2017-12-04 16:26:34 +01:00
|
|
|
(module
|
2018-02-04 07:51:40 +01:00
|
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
2017-12-04 16:26:34 +01:00
|
|
|
(type $v (func))
|
2018-02-04 07:51:40 +01:00
|
|
|
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
|
2017-12-04 19:26:50 +01:00
|
|
|
(global $logical/i (mut i32) (i32.const 0))
|
|
|
|
(global $logical/I (mut i64) (i64.const 0))
|
|
|
|
(global $logical/f (mut f32) (f32.const 0))
|
|
|
|
(global $logical/F (mut f64) (f64.const 0))
|
2018-02-14 09:18:43 +01:00
|
|
|
(global $HEAP_BASE i32 (i32.const 28))
|
2017-12-04 16:26:34 +01:00
|
|
|
(memory $0 1)
|
2018-02-14 09:18:43 +01:00
|
|
|
(data (i32.const 4) "\n\00\00\00l\00o\00g\00i\00c\00a\00l\00.\00t\00s\00")
|
2017-12-04 16:26:34 +01:00
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $start (; 1 ;) (type $v)
|
2017-12-04 16:26:34 +01:00
|
|
|
(local $0 i32)
|
|
|
|
(local $1 f64)
|
|
|
|
(drop
|
|
|
|
(if (result i32)
|
2018-02-28 01:48:01 +01:00
|
|
|
(i32.const 0)
|
2017-12-04 16:26:34 +01:00
|
|
|
(unreachable)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i32.const 0)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(if (result f64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f64.const 0)
|
2017-12-04 16:26:34 +01:00
|
|
|
(f64.const 0)
|
|
|
|
)
|
2018-01-10 23:19:14 +01:00
|
|
|
(unreachable)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.const 0)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(if (result i32)
|
2018-02-28 01:48:01 +01:00
|
|
|
(i32.const 1)
|
2018-01-10 23:19:14 +01:00
|
|
|
(i32.const 1)
|
2018-01-12 15:36:17 +01:00
|
|
|
(unreachable)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(if (result f64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f64.const 1)
|
2017-12-04 16:26:34 +01:00
|
|
|
(f64.const 0)
|
|
|
|
)
|
2018-01-10 23:19:14 +01:00
|
|
|
(f64.const 1)
|
2018-01-12 15:36:17 +01:00
|
|
|
(unreachable)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(if (result i32)
|
2018-02-28 01:48:01 +01:00
|
|
|
(tee_local $0
|
|
|
|
(if (result i32)
|
|
|
|
(i32.const 1)
|
|
|
|
(i32.const 2)
|
|
|
|
(i32.const 1)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
2018-01-10 23:19:14 +01:00
|
|
|
(get_local $0)
|
2018-01-12 15:36:17 +01:00
|
|
|
(unreachable)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(drop
|
|
|
|
(if (result f64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.ne
|
2017-12-12 09:38:20 +01:00
|
|
|
(tee_local $1
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result f64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f64.const 1)
|
2017-12-04 16:26:34 +01:00
|
|
|
(f64.const 0)
|
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(f64.const 2)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.const 1)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(f64.const 0)
|
|
|
|
)
|
2018-01-10 23:19:14 +01:00
|
|
|
(get_local $1)
|
2018-01-12 15:36:17 +01:00
|
|
|
(unreachable)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
(set_global $logical/i
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result i32)
|
2018-02-28 01:48:01 +01:00
|
|
|
(i32.const 1)
|
2018-01-12 05:03:25 +01:00
|
|
|
(i32.const 2)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i32.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $logical/i)
|
|
|
|
(i32.const 2)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 12)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/i
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result i32)
|
2018-02-28 01:48:01 +01:00
|
|
|
(i32.const 0)
|
2018-01-12 05:03:25 +01:00
|
|
|
(i32.const 0)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i32.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $logical/i)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 15)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/I
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result i64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i64.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(i64.const 1)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i64.const 0)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(i64.const 2)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i64.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(i64.eq
|
|
|
|
(get_global $logical/I)
|
|
|
|
(i64.const 2)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 20)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/I
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result i64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i64.ne
|
|
|
|
(i64.const 0)
|
2017-12-04 19:26:50 +01:00
|
|
|
(i64.const 0)
|
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(i64.const 0)
|
2018-01-12 15:36:17 +01:00
|
|
|
(i64.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(i64.eq
|
|
|
|
(get_global $logical/I)
|
|
|
|
(i64.const 1)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 23)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/f
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result f32)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f32.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f32.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
(f32.const 0)
|
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(f32.const 2)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f32.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(f32.eq
|
|
|
|
(get_global $logical/f)
|
|
|
|
(f32.const 2)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 28)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/f
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result f32)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f32.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f32.const 0)
|
2017-12-04 19:26:50 +01:00
|
|
|
(f32.const 0)
|
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(f32.const 0)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f32.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(f32.eq
|
|
|
|
(get_global $logical/f)
|
|
|
|
(f32.const 1)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 31)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/F
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result f64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f64.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
(f64.const 0)
|
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(f64.const 2)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(f64.eq
|
|
|
|
(get_global $logical/F)
|
|
|
|
(f64.const 2)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 36)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
(set_global $logical/F
|
2018-01-12 05:03:25 +01:00
|
|
|
(if (result f64)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.ne
|
2017-12-29 04:38:39 +01:00
|
|
|
(f64.const 0)
|
2017-12-04 19:26:50 +01:00
|
|
|
(f64.const 0)
|
|
|
|
)
|
2018-01-12 05:03:25 +01:00
|
|
|
(f64.const 0)
|
2018-01-12 15:36:17 +01:00
|
|
|
(f64.const 1)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(f64.eq
|
|
|
|
(get_global $logical/F)
|
|
|
|
(f64.const 1)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const 4)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 39)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-04 19:26:50 +01:00
|
|
|
)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
|
|
|
)
|