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