clarify the purpose of this project
[nyanglibc.git] / dirent / rewinddir.shared.s
blob468766a83ccfe42c172296011fd9999aa193a0ab
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___rewinddir
9 .hidden __GI___rewinddir
10 .type __GI___rewinddir, @function
11 __GI___rewinddir:
12 pushq %rbp
13 pushq %rbx
14 movq %rdi, %rbx
15 subq $8, %rsp
16 #APP
17 # 29 "../sysdeps/unix/sysv/linux/rewinddir.c" 1
18 movl %fs:24,%eax
19 # 0 "" 2
20 #NO_APP
21 testl %eax, %eax
22 leaq 4(%rdi), %rbp
23 jne .L2
24 movl $1, %edx
25 #APP
26 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
27 cmpxchgl %edx, 4(%rdi)
28 # 0 "" 2
29 #NO_APP
30 .L3:
31 movl (%rbx), %edi
32 xorl %edx, %edx
33 xorl %esi, %esi
34 call __GI___lseek
35 movq $0, 32(%rbx)
36 movq $0, 24(%rbx)
37 movq $0, 16(%rbx)
38 movl $0, 40(%rbx)
39 #APP
40 # 37 "../sysdeps/unix/sysv/linux/rewinddir.c" 1
41 movl %fs:24,%eax
42 # 0 "" 2
43 #NO_APP
44 testl %eax, %eax
45 jne .L4
46 subl $1, 4(%rbx)
47 .L1:
48 addq $8, %rsp
49 popq %rbx
50 popq %rbp
51 ret
52 .p2align 4,,10
53 .p2align 3
54 .L2:
55 xorl %eax, %eax
56 movl $1, %edx
57 lock cmpxchgl %edx, 0(%rbp)
58 je .L3
59 movq %rbp, %rdi
60 call __lll_lock_wait_private
61 jmp .L3
62 .p2align 4,,10
63 .p2align 3
64 .L4:
65 xorl %eax, %eax
66 #APP
67 # 37 "../sysdeps/unix/sysv/linux/rewinddir.c" 1
68 xchgl %eax, 4(%rbx)
69 # 0 "" 2
70 #NO_APP
71 cmpl $1, %eax
72 jle .L1
73 xorl %r10d, %r10d
74 movl $1, %edx
75 movl $129, %esi
76 movq %rbp, %rdi
77 movl $202, %eax
78 #APP
79 # 37 "../sysdeps/unix/sysv/linux/rewinddir.c" 1
80 syscall
82 # 0 "" 2
83 #NO_APP
84 jmp .L1
85 .size __GI___rewinddir, .-__GI___rewinddir
86 .globl __rewinddir
87 .set __rewinddir,__GI___rewinddir
88 .weak rewinddir
89 .set rewinddir,__rewinddir
90 .hidden __lll_lock_wait_private