clarify the purpose of this project
[nyanglibc.git] / nptl / pthread_setspecific.s
blobe13ba8d9c0a9d548396ca4b1082bcf732255791d
1 .text
2 .p2align 4,,15
3 .globl __pthread_setspecific
4 .type __pthread_setspecific, @function
5 __pthread_setspecific:
6 pushq %r13
7 pushq %r12
8 pushq %rbp
9 pushq %rbx
10 movq %rsi, %rbp
11 subq $8, %rsp
12 cmpl $31, %edi
13 ja .L2
14 movl %edi, %edi
15 leaq __pthread_keys(%rip), %rdx
16 movq %rdi, %rax
17 salq $4, %rax
18 movq (%rdx,%rax), %rdx
19 movl $22, %eax
20 movl %edx, %r12d
21 andl $1, %edx
22 je .L1
23 addq $49, %rdi
24 salq $4, %rdi
25 addq %fs:16, %rdi
26 testq %rsi, %rsi
27 je .L4
28 .L18:
29 #APP
30 # 82 "pthread_setspecific.c" 1
31 movb $1,%fs:1552
32 # 0 "" 2
33 #NO_APP
34 .L4:
35 movl %r12d, %eax
36 movq %rbp, 8(%rdi)
37 movq %rax, (%rdi)
38 xorl %eax, %eax
39 .L1:
40 addq $8, %rsp
41 popq %rbx
42 popq %rbp
43 popq %r12
44 popq %r13
45 ret
46 .p2align 4,,10
47 .p2align 3
48 .L2:
49 cmpl $1023, %edi
50 movl $22, %eax
51 ja .L1
52 movl %edi, %edx
53 leaq __pthread_keys(%rip), %rcx
54 salq $4, %rdx
55 movq (%rcx,%rdx), %rdx
56 movl %edx, %r12d
57 andl $1, %edx
58 je .L1
59 movl %edi, %r13d
60 movl %edi, %ebx
61 shrl $5, %r13d
62 andl $31, %ebx
63 #APP
64 # 61 "pthread_setspecific.c" 1
65 movq %fs:1296(,%r13,8),%rax
66 # 0 "" 2
67 #NO_APP
68 testq %rax, %rax
69 je .L20
70 .L5:
71 movl %ebx, %edi
72 salq $4, %rdi
73 addq %rax, %rdi
74 jmp .L18
75 .p2align 4,,10
76 .p2align 3
77 .L20:
78 testq %rsi, %rsi
79 je .L1
80 movl $16, %esi
81 movl $32, %edi
82 call calloc@PLT
83 testq %rax, %rax
84 je .L10
85 #APP
86 # 75 "pthread_setspecific.c" 1
87 movq %rax,%fs:1296(,%r13,8)
88 # 0 "" 2
89 #NO_APP
90 jmp .L5
91 .L10:
92 movl $12, %eax
93 jmp .L1
94 .size __pthread_setspecific, .-__pthread_setspecific
95 .weak pthread_setspecific
96 .set pthread_setspecific,__pthread_setspecific