clarify the purpose of this project
[nyanglibc.git] / login / utmpname.s
blob1827fd5e7a482f94c871d80808c1832715befada
1 .text
2 .p2align 4,,15
3 .globl __utmpname
4 .hidden __utmpname
5 .type __utmpname, @function
6 __utmpname:
7 pushq %r12
8 pushq %rbp
9 movq %rdi, %rbp
10 pushq %rbx
11 #APP
12 # 42 "utmpname.c" 1
13 movl %fs:24,%eax
14 # 0 "" 2
15 #NO_APP
16 testl %eax, %eax
17 jne .L2
18 movl $1, %edx
19 #APP
20 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
21 cmpxchgl %edx, __libc_utmp_lock(%rip)
22 # 0 "" 2
23 #NO_APP
24 .L3:
25 call __libc_endutent
26 movq __libc_utmp_file_name(%rip), %r12
27 movq %rbp, %rdi
28 movq %r12, %rsi
29 call strcmp
30 testl %eax, %eax
31 movl %eax, %ebx
32 je .L4
33 leaq default_file_name(%rip), %rsi
34 movq %rbp, %rdi
35 call strcmp
36 testl %eax, %eax
37 movl %eax, %ebx
38 je .L15
39 movq %rbp, %rdi
40 call __strdup
41 testq %rax, %rax
42 movq %rax, %rbx
43 je .L9
44 movq __libc_utmp_file_name(%rip), %rdi
45 leaq default_file_name(%rip), %rax
46 cmpq %rax, %rdi
47 je .L6
48 call free@PLT
49 .L6:
50 movq %rbx, __libc_utmp_file_name(%rip)
51 xorl %ebx, %ebx
52 .L4:
53 #APP
54 # 72 "utmpname.c" 1
55 movl %fs:24,%eax
56 # 0 "" 2
57 #NO_APP
58 testl %eax, %eax
59 jne .L7
60 subl $1, __libc_utmp_lock(%rip)
61 .L1:
62 movl %ebx, %eax
63 popq %rbx
64 popq %rbp
65 popq %r12
66 ret
67 .p2align 4,,10
68 .p2align 3
69 .L15:
70 movq %r12, %rdi
71 call free@PLT
72 leaq default_file_name(%rip), %rax
73 movq %rax, __libc_utmp_file_name(%rip)
74 jmp .L4
75 .p2align 4,,10
76 .p2align 3
77 .L7:
78 xorl %eax, %eax
79 #APP
80 # 72 "utmpname.c" 1
81 xchgl %eax, __libc_utmp_lock(%rip)
82 # 0 "" 2
83 #NO_APP
84 cmpl $1, %eax
85 jle .L1
86 xorl %r10d, %r10d
87 movl $1, %edx
88 movl $129, %esi
89 leaq __libc_utmp_lock(%rip), %rdi
90 movl $202, %eax
91 #APP
92 # 72 "utmpname.c" 1
93 syscall
95 # 0 "" 2
96 #NO_APP
97 jmp .L1
98 .p2align 4,,10
99 .p2align 3
100 .L2:
101 xorl %eax, %eax
102 movl $1, %edx
103 lock cmpxchgl %edx, __libc_utmp_lock(%rip)
104 je .L3
105 leaq __libc_utmp_lock(%rip), %rdi
106 call __lll_lock_wait_private
107 jmp .L3
108 .L9:
109 movl $-1, %ebx
110 jmp .L4
111 .size __utmpname, .-__utmpname
112 .weak utmpname
113 .set utmpname,__utmpname
114 .hidden __libc_utmp_file_name
115 .globl __libc_utmp_file_name
116 .section .data.rel.local,"aw",@progbits
117 .align 8
118 .type __libc_utmp_file_name, @object
119 .size __libc_utmp_file_name, 8
120 __libc_utmp_file_name:
121 .quad default_file_name
122 .section .rodata.str1.8,"aMS",@progbits,1
123 .align 8
124 .type default_file_name, @object
125 .size default_file_name, 14
126 default_file_name:
127 .string "/var/run/utmp"
128 .hidden __lll_lock_wait_private
129 .hidden __strdup
130 .hidden strcmp
131 .hidden __libc_endutent
132 .hidden __libc_utmp_lock