2017-12-05 15:06:44 +01:00
|
|
|
(module
|
|
|
|
(type $v (func))
|
|
|
|
(global $for/i (mut i32) (i32.const 0))
|
2017-12-08 04:03:44 +01:00
|
|
|
(global $HEAP_START i32 (i32.const 4))
|
2017-12-05 15:06:44 +01:00
|
|
|
(memory $0 1)
|
|
|
|
(export "memory" (memory $0))
|
|
|
|
(start $start)
|
|
|
|
(func $start (; 0 ;) (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
|
|
|
|
(nop)
|
|
|
|
(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)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
2017-12-08 16:11:58 +01:00
|
|
|
(block $break|1
|
2017-12-05 22:47:20 +01:00
|
|
|
(block
|
|
|
|
(set_local $0
|
|
|
|
(i32.const 0)
|
|
|
|
)
|
|
|
|
)
|
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
|
|
|
|
(nop)
|
|
|
|
(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
|
|
|
)
|
|
|
|
(unreachable)
|
|
|
|
)
|
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
|
|
|
)
|
|
|
|
)
|
|
|
|
(;
|
|
|
|
[program.elements]
|
|
|
|
clz
|
|
|
|
ctz
|
|
|
|
popcnt
|
|
|
|
rotl
|
|
|
|
rotr
|
|
|
|
abs
|
|
|
|
ceil
|
|
|
|
copysign
|
|
|
|
floor
|
|
|
|
max
|
|
|
|
min
|
|
|
|
nearest
|
|
|
|
sqrt
|
|
|
|
trunc
|
|
|
|
current_memory
|
|
|
|
grow_memory
|
|
|
|
unreachable
|
|
|
|
load
|
|
|
|
store
|
|
|
|
reinterpret
|
|
|
|
select
|
|
|
|
sizeof
|
2017-12-08 04:03:44 +01:00
|
|
|
changetype
|
2017-12-05 15:06:44 +01:00
|
|
|
isNaN
|
|
|
|
isFinite
|
|
|
|
assert
|
2017-12-12 01:35:48 +01:00
|
|
|
parseInt
|
|
|
|
parseFloat
|
2017-12-15 15:00:19 +01:00
|
|
|
i8
|
|
|
|
i16
|
|
|
|
i32
|
|
|
|
i64
|
|
|
|
u8
|
|
|
|
u16
|
|
|
|
u32
|
|
|
|
u64
|
|
|
|
bool
|
|
|
|
f32
|
|
|
|
f64
|
|
|
|
isize
|
|
|
|
usize
|
2017-12-05 15:06:44 +01:00
|
|
|
for/i
|
|
|
|
[program.exports]
|
|
|
|
|
|
|
|
;)
|