clarify the purpose of this project
[nyanglibc.git] / login / getutid_r.s
blob7a8a399e4b995a8874253a33118ef567794a3690
1 .text
2 .p2align 4,,15
3 .globl __getutid_r
4 .hidden __getutid_r
5 .type __getutid_r, @function
6 __getutid_r:
7 movzwl (%rdi), %eax
8 subl $1, %eax
9 cmpw $7, %ax
10 ja .L11
11 pushq %rbx
12 movq %rdi, %rbx
13 subq $16, %rsp
14 #APP
15 # 49 "getutid_r.c" 1
16 movl %fs:24,%eax
17 # 0 "" 2
18 #NO_APP
19 testl %eax, %eax
20 jne .L4
21 movl $1, %ecx
22 #APP
23 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
24 cmpxchgl %ecx, __libc_utmp_lock(%rip)
25 # 0 "" 2
26 #NO_APP
27 .L5:
28 movq %rbx, %rdi
29 call __libc_getutid_r
30 movl %eax, %r8d
31 #APP
32 # 53 "getutid_r.c" 1
33 movl %fs:24,%eax
34 # 0 "" 2
35 #NO_APP
36 testl %eax, %eax
37 jne .L6
38 subl $1, __libc_utmp_lock(%rip)
39 .L1:
40 addq $16, %rsp
41 movl %r8d, %eax
42 popq %rbx
43 ret
44 .p2align 4,,10
45 .p2align 3
46 .L4:
47 xorl %eax, %eax
48 movl $1, %ecx
49 lock cmpxchgl %ecx, __libc_utmp_lock(%rip)
50 je .L5
51 leaq __libc_utmp_lock(%rip), %rdi
52 movq %rdx, 8(%rsp)
53 movq %rsi, (%rsp)
54 call __lll_lock_wait_private
55 movq 8(%rsp), %rdx
56 movq (%rsp), %rsi
57 jmp .L5
58 .p2align 4,,10
59 .p2align 3
60 .L6:
61 xorl %eax, %eax
62 #APP
63 # 53 "getutid_r.c" 1
64 xchgl %eax, __libc_utmp_lock(%rip)
65 # 0 "" 2
66 #NO_APP
67 cmpl $1, %eax
68 jle .L1
69 xorl %r10d, %r10d
70 movl $1, %edx
71 movl $129, %esi
72 leaq __libc_utmp_lock(%rip), %rdi
73 movl $202, %eax
74 #APP
75 # 53 "getutid_r.c" 1
76 syscall
78 # 0 "" 2
79 #NO_APP
80 jmp .L1
81 .L11:
82 movq __libc_errno@gottpoff(%rip), %rax
83 movl $-1, %r8d
84 movl $22, %fs:(%rax)
85 movq $0, (%rdx)
86 movl %r8d, %eax
87 ret
88 .size __getutid_r, .-__getutid_r
89 .weak getutid_r
90 .set getutid_r,__getutid_r
91 .hidden __lll_lock_wait_private
92 .hidden __libc_getutid_r
93 .hidden __libc_utmp_lock