clarify the purpose of this project
[nyanglibc.git] / misc / fd_to_filename.s
blobb6ad85156aca742fb4efe2b6f01c3fd4cfe43858
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "fd_to_filename.c"
5 .LC1:
6 .string "descriptor >= 0"
7 .text
8 .p2align 4,,15
9 .globl __fd_to_filename
10 .hidden __fd_to_filename
11 .type __fd_to_filename, @function
12 __fd_to_filename:
13 testl %edi, %edi
14 js .L11
15 movabsq $7310238724270485551, %rax
16 leaq 14(%rsi), %rcx
17 movl $1714382444, 8(%rsi)
18 movq %rax, (%rsi)
19 movl $12132, %eax
20 movl %edi, %edx
21 movw %ax, 12(%rsi)
22 movl $-858993459, %r8d
23 .L3:
24 movl %edx, %eax
25 addq $1, %rcx
26 mull %r8d
27 shrl $3, %edx
28 testl %edx, %edx
29 jne .L3
30 movb $0, (%rcx)
31 movl $-858993459, %r8d
32 .L4:
33 movl %edi, %eax
34 subq $1, %rcx
35 mull %r8d
36 shrl $3, %edx
37 leal (%rdx,%rdx,4), %eax
38 addl %eax, %eax
39 subl %eax, %edi
40 addl $48, %edi
41 testl %edx, %edx
42 movb %dil, (%rcx)
43 movl %edx, %edi
44 jne .L4
45 movq %rsi, %rax
46 ret
47 .L11:
48 leaq __PRETTY_FUNCTION__.2541(%rip), %rcx
49 leaq .LC0(%rip), %rsi
50 leaq .LC1(%rip), %rdi
51 subq $8, %rsp
52 movl $27, %edx
53 call __assert_fail
54 .size __fd_to_filename, .-__fd_to_filename
55 .section .rodata.str1.16,"aMS",@progbits,1
56 .align 16
57 .type __PRETTY_FUNCTION__.2541, @object
58 .size __PRETTY_FUNCTION__.2541, 17
59 __PRETTY_FUNCTION__.2541:
60 .string "__fd_to_filename"
61 .hidden __assert_fail