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