clarify the purpose of this project
[nyanglibc.git] / posix / pathconf.shared.s
blob9c4c871ed4939e363762c70347c07ae74339df39
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 "/sys/dev/block/%u:%u"
9 .LC1:
10 .string "/sys/fs/ext4/%s"
11 .LC2:
12 .string "r"
13 .LC3:
14 .string "/proc/mounts"
15 .LC4:
16 .string "/etc/mtab"
17 .LC5:
18 .string "ext2"
19 .LC6:
20 .string "ext3"
21 .LC7:
22 .string "ext4"
23 #NO_APP
24 .text
25 .p2align 4,,15
26 .type distinguish_extX.isra.0, @function
27 distinguish_extX.isra.0:
28 .LFB78:
29 pushq %rbp
30 movq %rsp, %rbp
31 pushq %r15
32 pushq %r14
33 pushq %r13
34 pushq %r12
35 pushq %rbx
36 subq $5528, %rsp
37 testq %rdi, %rdi
38 je .L31
39 leaq -5456(%rbp), %rsi
40 call __GI___stat64
41 testl %eax, %eax
42 setne %al
43 .L3:
44 testb %al, %al
45 jne .L4
46 movq -5456(%rbp), %rax
47 leaq -5520(%rbp), %r12
48 leaq -4144(%rbp), %rbx
49 movq %r12, %rdi
50 movq %rax, %rcx
51 movzbl %al, %esi
52 movq %rax, %r8
53 shrq $8, %rcx
54 shrq $32, %rax
55 shrq $12, %r8
56 movl %ecx, %edx
57 movq %rax, %rcx
58 xorb %r8b, %r8b
59 andl $4095, %edx
60 andl $-4096, %ecx
61 orl %esi, %r8d
62 orl %edx, %ecx
63 leaq .LC0(%rip), %rdx
64 movl $64, %esi
65 xorl %eax, %eax
66 call __GI___snprintf
67 movl $4096, %edx
68 movq %rbx, %rsi
69 movq %r12, %rdi
70 call __readlink
71 cmpq $4095, %rax
72 jbe .L32
73 leaq .LC2(%rip), %rsi
74 leaq .LC3(%rip), %rdi
75 call __GI___setmntent
76 testq %rax, %rax
77 movq %rax, %rbx
78 je .L33
79 .L7:
80 orl $32768, (%rbx)
81 leaq -5168(%rbp), %r13
82 leaq -5568(%rbp), %r12
83 leaq .LC5(%rip), %r14
84 leaq -5312(%rbp), %r15
85 .p2align 4,,10
86 .p2align 3
87 .L8:
88 movl $1024, %ecx
89 movq %r13, %rdx
90 movq %r12, %rsi
91 movq %rbx, %rdi
92 call __GI___getmntent_r
93 testq %rax, %rax
94 je .L34
95 movq -5552(%rbp), %rax
96 movl $5, %ecx
97 movq %r14, %rdi
98 movq %rax, %rsi
99 repz cmpsb
100 je .L9
101 leaq .LC6(%rip), %rdi
102 movl $5, %ecx
103 movq %rax, %rsi
104 repz cmpsb
105 je .L9
106 leaq .LC7(%rip), %rdi
107 movl $5, %ecx
108 movq %rax, %rsi
109 repz cmpsb
110 jne .L8
111 .L9:
112 movq -5560(%rbp), %rdi
113 movq %r15, %rsi
114 call __GI___stat64
115 testl %eax, %eax
116 js .L8
117 movq -5312(%rbp), %rax
118 cmpq %rax, -5456(%rbp)
119 jne .L8
120 movq -5552(%rbp), %rsi
121 leaq .LC7(%rip), %rdi
122 movl $5, %ecx
123 repz cmpsb
124 seta %al
125 setb %dl
126 subl %edx, %eax
127 movsbl %al, %eax
128 cmpl $1, %eax
129 sbbq %r12, %r12
130 andl $33000, %r12d
131 addq $32000, %r12
132 .L12:
133 movq %rbx, %rdi
134 call __GI___endmntent
135 jmp .L1
136 .p2align 4,,10
137 .p2align 3
138 .L33:
139 leaq .LC2(%rip), %rsi
140 leaq .LC4(%rip), %rdi
141 call __GI___setmntent
142 testq %rax, %rax
143 movq %rax, %rbx
144 jne .L7
145 .p2align 4,,10
146 .p2align 3
147 .L4:
148 movl $32000, %r12d
149 .L1:
150 leaq -40(%rbp), %rsp
151 movq %r12, %rax
152 popq %rbx
153 popq %r12
154 popq %r13
155 popq %r14
156 popq %r15
157 popq %rbp
159 .p2align 4,,10
160 .p2align 3
161 .L32:
162 movq %rbx, %rdi
163 movb $0, -4144(%rbp,%rax)
164 call __GI___basename
165 movq %rax, %rdi
166 movq %rax, %r12
167 call __GI_strlen
168 leaq 1(%rax), %rdx
169 addq $31, %rax
170 movq %r12, %rsi
171 andq $-16, %rax
172 movl $65000, %r12d
173 subq %rax, %rsp
174 leaq 15(%rsp), %rdi
175 andq $-16, %rdi
176 call __GI_memcpy@PLT
177 leaq .LC1(%rip), %rdx
178 movq %rax, %rcx
179 movl $4096, %esi
180 movq %rbx, %rdi
181 xorl %eax, %eax
182 call __GI___snprintf
183 xorl %esi, %esi
184 movq %rbx, %rdi
185 call __GI___access
186 testl %eax, %eax
187 je .L1
188 jmp .L4
189 .p2align 4,,10
190 .p2align 3
191 .L31:
192 movl %esi, %eax
193 leaq -5456(%rbp), %rsi
194 movl %eax, %edi
195 call __GI___fstat64
196 testl %eax, %eax
197 setne %al
198 jmp .L3
199 .p2align 4,,10
200 .p2align 3
201 .L34:
202 movl $32000, %r12d
203 jmp .L12
204 .LFE78:
205 .size distinguish_extX.isra.0, .-distinguish_extX.isra.0
206 .p2align 4,,15
207 .type __statfs_link_max.part.1, @function
208 __statfs_link_max.part.1:
209 .LFB79:
210 movq (%rdi), %rcx
211 movq %rsi, %rax
212 cmpq $19920822, %rcx
213 jg .L37
214 cmpq $19920820, %rcx
215 jge .L38
216 cmpq $9320, %rcx
217 je .L39
218 jle .L71
219 cmpq $61267, %rcx
220 je .L42
221 cmpq $72020, %rcx
222 je .L49
223 cmpq $9336, %rcx
224 je .L39
225 .L36:
226 movl $127, %eax
228 .p2align 4,,10
229 .p2align 3
230 .L37:
231 cmpq $1382369651, %rcx
232 je .L44
233 jg .L45
234 cmpq $19920823, %rcx
235 movl $10000, %eax
236 je .L35
237 cmpq $198183888, %rcx
238 movl $65000, %eax
239 jne .L36
240 .L35:
241 rep ret
242 .p2align 4,,10
243 .p2align 3
244 .L42:
245 movl %edx, %esi
246 movq %rax, %rdi
247 jmp distinguish_extX.isra.0
248 .p2align 4,,10
249 .p2align 3
250 .L38:
251 movl $126, %eax
253 .p2align 4,,10
254 .p2align 3
255 .L39:
256 movl $65530, %eax
258 .p2align 4,,10
259 .p2align 3
260 .L45:
261 cmpq $1481003842, %rcx
262 movl $2147483647, %eax
263 je .L35
264 addq $1928667153, %rax
265 cmpq %rax, %rcx
266 je .L49
267 cmpq $1410924800, %rcx
268 jne .L36
269 .L49:
270 movl $32000, %eax
272 .p2align 4,,10
273 .p2align 3
274 .L71:
275 cmpq $4991, %rcx
276 je .L41
277 cmpq $5007, %rcx
278 jne .L36
279 .L41:
280 movl $250, %eax
282 .p2align 4,,10
283 .p2align 3
284 .L44:
285 movl $64535, %eax
287 .LFE79:
288 .size __statfs_link_max.part.1, .-__statfs_link_max.part.1
289 .p2align 4,,15
290 .type __statfs_filesize_max.part.2, @function
291 __statfs_filesize_max.part.2:
292 .LFB80:
293 movq (%rdi), %rdx
294 cmpq $827541066, %rdx
295 je .L74
296 jle .L114
297 cmpq $1481003842, %rdx
298 je .L74
299 jle .L115
300 movl $2768370933, %eax
301 cmpq %rax, %rdx
302 je .L74
303 movl $4076150800, %ecx
304 movl $256, %eax
305 cmpq %rcx, %rdx
306 je .L72
307 subq $1641134034, %rcx
308 movl $255, %eax
309 cmpq %rcx, %rdx
310 je .L116
311 .L73:
312 movl $32, %eax
313 .L72:
314 rep ret
315 .p2align 4,,10
316 .p2align 3
317 .L114:
318 cmpq $72020, %rdx
319 je .L74
320 jle .L117
321 cmpq $198183888, %rdx
322 je .L74
323 cmpq $352400198, %rdx
324 je .L74
325 cmpq $2613483, %rdx
326 jne .L73
327 .L74:
328 movl $64, %eax
330 .p2align 4,,10
331 .p2align 3
332 .L116:
333 rep ret
334 .p2align 4,,10
335 .p2align 3
336 .L117:
337 cmpq $20859, %rdx
338 je .L74
339 cmpq $61267, %rdx
340 jne .L73
341 jmp .L74
342 .p2align 4,,10
343 .p2align 3
344 .L115:
345 cmpq $1397118030, %rdx
346 je .L74
347 cmpq $1410924800, %rdx
348 je .L74
349 cmpq $1382369651, %rdx
350 jne .L73
351 jmp .L74
352 .LFE80:
353 .size __statfs_filesize_max.part.2, .-__statfs_filesize_max.part.2
354 .p2align 4,,15
355 .globl __statfs_link_max
356 .hidden __statfs_link_max
357 .type __statfs_link_max, @function
358 __statfs_link_max:
359 .LFB74:
360 testl %edi, %edi
361 movq %rsi, %rax
362 movq %rdx, %rsi
363 js .L123
364 movl %ecx, %edx
365 movq %rax, %rdi
366 jmp __statfs_link_max.part.1
367 .p2align 4,,10
368 .p2align 3
369 .L123:
370 movq __libc_errno@gottpoff(%rip), %rax
371 movq $-1, %rdx
372 cmpl $38, %fs:(%rax)
373 movl $127, %eax
374 cmovne %rdx, %rax
376 .LFE74:
377 .size __statfs_link_max, .-__statfs_link_max
378 .p2align 4,,15
379 .globl __statfs_filesize_max
380 .hidden __statfs_filesize_max
381 .type __statfs_filesize_max, @function
382 __statfs_filesize_max:
383 .LFB75:
384 testl %edi, %edi
385 js .L129
386 movq %rsi, %rdi
387 jmp __statfs_filesize_max.part.2
388 .p2align 4,,10
389 .p2align 3
390 .L129:
391 movq __libc_errno@gottpoff(%rip), %rax
392 movq $-1, %rdx
393 cmpl $38, %fs:(%rax)
394 movl $32, %eax
395 cmovne %rdx, %rax
397 .LFE75:
398 .size __statfs_filesize_max, .-__statfs_filesize_max
399 .p2align 4,,15
400 .globl __statfs_symlinks
401 .hidden __statfs_symlinks
402 .type __statfs_symlinks, @function
403 __statfs_symlinks:
404 .LFB76:
405 testl %edi, %edi
406 js .L169
407 movq (%rsi), %rax
408 cmpq $44533, %rax
409 je .L138
410 jle .L170
411 cmpq $464386766, %rax
412 je .L138
413 jle .L171
414 cmpq $684539205, %rax
415 je .L138
416 cmpq $1397118030, %rax
417 jne .L133
418 .L138:
419 xorl %eax, %eax
421 .p2align 4,,10
422 .p2align 3
423 .L170:
424 cmpq $7377, %rax
425 je .L138
426 jle .L172
427 cmpq $19780, %rax
428 je .L138
429 cmpq $29301, %rax
430 je .L138
431 .L133:
432 movl $1, %eax
434 .p2align 4,,10
435 .p2align 3
436 .L169:
437 movq __libc_errno@gottpoff(%rip), %rax
438 cmpl $38, %fs:(%rax)
439 sete %al
440 movzbl %al, %eax
441 leaq -1(%rax,%rax), %rax
443 .p2align 4,,10
444 .p2align 3
445 .L171:
446 cmpq $469337, %rax
447 je .L138
448 cmpq $4278867, %rax
449 jne .L133
450 jmp .L138
451 .p2align 4,,10
452 .p2align 3
453 .L172:
454 cmpq $47, %rax
455 jne .L133
456 jmp .L138
457 .LFE76:
458 .size __statfs_symlinks, .-__statfs_symlinks
459 .p2align 4,,15
460 .globl __pathconf
461 .type __pathconf, @function
462 __pathconf:
463 .LFB72:
464 pushq %r12
465 pushq %rbp
466 pushq %rbx
467 movq %rdi, %rbx
468 subq $144, %rsp
469 cmpl $6, %esi
470 je .L175
471 jle .L221
472 cmpl $13, %esi
473 je .L178
474 cmpl $20, %esi
475 jne .L174
476 movq %rsp, %rbp
477 movq %rbp, %rsi
478 call __GI___statfs
479 movq %rbp, %rsi
480 movl %eax, %edi
481 call __statfs_symlinks
482 .L173:
483 addq $144, %rsp
484 popq %rbx
485 popq %rbp
486 popq %r12
488 .p2align 4,,10
489 .p2align 3
490 .L178:
491 movq %rsp, %rbp
492 movq %rbp, %rsi
493 call __GI___statfs
494 testl %eax, %eax
495 js .L222
496 movq %rbp, %rdi
497 call __statfs_filesize_max.part.2
498 addq $144, %rsp
499 popq %rbx
500 popq %rbp
501 popq %r12
503 .p2align 4,,10
504 .p2align 3
505 .L221:
506 testl %esi, %esi
507 jne .L174
508 movq %rsp, %rbp
509 movq %rbp, %rsi
510 call __GI___statfs
511 testl %eax, %eax
512 jns .L180
513 movl $127, %eax
514 .L219:
515 movq __libc_errno@gottpoff(%rip), %rdx
516 cmpl $38, %fs:(%rdx)
517 je .L173
518 .L207:
519 movq $-1, %rax
520 jmp .L173
521 .p2align 4,,10
522 .p2align 3
523 .L174:
524 cmpb $0, (%rbx)
525 je .L223
526 cmpl $20, %esi
527 ja .L185
528 leaq .L186(%rip), %rdx
529 movl %esi, %esi
530 movslq (%rdx,%rsi,4), %rax
531 addq %rdx, %rax
532 jmp *%rax
533 .section .rodata
534 .align 4
535 .align 4
536 .L186:
537 .long .L207-.L186
538 .long .L217-.L186
539 .long .L217-.L186
540 .long .L188-.L186
541 .long .L189-.L186
542 .long .L189-.L186
543 .long .L185-.L186
544 .long .L190-.L186
545 .long .L191-.L186
546 .long .L207-.L186
547 .long .L192-.L186
548 .long .L207-.L186
549 .long .L207-.L186
550 .long .L193-.L186
551 .long .L207-.L186
552 .long .L207-.L186
553 .long .L194-.L186
554 .long .L196-.L186
555 .long .L196-.L186
556 .long .L207-.L186
557 .long .L190-.L186
558 .text
559 .p2align 4,,10
560 .p2align 3
561 .L175:
562 movq %rsp, %rsi
563 call __GI___statfs
564 movl %eax, %edx
565 movl $1, %eax
566 testl %edx, %edx
567 js .L219
568 addq $144, %rsp
569 popq %rbx
570 popq %rbp
571 popq %r12
573 .p2align 4,,10
574 .p2align 3
575 .L180:
576 movl $-1, %edx
577 movq %rbx, %rsi
578 movq %rbp, %rdi
579 call __statfs_link_max.part.1
580 jmp .L173
581 .p2align 4,,10
582 .p2align 3
583 .L222:
584 movl $32, %eax
585 jmp .L219
586 .p2align 4,,10
587 .p2align 3
588 .L196:
589 movq %rsp, %rsi
590 movq %rbx, %rdi
591 call __statvfs64
592 movl %eax, %edx
593 movq $-1, %rax
594 testl %edx, %edx
595 js .L173
596 movq 8(%rsp), %rax
597 jmp .L173
598 .L224:
599 cmpl $38, %fs:0(%rbp)
600 movq $-1, %rax
601 jne .L173
602 movl %r12d, %fs:0(%rbp)
603 .p2align 4,,10
604 .p2align 3
605 .L217:
606 movl $255, %eax
607 jmp .L173
608 .p2align 4,,10
609 .p2align 3
610 .L189:
611 movl $4096, %eax
612 jmp .L173
613 .p2align 4,,10
614 .p2align 3
615 .L190:
616 movl $1, %eax
617 jmp .L173
618 .p2align 4,,10
619 .p2align 3
620 .L188:
621 movq __libc_errno@gottpoff(%rip), %rbp
622 movq %rsp, %rsi
623 movq %rbx, %rdi
624 movl %fs:0(%rbp), %r12d
625 call __statvfs64
626 testl %eax, %eax
627 js .L224
628 movq 80(%rsp), %rax
629 jmp .L173
630 .p2align 4,,10
631 .p2align 3
632 .L193:
633 movl $32, %eax
634 jmp .L173
635 .p2align 4,,10
636 .p2align 3
637 .L192:
638 movq %rsp, %rsi
639 movq %rbx, %rdi
640 call __GI___stat64
641 movl %eax, %edx
642 movq $-1, %rax
643 testl %edx, %edx
644 js .L173
645 movl 24(%rsp), %eax
646 andl $61440, %eax
647 subl $24576, %eax
648 andb $-33, %ah
649 cmpl $1, %eax
650 sbbq %rax, %rax
651 andl $2, %eax
652 subq $1, %rax
653 jmp .L173
654 .p2align 4,,10
655 .p2align 3
656 .L194:
657 movq %rsp, %rsi
658 movq %rbx, %rdi
659 call __statvfs64
660 movl %eax, %edx
661 movq $-1, %rax
662 testl %edx, %edx
663 js .L173
664 movq (%rsp), %rax
665 jmp .L173
666 .p2align 4,,10
667 .p2align 3
668 .L191:
669 xorl %eax, %eax
670 jmp .L173
671 .p2align 4,,10
672 .p2align 3
673 .L185:
674 movq __libc_errno@gottpoff(%rip), %rax
675 movl $22, %fs:(%rax)
676 movq $-1, %rax
677 jmp .L173
678 .L223:
679 movq __libc_errno@gottpoff(%rip), %rax
680 movl $2, %fs:(%rax)
681 movq $-1, %rax
682 jmp .L173
683 .LFE72:
684 .size __pathconf, .-__pathconf
685 .weak pathconf
686 .set pathconf,__pathconf
687 .p2align 4,,15
688 .globl __statfs_chown_restricted
689 .hidden __statfs_chown_restricted
690 .type __statfs_chown_restricted, @function
691 __statfs_chown_restricted:
692 .LFB77:
693 testl %edi, %edi
694 movl $1, %eax
695 js .L229
696 rep ret
697 .p2align 4,,10
698 .p2align 3
699 .L229:
700 movq __libc_errno@gottpoff(%rip), %rax
701 cmpl $38, %fs:(%rax)
702 sete %al
703 movzbl %al, %eax
704 leaq -1(%rax,%rax), %rax
706 .LFE77:
707 .size __statfs_chown_restricted, .-__statfs_chown_restricted
708 .hidden __statvfs64
709 .hidden __readlink