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