1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
(module
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32)))
(import "env" "memory" (memory $0 1))
(table 0 anyfunc)
(data (i32.const 4) "\b0\08\00\00")
(data (i32.const 12) "9\05\00\00")
(data (i32.const 28) "\01\00\00\00")
(data (i32.const 32) "*\00\00\00")
(data (i32.const 36) "\ff\ff\ff\ff")
(data (i32.const 64) "\00\00\00\00\01\00\00\00")
(data (i32.const 72) "\ff\ff\ff\ff\ff\ff\ff\ff")
(data (i32.const 92) "\00\00\00\80")
(data (i32.const 96) "\00\00\00@")
(data (i32.const 128) "\00\00\00\00\00\00\00\80")
(data (i32.const 136) "\00\00\00\00\00\00\00@")
(data (i32.const 656) "\e0\00\00\00")
(data (i32.const 1192) "\a4\04\00\00")
(export "foo" (func $foo))
(export "call_memcpy" (func $call_memcpy))
(export "stackSave" (func $stackSave))
(export "stackAlloc" (func $stackAlloc))
(export "stackRestore" (func $stackRestore))
(func $foo (; 1 ;) (result i32)
(return
(i32.load offset=32
(i32.const 0)
)
)
)
(func $call_memcpy (; 2 ;) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
(return
(call $memcpy
(get_local $0)
(get_local $1)
(get_local $2)
)
)
)
(func $stackSave (; 3 ;) (result i32)
(i32.load offset=4
(i32.const 0)
)
)
(func $stackAlloc (; 4 ;) (param $0 i32) (result i32)
(local $1 i32)
(i32.store offset=4
(i32.const 0)
(tee_local $1
(i32.and
(i32.sub
(i32.load offset=4
(i32.const 0)
)
(get_local $0)
)
(i32.const -16)
)
)
)
(get_local $1)
)
(func $stackRestore (; 5 ;) (param $0 i32)
(i32.store offset=4
(i32.const 0)
(get_local $0)
)
)
)
;; METADATA: { "asmConsts": {},"staticBump": 2224, "initializers": [], "declares": ["memcpy"], "externs": [], "implementedFunctions": ["_foo","_call_memcpy","_stackSave","_stackAlloc","_stackRestore"], "exports": ["foo","call_memcpy","stackSave","stackAlloc","stackRestore"], "invokeFuncs": [] }
|