-
Notifications
You must be signed in to change notification settings - Fork 25
/
65472.s
138 lines (138 loc) · 2.39 KB
/
65472.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
.file "65472.c"
.text
.def printf; .scl 3; .type 32; .endef
.seh_proc printf
printf:
pushq %rbp
.seh_pushreg %rbp
pushq %rbx
.seh_pushreg %rbx
subq $56, %rsp
.seh_stackalloc 56
leaq 48(%rsp), %rbp
.seh_setframe %rbp, 48
.seh_endprologue
movq %rcx, 32(%rbp)
movq %rdx, 40(%rbp)
movq %r8, 48(%rbp)
movq %r9, 56(%rbp)
leaq 40(%rbp), %rax
movq %rax, -16(%rbp)
movq -16(%rbp), %rbx
movl $1, %ecx
movq __imp___acrt_iob_func(%rip), %rax
call *%rax
movq %rbx, %r8
movq 32(%rbp), %rdx
movq %rax, %rcx
call __mingw_vfprintf
movl %eax, -4(%rbp)
movl -4(%rbp), %eax
addq $56, %rsp
popq %rbx
popq %rbp
ret
.seh_endproc
.def __main; .scl 2; .type 32; .endef
.section .rdata,"dr"
.LC0:
.ascii "%d\0"
.LC1:
.ascii "\12\0"
.text
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
pushq %rbp
.seh_pushreg %rbp
pushq %rdi
.seh_pushreg %rdi
subq $200, %rsp
.seh_stackalloc 200
leaq 192(%rsp), %rbp
.seh_setframe %rbp, 192
.seh_endprologue
call __main
leaq -160(%rbp), %rdx
movl $0, %eax
movl $17, %ecx
movq %rdx, %rdi
rep stosq
movq %rdi, %rdx
movl %eax, (%rdx)
addq $4, %rdx
movl $1, -160(%rbp)
movl $1, -156(%rbp)
movl $1, -152(%rbp)
movl $1, -148(%rbp)
movl $1, -144(%rbp)
movl $1, -140(%rbp)
movl $1, -132(%rbp)
movl $1, -128(%rbp)
movl $1, -124(%rbp)
movl $1, -120(%rbp)
movl $1, -116(%rbp)
movl $1, -104(%rbp)
movl $1, -100(%rbp)
movl $1, -96(%rbp)
movl $1, -92(%rbp)
movl $1, -76(%rbp)
movl $1, -72(%rbp)
movl $1, -68(%rbp)
movl $1, -64(%rbp)
movl $1, -60(%rbp)
movl $1, -56(%rbp)
movl $1, -52(%rbp)
movl $1, -48(%rbp)
movl $1, -44(%rbp)
movl $0, -4(%rbp)
jmp .L4
.L8:
movl $0, -8(%rbp)
jmp .L5
.L7:
movl -8(%rbp), %eax
movslq %eax, %rcx
movl -4(%rbp), %eax
movslq %eax, %rdx
movq %rdx, %rax
salq $3, %rax
subq %rdx, %rax
addq %rcx, %rax
movl -160(%rbp,%rax,4), %eax
cmpl $1, %eax
jne .L6
movl -8(%rbp), %eax
movslq %eax, %rcx
movl -4(%rbp), %eax
movslq %eax, %rdx
movq %rdx, %rax
salq $3, %rax
subq %rdx, %rax
addq %rcx, %rax
movl -160(%rbp,%rax,4), %eax
movl %eax, %edx
leaq .LC0(%rip), %rax
movq %rax, %rcx
call printf
.L6:
addl $1, -8(%rbp)
.L5:
cmpl $6, -8(%rbp)
jle .L7
leaq .LC1(%rip), %rax
movq %rax, %rcx
call printf
addl $1, -4(%rbp)
.L4:
cmpl $4, -4(%rbp)
jle .L8
movl $0, %eax
addq $200, %rsp
popq %rdi
popq %rbp
ret
.seh_endproc
.ident "GCC: (GNU) 11.2.0"
.def __mingw_vfprintf; .scl 2; .type 32; .endef