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