clarify the purpose of this project
[nyanglibc.git] / inet / if_index.shared.s
blob3c0ea53d08f8b21e09e65e4fe791ceb4108e753e
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 __GI___if_nametoindex
9 .hidden __GI___if_nametoindex
10 .type __GI___if_nametoindex, @function
11 __GI___if_nametoindex:
12 pushq %r12
13 pushq %rbp
14 pushq %rbx
15 movq %rdi, %rbx
16 subq $48, %rsp
17 call __GI_strlen
18 cmpq $15, %rax
19 jbe .L2
20 movq __libc_errno@gottpoff(%rip), %rax
21 movl $19, %fs:(%rax)
22 addq $48, %rsp
23 xorl %eax, %eax
24 popq %rbx
25 popq %rbp
26 popq %r12
27 ret
28 .p2align 4,,10
29 .p2align 3
30 .L2:
31 movq %rsp, %rbp
32 movq %rbx, %rsi
33 movl $16, %edx
34 movq %rbp, %rdi
35 call __GI_strncpy
36 call __opensock
37 testl %eax, %eax
38 movl %eax, %ebx
39 js .L9
40 movl %eax, %edi
41 movq %rbp, %rdx
42 xorl %eax, %eax
43 movl $35123, %esi
44 call __GI___ioctl
45 testl %eax, %eax
46 js .L11
47 movl %ebx, %edi
48 call __GI___close_nocancel
49 movl 16(%rsp), %eax
50 addq $48, %rsp
51 popq %rbx
52 popq %rbp
53 popq %r12
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L11:
58 movq __libc_errno@gottpoff(%rip), %rbp
59 movl %ebx, %edi
60 movl %fs:0(%rbp), %r12d
61 call __GI___close_nocancel
62 cmpl $22, %r12d
63 jne .L9
64 movl $38, %fs:0(%rbp)
65 .L9:
66 addq $48, %rsp
67 xorl %eax, %eax
68 popq %rbx
69 popq %rbp
70 popq %r12
71 ret
72 .size __GI___if_nametoindex, .-__GI___if_nametoindex
73 .globl __if_nametoindex
74 .set __if_nametoindex,__GI___if_nametoindex
75 .weak __GI_if_nametoindex
76 .hidden __GI_if_nametoindex
77 .set __GI_if_nametoindex,__if_nametoindex
78 .weak if_nametoindex
79 .set if_nametoindex,__GI_if_nametoindex
80 .p2align 4,,15
81 .globl __GI___if_freenameindex
82 .hidden __GI___if_freenameindex
83 .type __GI___if_freenameindex, @function
84 __GI___if_freenameindex:
85 pushq %rbp
86 pushq %rbx
87 movq %rdi, %rbp
88 movq %rdi, %rbx
89 subq $8, %rsp
90 jmp .L13
91 .p2align 4,,10
92 .p2align 3
93 .L14:
94 addq $16, %rbx
95 call free@PLT
96 .L13:
97 movq 8(%rbx), %rdi
98 testq %rdi, %rdi
99 jne .L14
100 movl (%rbx), %eax
101 testl %eax, %eax
102 jne .L14
103 addq $8, %rsp
104 movq %rbp, %rdi
105 popq %rbx
106 popq %rbp
107 jmp free@PLT
108 .size __GI___if_freenameindex, .-__GI___if_freenameindex
109 .globl __if_freenameindex
110 .set __if_freenameindex,__GI___if_freenameindex
111 .weak __GI_if_freenameindex
112 .hidden __GI_if_freenameindex
113 .set __GI_if_freenameindex,__if_freenameindex
114 .weak if_freenameindex
115 .set if_freenameindex,__GI_if_freenameindex
116 .p2align 4,,15
117 .globl __if_nameindex
118 .type __if_nameindex, @function
119 __if_nameindex:
120 pushq %r15
121 pushq %r14
122 pushq %r13
123 pushq %r12
124 pushq %rbp
125 pushq %rbx
126 subq $56, %rsp
127 leaq 16(%rsp), %rbx
128 movq $0, 16(%rsp)
129 movl $0, 24(%rsp)
130 movq $0, 32(%rsp)
131 movq $0, 40(%rsp)
132 movq %rbx, %rdi
133 call __netlink_open
134 testl %eax, %eax
135 js .L38
136 movl $18, %esi
137 movq %rbx, %rdi
138 xorl %r14d, %r14d
139 call __netlink_request
140 testl %eax, %eax
141 js .L18
142 movq 32(%rsp), %r15
143 testq %r15, %r15
144 je .L19
145 movl 20(%rsp), %r10d
146 movq %r15, %r8
147 xorl %r9d, %r9d
148 .p2align 4,,10
149 .p2align 3
150 .L23:
151 movq 8(%r8), %rdx
152 leal 1(%r9), %esi
153 movl %esi, %edi
154 testq %rdx, %rdx
155 je .L20
156 movq 16(%r8), %rcx
157 cmpq $15, %rcx
158 jbe .L20
159 movl (%rdx), %eax
160 cmpl $15, %eax
161 jbe .L20
162 movl %eax, %r11d
163 cmpq %r11, %rcx
164 jnb .L22
165 jmp .L20
166 .p2align 4,,10
167 .p2align 3
168 .L65:
169 movl (%rdx), %eax
170 cmpl $15, %eax
171 jbe .L20
172 movl %eax, %esi
173 cmpq %rsi, %rcx
174 jb .L20
175 leal 1(%r9), %esi
176 .L22:
177 cmpl %r10d, 12(%rdx)
178 movl %esi, %edi
179 jne .L21
180 movl 24(%r8), %esi
181 cmpl %esi, 8(%rdx)
182 jne .L21
183 movzwl 4(%rdx), %esi
184 cmpw $3, %si
185 je .L20
186 cmpw $16, %si
187 jne .L21
188 leal 2(%r9), %esi
189 movl %edi, %r9d
190 movl %esi, %edi
191 .p2align 4,,10
192 .p2align 3
193 .L21:
194 addl $3, %eax
195 andl $-4, %eax
196 subq %rax, %rcx
197 addq %rax, %rdx
198 cmpq $15, %rcx
199 ja .L65
200 .L20:
201 movq (%r8), %r8
202 testq %r8, %r8
203 jne .L23
204 salq $4, %rdi
205 call malloc@PLT
206 testq %rax, %rax
207 movq %rax, %r14
208 je .L25
209 xorl %edx, %edx
210 xorl %ecx, %ecx
211 .p2align 4,,10
212 .p2align 3
213 .L35:
214 movq 8(%r15), %rbp
215 movq %rcx, %r13
216 salq $4, %r13
217 addq %r14, %r13
218 testq %rbp, %rbp
219 je .L26
220 movq 16(%r15), %r12
221 cmpq $15, %r12
222 jbe .L26
223 movl 0(%rbp), %eax
224 cmpl $15, %eax
225 jbe .L26
226 cmpq %rax, %r12
227 jnb .L34
228 jmp .L26
229 .p2align 4,,10
230 .p2align 3
231 .L27:
232 movl 0(%rbp), %eax
233 addl $3, %eax
234 andl $-4, %eax
235 subq %rax, %r12
236 addq %rax, %rbp
237 cmpq $15, %r12
238 jbe .L26
239 movl 0(%rbp), %eax
240 cmpl $15, %eax
241 jbe .L26
242 cmpq %r12, %rax
243 ja .L26
244 .L34:
245 movq %rcx, %r13
246 movl 20(%rsp), %edi
247 salq $4, %r13
248 addq %r14, %r13
249 cmpl %edi, 12(%rbp)
250 jne .L27
251 movl 24(%r15), %edi
252 cmpl %edi, 8(%rbp)
253 jne .L27
254 movzwl 4(%rbp), %esi
255 cmpw $3, %si
256 je .L26
257 cmpw $16, %si
258 jne .L27
259 movl 20(%rbp), %ecx
260 subq $32, %rax
261 leaq 32(%rbp), %rsi
262 cmpq $3, %rax
263 movl %ecx, 0(%r13)
264 jbe .L29
265 movzwl 32(%rbp), %ecx
266 cmpw $3, %cx
267 jbe .L29
268 movzwl %cx, %r8d
269 cmpq %r8, %rax
270 jb .L29
271 cmpw $3, 34(%rbp)
272 jne .L31
273 jmp .L66
274 .p2align 4,,10
275 .p2align 3
276 .L68:
277 movzwl (%rsi), %ecx
278 cmpw $3, %cx
279 jbe .L29
280 movzwl %cx, %r8d
281 cmpq %rax, %r8
282 ja .L29
283 cmpw $3, 2(%rsi)
284 je .L67
285 .L31:
286 addl $3, %ecx
287 andl $131068, %ecx
288 subq %rcx, %rax
289 addq %rcx, %rsi
290 cmpq $3, %rax
291 ja .L68
292 .L29:
293 leal 1(%rdx), %ecx
294 movq %rcx, %r13
295 movq %rcx, %rdx
296 salq $4, %r13
297 addq %r14, %r13
298 jmp .L27
299 .L19:
300 movl $16, %edi
301 call malloc@PLT
302 testq %rax, %rax
303 movq %rax, %r14
304 movq %rax, %r13
305 jne .L37
306 .L25:
307 movq __libc_errno@gottpoff(%rip), %rax
308 xorl %r14d, %r14d
309 movl $105, %fs:(%rax)
310 .L18:
311 movq %rbx, %rdi
312 call __netlink_free_handle
313 movq %rbx, %rdi
314 call __netlink_close
315 .L16:
316 addq $56, %rsp
317 movq %r14, %rax
318 popq %rbx
319 popq %rbp
320 popq %r12
321 popq %r13
322 popq %r14
323 popq %r15
325 .p2align 4,,10
326 .p2align 3
327 .L26:
328 movq (%r15), %r15
329 testq %r15, %r15
330 jne .L35
331 .L37:
332 movl $0, 0(%r13)
333 movq $0, 8(%r13)
334 jmp .L18
335 .p2align 4,,10
336 .p2align 3
337 .L67:
338 leaq 4(%rsi), %rdi
339 leaq -4(%r8), %rsi
340 .L32:
341 movl %edx, 12(%rsp)
342 call __GI___strndup
343 testq %rax, %rax
344 movq %rax, 8(%r13)
345 movl 12(%rsp), %edx
346 jne .L29
347 movl $0, 0(%r13)
348 movq %r14, %rdi
349 call __GI___if_freenameindex
350 jmp .L25
351 .L38:
352 xorl %r14d, %r14d
353 jmp .L16
354 .L66:
355 leaq 36(%rbp), %rdi
356 leaq -4(%r8), %rsi
357 jmp .L32
358 .size __if_nameindex, .-__if_nameindex
359 .weak __GI_if_nameindex
360 .hidden __GI_if_nameindex
361 .set __GI_if_nameindex,__if_nameindex
362 .weak if_nameindex
363 .set if_nameindex,__GI_if_nameindex
364 .p2align 4,,15
365 .globl __if_indextoname
366 .type __if_indextoname, @function
367 __if_indextoname:
368 pushq %r13
369 pushq %r12
370 movq %rsi, %r13
371 pushq %rbp
372 pushq %rbx
373 movl %edi, %ebp
374 subq $56, %rsp
375 call __opensock
376 testl %eax, %eax
377 js .L75
378 movl %ebp, 16(%rsp)
379 movq %rsp, %rbp
380 movl %eax, %edi
381 movl %eax, %ebx
382 movq %rbp, %rdx
383 movl $35088, %esi
384 xorl %eax, %eax
385 call __GI___ioctl
386 movl %ebx, %edi
387 movl %eax, %r12d
388 call __GI___close_nocancel
389 testl %r12d, %r12d
390 jns .L72
391 movq __libc_errno@gottpoff(%rip), %rax
392 cmpl $19, %fs:(%rax)
393 je .L76
394 .L75:
395 addq $56, %rsp
396 xorl %eax, %eax
397 popq %rbx
398 popq %rbp
399 popq %r12
400 popq %r13
402 .p2align 4,,10
403 .p2align 3
404 .L72:
405 movq %rbp, %rsi
406 movq %r13, %rdi
407 movl $16, %edx
408 call __GI_strncpy
409 addq $56, %rsp
410 popq %rbx
411 popq %rbp
412 popq %r12
413 popq %r13
415 .p2align 4,,10
416 .p2align 3
417 .L76:
418 movl $6, %fs:(%rax)
419 jmp .L75
420 .size __if_indextoname, .-__if_indextoname
421 .weak __GI_if_indextoname
422 .hidden __GI_if_indextoname
423 .set __GI_if_indextoname,__if_indextoname
424 .weak if_indextoname
425 .set if_indextoname,__GI_if_indextoname
426 .hidden __netlink_close
427 .hidden __netlink_free_handle
428 .hidden __netlink_request
429 .hidden __netlink_open
430 .hidden __opensock