clarify the purpose of this project
[nyanglibc.git] / login / utmp_file.shared.s
blob650410c90e635b9144f3fd4a2b74003bc6ae847d
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type timeout_handler, @function
9 timeout_handler:
10 rep ret
11 .size timeout_handler, .-timeout_handler
12 .p2align 4,,15
13 .type try_file_lock, @function
14 try_file_lock:
15 pushq %r14
16 pushq %r13
17 pushq %r12
18 pushq %rbp
19 movl %esi, %ebp
20 pushq %rbx
21 movl %edi, %ebx
22 xorl %edi, %edi
23 subq $352, %rsp
24 leaq 32(%rsp), %r12
25 call __GI_alarm
26 leaq 192(%rsp), %rsi
27 movl %eax, %r13d
28 leaq timeout_handler(%rip), %rax
29 movq %r12, %rdx
30 movl $14, %edi
31 movq $0, 200(%rsp)
32 movq %rax, 192(%rsp)
33 movl $0, 328(%rsp)
34 call __GI___sigaction
35 movl $10, %edi
36 call __GI_alarm
37 pxor %xmm0, %xmm0
38 xorl %eax, %eax
39 movq %rsp, %rdx
40 movl $7, %esi
41 movl %ebx, %edi
42 movw %ax, 30(%rsp)
43 xorl %eax, %eax
44 movw %bp, (%rsp)
45 movups %xmm0, 2(%rsp)
46 movq $0, 18(%rsp)
47 movl $0, 26(%rsp)
48 call __GI___fcntl64_nocancel
49 xorl %edi, %edi
50 shrl $31, %eax
51 movq __libc_errno@gottpoff(%rip), %rbp
52 movl %eax, %ebx
53 movl %fs:0(%rbp), %r14d
54 call __GI_alarm
55 xorl %edx, %edx
56 movq %r12, %rsi
57 movl $14, %edi
58 call __GI___sigaction
59 testl %r13d, %r13d
60 je .L4
61 movl %r13d, %edi
62 call __GI_alarm
63 .L4:
64 movl %r14d, %fs:0(%rbp)
65 addq $352, %rsp
66 movl %ebx, %eax
67 popq %rbx
68 popq %rbp
69 popq %r12
70 popq %r13
71 popq %r14
72 ret
73 .size try_file_lock, .-try_file_lock
74 .p2align 4,,15
75 .type read_last_entry, @function
76 read_last_entry:
77 pushq %rbx
78 movl $384, %edx
79 subq $384, %rsp
80 movq file_offset(%rip), %rcx
81 movl file_fd(%rip), %edi
82 movq %rsp, %rbx
83 movq %rbx, %rsi
84 call __GI___pread64_nocancel
85 testq %rax, %rax
86 js .L11
87 movq %rax, %rdx
88 xorl %eax, %eax
89 cmpq $384, %rdx
90 jne .L9
91 leaq last_entry(%rip), %rdi
92 movl $48, %ecx
93 movq %rbx, %rsi
94 rep movsq
95 addq $384, file_offset(%rip)
96 movl $1, %eax
97 .L9:
98 addq $384, %rsp
99 popq %rbx
101 .p2align 4,,10
102 .p2align 3
103 .L11:
104 movq $-1, %rax
105 jmp .L9
106 .size read_last_entry, .-read_last_entry
107 .p2align 4,,15
108 .type matches_last_entry, @function
109 matches_last_entry:
110 xorl %eax, %eax
111 cmpq $0, file_offset(%rip)
112 jle .L23
113 movzwl (%rdi), %edx
114 movzwl last_entry(%rip), %ecx
115 leal -1(%rdx), %esi
116 cmpw $3, %si
117 ja .L16
118 cmpw %cx, %dx
119 sete %al
121 .p2align 4,,10
122 .p2align 3
123 .L16:
124 subl $5, %ecx
125 cmpw $3, %cx
126 ja .L23
127 subl $5, %edx
128 cmpw $3, %dx
129 ja .L23
130 subq $8, %rsp
131 cmpb $0, 40+last_entry(%rip)
132 je .L18
133 cmpb $0, 40(%rdi)
134 je .L18
135 leaq 40(%rdi), %rsi
136 leaq 40+last_entry(%rip), %rdi
137 movl $4, %edx
138 call __GI_strncmp
139 testl %eax, %eax
140 sete %al
141 jmp .L14
142 .p2align 4,,10
143 .p2align 3
144 .L23:
145 rep ret
146 .p2align 4,,10
147 .p2align 3
148 .L18:
149 leaq 8(%rdi), %rsi
150 leaq 8+last_entry(%rip), %rdi
151 movl $32, %edx
152 call __GI_strncmp
153 testl %eax, %eax
154 sete %al
155 .L14:
156 addq $8, %rsp
158 .size matches_last_entry, .-matches_last_entry
159 .p2align 4,,15
160 .type internal_getut_nolock, @function
161 internal_getut_nolock:
162 pushq %rbx
163 movq %rdi, %rbx
164 jmp .L29
165 .p2align 4,,10
166 .p2align 3
167 .L36:
168 je .L34
169 movq %rbx, %rdi
170 call matches_last_entry
171 testb %al, %al
172 jne .L35
173 .L29:
174 call read_last_entry
175 testq %rax, %rax
176 jns .L36
177 movl $-1, %eax
178 popq %rbx
180 .p2align 4,,10
181 .p2align 3
182 .L34:
183 movq __libc_errno@gottpoff(%rip), %rax
184 movl $3, %fs:(%rax)
185 movl $-1, %eax
186 popq %rbx
188 .p2align 4,,10
189 .p2align 3
190 .L35:
191 xorl %eax, %eax
192 popq %rbx
194 .size internal_getut_nolock, .-internal_getut_nolock
195 .section .rodata.str1.1,"aMS",@progbits,1
196 .LC0:
197 .string "/var/log/wtmpx"
198 .LC1:
199 .string "/var/run/utmpx"
200 .LC2:
201 .string "/var/run/utmp"
202 .LC3:
203 .string "/var/log/wtmp"
204 .text
205 .p2align 4,,15
206 .globl __libc_setutent
207 .hidden __libc_setutent
208 .type __libc_setutent, @function
209 __libc_setutent:
210 subq $8, %rsp
211 movl file_fd(%rip), %edi
212 testl %edi, %edi
213 jns .L38
214 movq __libc_utmp_file_name(%rip), %rdx
215 leaq .LC2(%rip), %rdi
216 movl $14, %ecx
217 movq %rdx, %rsi
218 repz cmpsb
219 je .L54
220 .L39:
221 leaq .LC3(%rip), %rdi
222 movl $14, %ecx
223 movq %rdx, %rsi
224 repz cmpsb
225 je .L55
226 .L41:
227 leaq .LC1(%rip), %rax
228 movl $15, %ecx
229 movq %rdx, %rsi
230 movq %rax, %rdi
231 repz cmpsb
232 je .L56
233 .L42:
234 leaq .LC0(%rip), %rax
235 movl $15, %ecx
236 movq %rdx, %rsi
237 movq %rax, %rdi
238 repz cmpsb
239 je .L57
240 .L40:
241 movq %rdx, %rdi
242 xorl %eax, %eax
243 movl $524288, %esi
244 movb $0, file_writable(%rip)
245 call __GI___open_nocancel
246 movl %eax, %edi
247 movl %eax, file_fd(%rip)
248 xorl %eax, %eax
249 cmpl $-1, %edi
250 je .L37
251 .L38:
252 xorl %edx, %edx
253 xorl %esi, %esi
254 call __lseek64
255 movq $0, file_offset(%rip)
256 movl $1, %eax
257 .L37:
258 addq $8, %rsp
260 .p2align 4,,10
261 .p2align 3
262 .L54:
263 leaq .LC1(%rip), %rdi
264 xorl %esi, %esi
265 call __GI___access
266 testl %eax, %eax
267 leaq .LC1(%rip), %rdx
268 je .L40
269 movq __libc_utmp_file_name(%rip), %rdx
270 jmp .L39
271 .p2align 4,,10
272 .p2align 3
273 .L55:
274 leaq .LC0(%rip), %rdi
275 xorl %esi, %esi
276 call __GI___access
277 testl %eax, %eax
278 leaq .LC0(%rip), %rdx
279 je .L40
280 movq __libc_utmp_file_name(%rip), %rdx
281 jmp .L41
282 .p2align 4,,10
283 .p2align 3
284 .L56:
285 xorl %esi, %esi
286 movq %rax, %rdi
287 call __GI___access
288 testl %eax, %eax
289 leaq .LC2(%rip), %rdx
290 jne .L40
291 movq __libc_utmp_file_name(%rip), %rdx
292 jmp .L42
293 .p2align 4,,10
294 .p2align 3
295 .L57:
296 xorl %esi, %esi
297 movq %rax, %rdi
298 call __GI___access
299 leaq .LC3(%rip), %rdx
300 testl %eax, %eax
301 cmove __libc_utmp_file_name(%rip), %rdx
302 jmp .L40
303 .size __libc_setutent, .-__libc_setutent
304 .p2align 4,,15
305 .globl __libc_getutent_r
306 .hidden __libc_getutent_r
307 .type __libc_getutent_r, @function
308 __libc_getutent_r:
309 pushq %r14
310 pushq %r13
311 pushq %r12
312 pushq %rbp
313 movq %rdi, %rbp
314 pushq %rbx
315 movq %rsi, %rbx
316 subq $32, %rsp
317 movl file_fd(%rip), %edi
318 movq __libc_errno@gottpoff(%rip), %r12
319 testl %edi, %edi
320 movl %fs:(%r12), %r13d
321 js .L70
322 .L59:
323 xorl %esi, %esi
324 call try_file_lock
325 testb %al, %al
326 jne .L71
327 call read_last_entry
328 pxor %xmm0, %xmm0
329 movl file_fd(%rip), %edi
330 movq %rax, %r14
331 movl $2, %edx
332 xorl %eax, %eax
333 movw %ax, 30(%rsp)
334 movw %dx, (%rsp)
335 xorl %eax, %eax
336 movq %rsp, %rdx
337 movl $7, %esi
338 movq $0, 18(%rsp)
339 movups %xmm0, 2(%rsp)
340 movl $0, 26(%rsp)
341 call __GI___fcntl64_nocancel
342 cmpq $0, %r14
343 jle .L72
344 movq last_entry(%rip), %rax
345 leaq 8(%rbp), %rdi
346 movq %rbp, %rcx
347 leaq last_entry(%rip), %rsi
348 andq $-8, %rdi
349 movq %rax, 0(%rbp)
350 movq 376+last_entry(%rip), %rax
351 subq %rdi, %rcx
352 subq %rcx, %rsi
353 addl $384, %ecx
354 shrl $3, %ecx
355 movq %rax, 376(%rbp)
356 xorl %eax, %eax
357 rep movsq
358 movq %rbp, (%rbx)
359 .L58:
360 addq $32, %rsp
361 popq %rbx
362 popq %rbp
363 popq %r12
364 popq %r13
365 popq %r14
367 .p2align 4,,10
368 .p2align 3
369 .L70:
370 call __libc_setutent
371 testl %eax, %eax
372 movl file_fd(%rip), %edi
373 jne .L59
374 .L60:
375 movq $0, (%rbx)
376 addq $32, %rsp
377 movl $-1, %eax
378 popq %rbx
379 popq %rbp
380 popq %r12
381 popq %r13
382 popq %r14
384 .p2align 4,,10
385 .p2align 3
386 .L71:
387 movl $-1, %eax
388 jmp .L58
389 .p2align 4,,10
390 .p2align 3
391 .L72:
392 jne .L60
393 movl %r13d, %fs:(%r12)
394 jmp .L60
395 .size __libc_getutent_r, .-__libc_getutent_r
396 .p2align 4,,15
397 .globl __libc_getutid_r
398 .hidden __libc_getutid_r
399 .type __libc_getutid_r, @function
400 __libc_getutid_r:
401 pushq %r12
402 pushq %rbp
403 movq %rdi, %r12
404 pushq %rbx
405 movq %rsi, %rbp
406 movq %rdx, %rbx
407 subq $32, %rsp
408 movl file_fd(%rip), %edi
409 testl %edi, %edi
410 js .L85
411 .L74:
412 xorl %esi, %esi
413 call try_file_lock
414 testb %al, %al
415 jne .L75
416 movq %r12, %rdi
417 call internal_getut_nolock
418 pxor %xmm0, %xmm0
419 movl file_fd(%rip), %edi
420 movl %eax, %r12d
421 movl $2, %edx
422 xorl %eax, %eax
423 movw %ax, 30(%rsp)
424 movw %dx, (%rsp)
425 xorl %eax, %eax
426 movq %rsp, %rdx
427 movl $7, %esi
428 movq $0, 18(%rsp)
429 movups %xmm0, 2(%rsp)
430 movl $0, 26(%rsp)
431 call __GI___fcntl64_nocancel
432 testl %r12d, %r12d
433 js .L75
434 movq last_entry(%rip), %rax
435 leaq 8(%rbp), %rdi
436 movq %rbp, %rcx
437 leaq last_entry(%rip), %rsi
438 andq $-8, %rdi
439 movq %rax, 0(%rbp)
440 movq 376+last_entry(%rip), %rax
441 subq %rdi, %rcx
442 subq %rcx, %rsi
443 addl $384, %ecx
444 shrl $3, %ecx
445 movq %rax, 376(%rbp)
446 xorl %eax, %eax
447 rep movsq
448 movq %rbp, (%rbx)
449 addq $32, %rsp
450 popq %rbx
451 popq %rbp
452 popq %r12
454 .p2align 4,,10
455 .p2align 3
456 .L85:
457 call __libc_setutent
458 testl %eax, %eax
459 movl file_fd(%rip), %edi
460 jne .L74
461 .L75:
462 movq $0, (%rbx)
463 addq $32, %rsp
464 movl $-1, %eax
465 popq %rbx
466 popq %rbp
467 popq %r12
469 .size __libc_getutid_r, .-__libc_getutid_r
470 .p2align 4,,15
471 .globl __libc_getutline_r
472 .hidden __libc_getutline_r
473 .type __libc_getutline_r, @function
474 __libc_getutline_r:
475 pushq %r14
476 pushq %r13
477 movq %rdi, %r13
478 pushq %r12
479 pushq %rbp
480 movq %rsi, %r12
481 pushq %rbx
482 movq %rdx, %rbp
483 subq $32, %rsp
484 movl file_fd(%rip), %edi
485 testl %edi, %edi
486 js .L99
487 .L87:
488 xorl %esi, %esi
489 call try_file_lock
490 testb %al, %al
491 jne .L98
492 addq $8, %r13
493 .p2align 4,,10
494 .p2align 3
495 .L95:
496 call read_last_entry
497 testq %rax, %rax
498 js .L100
499 je .L101
500 movzwl last_entry(%rip), %eax
501 leaq last_entry(%rip), %rbx
502 subl $6, %eax
503 cmpw $1, %ax
504 ja .L95
505 leaq 8(%rbx), %rsi
506 movl $32, %edx
507 movq %r13, %rdi
508 call __GI_strncmp
509 testl %eax, %eax
510 movl %eax, %r14d
511 jne .L95
512 pxor %xmm0, %xmm0
513 movl file_fd(%rip), %edi
514 xorl %eax, %eax
515 movl $2, %edx
516 movl $7, %esi
517 movw %ax, 30(%rsp)
518 movw %dx, (%rsp)
519 xorl %eax, %eax
520 movq %rsp, %rdx
521 movq $0, 18(%rsp)
522 movl $0, 26(%rsp)
523 movups %xmm0, 2(%rsp)
524 call __GI___fcntl64_nocancel
525 leaq 8(%r12), %rdi
526 movq %rbx, %rsi
527 movq (%rbx), %rax
528 andq $-8, %rdi
529 movq %rax, (%r12)
530 movq 376+last_entry(%rip), %rax
531 movq %rax, 376(%r12)
532 movq %r12, %rax
533 subq %rdi, %rax
534 leal 384(%rax), %ecx
535 subq %rax, %rsi
536 movl %ecx, %eax
537 shrl $3, %eax
538 movl %eax, %ecx
539 movl %r14d, %eax
540 rep movsq
541 movq %r12, 0(%rbp)
542 addq $32, %rsp
543 popq %rbx
544 popq %rbp
545 popq %r12
546 popq %r13
547 popq %r14
549 .p2align 4,,10
550 .p2align 3
551 .L101:
552 pxor %xmm0, %xmm0
553 movl file_fd(%rip), %edi
554 movl $2, %esi
555 xorl %ecx, %ecx
556 movq %rsp, %rdx
557 movw %si, (%rsp)
558 xorl %eax, %eax
559 movl $7, %esi
560 movups %xmm0, 2(%rsp)
561 movq $0, 18(%rsp)
562 movl $0, 26(%rsp)
563 movw %cx, 30(%rsp)
564 call __GI___fcntl64_nocancel
565 movq __libc_errno@gottpoff(%rip), %rax
566 movl $3, %fs:(%rax)
567 .L98:
568 movq $0, 0(%rbp)
569 movl $-1, %r14d
570 addq $32, %rsp
571 popq %rbx
572 movl %r14d, %eax
573 popq %rbp
574 popq %r12
575 popq %r13
576 popq %r14
578 .p2align 4,,10
579 .p2align 3
580 .L100:
581 xorl %edi, %edi
582 pxor %xmm0, %xmm0
583 movw %di, 30(%rsp)
584 movl file_fd(%rip), %edi
585 movl $2, %r8d
586 movq %rsp, %rdx
587 movl $7, %esi
588 xorl %eax, %eax
589 movups %xmm0, 2(%rsp)
590 movq $0, 18(%rsp)
591 movl $0, 26(%rsp)
592 movl $-1, %r14d
593 movw %r8w, (%rsp)
594 call __GI___fcntl64_nocancel
595 movq $0, 0(%rbp)
596 addq $32, %rsp
597 movl %r14d, %eax
598 popq %rbx
599 popq %rbp
600 popq %r12
601 popq %r13
602 popq %r14
604 .p2align 4,,10
605 .p2align 3
606 .L99:
607 call __libc_setutent
608 testl %eax, %eax
609 movl file_fd(%rip), %edi
610 jne .L87
611 jmp .L98
612 .size __libc_getutline_r, .-__libc_getutline_r
613 .p2align 4,,15
614 .globl __libc_pututline
615 .hidden __libc_pututline
616 .type __libc_pututline, @function
617 __libc_pututline:
618 pushq %r12
619 pushq %rbp
620 pushq %rbx
621 movq %rdi, %rbx
622 subq $32, %rsp
623 movl file_fd(%rip), %r9d
624 testl %r9d, %r9d
625 js .L140
626 .L103:
627 cmpb $0, file_writable(%rip)
628 jne .L122
629 movq __libc_utmp_file_name(%rip), %rdx
630 leaq .LC2(%rip), %rdi
631 movl $14, %ecx
632 movq %rdx, %rsi
633 repz cmpsb
634 je .L141
635 .L105:
636 leaq .LC3(%rip), %rdi
637 movl $14, %ecx
638 movq %rdx, %rsi
639 repz cmpsb
640 je .L142
641 .L107:
642 leaq .LC1(%rip), %rax
643 movl $15, %ecx
644 movq %rdx, %rsi
645 movq %rax, %rdi
646 repz cmpsb
647 je .L143
648 .L108:
649 leaq .LC0(%rip), %rax
650 movl $15, %ecx
651 movq %rdx, %rsi
652 movq %rax, %rdi
653 repz cmpsb
654 je .L144
655 .L106:
656 xorl %eax, %eax
657 movl $524290, %esi
658 movq %rdx, %rdi
659 call __GI___open_nocancel
660 cmpl $-1, %eax
661 movl %eax, %ebp
662 je .L139
663 movl file_fd(%rip), %esi
664 movl %eax, %edi
665 call __GI___dup2
666 testl %eax, %eax
667 movl %ebp, %edi
668 js .L145
669 call __GI___close_nocancel
670 movb $1, file_writable(%rip)
671 .L122:
672 movl file_fd(%rip), %edi
673 movl $1, %esi
674 call try_file_lock
675 testb %al, %al
676 movl %eax, %r12d
677 jne .L139
678 movq %rbx, %rdi
679 call matches_last_entry
680 testb %al, %al
681 je .L116
682 subq $384, file_offset(%rip)
683 call read_last_entry
684 testq %rax, %rax
685 js .L119
686 jne .L146
687 .L116:
688 movq %rbx, %rdi
689 call internal_getut_nolock
690 testl %eax, %eax
691 js .L147
692 .L113:
693 movq file_offset(%rip), %rax
694 movl $1, %r12d
695 leaq -384(%rax), %rbp
696 .L117:
697 movl file_fd(%rip), %edi
698 xorl %edx, %edx
699 movq %rbp, %rsi
700 call __lseek64
701 testq %rax, %rax
702 js .L119
703 movl file_fd(%rip), %edi
704 movl $384, %edx
705 movq %rbx, %rsi
706 call __GI___write_nocancel
707 testq %rax, %rax
708 js .L119
709 cmpq $384, %rax
710 movl file_fd(%rip), %edi
711 jne .L148
712 pxor %xmm0, %xmm0
713 xorl %eax, %eax
714 movl $2, %edx
715 movw %ax, 30(%rsp)
716 movw %dx, (%rsp)
717 movl $7, %esi
718 movq %rsp, %rdx
719 xorl %eax, %eax
720 addq $384, %rbp
721 movups %xmm0, 2(%rsp)
722 movq $0, 18(%rsp)
723 movl $0, 26(%rsp)
724 call __GI___fcntl64_nocancel
725 movq %rbx, %rax
726 movq %rbp, file_offset(%rip)
727 .L102:
728 addq $32, %rsp
729 popq %rbx
730 popq %rbp
731 popq %r12
733 .p2align 4,,10
734 .p2align 3
735 .L147:
736 movl file_fd(%rip), %edi
737 movl $2, %edx
738 xorl %esi, %esi
739 call __lseek64
740 movabsq $-6148914691236517205, %rdx
741 mulq %rdx
742 shrq $8, %rdx
743 leaq (%rdx,%rdx,2), %rbp
744 salq $7, %rbp
745 jmp .L117
746 .p2align 4,,10
747 .p2align 3
748 .L141:
749 leaq .LC1(%rip), %rdi
750 xorl %esi, %esi
751 call __GI___access
752 testl %eax, %eax
753 leaq .LC1(%rip), %rdx
754 je .L106
755 movq __libc_utmp_file_name(%rip), %rdx
756 jmp .L105
757 .p2align 4,,10
758 .p2align 3
759 .L148:
760 testb %r12b, %r12b
761 jne .L121
762 movq %rbp, %rsi
763 call __ftruncate64
764 movl file_fd(%rip), %edi
765 .L121:
766 pxor %xmm0, %xmm0
767 movl $2, %esi
768 xorl %ecx, %ecx
769 movw %si, (%rsp)
770 movq %rsp, %rdx
771 movl $7, %esi
772 xorl %eax, %eax
773 movq $0, 18(%rsp)
774 movl $0, 26(%rsp)
775 movups %xmm0, 2(%rsp)
776 movw %cx, 30(%rsp)
777 call __GI___fcntl64_nocancel
778 movq __libc_errno@gottpoff(%rip), %rax
779 movl $28, %fs:(%rax)
780 .L139:
781 xorl %eax, %eax
782 .L149:
783 addq $32, %rsp
784 popq %rbx
785 popq %rbp
786 popq %r12
788 .p2align 4,,10
789 .p2align 3
790 .L140:
791 call __libc_setutent
792 testl %eax, %eax
793 jne .L103
794 xorl %eax, %eax
795 jmp .L149
796 .p2align 4,,10
797 .p2align 3
798 .L146:
799 movq %rbx, %rdi
800 call matches_last_entry
801 testb %al, %al
802 jne .L113
803 jmp .L116
804 .p2align 4,,10
805 .p2align 3
806 .L142:
807 leaq .LC0(%rip), %rdi
808 xorl %esi, %esi
809 call __GI___access
810 testl %eax, %eax
811 leaq .LC0(%rip), %rdx
812 je .L106
813 movq __libc_utmp_file_name(%rip), %rdx
814 jmp .L107
815 .p2align 4,,10
816 .p2align 3
817 .L143:
818 xorl %esi, %esi
819 movq %rax, %rdi
820 call __GI___access
821 testl %eax, %eax
822 leaq .LC2(%rip), %rdx
823 jne .L106
824 movq __libc_utmp_file_name(%rip), %rdx
825 jmp .L108
826 .p2align 4,,10
827 .p2align 3
828 .L144:
829 xorl %esi, %esi
830 movq %rax, %rdi
831 call __GI___access
832 leaq .LC3(%rip), %rdx
833 testl %eax, %eax
834 cmove __libc_utmp_file_name(%rip), %rdx
835 jmp .L106
836 .p2align 4,,10
837 .p2align 3
838 .L119:
839 xorl %edi, %edi
840 pxor %xmm0, %xmm0
841 movw %di, 30(%rsp)
842 movl file_fd(%rip), %edi
843 movl $2, %r8d
844 movq %rsp, %rdx
845 movl $7, %esi
846 xorl %eax, %eax
847 movups %xmm0, 2(%rsp)
848 movq $0, 18(%rsp)
849 movl $0, 26(%rsp)
850 movw %r8w, (%rsp)
851 call __GI___fcntl64_nocancel
852 xorl %eax, %eax
853 jmp .L102
854 .p2align 4,,10
855 .p2align 3
856 .L145:
857 call __GI___close_nocancel
858 xorl %eax, %eax
859 jmp .L102
860 .size __libc_pututline, .-__libc_pututline
861 .p2align 4,,15
862 .globl __libc_endutent
863 .hidden __libc_endutent
864 .type __libc_endutent, @function
865 __libc_endutent:
866 movl file_fd(%rip), %edi
867 testl %edi, %edi
868 js .L153
869 subq $8, %rsp
870 call __GI___close_nocancel
871 movl $-1, file_fd(%rip)
872 addq $8, %rsp
874 .p2align 4,,10
875 .p2align 3
876 .L153:
877 rep ret
878 .size __libc_endutent, .-__libc_endutent
879 .p2align 4,,15
880 .globl __libc_updwtmp
881 .hidden __libc_updwtmp
882 .type __libc_updwtmp, @function
883 __libc_updwtmp:
884 pushq %r13
885 pushq %r12
886 xorl %eax, %eax
887 pushq %rbp
888 pushq %rbx
889 movq %rsi, %r12
890 movl $1, %esi
891 subq $40, %rsp
892 call __GI___open_nocancel
893 testl %eax, %eax
894 js .L161
895 movl $1, %esi
896 movl %eax, %edi
897 movl %eax, %ebx
898 call try_file_lock
899 testb %al, %al
900 jne .L169
901 movl $2, %edx
902 xorl %esi, %esi
903 movl %ebx, %edi
904 call __lseek64
905 movabsq $-6148914691236517205, %rdx
906 movq %rax, %rbp
907 mulq %rdx
908 shrq $8, %rdx
909 leaq (%rdx,%rdx,2), %rax
910 movq %rbp, %rdx
911 salq $7, %rax
912 subq %rax, %rdx
913 je .L159
914 subq %rdx, %rbp
915 movl %ebx, %edi
916 movl $-1, %r13d
917 movq %rbp, %rsi
918 call __ftruncate64
919 xorl %esi, %esi
920 movl $2, %edx
921 movl %ebx, %edi
922 call __lseek64
923 testq %rax, %rax
924 js .L160
925 .L159:
926 movl $384, %edx
927 movq %r12, %rsi
928 movl %ebx, %edi
929 call __GI___write_nocancel
930 xorl %r13d, %r13d
931 cmpq $384, %rax
932 jne .L170
933 .L160:
934 pxor %xmm0, %xmm0
935 xorl %eax, %eax
936 movl $2, %edx
937 movw %ax, 30(%rsp)
938 movw %dx, (%rsp)
939 movl %ebx, %edi
940 movq %rsp, %rdx
941 movl $7, %esi
942 xorl %eax, %eax
943 movups %xmm0, 2(%rsp)
944 movq $0, 18(%rsp)
945 movl $0, 26(%rsp)
946 call __GI___fcntl64_nocancel
947 movl %ebx, %edi
948 call __GI___close_nocancel
949 .L156:
950 addq $40, %rsp
951 movl %r13d, %eax
952 popq %rbx
953 popq %rbp
954 popq %r12
955 popq %r13
957 .p2align 4,,10
958 .p2align 3
959 .L170:
960 movq %rbp, %rsi
961 movl %ebx, %edi
962 movl $-1, %r13d
963 call __ftruncate64
964 jmp .L160
965 .p2align 4,,10
966 .p2align 3
967 .L161:
968 movl $-1, %r13d
969 jmp .L156
970 .p2align 4,,10
971 .p2align 3
972 .L169:
973 movl %ebx, %edi
974 movl $-1, %r13d
975 call __GI___close_nocancel
976 jmp .L156
977 .size __libc_updwtmp, .-__libc_updwtmp
978 .local last_entry
979 .comm last_entry,384,32
980 .local file_offset
981 .comm file_offset,8,8
982 .local file_writable
983 .comm file_writable,1,1
984 .data
985 .align 4
986 .type file_fd, @object
987 .size file_fd, 4
988 file_fd:
989 .long -1
990 .hidden __ftruncate64
991 .hidden __lseek64
992 .hidden __libc_utmp_file_name