clarify the purpose of this project
[nyanglibc.git] / login / ptsname.shared.s
blobef14007e98f63e98924b6fe70459722dc5b5250a
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 __ptsname_r
9 .hidden __ptsname_r
10 .type __ptsname_r, @function
11 __ptsname_r:
12 pushq %r15
13 pushq %r14
14 movq %rdx, %r14
15 pushq %r13
16 pushq %r12
17 xorl %eax, %eax
18 pushq %rbp
19 pushq %rbx
20 movq %rsi, %r13
21 movl $2147767344, %esi
22 subq $56, %rsp
23 movq __libc_errno@gottpoff(%rip), %rbp
24 leaq 12(%rsp), %rdx
25 movl %fs:0(%rbp), %r15d
26 call __GI___ioctl
27 testl %eax, %eax
28 je .L7
29 movl %fs:0(%rbp), %ebx
30 .L1:
31 addq $56, %rsp
32 movl %ebx, %eax
33 popq %rbx
34 popq %rbp
35 popq %r12
36 popq %r13
37 popq %r14
38 popq %r15
39 ret
40 .p2align 4,,10
41 .p2align 3
42 .L7:
43 movl 12(%rsp), %edi
44 leaq 16(%rsp), %r12
45 leaq 36(%rsp), %rsi
46 xorl %ecx, %ecx
47 movl $10, %edx
48 movl %eax, %ebx
49 movb $0, 36(%rsp)
50 call _itoa_word
51 leaq 21(%r12), %rdx
52 subq %rax, %rdx
53 leaq 9(%rdx), %rcx
54 cmpq %r14, %rcx
55 ja .L8
56 movabsq $8319397760812278831, %rcx
57 leaq 9(%r13), %rdi
58 movq %rax, %rsi
59 movq %rcx, 0(%r13)
60 movl $47, %ecx
61 movw %cx, 8(%r13)
62 call __GI_memcpy@PLT
63 movl %r15d, %fs:0(%rbp)
64 jmp .L1
65 .p2align 4,,10
66 .p2align 3
67 .L8:
68 movl $34, %fs:0(%rbp)
69 movl $34, %ebx
70 jmp .L1
71 .size __ptsname_r, .-__ptsname_r
72 .weak ptsname_r
73 .set ptsname_r,__ptsname_r
74 .p2align 4,,15
75 .globl ptsname
76 .type ptsname, @function
77 ptsname:
78 leaq buffer(%rip), %rsi
79 subq $8, %rsp
80 movl $30, %edx
81 call __ptsname_r
82 testl %eax, %eax
83 leaq buffer(%rip), %rax
84 movl $0, %edx
85 cmovne %rdx, %rax
86 addq $8, %rsp
87 ret
88 .size ptsname, .-ptsname
89 .local buffer
90 .comm buffer,30,16
91 .hidden _itoa_word