clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_rwlock_timedwrlock.s
blob17450f4a25b5c247dabeea15c8bf2a7a58ca78fd
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_rwlock_timedwrlock
9 .type __pthread_rwlock_timedwrlock, @function
10 __pthread_rwlock_timedwrlock:
11 testq %rsi, %rsi
12 je .L2
13 cmpq $999999999, 8(%rsi)
14 ja .L48
15 .L2:
16 movl 24(%rdi), %edx
17 #APP
18 # 603 "pthread_rwlock_common.c" 1
19 movl %fs:720,%eax
20 # 0 "" 2
21 #NO_APP
22 cmpl %eax, %edx
23 je .L49
24 pushq %r15
25 pushq %r14
26 pushq %r13
27 pushq %r12
28 pushq %rbp
29 pushq %rbx
30 subq $8, %rsp
31 movl (%rdi), %eax
32 .L4:
33 movl %eax, %ecx
34 movl %eax, %edx
35 orl $2, %ecx
36 lock cmpxchgl %ecx, (%rdi)
37 jne .L4
38 testb $2, %dl
39 movq %rsi, %rbp
40 movq %rdi, %rbx
41 leaq 12(%rdi), %r12
42 movl $1, %eax
43 jne .L117
44 .L5:
45 testb $1, %dl
46 movl %eax, 12(%rbx)
47 jne .L23
48 .L21:
49 movl %edx, %eax
50 shrl $3, %eax
51 testl %eax, %eax
52 jne .L26
53 movl %edx, %ecx
54 movl %edx, %eax
55 orl $1, %ecx
56 lock cmpxchgl %ecx, (%rbx)
57 movl %eax, %edx
58 jne .L22
59 movl $1, 8(%rbx)
60 .L23:
61 #APP
62 # 947 "pthread_rwlock_common.c" 1
63 movl %fs:720,%eax
64 # 0 "" 2
65 #NO_APP
66 movl %eax, 24(%rbx)
67 xorl %r8d, %r8d
68 .L1:
69 addq $8, %rsp
70 movl %r8d, %eax
71 popq %rbx
72 popq %rbp
73 popq %r12
74 popq %r13
75 popq %r14
76 popq %r15
77 ret
78 .L22:
79 testb $1, %al
80 je .L21
81 .p2align 4,,10
82 .p2align 3
83 .L26:
84 leaq 8(%rbx), %r15
85 xorl %r13d, %r13d
86 .p2align 4,,10
87 .p2align 3
88 .L24:
89 movl (%r15), %eax
90 movl %eax, %edx
91 orl $2, %edx
92 cmpl $2, %edx
93 je .L46
94 testb %r13b, %r13b
95 jne .L23
96 movl (%rbx), %eax
97 testb $1, %al
98 je .L24
99 movl (%r15), %eax
100 movl %eax, %edx
101 orl $2, %edx
102 cmpl $2, %edx
103 jne .L23
104 movl $1, %r13d
105 .L46:
106 movl 28(%rbx), %r14d
107 movl $128, %edx
108 testl %r14d, %r14d
109 cmovne %edx, %r14d
110 testb $2, %al
111 jne .L31
112 movl $2, %edx
113 lock cmpxchgl %edx, (%r15)
114 jne .L24
115 .L31:
116 movl %r14d, %r8d
117 xorl %edx, %edx
118 movq %rbp, %rcx
119 movl $2, %esi
120 movq %r15, %rdi
121 call __futex_abstimed_wait64@PLT
122 cmpl $110, %eax
123 movl %eax, %r8d
124 je .L29
125 cmpl $75, %eax
126 jne .L24
127 .L29:
128 movl 48(%rbx), %eax
129 testl %eax, %eax
130 je .L33
131 movl 4(%rbx), %eax
132 leaq 4(%rbx), %rdx
133 testl %eax, %eax
134 je .L33
135 xorl %ecx, %ecx
136 xchgl (%r12), %ecx
137 .L37:
138 movl %eax, %esi
139 orl $-2147483648, %esi
140 lock cmpxchgl %esi, (%rdx)
141 jne .L35
142 andl $2, %ecx
143 je .L1
144 movl %r14d, %esi
145 xorl %r10d, %r10d
146 movl $1, %edx
147 xorb $-127, %sil
148 movq %r12, %rdi
149 movl $202, %eax
150 #APP
151 # 209 "../sysdeps/nptl/futex-internal.h" 1
152 syscall
154 # 0 "" 2
155 #NO_APP
156 cmpq $-4096, %rax
157 jbe .L1
158 cmpl $-22, %eax
159 je .L1
160 cmpl $-14, %eax
161 je .L1
162 .L36:
163 leaq .LC0(%rip), %rdi
164 call __libc_fatal@PLT
165 .L35:
166 testl %eax, %eax
167 jne .L37
168 movl %ecx, 12(%rbx)
169 .p2align 4,,10
170 .p2align 3
171 .L33:
172 movl (%rbx), %eax
173 movl %eax, %edx
174 andl $1, %edx
175 jne .L45
176 xchgl (%r12), %edx
177 .L44:
178 movl %eax, %ecx
179 xorl $2, %ecx
180 andl $-5, %ecx
181 lock cmpxchgl %ecx, (%rbx)
182 movl %eax, %r8d
183 jne .L39
184 andl $2, %edx
185 je .L41
186 movl %r14d, %esi
187 xorl %r10d, %r10d
188 movl $1, %edx
189 xorb $-127, %sil
190 movq %r12, %rdi
191 movl $202, %eax
192 #APP
193 # 209 "../sysdeps/nptl/futex-internal.h" 1
194 syscall
196 # 0 "" 2
197 #NO_APP
198 cmpq $-4096, %rax
199 ja .L118
200 .L41:
201 andl $4, %r8d
202 je .L53
203 movl %r14d, %esi
204 xorl %r10d, %r10d
205 movl $2147483647, %edx
206 xorb $-127, %sil
207 movq %rbx, %rdi
208 movl $202, %eax
209 #APP
210 # 209 "../sysdeps/nptl/futex-internal.h" 1
211 syscall
213 # 0 "" 2
214 #NO_APP
215 cmpq $-4096, %rax
216 ja .L119
217 .L53:
218 movl $110, %r8d
219 jmp .L1
220 .L39:
221 testb $1, %al
222 je .L44
223 movl %edx, 12(%rbx)
224 .p2align 4,,10
225 .p2align 3
226 .L45:
227 movl (%r15), %eax
228 orl $2, %eax
229 cmpl $2, %eax
230 jne .L23
231 movl (%r15), %eax
232 orl $2, %eax
233 cmpl $2, %eax
234 je .L45
235 jmp .L23
236 .p2align 4,,10
237 .p2align 3
238 .L49:
239 movl $35, %r8d
240 .L112:
241 movl %r8d, %eax
243 .p2align 4,,10
244 .p2align 3
245 .L48:
246 movl $22, %r8d
247 jmp .L112
248 .p2align 4,,10
249 .p2align 3
250 .L117:
251 movl 48(%rdi), %r13d
252 testl %r13d, %r13d
253 jne .L120
254 .L6:
255 xorl %ecx, %ecx
256 movl $128, %r14d
257 .L7:
258 testb $2, %dl
259 jne .L8
260 movl %edx, %esi
261 movl %edx, %eax
262 orl $2, %esi
263 lock cmpxchgl %esi, (%rbx)
264 movl %eax, %edx
265 jne .L7
266 testl %r13d, %r13d
267 jne .L121
268 .L10:
269 orl $2, %edx
270 cmpb $1, %cl
271 sbbl %eax, %eax
272 andl $-2, %eax
273 addl $3, %eax
274 jmp .L5
275 .p2align 4,,10
276 .p2align 3
277 .L8:
278 testl %r13d, %r13d
279 jne .L122
280 .L11:
281 movl 28(%rbx), %r8d
282 movl (%r12), %eax
283 testl %r8d, %r8d
284 movl %eax, %edx
285 cmovne %r14d, %r8d
286 andl $-3, %edx
287 cmpl $1, %edx
288 jne .L15
289 cmpl $3, %eax
290 je .L14
291 movl $3, %edx
292 lock cmpxchgl %edx, (%r12)
293 jne .L15
294 .L14:
295 xorl %edx, %edx
296 movq %rbp, %rcx
297 movl $3, %esi
298 movq %r12, %rdi
299 call __futex_abstimed_wait64@PLT
300 cmpl $110, %eax
301 movl %eax, %r8d
302 je .L55
303 cmpl $75, %eax
304 je .L55
305 movl (%rbx), %edx
306 movl $1, %ecx
307 jmp .L7
308 .p2align 4,,10
309 .p2align 3
310 .L122:
311 movl 4(%rbx), %eax
312 leaq 4(%rbx), %rsi
313 testl %eax, %eax
314 jns .L11
315 leal 2147483647(%rax), %edi
316 lock cmpxchgl %edi, (%rsi)
317 jne .L7
318 movl (%rbx), %edx
319 jmp .L10
320 .p2align 4,,10
321 .p2align 3
322 .L121:
323 lock subl $1, 4(%rbx)
324 jmp .L10
325 .p2align 4,,10
326 .p2align 3
327 .L15:
328 movl (%rbx), %edx
329 jmp .L7
330 .p2align 4,,10
331 .p2align 3
332 .L120:
333 lock addl $1, 4(%rdi)
334 jmp .L6
335 .L119:
336 cmpl $-22, %eax
337 je .L53
338 cmpl $-14, %eax
339 je .L53
340 jmp .L36
341 .p2align 4,,10
342 .p2align 3
343 .L118:
344 cmpl $-22, %eax
345 je .L41
346 cmpl $-14, %eax
347 je .L41
348 jmp .L36
349 .p2align 4,,10
350 .p2align 3
351 .L55:
352 testl %r13d, %r13d
353 je .L1
354 movl 4(%rbx), %eax
355 leaq 4(%rbx), %rdx
356 .L19:
357 cmpl $-2147483647, %eax
358 je .L51
359 leal -1(%rax), %ecx
360 .L18:
361 lock cmpxchgl %ecx, (%rdx)
362 jne .L19
363 cmpl $-2147483647, %eax
364 jne .L1
365 movl (%rbx), %edx
366 movl $3, %eax
367 orl $2, %edx
368 jmp .L5
369 .L51:
370 xorl %ecx, %ecx
371 jmp .L18
372 .size __pthread_rwlock_timedwrlock, .-__pthread_rwlock_timedwrlock
373 .weak pthread_rwlock_timedwrlock
374 .set pthread_rwlock_timedwrlock,__pthread_rwlock_timedwrlock