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