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