clarify the purpose of this project
[nyanglibc.git] / sunrpc / compat-clnt_tcp.shared.s
blob46c427168b52b10598bbe3db1a4f71227aaf32ce
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 clnttcp_geterr, @function
9 clnttcp_geterr:
10 movq 16(%rdi), %rax
11 movdqu 48(%rax), %xmm0
12 movups %xmm0, (%rsi)
13 movq 64(%rax), %rax
14 movq %rax, 16(%rsi)
15 ret
16 .size clnttcp_geterr, .-clnttcp_geterr
17 .p2align 4,,15
18 .type clnttcp_freeres, @function
19 clnttcp_freeres:
20 movq 16(%rdi), %rdi
21 movq %rsi, %rcx
22 xorl %eax, %eax
23 movq %rdx, %rsi
24 movl $2, 104(%rdi)
25 addq $104, %rdi
26 jmp *%rcx
27 .size clnttcp_freeres, .-clnttcp_freeres
28 .p2align 4,,15
29 .type clnttcp_abort, @function
30 clnttcp_abort:
31 rep ret
32 .size clnttcp_abort, .-clnttcp_abort
33 .p2align 4,,15
34 .type clnttcp_destroy, @function
35 clnttcp_destroy:
36 pushq %rbp
37 pushq %rbx
38 movq %rdi, %rbp
39 subq $8, %rsp
40 movq 16(%rdi), %rbx
41 movl 4(%rbx), %eax
42 testl %eax, %eax
43 jne .L12
44 .L6:
45 movq 112(%rbx), %rax
46 movq 56(%rax), %rax
47 testq %rax, %rax
48 je .L7
49 leaq 104(%rbx), %rdi
50 call *%rax
51 .L7:
52 movq %rbx, %rdi
53 call free@PLT
54 addq $8, %rsp
55 movq %rbp, %rdi
56 popq %rbx
57 popq %rbp
58 jmp free@PLT
59 .p2align 4,,10
60 .p2align 3
61 .L12:
62 movl (%rbx), %edi
63 call __GI___close
64 jmp .L6
65 .size clnttcp_destroy, .-clnttcp_destroy
66 .p2align 4,,15
67 .type clnttcp_control, @function
68 clnttcp_control:
69 cmpl $15, %esi
70 movq 16(%rdi), %rdi
71 ja .L28
72 leaq .L16(%rip), %rcx
73 movl %esi, %esi
74 movslq (%rcx,%rsi,4), %rax
75 addq %rcx, %rax
76 jmp *%rax
77 .section .rodata
78 .align 4
79 .align 4
80 .L16:
81 .long .L28-.L16
82 .long .L15-.L16
83 .long .L17-.L16
84 .long .L18-.L16
85 .long .L28-.L16
86 .long .L28-.L16
87 .long .L19-.L16
88 .long .L28-.L16
89 .long .L20-.L16
90 .long .L21-.L16
91 .long .L22-.L16
92 .long .L23-.L16
93 .long .L24-.L16
94 .long .L25-.L16
95 .long .L26-.L16
96 .long .L27-.L16
97 .text
98 .p2align 4,,10
99 .p2align 3
100 .L27:
101 movq (%rdx), %rax
102 bswap %eax
103 movl %eax, 84(%rdi)
104 movl $1, %eax
106 .p2align 4,,10
107 .p2align 3
108 .L15:
109 movdqu (%rdx), %xmm0
110 movl $1, %eax
111 movl $1, 24(%rdi)
112 movups %xmm0, 8(%rdi)
114 .p2align 4,,10
115 .p2align 3
116 .L17:
117 movdqu 8(%rdi), %xmm0
118 movl $1, %eax
119 movups %xmm0, (%rdx)
121 .p2align 4,,10
122 .p2align 3
123 .L18:
124 movdqu 28(%rdi), %xmm0
125 movl $1, %eax
126 movups %xmm0, (%rdx)
128 .p2align 4,,10
129 .p2align 3
130 .L19:
131 movl (%rdi), %eax
132 movl %eax, (%rdx)
133 movl $1, %eax
135 .p2align 4,,10
136 .p2align 3
137 .L20:
138 movl $1, 4(%rdi)
139 movl $1, %eax
141 .p2align 4,,10
142 .p2align 3
143 .L21:
144 movl $0, 4(%rdi)
145 movl $1, %eax
147 .p2align 4,,10
148 .p2align 3
149 .L22:
150 movl 72(%rdi), %eax
151 bswap %eax
152 movl %eax, %eax
153 movq %rax, (%rdx)
154 movl $1, %eax
156 .p2align 4,,10
157 .p2align 3
158 .L23:
159 movq (%rdx), %rax
160 subl $1, %eax
161 bswap %eax
162 movl %eax, 72(%rdi)
163 movl $1, %eax
165 .p2align 4,,10
166 .p2align 3
167 .L24:
168 movl 88(%rdi), %eax
169 bswap %eax
170 movl %eax, %eax
171 movq %rax, (%rdx)
172 movl $1, %eax
174 .p2align 4,,10
175 .p2align 3
176 .L25:
177 movq (%rdx), %rax
178 bswap %eax
179 movl %eax, 88(%rdi)
180 movl $1, %eax
182 .p2align 4,,10
183 .p2align 3
184 .L26:
185 movl 84(%rdi), %eax
186 bswap %eax
187 movl %eax, %eax
188 movq %rax, (%rdx)
189 movl $1, %eax
191 .p2align 4,,10
192 .p2align 3
193 .L28:
194 xorl %eax, %eax
196 .size clnttcp_control, .-clnttcp_control
197 .p2align 4,,15
198 .type clnttcp_call, @function
199 clnttcp_call:
200 pushq %r15
201 pushq %r14
202 movq %rdi, %r15
203 pushq %r13
204 pushq %r12
205 pushq %rbp
206 pushq %rbx
207 subq $184, %rsp
208 movq 16(%rdi), %r12
209 movq %rcx, 48(%rsp)
210 movq %rsi, 72(%rsp)
211 movq %rdx, 40(%rsp)
212 movq %r8, 32(%rsp)
213 movl 24(%r12), %ecx
214 leaq 72(%r12), %rax
215 movq %r9, 64(%rsp)
216 leaq 104(%r12), %rbx
217 movq %rax, 16(%rsp)
218 testl %ecx, %ecx
219 jne .L30
220 movdqu 240(%rsp), %xmm0
221 movups %xmm0, 8(%r12)
222 .L30:
223 cmpq $0, 32(%rsp)
224 movl $1, 56(%rsp)
225 je .L74
226 .L31:
227 leaq 72(%rsp), %rax
228 movl $3, 60(%rsp)
229 movq %rax, 24(%rsp)
230 leaq 80(%rsp), %rax
231 movq %rax, 8(%rsp)
232 .L32:
233 movl 72(%r12), %eax
234 movl $0, 104(%r12)
235 movq %rbx, %rdi
236 movl $0, 48(%r12)
237 movl 96(%r12), %edx
238 movq 16(%rsp), %rsi
239 leal -1(%rax), %ebp
240 movq 112(%r12), %rax
241 movl %ebp, 72(%r12)
242 bswap %ebp
243 call *24(%rax)
244 testl %eax, %eax
245 je .L36
246 movq 112(%r12), %rax
247 movq 24(%rsp), %rsi
248 movq %rbx, %rdi
249 call *8(%rax)
250 testl %eax, %eax
251 je .L36
252 movq (%r15), %rdi
253 movq %rbx, %rsi
254 movq 56(%rdi), %rax
255 call *8(%rax)
256 testl %eax, %eax
257 je .L36
258 xorl %eax, %eax
259 movq 48(%rsp), %rsi
260 movq %rbx, %rdi
261 movq 40(%rsp), %rcx
262 call *%rcx
263 testl %eax, %eax
264 je .L36
265 movl 56(%rsp), %esi
266 movq %rbx, %rdi
267 call __GI_xdrrec_endofrecord
268 testl %eax, %eax
269 je .L75
270 movl 56(%rsp), %eax
271 testl %eax, %eax
272 je .L51
273 cmpq $0, 8(%r12)
274 je .L76
275 .L40:
276 leaq __GI__null_auth(%rip), %r14
277 movl $1, 104(%r12)
278 leaq 16(%r14), %r13
279 .L62:
280 movq 0(%r13), %rax
281 movq %rbx, %rdi
282 movq $0, 136(%rsp)
283 movdqu (%r14), %xmm0
284 movq %rax, 120(%rsp)
285 leaq __GI_xdr_void(%rip), %rax
286 movups %xmm0, 104(%rsp)
287 movq %rax, 144(%rsp)
288 call __GI_xdrrec_skiprecord
289 testl %eax, %eax
290 je .L47
291 movq 8(%rsp), %rsi
292 movq %rbx, %rdi
293 call __GI_xdr_replymsg
294 testl %eax, %eax
295 jne .L42
296 movl 48(%r12), %eax
297 testl %eax, %eax
298 je .L62
299 .L29:
300 addq $184, %rsp
301 popq %rbx
302 popq %rbp
303 popq %r12
304 popq %r13
305 popq %r14
306 popq %r15
308 .p2align 4,,10
309 .p2align 3
310 .L42:
311 cmpl 80(%rsp), %ebp
312 jne .L62
313 movq 8(%rsp), %rdi
314 leaq 48(%r12), %rsi
315 call __GI__seterr_reply
316 movl 48(%r12), %eax
317 testl %eax, %eax
318 je .L77
319 subl $1, 60(%rsp)
320 je .L29
321 movq (%r15), %rdi
322 movq 56(%rdi), %rax
323 call *24(%rax)
324 testl %eax, %eax
325 jne .L32
326 .p2align 4,,10
327 .p2align 3
328 .L47:
329 movl 48(%r12), %eax
330 jmp .L29
331 .p2align 4,,10
332 .p2align 3
333 .L76:
334 cmpq $0, 16(%r12)
335 jne .L40
336 movl $5, 48(%r12)
337 movl $5, %eax
338 jmp .L29
339 .p2align 4,,10
340 .p2align 3
341 .L74:
342 cmpq $0, 8(%r12)
343 jne .L31
344 xorl %eax, %eax
345 cmpq $0, 16(%r12)
346 setne %al
347 movl %eax, 56(%rsp)
348 jmp .L31
349 .p2align 4,,10
350 .p2align 3
351 .L36:
352 movl 48(%r12), %edx
353 testl %edx, %edx
354 jne .L35
355 movl $1, 48(%r12)
356 .L35:
357 movl $1, %esi
358 movq %rbx, %rdi
359 call __GI_xdrrec_endofrecord
360 movl 48(%r12), %eax
361 jmp .L29
362 .L75:
363 movl $3, 48(%r12)
364 movl $3, %eax
365 jmp .L29
366 .L51:
367 xorl %eax, %eax
368 jmp .L29
369 .L77:
370 movq 8(%rsp), %rax
371 movq (%r15), %rdi
372 leaq 24(%rax), %rsi
373 movq 56(%rdi), %rax
374 call *16(%rax)
375 testl %eax, %eax
376 je .L78
377 xorl %eax, %eax
378 movq 64(%rsp), %rsi
379 movq %rbx, %rdi
380 movq 32(%rsp), %rcx
381 call *%rcx
382 testl %eax, %eax
383 jne .L46
384 cmpl $0, 48(%r12)
385 jne .L46
386 movl $2, 48(%r12)
387 .L46:
388 cmpq $0, 112(%rsp)
389 je .L47
390 movq 8(%rsp), %rsi
391 movl $2, 104(%r12)
392 movq %rbx, %rdi
393 addq $24, %rsi
394 call __GI_xdr_opaque_auth
395 movl 48(%r12), %eax
396 jmp .L29
397 .L78:
398 movl $7, 48(%r12)
399 movl $6, 56(%r12)
400 jmp .L46
401 .size clnttcp_call, .-clnttcp_call
402 .p2align 4,,15
403 .type writetcp, @function
404 writetcp:
405 pushq %r13
406 pushq %r12
407 movl %edx, %r13d
408 pushq %rbp
409 pushq %rbx
410 subq $8, %rsp
411 testl %edx, %edx
412 jle .L80
413 movq %rdi, %r12
414 movq %rsi, %rbp
415 movl %edx, %ebx
416 jmp .L83
417 .p2align 4,,10
418 .p2align 3
419 .L81:
420 subl %eax, %ebx
421 cltq
422 addq %rax, %rbp
423 testl %ebx, %ebx
424 jle .L80
425 .L83:
426 movl (%r12), %edi
427 movslq %ebx, %rdx
428 movq %rbp, %rsi
429 call __GI___write
430 cmpl $-1, %eax
431 movl %eax, %edx
432 jne .L81
433 movq __libc_errno@gottpoff(%rip), %rax
434 movl $3, 48(%r12)
435 movl %fs:(%rax), %eax
436 movl %eax, 56(%r12)
437 addq $8, %rsp
438 movl %edx, %eax
439 popq %rbx
440 popq %rbp
441 popq %r12
442 popq %r13
444 .p2align 4,,10
445 .p2align 3
446 .L80:
447 addq $8, %rsp
448 movl %r13d, %edx
449 popq %rbx
450 movl %edx, %eax
451 popq %rbp
452 popq %r12
453 popq %r13
455 .size writetcp, .-writetcp
456 .p2align 4,,15
457 .type readtcp, @function
458 readtcp:
459 xorl %eax, %eax
460 testl %edx, %edx
461 je .L100
462 pushq %r14
463 pushq %r13
464 movabsq $2361183241434822607, %rcx
465 pushq %r12
466 pushq %rbp
467 movq %rsi, %r12
468 pushq %rbx
469 movl %edx, %ebp
470 movq %rdi, %rbx
471 subq $16, %rsp
472 movl (%rdi), %eax
473 movq 16(%rdi), %rsi
474 imull $1000, 8(%rdi), %r13d
475 leaq 8(%rsp), %r14
476 movl %eax, 8(%rsp)
477 movl $1, %eax
478 movw %ax, 12(%rsp)
479 movq %rsi, %rax
480 sarq $63, %rsi
481 imulq %rcx
482 sarq $7, %rdx
483 subq %rsi, %rdx
484 addl %edx, %r13d
485 .L91:
486 movl %r13d, %edx
487 movl $1, %esi
488 movq %r14, %rdi
489 call __GI___poll
490 cmpl $-1, %eax
491 je .L89
492 testl %eax, %eax
493 jne .L98
494 movl $5, 48(%rbx)
495 movl $-1, %eax
496 .L86:
497 addq $16, %rsp
498 popq %rbx
499 popq %rbp
500 popq %r12
501 popq %r13
502 popq %r14
504 .p2align 4,,10
505 .p2align 3
506 .L98:
507 movl (%rbx), %edi
508 movslq %ebp, %rdx
509 movq %r12, %rsi
510 call __GI___read
511 cmpl $-1, %eax
512 je .L92
513 testl %eax, %eax
514 jne .L86
515 movl $104, 56(%rbx)
516 movl $4, 48(%rbx)
517 movl $-1, %eax
518 jmp .L86
519 .p2align 4,,10
520 .p2align 3
521 .L100:
522 rep ret
523 .p2align 4,,10
524 .p2align 3
525 .L89:
526 movq __libc_errno@gottpoff(%rip), %rdx
527 movl %fs:(%rdx), %edx
528 cmpl $4, %edx
529 je .L91
530 movl $4, 48(%rbx)
531 movl %edx, 56(%rbx)
532 jmp .L86
533 .p2align 4,,10
534 .p2align 3
535 .L92:
536 movq __libc_errno@gottpoff(%rip), %rdx
537 movl $4, 48(%rbx)
538 movl %fs:(%rdx), %edx
539 movl %edx, 56(%rbx)
540 jmp .L86
541 .size readtcp, .-readtcp
542 .section .rodata.str1.1,"aMS",@progbits,1
543 .LC0:
544 .string "out of memory\n"
545 .LC1:
546 .string "%s: %s"
547 .text
548 .p2align 4,,15
549 .globl __GI_clnttcp_create
550 .hidden __GI_clnttcp_create
551 .type __GI_clnttcp_create, @function
552 __GI_clnttcp_create:
553 pushq %r15
554 pushq %r14
555 movq %rdi, %r15
556 pushq %r13
557 pushq %r12
558 movl $24, %edi
559 pushq %rbp
560 pushq %rbx
561 movq %rsi, %r13
562 movq %rdx, %r12
563 movq %rcx, %rbp
564 subq $120, %rsp
565 movl %r8d, 8(%rsp)
566 movl %r9d, 12(%rsp)
567 call malloc@PLT
568 movl $152, %edi
569 movq %rax, %rbx
570 call malloc@PLT
571 testq %rbx, %rbx
572 movq %rax, %r14
573 je .L119
574 testq %rax, %rax
575 je .L119
576 cmpw $0, 2(%r15)
577 je .L126
578 movl 0(%rbp), %eax
579 testl %eax, %eax
580 js .L127
581 .L110:
582 movl $0, 4(%r14)
583 .L116:
584 movdqu (%r15), %xmm0
585 movl %eax, (%r14)
586 movq $0, 16(%r14)
587 movups %xmm0, 28(%r14)
588 movl $0, 24(%r14)
589 call _create_xid@PLT
590 leaq 72(%r14), %rsi
591 xorl %ecx, %ecx
592 movl $24, %edx
593 movq %r12, 48(%rsp)
594 leaq 104(%r14), %r12
595 movq %rax, 16(%rsp)
596 movl $0, 24(%rsp)
597 movq $2, 32(%rsp)
598 movq %r12, %rdi
599 movq %r13, 40(%rsp)
600 call __GI_xdrmem_create
601 leaq 16(%rsp), %rsi
602 movq %r12, %rdi
603 call __GI_xdr_callhdr
604 testl %eax, %eax
605 je .L128
606 movq 112(%r14), %rax
607 movq %r12, %rdi
608 call *32(%rax)
609 movl %eax, 96(%r14)
610 movq 112(%r14), %rax
611 movq 56(%rax), %rax
612 testq %rax, %rax
613 je .L118
614 movq %r12, %rdi
615 call *%rax
616 .L118:
617 movl 12(%rsp), %edx
618 movl 8(%rsp), %esi
619 leaq writetcp(%rip), %r9
620 leaq readtcp(%rip), %r8
621 movq %r14, %rcx
622 movq %r12, %rdi
623 call __GI_xdrrec_create
624 leaq tcp_ops(%rip), %rax
625 movq %r14, 16(%rbx)
626 movq %rax, 8(%rbx)
627 call __GI_authnone_create
628 movq %rax, (%rbx)
629 .L103:
630 addq $120, %rsp
631 movq %rbx, %rax
632 popq %rbx
633 popq %rbp
634 popq %r12
635 popq %r13
636 popq %r14
637 popq %r15
639 .p2align 4,,10
640 .p2align 3
641 .L126:
642 movl $6, %ecx
643 movq %r12, %rdx
644 movq %r13, %rsi
645 movq %r15, %rdi
646 call __GI_pmap_getport
647 testw %ax, %ax
648 je .L106
649 rolw $8, %ax
650 movw %ax, 2(%r15)
651 movl 0(%rbp), %eax
652 testl %eax, %eax
653 jns .L110
654 .L127:
655 movl $6, %edx
656 movl $1, %esi
657 movl $2, %edi
658 call __GI___socket
659 xorl %esi, %esi
660 movl %eax, %edi
661 movl %eax, 0(%rbp)
662 call __GI_bindresvport
663 movl 0(%rbp), %edi
664 testl %edi, %edi
665 js .L114
666 movl $16, %edx
667 movq %r15, %rsi
668 call __GI___connect
669 testl %eax, %eax
670 js .L114
671 movl $1, 4(%r14)
672 movl 0(%rbp), %eax
673 jmp .L116
674 .p2align 4,,10
675 .p2align 3
676 .L114:
677 call __GI___rpc_thread_createerr
678 movq __libc_errno@gottpoff(%rip), %rdx
679 movl $12, (%rax)
680 movl %fs:(%rdx), %edx
681 movl %edx, 16(%rax)
682 movl 0(%rbp), %edi
683 testl %edi, %edi
684 js .L106
685 .L125:
686 call __GI___close
687 .p2align 4,,10
688 .p2align 3
689 .L106:
690 movq %r14, %rdi
691 call free@PLT
692 movq %rbx, %rdi
693 xorl %ebx, %ebx
694 call free@PLT
695 jmp .L103
696 .p2align 4,,10
697 .p2align 3
698 .L119:
699 call __GI___rpc_thread_createerr
700 leaq .LC0(%rip), %rsi
701 leaq __GI__libc_intl_domainname(%rip), %rdi
702 movl $5, %edx
703 movq %rax, %rbp
704 call __GI___dcgettext
705 leaq __func__.14334(%rip), %rdx
706 leaq .LC1(%rip), %rsi
707 movq %rax, %rcx
708 xorl %edi, %edi
709 xorl %eax, %eax
710 call __fxprintf
711 movl $12, 0(%rbp)
712 movl $12, 16(%rbp)
713 jmp .L106
714 .p2align 4,,10
715 .p2align 3
716 .L128:
717 movl 4(%r14), %eax
718 testl %eax, %eax
719 je .L106
720 movl 0(%rbp), %edi
721 jmp .L125
722 .size __GI_clnttcp_create, .-__GI_clnttcp_create
723 .globl clnttcp_create
724 .set clnttcp_create,__GI_clnttcp_create
725 .section .rodata.str1.8,"aMS",@progbits,1
726 .align 8
727 .type __func__.14334, @object
728 .size __func__.14334, 15
729 __func__.14334:
730 .string "clnttcp_create"
731 .section .data.rel.ro.local,"aw",@progbits
732 .align 32
733 .type tcp_ops, @object
734 .size tcp_ops, 48
735 tcp_ops:
736 .quad clnttcp_call
737 .quad clnttcp_abort
738 .quad clnttcp_geterr
739 .quad clnttcp_freeres
740 .quad clnttcp_destroy
741 .quad clnttcp_control
742 .hidden __fxprintf