clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_getattr_np.s
blob0b12ea72d1ac808f2d8323853ef12bf5449a1481
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "rce"
5 .LC1:
6 .string "/proc/self/maps"
7 .LC2:
8 .string "%lx-%lx"
9 .text
10 .p2align 4,,15
11 .globl __pthread_getattr_np
12 .type __pthread_getattr_np, @function
13 __pthread_getattr_np:
14 pushq %r15
15 pushq %r14
16 pushq %r13
17 pushq %r12
18 movq %rdi, %r13
19 pushq %rbp
20 pushq %rbx
21 movq %rsi, %rdi
22 movq %rsi, %rbx
23 subq $120, %rsp
24 call __pthread_attr_init
25 testl %eax, %eax
26 movl %eax, %ebp
27 jne .L1
28 #APP
29 # 44 "pthread_getattr_np.c" 1
30 movl %fs:24,%eax
31 # 0 "" 2
32 #NO_APP
33 leaq 1560(%r13), %rcx
34 testl %eax, %eax
35 movq %rcx, 8(%rsp)
36 jne .L3
37 movl %ebp, %eax
38 movl $1, %edx
39 #APP
40 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
41 cmpxchgl %edx, 1560(%r13)
42 # 0 "" 2
43 #NO_APP
44 .L4:
45 movl 1592(%r13), %eax
46 movl %eax, (%rbx)
47 movl 1596(%r13), %eax
48 cmpq %r13, 1576(%r13)
49 movl %eax, 4(%rbx)
50 movl 780(%r13), %eax
51 movl %eax, 8(%rbx)
52 je .L42
53 .L5:
54 movq 1704(%r13), %rax
55 movq %rax, 16(%rbx)
56 movq 1680(%r13), %rax
57 testq %rax, %rax
58 je .L6
59 movq 1688(%r13), %rdx
60 movq %rdx, %rcx
61 subq 1696(%r13), %rcx
62 orl $8, 8(%rbx)
63 addq %rdx, %rax
64 movq %rax, 24(%rbx)
65 movq %rcx, 32(%rbx)
66 .L7:
67 xorl %r15d, %r15d
68 movl $16, %r12d
69 jmp .L22
70 .p2align 4,,10
71 .p2align 3
72 .L43:
73 movq %rax, %rdx
74 movq %r12, %rsi
75 movq %r13, %rdi
76 call __pthread_getaffinity_np
77 cmpl $22, %eax
78 movq %r14, %r15
79 jne .L31
80 cmpq $1048575, %r12
81 ja .L31
82 .L22:
83 addq %r12, %r12
84 movq %r15, %rdi
85 movq %r12, %rsi
86 call realloc@PLT
87 testq %rax, %rax
88 movq %rax, %r14
89 jne .L43
90 movl $12, %ebp
91 .L21:
92 movq %r15, %rdi
93 call free@PLT
94 .L20:
95 #APP
96 # 202 "pthread_getattr_np.c" 1
97 movl %fs:24,%eax
98 # 0 "" 2
99 #NO_APP
100 testl %eax, %eax
101 jne .L25
102 subl $1, 1560(%r13)
103 .L26:
104 testl %ebp, %ebp
105 je .L1
106 movq %rbx, %rdi
107 call __pthread_attr_destroy
108 .L1:
109 addq $120, %rsp
110 movl %ebp, %eax
111 popq %rbx
112 popq %rbp
113 popq %r12
114 popq %r13
115 popq %r14
116 popq %r15
118 .p2align 4,,10
119 .p2align 3
120 .L3:
121 leaq 1560(%r13), %rcx
122 movl $1, %edx
123 movl %ebp, %eax
124 lock cmpxchgl %edx, (%rcx)
125 je .L4
126 movq %rcx, %rdi
127 call __lll_lock_wait_private
128 jmp .L4
129 .p2align 4,,10
130 .p2align 3
131 .L42:
132 orl $1, %eax
133 movl %eax, 8(%rbx)
134 jmp .L5
135 .p2align 4,,10
136 .p2align 3
137 .L31:
138 testl %eax, %eax
139 jne .L24
140 movq %r14, %rdx
141 movq %r12, %rsi
142 movq %rbx, %rdi
143 call __pthread_attr_setaffinity_np
144 movq %r14, %r15
145 movl %eax, %ebp
146 jmp .L21
147 .p2align 4,,10
148 .p2align 3
149 .L6:
150 leaq .LC0(%rip), %rsi
151 leaq .LC1(%rip), %rdi
152 call _IO_new_fopen@PLT
153 testq %rax, %rax
154 movq %rax, %r14
155 je .L44
156 leaq 96(%rsp), %rsi
157 movl $3, %edi
158 call __getrlimit
159 testl %eax, %eax
160 je .L10
161 movq __libc_errno@gottpoff(%rip), %rax
162 movl %fs:(%rax), %r12d
163 .L11:
164 movq %r14, %rdi
165 call _IO_new_fclose@PLT
166 .L9:
167 orl $8, 8(%rbx)
168 testl %r12d, %r12d
169 je .L7
170 movl %r12d, %ebp
171 jmp .L20
172 .p2align 4,,10
173 .p2align 3
174 .L25:
175 xorl %eax, %eax
176 #APP
177 # 202 "pthread_getattr_np.c" 1
178 xchgl %eax, 1560(%r13)
179 # 0 "" 2
180 #NO_APP
181 cmpl $1, %eax
182 jle .L26
183 xorl %r10d, %r10d
184 movl $1, %edx
185 movl $129, %esi
186 movq 8(%rsp), %rdi
187 movl $202, %eax
188 #APP
189 # 202 "pthread_getattr_np.c" 1
190 syscall
192 # 0 "" 2
193 #NO_APP
194 jmp .L26
195 .p2align 4,,10
196 .p2align 3
197 .L44:
198 movq __libc_errno@gottpoff(%rip), %rax
199 movl %fs:(%rax), %r12d
200 jmp .L9
201 .p2align 4,,10
202 .p2align 3
203 .L24:
204 cmpl $38, %eax
205 movq %r14, %r15
206 cmovne %eax, %ebp
207 jmp .L21
208 .L10:
209 movq _dl_pagesize(%rip), %rax
210 movl (%r14), %r12d
211 leaq 64(%rsp), %rdx
212 leaq 80(%rsp), %rcx
213 movl %ebp, 28(%rsp)
214 movq %r13, 32(%rsp)
215 movq %rbx, 40(%rsp)
216 movq $0, 16(%rsp)
217 leaq 72(%rsp), %r15
218 movq %rax, 48(%rsp)
219 movq __libc_stack_end(%rip), %rax
220 orl $32768, %r12d
221 movl %r12d, (%r14)
222 movq %rdx, %rbx
223 movq $0, 64(%rsp)
224 movq $0, 72(%rsp)
225 movq %rcx, %r13
226 movq %rax, 56(%rsp)
227 leaq 88(%rsp), %rax
228 movq %rax, %rbp
229 jmp .L12
230 .p2align 4,,10
231 .p2align 3
232 .L19:
233 movq %r14, %rdx
234 movq %r15, %rsi
235 movq %rbx, %rdi
236 call __getline
237 testq %rax, %rax
238 jle .L40
239 movq 64(%rsp), %rdi
240 leaq .LC2(%rip), %rsi
241 xorl %eax, %eax
242 movq %rbp, %rcx
243 movq %r13, %rdx
244 call __isoc99_sscanf
245 cmpl $2, %eax
246 jne .L15
247 movq __libc_stack_end(%rip), %rdx
248 cmpq %rdx, 80(%rsp)
249 movq 88(%rsp), %rax
250 ja .L16
251 cmpq %rax, %rdx
252 jb .L45
253 .L16:
254 movq %rax, 16(%rsp)
255 .L15:
256 movl (%r14), %r12d
257 .L12:
258 andl $16, %r12d
259 je .L19
260 .L40:
261 movl 28(%rsp), %ebp
262 movq 32(%rsp), %r13
263 movl $2, %r12d
264 movq 40(%rsp), %rbx
265 .L18:
266 movq 64(%rsp), %rdi
267 call free@PLT
268 jmp .L11
269 .L45:
270 movq 48(%rsp), %rcx
271 movq 40(%rsp), %rbx
272 movl 28(%rsp), %ebp
273 movq 32(%rsp), %r13
274 movq %rcx, %rdx
275 negq %rdx
276 andq 56(%rsp), %rdx
277 addq %rcx, %rdx
278 movq 96(%rsp), %rcx
279 movq %rdx, 24(%rbx)
280 addq %rdx, %rcx
281 subq 16(%rsp), %rdx
282 subq %rax, %rcx
283 movq %rcx, %rax
284 movq _dl_pagesize(%rip), %rcx
285 negq %rcx
286 andq %rcx, %rax
287 cmpq %rdx, %rax
288 cmovbe %rax, %rdx
289 movq %rdx, 32(%rbx)
290 jmp .L18
291 .size __pthread_getattr_np, .-__pthread_getattr_np
292 .weak pthread_getattr_np
293 .set pthread_getattr_np,__pthread_getattr_np
294 .hidden __isoc99_sscanf
295 .hidden __getline
296 .hidden __getrlimit
297 .hidden __pthread_attr_setaffinity_np
298 .hidden __lll_lock_wait_private
299 .hidden __pthread_attr_destroy
300 .hidden __pthread_getaffinity_np
301 .hidden __pthread_attr_init