clarify the purpose of this project
[nyanglibc.git] / libio / clearerr.shared.s
blob7d1b6b23e0e7bebc1ae2fa6df6975f4c38c0048e
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 clearerr
9 .type clearerr, @function
10 clearerr:
11 movl (%rdi), %edx
12 movl %edx, %esi
13 andl $32768, %esi
14 jne .L2
15 pushq %rbp
16 pushq %rbx
17 subq $8, %rsp
18 movq 136(%rdi), %rcx
19 movq %fs:16, %rbp
20 cmpq %rbp, 8(%rcx)
21 je .L3
22 movq %rdi, %rbx
23 #APP
24 # 25 "clearerr.c" 1
25 movl %fs:24,%eax
26 # 0 "" 2
27 #NO_APP
28 testl %eax, %eax
29 movl $1, %edx
30 jne .L4
31 #APP
32 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
33 cmpxchgl %edx, (%rcx)
34 # 0 "" 2
35 #NO_APP
36 .L5:
37 movq 136(%rbx), %rcx
38 movl (%rbx), %edx
39 movl 4(%rcx), %eax
40 movq %rbp, 8(%rcx)
41 leal 1(%rax), %esi
42 movl %esi, 4(%rcx)
43 movl %edx, %esi
44 andl $-49, %esi
45 andb $-128, %dh
46 movl %esi, (%rbx)
47 jne .L1
48 .L6:
49 testl %eax, %eax
50 movl %eax, 4(%rcx)
51 jne .L1
52 movq $0, 8(%rcx)
53 #APP
54 # 27 "clearerr.c" 1
55 movl %fs:24,%edx
56 # 0 "" 2
57 #NO_APP
58 testl %edx, %edx
59 jne .L9
60 subl $1, (%rcx)
61 .L1:
62 addq $8, %rsp
63 popq %rbx
64 popq %rbp
65 ret
66 .p2align 4,,10
67 .p2align 3
68 .L2:
69 andl $-49, %edx
70 movl %edx, (%rdi)
71 ret
72 .p2align 4,,10
73 .p2align 3
74 .L3:
75 movl 4(%rcx), %eax
76 andl $-49, %edx
77 leal 1(%rax), %esi
78 movl %esi, 4(%rcx)
79 movl %edx, (%rdi)
80 jmp .L6
81 .p2align 4,,10
82 .p2align 3
83 .L4:
84 movl %esi, %eax
85 lock cmpxchgl %edx, (%rcx)
86 je .L5
87 movq %rcx, %rdi
88 call __lll_lock_wait_private
89 jmp .L5
90 .p2align 4,,10
91 .p2align 3
92 .L9:
93 #APP
94 # 27 "clearerr.c" 1
95 xchgl %eax, (%rcx)
96 # 0 "" 2
97 #NO_APP
98 cmpl $1, %eax
99 jle .L1
100 xorl %r10d, %r10d
101 movl $1, %edx
102 movl $129, %esi
103 movq %rcx, %rdi
104 movl $202, %eax
105 #APP
106 # 27 "clearerr.c" 1
107 syscall
109 # 0 "" 2
110 #NO_APP
111 jmp .L1
112 .size clearerr, .-clearerr
113 .hidden __lll_lock_wait_private