summaryrefslogtreecommitdiff
path: root/test/dynamicLibrary.fromasm.imprecise.no-opts
blob: 48f6d82194e8926d62929dc947bc239d9074ec06 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
(module
 (type $FUNCSIG$vi (func (param i32)))
 (type $FUNCSIG$ii (func (param i32) (result i32)))
 (import "env" "memory" (memory $memory 256 256))
 (import "env" "table" (table $table 0 0 funcref))
 (import "env" "__memory_base" (global $__memory_base i32))
 (import "env" "__table_base" (global $__table_base i32))
 (import "env" "DYNAMICTOP_PTR" (global $DYNAMICTOP_PTR$asm2wasm$import i32))
 (import "env" "tempDoublePtr" (global $tempDoublePtr$asm2wasm$import i32))
 (import "env" "ABORT" (global $ABORT$asm2wasm$import i32))
 (import "env" "memoryBase" (global $memoryBase$asm2wasm$import i32))
 (import "env" "tableBase" (global $tableBase$asm2wasm$import i32))
 (import "global" "NaN" (global $nan$asm2wasm$import f64))
 (import "global" "Infinity" (global $inf$asm2wasm$import f64))
 (import "env" "abortStackOverflow" (func $abortStackOverflow (param i32)))
 (import "env" "_puts" (func $_puts (param i32) (result i32)))
 (global $DYNAMICTOP_PTR (mut i32) (global.get $DYNAMICTOP_PTR$asm2wasm$import))
 (global $tempDoublePtr (mut i32) (global.get $tempDoublePtr$asm2wasm$import))
 (global $ABORT (mut i32) (global.get $ABORT$asm2wasm$import))
 (global $memoryBase (mut i32) (global.get $memoryBase$asm2wasm$import))
 (global $tableBase (mut i32) (global.get $tableBase$asm2wasm$import))
 (global $STACKTOP (mut i32) (i32.const 0))
 (global $STACK_MAX (mut i32) (i32.const 0))
 (global $__THREW__ (mut i32) (i32.const 0))
 (global $threwValue (mut i32) (i32.const 0))
 (global $setjmpId (mut i32) (i32.const 0))
 (global $undef (mut i32) (i32.const 0))
 (global $nan (mut f64) (global.get $nan$asm2wasm$import))
 (global $inf (mut f64) (global.get $inf$asm2wasm$import))
 (global $tempInt (mut i32) (i32.const 0))
 (global $tempBigInt (mut i32) (i32.const 0))
 (global $tempBigIntP (mut i32) (i32.const 0))
 (global $tempBigIntS (mut i32) (i32.const 0))
 (global $tempBigIntR (mut f64) (f64.const 0))
 (global $tempBigIntI (mut i32) (i32.const 0))
 (global $tempBigIntD (mut i32) (i32.const 0))
 (global $tempValue (mut i32) (i32.const 0))
 (global $tempDouble (mut f64) (f64.const 0))
 (global $tempRet0 (mut i32) (i32.const 0))
 (global $tempFloat (mut f32) (f32.const 0))
 (global $f0 (mut f32) (f32.const 0))
 (global $_global i32 (i32.const 5242912))
 (export "__ZN3FooC2Ev" (func $__ZN3FooC2Ev))
 (export "__post_instantiate" (func $__post_instantiate))
 (export "runPostSets" (func $runPostSets))
 (export "_global" (global $_global))
 (func $stackAlloc (; 2 ;) (param $size i32) (result i32)
  (local $ret i32)
  (local.set $ret
   (global.get $STACKTOP)
  )
  (global.set $STACKTOP
   (i32.add
    (global.get $STACKTOP)
    (local.get $size)
   )
  )
  (global.set $STACKTOP
   (i32.and
    (i32.add
     (global.get $STACKTOP)
     (i32.const 15)
    )
    (i32.const -16)
   )
  )
  (if
   (i32.ge_s
    (global.get $STACKTOP)
    (global.get $STACK_MAX)
   )
   (call $abortStackOverflow
    (local.get $size)
   )
  )
  (return
   (local.get $ret)
  )
 )
 (func $stackSave (; 3 ;) (result i32)
  (return
   (global.get $STACKTOP)
  )
 )
 (func $stackRestore (; 4 ;) (param $top i32)
  (global.set $STACKTOP
   (local.get $top)
  )
 )
 (func $establishStackSpace (; 5 ;) (param $stackBase i32) (param $stackMax i32)
  (global.set $STACKTOP
   (local.get $stackBase)
  )
  (global.set $STACK_MAX
   (local.get $stackMax)
  )
 )
 (func $setThrew (; 6 ;) (param $threw i32) (param $value i32)
  (if
   (i32.eq
    (global.get $__THREW__)
    (i32.const 0)
   )
   (block
    (global.set $__THREW__
     (local.get $threw)
    )
    (global.set $threwValue
     (local.get $value)
    )
   )
  )
 )
 (func $___cxx_global_var_init (; 7 ;)
  (local $label i32)
  (local $sp i32)
  (local.set $sp
   (global.get $STACKTOP)
  )
  (call $__ZN3FooC2Ev
   (i32.add
    (global.get $memoryBase)
    (i32.const 5242912)
   )
  )
  (return)
 )
 (func $__ZN3FooC2Ev (; 8 ;) (param $$0 i32)
  (local $$1 i32)
  (local $label i32)
  (local $sp i32)
  (local.set $sp
   (global.get $STACKTOP)
  )
  (global.set $STACKTOP
   (i32.add
    (global.get $STACKTOP)
    (i32.const 16)
   )
  )
  (if
   (i32.ge_s
    (global.get $STACKTOP)
    (global.get $STACK_MAX)
   )
   (call $abortStackOverflow
    (i32.const 16)
   )
  )
  (local.set $$1
   (local.get $$0)
  )
  (drop
   (call $_puts
    (i32.add
     (global.get $memoryBase)
     (i32.const 0)
    )
   )
  )
  (global.set $STACKTOP
   (local.get $sp)
  )
  (return)
 )
 (func $__GLOBAL__sub_I_liblib_cpp (; 9 ;)
  (local $label i32)
  (local $sp i32)
  (local.set $sp
   (global.get $STACKTOP)
  )
  (call $___cxx_global_var_init)
  (return)
 )
 (func $runPostSets (; 10 ;)
  (local $temp i32)
  (nop)
 )
 (func $__post_instantiate (; 11 ;)
  (global.set $STACKTOP
   (i32.add
    (global.get $memoryBase)
    (i32.const 32)
   )
  )
  (global.set $STACK_MAX
   (i32.add
    (global.get $STACKTOP)
    (i32.const 5242880)
   )
  )
  (call $runPostSets)
  (call $__GLOBAL__sub_I_liblib_cpp)
 )
)