clarify the purpose of this project
[nyanglibc.git] / libio / iofgetws_u.s
blob9ff8ac009c5d33f100e7ca3781f9b13d5b36eb27
1 .text
2 .p2align 4,,15
3 .globl fgetws_unlocked
4 .type fgetws_unlocked, @function
5 fgetws_unlocked:
6 testl %esi, %esi
7 jle .L7
8 cmpl $1, %esi
9 je .L16
10 pushq %r12
11 pushq %rbp
12 subl $1, %esi
13 pushq %rbx
14 movq %rdx, %rbx
15 movl (%rdx), %edx
16 movq %rdi, %r12
17 movl $1, %r8d
18 movl $10, %ecx
19 movl %edx, %ebp
20 andl $-33, %edx
21 movl %edx, (%rbx)
22 movslq %esi, %rdx
23 movq %rdi, %rsi
24 movq %rbx, %rdi
25 andl $32, %ebp
26 call _IO_getwline@PLT
27 xorl %edi, %edi
28 testq %rax, %rax
29 movl (%rbx), %edx
30 je .L5
31 testb $32, %dl
32 je .L6
33 movq __libc_errno@gottpoff(%rip), %rcx
34 xorl %edi, %edi
35 cmpl $11, %fs:(%rcx)
36 je .L6
37 .L5:
38 orl %edx, %ebp
39 movq %rdi, %rax
40 movl %ebp, (%rbx)
41 popq %rbx
42 popq %rbp
43 popq %r12
44 ret
45 .p2align 4,,10
46 .p2align 3
47 .L6:
48 movl $0, (%r12,%rax,4)
49 movl (%rbx), %edx
50 movq %r12, %rdi
51 movq %rdi, %rax
52 orl %edx, %ebp
53 movl %ebp, (%rbx)
54 popq %rbx
55 popq %rbp
56 popq %r12
57 ret
58 .p2align 4,,10
59 .p2align 3
60 .L16:
61 movl $0, (%rdi)
62 .L13:
63 movq %rdi, %rax
64 ret
65 .p2align 4,,10
66 .p2align 3
67 .L7:
68 xorl %edi, %edi
69 jmp .L13
70 .size fgetws_unlocked, .-fgetws_unlocked