clarify the purpose of this project
[nyanglibc.git] / libio / iogets.s
blobfb7d88988d09e3bb170e710fd7d13d291cf774d3
1 .text
2 #APP
3 .section .gnu.warning.gets
4 .previous
5 #NO_APP
6 .p2align 4,,15
7 .globl _IO_gets
8 .type _IO_gets, @function
9 _IO_gets:
10 .LFB68:
11 pushq %r12
12 pushq %rbp
13 movq stdin(%rip), %rbp
14 pushq %rbx
15 movq %rdi, %rbx
16 movl 0(%rbp), %edx
17 andl $32768, %edx
18 jne .L21
19 movq 136(%rbp), %rcx
20 movq %fs:16, %r12
21 cmpq %r12, 8(%rcx)
22 je .L22
23 #APP
24 # 37 "iogets.c" 1
25 movl %fs:24,%eax
26 # 0 "" 2
27 #NO_APP
28 testl %eax, %eax
29 jne .L4
30 movl $1, %edx
31 #APP
32 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
33 cmpxchgl %edx, (%rcx)
34 # 0 "" 2
35 #NO_APP
36 .L5:
37 movq 136(%rbp), %rcx
38 movq stdin(%rip), %rdi
39 movq %r12, 8(%rcx)
40 .L3:
41 addl $1, 4(%rcx)
42 movq 8(%rdi), %rax
43 cmpq 16(%rdi), %rax
44 jb .L8
45 .L28:
46 .LEHB0:
47 call __uflow
48 cmpl $-1, %eax
49 jne .L10
50 .L13:
51 xorl %ebx, %ebx
52 jmp .L11
53 .p2align 4,,10
54 .p2align 3
55 .L21:
56 movq %rbp, %rdi
57 movq 8(%rdi), %rax
58 cmpq 16(%rdi), %rax
59 jnb .L28
60 .L8:
61 leaq 1(%rax), %rdx
62 movq %rdx, 8(%rdi)
63 movzbl (%rax), %eax
64 .L10:
65 cmpl $10, %eax
66 movq %rbx, %rdx
67 jne .L29
68 .L12:
69 movb $0, (%rdx)
70 .L11:
71 testl $32768, 0(%rbp)
72 jne .L1
73 movq 136(%rbp), %rdi
74 movl 4(%rdi), %eax
75 subl $1, %eax
76 testl %eax, %eax
77 movl %eax, 4(%rdi)
78 jne .L1
79 movq $0, 8(%rdi)
80 #APP
81 # 885 "libioP.h" 1
82 movl %fs:24,%edx
83 # 0 "" 2
84 #NO_APP
85 testl %edx, %edx
86 jne .L17
87 subl $1, (%rdi)
88 .L1:
89 movq %rbx, %rax
90 popq %rbx
91 popq %rbp
92 popq %r12
93 ret
94 .p2align 4,,10
95 .p2align 3
96 .L29:
97 movq stdin(%rip), %rcx
98 leaq 1(%rbx), %rsi
99 xorl %r8d, %r8d
100 movl (%rcx), %edx
101 movl %edx, %r12d
102 andl $-33, %edx
103 movl %edx, (%rcx)
104 movb %al, (%rbx)
105 movl $10, %ecx
106 movq stdin(%rip), %rdi
107 movl $2147483647, %edx
108 andl $32, %r12d
109 call _IO_getline
110 movq stdin(%rip), %rcx
111 addq $1, %rax
112 movl (%rcx), %edx
113 testb $32, %dl
114 jne .L13
115 orl %edx, %r12d
116 leaq (%rbx,%rax), %rdx
117 movl %r12d, (%rcx)
118 jmp .L12
119 .p2align 4,,10
120 .p2align 3
121 .L22:
122 movq %rbp, %rdi
123 jmp .L3
124 .p2align 4,,10
125 .p2align 3
126 .L4:
127 movl $1, %esi
128 movl %edx, %eax
129 lock cmpxchgl %esi, (%rcx)
130 je .L5
131 movq %rcx, %rdi
132 call __lll_lock_wait_private
133 .LEHE0:
134 jmp .L5
135 .p2align 4,,10
136 .p2align 3
137 .L17:
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 .L24:
157 testl $32768, 0(%rbp)
158 movq %rax, %r8
159 jne .L19
160 movq 136(%rbp), %rdi
161 movl 4(%rdi), %eax
162 subl $1, %eax
163 testl %eax, %eax
164 movl %eax, 4(%rdi)
165 jne .L19
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 .L20
174 subl $1, (%rdi)
175 .L19:
176 movq %r8, %rdi
177 .LEHB1:
178 call _Unwind_Resume@PLT
179 .LEHE1:
180 .L20:
181 #APP
182 # 885 "libioP.h" 1
183 xchgl %eax, (%rdi)
184 # 0 "" 2
185 #NO_APP
186 subl $1, %eax
187 jle .L19
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 .L19
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 .L24-.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_gets, .-_IO_gets
219 .weak gets
220 .set gets,_IO_gets
221 .section .gnu.warning.gets
222 #,"a",@progbits
223 .align 32
224 .type __evoke_link_warning_gets, @object
225 .size __evoke_link_warning_gets, 57
226 __evoke_link_warning_gets:
227 .string "the `gets' function is dangerous and should not be used."
228 .hidden DW.ref.__gcc_personality_v0
229 .weak DW.ref.__gcc_personality_v0
230 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
231 .align 8
232 .type DW.ref.__gcc_personality_v0, @object
233 .size DW.ref.__gcc_personality_v0, 8
234 DW.ref.__gcc_personality_v0:
235 .quad __gcc_personality_v0
236 .hidden __lll_lock_wait_private
237 .hidden _IO_getline
238 .hidden __uflow