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