2017-12-02 18:37:59 +01:00
|
|
|
(module
|
2018-02-04 07:51:40 +01:00
|
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
2017-12-30 05:11:58 +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-30 05:11:58 +01:00
|
|
|
(global $do/n (mut i32) (i32.const 10))
|
|
|
|
(global $do/m (mut i32) (i32.const 0))
|
|
|
|
(global $do/o (mut i32) (i32.const 0))
|
2018-02-14 09:18:43 +01:00
|
|
|
(global $HEAP_BASE i32 (i32.const 20))
|
2017-12-02 18:37:59 +01:00
|
|
|
(memory $0 1)
|
2018-02-14 09:18:43 +01:00
|
|
|
(data (i32.const 4) "\05\00\00\00d\00o\00.\00t\00s\00")
|
2017-12-02 18:37:59 +01:00
|
|
|
(export "memory" (memory $0))
|
2017-12-30 05:11:58 +01:00
|
|
|
(start $start)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $start (; 1 ;) (type $v)
|
2017-12-30 05:11:58 +01:00
|
|
|
(local $0 i32)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|0
|
|
|
|
(loop $continue|0
|
2017-12-30 05:11:58 +01:00
|
|
|
(block
|
2018-01-10 13:09:05 +01:00
|
|
|
(set_global $do/n
|
|
|
|
(i32.sub
|
|
|
|
(get_global $do/n)
|
|
|
|
(i32.const 1)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
)
|
2018-01-10 13:09:05 +01:00
|
|
|
(set_global $do/m
|
|
|
|
(i32.add
|
|
|
|
(get_global $do/m)
|
|
|
|
(i32.const 1)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br_if $continue|0
|
2017-12-30 05:11:58 +01:00
|
|
|
(get_global $do/n)
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-12-30 05:11:58 +01:00
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/n)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
)
|
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 7)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/m)
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
)
|
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 8)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
(set_global $do/n
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
(block $break|1
|
|
|
|
(loop $continue|1
|
|
|
|
(nop)
|
|
|
|
(br_if $continue|1
|
|
|
|
(block (result i32)
|
|
|
|
(set_local $0
|
|
|
|
(get_global $do/n)
|
|
|
|
)
|
|
|
|
(set_global $do/n
|
|
|
|
(i32.sub
|
|
|
|
(get_local $0)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(get_local $0)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/n)
|
2018-02-14 09:18:43 +01:00
|
|
|
(i32.const -1)
|
2017-12-30 05:11:58 +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-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
(set_global $do/n
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
(set_global $do/m
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(block $break|2
|
|
|
|
(loop $continue|2
|
2017-12-02 18:37:59 +01:00
|
|
|
(block
|
2018-01-10 13:09:05 +01:00
|
|
|
(set_global $do/n
|
|
|
|
(i32.sub
|
|
|
|
(get_global $do/n)
|
|
|
|
(i32.const 1)
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
|
|
|
)
|
2018-01-10 13:09:05 +01:00
|
|
|
(set_global $do/m
|
|
|
|
(i32.add
|
|
|
|
(get_global $do/m)
|
|
|
|
(i32.const 1)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
(block $break|3
|
|
|
|
(loop $continue|3
|
|
|
|
(block
|
2018-01-10 13:09:05 +01:00
|
|
|
(set_global $do/n
|
|
|
|
(i32.sub
|
|
|
|
(get_global $do/n)
|
|
|
|
(i32.const 1)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
)
|
2018-01-10 13:09:05 +01:00
|
|
|
(set_global $do/o
|
|
|
|
(i32.add
|
|
|
|
(get_global $do/o)
|
|
|
|
(i32.const 1)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(br_if $continue|3
|
|
|
|
(get_global $do/n)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/n)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
)
|
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 24)
|
|
|
|
(i32.const 2)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/o)
|
|
|
|
(i32.const 9)
|
2017-12-02 18:37:59 +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 25)
|
|
|
|
(i32.const 2)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
|
|
|
)
|
2017-12-30 05:11:58 +01:00
|
|
|
(br_if $continue|2
|
|
|
|
(get_global $do/n)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/n)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
)
|
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 27)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/m)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
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-30 05:11:58 +01:00
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $do/o)
|
|
|
|
(i32.const 9)
|
2017-12-02 18:37:59 +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 29)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-02 18:37:59 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|