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