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
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
|
.globl main
.text
.text
.ent main
main:
ldgp $gp,0($27)
lda $sp,-80($sp)
.mask 0x4006000,-64
.frame $sp,80,$26,48
stq $13,0($sp)
stq $14,8($sp)
stq $26,16($sp)
.prologue 1
lda $14,L.6
br L.5
L.2:
ldb $16,($14)
jsr $26,backslash
ldgp $gp,0($26)
mov $0,$27
lda $16,L.7
ldb $17,($14)
mov $27,$18
jsr $26,printf
ldgp $gp,0($26)
L.3:
lda $14,1($14)
L.5:
ldb $27,($14)
cmpeq $27,$31,$23
beq $23,L.2
jsr $26,f
ldgp $gp,0($26)
jsr $26,g
ldgp $gp,0($26)
jsr $26,h
ldgp $gp,0($26)
lda $13,16777216
br L.11
L.8:
mov $13,$16
jsr $26,big
ldgp $gp,0($26)
L.9:
lda $13,16777216($13)
L.11:
and $13,117440512,$27
addl $27,0,$27
cmpeq $27,$31,$23
beq $23,L.8
jsr $26,limit
ldgp $gp,0($26)
mov $31,$0
L.1:
ldq $13,0($sp)
ldq $14,8($sp)
ldq $26,16($sp)
lda $sp,80($sp)
ret
.end main
.globl backslash
.text
.ent backslash
backslash:
ldgp $gp,0($27)
lda $sp,-64($sp)
.frame $sp,64,$26,48
.prologue 1
lda $27,102
cmpeq $16,$27,$23
bne $23,L.16
cmple $16,$27,$23
beq $23,L.22
L.21:
lda $27,98
cmpeq $16,$27,$23
bne $23,L.15
br L.13
L.22:
lda $27,110
cmpeq $16,$27,$23
bne $23,L.17
cmplt $16,$27,$23
bne $23,L.13
L.23:
lda $27,114
cmpeq $16,$27,$23
bne $23,L.18
lda $27,116
cmpeq $16,$27,$23
bne $23,L.19
lda $27,118
cmpeq $16,$27,$23
bne $23,L.20
br L.13
L.15:
lda $0,8
br L.12
L.16:
lda $0,12
br L.12
L.17:
lda $0,10
br L.12
L.18:
lda $0,13
br L.12
L.19:
lda $0,9
br L.12
L.20:
lda $0,11
br L.12
L.13:
mov $16,$0
L.12:
lda $sp,64($sp)
ret
.end backslash
.globl f
.text
.ent f
f:
ldgp $gp,0($27)
lda $sp,-96($sp)
.mask 0x4007000,-72
.frame $sp,96,$26,48
stq $12,0($sp)
stq $13,8($sp)
stq $14,16($sp)
stq $26,24($sp)
.prologue 1
mov $31,$13
lda $16,L.25
jsr $26,printf
ldgp $gp,0($26)
mov $31,$14
L.26:
mov $14,$12
cmplt $14,1,$23
bne $23,L.30
cmple $14,20,$23
beq $23,L.30
subl $14,1,$27
sll $27,3,$27
ldq $27,L.42($27)
jmp ($27)
.rdata
.align 3
L.42:
.quad L.32
.quad L.33
.quad L.30
.quad L.30
.quad L.30
.quad L.30
.quad L.34
.quad L.35
.quad L.36
.quad L.30
.quad L.30
.quad L.30
.quad L.30
.quad L.30
.quad L.30
.quad L.37
.quad L.38
.quad L.39
.quad L.40
.quad L.41
.text
L.32:
mov $14,$13
br L.31
L.33:
mov $14,$13
br L.31
L.34:
mov $14,$13
br L.31
L.35:
mov $14,$13
br L.31
L.36:
mov $14,$13
br L.31
L.37:
mov $14,$13
br L.31
L.38:
mov $14,$13
br L.31
L.39:
mov $14,$13
br L.31
L.40:
mov $14,$13
br L.31
L.41:
mov $14,$13
L.30:
L.31:
lda $16,L.43
mov $13,$17
jsr $26,printf
ldgp $gp,0($26)
L.27:
lda $14,1($14)
cmple $14,20,$23
bne $23,L.26
mov $31,$0
L.24:
ldq $12,0($sp)
ldq $13,8($sp)
ldq $14,16($sp)
ldq $26,24($sp)
lda $sp,96($sp)
ret
.end f
.globl g
.text
.ent g
g:
ldgp $gp,0($27)
lda $sp,-80($sp)
.mask 0x4004000,-72
.frame $sp,80,$26,48
stq $14,0($sp)
stq $26,8($sp)
.prologue 1
lda $16,L.45
jsr $26,printf
ldgp $gp,0($26)
lda $14,1
L.46:
lda $27,1001
cmplt $14,$27,$23
bne $23,L.63
lda $27,1004
cmple $14,$27,$23
beq $23,L.64
subl $14,1001,$27
sll $27,3,$27
ldq $27,L.65($27)
jmp ($27)
.rdata
.align 3
L.65:
.quad L.59
.quad L.59
.quad L.59
.quad L.59
.text
L.63:
cmplt $14,1,$23
bne $23,L.50
cmple $14,8,$23
beq $23,L.50
subl $14,1,$27
sll $27,3,$27
ldq $27,L.66($27)
jmp ($27)
.rdata
.align 3
L.66:
.quad L.52
.quad L.52
.quad L.54
.quad L.54
.quad L.54
.quad L.56
.quad L.56
.quad L.56
.text
L.64:
lda $27,3001
cmplt $14,$27,$23
bne $23,L.50
lda $27,3004
cmple $14,$27,$23
beq $23,L.50
subl $14,3001,$27
sll $27,3,$27
ldq $27,L.67($27)
jmp ($27)
.rdata
.align 3
L.67:
.quad L.61
.quad L.61
.quad L.61
.quad L.61
.text
L.52:
lda $16,L.53
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.51
L.54:
lda $16,L.55
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.51
L.56:
lda $16,L.57
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
L.50:
lda $16,L.58
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.51
L.59:
lda $16,L.60
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.51
L.61:
lda $16,L.62
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
L.51:
L.47:
lda $14,1($14)
cmple $14,10,$23
bne $23,L.46
mov $31,$0
L.44:
ldq $14,0($sp)
ldq $26,8($sp)
lda $sp,80($sp)
ret
.end g
.globl h
.text
.ent h
h:
ldgp $gp,0($27)
lda $sp,-80($sp)
.mask 0x4006000,-64
.frame $sp,80,$26,48
stq $13,0($sp)
stq $14,8($sp)
stq $26,16($sp)
.prologue 1
mov $31,$13
lda $16,L.69
jsr $26,printf
ldgp $gp,0($26)
lda $14,1
L.70:
lda $27,264
cmpeq $14,$27,$23
bne $23,L.82
cmple $14,$27,$23
beq $23,L.90
L.89:
lda $27,120
cmpeq $14,$27,$23
bne $23,L.80
cmple $14,$27,$23
beq $23,L.92
L.91:
cmpeq $14,8,$23
bne $23,L.79
cmplt $14,8,$23
bne $23,L.74
L.93:
cmpeq $14,16,$23
bne $23,L.78
br L.74
L.92:
lda $27,128
cmpeq $14,$27,$23
bne $23,L.76
cmplt $14,$27,$23
bne $23,L.74
L.94:
lda $27,248
cmpeq $14,$27,$23
bne $23,L.83
br L.74
L.90:
lda $27,288
cmpeq $14,$27,$23
bne $23,L.87
cmple $14,$27,$23
beq $23,L.96
L.95:
lda $27,272
cmpeq $14,$27,$23
bne $23,L.84
cmplt $14,$27,$23
bne $23,L.74
L.97:
lda $27,280
cmpeq $14,$27,$23
bne $23,L.81
br L.74
L.96:
lda $27,304
cmpeq $14,$27,$23
bne $23,L.85
cmple $14,$27,$23
beq $23,L.99
L.98:
lda $27,296
cmpeq $14,$27,$23
bne $23,L.86
br L.74
L.99:
lda $27,312
cmpeq $14,$27,$23
bne $23,L.88
br L.74
L.74:
lda $13,1($13)
br L.71
L.76:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.78:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.79:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.80:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.81:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.82:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.83:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.84:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.85:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.86:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.87:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
br L.75
L.88:
lda $16,L.77
mov $14,$17
jsr $26,printf
ldgp $gp,0($26)
L.75:
L.71:
lda $14,1($14)
lda $27,500
cmple $14,$27,$23
bne $23,L.70
lda $16,L.100
mov $13,$17
jsr $26,printf
ldgp $gp,0($26)
mov $31,$0
L.68:
ldq $13,0($sp)
ldq $14,8($sp)
ldq $26,16($sp)
lda $sp,80($sp)
ret
.end h
.globl big
.text
.ent big
big:
ldgp $gp,0($27)
lda $sp,-80($sp)
.mask 0x4004000,-72
.frame $sp,80,$26,48
stq $14,0($sp)
stq $26,8($sp)
stq $16,32($sp)
.prologue 1
ldl $27,-48+80($sp)
zap $27,240,$27
and $27,0x6000000,$14
lda $25,33554432
cmpeq $14,$25,$23
bne $23,L.107
cmple $14,$25,$23
beq $23,L.111
L.110:
lda $25,-2
cmpeq $14,$25,$23
bne $23,L.105
lda $25,-1
cmpeq $14,$25,$23
bne $23,L.105
cmpeq $14,$31,$23
bne $23,L.105
br L.102
L.111:
mov $14,$27
lda $25,67108864
cmpeq $27,$25,$23
bne $23,L.108
br L.102
L.105:
lda $16,L.106
ldl $17,-48+80($sp)
zap $17,240,$17
jsr $26,printf
ldgp $gp,0($26)
br L.103
L.107:
lda $16,L.106
ldl $17,-48+80($sp)
zap $17,240,$17
jsr $26,printf
ldgp $gp,0($26)
br L.103
L.108:
lda $16,L.106
ldl $17,-48+80($sp)
zap $17,240,$17
jsr $26,printf
ldgp $gp,0($26)
br L.103
L.102:
lda $16,L.109
ldl $17,-48+80($sp)
zap $17,240,$17
jsr $26,printf
ldgp $gp,0($26)
L.103:
mov $31,$0
L.101:
ldq $14,0($sp)
ldq $26,8($sp)
lda $sp,80($sp)
ret
.end big
.globl limit
.text
.ent limit
limit:
ldgp $gp,0($27)
lda $sp,-80($sp)
.mask 0x4004000,-72
.frame $sp,80,$26,48
stq $14,0($sp)
stq $26,8($sp)
.prologue 1
lda $14,-2147483648
L.113:
lda $27,-2147483648
cmplt $14,$27,$23
bne $23,L.117
lda $27,-2147483644
cmple $14,$27,$23
beq $23,L.117
subl $14,-2147483648,$27
sll $27,3,$27
ldq $27,L.130($27)
jmp ($27)
.rdata
.align 3
L.130:
.quad L.119
.quad L.121
.quad L.123
.quad L.125
.quad L.127
.text
L.119:
lda $16,L.120
jsr $26,printf
ldgp $gp,0($26)
br L.118
L.121:
lda $16,L.122
jsr $26,printf
ldgp $gp,0($26)
br L.118
L.123:
lda $16,L.124
jsr $26,printf
ldgp $gp,0($26)
br L.118
L.125:
lda $16,L.126
jsr $26,printf
ldgp $gp,0($26)
br L.118
L.127:
lda $16,L.128
jsr $26,printf
ldgp $gp,0($26)
br L.118
L.117:
lda $16,L.129
jsr $26,printf
ldgp $gp,0($26)
L.118:
L.114:
lda $14,1($14)
lda $27,-2147483643
cmple $14,$27,$23
bne $23,L.113
lda $14,2147483647
L.131:
lda $27,2147483643
cmplt $14,$27,$23
bne $23,L.135
lda $27,2147483647
cmple $14,$27,$23
beq $23,L.135
subl $14,2147483643,$27
sll $27,3,$27
ldq $27,L.142($27)
jmp ($27)
.rdata
.align 3
L.142:
.quad L.141
.quad L.140
.quad L.139
.quad L.138
.quad L.137
.text
L.137:
lda $16,L.120
jsr $26,printf
ldgp $gp,0($26)
br L.136
L.138:
lda $16,L.122
jsr $26,printf
ldgp $gp,0($26)
br L.136
L.139:
lda $16,L.124
jsr $26,printf
ldgp $gp,0($26)
br L.136
L.140:
lda $16,L.126
jsr $26,printf
ldgp $gp,0($26)
br L.136
L.141:
lda $16,L.128
jsr $26,printf
ldgp $gp,0($26)
br L.136
L.135:
lda $16,L.129
jsr $26,printf
ldgp $gp,0($26)
L.136:
L.132:
subl $14,1,$14
lda $27,2147483642
cmplt $14,$27,$23
beq $23,L.131
mov $31,$0
L.112:
ldq $14,0($sp)
ldq $26,8($sp)
lda $sp,80($sp)
ret
.end limit
.rdata
.align 0
L.129:
.byte 53
.byte 10
.byte 0
.align 0
L.128:
.byte 52
.byte 10
.byte 0
.align 0
L.126:
.byte 51
.byte 10
.byte 0
.align 0
L.124:
.byte 50
.byte 10
.byte 0
.align 0
L.122:
.byte 49
.byte 10
.byte 0
.align 0
L.120:
.byte 48
.byte 10
.byte 0
.align 0
L.109:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 32
.byte 40
.byte 100
.byte 101
.byte 102
.byte 97
.byte 117
.byte 108
.byte 116
.byte 41
.byte 10
.byte 0
.align 0
L.106:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 0
L.100:
.byte 37
.byte 100
.byte 32
.byte 100
.byte 101
.byte 102
.byte 97
.byte 117
.byte 108
.byte 116
.byte 115
.byte 10
.byte 0
.align 0
L.77:
.byte 105
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.69:
.byte 104
.byte 58
.byte 10
.byte 0
.align 0
L.62:
.byte 54
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.60:
.byte 53
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.58:
.byte 100
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.57:
.byte 51
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.55:
.byte 50
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.53:
.byte 49
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.45:
.byte 103
.byte 58
.byte 10
.byte 0
.align 0
L.43:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 0
L.25:
.byte 102
.byte 58
.byte 10
.byte 0
.align 0
L.7:
.byte 37
.byte 99
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 0
L.6:
.byte 98
.byte 102
.byte 110
.byte 114
.byte 116
.byte 118
.byte 120
.byte 0
|