clarify the purpose of this project
[nyanglibc.git] / inet / ruserpass.shared.s
blob4e69d3e5de8cde6b6d729156767077b01b25c1f4
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type token, @function
9 token:
10 movq cfile(%rip), %rdi
11 testb $48, (%rdi)
12 je .L33
13 xorl %eax, %eax
14 ret
15 .p2align 4,,10
16 .p2align 3
17 .L33:
18 pushq %r14
19 pushq %r13
20 pushq %r12
21 pushq %rbp
22 pushq %rbx
23 movabsq $17596481013248, %rbx
24 .L7:
25 movq 8(%rdi), %rax
26 cmpq 16(%rdi), %rax
27 jnb .L34
28 leaq 1(%rax), %rdx
29 movq %rdx, 8(%rdi)
30 movzbl (%rax), %eax
31 .L4:
32 cmpl $44, %eax
33 jbe .L35
34 .L5:
35 leaq 1+tokval(%rip), %rbx
36 movb %al, tokval(%rip)
37 movabsq $17596481013248, %rbp
38 .p2align 4,,10
39 .p2align 3
40 .L14:
41 movq 8(%rdi), %rax
42 cmpq 16(%rdi), %rax
43 jnb .L36
44 leaq 1(%rax), %rdx
45 movq %rdx, 8(%rdi)
46 movzbl (%rax), %eax
47 .L18:
48 cmpl $44, %eax
49 jbe .L37
50 cmpl $92, %eax
51 movq cfile(%rip), %rdi
52 jne .L16
53 movq 8(%rdi), %rax
54 cmpq 16(%rdi), %rax
55 jnb .L38
56 leaq 1(%rax), %rdx
57 movq %rdx, 8(%rdi)
58 movzbl (%rax), %eax
59 .L16:
60 addq $1, %rbx
61 movb %al, -1(%rbx)
62 jmp .L14
63 .p2align 4,,10
64 .p2align 3
65 .L37:
66 btq %rax, %rbp
67 jc .L12
68 movq cfile(%rip), %rdi
69 jmp .L16
70 .p2align 4,,10
71 .p2align 3
72 .L35:
73 btq %rax, %rbx
74 jc .L7
75 cmpl $34, %eax
76 jne .L5
77 leaq tokval(%rip), %rbx
78 jmp .L25
79 .p2align 4,,10
80 .p2align 3
81 .L8:
82 addq $1, %rbx
83 movb %al, -1(%rbx)
84 .L25:
85 movq 8(%rdi), %rax
86 cmpq 16(%rdi), %rax
87 jnb .L39
88 leaq 1(%rax), %rdx
89 movq %rdx, 8(%rdi)
90 movzbl (%rax), %eax
91 .L11:
92 cmpl $34, %eax
93 je .L12
94 cmpl $92, %eax
95 movq cfile(%rip), %rdi
96 jne .L8
97 movq 8(%rdi), %rax
98 cmpq 16(%rdi), %rax
99 jnb .L40
100 leaq 1(%rax), %rdx
101 movq %rdx, 8(%rdi)
102 movzbl (%rax), %eax
103 jmp .L8
104 .p2align 4,,10
105 .p2align 3
106 .L39:
107 call __GI___uflow
108 cmpl $-1, %eax
109 jne .L11
110 .p2align 4,,10
111 .p2align 3
112 .L12:
113 movb $0, (%rbx)
114 cmpb $0, tokval(%rip)
115 je .L2
116 leaq tokstr(%rip), %r12
117 leaq tokval(%rip), %rbp
118 leaq toktab(%rip), %r13
119 xorl %r14d, %r14d
120 xorl %edi, %edi
121 .L24:
122 addq %r12, %rdi
123 movq %rbp, %rsi
124 movslq %r14d, %rbx
125 call __GI_strcmp
126 testl %eax, %eax
127 je .L41
128 addq $1, %r14
129 cmpq $7, %r14
130 je .L26
131 movslq 0(%r13,%r14,8), %rdi
132 jmp .L24
133 .p2align 4,,10
134 .p2align 3
135 .L34:
136 call __GI___uflow
137 cmpl $-1, %eax
138 jne .L42
139 .L2:
140 xorl %eax, %eax
141 .L1:
142 popq %rbx
143 popq %rbp
144 popq %r12
145 popq %r13
146 popq %r14
148 .p2align 4,,10
149 .p2align 3
150 .L36:
151 call __GI___uflow
152 cmpl $-1, %eax
153 jne .L18
154 jmp .L12
155 .p2align 4,,10
156 .p2align 3
157 .L26:
158 movl $10, %eax
159 jmp .L1
160 .p2align 4,,10
161 .p2align 3
162 .L42:
163 movq cfile(%rip), %rdi
164 jmp .L4
165 .p2align 4,,10
166 .p2align 3
167 .L41:
168 leaq toktab(%rip), %rax
169 movl 4(%rax,%rbx,8), %eax
170 jmp .L1
171 .p2align 4,,10
172 .p2align 3
173 .L38:
174 call __GI___uflow
175 movq cfile(%rip), %rdi
176 jmp .L16
177 .p2align 4,,10
178 .p2align 3
179 .L40:
180 call __GI___uflow
181 movq cfile(%rip), %rdi
182 jmp .L8
183 .size token, .-token
184 .section .rodata.str1.1,"aMS",@progbits,1
185 .LC0:
186 .string "HOME"
187 .LC1:
188 .string "rce"
189 .LC2:
190 .string "%s"
191 .LC3:
192 .string "out of memory"
193 .LC4:
194 .string "anonymous"
195 .section .rodata.str1.8,"aMS",@progbits,1
196 .align 8
197 .LC5:
198 .string "Error: .netrc file is readable by others."
199 .align 8
200 .LC6:
201 .string "Remove 'password' line or make file unreadable by others."
202 .section .rodata.str1.1
203 .LC7:
204 .string "Unknown .netrc keyword %s"
205 .text
206 .p2align 4,,15
207 .globl __GI_ruserpass
208 .hidden __GI_ruserpass
209 .type __GI_ruserpass, @function
210 __GI_ruserpass:
211 pushq %rbp
212 movq %rsp, %rbp
213 pushq %r15
214 pushq %r14
215 pushq %r13
216 pushq %r12
217 movq %rdx, %r15
218 pushq %rbx
219 movq %rsi, %r12
220 subq $1208, %rsp
221 movq %rdi, -1232(%rbp)
222 leaq .LC0(%rip), %rdi
223 call __GI___libc_secure_getenv
224 testq %rax, %rax
225 je .L73
226 movq %rax, %rdi
227 movq %rax, %r13
228 call __GI_strlen
229 addq $38, %rax
230 movq %r13, %rsi
231 andq $-16, %rax
232 subq %rax, %rsp
233 leaq 15(%rsp), %rbx
234 andq $-16, %rbx
235 movq %rbx, %rdi
236 call __GI_stpcpy@PLT
237 movabsq $27991866937847343, %rcx
238 leaq .LC1(%rip), %rsi
239 movq %rbx, %rdi
240 movq %rcx, (%rax)
241 call _IO_new_fopen@PLT
242 testq %rax, %rax
243 movq %rax, cfile(%rip)
244 je .L106
245 orl $32768, (%rax)
246 leaq -1072(%rbp), %rbx
247 movl $1024, %esi
248 movq %rbx, %rdi
249 call __gethostname
250 testl %eax, %eax
251 js .L107
252 .L46:
253 movl $46, %esi
254 movq %rbx, %rdi
255 leaq tokval(%rip), %r13
256 leaq .LC7(%rip), %r14
257 call __strchrnul@PLT
258 movl $0, -1224(%rbp)
259 movq %rax, -1240(%rbp)
260 .L48:
261 call token
262 testl %eax, %eax
263 movl %eax, %ebx
264 je .L71
265 cmpl $1, %ebx
266 je .L49
267 cmpl $11, %ebx
268 jne .L48
269 movl -1224(%rbp), %ebx
270 testl %ebx, %ebx
271 je .L108
272 .L49:
273 leaq -1216(%rbp), %rax
274 movq %rax, -1224(%rbp)
275 .p2align 4,,10
276 .p2align 3
277 .L56:
278 call token
279 cmpl $1, %eax
280 jbe .L71
281 cmpl $11, %eax
282 je .L71
283 cmpl $3, %eax
284 je .L53
285 jg .L54
286 cmpl $2, %eax
287 jne .L52
288 call token
289 testl %eax, %eax
290 je .L56
291 movq (%r12), %rdi
292 testq %rdi, %rdi
293 je .L109
294 movq %r13, %rsi
295 call __GI_strcmp
296 testl %eax, %eax
297 je .L56
298 movl %ebx, -1224(%rbp)
299 jmp .L48
300 .p2align 4,,10
301 .p2align 3
302 .L71:
303 movq cfile(%rip), %rdi
304 xorl %r12d, %r12d
305 call _IO_new_fclose@PLT
306 .L43:
307 leaq -40(%rbp), %rsp
308 movl %r12d, %eax
309 popq %rbx
310 popq %r12
311 popq %r13
312 popq %r14
313 popq %r15
314 popq %rbp
316 .p2align 4,,10
317 .p2align 3
318 .L54:
319 cmpl $5, %eax
320 jle .L56
321 .L52:
322 leaq __GI__libc_intl_domainname(%rip), %rdi
323 movq %r14, %rsi
324 movl $5, %edx
325 call __GI___dcgettext
326 movq %r13, %rsi
327 movq %rax, %rdi
328 xorl %eax, %eax
329 call __GI_warnx
330 jmp .L56
331 .p2align 4,,10
332 .p2align 3
333 .L53:
334 movq (%r12), %rsi
335 leaq .LC4(%rip), %rdi
336 movl $10, %ecx
337 repz cmpsb
338 je .L64
339 movq cfile(%rip), %rdi
340 call __GI_fileno
341 movq -1224(%rbp), %rsi
342 movl %eax, %edi
343 call __GI___fstat64
344 testl %eax, %eax
345 js .L64
346 testb $63, -1192(%rbp)
347 jne .L110
348 .L64:
349 call token
350 testl %eax, %eax
351 je .L56
352 cmpq $0, (%r15)
353 jne .L56
354 leaq tokval(%rip), %rdx
355 .L65:
356 movl (%rdx), %ecx
357 addq $4, %rdx
358 leal -16843009(%rcx), %eax
359 notl %ecx
360 andl %ecx, %eax
361 andl $-2139062144, %eax
362 je .L65
363 movl %eax, %ecx
364 shrl $16, %ecx
365 testl $32896, %eax
366 cmove %ecx, %eax
367 leaq 2(%rdx), %rcx
368 cmove %rcx, %rdx
369 movl %eax, %ecx
370 addb %al, %cl
371 sbbq $3, %rdx
372 subq %r13, %rdx
373 leal 1(%rdx), %edi
374 movq %rdx, -1248(%rbp)
375 call malloc@PLT
376 testq %rax, %rax
377 movq %rax, %rdi
378 movq -1248(%rbp), %rdx
379 je .L105
380 addq $1, %rdx
381 movq %r13, %rsi
382 call __GI_memcpy@PLT
383 movq %rax, (%r15)
384 jmp .L56
385 .p2align 4,,10
386 .p2align 3
387 .L106:
388 movq __libc_errno@gottpoff(%rip), %rax
389 xorl %r12d, %r12d
390 cmpl $2, %fs:(%rax)
391 je .L43
392 leaq .LC2(%rip), %rdi
393 movq %rbx, %rsi
394 xorl %eax, %eax
395 call __GI_warn
396 jmp .L43
397 .p2align 4,,10
398 .p2align 3
399 .L107:
400 movb $0, -1072(%rbp)
401 jmp .L46
402 .p2align 4,,10
403 .p2align 3
404 .L108:
405 call token
406 cmpl $10, %eax
407 jne .L48
408 movq -1232(%rbp), %rdi
409 movq %r13, %rsi
410 call __GI___strcasecmp
411 testl %eax, %eax
412 movl %eax, %ebx
413 je .L49
414 movq -1232(%rbp), %rdi
415 movl $46, %esi
416 call __GI_strchr
417 testq %rax, %rax
418 movq %rax, %rbx
419 je .L48
420 movq -1240(%rbp), %rsi
421 movq %rax, %rdi
422 call __GI___strcasecmp
423 testl %eax, %eax
424 jne .L48
425 movq -1232(%rbp), %rdi
426 movq %rbx, %rcx
427 movq %r13, %rsi
428 subq %rdi, %rcx
429 movq %rcx, %rdx
430 movq %rcx, -1248(%rbp)
431 call __strncasecmp@PLT
432 testl %eax, %eax
433 movl %eax, %ebx
434 jne .L48
435 movq -1248(%rbp), %rcx
436 cmpb $0, 0(%r13,%rcx)
437 je .L49
438 movl $0, -1224(%rbp)
439 jmp .L48
440 .p2align 4,,10
441 .p2align 3
442 .L109:
443 leaq tokval(%rip), %rdx
444 .L59:
445 movl (%rdx), %ecx
446 addq $4, %rdx
447 leal -16843009(%rcx), %eax
448 notl %ecx
449 andl %ecx, %eax
450 andl $-2139062144, %eax
451 je .L59
452 movl %eax, %ecx
453 shrl $16, %ecx
454 testl $32896, %eax
455 cmove %ecx, %eax
456 leaq 2(%rdx), %rcx
457 cmove %rcx, %rdx
458 movl %eax, %ecx
459 addb %al, %cl
460 sbbq $3, %rdx
461 subq %r13, %rdx
462 leal 1(%rdx), %edi
463 movq %rdx, -1248(%rbp)
464 call malloc@PLT
465 testq %rax, %rax
466 movq %rax, %rdi
467 movq -1248(%rbp), %rdx
468 je .L105
469 addq $1, %rdx
470 movq %r13, %rsi
471 call __GI_memcpy@PLT
472 movq %rax, (%r12)
473 jmp .L56
474 .L73:
475 movl $-1, %r12d
476 jmp .L43
477 .L110:
478 leaq .LC5(%rip), %rsi
479 leaq __GI__libc_intl_domainname(%rip), %rdi
480 movl $5, %edx
481 call __GI___dcgettext
482 movq %rax, %rdi
483 xorl %eax, %eax
484 call __GI_warnx
485 leaq .LC6(%rip), %rsi
486 movl $5, %edx
487 .L104:
488 .L62:
489 leaq __GI__libc_intl_domainname(%rip), %rdi
490 movl $-1, %r12d
491 call __GI___dcgettext
492 movq %rax, %rdi
493 xorl %eax, %eax
494 call __GI_warnx
495 movq cfile(%rip), %rdi
496 call _IO_new_fclose@PLT
497 jmp .L43
498 .L105:
499 movl $5, %edx
500 leaq .LC3(%rip), %rsi
501 jmp .L104
502 .size __GI_ruserpass, .-__GI_ruserpass
503 .globl ruserpass
504 .set ruserpass,__GI_ruserpass
505 .section .rodata
506 .align 32
507 .type toktab, @object
508 .size toktab, 56
509 toktab:
510 .long 0
511 .long 1
512 .long 8
513 .long 2
514 .long 14
515 .long 3
516 .long 23
517 .long 3
518 .long 30
519 .long 4
520 .long 38
521 .long 11
522 .long 46
523 .long 5
524 .align 32
525 .type tokstr, @object
526 .size tokstr, 53
527 tokstr:
528 .string "default"
529 .string "login"
530 .string "password"
531 .string "passwd"
532 .string "account"
533 .string "machine"
534 .string "macdef"
535 .local tokval
536 .comm tokval,100,32
537 .local cfile
538 .comm cfile,8,8
539 .hidden __gethostname