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