2017-12-05 15:06:44 +01:00
|
|
|
(module
|
2018-02-04 07:51:40 +01:00
|
|
|
(type $iiiiv (func (param i32 i32 i32 i32)))
|
2017-12-05 15:06:44 +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-05 15:06:44 +01:00
|
|
|
(global $for/i (mut i32) (i32.const 0))
|
2018-02-04 07:51:40 +01:00
|
|
|
(global $HEAP_BASE i32 (i32.const 24))
|
2017-12-05 15:06:44 +01:00
|
|
|
(memory $0 1)
|
2018-02-04 07:51:40 +01: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)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:0
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|0
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:5
|
2017-12-05 15:06:44 +01:00
|
|
|
(set_global $for/i
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:9
|
2017-12-05 15:06:44 +01:00
|
|
|
(i32.const 0)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(loop $continue|0
|
2017-12-05 15:06:44 +01:00
|
|
|
(if
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:12
|
2017-12-05 15:06:44 +01:00
|
|
|
(i32.lt_s
|
|
|
|
(get_global $for/i)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:16
|
2017-12-05 15:06:44 +01:00
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
(block
|
2018-01-18 23:34:12 +01:00
|
|
|
(block
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:3:2
|
2018-01-18 23:34:12 +01:00
|
|
|
(nop)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:20
|
2017-12-05 15:06:44 +01:00
|
|
|
(set_global $for/i
|
|
|
|
(i32.add
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:2:22
|
2017-12-05 15:06:44 +01:00
|
|
|
(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
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:5:0
|
2017-12-05 15:06:44 +01:00
|
|
|
(if
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eqz
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:5:7
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eq
|
|
|
|
(get_global $for/i)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:5:12
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
|
|
|
(i32.const 8)
|
|
|
|
(i32.const 5)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:0
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|1
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:5
|
2018-01-18 23:34:12 +01:00
|
|
|
(set_local $0
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:18
|
2018-01-18 23:34:12 +01:00
|
|
|
(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
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:21
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.lt_s
|
|
|
|
(get_local $0)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:25
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.const 10)
|
|
|
|
)
|
|
|
|
(block
|
2018-01-18 23:34:12 +01:00
|
|
|
(block
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:8:2
|
2018-01-18 23:34:12 +01:00
|
|
|
(nop)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:29
|
2017-12-05 22:47:20 +01:00
|
|
|
(set_local $0
|
|
|
|
(i32.add
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:7:31
|
2017-12-05 22:47:20 +01:00
|
|
|
(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
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:11:0
|
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
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:11:7
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.gt_s
|
|
|
|
(get_global $for/i)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:11:11
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(block
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:11:18
|
2017-12-05 22:47:20 +01:00
|
|
|
(nop)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:11:14
|
2017-12-05 22:47:20 +01:00
|
|
|
(set_global $for/i
|
|
|
|
(i32.sub
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:11:16
|
2017-12-05 22:47:20 +01:00
|
|
|
(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
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:12:0
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
|
|
|
(i32.eqz
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:12:7
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eq
|
|
|
|
(get_global $for/i)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:12:12
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.const 0)
|
|
|
|
)
|
2017-12-05 15:06:44 +01:00
|
|
|
)
|
2018-02-04 07:51:40 +01:00
|
|
|
(block
|
|
|
|
(call $abort
|
|
|
|
(i32.const 0)
|
|
|
|
(i32.const 8)
|
|
|
|
(i32.const 12)
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-05 15:06:44 +01:00
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:14:0
|
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
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:15:2
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:15:6
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eq
|
|
|
|
(get_global $for/i)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:15:11
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.const 10)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:16:4
|
2017-12-08 16:11:58 +01:00
|
|
|
(br $break|3)
|
2017-12-05 22:47:20 +01:00
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:14:8
|
2017-12-05 22:47:20 +01:00
|
|
|
(set_global $for/i
|
|
|
|
(i32.add
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:14:10
|
2017-12-05 22:47:20 +01:00
|
|
|
(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
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:18:0
|
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
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:19:2
|
2017-12-05 22:47:20 +01:00
|
|
|
(if
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:19:6
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.eq
|
|
|
|
(block (result i32)
|
|
|
|
(set_global $for/i
|
|
|
|
(i32.sub
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:19:8
|
2017-12-05 22:47:20 +01:00
|
|
|
(get_global $for/i)
|
|
|
|
(i32.const 1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(get_global $for/i)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:19:13
|
2017-12-05 22:47:20 +01:00
|
|
|
(i32.const 0)
|
|
|
|
)
|
2018-02-02 03:07:54 +01:00
|
|
|
;;@ for.ts:20:4
|
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
|
|
|
)
|
|
|
|
)
|