clarify the purpose of this project
[nyanglibc.git] / libio / iofclose.s
blob0899504da1e434b5ad3a9477752a72767443798f
1 .text
2 .p2align 4,,15
3 .globl _IO_new_fclose
4 .type _IO_new_fclose, @function
5 _IO_new_fclose:
6 .LFB77:
7 pushq %r12
8 pushq %rbp
9 pushq %rbx
10 movl (%rdi), %eax
11 movq %rdi, %rbx
12 testb $32, %ah
13 jne .L36
14 movl %eax, %edx
15 andl $32768, %edx
16 je .L27
17 .L28:
18 sall $26, %eax
19 sarl $31, %eax
20 movl %eax, %ebp
21 .L10:
22 testl %edx, %edx
23 jne .L12
24 movq 136(%rbx), %rdi
25 subl $1, 4(%rdi)
26 je .L37
27 .L12:
28 movq 216(%rbx), %r12
29 movq __start___libc_IO_vtables@GOTPCREL(%rip), %rdx
30 movq __stop___libc_IO_vtables@GOTPCREL(%rip), %rax
31 movq %r12, %rcx
32 subq %rdx, %rax
33 subq %rdx, %rcx
34 cmpq %rcx, %rax
35 jbe .L38
36 .L15:
37 xorl %esi, %esi
38 movq %rbx, %rdi
39 .LEHB0:
40 call *16(%r12)
41 movl 192(%rbx), %eax
42 testl %eax, %eax
43 jle .L16
44 movq 152(%rbx), %r12
45 #APP
46 # 64 "iofclose.c" 1
47 movl %fs:24,%eax
48 # 0 "" 2
49 #NO_APP
50 testl %eax, %eax
51 jne .L17
52 movl $1, %edx
53 #APP
54 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
55 cmpxchgl %edx, __gconv_lock(%rip)
56 # 0 "" 2
57 #NO_APP
58 .L18:
59 movq (%r12), %rdi
60 call __gconv_release_step
61 movq 56(%r12), %rdi
62 call __gconv_release_step
63 .LEHE0:
64 #APP
65 # 67 "iofclose.c" 1
66 movl %fs:24,%eax
67 # 0 "" 2
68 #NO_APP
69 testl %eax, %eax
70 jne .L19
71 subl $1, __gconv_lock(%rip)
72 .L20:
73 leaq _IO_2_1_stdout_(%rip), %rax
74 cmpq %rax, %rbx
75 leaq _IO_2_1_stdin_(%rip), %rax
76 sete %dl
77 cmpq %rax, %rbx
78 sete %al
79 orb %al, %dl
80 jne .L1
81 leaq _IO_2_1_stderr_(%rip), %rax
82 cmpq %rax, %rbx
83 jne .L39
84 .L1:
85 movl %ebp, %eax
86 popq %rbx
87 popq %rbp
88 popq %r12
89 ret
90 .p2align 4,,10
91 .p2align 3
92 .L36:
93 call _IO_un_link
94 movl (%rbx), %eax
95 testb $-128, %ah
96 jne .L3
97 .L27:
98 movq 136(%rbx), %rdi
99 movq %fs:16, %rbp
100 cmpq %rbp, 8(%rdi)
101 je .L4
102 #APP
103 # 51 "iofclose.c" 1
104 movl %fs:24,%eax
105 # 0 "" 2
106 #NO_APP
107 testl %eax, %eax
108 jne .L5
109 movl $1, %edx
110 #APP
111 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
112 cmpxchgl %edx, (%rdi)
113 # 0 "" 2
114 #NO_APP
115 .L6:
116 movq 136(%rbx), %rdi
117 movl (%rbx), %eax
118 movq %rbp, 8(%rdi)
119 .L4:
120 addl $1, 4(%rdi)
121 .L3:
122 movl %eax, %edx
123 andl $32768, %edx
124 testb $32, %ah
125 je .L28
126 movq %rbx, %rdi
127 .LEHB1:
128 call _IO_file_close_it
129 .LEHE1:
130 movl (%rbx), %edx
131 movl %eax, %ebp
132 andl $32768, %edx
133 jmp .L10
134 .p2align 4,,10
135 .p2align 3
136 .L39:
137 movq %rbx, %rdi
138 call free@PLT
139 movl %ebp, %eax
140 popq %rbx
141 popq %rbp
142 popq %r12
144 .p2align 4,,10
145 .p2align 3
146 .L37:
147 movq $0, 8(%rdi)
148 #APP
149 # 885 "libioP.h" 1
150 movl %fs:24,%eax
151 # 0 "" 2
152 #NO_APP
153 testl %eax, %eax
154 jne .L14
155 subl $1, (%rdi)
156 jmp .L12
157 .p2align 4,,10
158 .p2align 3
159 .L16:
160 cmpq $0, 72(%rbx)
161 je .L20
162 movq %rbx, %rdi
163 call _IO_free_backup_area
164 jmp .L20
165 .p2align 4,,10
166 .p2align 3
167 .L38:
168 .LEHB2:
169 call _IO_vtable_check
170 jmp .L15
171 .p2align 4,,10
172 .p2align 3
173 .L19:
174 xorl %eax, %eax
175 #APP
176 # 67 "iofclose.c" 1
177 xchgl %eax, __gconv_lock(%rip)
178 # 0 "" 2
179 #NO_APP
180 cmpl $1, %eax
181 jle .L20
182 xorl %r10d, %r10d
183 movl $1, %edx
184 movl $129, %esi
185 leaq __gconv_lock(%rip), %rdi
186 movl $202, %eax
187 #APP
188 # 67 "iofclose.c" 1
189 syscall
191 # 0 "" 2
192 #NO_APP
193 jmp .L20
194 .p2align 4,,10
195 .p2align 3
196 .L17:
197 xorl %eax, %eax
198 movl $1, %edx
199 lock cmpxchgl %edx, __gconv_lock(%rip)
200 je .L18
201 leaq __gconv_lock(%rip), %rdi
202 call __lll_lock_wait_private
203 .LEHE2:
204 jmp .L18
205 .p2align 4,,10
206 .p2align 3
207 .L5:
208 xorl %eax, %eax
209 movl $1, %edx
210 lock cmpxchgl %edx, (%rdi)
211 je .L6
212 .LEHB3:
213 call __lll_lock_wait_private
214 .LEHE3:
215 jmp .L6
216 .p2align 4,,10
217 .p2align 3
218 .L14:
219 #APP
220 # 885 "libioP.h" 1
221 xchgl %edx, (%rdi)
222 # 0 "" 2
223 #NO_APP
224 cmpl $1, %edx
225 jle .L12
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 .L12
237 .L29:
238 testl $32768, (%rbx)
239 movq %rax, %r8
240 jne .L25
241 movq 136(%rbx), %rdi
242 movl 4(%rdi), %eax
243 subl $1, %eax
244 testl %eax, %eax
245 movl %eax, 4(%rdi)
246 jne .L25
247 movq $0, 8(%rdi)
248 #APP
249 # 885 "libioP.h" 1
250 movl %fs:24,%edx
251 # 0 "" 2
252 #NO_APP
253 testl %edx, %edx
254 jne .L26
255 subl $1, (%rdi)
256 .L25:
257 movq %r8, %rdi
258 .LEHB4:
259 call _Unwind_Resume@PLT
260 .LEHE4:
261 .L26:
262 #APP
263 # 885 "libioP.h" 1
264 xchgl %eax, (%rdi)
265 # 0 "" 2
266 #NO_APP
267 subl $1, %eax
268 jle .L25
269 xorl %r10d, %r10d
270 movl $1, %edx
271 movl $129, %esi
272 movl $202, %eax
273 #APP
274 # 885 "libioP.h" 1
275 syscall
277 # 0 "" 2
278 #NO_APP
279 jmp .L25
280 .LFE77:
281 .globl __gcc_personality_v0
282 .section .gcc_except_table,"a",@progbits
283 .LLSDA77:
284 .byte 0xff
285 .byte 0xff
286 .byte 0x1
287 .uleb128 .LLSDACSE77-.LLSDACSB77
288 .LLSDACSB77:
289 .uleb128 .LEHB0-.LFB77
290 .uleb128 .LEHE0-.LEHB0
291 .uleb128 0
292 .uleb128 0
293 .uleb128 .LEHB1-.LFB77
294 .uleb128 .LEHE1-.LEHB1
295 .uleb128 .L29-.LFB77
296 .uleb128 0
297 .uleb128 .LEHB2-.LFB77
298 .uleb128 .LEHE2-.LEHB2
299 .uleb128 0
300 .uleb128 0
301 .uleb128 .LEHB3-.LFB77
302 .uleb128 .LEHE3-.LEHB3
303 .uleb128 .L29-.LFB77
304 .uleb128 0
305 .uleb128 .LEHB4-.LFB77
306 .uleb128 .LEHE4-.LEHB4
307 .uleb128 0
308 .uleb128 0
309 .LLSDACSE77:
310 .text
311 .size _IO_new_fclose, .-_IO_new_fclose
312 .globl __new_fclose
313 .set __new_fclose,_IO_new_fclose
314 .weak fclose
315 .set fclose,__new_fclose
316 .weak _IO_fclose
317 .set _IO_fclose,_IO_new_fclose
318 .weak __stop___libc_IO_vtables
319 .weak __start___libc_IO_vtables
320 .hidden DW.ref.__gcc_personality_v0
321 .weak DW.ref.__gcc_personality_v0
322 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
323 .align 8
324 .type DW.ref.__gcc_personality_v0, @object
325 .size DW.ref.__gcc_personality_v0, 8
326 DW.ref.__gcc_personality_v0:
327 .quad __gcc_personality_v0
328 .hidden __lll_lock_wait_private
329 .hidden _IO_vtable_check
330 .hidden _IO_free_backup_area
331 .hidden _IO_file_close_it
332 .hidden _IO_un_link
333 .hidden __gconv_release_step
334 .hidden __gconv_lock