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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
|
.text
.file "/s/llvm/llvm/test/CodeGen/WebAssembly/cfg-stackify.ll"
.globl test0
.type test0,@function
test0:
.param i32
.local i32
i32.const $1=, 0
.LBB0_1:
loop
i32.const $push1=, 1
i32.add $1=, $1, $pop1
i32.ge_s $push0=, $1, $0
br_if 1, $pop0
call something@FUNCTION
br 0
.LBB0_3:
end_loop
return
.endfunc
.Lfunc_end0:
.size test0, .Lfunc_end0-test0
.globl test1
.type test1,@function
test1:
.param i32
.local i32
i32.const $1=, 0
.LBB1_1:
loop
i32.const $push1=, 1
i32.add $1=, $1, $pop1
i32.ge_s $push0=, $1, $0
br_if 1, $pop0
call something@FUNCTION
br 0
.LBB1_3:
end_loop
return
.endfunc
.Lfunc_end1:
.size test1, .Lfunc_end1-test1
.globl test2
.type test2,@function
test2:
.param i32, i32
block
i32.const $push0=, 1
i32.lt_s $push1=, $1, $pop0
br_if 0, $pop1
.LBB2_1:
loop
i32.const $push5=, -1
i32.add $1=, $1, $pop5
f64.load $push2=, 0($0)
f64.const $push3=, 0x1.999999999999ap1
f64.mul $push4=, $pop2, $pop3
f64.store $discard=, 0($0), $pop4
i32.const $push6=, 8
i32.add $0=, $0, $pop6
br_if 0, $1
.LBB2_2:
end_loop
end_block
return
.endfunc
.Lfunc_end2:
.size test2, .Lfunc_end2-test2
.globl doublediamond
.type doublediamond,@function
doublediamond:
.param i32, i32, i32
.result i32
i32.const $push0=, 0
i32.store $discard=, 0($2), $pop0
block
block
br_if 0, $0
i32.const $push4=, 1
i32.store $discard=, 0($2), $pop4
br 1
.LBB3_2:
end_block
i32.const $push1=, 2
i32.store $discard=, 0($2), $pop1
block
br_if 0, $1
i32.const $push3=, 3
i32.store $discard=, 0($2), $pop3
br 1
.LBB3_4:
end_block
i32.const $push2=, 4
i32.store $discard=, 0($2), $pop2
.LBB3_5:
end_block
i32.const $push5=, 5
i32.store $discard=, 0($2), $pop5
i32.const $push6=, 0
return $pop6
.endfunc
.Lfunc_end3:
.size doublediamond, .Lfunc_end3-doublediamond
.globl triangle
.type triangle,@function
triangle:
.param i32, i32
.result i32
.local i32
i32.const $push0=, 0
i32.store $2=, 0($0), $pop0
block
br_if 0, $1
i32.const $push1=, 1
i32.store $discard=, 0($0), $pop1
.LBB4_2:
end_block
i32.const $push2=, 2
i32.store $discard=, 0($0), $pop2
return $2
.endfunc
.Lfunc_end4:
.size triangle, .Lfunc_end4-triangle
.globl diamond
.type diamond,@function
diamond:
.param i32, i32
.result i32
i32.const $push0=, 0
i32.store $discard=, 0($0), $pop0
block
block
br_if 0, $1
i32.const $push2=, 1
i32.store $discard=, 0($0), $pop2
br 1
.LBB5_2:
end_block
i32.const $push1=, 2
i32.store $discard=, 0($0), $pop1
.LBB5_3:
end_block
i32.const $push3=, 3
i32.store $discard=, 0($0), $pop3
i32.const $push4=, 0
return $pop4
.endfunc
.Lfunc_end5:
.size diamond, .Lfunc_end5-diamond
.globl single_block
.type single_block,@function
single_block:
.param i32
.result i32
i32.const $push0=, 0
i32.store $push1=, 0($0), $pop0
return $pop1
.endfunc
.Lfunc_end6:
.size single_block, .Lfunc_end6-single_block
.globl minimal_loop
.type minimal_loop,@function
minimal_loop:
.param i32
.result i32
i32.const $push0=, 0
i32.store $discard=, 0($0), $pop0
.LBB7_1:
loop
i32.const $push1=, 1
i32.store $discard=, 0($0), $pop1
br 0
.LBB7_2:
end_loop
.endfunc
.Lfunc_end7:
.size minimal_loop, .Lfunc_end7-minimal_loop
.globl simple_loop
.type simple_loop,@function
simple_loop:
.param i32, i32
.result i32
i32.const $push0=, 0
i32.store $discard=, 0($0), $pop0
.LBB8_1:
loop
i32.const $push3=, 1
i32.store $discard=, 0($0), $pop3
i32.const $push4=, 0
i32.eq $push5=, $1, $pop4
br_if 0, $pop5
end_loop
i32.const $push1=, 2
i32.store $discard=, 0($0), $pop1
i32.const $push2=, 0
return $pop2
.endfunc
.Lfunc_end8:
.size simple_loop, .Lfunc_end8-simple_loop
.globl doubletriangle
.type doubletriangle,@function
doubletriangle:
.param i32, i32, i32
.result i32
.local i32
i32.const $push0=, 0
i32.store $3=, 0($2), $pop0
block
br_if 0, $0
i32.const $push1=, 2
i32.store $discard=, 0($2), $pop1
block
br_if 0, $1
i32.const $push2=, 3
i32.store $discard=, 0($2), $pop2
.LBB9_3:
end_block
i32.const $push3=, 4
i32.store $discard=, 0($2), $pop3
.LBB9_4:
end_block
i32.const $push4=, 5
i32.store $discard=, 0($2), $pop4
return $3
.endfunc
.Lfunc_end9:
.size doubletriangle, .Lfunc_end9-doubletriangle
.globl ifelse_earlyexits
.type ifelse_earlyexits,@function
ifelse_earlyexits:
.param i32, i32, i32
.result i32
i32.const $push0=, 0
i32.store $discard=, 0($2), $pop0
block
block
br_if 0, $0
i32.const $push3=, 1
i32.store $discard=, 0($2), $pop3
br 1
.LBB10_2:
end_block
i32.const $push1=, 2
i32.store $discard=, 0($2), $pop1
br_if 0, $1
i32.const $push2=, 3
i32.store $discard=, 0($2), $pop2
.LBB10_4:
end_block
i32.const $push4=, 4
i32.store $discard=, 0($2), $pop4
i32.const $push5=, 0
return $pop5
.endfunc
.Lfunc_end10:
.size ifelse_earlyexits, .Lfunc_end10-ifelse_earlyexits
.globl doublediamond_in_a_loop
.type doublediamond_in_a_loop,@function
doublediamond_in_a_loop:
.param i32, i32, i32
.result i32
.LBB11_1:
loop
i32.const $push0=, 0
i32.store $discard=, 0($2), $pop0
block
block
br_if 0, $0
i32.const $push1=, 1
i32.store $discard=, 0($2), $pop1
br 1
.LBB11_3:
end_block
i32.const $push2=, 2
i32.store $discard=, 0($2), $pop2
block
br_if 0, $1
i32.const $push3=, 3
i32.store $discard=, 0($2), $pop3
br 1
.LBB11_5:
end_block
i32.const $push4=, 4
i32.store $discard=, 0($2), $pop4
.LBB11_6:
end_block
i32.const $push5=, 5
i32.store $discard=, 0($2), $pop5
br 0
.LBB11_7:
end_loop
.endfunc
.Lfunc_end11:
.size doublediamond_in_a_loop, .Lfunc_end11-doublediamond_in_a_loop
.globl test3
.type test3,@function
test3:
.param i32
block
i32.const $push0=, 0
br_if 0, $pop0
.LBB12_1:
loop
br_if 1, $0
.LBB12_2:
loop
i32.ne $push1=, $0, $0
br_if 0, $pop1
end_loop
call bar@FUNCTION
br 0
.LBB12_4:
end_loop
unreachable
.LBB12_5:
end_block
return
.endfunc
.Lfunc_end12:
.size test3, .Lfunc_end12-test3
.globl test4
.type test4,@function
test4:
.param i32
block
block
block
i32.const $push0=, 3
i32.gt_s $push1=, $0, $pop0
br_if 0, $pop1
block
i32.const $push8=, 0
i32.eq $push9=, $0, $pop8
br_if 0, $pop9
i32.const $push6=, 2
i32.ne $push7=, $0, $pop6
br_if 2, $pop7
.LBB13_3:
end_block
return
.LBB13_4:
end_block
i32.const $push2=, 4
i32.eq $push3=, $0, $pop2
br_if 1, $pop3
i32.const $push4=, 622
i32.ne $push5=, $0, $pop4
br_if 0, $pop5
return
.LBB13_7:
end_block
return
.LBB13_8:
end_block
return
.endfunc
.Lfunc_end13:
.size test4, .Lfunc_end13-test4
.globl test5
.type test5,@function
test5:
.param i32, i32
.local i32
i32.const $push5=, 1
i32.and $0=, $0, $pop5
i32.const $push4=, 1
i32.and $2=, $1, $pop4
.LBB14_1:
block
loop
i32.const $push7=, 0
i32.const $push6=, 0
i32.store $1=, 0($pop7), $pop6
i32.const $push9=, 0
i32.eq $push10=, $0, $pop9
br_if 2, $pop10
i32.const $push8=, 1
i32.store $discard=, 0($1), $pop8
br_if 0, $2
end_loop
i32.const $push2=, 0
i32.const $push3=, 3
i32.store $discard=, 0($pop2), $pop3
return
.LBB14_4:
end_block
i32.const $push0=, 0
i32.const $push1=, 2
i32.store $discard=, 0($pop0), $pop1
return
.endfunc
.Lfunc_end14:
.size test5, .Lfunc_end14-test5
.globl test6
.type test6,@function
test6:
.param i32, i32
.local i32, i32, i32
i32.const $push8=, 1
i32.and $2=, $0, $pop8
.LBB15_1:
block
block
loop
i32.const $push10=, 0
i32.const $push9=, 0
i32.store $0=, 0($pop10), $pop9
i32.const $push14=, 0
i32.eq $push15=, $2, $pop14
br_if 3, $pop15
i32.const $push13=, 1
i32.store $push0=, 0($0), $pop13
tee_local $push12=, $4=, $pop0
i32.and $push1=, $1, $pop12
tee_local $push11=, $3=, $pop1
i32.const $push16=, 0
i32.eq $push17=, $pop11, $pop16
br_if 2, $pop17
i32.store $discard=, 0($0), $4
br_if 0, $3
end_loop
i32.const $push6=, 0
i32.const $push7=, 2
i32.store $discard=, 0($pop6), $pop7
return
.LBB15_5:
end_block
i32.const $push2=, 0
i32.const $push3=, 3
i32.store $discard=, 0($pop2), $pop3
.LBB15_6:
end_block
i32.const $push4=, 0
i32.const $push5=, 4
i32.store $discard=, 0($pop4), $pop5
return
.endfunc
.Lfunc_end15:
.size test6, .Lfunc_end15-test6
.globl test7
.type test7,@function
test7:
.param i32, i32
.local i32, i32
i32.const $push0=, 0
i32.const $push8=, 0
i32.store $2=, 0($pop0), $pop8
i32.const $push7=, 1
i32.and $3=, $0, $pop7
.LBB16_1:
loop
i32.const $push9=, 1
i32.store $0=, 0($2), $pop9
block
br_if 0, $3
i32.const $push10=, 2
i32.store $discard=, 0($2), $pop10
i32.and $push1=, $1, $0
br_if 1, $pop1
i32.const $push2=, 0
i32.const $push3=, 4
i32.store $discard=, 0($pop2), $pop3
unreachable
.LBB16_4:
end_block
i32.const $push11=, 3
i32.store $discard=, 0($2), $pop11
i32.and $push4=, $1, $0
br_if 0, $pop4
end_loop
i32.const $push5=, 0
i32.const $push6=, 5
i32.store $discard=, 0($pop5), $pop6
unreachable
.endfunc
.Lfunc_end16:
.size test7, .Lfunc_end16-test7
.globl test8
.type test8,@function
test8:
.result i32
.LBB17_1:
loop
block
i32.const $push0=, 0
i32.const $push3=, 0
i32.eq $push4=, $pop0, $pop3
br_if 0, $pop4
i32.const $push2=, 0
i32.const $push5=, 0
i32.eq $push6=, $pop2, $pop5
br_if 1, $pop6
.LBB17_3:
end_block
loop
i32.const $push1=, 0
br_if 0, $pop1
br 2
.LBB17_4:
end_loop
end_loop
.endfunc
.Lfunc_end17:
.size test8, .Lfunc_end17-test8
.globl test9
.type test9,@function
test9:
.local i32, i32
i32.const $push0=, 0
i32.const $push12=, 0
i32.store $0=, 0($pop0), $pop12
.LBB18_1:
loop
i32.const $push14=, 1
i32.store $push1=, 0($0), $pop14
tee_local $push13=, $1=, $pop1
i32.call $push2=, a@FUNCTION
i32.and $push3=, $pop13, $pop2
i32.const $push18=, 0
i32.eq $push19=, $pop3, $pop18
br_if 1, $pop19
.LBB18_2:
loop
i32.const $push15=, 2
i32.store $discard=, 0($0), $pop15
block
i32.call $push6=, a@FUNCTION
i32.and $push7=, $pop6, $1
i32.const $push20=, 0
i32.eq $push21=, $pop7, $pop20
br_if 0, $pop21
i32.const $push16=, 3
i32.store $discard=, 0($0), $pop16
i32.call $push10=, a@FUNCTION
i32.and $push11=, $pop10, $1
br_if 1, $pop11
br 3
.LBB18_4:
end_block
i32.const $push17=, 4
i32.store $discard=, 0($0), $pop17
i32.call $push8=, a@FUNCTION
i32.and $push9=, $pop8, $1
br_if 0, $pop9
br 2
.LBB18_5:
end_loop
end_loop
i32.const $push4=, 0
i32.const $push5=, 5
i32.store $discard=, 0($pop4), $pop5
return
.endfunc
.Lfunc_end18:
.size test9, .Lfunc_end18-test9
.globl test10
.type test10,@function
test10:
.local i32, i32, i32, i32, i32
i32.const $0=, 2
.LBB19_1:
loop
copy_local $4=, $1
copy_local $3=, $0
i32.const $1=, 0
i32.const $0=, 3
i32.const $2=, 4
br_if 0, $4
.LBB19_2:
block
loop
copy_local $4=, $3
copy_local $3=, $2
.LBB19_3:
loop
copy_local $2=, $4
i32.const $push1=, 4
i32.gt_u $push0=, $2, $pop1
br_if 5, $pop0
copy_local $4=, $3
br_table $2, 0, 1, 5, 2, 4, 0
.LBB19_5:
end_loop
end_loop
return
.LBB19_6:
end_block
i32.const $1=, 1
br 0
.LBB19_7:
end_loop
.endfunc
.Lfunc_end19:
.size test10, .Lfunc_end19-test10
.globl test11
.type test11,@function
test11:
.local i32
block
block
block
block
i32.const $push0=, 0
i32.const $push15=, 0
i32.store $push1=, 0($pop0), $pop15
tee_local $push14=, $0=, $pop1
br_if 0, $pop14
i32.const $push7=, 1
i32.store $discard=, 0($0), $pop7
block
br_if 0, $0
i32.const $push9=, 0
i32.const $push8=, 2
i32.store $discard=, 0($pop9), $pop8
i32.const $push16=, 0
br_if 2, $pop16
.LBB20_3:
end_block
i32.const $push12=, 0
i32.const $push13=, 3
i32.store $discard=, 0($pop12), $pop13
return
.LBB20_4:
end_block
i32.const $push2=, 4
i32.store $discard=, 0($0), $pop2
br_if 2, $0
i32.const $push18=, 0
i32.const $push3=, 5
i32.store $discard=, 0($pop18), $pop3
i32.const $push17=, 0
i32.const $push20=, 0
i32.eq $push21=, $pop17, $pop20
br_if 1, $pop21
.LBB20_6:
end_block
i32.const $push10=, 0
i32.const $push11=, 7
i32.store $discard=, 0($pop10), $pop11
return
.LBB20_7:
end_block
i32.const $push19=, 0
i32.const $push4=, 6
i32.store $discard=, 0($pop19), $pop4
return
.LBB20_8:
end_block
i32.const $push5=, 0
i32.const $push6=, 8
i32.store $discard=, 0($pop5), $pop6
return
.endfunc
.Lfunc_end20:
.size test11, .Lfunc_end20-test11
.globl test12
.type test12,@function
test12:
.param i32
.local i32
.LBB21_1:
loop
block
block
block
i32.load8_u $push0=, 0($0)
tee_local $push7=, $1=, $pop0
i32.const $push6=, 103
i32.gt_s $push1=, $pop7, $pop6
br_if 0, $pop1
i32.const $push8=, 42
i32.eq $push4=, $1, $pop8
br_if 2, $pop4
i32.const $push9=, 76
i32.eq $push5=, $1, $pop9
br_if 2, $pop5
br 1
.LBB21_4:
end_block
i32.const $push10=, 108
i32.eq $push2=, $1, $pop10
br_if 1, $pop2
i32.const $push11=, 104
i32.eq $push3=, $1, $pop11
br_if 1, $pop3
.LBB21_6:
end_block
return
.LBB21_7:
end_block
i32.const $push12=, 1
i32.add $0=, $0, $pop12
br 0
.LBB21_8:
end_loop
.endfunc
.Lfunc_end21:
.size test12, .Lfunc_end21-test12
.globl test13
.type test13,@function
test13:
.local i32
block
i32.const $push0=, 0
i32.const $push4=, 0
i32.eq $push5=, $pop0, $pop4
br_if 0, $pop5
return
.LBB22_2:
end_block
i32.const $0=, 0
block
i32.const $push3=, 0
br_if 0, $pop3
i32.const $0=, 0
.LBB22_4:
end_block
block
i32.const $push1=, 1
i32.and $push2=, $0, $pop1
i32.const $push6=, 0
i32.eq $push7=, $pop2, $pop6
br_if 0, $pop7
end_block
unreachable
.endfunc
.Lfunc_end22:
.size test13, .Lfunc_end22-test13
.globl test14
.type test14,@function
test14:
.LBB23_1:
loop
i32.const $push0=, 0
br_if 0, $pop0
.LBB23_2:
end_loop
loop
i32.const $discard=, 0
i32.const $push1=, 0
br_if 0, $pop1
end_loop
return
.endfunc
.Lfunc_end23:
.size test14, .Lfunc_end23-test14
|