Skip to content

Instantly share code, notes, and snippets.

@willemneal
Created February 8, 2019 21:51
Show Gist options
  • Save willemneal/da038a47bb33c4cf25b822cb3d3bdbda to your computer and use it in GitHub Desktop.
Save willemneal/da038a47bb33c4cf25b822cb3d3bdbda to your computer and use it in GitHub Desktop.
Main Function wat file
(module
(type $t0 (func))
(type $t1 (func (param i32 i32) (result i32)))
(type $t2 (func (result i32)))
(type $t3 (func (param i32 i32 i32) (result i32)))
(type $t4 (func (param i32 i32 i32 i32)))
(type $t5 (func (param i32) (result i32)))
(type $t6 (func (param i32 i32 i32)))
(type $t7 (func (param i32 i32 i32 i32 i32) (result i32)))
(type $t8 (func (param i32 i32 i32 i32 i32)))
(type $t9 (func (param i32)))
(import "main" "sayHello" (func $main.sayHello (type $t0)))
(import "env" "abort" (func $env.abort (type $t4)))
(func $add (export "add") (type $t1) (param $p0 i32) (param $p1 i32) (result i32)
get_local $p0
get_local $p1
i32.add)
(func $f3 (type $t5) (param $p0 i32) (result i32)
i32.const 1
i32.const 32
get_local $p0
get_global $g4
i32.add
i32.const 1
i32.sub
i32.clz
i32.sub
i32.shl)
(func $f4 (type $t5) (param $p0 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i32)
get_local $p0
get_global $g3
i32.gt_u
if $I0
unreachable
end
get_global $g17
set_local $l0
get_local $l0
get_local $p0
tee_local $l1
i32.const 1
tee_local $l2
get_local $l1
get_local $l2
i32.gt_u
select
i32.add
get_global $g2
i32.add
get_global $g2
i32.const -1
i32.xor
i32.and
set_local $l3
current_memory
set_local $l4
get_local $l3
get_local $l4
i32.const 16
i32.shl
i32.gt_u
if $I1
get_local $l3
get_local $l0
i32.sub
i32.const 65535
i32.add
i32.const 65535
i32.const -1
i32.xor
i32.and
i32.const 16
i32.shr_u
set_local $l1
get_local $l4
tee_local $l2
get_local $l1
tee_local $l5
get_local $l2
get_local $l5
i32.gt_s
select
set_local $l2
get_local $l2
grow_memory
i32.const 0
i32.lt_s
if $I2
get_local $l1
grow_memory
i32.const 0
i32.lt_s
if $I3
unreachable
end
end
end
get_local $l3
set_global $g17
get_local $l0)
(func $f5 (type $t5) (param $p0 i32) (result i32)
(local $l0 i32) (local $l1 i32)
get_local $p0
get_global $g5
i32.le_u
i32.eqz
if $I0
i32.const 0
i32.const 144
i32.const 26
i32.const 2
call $env.abort
unreachable
end
block $B1 (result i32)
get_local $p0
call $f3
set_local $l1
get_local $l1
call $f4
br $B1
end
set_local $l0
get_local $l0
get_local $p0
i32.store
get_local $l0)
(func $f6 (type $t5) (param $p0 i32) (result i32)
get_local $p0
call $f4
return)
(func $f7 (type $t6) (param $p0 i32) (param $p1 i32) (param $p2 i32)
(local $l0 i32) (local $l1 i32) (local $l2 i64)
get_local $p2
i32.eqz
if $I0
return
end
get_local $p0
get_local $p1
i32.store8
get_local $p0
get_local $p2
i32.add
i32.const 1
i32.sub
get_local $p1
i32.store8
get_local $p2
i32.const 2
i32.le_u
if $I1
return
end
get_local $p0
i32.const 1
i32.add
get_local $p1
i32.store8
get_local $p0
i32.const 2
i32.add
get_local $p1
i32.store8
get_local $p0
get_local $p2
i32.add
i32.const 2
i32.sub
get_local $p1
i32.store8
get_local $p0
get_local $p2
i32.add
i32.const 3
i32.sub
get_local $p1
i32.store8
get_local $p2
i32.const 6
i32.le_u
if $I2
return
end
get_local $p0
i32.const 3
i32.add
get_local $p1
i32.store8
get_local $p0
get_local $p2
i32.add
i32.const 4
i32.sub
get_local $p1
i32.store8
get_local $p2
i32.const 8
i32.le_u
if $I3
return
end
i32.const 0
get_local $p0
i32.sub
i32.const 3
i32.and
set_local $l0
get_local $p0
get_local $l0
i32.add
set_local $p0
get_local $p2
get_local $l0
i32.sub
set_local $p2
get_local $p2
i32.const -4
i32.and
set_local $p2
i32.const -1
i32.const 255
i32.div_u
get_local $p1
i32.const 255
i32.and
i32.mul
set_local $l1
get_local $p0
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 4
i32.sub
get_local $l1
i32.store
get_local $p2
i32.const 8
i32.le_u
if $I4
return
end
get_local $p0
i32.const 4
i32.add
get_local $l1
i32.store
get_local $p0
i32.const 8
i32.add
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 12
i32.sub
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 8
i32.sub
get_local $l1
i32.store
get_local $p2
i32.const 24
i32.le_u
if $I5
return
end
get_local $p0
i32.const 12
i32.add
get_local $l1
i32.store
get_local $p0
i32.const 16
i32.add
get_local $l1
i32.store
get_local $p0
i32.const 20
i32.add
get_local $l1
i32.store
get_local $p0
i32.const 24
i32.add
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 28
i32.sub
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 24
i32.sub
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 20
i32.sub
get_local $l1
i32.store
get_local $p0
get_local $p2
i32.add
i32.const 16
i32.sub
get_local $l1
i32.store
i32.const 24
get_local $p0
i32.const 4
i32.and
i32.add
set_local $l0
get_local $p0
get_local $l0
i32.add
set_local $p0
get_local $p2
get_local $l0
i32.sub
set_local $p2
get_local $l1
i64.extend_u/i32
get_local $l1
i64.extend_u/i32
i64.const 32
i64.shl
i64.or
set_local $l2
block $B6
loop $L7
get_local $p2
i32.const 32
i32.ge_u
if $I8
block $B9
get_local $p0
get_local $l2
i64.store
get_local $p0
i32.const 8
i32.add
get_local $l2
i64.store
get_local $p0
i32.const 16
i32.add
get_local $l2
i64.store
get_local $p0
i32.const 24
i32.add
get_local $l2
i64.store
get_local $p2
i32.const 32
i32.sub
set_local $p2
get_local $p0
i32.const 32
i32.add
set_local $p0
end
br $L7
end
end
end)
(func $f8 (type $t1) (param $p0 i32) (param $p1 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32)
get_local $p1
i32.const 268435454
i32.gt_u
if $I0
i32.const 0
i32.const 112
i32.const 45
i32.const 39
call $env.abort
unreachable
end
get_local $p1
i32.const 2
i32.shl
set_local $l0
get_local $l0
call $f5
set_local $l1
get_local $p0
if $I1 (result i32)
get_local $p0
else
block $B2 (result i32)
i32.const 8
call $f6
set_local $l2
get_local $l2
i32.const 0
i32.store
get_local $l2
i32.const 0
i32.store offset=4
get_local $l2
end
tee_local $p0
end
tee_local $p0
get_local $l1
i32.store
get_local $p0
get_local $p1
i32.store offset=4
get_local $l1
get_global $g4
i32.add
set_local $l2
i32.const 0
set_local $l3
get_local $l2
get_local $l3
get_local $l0
call $f7
get_local $p0)
(func $f9 (type $t6) (param $p0 i32) (param $p1 i32) (param $p2 i32)
(local $l0 i32) (local $l1 i32)
get_local $p0
i32.load
set_local $l0
i32.const 0
set_local $l1
get_local $l0
get_local $p1
i32.const 2
i32.shl
i32.add
get_local $l1
i32.add
get_local $p2
i32.store offset=8)
(func $f10 (type $t5) (param $p0 i32) (result i32)
(local $l0 i32) (local $l1 i32)
get_local $p0
i32.const 0
i32.gt_s
tee_local $l0
if $I0 (result i32)
get_local $p0
get_global $g7
i32.le_s
else
get_local $l0
end
i32.eqz
if $I1
i32.const 0
i32.const 208
i32.const 14
i32.const 2
call $env.abort
unreachable
end
block $B2 (result i32)
get_global $g6
get_local $p0
i32.const 1
i32.shl
i32.add
set_local $l0
get_local $l0
call $f4
br $B2
end
set_local $l1
get_local $l1
get_local $p0
i32.store
get_local $l1)
(func $f11 (type $t1) (param $p0 i32) (param $p1 i32) (result i32)
(local $l0 i32) (local $l1 i32)
get_local $p0
i32.load
set_local $l0
i32.const 0
set_local $l1
get_local $l0
get_local $p1
i32.const 2
i32.shl
i32.add
get_local $l1
i32.add
i32.load offset=8)
(func $f12 (type $t7) (param $p0 i32) (param $p1 i32) (param $p2 i32) (param $p3 i32) (param $p4 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32)
i32.const 0
set_local $l0
get_local $p0
get_local $p1
i32.const 1
i32.shl
i32.add
set_local $l1
get_local $p2
get_local $p3
i32.const 1
i32.shl
i32.add
set_local $l2
block $B0
loop $L1
get_local $p4
if $I2 (result i32)
get_local $l1
i32.load16_u offset=4
get_local $l2
i32.load16_u offset=4
i32.sub
tee_local $l0
i32.eqz
else
get_local $p4
end
if $I3
block $B4
get_local $p4
i32.const 1
i32.sub
set_local $p4
get_local $l1
i32.const 2
i32.add
set_local $l1
get_local $l2
i32.const 2
i32.add
set_local $l2
end
br $L1
end
end
end
get_local $l0)
(func $f13 (type $t3) (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32)
get_local $p0
i32.const 0
i32.ne
i32.eqz
if $I0
i32.const 0
i32.const 80
i32.const 213
i32.const 4
call $env.abort
unreachable
end
get_local $p1
i32.const 0
i32.eq
if $I1
i32.const 272
set_local $p1
end
get_local $p1
i32.load
set_local $l0
get_local $l0
i32.eqz
if $I2
i32.const 0
return
end
get_local $p0
i32.load
set_local $l1
get_local $l1
i32.eqz
if $I3
i32.const -1
return
end
get_local $p2
tee_local $l2
i32.const 0
tee_local $l3
get_local $l2
get_local $l3
i32.gt_s
select
tee_local $l2
get_local $l1
tee_local $l3
get_local $l2
get_local $l3
i32.lt_s
select
set_local $l4
get_local $l1
get_local $l0
i32.sub
set_local $l1
block $B4
get_local $l4
set_local $l2
loop $L5
get_local $l2
get_local $l1
i32.le_s
i32.eqz
br_if $B4
get_local $p0
get_local $l2
get_local $p1
i32.const 0
get_local $l0
call $f12
i32.eqz
if $I6
get_local $l2
return
end
get_local $l2
i32.const 1
i32.add
set_local $l2
br $L5
unreachable
end
unreachable
end
i32.const -1)
(func $f14 (type $t6) (param $p0 i32) (param $p1 i32) (param $p2 i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32)
block $B0
loop $L1
get_local $p2
if $I2 (result i32)
get_local $p1
i32.const 3
i32.and
else
get_local $p2
end
if $I3
block $B4
block $B5 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B6 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
get_local $p2
i32.const 1
i32.sub
set_local $p2
end
br $L1
end
end
end
get_local $p0
i32.const 3
i32.and
i32.const 0
i32.eq
if $I7
block $B8
loop $L9
get_local $p2
i32.const 16
i32.ge_u
if $I10
block $B11
get_local $p0
get_local $p1
i32.load
i32.store
get_local $p0
i32.const 4
i32.add
get_local $p1
i32.const 4
i32.add
i32.load
i32.store
get_local $p0
i32.const 8
i32.add
get_local $p1
i32.const 8
i32.add
i32.load
i32.store
get_local $p0
i32.const 12
i32.add
get_local $p1
i32.const 12
i32.add
i32.load
i32.store
get_local $p1
i32.const 16
i32.add
set_local $p1
get_local $p0
i32.const 16
i32.add
set_local $p0
get_local $p2
i32.const 16
i32.sub
set_local $p2
end
br $L9
end
end
end
get_local $p2
i32.const 8
i32.and
if $I12
get_local $p0
get_local $p1
i32.load
i32.store
get_local $p0
i32.const 4
i32.add
get_local $p1
i32.const 4
i32.add
i32.load
i32.store
get_local $p0
i32.const 8
i32.add
set_local $p0
get_local $p1
i32.const 8
i32.add
set_local $p1
end
get_local $p2
i32.const 4
i32.and
if $I13
get_local $p0
get_local $p1
i32.load
i32.store
get_local $p0
i32.const 4
i32.add
set_local $p0
get_local $p1
i32.const 4
i32.add
set_local $p1
end
get_local $p2
i32.const 2
i32.and
if $I14
get_local $p0
get_local $p1
i32.load16_u
i32.store16
get_local $p0
i32.const 2
i32.add
set_local $p0
get_local $p1
i32.const 2
i32.add
set_local $p1
end
get_local $p2
i32.const 1
i32.and
if $I15
block $B16 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B17 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
end
return
end
get_local $p2
i32.const 32
i32.ge_u
if $I18
block $B19
block $B20
block $B21
block $B22
get_local $p0
i32.const 3
i32.and
set_local $l2
get_local $l2
i32.const 1
i32.eq
br_if $B22
get_local $l2
i32.const 2
i32.eq
br_if $B21
get_local $l2
i32.const 3
i32.eq
br_if $B20
br $B19
end
block $B23
get_local $p1
i32.load
set_local $l0
block $B24 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B25 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B26 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B27 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B28 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B29 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
get_local $p2
i32.const 3
i32.sub
set_local $p2
block $B30
loop $L31
get_local $p2
i32.const 17
i32.ge_u
if $I32
block $B33
get_local $p1
i32.const 1
i32.add
i32.load
set_local $l1
get_local $p0
get_local $l0
i32.const 24
i32.shr_u
get_local $l1
i32.const 8
i32.shl
i32.or
i32.store
get_local $p1
i32.const 5
i32.add
i32.load
set_local $l0
get_local $p0
i32.const 4
i32.add
get_local $l1
i32.const 24
i32.shr_u
get_local $l0
i32.const 8
i32.shl
i32.or
i32.store
get_local $p1
i32.const 9
i32.add
i32.load
set_local $l1
get_local $p0
i32.const 8
i32.add
get_local $l0
i32.const 24
i32.shr_u
get_local $l1
i32.const 8
i32.shl
i32.or
i32.store
get_local $p1
i32.const 13
i32.add
i32.load
set_local $l0
get_local $p0
i32.const 12
i32.add
get_local $l1
i32.const 24
i32.shr_u
get_local $l0
i32.const 8
i32.shl
i32.or
i32.store
get_local $p1
i32.const 16
i32.add
set_local $p1
get_local $p0
i32.const 16
i32.add
set_local $p0
get_local $p2
i32.const 16
i32.sub
set_local $p2
end
br $L31
end
end
end
br $B19
unreachable
end
unreachable
end
block $B34
get_local $p1
i32.load
set_local $l0
block $B35 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B36 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B37 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B38 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
get_local $p2
i32.const 2
i32.sub
set_local $p2
block $B39
loop $L40
get_local $p2
i32.const 18
i32.ge_u
if $I41
block $B42
get_local $p1
i32.const 2
i32.add
i32.load
set_local $l1
get_local $p0
get_local $l0
i32.const 16
i32.shr_u
get_local $l1
i32.const 16
i32.shl
i32.or
i32.store
get_local $p1
i32.const 6
i32.add
i32.load
set_local $l0
get_local $p0
i32.const 4
i32.add
get_local $l1
i32.const 16
i32.shr_u
get_local $l0
i32.const 16
i32.shl
i32.or
i32.store
get_local $p1
i32.const 10
i32.add
i32.load
set_local $l1
get_local $p0
i32.const 8
i32.add
get_local $l0
i32.const 16
i32.shr_u
get_local $l1
i32.const 16
i32.shl
i32.or
i32.store
get_local $p1
i32.const 14
i32.add
i32.load
set_local $l0
get_local $p0
i32.const 12
i32.add
get_local $l1
i32.const 16
i32.shr_u
get_local $l0
i32.const 16
i32.shl
i32.or
i32.store
get_local $p1
i32.const 16
i32.add
set_local $p1
get_local $p0
i32.const 16
i32.add
set_local $p0
get_local $p2
i32.const 16
i32.sub
set_local $p2
end
br $L40
end
end
end
br $B19
unreachable
end
unreachable
end
block $B43
get_local $p1
i32.load
set_local $l0
block $B44 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B45 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
get_local $p2
i32.const 1
i32.sub
set_local $p2
block $B46
loop $L47
get_local $p2
i32.const 19
i32.ge_u
if $I48
block $B49
get_local $p1
i32.const 3
i32.add
i32.load
set_local $l1
get_local $p0
get_local $l0
i32.const 8
i32.shr_u
get_local $l1
i32.const 24
i32.shl
i32.or
i32.store
get_local $p1
i32.const 7
i32.add
i32.load
set_local $l0
get_local $p0
i32.const 4
i32.add
get_local $l1
i32.const 8
i32.shr_u
get_local $l0
i32.const 24
i32.shl
i32.or
i32.store
get_local $p1
i32.const 11
i32.add
i32.load
set_local $l1
get_local $p0
i32.const 8
i32.add
get_local $l0
i32.const 8
i32.shr_u
get_local $l1
i32.const 24
i32.shl
i32.or
i32.store
get_local $p1
i32.const 15
i32.add
i32.load
set_local $l0
get_local $p0
i32.const 12
i32.add
get_local $l1
i32.const 8
i32.shr_u
get_local $l0
i32.const 24
i32.shl
i32.or
i32.store
get_local $p1
i32.const 16
i32.add
set_local $p1
get_local $p0
i32.const 16
i32.add
set_local $p0
get_local $p2
i32.const 16
i32.sub
set_local $p2
end
br $L47
end
end
end
br $B19
unreachable
end
unreachable
end
end
get_local $p2
i32.const 16
i32.and
if $I50
block $B51 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B52 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B53 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B54 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B55 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B56 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B57 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B58 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B59 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B60 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B61 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B62 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B63 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B64 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B65 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B66 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B67 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B68 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B69 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B70 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B71 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B72 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B73 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B74 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B75 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B76 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B77 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B78 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B79 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B80 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B81 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B82 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
end
get_local $p2
i32.const 8
i32.and
if $I83
block $B84 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B85 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B86 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B87 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B88 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B89 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B90 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B91 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B92 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B93 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B94 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B95 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B96 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B97 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B98 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B99 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
end
get_local $p2
i32.const 4
i32.and
if $I100
block $B101 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B102 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B103 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B104 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B105 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B106 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B107 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B108 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
end
get_local $p2
i32.const 2
i32.and
if $I109
block $B110 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B111 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
block $B112 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B113 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
end
get_local $p2
i32.const 1
i32.and
if $I114
block $B115 (result i32)
get_local $p0
tee_local $l2
i32.const 1
i32.add
set_local $p0
get_local $l2
end
block $B116 (result i32)
get_local $p1
tee_local $l2
i32.const 1
i32.add
set_local $p1
get_local $l2
end
i32.load8_u
i32.store8
end)
(func $f15 (type $t6) (param $p0 i32) (param $p1 i32) (param $p2 i32)
(local $l0 i32)
get_local $p0
get_local $p1
i32.eq
if $I0
return
end
get_local $p1
get_local $p2
i32.add
get_local $p0
i32.le_u
tee_local $l0
if $I1 (result i32)
get_local $l0
else
get_local $p0
get_local $p2
i32.add
get_local $p1
i32.le_u
end
if $I2
get_local $p0
get_local $p1
get_local $p2
call $f14
return
end
get_local $p0
get_local $p1
i32.lt_u
if $I3
get_local $p1
i32.const 7
i32.and
get_local $p0
i32.const 7
i32.and
i32.eq
if $I4
block $B5
loop $L6
get_local $p0
i32.const 7
i32.and
if $I7
block $B8
get_local $p2
i32.eqz
if $I9
return
end
get_local $p2
i32.const 1
i32.sub
set_local $p2
block $B10 (result i32)
get_local $p0
tee_local $l0
i32.const 1
i32.add
set_local $p0
get_local $l0
end
block $B11 (result i32)
get_local $p1
tee_local $l0
i32.const 1
i32.add
set_local $p1
get_local $l0
end
i32.load8_u
i32.store8
end
br $L6
end
end
end
block $B12
loop $L13
get_local $p2
i32.const 8
i32.ge_u
if $I14
block $B15
get_local $p0
get_local $p1
i64.load
i64.store
get_local $p2
i32.const 8
i32.sub
set_local $p2
get_local $p0
i32.const 8
i32.add
set_local $p0
get_local $p1
i32.const 8
i32.add
set_local $p1
end
br $L13
end
end
end
end
block $B16
loop $L17
get_local $p2
if $I18
block $B19
block $B20 (result i32)
get_local $p0
tee_local $l0
i32.const 1
i32.add
set_local $p0
get_local $l0
end
block $B21 (result i32)
get_local $p1
tee_local $l0
i32.const 1
i32.add
set_local $p1
get_local $l0
end
i32.load8_u
i32.store8
get_local $p2
i32.const 1
i32.sub
set_local $p2
end
br $L17
end
end
end
else
get_local $p1
i32.const 7
i32.and
get_local $p0
i32.const 7
i32.and
i32.eq
if $I22
block $B23
loop $L24
get_local $p0
get_local $p2
i32.add
i32.const 7
i32.and
if $I25
block $B26
get_local $p2
i32.eqz
if $I27
return
end
get_local $p0
get_local $p2
i32.const 1
i32.sub
tee_local $p2
i32.add
get_local $p1
get_local $p2
i32.add
i32.load8_u
i32.store8
end
br $L24
end
end
end
block $B28
loop $L29
get_local $p2
i32.const 8
i32.ge_u
if $I30
block $B31
get_local $p2
i32.const 8
i32.sub
set_local $p2
get_local $p0
get_local $p2
i32.add
get_local $p1
get_local $p2
i32.add
i64.load
i64.store
end
br $L29
end
end
end
end
block $B32
loop $L33
get_local $p2
if $I34
get_local $p0
get_local $p2
i32.const 1
i32.sub
tee_local $p2
i32.add
get_local $p1
get_local $p2
i32.add
i32.load8_u
i32.store8
br $L33
end
end
end
end)
(func $f16 (type $t8) (param $p0 i32) (param $p1 i32) (param $p2 i32) (param $p3 i32) (param $p4 i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32)
get_local $p0
get_local $p1
i32.const 1
i32.shl
i32.add
get_global $g6
i32.add
set_local $l0
get_local $p2
get_local $p3
i32.const 1
i32.shl
i32.add
get_global $g6
i32.add
set_local $l1
get_local $p4
i32.const 1
i32.shl
set_local $l2
get_local $l0
get_local $l1
get_local $l2
call $f15)
(func $f17 (type $t9) (param $p0 i32)
nop)
(func $f18 (type $t1) (param $p0 i32) (param $p1 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32)
get_local $p0
i32.load
set_local $l0
get_local $p1
get_local $l0
i32.gt_s
if $I0
get_local $p1
get_global $g5
i32.le_s
i32.eqz
if $I1
i32.const 0
i32.const 144
i32.const 40
i32.const 4
call $env.abort
unreachable
end
get_local $p1
get_local $l0
call $f3
get_global $g4
i32.sub
i32.le_s
if $I2
get_local $p0
get_local $p1
i32.store
else
get_local $p1
call $f5
set_local $l1
get_local $l1
get_global $g4
i32.add
set_local $l2
get_local $p0
get_global $g4
i32.add
set_local $l3
get_local $l2
get_local $l3
get_local $l0
call $f15
block $B3
block $B4
get_local $p0
call $f17
br $B3
unreachable
end
unreachable
end
get_local $l1
set_local $p0
end
get_local $p0
get_global $g4
i32.add
get_local $l0
i32.add
set_local $l1
i32.const 0
set_local $l3
get_local $p1
get_local $l0
i32.sub
set_local $l2
get_local $l1
get_local $l3
get_local $l2
call $f7
else
get_local $p1
get_local $l0
i32.lt_s
if $I5
get_local $p1
i32.const 0
i32.ge_s
i32.eqz
if $I6
i32.const 0
i32.const 144
i32.const 62
i32.const 4
call $env.abort
unreachable
end
get_local $p0
get_local $p1
i32.store
end
end
get_local $p0)
(func $f19 (type $t1) (param $p0 i32) (param $p1 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32)
get_local $p0
i32.load offset=4
set_local $l0
get_local $p0
i32.load
set_local $l1
get_local $l1
i32.load
i32.const 2
i32.shr_u
set_local $l2
get_local $l0
i32.const 1
i32.add
set_local $l3
get_local $l0
get_local $l2
i32.ge_u
if $I0
get_local $l0
i32.const 268435454
i32.ge_u
if $I1
i32.const 0
i32.const 112
i32.const 182
i32.const 42
call $env.abort
unreachable
end
get_local $l1
get_local $l3
i32.const 2
i32.shl
call $f18
set_local $l1
get_local $p0
get_local $l1
i32.store
end
get_local $p0
get_local $l3
i32.store offset=4
i32.const 0
set_local $l4
get_local $l1
get_local $l0
i32.const 2
i32.shl
i32.add
get_local $l4
i32.add
get_local $p1
i32.store offset=8
get_local $l3)
(func $f20 (type $t3) (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32)
(local $l0 i32) (local $l1 i32) (local $l2 i32) (local $l3 i32) (local $l4 i32) (local $l5 i32) (local $l6 i32) (local $l7 i32) (local $l8 i32) (local $l9 i32) (local $l10 i32) (local $l11 i32)
get_local $p0
i32.const 0
i32.ne
i32.eqz
if $I0
i32.const 0
i32.const 80
i32.const 428
i32.const 4
call $env.abort
unreachable
end
get_local $p2
i32.eqz
if $I1
i32.const 0
i32.const 0
call $f8
return
end
get_local $p1
i32.const 0
i32.eq
if $I2
block $B3 (result i32)
i32.const 0
i32.const 1
call $f8
set_local $l0
get_local $l0
i32.const 0
get_local $p0
call $f9
get_local $l0
end
return
end
get_local $p0
i32.load
set_local $l1
get_local $p1
i32.load
set_local $l2
get_local $p2
i32.const 0
i32.lt_s
if $I4
get_global $g18
set_local $p2
end
get_local $l2
i32.eqz
if $I5
get_local $l1
i32.eqz
if $I6
i32.const 0
i32.const 0
call $f8
return
end
get_local $l1
tee_local $l0
get_local $p2
tee_local $l3
get_local $l0
get_local $l3
i32.lt_s
select
set_local $l1
i32.const 0
get_local $l1
call $f8
set_local $l0
get_local $l0
i32.load
set_local $l3
block $B7
i32.const 0
set_local $l4
loop $L8
get_local $l4
get_local $l1
i32.lt_s
i32.eqz
br_if $B7
block $B9
i32.const 1
call $f10
set_local $l5
get_local $l5
get_local $p0
get_local $l4
i32.const 1
i32.shl
i32.add
i32.load16_u offset=4
i32.store16 offset=4
i32.const 0
set_local $l6
get_local $l3
get_local $l4
i32.const 2
i32.shl
i32.add
get_local $l6
i32.add
get_local $l5
i32.store offset=8
end
get_local $l4
i32.const 1
i32.add
set_local $l4
br $L8
unreachable
end
unreachable
end
get_local $l0
return
else
get_local $l1
i32.eqz
if $I10
i32.const 0
i32.const 1
call $f8
set_local $l3
block $B11 (result i32)
get_local $l3
tee_local $l0
i32.const 0
tee_local $l4
i32.const 264
call $f9
get_local $l0
get_local $l4
call $f11
end
drop
get_local $l3
return
end
end
i32.const 0
i32.const 0
call $f8
set_local $l7
i32.const 0
set_local $l8
i32.const 0
set_local $l9
i32.const 0
set_local $l10
block $B12
loop $L13
get_local $p0
get_local $p1
get_local $l9
call $f13
tee_local $l8
i32.const -1
i32.ne
if $I14
block $B15
get_local $l8
get_local $l9
i32.sub
set_local $l3
get_local $l3
i32.const 0
i32.gt_s
if $I16
get_local $l3
call $f10
set_local $l0
get_local $l0
i32.const 0
get_local $p0
get_local $l9
get_local $l3
call $f16
get_local $l7
get_local $l0
call $f19
drop
else
get_local $l7
i32.const 264
call $f19
drop
end
get_local $l10
i32.const 1
i32.add
tee_local $l10
get_local $p2
i32.eq
if $I17
get_local $l7
return
end
get_local $l8
get_local $l2
i32.add
set_local $l9
end
br $L13
end
end
end
get_local $l9
i32.eqz
if $I18
i32.const 0
i32.const 1
call $f8
set_local $l3
block $B19 (result i32)
get_local $l3
tee_local $l0
i32.const 0
tee_local $l4
get_local $p0
call $f9
get_local $l0
get_local $l4
call $f11
end
drop
get_local $l3
return
end
get_local $l1
get_local $l9
i32.sub
set_local $l11
get_local $l11
i32.const 0
i32.gt_s
if $I20
get_local $l11
call $f10
set_local $l3
get_local $l3
i32.const 0
get_local $p0
get_local $l9
get_local $l11
call $f16
get_local $l7
get_local $l3
call $f19
drop
else
get_local $l7
i32.const 264
call $f19
drop
end
get_local $l7)
(func $f21 (type $t3) (param $p0 i32) (param $p1 i32) (param $p2 i32) (result i32)
block $B0
block $B1
block $B2
block $B3
get_global $g19
br_table $B2 $B1 $B0 $B3
end
unreachable
end
i32.const 0
set_local $p1
end
get_global $g18
set_local $p2
end
get_local $p0
get_local $p1
get_local $p2
call $f20)
(func $testSplit (export "testSplit") (type $t2) (result i32)
(local $l0 i32) (local $l1 i32)
i32.const 8
set_local $l0
block $B0 (result i32)
i32.const 1
set_global $g19
get_local $l0
i32.const 72
i32.const 0
call $f21
end
set_local $l1
block $B1 (result i32)
get_local $l1
i32.load offset=4
end)
(func $main (export "main") (type $t0)
get_global $g20
i32.eqz
if $I0
call $f24
i32.const 1
set_global $g20
end)
(func $f24 (type $t0)
get_global $g21
get_global $g2
i32.add
get_global $g2
i32.const -1
i32.xor
i32.and
set_global $g16
get_global $g16
set_global $g17
call $main.sayHello)
(func $f25 (type $t0))
(table $table (export "table") 1 anyfunc)
(memory $memory (export "memory") 1)
(global $g0 i32 (i32.const 3))
(global $g1 i32 (i32.const 8))
(global $g2 i32 (i32.const 7))
(global $g3 i32 (i32.const 1073741824))
(global $g4 i32 (i32.const 8))
(global $g5 i32 (i32.const 1073741816))
(global $g6 i32 (i32.const 4))
(global $g7 i32 (i32.const 536870910))
(global $g8 i32 (i32.const 28))
(global $g9 (mut i32) (i32.const 0))
(global $g10 (mut i64) (i64.const 0))
(global $g11 (mut i32) (i32.const 0))
(global $g12 (mut i64) (i64.const 0))
(global $g13 (mut i64) (i64.const 0))
(global $g14 (mut i64) (i64.const 0))
(global $g15 (mut i32) (i32.const 0))
(global $g16 (mut i32) (i32.const 0))
(global $g17 (mut i32) (i32.const 0))
(global $g18 i32 (i32.const 2147483647))
(global $g19 (mut i32) (i32.const 0))
(global $g20 (mut i32) (i32.const 0))
(global $g21 i32 (i32.const 284))
(elem (i32.const 0) $f25)
(data (i32.const 8) "\1c\00\00\00h\00e\00l\00l\00 \00o\00 \00o\00 \00o\00 \00o\00 \00-\00 \00-\00 \00-\00 \00-\00 \00-\00 \00-\00 \00-\00 \00-\00")
(data (i32.const 72) "\01\00\00\00 \00")
(data (i32.const 80) "\0e\00\00\00~\00l\00i\00b\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00")
(data (i32.const 112) "\0d\00\00\00~\00l\00i\00b\00/\00a\00r\00r\00a\00y\00.\00t\00s\00")
(data (i32.const 144) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
(data (i32.const 208) "\17\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00s\00t\00r\00i\00n\00g\00.\00t\00s\00")
(data (i32.const 264) "\00\00\00\00")
(data (i32.const 272) "\04\00\00\00n\00u\00l\00l\00"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment