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