clarify the purpose of this project
[nyanglibc.git] / stdlib / getentropy.shared.s
blobf39a8f080f55cf85991e2a1bfede07dfcee072d1
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 getentropy
9 .type getentropy, @function
10 getentropy:
11 cmpq $256, %rsi
12 movq %rdi, %r8
13 ja .L9
14 leaq (%rdi,%rsi), %r9
15 cmpq %r9, %rdi
16 jnb .L4
17 movl $318, %r10d
18 jmp .L10
19 .p2align 4,,10
20 .p2align 3
21 .L7:
22 je .L9
23 addq %rax, %r8
24 .L8:
25 cmpq %r8, %r9
26 jbe .L4
27 .L10:
28 movq %r9, %rsi
29 xorl %edx, %edx
30 movq %r8, %rdi
31 subq %r8, %rsi
32 movl %r10d, %eax
33 #APP
34 # 45 "../sysdeps/unix/sysv/linux/getentropy.c" 1
35 syscall
37 # 0 "" 2
38 #NO_APP
39 cmpq $-4096, %rax
40 ja .L19
41 testq %rax, %rax
42 jns .L7
43 movq __libc_errno@gottpoff(%rip), %rax
44 movl %fs:(%rax), %eax
45 .L6:
46 cmpl $4, %eax
47 je .L8
48 movl $-1, %eax
49 ret
50 .p2align 4,,10
51 .p2align 3
52 .L19:
53 movq __libc_errno@gottpoff(%rip), %rdx
54 negl %eax
55 movl %eax, %fs:(%rdx)
56 jmp .L6
57 .p2align 4,,10
58 .p2align 3
59 .L4:
60 xorl %eax, %eax
61 ret
62 .p2align 4,,10
63 .p2align 3
64 .L9:
65 movq __libc_errno@gottpoff(%rip), %rax
66 movl $5, %fs:(%rax)
67 movl $-1, %eax
68 ret
69 .size getentropy, .-getentropy