aboutsummaryrefslogtreecommitdiffstats
path: root/code/tools/lcc/x86/linux/tst/switch.sbk
blob: 2825130781d8ea1ce7d48ee855ca2d3fface57e4 (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
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
.globl main
.text
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
leal .LC6,%edi
movl %edi,-4(%ebp)
jmp .LC5
.LC2:
movl -4(%ebp),%edi
movsbl (,%edi),%edi
pushl %edi
call backslash
addl $4,%esp
pushl %eax
movl -4(%ebp),%edi
movsbl (,%edi),%edi
pushl %edi
pushl $.LC7
call printf
addl $12,%esp
.LC3:
incl -4(%ebp)
.LC5:
movl -4(%ebp),%edi
movsbl (,%edi),%edi
cmpl $0,%edi
jne .LC2
call f
call g
call h
movl $16777216,-8(%ebp)
jmp .LC11
.LC8:
pushl -8(%ebp)
call big
addl $4,%esp
.LC9:
addl $16777216,-8(%ebp)
.LC11:
movl -8(%ebp),%edi
andl $117440512,%edi
cmpl $0,%edi
jne .LC8
call limit
movl $0,%eax
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf12:
.size main,.Lf12-main
.globl backslash
.align 16
.type backslash,@function
backslash:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
movl 20(%ebp),%edi
cmpl $102,%edi
je .LC17
cmpl $102,%edi
jg .LC23
.LC22:
cmpl $98,20(%ebp)
je .LC16
jmp .LC14
.LC23:
movl 20(%ebp),%edi
cmpl $110,%edi
je .LC18
cmpl $110,%edi
jl .LC14
.LC24:
movl 20(%ebp),%edi
cmpl $114,%edi
je .LC19
cmpl $116,%edi
je .LC20
cmpl $118,%edi
je .LC21
jmp .LC14
.LC16:
movl $8,%eax
jmp .LC13
.LC17:
movl $12,%eax
jmp .LC13
.LC18:
movl $10,%eax
jmp .LC13
.LC19:
movl $13,%eax
jmp .LC13
.LC20:
movl $9,%eax
jmp .LC13
.LC21:
movl $11,%eax
jmp .LC13
.LC14:
movl 20(%ebp),%eax
.LC13:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf25:
.size backslash,.Lf25-backslash
.globl f
.align 16
.type f,@function
f:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $12,%esp
movl $0,-8(%ebp)
pushl $.LC27
call printf
addl $4,%esp
movl $0,-4(%ebp)
.LC28:
movl -4(%ebp),%edi
movl %edi,-12(%ebp)
movl -4(%ebp),%edi
cmpl $1,%edi
jl .LC32
cmpl $20,%edi
jg .LC32
jmp *.LC44-4(,%edi,4)
.data
.align 4
.LC44:
.long .LC34
.long .LC35
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC36
.long .LC37
.long .LC38
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC32
.long .LC39
.long .LC40
.long .LC41
.long .LC42
.long .LC43
.text
.LC34:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC35:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC36:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC37:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC38:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC39:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC40:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC41:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC42:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
jmp .LC33
.LC43:
movl -4(%ebp),%edi
movl %edi,-8(%ebp)
.LC32:
.LC33:
pushl -8(%ebp)
pushl $.LC46
call printf
addl $8,%esp
.LC29:
incl -4(%ebp)
cmpl $20,-4(%ebp)
jle .LC28
movl $0,%eax
.LC26:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf47:
.size f,.Lf47-f
.globl g
.align 16
.type g,@function
g:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
pushl $.LC49
call printf
addl $4,%esp
movl $1,-4(%ebp)
.LC50:
movl -4(%ebp),%edi
cmpl $1001,%edi
jl .LC67
cmpl $1004,%edi
jg .LC68
jmp *.LC69-4004(,%edi,4)
.data
.align 4
.LC69:
.long .LC63
.long .LC63
.long .LC63
.long .LC63
.text
.LC67:
movl -4(%ebp),%edi
cmpl $1,%edi
jl .LC54
cmpl $8,%edi
jg .LC54
jmp *.LC71-4(,%edi,4)
.data
.align 4
.LC71:
.long .LC56
.long .LC56
.long .LC58
.long .LC58
.long .LC58
.long .LC60
.long .LC60
.long .LC60
.text
.LC68:
movl -4(%ebp),%edi
cmpl $3001,%edi
jl .LC54
cmpl $3004,%edi
jg .LC54
jmp *.LC73-12004(,%edi,4)
.data
.align 4
.LC73:
.long .LC65
.long .LC65
.long .LC65
.long .LC65
.text
.LC56:
pushl -4(%ebp)
pushl $.LC57
call printf
addl $8,%esp
jmp .LC55
.LC58:
pushl -4(%ebp)
pushl $.LC59
call printf
addl $8,%esp
jmp .LC55
.LC60:
pushl -4(%ebp)
pushl $.LC61
call printf
addl $8,%esp
.LC54:
pushl -4(%ebp)
pushl $.LC62
call printf
addl $8,%esp
jmp .LC55
.LC63:
pushl -4(%ebp)
pushl $.LC64
call printf
addl $8,%esp
jmp .LC55
.LC65:
pushl -4(%ebp)
pushl $.LC66
call printf
addl $8,%esp
.LC55:
.LC51:
incl -4(%ebp)
cmpl $10,-4(%ebp)
jle .LC50
movl $0,%eax
.LC48:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf75:
.size g,.Lf75-g
.globl h
.align 16
.type h,@function
h:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $8,%esp
movl $0,-8(%ebp)
pushl $.LC77
call printf
addl $4,%esp
movl $1,-4(%ebp)
.LC78:
movl -4(%ebp),%edi
cmpl $264,%edi
je .LC90
cmpl $264,%edi
jg .LC98
.LC97:
movl -4(%ebp),%edi
cmpl $120,%edi
je .LC88
cmpl $120,%edi
jg .LC100
.LC99:
movl -4(%ebp),%edi
cmpl $8,%edi
je .LC87
cmpl $8,%edi
jl .LC82
.LC101:
cmpl $16,-4(%ebp)
je .LC86
jmp .LC82
.LC100:
movl -4(%ebp),%edi
cmpl $128,%edi
je .LC84
cmpl $128,%edi
jl .LC82
.LC102:
cmpl $248,-4(%ebp)
je .LC91
jmp .LC82
.LC98:
movl -4(%ebp),%edi
cmpl $288,%edi
je .LC95
cmpl $288,%edi
jg .LC104
.LC103:
movl -4(%ebp),%edi
cmpl $272,%edi
je .LC92
cmpl $272,%edi
jl .LC82
.LC105:
cmpl $280,-4(%ebp)
je .LC89
jmp .LC82
.LC104:
movl -4(%ebp),%edi
cmpl $304,%edi
je .LC93
cmpl $304,%edi
jg .LC107
.LC106:
cmpl $296,-4(%ebp)
je .LC94
jmp .LC82
.LC107:
cmpl $312,-4(%ebp)
je .LC96
jmp .LC82
.LC82:
incl -8(%ebp)
jmp .LC79
.LC84:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC86:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC87:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC88:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC89:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC90:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC91:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC92:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC93:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC94:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC95:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
jmp .LC83
.LC96:
pushl -4(%ebp)
pushl $.LC85
call printf
addl $8,%esp
.LC83:
.LC79:
incl -4(%ebp)
cmpl $500,-4(%ebp)
jle .LC78
pushl -8(%ebp)
pushl $.LC108
call printf
addl $8,%esp
movl $0,%eax
.LC76:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf109:
.size h,.Lf109-h
.globl big
.align 16
.type big,@function
big:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl 20(%ebp),%edi
andl $0x6000000,%edi
movl %edi,-4(%ebp)
movl -4(%ebp),%edi
cmpl $33554432,%edi
je .LC116
cmpl $33554432,%edi
jg .LC120
.LC119:
movl -4(%ebp),%edi
cmpl $-2,%edi
je .LC114
cmpl $-1,%edi
je .LC114
cmpl $0,%edi
je .LC114
jmp .LC111
.LC120:
movl -4(%ebp),%edi
cmpl $67108864,%edi
je .LC117
jmp .LC111
.LC114:
pushl 20(%ebp)
pushl $.LC115
call printf
addl $8,%esp
jmp .LC112
.LC116:
pushl 20(%ebp)
pushl $.LC115
call printf
addl $8,%esp
jmp .LC112
.LC117:
pushl 20(%ebp)
pushl $.LC115
call printf
addl $8,%esp
jmp .LC112
.LC111:
pushl 20(%ebp)
pushl $.LC118
call printf
addl $8,%esp
.LC112:
movl $0,%eax
.LC110:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf121:
.size big,.Lf121-big
.globl limit
.align 16
.type limit,@function
limit:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $4,%esp
movl $-2147483648,-4(%ebp)
.LC123:
movl -4(%ebp),%edi
movl $-2147483648,%esi
cmpl $-2147483648,%edi
jl .LC127
cmpl $-2147483644,%edi
jg .LC127
leal (,%edi,4),%edi
leal (,%esi,4),%esi
subl %esi,%edi
jmp *.LC140(%edi)
.data
.align 4
.LC140:
.long .LC129
.long .LC131
.long .LC133
.long .LC135
.long .LC137
.text
.LC129:
pushl $.LC130
call printf
addl $4,%esp
jmp .LC128
.LC131:
pushl $.LC132
call printf
addl $4,%esp
jmp .LC128
.LC133:
pushl $.LC134
call printf
addl $4,%esp
jmp .LC128
.LC135:
pushl $.LC136
call printf
addl $4,%esp
jmp .LC128
.LC137:
pushl $.LC138
call printf
addl $4,%esp
jmp .LC128
.LC127:
pushl $.LC139
call printf
addl $4,%esp
.LC128:
.LC124:
incl -4(%ebp)
cmpl $-2147483643,-4(%ebp)
jle .LC123
movl $2147483647,-4(%ebp)
.LC141:
movl -4(%ebp),%edi
movl $2147483643,%esi
cmpl $2147483643,%edi
jl .LC145
cmpl $2147483647,%edi
jg .LC145
leal (,%edi,4),%edi
leal (,%esi,4),%esi
subl %esi,%edi
jmp *.LC152(%edi)
.data
.align 4
.LC152:
.long .LC151
.long .LC150
.long .LC149
.long .LC148
.long .LC147
.text
.LC147:
pushl $.LC130
call printf
addl $4,%esp
jmp .LC146
.LC148:
pushl $.LC132
call printf
addl $4,%esp
jmp .LC146
.LC149:
pushl $.LC134
call printf
addl $4,%esp
jmp .LC146
.LC150:
pushl $.LC136
call printf
addl $4,%esp
jmp .LC146
.LC151:
pushl $.LC138
call printf
addl $4,%esp
jmp .LC146
.LC145:
pushl $.LC139
call printf
addl $4,%esp
.LC146:
.LC142:
decl -4(%ebp)
cmpl $2147483642,-4(%ebp)
jge .LC141
movl $0,%eax
.LC122:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf153:
.size limit,.Lf153-limit
.data
.align 1
.LC139:
.byte 53
.byte 10
.byte 0
.align 1
.LC138:
.byte 52
.byte 10
.byte 0
.align 1
.LC136:
.byte 51
.byte 10
.byte 0
.align 1
.LC134:
.byte 50
.byte 10
.byte 0
.align 1
.LC132:
.byte 49
.byte 10
.byte 0
.align 1
.LC130:
.byte 48
.byte 10
.byte 0
.align 1
.LC118:
.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 1
.LC115:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 1
.LC108:
.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 1
.LC85:
.byte 105
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC77:
.byte 104
.byte 58
.byte 10
.byte 0
.align 1
.LC66:
.byte 54
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC64:
.byte 53
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC62:
.byte 100
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC61:
.byte 51
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC59:
.byte 50
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC57:
.byte 49
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC49:
.byte 103
.byte 58
.byte 10
.byte 0
.align 1
.LC46:
.byte 120
.byte 32
.byte 61
.byte 32
.byte 37
.byte 100
.byte 10
.byte 0
.align 1
.LC27:
.byte 102
.byte 58
.byte 10
.byte 0
.align 1
.LC7:
.byte 37
.byte 99
.byte 32
.byte 61
.byte 32
.byte 48
.byte 120
.byte 37
.byte 120
.byte 10
.byte 0
.align 1
.LC6:
.byte 98
.byte 102
.byte 110
.byte 114
.byte 116
.byte 118
.byte 120
.byte 0
.text
.ident "LCC: 4.1"