clarify the purpose of this project
[nyanglibc.git] / shadow / sgetspent.s
blobb07211c66092d832880473ab049a52e73a999975
1 .text
2 .p2align 4,,15
3 .globl sgetspent
4 .type sgetspent, @function
5 sgetspent:
6 pushq %r14
7 pushq %r13
8 pushq %r12
9 pushq %rbp
10 movq %rdi, %r12
11 pushq %rbx
12 subq $16, %rsp
13 #APP
14 # 41 "sgetspent.c" 1
15 movl %fs:24,%eax
16 # 0 "" 2
17 #NO_APP
18 testl %eax, %eax
19 jne .L2
20 movl $1, %edx
21 #APP
22 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
23 cmpxchgl %edx, lock(%rip)
24 # 0 "" 2
25 #NO_APP
26 .L3:
27 movq buffer.7715(%rip), %rdx
28 movq buffer_size.7716(%rip), %rbx
29 testq %rdx, %rdx
30 je .L20
31 .L5:
32 leaq 8(%rsp), %r14
33 leaq resbuf.7717(%rip), %r13
34 jmp .L13
35 .p2align 4,,10
36 .p2align 3
37 .L7:
38 movq %rax, buffer.7715(%rip)
39 .L13:
40 movq %r14, %r8
41 movq %rbx, %rcx
42 movq %r13, %rsi
43 movq %r12, %rdi
44 call __sgetspent_r
45 cmpl $34, %eax
46 jne .L21
47 movq buffer_size.7716(%rip), %rax
48 movq buffer.7715(%rip), %rbp
49 leaq 1024(%rax), %rbx
50 movq %rbp, %rdi
51 movq %rbx, %rsi
52 movq %rbx, buffer_size.7716(%rip)
53 call realloc@PLT
54 testq %rax, %rax
55 movq %rax, %rdx
56 jne .L7
57 movq __libc_errno@gottpoff(%rip), %rbx
58 movq %rbp, %rdi
59 movl %fs:(%rbx), %r12d
60 call free@PLT
61 movq $0, buffer.7715(%rip)
62 movl %r12d, %fs:(%rbx)
63 .L14:
64 movq $0, 8(%rsp)
65 .L10:
66 #APP
67 # 73 "sgetspent.c" 1
68 movl %fs:24,%eax
69 # 0 "" 2
70 #NO_APP
71 testl %eax, %eax
72 jne .L11
73 subl $1, lock(%rip)
74 .L12:
75 movl %r12d, %fs:(%rbx)
76 movq 8(%rsp), %rax
77 addq $16, %rsp
78 popq %rbx
79 popq %rbp
80 popq %r12
81 popq %r13
82 popq %r14
83 ret
84 .p2align 4,,10
85 .p2align 3
86 .L21:
87 cmpq $0, buffer.7715(%rip)
88 movq __libc_errno@gottpoff(%rip), %rbx
89 movl %fs:(%rbx), %r12d
90 jne .L10
91 jmp .L14
92 .p2align 4,,10
93 .p2align 3
94 .L20:
95 movl $1024, %edi
96 movq $1024, buffer_size.7716(%rip)
97 movl $1024, %ebx
98 call malloc@PLT
99 testq %rax, %rax
100 movq %rax, %rdx
101 movq %rax, buffer.7715(%rip)
102 jne .L5
103 movq __libc_errno@gottpoff(%rip), %rbx
104 movl %fs:(%rbx), %r12d
105 jmp .L14
106 .p2align 4,,10
107 .p2align 3
108 .L11:
109 xorl %eax, %eax
110 #APP
111 # 73 "sgetspent.c" 1
112 xchgl %eax, lock(%rip)
113 # 0 "" 2
114 #NO_APP
115 cmpl $1, %eax
116 jle .L12
117 xorl %r10d, %r10d
118 movl $1, %edx
119 movl $129, %esi
120 leaq lock(%rip), %rdi
121 movl $202, %eax
122 #APP
123 # 73 "sgetspent.c" 1
124 syscall
126 # 0 "" 2
127 #NO_APP
128 jmp .L12
129 .p2align 4,,10
130 .p2align 3
131 .L2:
132 xorl %eax, %eax
133 movl $1, %edx
134 lock cmpxchgl %edx, lock(%rip)
135 je .L3
136 leaq lock(%rip), %rdi
137 call __lll_lock_wait_private
138 jmp .L3
139 .size sgetspent, .-sgetspent
140 .local resbuf.7717
141 .comm resbuf.7717,72,32
142 .local buffer_size.7716
143 .comm buffer_size.7716,8,8
144 .local buffer.7715
145 .comm buffer.7715,8,8
146 .local lock
147 .comm lock,4,4
148 .hidden __lll_lock_wait_private
149 .hidden __sgetspent_r