(module
 (type $0 (func (param i32 i64)))
 (type $1 (func (param f32)))
 (type $2 (func (param f64)))
 (memory $0 0)
 (func $test_div (; 0 ;) (type $0) (param $0 i32) (param $1 i64)
  (drop
   (call $i32s-div
    (get_local $0)
    (get_local $0)
   )
  )
  (drop
   (call $i32u-div
    (get_local $0)
    (get_local $0)
   )
  )
  (drop
   (call $i64s-div
    (get_local $1)
    (get_local $1)
   )
  )
  (drop
   (call $i64u-div
    (get_local $1)
    (get_local $1)
   )
  )
 )
 (func $test_rem (; 1 ;) (type $0) (param $0 i32) (param $1 i64)
  (drop
   (call $i32s-rem
    (get_local $0)
    (get_local $0)
   )
  )
  (drop
   (call $i32u-rem
    (get_local $0)
    (get_local $0)
   )
  )
  (drop
   (call $i64s-rem
    (get_local $1)
    (get_local $1)
   )
  )
  (drop
   (call $i64u-rem
    (get_local $1)
    (get_local $1)
   )
  )
 )
 (func $test_f32_to_int (; 2 ;) (type $1) (param $0 f32)
  (drop
   (call $f32-to-int
    (get_local $0)
   )
  )
  (drop
   (call $f32-to-uint
    (get_local $0)
   )
  )
  (drop
   (call $f32-to-int64
    (get_local $0)
   )
  )
  (drop
   (call $f32-to-uint64
    (get_local $0)
   )
  )
 )
 (func $test_f64_to_int (; 3 ;) (type $2) (param $0 f64)
  (drop
   (call $f64-to-int
    (get_local $0)
   )
  )
  (drop
   (call $f64-to-uint
    (get_local $0)
   )
  )
  (drop
   (call $f64-to-int64
    (get_local $0)
   )
  )
  (drop
   (call $f64-to-uint64
    (get_local $0)
   )
  )
 )
 (func $f32-to-int (; 4 ;) (param $0 f32) (result i32)
  (if (result i32)
   (f32.ne
    (get_local $0)
    (get_local $0)
   )
   (i32.const -2147483648)
   (if (result i32)
    (f32.ge
     (get_local $0)
     (f32.const 2147483648)
    )
    (i32.const -2147483648)
    (if (result i32)
     (f32.le
      (get_local $0)
      (f32.const -2147483648)
     )
     (i32.const -2147483648)
     (i32.trunc_s/f32
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f32-to-int64 (; 5 ;) (param $0 f32) (result i64)
  (if (result i64)
   (f32.ne
    (get_local $0)
    (get_local $0)
   )
   (i64.const -9223372036854775808)
   (if (result i64)
    (f32.ge
     (get_local $0)
     (f32.const 9223372036854775808)
    )
    (i64.const -9223372036854775808)
    (if (result i64)
     (f32.le
      (get_local $0)
      (f32.const -9223372036854775808)
     )
     (i64.const -9223372036854775808)
     (i64.trunc_s/f32
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f32-to-uint (; 6 ;) (param $0 f32) (result i32)
  (if (result i32)
   (f32.ne
    (get_local $0)
    (get_local $0)
   )
   (i32.const 0)
   (if (result i32)
    (f32.ge
     (get_local $0)
     (f32.const 4294967296)
    )
    (i32.const 0)
    (if (result i32)
     (f32.le
      (get_local $0)
      (f32.const -1)
     )
     (i32.const 0)
     (i32.trunc_u/f32
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f32-to-uint64 (; 7 ;) (param $0 f32) (result i64)
  (if (result i64)
   (f32.ne
    (get_local $0)
    (get_local $0)
   )
   (i64.const 0)
   (if (result i64)
    (f32.ge
     (get_local $0)
     (f32.const 18446744073709551615)
    )
    (i64.const 0)
    (if (result i64)
     (f32.le
      (get_local $0)
      (f32.const -1)
     )
     (i64.const 0)
     (i64.trunc_u/f32
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f64-to-int (; 8 ;) (param $0 f64) (result i32)
  (if (result i32)
   (f64.ne
    (get_local $0)
    (get_local $0)
   )
   (i32.const -2147483648)
   (if (result i32)
    (f64.ge
     (get_local $0)
     (f64.const 2147483648)
    )
    (i32.const -2147483648)
    (if (result i32)
     (f64.le
      (get_local $0)
      (f64.const -2147483649)
     )
     (i32.const -2147483648)
     (i32.trunc_s/f64
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f64-to-int64 (; 9 ;) (param $0 f64) (result i64)
  (if (result i64)
   (f64.ne
    (get_local $0)
    (get_local $0)
   )
   (i64.const -9223372036854775808)
   (if (result i64)
    (f64.ge
     (get_local $0)
     (f64.const 9223372036854775808)
    )
    (i64.const -9223372036854775808)
    (if (result i64)
     (f64.le
      (get_local $0)
      (f64.const -9223372036854775808)
     )
     (i64.const -9223372036854775808)
     (i64.trunc_s/f64
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f64-to-uint (; 10 ;) (param $0 f64) (result i32)
  (if (result i32)
   (f64.ne
    (get_local $0)
    (get_local $0)
   )
   (i32.const 0)
   (if (result i32)
    (f64.ge
     (get_local $0)
     (f64.const 4294967296)
    )
    (i32.const 0)
    (if (result i32)
     (f64.le
      (get_local $0)
      (f64.const -1)
     )
     (i32.const 0)
     (i32.trunc_u/f64
      (get_local $0)
     )
    )
   )
  )
 )
 (func $f64-to-uint64 (; 11 ;) (param $0 f64) (result i64)
  (if (result i64)
   (f64.ne
    (get_local $0)
    (get_local $0)
   )
   (i64.const 0)
   (if (result i64)
    (f64.ge
     (get_local $0)
     (f64.const 18446744073709551615)
    )
    (i64.const 0)
    (if (result i64)
     (f64.le
      (get_local $0)
      (f64.const -1)
     )
     (i64.const 0)
     (i64.trunc_u/f64
      (get_local $0)
     )
    )
   )
  )
 )
 (func $i32s-div (; 12 ;) (param $0 i32) (param $1 i32) (result i32)
  (if (result i32)
   (i32.eqz
    (get_local $1)
   )
   (i32.const 0)
   (if (result i32)
    (i32.and
     (i32.eq
      (get_local $0)
      (i32.const -2147483648)
     )
     (i32.eq
      (get_local $1)
      (i32.const -1)
     )
    )
    (i32.const 0)
    (i32.div_s
     (get_local $0)
     (get_local $1)
    )
   )
  )
 )
 (func $i32s-rem (; 13 ;) (param $0 i32) (param $1 i32) (result i32)
  (if (result i32)
   (i32.eqz
    (get_local $1)
   )
   (i32.const 0)
   (i32.rem_s
    (get_local $0)
    (get_local $1)
   )
  )
 )
 (func $i32u-div (; 14 ;) (param $0 i32) (param $1 i32) (result i32)
  (if (result i32)
   (i32.eqz
    (get_local $1)
   )
   (i32.const 0)
   (i32.div_u
    (get_local $0)
    (get_local $1)
   )
  )
 )
 (func $i32u-rem (; 15 ;) (param $0 i32) (param $1 i32) (result i32)
  (if (result i32)
   (i32.eqz
    (get_local $1)
   )
   (i32.const 0)
   (i32.rem_u
    (get_local $0)
    (get_local $1)
   )
  )
 )
 (func $i64s-div (; 16 ;) (param $0 i64) (param $1 i64) (result i64)
  (if (result i64)
   (i64.eqz
    (get_local $1)
   )
   (i64.const 0)
   (if (result i64)
    (i32.and
     (i64.eq
      (get_local $0)
      (i64.const -9223372036854775808)
     )
     (i64.eq
      (get_local $1)
      (i64.const -1)
     )
    )
    (i64.const 0)
    (i64.div_s
     (get_local $0)
     (get_local $1)
    )
   )
  )
 )
 (func $i64s-rem (; 17 ;) (param $0 i64) (param $1 i64) (result i64)
  (if (result i64)
   (i64.eqz
    (get_local $1)
   )
   (i64.const 0)
   (i64.rem_s
    (get_local $0)
    (get_local $1)
   )
  )
 )
 (func $i64u-div (; 18 ;) (param $0 i64) (param $1 i64) (result i64)
  (if (result i64)
   (i64.eqz
    (get_local $1)
   )
   (i64.const 0)
   (i64.div_u
    (get_local $0)
    (get_local $1)
   )
  )
 )
 (func $i64u-rem (; 19 ;) (param $0 i64) (param $1 i64) (result i64)
  (if (result i64)
   (i64.eqz
    (get_local $1)
   )
   (i64.const 0)
   (i64.rem_u
    (get_local $0)
    (get_local $1)
   )
  )
 )
)
