Some broken software wants to deal with ld.so.cache.
[nyanglibc.git] / nptl / pthread_rwlock_timedrdlock.s
blob3514158161026b543a8fce54a543bfa98dd9c09c
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_timedrdlock
9 .type __pthread_rwlock_timedrdlock, @function
10 __pthread_rwlock_timedrdlock:
11 testq %rsi, %rsi
12 je .L2
13 cmpq $999999999, 8(%rsi)
14 ja .L30
15 .L2:
16 movl 24(%rdi), %edx
17 #APP
18 # 298 "pthread_rwlock_common.c" 1
19 movl %fs:720,%eax
20 # 0 "" 2
21 #NO_APP
22 cmpl %eax, %edx
23 je .L31
24 pushq %r13
25 pushq %r12
26 pushq %rbp
27 pushq %rbx
28 movq %rsi, %rbp
29 movq %rdi, %rbx
30 subq $8, %rsp
31 cmpl $2, 48(%rdi)
32 je .L4
33 .L11:
34 movl $8, %eax
35 lock xaddl %eax, (%rbx)
36 addl $8, %eax
37 .L5:
38 testl %eax, %eax
39 js .L13
40 testb $1, %al
41 jne .L14
42 .L34:
43 xorl %edx, %edx
44 .L1:
45 addq $8, %rsp
46 movl %edx, %eax
47 popq %rbx
48 popq %rbp
49 popq %r12
50 popq %r13
51 ret
52 .p2align 4,,10
53 .p2align 3
54 .L4:
55 movl (%rdi), %esi
56 movl $128, %r12d
57 .L8:
58 movl %esi, %eax
59 andl $3, %eax
60 cmpl $2, %eax
61 jne .L11
62 movl %esi, %eax
63 shrl $3, %eax
64 testl %eax, %eax
65 je .L11
66 movl %esi, %edx
67 movl %esi, %eax
68 orl $4, %edx
69 lock cmpxchgl %edx, (%rbx)
70 movl %eax, %esi
71 je .L7
72 jmp .L8
73 .p2align 4,,10
74 .p2align 3
75 .L61:
76 cmpl $75, %eax
77 je .L1
78 .L7:
79 movl (%rbx), %esi
80 testb $4, %sil
81 je .L8
82 movl 28(%rbx), %r8d
83 movq %rbp, %rcx
84 movq %rbx, %rdi
85 testl %r8d, %r8d
86 cmovne %r12d, %r8d
87 xorl %edx, %edx
88 call __futex_abstimed_wait64@PLT
89 cmpl $110, %eax
90 movl %eax, %edx
91 jne .L61
92 addq $8, %rsp
93 movl %edx, %eax
94 popq %rbx
95 popq %rbp
96 popq %r12
97 popq %r13
98 ret
99 .p2align 4,,10
100 .p2align 3
101 .L14:
102 movl %eax, %edx
103 andl $3, %edx
104 cmpl $1, %edx
105 jne .L62
106 movl %eax, %edx
107 xorl $1, %edx
108 lock cmpxchgl %edx, (%rbx)
109 jne .L14
110 leaq 8(%rbx), %rdi
111 xorl %eax, %eax
112 xchgl (%rdi), %eax
113 testb $2, %al
114 je .L34
115 cmpl $1, 28(%rbx)
116 movl $2147483647, %edx
117 movl $202, %eax
118 sbbl %esi, %esi
119 xorl %r10d, %r10d
120 andl $128, %esi
121 addl $1, %esi
122 #APP
123 # 209 "../sysdeps/nptl/futex-internal.h" 1
124 syscall
126 # 0 "" 2
127 #NO_APP
128 cmpq $-4096, %rax
129 jbe .L34
130 cmpl $-22, %eax
131 je .L34
132 cmpl $-14, %eax
133 je .L34
134 leaq .LC0(%rip), %rdi
135 call __libc_fatal@PLT
136 .p2align 4,,10
137 .p2align 3
138 .L31:
139 movl $35, %edx
140 .L56:
141 movl %edx, %eax
143 .p2align 4,,10
144 .p2align 3
145 .L30:
146 movl $22, %edx
147 jmp .L56
148 .p2align 4,,10
149 .p2align 3
150 .L13:
151 leal -8(%rax), %edx
152 lock cmpxchgl %edx, (%rbx)
153 jne .L5
154 movl $11, %edx
155 jmp .L1
156 .L62:
157 leaq 8(%rbx), %r12
158 xorl %r13d, %r13d
159 .L19:
160 movl (%r12), %eax
161 movl %eax, %edx
162 orl $2, %edx
163 cmpl $3, %edx
164 je .L28
165 testb %r13b, %r13b
166 jne .L34
167 movl (%rbx), %eax
168 testb $1, %al
169 jne .L19
170 movl (%r12), %eax
171 movl %eax, %edx
172 orl $2, %edx
173 cmpl $3, %edx
174 jne .L34
175 movl $1, %r13d
176 .L28:
177 movl 28(%rbx), %r8d
178 movl $128, %edx
179 testl %r8d, %r8d
180 cmovne %edx, %r8d
181 testb $2, %al
182 jne .L24
183 movl $3, %edx
184 lock cmpxchgl %edx, (%r12)
185 jne .L19
186 .L24:
187 xorl %edx, %edx
188 movq %rbp, %rcx
189 movl $3, %esi
190 movq %r12, %rdi
191 call __futex_abstimed_wait64@PLT
192 cmpl $110, %eax
193 movl %eax, %edx
194 je .L22
195 cmpl $75, %eax
196 jne .L19
197 .L22:
198 movl (%rbx), %eax
199 .L25:
200 testb $1, %al
201 je .L27
202 leal -8(%rax), %ecx
203 lock cmpxchgl %ecx, (%rbx)
204 je .L1
205 jmp .L25
206 .p2align 4,,10
207 .p2align 3
208 .L27:
209 movl (%r12), %eax
210 orl $2, %eax
211 cmpl $3, %eax
212 je .L27
213 jmp .L34
214 .size __pthread_rwlock_timedrdlock, .-__pthread_rwlock_timedrdlock
215 .weak pthread_rwlock_timedrdlock
216 .set pthread_rwlock_timedrdlock,__pthread_rwlock_timedrdlock