clarify the purpose of this project
[nyanglibc.git] / libio / iofopncook.shared.s
blobb2a72b679fe2ad82e24de06453ab1fc1dfaaa226
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .symver _IO_fopencookie,fopencookie@@GLIBC_2.2.5
7 #NO_APP
8 .p2align 4,,15
9 .type _IO_cookie_read, @function
10 _IO_cookie_read:
11 movq 232(%rdi), %rax
12 #APP
13 # 38 "iofopncook.c" 1
14 ror $2*8+1, %rax
15 xor %fs:48, %rax
16 # 0 "" 2
17 #NO_APP
18 testq %rax, %rax
19 je .L2
20 movq 224(%rdi), %rdi
21 jmp *%rax
22 .L2:
23 movq $-1, %rax
24 ret
25 .size _IO_cookie_read, .-_IO_cookie_read
26 .p2align 4,,15
27 .type _IO_cookie_write, @function
28 _IO_cookie_write:
29 movq 240(%rdi), %rax
30 #APP
31 # 53 "iofopncook.c" 1
32 ror $2*8+1, %rax
33 xor %fs:48, %rax
34 # 0 "" 2
35 #NO_APP
36 testq %rax, %rax
37 je .L10
38 pushq %rbp
39 pushq %rbx
40 movq %rdx, %rbp
41 movq %rdi, %rbx
42 subq $8, %rsp
43 movq 224(%rdi), %rdi
44 call *%rax
45 cmpq %rax, %rbp
46 jle .L4
47 orl $32, (%rbx)
48 .L4:
49 addq $8, %rsp
50 popq %rbx
51 popq %rbp
52 ret
53 .p2align 4,,10
54 .p2align 3
55 .L10:
56 orl $32, (%rdi)
57 ret
58 .size _IO_cookie_write, .-_IO_cookie_write
59 .p2align 4,,15
60 .type _IO_cookie_seek, @function
61 _IO_cookie_seek:
62 subq $24, %rsp
63 movq 248(%rdi), %rax
64 #APP
65 # 75 "iofopncook.c" 1
66 ror $2*8+1, %rax
67 xor %fs:48, %rax
68 # 0 "" 2
69 #NO_APP
70 testq %rax, %rax
71 movq %rsi, 8(%rsp)
72 je .L14
73 leaq 8(%rsp), %rsi
74 movq 224(%rdi), %rdi
75 call *%rax
76 cmpl $-1, %eax
77 je .L14
78 movq 8(%rsp), %rax
79 .L11:
80 addq $24, %rsp
81 ret
82 .p2align 4,,10
83 .p2align 3
84 .L14:
85 movq $-1, %rax
86 jmp .L11
87 .size _IO_cookie_seek, .-_IO_cookie_seek
88 .p2align 4,,15
89 .type _IO_cookie_close, @function
90 _IO_cookie_close:
91 movq 256(%rdi), %rax
92 #APP
93 # 91 "iofopncook.c" 1
94 ror $2*8+1, %rax
95 xor %fs:48, %rax
96 # 0 "" 2
97 #NO_APP
98 testq %rax, %rax
99 je .L20
100 movq 224(%rdi), %rdi
101 jmp *%rax
102 .p2align 4,,10
103 .p2align 3
104 .L20:
105 xorl %eax, %eax
107 .size _IO_cookie_close, .-_IO_cookie_close
108 .p2align 4,,15
109 .type _IO_cookie_seekoff, @function
110 _IO_cookie_seekoff:
111 movq $-1, 144(%rdi)
112 jmp __GI__IO_file_seekoff
113 .size _IO_cookie_seekoff, .-_IO_cookie_seekoff
114 .p2align 4,,15
115 .globl _IO_cookie_init
116 .type _IO_cookie_init, @function
117 _IO_cookie_init:
118 pushq %r12
119 pushq %rbp
120 movl %esi, %ebp
121 pushq %rbx
122 xorl %esi, %esi
123 movq %rdi, %rbx
124 movq %rdx, %r12
125 andl $4108, %ebp
126 call _IO_init_internal
127 leaq _IO_cookie_jumps(%rip), %rax
128 movq 32(%rsp), %rsi
129 movq 40(%rsp), %rcx
130 movq 48(%rsp), %rdx
131 movq %r12, 224(%rbx)
132 movq %rbx, %rdi
133 movq %rax, 216(%rbx)
134 movq 56(%rsp), %rax
135 #APP
136 # 142 "iofopncook.c" 1
137 xor %fs:48, %rsi
138 rol $2*8+1, %rsi
139 # 0 "" 2
140 # 143 "iofopncook.c" 1
141 xor %fs:48, %rcx
142 rol $2*8+1, %rcx
143 # 0 "" 2
144 #NO_APP
145 movq %rsi, 232(%rbx)
146 movq %rcx, 240(%rbx)
147 #APP
148 # 144 "iofopncook.c" 1
149 xor %fs:48, %rdx
150 rol $2*8+1, %rdx
151 # 0 "" 2
152 # 145 "iofopncook.c" 1
153 xor %fs:48, %rax
154 rol $2*8+1, %rax
155 # 0 "" 2
156 #NO_APP
157 movq %rdx, 248(%rbx)
158 movq %rax, 256(%rbx)
159 call _IO_new_file_init_internal
160 movl (%rbx), %esi
161 orl $128, 116(%rbx)
162 movl $-2, 112(%rbx)
163 andl $-4109, %esi
164 orl %ebp, %esi
165 movl %esi, (%rbx)
166 popq %rbx
167 popq %rbp
168 popq %r12
170 .size _IO_cookie_init, .-_IO_cookie_init
171 .p2align 4,,15
172 .globl _IO_fopencookie
173 .type _IO_fopencookie, @function
174 _IO_fopencookie:
175 pushq %r12
176 pushq %rbp
177 pushq %rbx
178 movzbl (%rsi), %eax
179 cmpb $114, %al
180 je .L26
181 cmpb $119, %al
182 je .L27
183 cmpb $97, %al
184 je .L41
185 movq __libc_errno@gottpoff(%rip), %rax
186 xorl %ebx, %ebx
187 movl $22, %fs:(%rax)
188 .L24:
189 movq %rbx, %rax
190 popq %rbx
191 popq %rbp
192 popq %r12
194 .p2align 4,,10
195 .p2align 3
196 .L41:
197 movl $4100, %r12d
198 .L28:
199 movzbl 1(%rsi), %eax
200 cmpb $43, %al
201 je .L30
202 cmpb $98, %al
203 je .L42
204 .L31:
205 movq %rdi, %rbp
206 movl $280, %edi
207 call malloc@PLT
208 testq %rax, %rax
209 movq %rax, %rbx
210 je .L24
211 leaq 264(%rax), %rax
212 movq %rbp, %rdx
213 movl %r12d, %esi
214 movq %rbx, %rdi
215 movq %rax, 136(%rbx)
216 pushq 56(%rsp)
217 pushq 56(%rsp)
218 pushq 56(%rsp)
219 pushq 56(%rsp)
220 call _IO_cookie_init@PLT
221 addq $32, %rsp
222 movq %rbx, %rax
223 popq %rbx
224 popq %rbp
225 popq %r12
227 .p2align 4,,10
228 .p2align 3
229 .L42:
230 cmpb $43, 2(%rsi)
231 jne .L31
232 .p2align 4,,10
233 .p2align 3
234 .L30:
235 andl $4096, %r12d
236 jmp .L31
237 .p2align 4,,10
238 .p2align 3
239 .L27:
240 movl $4, %r12d
241 jmp .L28
242 .p2align 4,,10
243 .p2align 3
244 .L26:
245 movl $8, %r12d
246 jmp .L28
247 .size _IO_fopencookie, .-_IO_fopencookie
248 .section __libc_IO_vtables,"aw",@progbits
249 .align 32
250 .type _IO_cookie_jumps, @object
251 .size _IO_cookie_jumps, 168
252 _IO_cookie_jumps:
253 .quad 0
254 .quad 0
255 .quad __GI__IO_file_finish
256 .quad __GI__IO_file_overflow
257 .quad __GI__IO_file_underflow
258 .quad __GI__IO_default_uflow
259 .quad __GI__IO_default_pbackfail
260 .quad __GI__IO_file_xsputn
261 .quad __GI__IO_default_xsgetn
262 .quad _IO_cookie_seekoff
263 .quad _IO_default_seekpos
264 .quad __GI__IO_file_setbuf
265 .quad __GI__IO_file_sync
266 .quad __GI__IO_file_doallocate
267 .quad _IO_cookie_read
268 .quad _IO_cookie_write
269 .quad _IO_cookie_seek
270 .quad _IO_cookie_close
271 .quad _IO_default_stat
272 .quad _IO_default_showmanyc
273 .quad _IO_default_imbue
274 .hidden _IO_new_file_init_internal
275 .hidden _IO_init_internal