forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
negative-base-reg.wast
65 lines (65 loc) · 1.33 KB
/
negative-base-reg.wast
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
(module
(import "env" "memory" (memory $0 1))
(table 0 funcref)
(data (i32.const 4) "\90\04\00\00")
(export "main" (func $main))
(export "stackSave" (func $stackSave))
(export "stackAlloc" (func $stackAlloc))
(export "stackRestore" (func $stackRestore))
(func $main (; 0 ;) (result i32)
(local $0 i32)
(local.set $0
(i32.const -128)
)
(loop $label$0
(i32.store
(i32.add
(local.get $0)
(i32.const 144)
)
(i32.const 1)
)
(br_if $label$0
(local.tee $0
(i32.add
(local.get $0)
(i32.const 4)
)
)
)
)
(return
(i32.const 0)
)
)
(func $stackSave (; 1 ;) (result i32)
(i32.load offset=4
(i32.const 0)
)
)
(func $stackAlloc (; 2 ;) (param $0 i32) (result i32)
(local $1 i32)
(i32.store offset=4
(i32.const 0)
(local.tee $1
(i32.and
(i32.sub
(i32.load offset=4
(i32.const 0)
)
(local.get $0)
)
(i32.const -16)
)
)
)
(local.get $1)
)
(func $stackRestore (; 3 ;) (param $0 i32)
(i32.store offset=4
(i32.const 0)
(local.get $0)
)
)
)
;; METADATA: { "asmConsts": {},"staticBump": 1168, "initializers": [], "declares": [], "externs": [], "implementedFunctions": ["_main","_stackSave","_stackAlloc","_stackRestore"], "exports": ["main","stackSave","stackAlloc","stackRestore"], "invokeFuncs": [] }