2017-12-05 15:06:44 +01:00
|
|
|
(module
|
2018-05-06 05:46:35 +02:00
|
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
2017-12-05 15:06:44 +01:00
|
|
|
(type $v (func))
|
2018-05-21 18:48:29 +02:00
|
|
|
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
2017-12-05 15:06:44 +01:00
|
|
|
(global $for/i (mut i32) (i32.const 0))
|
2018-05-14 16:55:55 +02:00
|
|
|
(global $HEAP_BASE i32 (i32.const 24))
|
2017-12-05 15:06:44 +01:00
|
|
|
(memory $0 1)
|
2018-05-14 16:55:55 +02:00
|
|
|
(data (i32.const 8) "\06\00\00\00f\00o\00r\00.\00t\00s\00")
|
2017-12-05 15:06:44 +01:00
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
2018-02-04 07:51:40 +01:00
|
|
|
(func $start (; 1 ;) (type $v)
|
2017-12-05 22:47:20 +01:00
|
|
|
(local $0 i32)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|0
|
2017-12-05 15:06:44 +01:00
|
|
|
(set_global $for/i
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(loop $continue|0
|
2017-12-05 15:06:44 +01:00
|
|
|
(if
|
|
|
|
(i32.lt_s
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
(block
|
2018-05-06 05:46:35 +02:00
|
|
|
(nop)
|
2017-12-05 15:06:44 +01:00
|
|
|
(set_global $for/i
|
|
|
|
(i32.add
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $continue|0)
|
2017-12-05 15:06:44 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
2018-05-21 18:48:29 +02:00
|
|
|
(call $~lib/env/abort
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 0)
|
2018-05-14 16:55:55 +02:00
|
|
|
(i32.const 8)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 5)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|1
|
2018-01-18 23:34:12 +01:00
|
|
|
(set_local $0
|
|
|
|
(i32.const 0)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(loop $continue|1
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
|
|
|
(i32.lt_s
|
|
|
|
(get_local $0)
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
(block
|
2018-05-06 05:46:35 +02:00
|
|
|
(nop)
|
2017-12-05 22:47:20 +01:00
|
|
|
(set_local $0
|
|
|
|
(i32.add
|
|
|
|
(get_local $0)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $continue|1)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|2
|
2017-12-05 22:47:20 +01:00
|
|
|
(nop)
|
2017-12-08 16:11:58 +01:00
|
|
|
(loop $continue|2
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
|
|
|
(i32.gt_s
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(block
|
|
|
|
(nop)
|
|
|
|
(set_global $for/i
|
|
|
|
(i32.sub
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $continue|2)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(if
|
|
|
|
(i32.eqz
|
|
|
|
(i32.eq
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
2017-12-05 15:06:44 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
2018-05-21 18:48:29 +02:00
|
|
|
(call $~lib/env/abort
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 0)
|
2018-05-14 16:55:55 +02:00
|
|
|
(i32.const 8)
|
2018-02-04 07:51:40 +01:00
|
|
|
(i32.const 12)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-05 15:06:44 +01:00
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|3
|
2017-12-05 22:47:20 +01:00
|
|
|
(nop)
|
2017-12-08 16:11:58 +01:00
|
|
|
(loop $continue|3
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
|
|
|
(i32.const 1)
|
|
|
|
(block
|
|
|
|
(if
|
|
|
|
(i32.eq
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 10)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $break|3)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
|
|
|
(set_global $for/i
|
|
|
|
(i32.add
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $continue|3)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|4
|
2017-12-05 22:47:20 +01:00
|
|
|
(nop)
|
2017-12-08 16:11:58 +01:00
|
|
|
(loop $continue|4
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
|
|
|
(i32.const 1)
|
|
|
|
(block
|
|
|
|
(if
|
|
|
|
(i32.eq
|
|
|
|
(block (result i32)
|
|
|
|
(set_global $for/i
|
|
|
|
(i32.sub
|
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(get_global $for/i)
|
|
|
|
)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $break|4)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
|
|
|
(nop)
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $continue|4)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-12-05 15:06:44 +01:00
|
|
|
)
|
|
|
|
)
|