clarify the purpose of this project
[nyanglibc.git] / dirent / readdir64.shared.s
blobc35f3631d92222ad72a083d0757d2eb404617ee4
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __GI___readdir64
9 .hidden __GI___readdir64
10 .type __GI___readdir64, @function
11 __GI___readdir64:
12 pushq %r14
13 pushq %r13
14 pushq %r12
15 movq __libc_errno@gottpoff(%rip), %r12
16 pushq %rbp
17 pushq %rbx
18 movq %rdi, %rbx
19 movl %fs:(%r12), %r14d
20 #APP
21 # 37 "../sysdeps/unix/sysv/linux/readdir64.c" 1
22 movl %fs:24,%eax
23 # 0 "" 2
24 #NO_APP
25 testl %eax, %eax
26 leaq 4(%rdi), %r13
27 jne .L2
28 movl $1, %edx
29 #APP
30 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
31 cmpxchgl %edx, 4(%rdi)
32 # 0 "" 2
33 #NO_APP
34 .L3:
35 movq 24(%rbx), %rax
36 leaq 48(%rbx), %rbp
37 jmp .L9
38 .p2align 4,,10
39 .p2align 3
40 .L5:
41 addq %rbx, %r8
42 movzwl 16(%r8), %edx
43 addq %rdx, %rax
44 cmpq $0, (%r8)
45 movq 8(%r8), %rdx
46 movq %rax, 24(%rbx)
47 movq %rdx, 32(%rbx)
48 jne .L8
49 .L9:
50 cmpq %rax, 16(%rbx)
51 leaq 48(%rax), %r8
52 ja .L5
53 movq 8(%rbx), %rdx
54 movl (%rbx), %edi
55 movq %rbp, %rsi
56 call __GI___getdents64
57 cmpq $0, %rax
58 jle .L19
59 movq %rax, 16(%rbx)
60 movl $48, %r8d
61 xorl %eax, %eax
62 jmp .L5
63 .p2align 4,,10
64 .p2align 3
65 .L19:
66 jne .L20
67 .L7:
68 movl %r14d, %fs:(%r12)
69 xorl %r8d, %r8d
70 .p2align 4,,10
71 .p2align 3
72 .L8:
73 #APP
74 # 84 "../sysdeps/unix/sysv/linux/readdir64.c" 1
75 movl %fs:24,%eax
76 # 0 "" 2
77 #NO_APP
78 testl %eax, %eax
79 jne .L10
80 subl $1, 4(%rbx)
81 .L1:
82 popq %rbx
83 movq %r8, %rax
84 popq %rbp
85 popq %r12
86 popq %r13
87 popq %r14
88 ret
89 .L20:
90 xorl %r8d, %r8d
91 cmpl $2, %fs:(%r12)
92 jne .L8
93 jmp .L7
94 .p2align 4,,10
95 .p2align 3
96 .L10:
97 xorl %eax, %eax
98 #APP
99 # 84 "../sysdeps/unix/sysv/linux/readdir64.c" 1
100 xchgl %eax, 4(%rbx)
101 # 0 "" 2
102 #NO_APP
103 cmpl $1, %eax
104 jle .L1
105 xorl %r10d, %r10d
106 movl $1, %edx
107 movl $129, %esi
108 movq %r13, %rdi
109 movl $202, %eax
110 #APP
111 # 84 "../sysdeps/unix/sysv/linux/readdir64.c" 1
112 syscall
114 # 0 "" 2
115 #NO_APP
116 jmp .L1
117 .L2:
118 xorl %eax, %eax
119 movl $1, %edx
120 lock cmpxchgl %edx, 0(%r13)
121 je .L3
122 movq %r13, %rdi
123 call __lll_lock_wait_private
124 jmp .L3
125 .size __GI___readdir64, .-__GI___readdir64
126 .globl __readdir64
127 .set __readdir64,__GI___readdir64
128 .weak readdir
129 .set readdir,__readdir64
130 .weak readdir64
131 .set readdir64,__readdir64
132 .globl __readdir
133 .set __readdir,__readdir64
134 .hidden __lll_lock_wait_private