clarify the purpose of this project
[nyanglibc.git] / gshadow / getsgnam.shared.s
blob70bcddfac0011a39827e84510669fe956826f73c
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section __libc_freeres_ptrs, "aw", %nobits
7 .previous
8 #NO_APP
9 .p2align 4,,15
10 .globl getsgnam
11 .type getsgnam, @function
12 getsgnam:
13 .LFB70:
14 pushq %r14
15 pushq %r13
16 pushq %r12
17 pushq %rbp
18 movq %rdi, %r12
19 pushq %rbx
20 subq $16, %rsp
21 #APP
22 # 116 "../nss/getXXbyYY.c" 1
23 movl %fs:24,%eax
24 # 0 "" 2
25 #NO_APP
26 testl %eax, %eax
27 jne .L2
28 movl $1, %edx
29 #APP
30 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
31 cmpxchgl %edx, lock(%rip)
32 # 0 "" 2
33 #NO_APP
34 .L3:
35 movq buffer(%rip), %rdx
36 movq buffer_size.10495(%rip), %rbx
37 testq %rdx, %rdx
38 je .L18
39 .L5:
40 leaq 8(%rsp), %r14
41 leaq resbuf.10496(%rip), %r13
42 jmp .L12
43 .p2align 4,,10
44 .p2align 3
45 .L7:
46 movq %rax, buffer(%rip)
47 .L12:
48 movq %r14, %r8
49 movq %rbx, %rcx
50 movq %r13, %rsi
51 movq %r12, %rdi
52 call __getsgnam_r
53 cmpl $34, %eax
54 jne .L19
55 movq buffer_size.10495(%rip), %rax
56 movq buffer(%rip), %rbp
57 leaq (%rax,%rax), %rbx
58 movq %rbp, %rdi
59 movq %rbx, %rsi
60 movq %rbx, buffer_size.10495(%rip)
61 call realloc@PLT
62 testq %rax, %rax
63 movq %rax, %rdx
64 jne .L7
65 movq %rbp, %rdi
66 call free@PLT
67 movq __libc_errno@gottpoff(%rip), %rax
68 movq $0, buffer(%rip)
69 movl $12, %fs:(%rax)
70 .L9:
71 movq $0, 8(%rsp)
72 .L13:
73 #APP
74 # 163 "../nss/getXXbyYY.c" 1
75 movl %fs:24,%eax
76 # 0 "" 2
77 #NO_APP
78 testl %eax, %eax
79 jne .L10
80 subl $1, lock(%rip)
81 .L11:
82 movq 8(%rsp), %rax
83 addq $16, %rsp
84 popq %rbx
85 popq %rbp
86 popq %r12
87 popq %r13
88 popq %r14
89 ret
90 .p2align 4,,10
91 .p2align 3
92 .L19:
93 cmpq $0, buffer(%rip)
94 jne .L13
95 jmp .L9
96 .p2align 4,,10
97 .p2align 3
98 .L18:
99 movl $1024, %edi
100 movq $1024, buffer_size.10495(%rip)
101 movl $1024, %ebx
102 call malloc@PLT
103 testq %rax, %rax
104 movq %rax, %rdx
105 movq %rax, buffer(%rip)
106 jne .L5
107 jmp .L9
108 .p2align 4,,10
109 .p2align 3
110 .L10:
111 xorl %eax, %eax
112 #APP
113 # 163 "../nss/getXXbyYY.c" 1
114 xchgl %eax, lock(%rip)
115 # 0 "" 2
116 #NO_APP
117 cmpl $1, %eax
118 jle .L11
119 xorl %r10d, %r10d
120 movl $1, %edx
121 movl $129, %esi
122 leaq lock(%rip), %rdi
123 movl $202, %eax
124 #APP
125 # 163 "../nss/getXXbyYY.c" 1
126 syscall
128 # 0 "" 2
129 #NO_APP
130 jmp .L11
131 .p2align 4,,10
132 .p2align 3
133 .L2:
134 xorl %eax, %eax
135 movl $1, %edx
136 lock cmpxchgl %edx, lock(%rip)
137 je .L3
138 leaq lock(%rip), %rdi
139 call __lll_lock_wait_private
140 jmp .L3
141 .LFE70:
142 .size getsgnam, .-getsgnam
143 .local resbuf.10496
144 .comm resbuf.10496,32,32
145 .local buffer_size.10495
146 .comm buffer_size.10495,8,8
147 .section __libc_freeres_ptrs
148 #,"aw",@progbits
149 .align 8
150 .type buffer, @object
151 .size buffer, 8
152 buffer:
153 .zero 8
154 .local lock
155 .comm lock,4,4
156 .hidden __lll_lock_wait_private
157 .hidden __getsgnam_r