clarify the purpose of this project
[nyanglibc.git] / libio / freopen64.shared.s
blob9e2599a941690806b3da29a9f0176f17dd29d22f
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 freopen64
9 .type freopen64, @function
10 freopen64:
11 .LFB68:
12 pushq %r13
13 pushq %r12
14 movq %rsi, %r12
15 pushq %rbp
16 pushq %rbx
17 movq %rdx, %rbx
18 movq %rdi, %rbp
19 subq $40, %rsp
20 movl (%rdx), %edx
21 andl $32768, %edx
22 jne .L2
23 movq 136(%rbx), %rdi
24 movq %fs:16, %r13
25 cmpq %r13, 8(%rdi)
26 je .L3
27 #APP
28 # 43 "freopen64.c" 1
29 movl %fs:24,%eax
30 # 0 "" 2
31 #NO_APP
32 testl %eax, %eax
33 jne .L4
34 movl $1, %edx
35 #APP
36 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
37 cmpxchgl %edx, (%rdi)
38 # 0 "" 2
39 #NO_APP
40 .L5:
41 movq 136(%rbx), %rdi
42 movq %r13, 8(%rdi)
43 .L3:
44 addl $1, 4(%rdi)
45 .L2:
46 movq 216(%rbx), %r13
47 leaq __start___libc_IO_vtables(%rip), %rdx
48 leaq __stop___libc_IO_vtables(%rip), %rax
49 subq %rdx, %rax
50 movq %r13, %rcx
51 subq %rdx, %rcx
52 cmpq %rcx, %rax
53 jbe .L8
54 .L10:
55 movq %rbx, %rdi
56 .LEHB0:
57 call *96(%r13)
58 movl (%rbx), %eax
59 testb $32, %ah
60 je .L26
61 testq %rbp, %rbp
62 movl 112(%rbx), %r13d
63 je .L42
64 .L12:
65 orl $32, 116(%rbx)
66 movq %rbx, %rdi
67 call __GI__IO_file_close_it
68 leaq __GI__IO_file_jumps(%rip), %rax
69 movq %rax, 216(%rbx)
70 movq 160(%rbx), %rax
71 testq %rax, %rax
72 je .L13
73 leaq __GI__IO_wfile_jumps(%rip), %rsi
74 movq %rsi, 224(%rax)
75 .L13:
76 xorl %ecx, %ecx
77 movq %r12, %rdx
78 movq %rbp, %rsi
79 movq %rbx, %rdi
80 call __GI__IO_file_fopen
81 andl $-33, 116(%rbx)
82 testq %rax, %rax
83 je .L14
84 movq %rax, %rdi
85 call __fopen_maybe_mmap
86 testq %rax, %rax
87 movq %rax, %rbp
88 je .L14
89 cmpl $-1, %r13d
90 movl $0, 192(%rax)
91 je .L39
92 movl 112(%rax), %edi
93 cmpl %r13d, %edi
94 je .L39
95 movl 116(%rax), %edx
96 movl %r13d, %esi
97 sall $13, %edx
98 andl $524288, %edx
99 call __GI___dup3
100 cmpl $-1, %eax
101 je .L43
102 movl 112(%rbp), %edi
103 call __GI___close
104 movl %r13d, 112(%rbp)
105 .L39:
106 movl (%rbx), %eax
107 jmp .L11
108 .p2align 4,,10
109 .p2align 3
110 .L14:
111 cmpl $-1, %r13d
112 je .L40
113 movl %r13d, %edi
114 call __GI___close
115 .L40:
116 movl (%rbx), %eax
117 xorl %ebp, %ebp
118 .L11:
119 testb $-128, %ah
120 jne .L1
121 movq 136(%rbx), %rdi
122 movl 4(%rdi), %eax
123 subl $1, %eax
124 testl %eax, %eax
125 movl %eax, 4(%rdi)
126 jne .L1
127 movq $0, 8(%rdi)
128 #APP
129 # 885 "../libio/libioP.h" 1
130 movl %fs:24,%edx
131 # 0 "" 2
132 #NO_APP
133 testl %edx, %edx
134 jne .L22
135 subl $1, (%rdi)
136 .L1:
137 addq $40, %rsp
138 movq %rbp, %rax
139 popq %rbx
140 popq %rbp
141 popq %r12
142 popq %r13
144 .p2align 4,,10
145 .p2align 3
146 .L42:
147 movq %rsp, %rsi
148 movl %r13d, %edi
149 call __fd_to_filename
150 movq %rax, %rbp
151 jmp .L12
152 .p2align 4,,10
153 .p2align 3
154 .L43:
155 movq %rbp, %rdi
156 call __GI__IO_file_close_it
157 jmp .L40
158 .p2align 4,,10
159 .p2align 3
160 .L8:
161 call _IO_vtable_check
162 jmp .L10
163 .p2align 4,,10
164 .p2align 3
165 .L26:
166 xorl %ebp, %ebp
167 jmp .L11
168 .p2align 4,,10
169 .p2align 3
170 .L4:
171 movl $1, %ecx
172 movl %edx, %eax
173 lock cmpxchgl %ecx, (%rdi)
174 je .L5
175 call __lll_lock_wait_private
176 .LEHE0:
177 jmp .L5
178 .p2align 4,,10
179 .p2align 3
180 .L22:
181 #APP
182 # 885 "../libio/libioP.h" 1
183 xchgl %eax, (%rdi)
184 # 0 "" 2
185 #NO_APP
186 cmpl $1, %eax
187 jle .L1
188 xorl %r10d, %r10d
189 movl $1, %edx
190 movl $129, %esi
191 movl $202, %eax
192 #APP
193 # 885 "../libio/libioP.h" 1
194 syscall
196 # 0 "" 2
197 #NO_APP
198 jmp .L1
199 .L27:
200 testl $32768, (%rbx)
201 movq %rax, %r8
202 jne .L24
203 movq 136(%rbx), %rdi
204 movl 4(%rdi), %eax
205 subl $1, %eax
206 testl %eax, %eax
207 movl %eax, 4(%rdi)
208 jne .L24
209 movq $0, 8(%rdi)
210 #APP
211 # 885 "../libio/libioP.h" 1
212 movl %fs:24,%edx
213 # 0 "" 2
214 #NO_APP
215 testl %edx, %edx
216 jne .L25
217 subl $1, (%rdi)
218 .L24:
219 movq %r8, %rdi
220 .LEHB1:
221 call _Unwind_Resume@PLT
222 .LEHE1:
223 .L25:
224 #APP
225 # 885 "../libio/libioP.h" 1
226 xchgl %eax, (%rdi)
227 # 0 "" 2
228 #NO_APP
229 subl $1, %eax
230 jle .L24
231 xorl %r10d, %r10d
232 movl $1, %edx
233 movl $129, %esi
234 movl $202, %eax
235 #APP
236 # 885 "../libio/libioP.h" 1
237 syscall
239 # 0 "" 2
240 #NO_APP
241 jmp .L24
242 .LFE68:
243 .globl __gcc_personality_v0
244 .section .gcc_except_table,"a",@progbits
245 .LLSDA68:
246 .byte 0xff
247 .byte 0xff
248 .byte 0x1
249 .uleb128 .LLSDACSE68-.LLSDACSB68
250 .LLSDACSB68:
251 .uleb128 .LEHB0-.LFB68
252 .uleb128 .LEHE0-.LEHB0
253 .uleb128 .L27-.LFB68
254 .uleb128 0
255 .uleb128 .LEHB1-.LFB68
256 .uleb128 .LEHE1-.LEHB1
257 .uleb128 0
258 .uleb128 0
259 .LLSDACSE68:
260 .text
261 .size freopen64, .-freopen64
262 .hidden DW.ref.__gcc_personality_v0
263 .weak DW.ref.__gcc_personality_v0
264 .section .data.DW.ref.__gcc_personality_v0,"awG",@progbits,DW.ref.__gcc_personality_v0,comdat
265 .align 8
266 .type DW.ref.__gcc_personality_v0, @object
267 .size DW.ref.__gcc_personality_v0, 8
268 DW.ref.__gcc_personality_v0:
269 .quad __gcc_personality_v0
270 .hidden __lll_lock_wait_private
271 .hidden _IO_vtable_check
272 .hidden __fd_to_filename
273 .hidden __fopen_maybe_mmap
274 .hidden __stop___libc_IO_vtables
275 .hidden __start___libc_IO_vtables