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