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