clarify the purpose of this project
[nyanglibc.git] / inet / check_native.shared.s
blob95270b0e87976b0d112edc0250685474887e00e2
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 __check_native
9 .hidden __check_native
10 .type __check_native, @function
11 __check_native:
12 pushq %rbp
13 movq %rsp, %rbp
14 pushq %r15
15 pushq %r14
16 pushq %r13
17 pushq %r12
18 leaq -172(%rbp), %r12
19 pushq %rbx
20 subq $184, %rsp
21 movl %edi, -184(%rbp)
22 movq %rsi, -192(%rbp)
23 movl %edx, -180(%rbp)
24 movl $524291, %esi
25 xorl %edx, %edx
26 movl $16, %edi
27 movq %rcx, -200(%rbp)
28 call __GI___socket
29 xorl %esi, %esi
30 movl $16, %edi
31 testl %eax, %eax
32 movq $0, -170(%rbp)
33 movw %di, -172(%rbp)
34 movw %si, 10(%r12)
35 movl $12, -176(%rbp)
36 jns .L34
37 .L1:
38 leaq -40(%rbp), %rsp
39 popq %rbx
40 popq %r12
41 popq %r13
42 popq %r14
43 popq %r15
44 popq %rbp
45 ret
46 .p2align 4,,10
47 .p2align 3
48 .L34:
49 movl $12, %edx
50 movq %r12, %rsi
51 movl %eax, %edi
52 movl %eax, %ebx
53 call __bind
54 testl %eax, %eax
55 jne .L1
56 leaq -176(%rbp), %rdx
57 movq %r12, %rsi
58 movl %ebx, %edi
59 call __getsockname
60 testl %eax, %eax
61 jne .L1
62 leaq -112(%rbp), %r13
63 movabsq $216454334399905812, %rax
64 movl $5, %edi
65 movl -168(%rbp), %r14d
66 movq %rax, -144(%rbp)
67 movq %r13, %rsi
68 movl $0, -132(%rbp)
69 call __GI___clock_gettime
70 movq -112(%rbp), %rax
71 subq $4112, %rsp
72 leaq -144(%rbp), %rdi
73 xorl %edx, %edx
74 movl $16, %ecx
75 movb $0, -128(%rbp)
76 movb $0, -125(%rbp)
77 movq $0, 2(%r12)
78 movq %rdi, %r15
79 movl %eax, -136(%rbp)
80 xorl %eax, %eax
81 movw %dx, 10(%r12)
82 movw %ax, -127(%rbp)
83 leaq 15(%rsp), %rax
84 movw %cx, -172(%rbp)
85 movq $4096, -152(%rbp)
86 andq $-16, %rax
87 movq %rax, -208(%rbp)
88 movq %rax, -160(%rbp)
89 jmp .L4
90 .p2align 4,,10
91 .p2align 3
92 .L35:
93 movq __libc_errno@gottpoff(%rip), %rax
94 cmpl $4, %fs:(%rax)
95 jne .L1
96 .L4:
97 xorl %ecx, %ecx
98 movl $12, %r9d
99 movq %r12, %r8
100 movl $20, %edx
101 movq %r15, %rsi
102 movl %ebx, %edi
103 call __sendto
104 cmpq $-1, %rax
105 je .L35
106 testq %rax, %rax
107 js .L1
108 leaq -160(%rbp), %r15
109 .p2align 4,,10
110 .p2align 3
111 .L6:
112 movq %r12, -112(%rbp)
113 movl $12, -104(%rbp)
114 movq %r15, -96(%rbp)
115 movq $1, -88(%rbp)
116 movq $0, -80(%rbp)
117 movq $0, -72(%rbp)
118 movl $0, -64(%rbp)
119 jmp .L8
120 .p2align 4,,10
121 .p2align 3
122 .L37:
123 movq __libc_errno@gottpoff(%rip), %rdx
124 cmpl $4, %fs:(%rdx)
125 jne .L36
126 .L8:
127 xorl %edx, %edx
128 movq %r13, %rsi
129 movl %ebx, %edi
130 call __recvmsg
131 cmpq $-1, %rax
132 je .L37
133 movq %rax, %rsi
134 movl %ebx, %edi
135 movq %rax, -216(%rbp)
136 call __GI___netlink_assert_response
137 movq -216(%rbp), %rax
138 testq %rax, %rax
139 js .L1
140 testb $32, -64(%rbp)
141 jne .L1
142 cmpq $15, %rax
143 jle .L6
144 movq -208(%rbp), %rsi
145 movl (%rsi), %edx
146 cmpl $15, %edx
147 jbe .L6
148 movl %edx, %ecx
149 cmpq %rax, %rcx
150 ja .L6
151 movl -168(%rbp), %edi
152 movl -136(%rbp), %r8d
153 movq %rsi, %rcx
154 xorl %r9d, %r9d
155 jmp .L22
156 .p2align 4,,10
157 .p2align 3
158 .L15:
159 cmpw $3, %si
160 movl $1, %esi
161 cmove %esi, %r9d
162 .p2align 4,,10
163 .p2align 3
164 .L14:
165 addl $3, %edx
166 andl $-4, %edx
167 subq %rdx, %rax
168 addq %rdx, %rcx
169 cmpq $15, %rax
170 jbe .L21
171 movl (%rcx), %edx
172 cmpl $15, %edx
173 jbe .L21
174 movl %edx, %esi
175 cmpq %rsi, %rax
176 jb .L21
177 .L22:
178 testl %edi, %edi
179 jne .L14
180 cmpl 12(%rcx), %r14d
181 jne .L14
182 cmpl %r8d, 8(%rcx)
183 jne .L14
184 movzwl 4(%rcx), %esi
185 cmpw $16, %si
186 jne .L15
187 movzwl 18(%rcx), %r10d
188 leal -768(%r10), %esi
189 cmpw $1, %si
190 seta %r11b
191 xorl %esi, %esi
192 cmpw $776, %r10w
193 setne %sil
194 movl -184(%rbp), %r10d
195 andl %r11d, %esi
196 movl 20(%rcx), %r11d
197 cmpl %r10d, %r11d
198 je .L16
199 cmpl $-1, %r10d
200 sete %r10b
201 cmpl -180(%rbp), %r11d
202 je .L38
203 .L18:
204 cmpl $-1, -180(%rbp)
205 sete %sil
206 andl %esi, %r10d
207 .L20:
208 testb %r10b, %r10b
209 je .L14
210 .p2align 4,,10
211 .p2align 3
212 .L23:
213 movl %ebx, %edi
214 call __GI___close_nocancel
215 jmp .L1
216 .p2align 4,,10
217 .p2align 3
218 .L21:
219 testb %r9b, %r9b
220 je .L6
221 jmp .L23
222 .L5:
223 .p2align 4,,10
224 .p2align 3
225 .L36:
226 movl %ebx, %edi
227 movq %rax, %rsi
228 call __GI___netlink_assert_response
229 leaq -40(%rbp), %rsp
230 popq %rbx
231 popq %r12
232 popq %r13
233 popq %r14
234 popq %r15
235 popq %rbp
237 .p2align 4,,10
238 .p2align 3
239 .L16:
240 movl -180(%rbp), %r10d
241 cmpl %r10d, -184(%rbp)
242 movq -192(%rbp), %r11
243 movl %esi, (%r11)
244 je .L39
245 movl $1, %r10d
246 movl $-1, -184(%rbp)
247 jmp .L18
248 .p2align 4,,10
249 .p2align 3
250 .L38:
251 movq -200(%rbp), %r11
252 movl $-1, -180(%rbp)
253 movl %esi, (%r11)
254 jmp .L20
255 .L39:
256 movq -200(%rbp), %rax
257 movl %esi, (%rax)
258 jmp .L23
259 .size __check_native, .-__check_native
260 .hidden __recvmsg
261 .hidden __sendto
262 .hidden __getsockname
263 .hidden __bind