clarify the purpose of this project
[nyanglibc.git] / libio / iofgets_u.shared.s
blob50333222d639f3615b56dc77d0564d6ade039033
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___fgets_unlocked
9 .hidden __GI___fgets_unlocked
10 .type __GI___fgets_unlocked, @function
11 __GI___fgets_unlocked:
12 testl %esi, %esi
13 jle .L7
14 cmpl $1, %esi
15 je .L16
16 pushq %r12
17 pushq %rbp
18 subl $1, %esi
19 pushq %rbx
20 movq %rdx, %rbx
21 movl (%rdx), %edx
22 movq %rdi, %r12
23 movl $1, %r8d
24 movl $10, %ecx
25 movl %edx, %ebp
26 andl $-33, %edx
27 movl %edx, (%rbx)
28 movslq %esi, %rdx
29 movq %rdi, %rsi
30 movq %rbx, %rdi
31 andl $32, %ebp
32 call __GI__IO_getline
33 xorl %edi, %edi
34 testq %rax, %rax
35 movl (%rbx), %edx
36 je .L5
37 testb $32, %dl
38 je .L6
39 movq __libc_errno@gottpoff(%rip), %rcx
40 xorl %edi, %edi
41 cmpl $11, %fs:(%rcx)
42 je .L6
43 .L5:
44 orl %edx, %ebp
45 movq %rdi, %rax
46 movl %ebp, (%rbx)
47 popq %rbx
48 popq %rbp
49 popq %r12
50 ret
51 .p2align 4,,10
52 .p2align 3
53 .L6:
54 movb $0, (%r12,%rax)
55 movl (%rbx), %edx
56 movq %r12, %rdi
57 movq %rdi, %rax
58 orl %edx, %ebp
59 movl %ebp, (%rbx)
60 popq %rbx
61 popq %rbp
62 popq %r12
63 ret
64 .p2align 4,,10
65 .p2align 3
66 .L16:
67 movb $0, (%rdi)
68 .L13:
69 movq %rdi, %rax
70 ret
71 .p2align 4,,10
72 .p2align 3
73 .L7:
74 xorl %edi, %edi
75 jmp .L13
76 .size __GI___fgets_unlocked, .-__GI___fgets_unlocked
77 .globl __fgets_unlocked
78 .set __fgets_unlocked,__GI___fgets_unlocked
79 .weak __GI_fgets_unlocked
80 .hidden __GI_fgets_unlocked
81 .set __GI_fgets_unlocked,__fgets_unlocked
82 .weak fgets_unlocked
83 .set fgets_unlocked,__GI_fgets_unlocked