2017-12-02 18:37:59 +01:00
|
|
|
(module
|
2019-03-01 00:01:23 +01:00
|
|
|
(type $FUNCSIG$ii (func (param i32) (result i32)))
|
|
|
|
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
|
|
|
|
(type $FUNCSIG$v (func))
|
2018-11-08 08:04:24 +01:00
|
|
|
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
2017-12-02 18:37:59 +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\00")
|
2019-02-05 17:12:10 +01:00
|
|
|
(table $0 1 funcref)
|
2018-10-11 08:49:08 +02:00
|
|
|
(elem (i32.const 0) $null)
|
2019-02-21 00:11:22 +01:00
|
|
|
(global $~lib/memory/HEAP_BASE i32 (i32.const 24))
|
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-02 23:33:01 +01:00
|
|
|
(export "ifThenElse" (func $if/ifThenElse))
|
|
|
|
(export "ifThen" (func $if/ifThen))
|
|
|
|
(export "ifThenElseBlock" (func $if/ifThenElseBlock))
|
2018-01-19 04:16:18 +01:00
|
|
|
(export "ifAlwaysReturns" (func $if/ifAlwaysReturns))
|
2018-01-12 15:36:17 +01:00
|
|
|
(start $start)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $if/ifThenElse (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
else
|
|
|
|
i32.const 0
|
|
|
|
return
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
unreachable
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $if/ifThen (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
end
|
|
|
|
i32.const 0
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $if/ifThenElseBlock (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-02-05 17:12:10 +01:00
|
|
|
local.get $0
|
2018-11-08 08:04:24 +01:00
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
else
|
|
|
|
i32.const 0
|
|
|
|
return
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
unreachable
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start:if (; 4 ;) (type $FUNCSIG$v)
|
2018-11-08 08:04:24 +01:00
|
|
|
i32.const 0
|
|
|
|
call $if/ifThenElse
|
|
|
|
i32.const 0
|
|
|
|
i32.eq
|
|
|
|
i32.eqz
|
|
|
|
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.eq
|
|
|
|
i32.eqz
|
|
|
|
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
|
|
|
|
i32.const 0
|
|
|
|
i32.eq
|
|
|
|
i32.eqz
|
|
|
|
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.eq
|
|
|
|
i32.eqz
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 18
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 0
|
|
|
|
call $if/ifThenElseBlock
|
|
|
|
i32.const 0
|
|
|
|
i32.eq
|
|
|
|
i32.eqz
|
|
|
|
if
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 30
|
|
|
|
i32.const 0
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
i32.const 1
|
|
|
|
call $if/ifThenElseBlock
|
|
|
|
i32.const 1
|
|
|
|
i32.eq
|
|
|
|
i32.eqz
|
|
|
|
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
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $if/ifAlwaysReturns (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
2019-02-21 00:11:22 +01:00
|
|
|
local.get $0
|
|
|
|
if
|
|
|
|
i32.const 1
|
|
|
|
return
|
|
|
|
else
|
|
|
|
i32.const 0
|
|
|
|
i32.const 8
|
|
|
|
i32.const 37
|
|
|
|
i32.const 4
|
|
|
|
call $~lib/env/abort
|
|
|
|
unreachable
|
|
|
|
end
|
|
|
|
unreachable
|
|
|
|
unreachable
|
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $start (; 6 ;) (type $FUNCSIG$v)
|
2019-02-21 00:11:22 +01:00
|
|
|
call $start:if
|
|
|
|
)
|
2019-03-01 00:01:23 +01:00
|
|
|
(func $null (; 7 ;) (type $FUNCSIG$v)
|
2018-09-17 01:48:35 +02:00
|
|
|
)
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|