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