|
1 | 1 | (module
|
2 | 2 | (type (;0;) (func (param i32) (result)))
|
3 | 3 | (type (;1;) (func (param i32 i32 i32 i32) (result i32)))
|
4 |
| - (type (;2;) (func (param i64) (result))) |
5 |
| - (type (;3;) (func (param f64) (result))) |
| 4 | + (type (;2;) (func (param) (result))) |
| 5 | + (type (;3;) (func (param) (result))) |
6 | 6 | (type (;4;) (func (param) (result)))
|
7 |
| - (type (;5;) (func (param) (result))) |
8 |
| - (type (;6;) (func (param) (result))) |
| 7 | + (type (;5;) (func (param i64) (result))) |
9 | 8 | (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0)))
|
10 | 9 | (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1)))
|
11 |
| - (global $0 i32 (i32.const 0)) |
12 |
| - (func $2 (type 2) (param i64) (result) |
| 10 | + (global $0 (mut i32) (i32.const 0)) |
| 11 | + (global $1 (mut f32) (f32.const 0.000000)) |
| 12 | + (global $2 (mut f64) (f64.const 0.000000)) |
| 13 | + (func $2 (type 2) (param) (result) |
| 14 | + (local) |
| 15 | + call 3 |
| 16 | + return |
| 17 | + ) |
| 18 | + (func $3 (type 3) (param) (result) |
| 19 | + (local i32) |
| 20 | + i32.const 1 |
| 21 | + i64.extend_i32_s |
| 22 | + call 5 |
| 23 | + i32.const 1 |
| 24 | + i32.const 16 |
| 25 | + i32.const 1 |
| 26 | + i32.const 0 |
| 27 | + call 1 |
| 28 | + drop |
| 29 | + i32.const 0 |
| 30 | + i64.extend_i32_s |
| 31 | + call 5 |
| 32 | + i32.const 1 |
| 33 | + i32.const 16 |
| 34 | + i32.const 1 |
| 35 | + i32.const 0 |
| 36 | + call 1 |
| 37 | + drop |
| 38 | + i32.const 1 |
| 39 | + local.set 0 |
| 40 | + local.get 0 |
| 41 | + i64.extend_i32_s |
| 42 | + call 5 |
| 43 | + i32.const 1 |
| 44 | + i32.const 16 |
| 45 | + i32.const 1 |
| 46 | + i32.const 0 |
| 47 | + call 1 |
| 48 | + drop |
| 49 | + i32.const 0 |
| 50 | + local.set 0 |
| 51 | + local.get 0 |
| 52 | + i64.extend_i32_s |
| 53 | + call 5 |
| 54 | + i32.const 1 |
| 55 | + i32.const 16 |
| 56 | + i32.const 1 |
| 57 | + i32.const 0 |
| 58 | + call 1 |
| 59 | + drop |
| 60 | + return |
| 61 | + ) |
| 62 | + (func $4 (type 4) (param) (result) |
| 63 | + (local) |
| 64 | + call 2 |
| 65 | + i32.const 0 |
| 66 | + call 0 |
| 67 | + return |
| 68 | + ) |
| 69 | + (func $5 (type 5) (param i64) (result) |
13 | 70 | (local i64 i64 i64 i64)
|
14 | 71 | local.get 0
|
15 | 72 | i64.const 0
|
16 | 73 | i64.eq
|
17 | 74 | if
|
18 | 75 | i32.const 1
|
19 |
| - i32.const 52 |
| 76 | + i32.const 88 |
20 | 77 | i32.const 1
|
21 | 78 | i32.const 0
|
22 | 79 | call 1
|
|
98 | 155 | i64.rem_s
|
99 | 156 | i64.const 12
|
100 | 157 | i64.mul
|
101 |
| - i64.const 52 |
| 158 | + i64.const 88 |
102 | 159 | i64.add
|
103 | 160 | local.set 0
|
104 | 161 | i32.const 1
|
|
114 | 171 | end
|
115 | 172 | return
|
116 | 173 | )
|
117 |
| - (func $3 (type 3) (param f64) (result) |
118 |
| - (local i64 i64 i64) |
119 |
| - local.get 0 |
120 |
| - f64.const 0.000000 |
121 |
| - f64.lt |
122 |
| - if |
123 |
| - i32.const 1 |
124 |
| - i32.const 28 |
125 |
| - i32.const 1 |
126 |
| - i32.const 0 |
127 |
| - call 1 |
128 |
| - drop |
129 |
| - local.get 0 |
130 |
| - f64.const -1.000000 |
131 |
| - f64.mul |
132 |
| - local.set 0 |
133 |
| - else |
134 |
| - end |
135 |
| - local.get 0 |
136 |
| - i64.trunc_f64_s |
137 |
| - call 2 |
138 |
| - i32.const 1 |
139 |
| - i32.const 40 |
140 |
| - i32.const 1 |
141 |
| - i32.const 0 |
142 |
| - call 1 |
143 |
| - drop |
144 |
| - local.get 0 |
145 |
| - local.get 0 |
146 |
| - i64.trunc_f64_s |
147 |
| - f64.convert_i64_s |
148 |
| - f64.sub |
149 |
| - f64.const 100000000.000000 |
150 |
| - f64.mul |
151 |
| - i64.trunc_f64_s |
152 |
| - local.set 2 |
153 |
| - local.get 2 |
154 |
| - local.set 3 |
155 |
| - i64.const 0 |
156 |
| - local.set 1 |
157 |
| - loop |
158 |
| - local.get 2 |
159 |
| - i64.const 0 |
160 |
| - i64.gt_s |
161 |
| - if |
162 |
| - local.get 1 |
163 |
| - i64.const 1 |
164 |
| - i64.add |
165 |
| - local.set 1 |
166 |
| - local.get 2 |
167 |
| - f64.convert_i64_s |
168 |
| - i64.const 10 |
169 |
| - f64.convert_i64_s |
170 |
| - f64.div |
171 |
| - i64.trunc_f64_s |
172 |
| - local.set 2 |
173 |
| - br 1 |
174 |
| - else |
175 |
| - end |
176 |
| - end |
177 |
| - loop |
178 |
| - local.get 1 |
179 |
| - i64.const 8 |
180 |
| - i64.lt_s |
181 |
| - if |
182 |
| - local.get 1 |
183 |
| - i64.const 1 |
184 |
| - i64.add |
185 |
| - local.set 1 |
186 |
| - i32.const 1 |
187 |
| - i32.const 52 |
188 |
| - i32.const 1 |
189 |
| - i32.const 0 |
190 |
| - call 1 |
191 |
| - drop |
192 |
| - br 1 |
193 |
| - else |
194 |
| - end |
195 |
| - end |
196 |
| - local.get 3 |
197 |
| - call 2 |
198 |
| - return |
199 |
| - ) |
200 |
| - (func $4 (type 4) (param) (result) |
201 |
| - (local) |
202 |
| - call 5 |
203 |
| - return |
204 |
| - ) |
205 |
| - (func $5 (type 5) (param) (result) |
206 |
| - (local i32) |
207 |
| - i32.const 1 |
208 |
| - i64.extend_i32_s |
209 |
| - call 2 |
210 |
| - i32.const 1 |
211 |
| - i32.const 16 |
212 |
| - i32.const 1 |
213 |
| - i32.const 0 |
214 |
| - call 1 |
215 |
| - drop |
216 |
| - i32.const 0 |
217 |
| - i64.extend_i32_s |
218 |
| - call 2 |
219 |
| - i32.const 1 |
220 |
| - i32.const 16 |
221 |
| - i32.const 1 |
222 |
| - i32.const 0 |
223 |
| - call 1 |
224 |
| - drop |
225 |
| - i32.const 1 |
226 |
| - local.set 0 |
227 |
| - local.get 0 |
228 |
| - i64.extend_i32_s |
229 |
| - call 2 |
230 |
| - i32.const 1 |
231 |
| - i32.const 16 |
232 |
| - i32.const 1 |
233 |
| - i32.const 0 |
234 |
| - call 1 |
235 |
| - drop |
236 |
| - i32.const 0 |
237 |
| - local.set 0 |
238 |
| - local.get 0 |
239 |
| - i64.extend_i32_s |
240 |
| - call 2 |
241 |
| - i32.const 1 |
242 |
| - i32.const 16 |
243 |
| - i32.const 1 |
244 |
| - i32.const 0 |
245 |
| - call 1 |
246 |
| - drop |
247 |
| - return |
248 |
| - ) |
249 |
| - (func $6 (type 6) (param) (result) |
250 |
| - (local) |
251 |
| - call 4 |
252 |
| - i32.const 0 |
253 |
| - call 0 |
254 |
| - return |
255 |
| - ) |
256 | 174 | (memory (;0;) 100 100)
|
257 | 175 | (export "memory" (memory 0))
|
258 |
| - (export "print_i64" (func 2)) |
259 |
| - (export "print_f64" (func 3)) |
260 |
| - (export "_lpython_main_program" (func 4)) |
261 |
| - (export "test_bool" (func 5)) |
262 |
| - (export "_start" (func 6)) |
| 176 | + (export "_lpython_main_program" (func 2)) |
| 177 | + (export "test_bool" (func 3)) |
| 178 | + (export "_start" (func 4)) |
| 179 | + (export "print_i64" (func 5)) |
263 | 180 | (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00")
|
264 | 181 | (data (;1;) (i32.const 12) " ")
|
265 | 182 | (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00")
|
|
269 | 186 | (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00")
|
270 | 187 | (data (;7;) (i32.const 48) ". ")
|
271 | 188 | (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00")
|
272 |
| - (data (;9;) (i32.const 60) "0 ") |
| 189 | + (data (;9;) (i32.const 60) "( ") |
273 | 190 | (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00")
|
274 |
| - (data (;11;) (i32.const 72) "1 ") |
| 191 | + (data (;11;) (i32.const 72) ") ") |
275 | 192 | (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00")
|
276 |
| - (data (;13;) (i32.const 84) "2 ") |
| 193 | + (data (;13;) (i32.const 84) ", ") |
277 | 194 | (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00")
|
278 |
| - (data (;15;) (i32.const 96) "3 ") |
| 195 | + (data (;15;) (i32.const 96) "0 ") |
279 | 196 | (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00")
|
280 |
| - (data (;17;) (i32.const 108) "4 ") |
| 197 | + (data (;17;) (i32.const 108) "1 ") |
281 | 198 | (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00")
|
282 |
| - (data (;19;) (i32.const 120) "5 ") |
| 199 | + (data (;19;) (i32.const 120) "2 ") |
283 | 200 | (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00")
|
284 |
| - (data (;21;) (i32.const 132) "6 ") |
| 201 | + (data (;21;) (i32.const 132) "3 ") |
285 | 202 | (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00")
|
286 |
| - (data (;23;) (i32.const 144) "7 ") |
| 203 | + (data (;23;) (i32.const 144) "4 ") |
287 | 204 | (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00")
|
288 |
| - (data (;25;) (i32.const 156) "8 ") |
| 205 | + (data (;25;) (i32.const 156) "5 ") |
289 | 206 | (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00")
|
290 |
| - (data (;27;) (i32.const 168) "9 ") |
| 207 | + (data (;27;) (i32.const 168) "6 ") |
| 208 | + (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00") |
| 209 | + (data (;29;) (i32.const 180) "7 ") |
| 210 | + (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00") |
| 211 | + (data (;31;) (i32.const 192) "8 ") |
| 212 | + (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00") |
| 213 | + (data (;33;) (i32.const 204) "9 ") |
291 | 214 | )
|
0 commit comments