clarify the purpose of this project
[nyanglibc.git] / debug / gets_chk.s
blob48924029af9d9b72065b069ee75e3c10b3648094
1 .text
2 #APP
3 .section .gnu.warning.__gets_chk
4 .previous
5 #NO_APP
6 .p2align 4,,15
7 .globl __gets_chk
8 .type __gets_chk, @function
9 __gets_chk:
10 .LFB68:
11 pushq %r13
12 pushq %r12
13 pushq %rbp
14 pushq %rbx
15 subq $8, %rsp
16 testq %rsi, %rsi
17 je .L30
18 movq stdin(%rip), %rbp
19 movq %rdi, %rbx
20 movq %rsi, %r12
21 movl 0(%rbp), %edx
22 andl $32768, %edx
23 je .L31
24 movq %rbp, %rdi
25 movq 8(%rdi), %rax
26 cmpq 16(%rdi), %rax
27 jnb .L32
28 .L9:
29 leaq 1(%rax), %rdx
30 movq %rdx, 8(%rdi)
31 movzbl (%rax), %eax
32 .L11:
33 xorl %edx, %edx
34 cmpl $10, %eax
35 je .L13
36 movq stdin(%rip), %rcx
37 leaq 1(%rbx), %rsi
38 xorl %r8d, %r8d
39 movl (%rcx), %edx
40 movl %edx, %r13d
41 andl $-33, %edx
42 movl %edx, (%rcx)
43 movb %al, (%rbx)
44 leaq -1(%r12), %rdx
45 movq stdin(%rip), %rdi
46 movl $10, %ecx
47 andl $32, %r13d
48 .LEHB0:
49 call _IO_getline
50 movq stdin(%rip), %rcx
51 leaq 1(%rax), %rdx
52 movl (%rcx), %eax
53 testb $32, %al
54 jne .L14
55 orl %eax, %r13d
56 movl %r13d, (%rcx)
57 .L13:
58 cmpq %r12, %rdx
59 jnb .L33
60 movb $0, (%rbx,%rdx)
61 .L12:
62 testl $32768, 0(%rbp)
63 jne .L1
64 movq 136(%rbp), %rdi
65 movl 4(%rdi), %eax
66 subl $1, %eax
67 testl %eax, %eax
68 movl %eax, 4(%rdi)
69 jne .L1
70 movq $0, 8(%rdi)
71 #APP
72 # 885 "../libio/libioP.h" 1
73 movl %fs:24,%edx
74 # 0 "" 2
75 #NO_APP
76 testl %edx, %edx
77 jne .L19
78 subl $1, (%rdi)
79 .L1:
80 addq $8, %rsp
81 movq %rbx, %rax
82 popq %rbx
83 popq %rbp
84 popq %r12
85 popq %r13
86 ret
87 .p2align 4,,10
88 .p2align 3
89 .L31:
90 movq 136(%rbp), %rcx
91 movq %fs:16, %r13
92 cmpq %r13, 8(%rcx)
93 je .L24
94 #APP
95 # 40 "gets_chk.c" 1
96 movl %fs:24,%eax
97 # 0 "" 2
98 #NO_APP
99 testl %eax, %eax
100 jne .L5
101 movl $1, %edx
102 #APP
103 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
104 cmpxchgl %edx, (%rcx)
105 # 0 "" 2
106 #NO_APP
107 .L6:
108 movq 136(%rbp), %rcx
109 movq stdin(%rip), %rdi
110 movq %r13, 8(%rcx)
111 .L4:
112 addl $1, 4(%rcx)
113 movq 8(%rdi), %rax
114 cmpq 16(%rdi), %rax
115 jb .L9
116 .L32:
117 call __uflow
118 cmpl $-1, %eax
119 jne .L11
120 .L14:
121 xorl %ebx, %ebx
122 jmp .L12
123 .p2align 4,,10
124 .p2align 3
125 .L24:
126 movq %rbp, %rdi
127 jmp .L4
128 .p2align 4,,10
129 .p2align 3
130 .L5:
131 movl $1, %esi
132 movl %edx, %eax
133 lock cmpxchgl %esi, (%rcx)
134 je .L6
135 movq %rcx, %rdi
136 call __lll_lock_wait_private
137 jmp .L6
138 .p2align 4,,10
139 .p2align 3
140 .L19:
141 #APP
142 # 885 "../libio/libioP.h" 1
143 xchgl %eax, (%rdi)
144 # 0 "" 2
145 #NO_APP
146 cmpl $1, %eax
147 jle .L1
148 xorl %r10d, %r10d
149 movl $1, %edx
150 movl $129, %esi
151 movl $202, %eax
152 #APP
153 # 885 "../libio/libioP.h" 1
154 syscall
156 # 0 "" 2
157 #NO_APP
158 jmp .L1
159 .L33:
160 call __chk_fail
161 .LEHE0:
162 .L26:
163 testl $32768, 0(%rbp)
164 movq %rax, %r8
165 jne .L21
166 movq 136(%rbp), %rdi
167 movl 4(%rdi), %eax
168 subl $1, %eax
169 testl %eax, %eax
170 movl %eax, 4(%rdi)
171 jne .L21
172 movq $0, 8(%rdi)
173 #APP
174 # 885 "../libio/libioP.h" 1
175 movl %fs:24,%edx
176 # 0 "" 2
177 #NO_APP
178 testl %edx, %edx
179 jne .L22
180 subl $1, (%rdi)
181 .L21:
182 movq %r8, %rdi
183 .LEHB1:
184 call _Unwind_Resume@PLT
185 .L30:
186 call __chk_fail
187 .LEHE1:
188 .L22:
189 #APP
190 # 885 "../libio/libioP.h" 1
191 xchgl %eax, (%rdi)
192 # 0 "" 2
193 #NO_APP
194 subl $1, %eax
195 jle .L21
196 xorl %r10d, %r10d
197 movl $1, %edx
198 movl $129, %esi
199 movl $202, %eax
200 #APP
201 # 885 "../libio/libioP.h" 1
202 syscall
204 # 0 "" 2
205 #NO_APP
206 jmp .L21
207 .LFE68:
208 .globl __gcc_personality_v0
209 .section .gcc_except_table,"a",@progbits
210 .LLSDA68:
211 .byte 0xff
212 .byte 0xff
213 .byte 0x1
214 .uleb128 .LLSDACSE68-.LLSDACSB68
215 .LLSDACSB68:
216 .uleb128 .LEHB0-.LFB68
217 .uleb128 .LEHE0-.LEHB0
218 .uleb128 .L26-.LFB68
219 .uleb128 0
220 .uleb128 .LEHB1-.LFB68
221 .uleb128 .LEHE1-.LEHB1
222 .uleb128 0
223 .uleb128 0
224 .LLSDACSE68:
225 .text
226 .size __gets_chk, .-__gets_chk
227 .section .gnu.warning.__gets_chk
228 #,"a",@progbits
229 .align 32
230 .type __evoke_link_warning___gets_chk, @object
231 .size __evoke_link_warning___gets_chk, 57
232 __evoke_link_warning___gets_chk:
233 .string "the `gets' function is dangerous and should not be used."
234 .hidden DW.ref.__gcc_personality_v0
235 .weak DW.ref.__gcc_personality_v0
236 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
237 .align 8
238 .type DW.ref.__gcc_personality_v0, @object
239 .size DW.ref.__gcc_personality_v0, 8
240 DW.ref.__gcc_personality_v0:
241 .quad __gcc_personality_v0
242 .hidden __chk_fail
243 .hidden __lll_lock_wait_private
244 .hidden __uflow
245 .hidden _IO_getline