2018-06-27 19:03:39 +02:00
|
|
|
(module
|
|
|
|
(type $iii (func (param i32 i32) (result i32)))
|
|
|
|
(type $v (func))
|
|
|
|
(global $main/code (mut i32) (i32.const 0))
|
2018-07-20 16:49:27 +02:00
|
|
|
(global $~started (mut i32) (i32.const 0))
|
2018-06-27 19:03:39 +02:00
|
|
|
(global $HEAP_BASE i32 (i32.const 8))
|
2018-09-17 01:48:35 +02:00
|
|
|
(table 1 1 anyfunc)
|
|
|
|
(elem (i32.const 0) $null)
|
2018-06-28 01:44:32 +02:00
|
|
|
(memory $0 0)
|
2018-06-27 19:03:39 +02:00
|
|
|
(export "memory" (memory $0))
|
2018-07-18 23:49:32 +02:00
|
|
|
(export "main" (func $main/main))
|
2018-06-27 19:03:39 +02:00
|
|
|
(func $main/main (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
2018-07-20 16:49:27 +02:00
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(get_global $~started)
|
|
|
|
)
|
|
|
|
(block
|
|
|
|
(call $start)
|
|
|
|
(set_global $~started
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-06-27 19:03:39 +02:00
|
|
|
(get_global $main/code)
|
|
|
|
)
|
|
|
|
(func $start (; 1 ;) (type $v)
|
|
|
|
(set_global $main/code
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
2018-09-17 01:48:35 +02:00
|
|
|
(func $null (; 2 ;) (type $v)
|
|
|
|
)
|
2018-06-27 19:03:39 +02:00
|
|
|
)
|