2017-12-04 16:26:34 +01:00
|
|
|
(module
|
|
|
|
(type $ii (func (param i32) (result i32)))
|
2018-02-04 07:51:40 +01:00
|
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
2018-01-12 15:36:17 +01:00
|
|
|
(type $v (func))
|
2018-11-08 08:04:24 +01:00
|
|
|
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
2017-12-04 16:26:34 +01:00
|
|
|
(memory $0 1)
|
2018-05-14 16:55:55 +02:00
|
|
|
(data (i32.const 8) "\05\00\00\00i\00f\00.\00t\00s")
|
2018-11-08 08:04:24 +01:00
|
|
|
(table $0 1 anyfunc)
|
2018-10-11 08:49:08 +02:00
|
|
|
(elem (i32.const 0) $null)
|
2018-07-18 23:49:32 +02:00
|
|
|
(export "memory" (memory $0))
|
2018-10-11 08:49:08 +02:00
|
|
|
(export "table" (table $0))
|
2017-12-04 16:26:34 +01:00
|
|
|
(export "ifThenElse" (func $if/ifThenElse))
|
|
|
|
(export "ifThen" (func $if/ifThen))
|
|
|
|
(export "ifThenElseBlock" (func $if/ifThenElse))
|
2018-01-19 04:16:18 +01:00
|
|
|
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
|
2018-01-12 15:36:17 +01:00
|
|
|
(start $start)
|
2018-11-08 08:04:24 +01:00
|
|
|
(func $if/ifThenElse (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
|
|
|
get_local $0
|
|
|
|
if (result i32)
|
|
|
|
i32.const 1
|
|
|
|
else
|
|
|
|
i32.const 0
|
|
|
|
end
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
2018-11-08 08:04:24 +01:00
|
|
|
(func $if/ifThen (; 2 ;) (type $ii) (param $0 i32) (result i32)
|
|
|
|
get_local $0
|
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
end
|
|
|
|
i32.const 0
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|
2018-11-08 08:04:24 +01:00
|
|
|
(func $if/ifAlwaysReturns (; 3 ;) (type $ii) (param $0 i32) (result i32)
|
|
|
|
get_local $0
|
|
|
|
if (result i32)
|
|
|
|
i32.const 1
|
|
|
|
else
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 37
|
|
|
|
i32.const 4
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
2018-01-19 04:16:18 +01:00
|
|
|
)
|
2018-11-08 08:04:24 +01:00
|
|
|
(func $start (; 4 ;) (type $v)
|
|
|
|
i32.const 0
|
|
|
|
call $if/ifThenElse
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 8
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
call $if/ifThenElse
|
|
|
|
i32.const 1
|
|
|
|
i32.ne
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 9
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 0
|
|
|
|
call $if/ifThen
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 17
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
call $if/ifThen
|
|
|
|
i32.const 1
|
|
|
|
i32.ne
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 18
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 0
|
|
|
|
call $if/ifThenElse
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 30
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
call $if/ifThenElse
|
|
|
|
i32.const 1
|
|
|
|
i32.ne
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 31
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
2018-01-12 15:36:17 +01:00
|
|
|
)
|
2018-11-08 08:04:24 +01:00
|
|
|
(func $null (; 5 ;) (type $v)
|
|
|
|
nop
|
2018-09-17 01:48:35 +02:00
|
|
|
)
|
2017-12-04 16:26:34 +01:00
|
|
|
)
|