clarify the purpose of this project
[nyanglibc.git] / libio / filedoalloc.shared.s
blob7bde39f4daaaec0f14388c8b15ceaf5c9698386c
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 __GI__IO_file_doallocate
9 .hidden __GI__IO_file_doallocate
10 .type __GI__IO_file_doallocate, @function
11 __GI__IO_file_doallocate:
12 pushq %r12
13 pushq %rbp
14 movq %rdi, %rbp
15 pushq %rbx
16 subq $144, %rsp
17 movl 112(%rdi), %eax
18 testl %eax, %eax
19 js .L2
20 movq 216(%rdi), %rbx
21 leaq __start___libc_IO_vtables(%rip), %rdx
22 leaq __stop___libc_IO_vtables(%rip), %rax
23 subq %rdx, %rax
24 movq %rbx, %rcx
25 subq %rdx, %rcx
26 cmpq %rcx, %rax
27 jbe .L15
28 .L3:
29 movq %rsp, %rsi
30 movq %rbp, %rdi
31 call *144(%rbx)
32 testl %eax, %eax
33 js .L2
34 movl 24(%rsp), %eax
35 andl $61440, %eax
36 cmpl $8192, %eax
37 je .L16
38 .L5:
39 movq 56(%rsp), %rbx
40 leaq -1(%rbx), %rax
41 cmpq $8190, %rax
42 ja .L2
43 .L9:
44 movq %rbx, %rdi
45 call malloc@PLT
46 movq %rax, %rsi
47 movl $-1, %eax
48 testq %rsi, %rsi
49 je .L1
50 leaq (%rsi,%rbx), %rdx
51 movl $1, %ecx
52 movq %rbp, %rdi
53 call __GI__IO_setb
54 movl $1, %eax
55 .L1:
56 addq $144, %rsp
57 popq %rbx
58 popq %rbp
59 popq %r12
60 ret
61 .p2align 4,,10
62 .p2align 3
63 .L2:
64 movl $8192, %ebx
65 jmp .L9
66 .p2align 4,,10
67 .p2align 3
68 .L16:
69 movq 40(%rsp), %rax
70 movq %rax, %rdx
71 shrq $32, %rax
72 shrq $8, %rdx
73 andl $-4096, %eax
74 andl $4095, %edx
75 orl %edx, %eax
76 subl $136, %eax
77 cmpl $7, %eax
78 ja .L6
79 .L7:
80 orl $512, 0(%rbp)
81 jmp .L5
82 .p2align 4,,10
83 .p2align 3
84 .L6:
85 movq __libc_errno@gottpoff(%rip), %rbx
86 movl 112(%rbp), %edi
87 movl %fs:(%rbx), %r12d
88 call __isatty
89 testl %eax, %eax
90 movl %r12d, %fs:(%rbx)
91 jne .L7
92 jmp .L5
93 .p2align 4,,10
94 .p2align 3
95 .L15:
96 call _IO_vtable_check
97 jmp .L3
98 .size __GI__IO_file_doallocate, .-__GI__IO_file_doallocate
99 .globl _IO_file_doallocate
100 .set _IO_file_doallocate,__GI__IO_file_doallocate
101 .hidden _IO_vtable_check
102 .hidden __isatty
103 .hidden __stop___libc_IO_vtables
104 .hidden __start___libc_IO_vtables