-
Notifications
You must be signed in to change notification settings - Fork 0
/
func_select.s.gcc
179 lines (179 loc) · 2.64 KB
/
func_select.s.gcc
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
.file "func_select.c"
.section .rodata.str1.4,"aMS",@progbits,1
.align 4
.LC0:
.string "first pstring length %d, second pstring length: %d\n"
.section .rodata.str1.1,"aMS",@progbits,1
.LC1:
.string "length: %d, string: %s\n"
.LC2:
.string "%d"
.LC3:
.string "compare result: %d\n"
.LC4:
.string "invalid option!"
.section .text.unlikely,"ax",@progbits
.LCOLDB5:
.text
.LHOTB5:
.p2align 4,,15
.globl run_func
.type run_func, @function
run_func:
pushl %esi
pushl %ebx
subl $20, %esp
movl %gs:20, %eax
movl %eax, 12(%esp)
xorl %eax, %eax
movl 32(%esp), %eax
movl 36(%esp), %ebx
movl 40(%esp), %esi
subl $50, %eax
cmpl $4, %eax
ja .L2
jmp *.L4(,%eax,4)
.section .rodata
.align 4
.align 4
.L4:
.long .L3
.long .L5
.long .L6
.long .L7
.long .L8
.text
.p2align 4,,10
.p2align 3
.L7:
subl $8, %esp
pushl %esi
pushl %ebx
call pstrcmp
addl $12, %esp
.L12:
pushl %eax
pushl $.LC3
pushl $1
call __printf_chk
addl $16, %esp
.L1:
movl 12(%esp), %eax
xorl %gs:20, %eax
jne .L15
addl $20, %esp
popl %ebx
popl %esi
ret
.p2align 4,,10
.p2align 3
.L8:
subl $8, %esp
leal 12(%esp), %eax
pushl %eax
pushl $.LC2
call __isoc99_scanf
popl %eax
popl %edx
leal 16(%esp), %eax
pushl %eax
pushl $.LC2
call __isoc99_scanf
movsbl 24(%esp), %eax
pushl %eax
movsbl 24(%esp), %eax
pushl %eax
pushl %esi
pushl %ebx
call pstrijcmp
addl $28, %esp
jmp .L12
.p2align 4,,10
.p2align 3
.L3:
subl $12, %esp
pushl %esi
call pstrlen
movl %eax, %esi
movl %ebx, (%esp)
call pstrlen
movl %esi, %edx
movsbl %al, %eax
movsbl %dl, %esi
pushl %esi
pushl %eax
pushl $.LC0
pushl $1
call __printf_chk
addl $32, %esp
jmp .L1
.p2align 4,,10
.p2align 3
.L5:
subl $8, %esp
pushl %esi
pushl %ebx
call pstrcpy
movl %ebx, (%esp)
.L13:
call pstrlen
addl $1, %ebx
movsbl %al, %eax
pushl %ebx
pushl %eax
pushl $.LC1
pushl $1
call __printf_chk
addl $20, %esp
pushl %esi
addl $1, %esi
call pstrlen
movsbl %al, %eax
pushl %esi
pushl %eax
pushl $.LC1
pushl $1
call __printf_chk
addl $32, %esp
jmp .L1
.p2align 4,,10
.p2align 3
.L6:
subl $8, %esp
leal 12(%esp), %eax
pushl %eax
pushl $.LC2
call __isoc99_scanf
popl %ecx
popl %eax
leal 16(%esp), %eax
pushl %eax
pushl $.LC2
call __isoc99_scanf
movsbl 24(%esp), %eax
pushl %eax
movsbl 24(%esp), %eax
pushl %eax
pushl %esi
pushl %ebx
call pstrijcpy
addl $20, %esp
pushl %ebx
jmp .L13
.p2align 4,,10
.p2align 3
.L2:
subl $12, %esp
pushl $.LC4
call puts
addl $16, %esp
jmp .L1
.L15:
call __stack_chk_fail
.size run_func, .-run_func
.section .text.unlikely
.LCOLDE5:
.text
.LHOTE5:
.ident "GCC: (Gentoo 4.9.2 p1.0, pie-0.6.1) 4.9.2"
.section .note.GNU-stack,"",@progbits