File: wat-wasm_main_program-7a34895.stdout

package info (click to toggle)
lfortran 0.59.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 56,736 kB
  • sloc: cpp: 168,052; f90: 74,272; python: 17,537; ansic: 7,705; yacc: 2,345; sh: 1,334; fortran: 895; makefile: 37; javascript: 15
file content (368 lines) | stat: -rw-r--r-- 9,543 bytes parent folder | download | duplicates (3)
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
(module
    (type (;0;) (func (param i32) (result)))
    (type (;1;) (func (param i32 i32 i32 i32) (result i32)))
    (type (;2;) (func (param i32) (result i32)))
    (type (;3;) (func (param) (result)))
    (type (;4;) (func (param i64) (result)))
    (type (;5;) (func (param f64) (result)))
    (import "wasi_snapshot_preview1" "proc_exit" (func (;0;) (type 0)))
    (import "wasi_snapshot_preview1" "fd_write" (func (;1;) (type 1)))
    (global $0 (mut i32) (i32.const 0))
    (global $1 (mut i32) (i32.const 0))
    (global $2 (mut i32) (i32.const 0))
    (global $3 (mut i64) (i64.const 0))
    (global $4 (mut i64) (i64.const 0))
    (global $5 (mut f32) (f32.const 0.000000))
    (global $6 (mut f32) (f32.const 0.000000))
    (global $7 (mut f64) (f64.const 0.000000))
    (global $8 (mut f64) (f64.const 0.000000))
    (func $2 (type 2) (param i32) (result i32)
        (local i32)
        local.get 0
        local.get 0
        i32.mul
        local.set 1
        local.get 1
        return
    )
    (func $3 (type 3) (param) (result)
        (local i32 f32 i32 f32 i32 f32)
        i32.const 3
        local.set 2
        i32.const 5
        local.set 4
        local.get 2
        local.get 4
        call 2
        i32.mul
        local.set 0
        local.get 0
        i64.extend_i32_s
        call 4
        i32.const 1
        i32.const 16
        i32.const 1
        i32.const 0
        call 1
        drop
        f32.const 3.140000
        local.set 3
        f32.const 5.000000
        local.set 5
        local.get 3
        local.get 5
        f32.mul
        local.get 5
        f32.mul
        local.set 1
        local.get 1
        f64.promote_f32
        call 5
        i32.const 1
        i32.const 16
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 1
        i32.const 208
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 1
        i32.const 4
        i32.const 1
        i32.const 0
        call 1
        drop
        local.get 5
        f64.promote_f32
        call 5
        i32.const 1
        i32.const 4
        i32.const 1
        i32.const 0
        call 1
        drop
        local.get 4
        i64.extend_i32_s
        call 4
        i32.const 1
        i32.const 16
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 1
        i32.const 240
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 1
        i32.const 4
        i32.const 1
        i32.const 0
        call 1
        drop
        local.get 1
        f64.promote_f32
        call 5
        i32.const 1
        i32.const 4
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 1
        i32.const 264
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 1
        i32.const 16
        i32.const 1
        i32.const 0
        call 1
        drop
        i32.const 0
        call 0
        return
    )
    (func $4 (type 4) (param i64) (result)
        (local i64 i64 i64 i64)
        local.get 0
        i64.const 0
        i64.eq
        if
            i32.const 1
            i32.const 88
            i32.const 1
            i32.const 0
            call 1
            drop
            return
        else
        end
        local.get 0
        i64.const 0
        i64.lt_s
        if
            i32.const 1
            i32.const 28
            i32.const 1
            i32.const 0
            call 1
            drop
            local.get 0
            i64.const -1
            i64.mul
            local.set 0
        else
        end
        local.get 0
        local.set 4
        i64.const 0
        local.set 1
        loop
            local.get 0
            i64.const 0
            i64.gt_s
            if
                local.get 1
                i64.const 1
                i64.add
                local.set 1
                local.get 0
                i64.const 10
                i64.div_s
                local.set 0
                br 1
            else
            end
        end
        loop
            local.get 1
            i64.const 0
            i64.gt_s
            if
                local.get 1
                i64.const 1
                i64.sub
                local.set 1
                i64.const 1
                local.set 2
                i64.const 0
                local.set 3
                loop
                    local.get 3
                    local.get 1
                    i64.lt_s
                    if
                        local.get 3
                        i64.const 1
                        i64.add
                        local.set 3
                        local.get 2
                        i64.const 10
                        i64.mul
                        local.set 2
                        br 1
                    else
                    end
                end
                local.get 4
                local.get 2
                i64.div_s
                i64.const 10
                i64.rem_s
                i64.const 12
                i64.mul
                i64.const 88
                i64.add
                local.set 0
                i32.const 1
                local.get 0
                i32.wrap_i64
                i32.const 1
                i32.const 0
                call 1
                drop
                br 1
            else
            end
        end
        return
    )
    (func $5 (type 5) (param f64) (result)
        (local i64 i64 i64)
        local.get 0
        f64.const 0.000000
        f64.lt
        if
            i32.const 1
            i32.const 28
            i32.const 1
            i32.const 0
            call 1
            drop
            local.get 0
            f64.const -1.000000
            f64.mul
            local.set 0
        else
        end
        local.get 0
        i64.trunc_f64_s
        call 4
        i32.const 1
        i32.const 40
        i32.const 1
        i32.const 0
        call 1
        drop
        local.get 0
        local.get 0
        i64.trunc_f64_s
        f64.convert_i64_s
        f64.sub
        f64.const 100000000.000000
        f64.mul
        i64.trunc_f64_s
        local.set 2
        local.get 2
        local.set 3
        i64.const 0
        local.set 1
        loop
            local.get 2
            i64.const 0
            i64.gt_s
            if
                local.get 1
                i64.const 1
                i64.add
                local.set 1
                local.get 2
                f64.convert_i64_s
                i64.const 10
                f64.convert_i64_s
                f64.div
                i64.trunc_f64_s
                local.set 2
                br 1
            else
            end
        end
        loop
            local.get 1
            i64.const 8
            i64.lt_s
            if
                local.get 1
                i64.const 1
                i64.add
                local.set 1
                i32.const 1
                i32.const 88
                i32.const 1
                i32.const 0
                call 1
                drop
                br 1
            else
            end
        end
        local.get 3
        call 4
        return
    )
    (memory (;0;) 1000 1000)
    (export "memory" (memory 0))
    (export "sqr" (func 2))
    (export "_start" (func 3))
    (export "print_i64" (func 4))
    (export "print_f64" (func 5))
    (data (;0;) (i32.const 4) "\0c\00\00\00\01\00\00\00")
    (data (;1;) (i32.const 12) "    ")
    (data (;2;) (i32.const 16) "\18\00\00\00\01\00\00\00")
    (data (;3;) (i32.const 24) "\n   ")
    (data (;4;) (i32.const 28) "\24\00\00\00\01\00\00\00")
    (data (;5;) (i32.const 36) "-   ")
    (data (;6;) (i32.const 40) "\30\00\00\00\01\00\00\00")
    (data (;7;) (i32.const 48) ".   ")
    (data (;8;) (i32.const 52) "\3c\00\00\00\01\00\00\00")
    (data (;9;) (i32.const 60) "(   ")
    (data (;10;) (i32.const 64) "\48\00\00\00\01\00\00\00")
    (data (;11;) (i32.const 72) ")   ")
    (data (;12;) (i32.const 76) "\54\00\00\00\01\00\00\00")
    (data (;13;) (i32.const 84) ",   ")
    (data (;14;) (i32.const 88) "\60\00\00\00\01\00\00\00")
    (data (;15;) (i32.const 96) "0   ")
    (data (;16;) (i32.const 100) "\6c\00\00\00\01\00\00\00")
    (data (;17;) (i32.const 108) "1   ")
    (data (;18;) (i32.const 112) "\78\00\00\00\01\00\00\00")
    (data (;19;) (i32.const 120) "2   ")
    (data (;20;) (i32.const 124) "\84\00\00\00\01\00\00\00")
    (data (;21;) (i32.const 132) "3   ")
    (data (;22;) (i32.const 136) "\90\00\00\00\01\00\00\00")
    (data (;23;) (i32.const 144) "4   ")
    (data (;24;) (i32.const 148) "\9c\00\00\00\01\00\00\00")
    (data (;25;) (i32.const 156) "5   ")
    (data (;26;) (i32.const 160) "\a8\00\00\00\01\00\00\00")
    (data (;27;) (i32.const 168) "6   ")
    (data (;28;) (i32.const 172) "\b4\00\00\00\01\00\00\00")
    (data (;29;) (i32.const 180) "7   ")
    (data (;30;) (i32.const 184) "\c0\00\00\00\01\00\00\00")
    (data (;31;) (i32.const 192) "8   ")
    (data (;32;) (i32.const 196) "\cc\00\00\00\01\00\00\00")
    (data (;33;) (i32.const 204) "9   ")
    (data (;34;) (i32.const 208) "\d8\00\00\00\17\00\00\00")
    (data (;35;) (i32.const 216) "radius of the circle is ")
    (data (;36;) (i32.const 240) "\f8\00\00\00\0f\00\00\00")
    (data (;37;) (i32.const 248) "and its area is ")
    (data (;38;) (i32.const 264) "\10\01\00\00\04\00\00\00")
    (data (;39;) (i32.const 272) "cm^2")
)