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