Some broken software wants to deal with ld.so.cache.
[nyanglibc.git] / nptl / pthread_barrier_wait.shared.s
blob030653e06755c79917522c1c3c5365a2c6949b07
1 .text
2 .section .rodata.str1.8,"aMS",@progbits,1
3 .align 8
4 .LC0:
5 .string "The futex facility returned an unexpected error code.\n"
6 .text
7 .p2align 4,,15
8 .globl __pthread_barrier_wait
9 .type __pthread_barrier_wait, @function
10 __pthread_barrier_wait:
11 pushq %r15
12 pushq %r14
13 movq %rdi, %r9
14 pushq %r13
15 pushq %r12
16 movl $1, %r13d
17 pushq %rbp
18 pushq %rbx
19 movl $2147483647, %r12d
20 movl $202, %ebp
21 subq $8, %rsp
22 .p2align 4,,10
23 .p2align 3
24 .L2:
25 movl $1, %r8d
26 lock xaddl %r8d, (%r9)
27 movl 8(%r9), %r14d
28 xorl %edx, %edx
29 movl %r12d, %eax
30 movl %r12d, %ebx
31 addl $1, %r8d
32 divl %r14d
33 subl %edx, %ebx
34 cmpl %ebx, %r8d
35 ja .L8
36 jmp .L3
37 .p2align 4,,10
38 .p2align 3
39 .L4:
40 movl (%r9), %r8d
41 cmpl %r8d, %ebx
42 jnb .L2
43 .L8:
44 movl 12(%r9), %esi
45 xorl %r10d, %r10d
46 movl %r8d, %edx
47 movq %r9, %rdi
48 movl %ebp, %eax
49 xorb $-128, %sil
50 #APP
51 # 146 "../sysdeps/nptl/futex-internal.h" 1
52 syscall
54 # 0 "" 2
55 #NO_APP
56 cmpq $-4096, %rax
57 jbe .L4
58 leal 11(%rax), %ecx
59 cmpl $11, %ecx
60 ja .L6
61 movq %r13, %rax
62 salq %cl, %rax
63 testl $2177, %eax
64 jne .L4
65 .L6:
66 leaq .LC0(%rip), %rdi
67 call __libc_fatal@PLT
68 .L3:
69 movl 4(%r9), %ecx
70 leaq 4(%r9), %r12
71 .L9:
72 leal (%r14,%rcx), %eax
73 cmpl %r8d, %eax
74 ja .L30
75 movl %r8d, %eax
76 xorl %edx, %edx
77 movl %r8d, %ebp
78 divl %r14d
79 movl %ecx, %eax
80 subl %edx, %ebp
81 lock cmpxchgl %ebp, (%r12)
82 movl %eax, %ecx
83 jne .L9
84 movl 12(%r9), %esi
85 xorl %r10d, %r10d
86 movl $2147483647, %edx
87 movq %r12, %rdi
88 movl $202, %eax
89 xorb $-127, %sil
90 #APP
91 # 209 "../sysdeps/nptl/futex-internal.h" 1
92 syscall
94 # 0 "" 2
95 #NO_APP
96 cmpq $-4096, %rax
97 ja .L31
98 .L10:
99 cmpl %ebp, %r8d
100 jbe .L11
101 .L12:
102 movl $202, %r13d
103 movl $1, %r15d
104 jmp .L16
105 .p2align 4,,10
106 .p2align 3
107 .L15:
108 movl (%r12), %ebp
109 cmpl %ebp, %r8d
110 jbe .L11
111 .L16:
112 movl 12(%r9), %esi
113 xorl %r10d, %r10d
114 movl %ebp, %edx
115 movq %r12, %rdi
116 movl %r13d, %eax
117 xorb $-128, %sil
118 #APP
119 # 146 "../sysdeps/nptl/futex-internal.h" 1
120 syscall
122 # 0 "" 2
123 #NO_APP
124 cmpq $-4096, %rax
125 jbe .L15
126 leal 11(%rax), %ecx
127 cmpl $11, %ecx
128 ja .L6
129 movq %r15, %rax
130 salq %cl, %rax
131 testl $2177, %eax
132 je .L6
133 movl (%r12), %ebp
134 cmpl %ebp, %r8d
135 ja .L16
136 .L11:
137 leaq 16(%r9), %rdx
138 movl $1, %eax
139 lock xaddl %eax, (%rdx)
140 addl $1, %eax
141 cmpl %eax, %ebx
142 je .L32
143 .L19:
144 xorl %edx, %edx
145 movl %r8d, %eax
146 divl %r14d
147 xorl %eax, %eax
148 testl %edx, %edx
149 sete %al
150 addq $8, %rsp
151 popq %rbx
152 negl %eax
153 popq %rbp
154 popq %r12
155 popq %r13
156 popq %r14
157 popq %r15
159 .L31:
160 cmpl $-22, %eax
161 je .L10
162 cmpl $-14, %eax
163 je .L10
164 jmp .L6
165 .p2align 4,,10
166 .p2align 3
167 .L32:
168 movl $0, 4(%r9)
169 movl $0, 16(%r9)
170 movl 12(%r9), %esi
171 xorl %r10d, %r10d
172 movl $2147483647, %edx
173 movl $0, (%r9)
174 movq %r9, %rdi
175 movl $202, %eax
176 xorb $-127, %sil
177 #APP
178 # 209 "../sysdeps/nptl/futex-internal.h" 1
179 syscall
181 # 0 "" 2
182 #NO_APP
183 cmpq $-4096, %rax
184 jbe .L19
185 cmpl $-22, %eax
186 je .L19
187 cmpl $-14, %eax
188 je .L19
189 jmp .L6
190 .p2align 4,,10
191 .p2align 3
192 .L30:
193 cmpl %ecx, %r8d
194 movl %ecx, %ebp
195 ja .L12
196 jmp .L11
197 .size __pthread_barrier_wait, .-__pthread_barrier_wait
198 .weak pthread_barrier_wait
199 .set pthread_barrier_wait,__pthread_barrier_wait