clarify the purpose of this project
[nyanglibc.git] / libio / iogetdelim.s
blob1bda091d5e93387ef549fd68c8d60ad889d1a4d6
1 .text
2 .p2align 4,,15
3 .globl _IO_getdelim
4 .type _IO_getdelim, @function
5 _IO_getdelim:
6 .LFB68:
7 pushq %r15
8 pushq %r14
9 pushq %r13
10 pushq %r12
11 pushq %rbp
12 pushq %rbx
13 subq $40, %rsp
14 testq %rdi, %rdi
15 je .L33
16 testq %rsi, %rsi
17 je .L33
18 movl %edx, 28(%rsp)
19 movl (%rcx), %edx
20 movq %rcx, %rbx
21 movq %rsi, 8(%rsp)
22 movq %rdi, %rbp
23 movl %edx, %ecx
24 andl $32768, %ecx
25 jne .L5
26 movq 136(%rbx), %rdi
27 movq %fs:16, %r13
28 cmpq %r13, 8(%rdi)
29 je .L6
30 #APP
31 # 52 "iogetdelim.c" 1
32 movl %fs:24,%eax
33 # 0 "" 2
34 #NO_APP
35 testl %eax, %eax
36 movl $1, %edx
37 jne .L7
38 #APP
39 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
40 cmpxchgl %edx, (%rdi)
41 # 0 "" 2
42 #NO_APP
43 .L8:
44 movq 136(%rbx), %rdi
45 movl (%rbx), %eax
46 addl $1, 4(%rdi)
47 testb $32, %al
48 movq %r13, 8(%rdi)
49 jne .L29
50 .L27:
51 cmpq $0, 0(%rbp)
52 je .L12
53 movq 8(%rsp), %rax
54 cmpq $0, (%rax)
55 jne .L15
56 .L12:
57 movq 8(%rsp), %rax
58 movl $120, %edi
59 movq $120, (%rax)
60 call malloc@PLT
61 testq %rax, %rax
62 movq %rax, 0(%rbp)
63 je .L40
64 .L15:
65 movq 8(%rbx), %r10
66 movq 16(%rbx), %r14
67 subq %r10, %r14
68 testq %r14, %r14
69 jle .L42
70 .L14:
71 xorl %r15d, %r15d
72 jmp .L22
73 .p2align 4,,10
74 .p2align 3
75 .L18:
76 movq 8(%rsp), %rcx
77 leaq (%r15,%r14), %r13
78 movq 0(%rbp), %rdi
79 leaq 1(%r13), %rax
80 movq (%rcx), %rdx
81 cmpq %rax, %rdx
82 jnb .L19
83 addq %rdx, %rdx
84 cmpq %rax, %rdx
85 cmovb %rax, %rdx
86 movq %rdx, %rsi
87 movq %rdx, 16(%rsp)
88 call realloc@PLT
89 testq %rax, %rax
90 movq %rax, %rdi
91 movq 16(%rsp), %rdx
92 je .L40
93 movq %rax, 0(%rbp)
94 movq 8(%rsp), %rax
95 movq 8(%rbx), %r10
96 movq %rdx, (%rax)
97 .L19:
98 addq %r15, %rdi
99 movq %r14, %rdx
100 movq %r10, %rsi
101 call memcpy@PLT
102 addq %r14, 8(%rbx)
103 testq %r12, %r12
104 jne .L21
105 movq %rbx, %rdi
106 .LEHB0:
107 call __underflow
108 cmpl $-1, %eax
109 je .L21
110 movq 8(%rbx), %r10
111 movq 16(%rbx), %r14
112 movq %r13, %r15
113 subq %r10, %r14
114 .L22:
115 movl 28(%rsp), %esi
116 movq %r14, %rdx
117 movq %r10, %rdi
118 movq %r10, 16(%rsp)
119 call memchr
120 movq 16(%rsp), %r10
121 movq %rax, %r12
122 subq %r10, %rax
123 addq $1, %rax
124 testq %r12, %r12
125 cmovne %rax, %r14
126 movabsq $9223372036854775807, %rax
127 subq %r15, %rax
128 cmpq %r14, %rax
129 jg .L18
130 movq __libc_errno@gottpoff(%rip), %rax
131 movq $-1, %r13
132 movl $75, %fs:(%rax)
133 movl (%rbx), %eax
134 .L11:
135 testb $-128, %ah
136 jne .L1
137 movq 136(%rbx), %rdi
138 .L28:
139 movl 4(%rdi), %eax
140 subl $1, %eax
141 testl %eax, %eax
142 movl %eax, 4(%rdi)
143 jne .L1
144 movq $0, 8(%rdi)
145 #APP
146 # 885 "libioP.h" 1
147 movl %fs:24,%edx
148 # 0 "" 2
149 #NO_APP
150 testl %edx, %edx
151 jne .L23
152 subl $1, (%rdi)
153 jmp .L1
154 .p2align 4,,10
155 .p2align 3
156 .L5:
157 andl $32, %edx
158 je .L27
159 movq $-1, %r13
160 .L1:
161 addq $40, %rsp
162 movq %r13, %rax
163 popq %rbx
164 popq %rbp
165 popq %r12
166 popq %r13
167 popq %r14
168 popq %r15
170 .p2align 4,,10
171 .p2align 3
172 .L29:
173 movq $-1, %r13
174 jmp .L11
175 .p2align 4,,10
176 .p2align 3
177 .L40:
178 movl (%rbx), %eax
179 movq $-1, %r13
180 jmp .L11
181 .p2align 4,,10
182 .p2align 3
183 .L6:
184 addl $1, 4(%rdi)
185 andl $32, %edx
186 je .L27
187 movq $-1, %r13
188 jmp .L28
189 .p2align 4,,10
190 .p2align 3
191 .L21:
192 movq 0(%rbp), %rax
193 movb $0, (%rax,%r13)
194 movl (%rbx), %eax
195 jmp .L11
196 .p2align 4,,10
197 .p2align 3
198 .L42:
199 movq %rbx, %rdi
200 call __underflow
201 cmpl $-1, %eax
202 je .L40
203 movq 8(%rbx), %r10
204 movq 16(%rbx), %r14
205 subq %r10, %r14
206 jmp .L14
207 .p2align 4,,10
208 .p2align 3
209 .L7:
210 movl %ecx, %eax
211 lock cmpxchgl %edx, (%rdi)
212 je .L8
213 call __lll_lock_wait_private
214 .LEHE0:
215 jmp .L8
216 .p2align 4,,10
217 .p2align 3
218 .L23:
219 #APP
220 # 885 "libioP.h" 1
221 xchgl %eax, (%rdi)
222 # 0 "" 2
223 #NO_APP
224 cmpl $1, %eax
225 jle .L1
226 xorl %r10d, %r10d
227 movl $1, %edx
228 movl $129, %esi
229 movl $202, %eax
230 #APP
231 # 885 "libioP.h" 1
232 syscall
234 # 0 "" 2
235 #NO_APP
236 jmp .L1
237 .L33:
238 movq __libc_errno@gottpoff(%rip), %rax
239 movq $-1, %r13
240 movl $22, %fs:(%rax)
241 jmp .L1
242 .L32:
243 testl $32768, (%rbx)
244 movq %rax, %r8
245 jne .L25
246 movq 136(%rbx), %rdi
247 movl 4(%rdi), %eax
248 subl $1, %eax
249 testl %eax, %eax
250 movl %eax, 4(%rdi)
251 jne .L25
252 movq $0, 8(%rdi)
253 #APP
254 # 885 "libioP.h" 1
255 movl %fs:24,%edx
256 # 0 "" 2
257 #NO_APP
258 testl %edx, %edx
259 jne .L26
260 subl $1, (%rdi)
261 .L25:
262 movq %r8, %rdi
263 .LEHB1:
264 call _Unwind_Resume@PLT
265 .LEHE1:
266 .L26:
267 #APP
268 # 885 "libioP.h" 1
269 xchgl %eax, (%rdi)
270 # 0 "" 2
271 #NO_APP
272 subl $1, %eax
273 jle .L25
274 xorl %r10d, %r10d
275 movl $1, %edx
276 movl $129, %esi
277 movl $202, %eax
278 #APP
279 # 885 "libioP.h" 1
280 syscall
282 # 0 "" 2
283 #NO_APP
284 jmp .L25
285 .LFE68:
286 .globl __gcc_personality_v0
287 .section .gcc_except_table,"a",@progbits
288 .LLSDA68:
289 .byte 0xff
290 .byte 0xff
291 .byte 0x1
292 .uleb128 .LLSDACSE68-.LLSDACSB68
293 .LLSDACSB68:
294 .uleb128 .LEHB0-.LFB68
295 .uleb128 .LEHE0-.LEHB0
296 .uleb128 .L32-.LFB68
297 .uleb128 0
298 .uleb128 .LEHB1-.LFB68
299 .uleb128 .LEHE1-.LEHB1
300 .uleb128 0
301 .uleb128 0
302 .LLSDACSE68:
303 .text
304 .size _IO_getdelim, .-_IO_getdelim
305 .weak getdelim
306 .set getdelim,_IO_getdelim
307 .weak __getdelim
308 .set __getdelim,_IO_getdelim
309 .hidden DW.ref.__gcc_personality_v0
310 .weak DW.ref.__gcc_personality_v0
311 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
312 .align 8
313 .type DW.ref.__gcc_personality_v0, @object
314 .size DW.ref.__gcc_personality_v0, 8
315 DW.ref.__gcc_personality_v0:
316 .quad __gcc_personality_v0
317 .hidden __lll_lock_wait_private
318 .hidden memchr
319 .hidden __underflow