Files
failnix/targets/wasm-tacle/kernel/isqrt/generated/default/isqrt.wat

292 lines
6.0 KiB
Plaintext

(module $isqrt.wasm
(type (;0;) (func (param i32 i32)))
(type (;1;) (func))
(type (;2;) (func (result i32)))
(type (;3;) (func (param i32 i32 i32)))
(import "__pragma" "loopbound" (func $__pragma_loopbound (type 0)))
(func $__wasm_apply_data_relocs (type 1))
(func $isqrt_main (type 1)
(local i32 i32 i32 i32 i32 i32)
global.get $__stack_pointer
i32.const 16
i32.sub
local.tee 0
global.set $__stack_pointer
i32.const 1000
i32.const 1000
call $__pragma_loopbound
i32.const 0
i32.const 1
i32.store offset=1032
i32.const 1
local.set 1
loop ;; label = @1
i32.const 32
local.set 2
i32.const 32
i32.const 32
call $__pragma_loopbound
i32.const 0
local.set 3
i32.const 0
local.set 4
loop ;; label = @2
local.get 4
i32.const 2
i32.shl
local.tee 5
i32.const -1
i32.xor
i32.const 0
local.get 3
i32.const 2
i32.shl
local.get 1
i32.const 30
i32.shr_u
i32.or
local.tee 3
local.get 5
i32.gt_u
local.tee 5
select
local.get 3
i32.add
local.set 3
local.get 4
i32.const 1
i32.shl
local.get 5
i32.or
local.set 4
local.get 1
i32.const 2
i32.shl
local.set 1
local.get 2
i32.const -1
i32.add
local.tee 2
br_if 0 (;@2;)
end
local.get 0
local.get 4
i32.store offset=8
i32.const 1036
local.get 0
i32.const 8
i32.add
i32.const 4
call $basicmath_memcpy
i32.const 0
i32.const 0
i32.load offset=1028
i32.const 0
i32.load16_u offset=1038
i32.add
i32.store offset=1028
i32.const 0
i32.const 0
i32.load offset=1032
local.tee 4
i32.const 1
i32.add
local.tee 1
i32.store offset=1032
local.get 4
i32.const 1000
i32.lt_s
br_if 0 (;@1;)
end
i32.const 0
i32.load offset=1024
local.set 1
i32.const 32
local.set 2
i32.const 32
i32.const 32
call $__pragma_loopbound
i32.const 0
local.set 3
i32.const 0
local.set 4
loop ;; label = @1
local.get 4
i32.const 2
i32.shl
local.tee 5
i32.const -1
i32.xor
i32.const 0
local.get 3
i32.const 2
i32.shl
local.get 1
i32.const 30
i32.shr_u
i32.or
local.tee 3
local.get 5
i32.gt_u
local.tee 5
select
local.get 3
i32.add
local.set 3
local.get 4
i32.const 1
i32.shl
local.get 5
i32.or
local.set 4
local.get 1
i32.const 2
i32.shl
local.set 1
local.get 2
i32.const -1
i32.add
local.tee 2
br_if 0 (;@1;)
end
local.get 0
local.get 4
i32.store offset=12
i32.const 1036
local.get 0
i32.const 12
i32.add
i32.const 4
call $basicmath_memcpy
i32.const 0
i32.const 0
i32.load offset=1028
i32.const 0
i32.load16_u offset=1038
i32.add
i32.store offset=1028
local.get 0
i32.const 16
i32.add
global.set $__stack_pointer)
(func $__original_main (type 2) (result i32)
i32.const 0
i32.const 1072497001
i32.store offset=1024
i32.const 0
i32.const 0
i32.store offset=1028
call $isqrt_main
i32.const -1
i32.const 0
i32.const 0
i32.load offset=1028
i32.const 53364
i32.ne
select)
(func $basicmath_memcpy (type 3) (param i32 i32 i32)
(local i32)
i32.const 4
i32.const 4
call $__pragma_loopbound
block ;; label = @1
local.get 2
i32.const 1
i32.lt_s
br_if 0 (;@1;)
local.get 2
i32.const 7
i32.and
local.set 3
block ;; label = @2
local.get 2
i32.const 8
i32.lt_u
br_if 0 (;@2;)
local.get 2
i32.const 2147483640
i32.and
local.set 2
loop ;; label = @3
local.get 0
local.get 1
i32.load8_u
i32.store8
local.get 0
local.get 1
i32.load8_u offset=1
i32.store8 offset=1
local.get 0
local.get 1
i32.load8_u offset=2
i32.store8 offset=2
local.get 0
local.get 1
i32.load8_u offset=3
i32.store8 offset=3
local.get 0
local.get 1
i32.load8_u offset=4
i32.store8 offset=4
local.get 0
local.get 1
i32.load8_u offset=5
i32.store8 offset=5
local.get 0
local.get 1
i32.load8_u offset=6
i32.store8 offset=6
local.get 0
local.get 1
i32.load8_u offset=7
i32.store8 offset=7
local.get 1
i32.const 8
i32.add
local.set 1
local.get 0
i32.const 8
i32.add
local.set 0
local.get 2
i32.const -8
i32.add
local.tee 2
br_if 0 (;@3;)
end
end
local.get 3
i32.eqz
br_if 0 (;@1;)
loop ;; label = @2
local.get 0
local.get 1
i32.load8_u
i32.store8
local.get 1
i32.const 1
i32.add
local.set 1
local.get 0
i32.const 1
i32.add
local.set 0
local.get 3
i32.const -1
i32.add
local.tee 3
br_if 0 (;@2;)
end
end)
(table (;0;) 1 1 funcref)
(memory (;0;) 1)
(global $__stack_pointer (mut i32) (i32.const 5136))
(global (;1;) i32 (i32.const 1040))
(global (;2;) i32 (i32.const 5136))
(export "memory" (memory 0))
(export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs))
(export "entrypoint" (func $isqrt_main))
(export "main" (func $__original_main))
(export "__data_end" (global 1))
(export "__heap_base" (global 2)))