clarify the purpose of this project
[nyanglibc.git] / gshadow / fgetsgent.shared.s
blob1e555a1ccabbaac736edc11a8696af07c5aa9110
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 fgetsgent
11 .type fgetsgent, @function
12 fgetsgent:
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 # 47 "fgetsgent.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.8524(%rip), %rcx
63 leaq resbuf.8525(%rip), %rsi
64 movq %r12, %r8
65 movq %rbx, %rdi
66 call __fgetsgent_r
67 cmpl $34, %eax
68 jne .L20
69 movq buffer_size.8524(%rip), %rax
70 movq buffer(%rip), %r14
71 leaq 1024(%rax), %rsi
72 movq %r14, %rdi
73 movq %rsi, buffer_size.8524(%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 # 83 "fgetsgent.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 movq 24(%rsp), %rax
102 movl %r8d, %fs:0(%r13)
103 .L1:
104 addq $56, %rsp
105 popq %rbx
106 popq %rbp
107 popq %r12
108 popq %r13
109 popq %r14
110 popq %r15
112 .p2align 4,,10
113 .p2align 3
114 .L20:
115 cmpq $0, buffer(%rip)
116 jne .L11
117 jmp .L13
118 .p2align 4,,10
119 .p2align 3
120 .L19:
121 movl $1024, %edi
122 movq $1024, buffer_size.8524(%rip)
123 call malloc@PLT
124 movq %rax, %rdx
125 movq %rax, buffer(%rip)
126 jmp .L5
127 .L14:
128 xorl %eax, %eax
129 #APP
130 # 83 "fgetsgent.c" 1
131 xchgl %eax, lock(%rip)
132 # 0 "" 2
133 #NO_APP
134 cmpl $1, %eax
135 jle .L15
136 xorl %r10d, %r10d
137 movl $1, %edx
138 movl $129, %esi
139 leaq lock(%rip), %rdi
140 movl $202, %eax
141 #APP
142 # 83 "fgetsgent.c" 1
143 syscall
145 # 0 "" 2
146 #NO_APP
147 jmp .L15
148 .L3:
149 movl $1, %edx
150 lock cmpxchgl %edx, lock(%rip)
151 je .L4
152 leaq lock(%rip), %rdi
153 call __lll_lock_wait_private
154 jmp .L4
155 .L16:
156 xorl %eax, %eax
157 jmp .L1
158 .LFE64:
159 .size fgetsgent, .-fgetsgent
160 .local resbuf.8525
161 .comm resbuf.8525,32,32
162 .local buffer_size.8524
163 .comm buffer_size.8524,8,8
164 .section __libc_freeres_ptrs
165 #,"aw",@progbits
166 .align 8
167 .type buffer, @object
168 .size buffer, 8
169 buffer:
170 .zero 8
171 .local lock
172 .comm lock,4,4
173 .hidden __lll_lock_wait_private
174 .hidden __fgetsgent_r