-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path3802.s
714 lines (714 loc) · 12.2 KB
/
3802.s
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
.file "3802.f"
.text
.globl trans_
.type trans_, @function
trans_:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
pushq %r13
pushq %r12
subq $8, %rsp
.cfi_offset 13, -24
.cfi_offset 12, -32
movq %rdi, -104(%rbp)
movq %rsi, -112(%rbp)
movq %rdx, -120(%rbp)
movq %rcx, -128(%rbp)
movq %r8, -136(%rbp)
movq %r9, -144(%rbp)
movq -144(%rbp), %rax
movl (%rax), %eax
cltq
movq %rax, -56(%rbp)
movq -56(%rbp), %rax
movl $0, %edx
testq %rax, %rax
cmovs %rdx, %rax
movq %rax, %r12
movl $0, %r13d
movq -128(%rbp), %rax
movl (%rax), %eax
cltq
movq %rax, -64(%rbp)
movq -64(%rbp), %rax
movl $0, %edx
testq %rax, %rax
cmovs %rdx, %rax
movq %rax, %r10
movl $0, %r11d
movq -112(%rbp), %rax
movl (%rax), %eax
cmpl $1, %eax
setle %al
movzbl %al, %edx
movq -120(%rbp), %rax
movl (%rax), %eax
cmpl $1, %eax
setle %al
movzbl %al, %eax
orl %edx, %eax
testl %eax, %eax
jne .L29
movq -128(%rbp), %rax
movl (%rax), %edx
movq -112(%rbp), %rax
movl (%rax), %ecx
movq -120(%rbp), %rax
movl (%rax), %eax
imull %ecx, %eax
cmpl %eax, %edx
jne .L30
movq -144(%rbp), %rax
movl (%rax), %eax
testl %eax, %eax
jle .L31
movq -112(%rbp), %rax
movl (%rax), %edx
movq -120(%rbp), %rax
movl (%rax), %eax
cmpl %eax, %edx
je .L32
movl $2, -44(%rbp)
movq -112(%rbp), %rax
movl (%rax), %eax
subl $2, %eax
movl %eax, -68(%rbp)
movq -144(%rbp), %rax
movl (%rax), %edx
movl $1, -20(%rbp)
.L7:
cmpl %edx, -20(%rbp)
setg %al
movzbl %al, %eax
testl %eax, %eax
jne .L33
movl -20(%rbp), %eax
cltq
leaq -1(%rax), %rcx
movq -136(%rbp), %rax
movl $0, (%rax,%rcx,4)
addl $1, -20(%rbp)
jmp .L7
.L33:
nop
cmpl $0, -68(%rbp)
jle .L34
movl -68(%rbp), %ecx
movl $1, -28(%rbp)
.L10:
cmpl %ecx, -28(%rbp)
setg %al
movzbl %al, %eax
testl %eax, %eax
jne .L34
movq -120(%rbp), %rax
movl (%rax), %eax
subl $1, %eax
imull -28(%rbp), %eax
movq -112(%rbp), %rdx
movl (%rdx), %edx
leal -1(%rdx), %esi
cltd
idivl %esi
movl %eax, -72(%rbp)
movq -120(%rbp), %rax
movl (%rax), %eax
subl $1, %eax
imull -28(%rbp), %eax
movl %eax, %edx
movq -112(%rbp), %rax
movl (%rax), %eax
subl $1, %eax
imull -72(%rbp), %eax
cmpl %eax, %edx
jne .L35
addl $1, -44(%rbp)
movq -120(%rbp), %rax
movl (%rax), %eax
imull -28(%rbp), %eax
movl %eax, %edx
movl -72(%rbp), %eax
addl %edx, %eax
movl %eax, -20(%rbp)
movq -144(%rbp), %rax
movl (%rax), %eax
cmpl %eax, -20(%rbp)
jg .L35
movl -20(%rbp), %eax
cltq
leaq -1(%rax), %rdx
movq -136(%rbp), %rax
movl $1, (%rax,%rdx,4)
jmp .L9
.L35:
nop
.L9:
addl $1, -28(%rbp)
jmp .L10
.L34:
nop
movq -128(%rbp), %rax
movl (%rax), %eax
subl $1, %eax
movl %eax, -76(%rbp)
movl -76(%rbp), %eax
subl $1, %eax
movl %eax, -36(%rbp)
movq -128(%rbp), %rax
movl (%rax), %eax
movl %eax, -40(%rbp)
movl $1, -20(%rbp)
jmp .L11
.L38:
nop
.L14:
movl -76(%rbp), %eax
subl -20(%rbp), %eax
movl %eax, -40(%rbp)
addl $1, -20(%rbp)
movl -76(%rbp), %eax
subl -20(%rbp), %eax
movl %eax, -36(%rbp)
movl -20(%rbp), %eax
cmpl -40(%rbp), %eax
jg .L36
movq -144(%rbp), %rax
movl (%rax), %eax
cmpl %eax, -20(%rbp)
jg .L37
movl -20(%rbp), %eax
cltq
leaq -1(%rax), %rdx
movq -136(%rbp), %rax
movl (%rax,%rdx,4), %eax
testl %eax, %eax
jle .L11
jmp .L14
.L37:
nop
movq -112(%rbp), %rax
movl (%rax), %eax
imull -20(%rbp), %eax
movl %eax, %ecx
movq -120(%rbp), %rax
movl (%rax), %esi
movl -20(%rbp), %eax
cltd
idivl %esi
imull -76(%rbp), %eax
subl %eax, %ecx
movl %ecx, %eax
cmpl %eax, -20(%rbp)
je .L38
movl -20(%rbp), %eax
movl %eax, -24(%rbp)
.L16:
movq -112(%rbp), %rax
movl (%rax), %eax
imull -24(%rbp), %eax
movl %eax, %ecx
movq -120(%rbp), %rax
movl (%rax), %edi
movl -24(%rbp), %eax
cltd
idivl %edi
imull -76(%rbp), %eax
subl %eax, %ecx
movl %ecx, %eax
movl %eax, -84(%rbp)
movl -84(%rbp), %eax
cmpl -20(%rbp), %eax
setle %al
movzbl %al, %edx
movl -84(%rbp), %eax
cmpl -40(%rbp), %eax
setge %al
movzbl %al, %eax
orl %edx, %eax
testl %eax, %eax
jne .L39
movl -84(%rbp), %eax
movl %eax, -24(%rbp)
jmp .L16
.L39:
nop
movl -84(%rbp), %eax
cmpl -20(%rbp), %eax
jne .L38
.L11:
movl -20(%rbp), %eax
movl %eax, -24(%rbp)
.L22:
movl -24(%rbp), %eax
addl $1, %eax
cltq
leaq -1(%rax), %rdx
movq -104(%rbp), %rax
movl (%rax,%rdx,4), %eax
cvtsi2ssl %eax, %xmm0
movss %xmm0, -80(%rbp)
.L19:
movq -112(%rbp), %rax
movl (%rax), %eax
imull -24(%rbp), %eax
movl %eax, %ecx
movq -120(%rbp), %rax
movl (%rax), %esi
movl -24(%rbp), %eax
cltd
idivl %esi
imull -76(%rbp), %eax
subl %eax, %ecx
movl %ecx, %eax
movl %eax, -84(%rbp)
movq -144(%rbp), %rax
movl (%rax), %eax
cmpl %eax, -24(%rbp)
jg .L17
movl -24(%rbp), %eax
cltq
leaq -1(%rax), %rdx
movq -136(%rbp), %rax
movl $2, (%rax,%rdx,4)
.L17:
addl $1, -44(%rbp)
movl -84(%rbp), %eax
cmpl -20(%rbp), %eax
sete %al
movzbl %al, %edx
movl -84(%rbp), %eax
cmpl -36(%rbp), %eax
setge %al
movzbl %al, %eax
orl %edx, %eax
testl %eax, %eax
jne .L40
.L21:
movl -84(%rbp), %eax
addl $1, %eax
cltq
leaq -1(%rax), %rdx
movl -24(%rbp), %eax
addl $1, %eax
cltq
leaq -1(%rax), %rcx
movq -104(%rbp), %rax
movl (%rax,%rdx,4), %edx
movq -104(%rbp), %rax
movl %edx, (%rax,%rcx,4)
movl -84(%rbp), %eax
movl %eax, -24(%rbp)
jmp .L19
.L40:
nop
movl -40(%rbp), %eax
cmpl -36(%rbp), %eax
sete %al
movzbl %al, %edx
movl -84(%rbp), %eax
cmpl -20(%rbp), %eax
sete %al
movzbl %al, %eax
orl %edx, %eax
testl %eax, %eax
jne .L41
movl -36(%rbp), %eax
movl %eax, -40(%rbp)
jmp .L21
.L41:
nop
movl -24(%rbp), %eax
addl $1, %eax
cltq
leaq -1(%rax), %rcx
movss -80(%rbp), %xmm0
cvttss2sil %xmm0, %edx
movq -104(%rbp), %rax
movl %edx, (%rax,%rcx,4)
movq -128(%rbp), %rax
movl (%rax), %eax
cmpl %eax, -44(%rbp)
jge .L29
movl -84(%rbp), %eax
cmpl -40(%rbp), %eax
sete %al
movzbl %al, %edx
movl -40(%rbp), %eax
cmpl -36(%rbp), %eax
sete %al
movzbl %al, %eax
orl %edx, %eax
testl %eax, %eax
jne .L38
movl -36(%rbp), %eax
movl %eax, -40(%rbp)
movl -40(%rbp), %eax
movl %eax, -24(%rbp)
jmp .L22
.L29:
nop
.L2:
movq 16(%rbp), %rax
movl $0, (%rax)
jmp .L1
.L32:
nop
movq -120(%rbp), %rax
movl (%rax), %eax
subl $1, %eax
movl %eax, -88(%rbp)
movl -88(%rbp), %eax
movl $1, -20(%rbp)
.L27:
cmpl %eax, -20(%rbp)
setg %dl
movzbl %dl, %edx
testl %edx, %edx
jne .L42
movl -20(%rbp), %edx
addl $1, %edx
movl %edx, -92(%rbp)
movl -92(%rbp), %edx
movq -120(%rbp), %rcx
movl (%rcx), %esi
movl %edx, -32(%rbp)
.L26:
cmpl %esi, -32(%rbp)
setg %dl
movzbl %dl, %edx
testl %edx, %edx
jne .L43
movl -32(%rbp), %edx
leal -1(%rdx), %ecx
movq -120(%rbp), %rdx
movl (%rdx), %edx
imull %edx, %ecx
movl -20(%rbp), %edx
addl %ecx, %edx
movl %edx, -24(%rbp)
movl -20(%rbp), %edx
leal -1(%rdx), %ecx
movq -112(%rbp), %rdx
movl (%rdx), %edx
imull %edx, %ecx
movl -32(%rbp), %edx
addl %ecx, %edx
movl %edx, -84(%rbp)
movl -24(%rbp), %edx
movslq %edx, %rdx
leaq -1(%rdx), %rcx
movq -104(%rbp), %rdx
movl (%rdx,%rcx,4), %edx
cvtsi2ssl %edx, %xmm0
movss %xmm0, -80(%rbp)
movl -84(%rbp), %edx
movslq %edx, %rdx
leaq -1(%rdx), %rcx
movl -24(%rbp), %edx
movslq %edx, %rdx
leaq -1(%rdx), %rdi
movq -104(%rbp), %rdx
movl (%rdx,%rcx,4), %ecx
movq -104(%rbp), %rdx
movl %ecx, (%rdx,%rdi,4)
movl -84(%rbp), %edx
movslq %edx, %rdx
leaq -1(%rdx), %rdi
movss -80(%rbp), %xmm0
cvttss2sil %xmm0, %ecx
movq -104(%rbp), %rdx
movl %ecx, (%rdx,%rdi,4)
addl $1, -32(%rbp)
jmp .L26
.L43:
nop
addl $1, -20(%rbp)
jmp .L27
.L42:
nop
jmp .L2
.L36:
nop
movq 16(%rbp), %rax
movl -20(%rbp), %edx
movl %edx, (%rax)
jmp .L1
.L28:
jmp .L1
.L30:
nop
movq 16(%rbp), %rax
movl $-1, (%rax)
jmp .L28
.L31:
nop
movq 16(%rbp), %rax
movl $-2, (%rax)
jmp .L28
.L1:
addq $8, %rsp
popq %r12
popq %r13
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size trans_, .-trans_
.section .rodata
.LC0:
.string "3802.f"
.LC1:
.ascii "A1 "
.align 4
.LC2:
.long 8
.align 4
.LC3:
.long 2
.align 4
.LC4:
.long 4
.LC5:
.ascii "MOVE1 "
.LC6:
.ascii " IOK1 "
.text
.type MAIN__, @function
MAIN__:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $576, %rsp
leaq .LC0(%rip), %rax
movq %rax, -568(%rbp)
movl $3, -560(%rbp)
movl $128, -576(%rbp)
movl $6, -572(%rbp)
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write@PLT
leaq -576(%rbp), %rax
movl $3, %edx
leaq .LC1(%rip), %rsi
movq %rax, %rdi
call _gfortran_transfer_character_write@PLT
movl $1, -4(%rbp)
.L46:
movl -576(%rbp), %eax
andl $3, %eax
andl $1, %eax
testb %al, %al
jne .L45
cmpl $8, -4(%rbp)
setg %al
movzbl %al, %eax
testl %eax, %eax
jne .L45
movl -4(%rbp), %eax
cltq
subq $1, %rax
leaq 0(,%rax,4), %rdx
leaq a1.3968(%rip), %rax
leaq (%rdx,%rax), %rcx
leaq -576(%rbp), %rax
movl $4, %edx
movq %rcx, %rsi
movq %rax, %rdi
call _gfortran_transfer_integer_write@PLT
addl $1, -4(%rbp)
jmp .L46
.L45:
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write_done@PLT
leaq -48(%rbp), %rdx
subq $8, %rsp
leaq -8(%rbp), %rax
pushq %rax
leaq .LC2(%rip), %r9
movq %rdx, %r8
leaq .LC2(%rip), %rcx
leaq .LC3(%rip), %rdx
leaq .LC4(%rip), %rsi
leaq a1.3968(%rip), %rdi
call trans_
addq $16, %rsp
leaq .LC0(%rip), %rax
movq %rax, -568(%rbp)
movl $5, -560(%rbp)
movl $128, -576(%rbp)
movl $6, -572(%rbp)
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write@PLT
leaq -576(%rbp), %rax
movl $3, %edx
leaq .LC1(%rip), %rsi
movq %rax, %rdi
call _gfortran_transfer_character_write@PLT
movl $1, -4(%rbp)
.L48:
movl -576(%rbp), %eax
andl $3, %eax
andl $1, %eax
testb %al, %al
jne .L47
cmpl $8, -4(%rbp)
setg %al
movzbl %al, %eax
testl %eax, %eax
jne .L47
movl -4(%rbp), %eax
cltq
subq $1, %rax
leaq 0(,%rax,4), %rdx
leaq a1.3968(%rip), %rax
leaq (%rdx,%rax), %rcx
leaq -576(%rbp), %rax
movl $4, %edx
movq %rcx, %rsi
movq %rax, %rdi
call _gfortran_transfer_integer_write@PLT
addl $1, -4(%rbp)
jmp .L48
.L47:
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write_done@PLT
leaq .LC0(%rip), %rax
movq %rax, -568(%rbp)
movl $6, -560(%rbp)
movl $128, -576(%rbp)
movl $6, -572(%rbp)
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write@PLT
leaq -576(%rbp), %rax
movl $6, %edx
leaq .LC5(%rip), %rsi
movq %rax, %rdi
call _gfortran_transfer_character_write@PLT
movl $1, -4(%rbp)
.L50:
movl -576(%rbp), %eax
andl $3, %eax
andl $1, %eax
testb %al, %al
jne .L49
cmpl $8, -4(%rbp)
setg %al
movzbl %al, %eax
testl %eax, %eax
jne .L49
movl -4(%rbp), %eax
cltq
leaq -1(%rax), %rdx
leaq -48(%rbp), %rax
salq $2, %rdx
leaq (%rax,%rdx), %rcx
leaq -576(%rbp), %rax
movl $4, %edx
movq %rcx, %rsi
movq %rax, %rdi
call _gfortran_transfer_integer_write@PLT
addl $1, -4(%rbp)
jmp .L50
.L49:
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write_done@PLT
leaq .LC0(%rip), %rax
movq %rax, -568(%rbp)
movl $7, -560(%rbp)
movl $128, -576(%rbp)
movl $6, -572(%rbp)
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write@PLT
leaq -576(%rbp), %rax
movl $6, %edx
leaq .LC6(%rip), %rsi
movq %rax, %rdi
call _gfortran_transfer_character_write@PLT
leaq -8(%rbp), %rcx
leaq -576(%rbp), %rax
movl $4, %edx
movq %rcx, %rsi
movq %rax, %rdi
call _gfortran_transfer_integer_write@PLT
leaq -576(%rbp), %rax
movq %rax, %rdi
call _gfortran_st_write_done@PLT
nop
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size MAIN__, .-MAIN__
.globl main
.type main, @function
main:
.LFB2:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movl %edi, -4(%rbp)
movq %rsi, -16(%rbp)
movq -16(%rbp), %rdx
movl -4(%rbp), %eax
movq %rdx, %rsi
movl %eax, %edi
call _gfortran_set_args@PLT
leaq options.8.3994(%rip), %rsi
movl $7, %edi
call _gfortran_set_options@PLT
call MAIN__
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE2:
.size main, .-main
.data
.align 32
.type a1.3968, @object
.size a1.3968, 32
a1.3968:
.long 1
.long 2
.long 3
.long 4
.long 5
.long 6
.long 7
.long 8
.section .rodata
.align 16
.type options.8.3994, @object
.size options.8.3994, 28
options.8.3994:
.long 2116
.long 4095
.long 0
.long 1
.long 1
.long 0
.long 31
.ident "GCC: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0"
.section .note.GNU-stack,"",@progbits