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