clarify the purpose of this project
[nyanglibc.git] / io / posix_fallocate64.s
blob3395aef2b613a3a4335ef374403897082c1c8d03
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string ""
5 .text
6 .p2align 4,,15
7 .type internal_fallocate64, @function
8 internal_fallocate64:
9 pushq %r15
10 pushq %r14
11 pushq %r13
12 pushq %r12
13 pushq %rbp
14 pushq %rbx
15 subq $296, %rsp
16 testq %rsi, %rsi
17 js .L15
18 testq %rdx, %rdx
19 movq %rdx, %rbx
20 js .L15
21 movq %rsi, %rax
22 movq %rsi, %r15
23 movl $27, %ebp
24 addq %rdx, %rax
25 js .L1
26 xorl %edx, %edx
27 xorl %eax, %eax
28 movl $3, %esi
29 movl %edi, %r13d
30 call __fcntl
31 testl %eax, %eax
32 js .L4
33 testb $4, %ah
34 jne .L4
35 leaq 144(%rsp), %rsi
36 movl %r13d, %edi
37 call __fstat64
38 testl %eax, %eax
39 movl %eax, %ebp
40 jne .L4
41 movl 168(%rsp), %eax
42 andl $61440, %eax
43 cmpl $4096, %eax
44 je .L17
45 cmpl $32768, %eax
46 jne .L18
47 testq %rbx, %rbx
48 jne .L5
49 cmpq %r15, 192(%rsp)
50 jge .L1
51 movq %r15, %rsi
52 movl %r13d, %edi
53 call __ftruncate64
54 testl %eax, %eax
55 je .L1
56 .L32:
57 movq __libc_errno@gottpoff(%rip), %rax
58 movl %fs:(%rax), %ebp
59 .L1:
60 addq $296, %rsp
61 movl %ebp, %eax
62 popq %rbx
63 popq %rbp
64 popq %r12
65 popq %r13
66 popq %r14
67 popq %r15
68 ret
69 .p2align 4,,10
70 .p2align 3
71 .L4:
72 movl $9, %ebp
73 jmp .L1
74 .p2align 4,,10
75 .p2align 3
76 .L15:
77 movl $22, %ebp
78 jmp .L1
79 .p2align 4,,10
80 .p2align 3
81 .L5:
82 leaq 16(%rsp), %rsi
83 movl %r13d, %edi
84 movq %rsi, 8(%rsp)
85 call __fstatfs64
86 testl %eax, %eax
87 jne .L32
88 movq 24(%rsp), %rax
89 movl $512, %r14d
90 testq %rax, %rax
91 je .L9
92 movl %eax, %r14d
93 cmpq $4096, %rax
94 movl $4096, %eax
95 cmovge %rax, %r14
96 .L9:
97 leaq -1(%rbx), %rax
98 leaq .LC0(%rip), %r12
99 cqto
100 idivq %r14
101 addq %rdx, %r15
102 jmp .L14
103 .p2align 4,,10
104 .p2align 3
105 .L10:
106 movq %r15, %rcx
107 movl $1, %edx
108 movq %r12, %rsi
109 movl %r13d, %edi
110 call __libc_pwrite64
111 cmpq $1, %rax
112 jne .L32
113 .L13:
114 addq %r14, %r15
115 testq %rbx, %rbx
116 jle .L1
117 .L14:
118 subq %r14, %rbx
119 cmpq %r15, 192(%rsp)
120 jle .L10
121 movq 8(%rsp), %rsi
122 movq %r15, %rcx
123 movl $1, %edx
124 movl %r13d, %edi
125 call __libc_pread64
126 testq %rax, %rax
127 js .L32
128 cmpq $1, %rax
129 jne .L10
130 cmpb $0, 16(%rsp)
131 je .L10
132 jmp .L13
133 .p2align 4,,10
134 .p2align 3
135 .L18:
136 movl $19, %ebp
137 jmp .L1
138 .p2align 4,,10
139 .p2align 3
140 .L17:
141 movl $29, %ebp
142 jmp .L1
143 .size internal_fallocate64, .-internal_fallocate64
144 .p2align 4,,15
145 .globl __posix_fallocate64_l64
146 .hidden __posix_fallocate64_l64
147 .type __posix_fallocate64_l64, @function
148 __posix_fallocate64_l64:
149 pushq %rbx
150 movq %rsi, %r9
151 movq %rdx, %rbx
152 movq %rdx, %r10
153 movl $285, %eax
154 movq %rsi, %rdx
155 xorl %esi, %esi
156 #APP
157 # 31 "../sysdeps/unix/sysv/linux/posix_fallocate64.c" 1
158 syscall
160 # 0 "" 2
161 #NO_APP
162 cmpl $-4096, %eax
163 jbe .L37
164 cmpl $-95, %eax
165 je .L36
166 negl %eax
167 popq %rbx
169 .p2align 4,,10
170 .p2align 3
171 .L37:
172 xorl %eax, %eax
173 popq %rbx
175 .p2align 4,,10
176 .p2align 3
177 .L36:
178 movq %rbx, %rdx
179 movq %r9, %rsi
180 popq %rbx
181 jmp internal_fallocate64
182 .size __posix_fallocate64_l64, .-__posix_fallocate64_l64
183 .globl posix_fallocate64
184 .set posix_fallocate64,__posix_fallocate64_l64
185 .hidden __libc_pread64
186 .hidden __libc_pwrite64
187 .hidden __fstatfs64
188 .hidden __ftruncate64
189 .hidden __fstat64
190 .hidden __fcntl