	.file	"21017.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/var/log/wtmp"
.LC1:
	.string	"reboot"
.LC2:
	.string	"shutdown"
.LC3:
	.string	"~~"
.LC4:
	.string	"~"
.LC5:
	.string	"/run/utmp"
	.text
	.globl	write_wtmp
	.type	write_wtmp, @function
write_wtmp:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 832
	mov	DWORD PTR -820[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 1025
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -804[rbp], eax
	cmp	DWORD PTR -804[rbp], 0
	js	.L15
	lea	rdx, -784[rbp]
	mov	eax, 0
	mov	ecx, 48
	mov	rdi, rdx
	rep stosq
	lea	rax, -800[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	gettimeofday@PLT
	mov	rax, QWORD PTR -800[rbp]
	mov	DWORD PTR -444[rbp], eax
	mov	rax, QWORD PTR -792[rbp]
	mov	DWORD PTR -440[rbp], eax
	cmp	DWORD PTR -820[rbp], 0
	je	.L4
	mov	eax, 2
	jmp	.L5
.L4:
	mov	eax, 1
.L5:
	mov	WORD PTR -784[rbp], ax
	cmp	DWORD PTR -820[rbp], 0
	je	.L6
	lea	rax, .LC1[rip]
	jmp	.L7
.L6:
	lea	rax, .LC2[rip]
.L7:
	lea	rdx, -784[rbp]
	lea	rcx, 44[rdx]
	mov	edx, 32
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	lea	rax, -784[rbp]
	add	rax, 40
	mov	edx, 4
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strncpy@PLT
	cmp	DWORD PTR -820[rbp], 0
	je	.L8
	lea	rax, .LC4[rip]
	jmp	.L9
.L8:
	lea	rax, .LC3[rip]
.L9:
	lea	rdx, -784[rbp]
	lea	rcx, 8[rdx]
	mov	edx, 32
	mov	rsi, rax
	mov	rdi, rcx
	call	strncpy@PLT
	lea	rax, -400[rbp]
	mov	rdi, rax
	call	uname@PLT
	test	eax, eax
	jne	.L10
	lea	rax, -400[rbp]
	lea	rcx, 130[rax]
	lea	rax, -784[rbp]
	add	rax, 76
	mov	edx, 256
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
.L10:
	lea	rcx, -784[rbp]
	mov	eax, DWORD PTR -804[rbp]
	mov	edx, 384
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -804[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	DWORD PTR -820[rbp], 0
	je	.L1
	mov	esi, 1025
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -804[rbp], eax
	cmp	DWORD PTR -804[rbp], 0
	js	.L16
	lea	rcx, -784[rbp]
	mov	eax, DWORD PTR -804[rbp]
	mov	edx, 384
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -804[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L1
.L15:
	nop
	jmp	.L1
.L16:
	nop
.L1:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	write_wtmp, .-write_wtmp
	.section	.rodata
.LC6:
	.string	"halt"
.LC7:
	.string	"poweroff"
	.align 8
.LC8:
	.string	"no default behavior, needs to be called as halt/reboot/poweroff."
	.align 8
.LC9:
	.string	"Usage: %s [-n] [-f] [-d] [-w] [-B]"
.LC10:
	.string	"dfhinwB"
.LC11:
	.string	"0"
.LC12:
	.string	"init"
.LC13:
	.string	"/sbin/runit-init"
.LC14:
	.string	"halt failed"
.LC15:
	.string	"poweroff failed"
.LC16:
	.string	"6"
.LC17:
	.string	"reboot failed"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -20[rbp], 1
	mov	DWORD PTR -16[rbp], 0
	mov	DWORD PTR -12[rbp], 1
	mov	DWORD PTR -8[rbp], 0
	mov	rax, QWORD PTR __progname[rip]
	mov	edx, 4
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L18
	mov	DWORD PTR -8[rbp], 1
	jmp	.L22
.L18:
	mov	rax, QWORD PTR __progname[rip]
	mov	edx, 6
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L20
	mov	DWORD PTR -8[rbp], 2
	jmp	.L22
.L20:
	mov	rax, QWORD PTR __progname[rip]
	mov	edx, 8
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L21
	mov	DWORD PTR -8[rbp], 3
	jmp	.L22
.L21:
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	warnx@PLT
	jmp	.L22
.L32:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 66
	cmp	eax, 53
	ja	.L23
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L25[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L25[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L25:
	.long	.L30-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L29-.L25
	.long	.L23-.L25
	.long	.L28-.L25
	.long	.L23-.L25
	.long	.L22-.L25
	.long	.L22-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L26-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L23-.L25
	.long	.L24-.L25
	.text
.L26:
	mov	DWORD PTR -20[rbp], 0
	jmp	.L22
.L24:
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	jmp	.L22
.L29:
	mov	DWORD PTR -12[rbp], 0
	jmp	.L22
.L28:
	mov	DWORD PTR -16[rbp], 1
	jmp	.L22
.L30:
	mov	edi, 1
	call	write_wtmp
	mov	eax, 0
	jmp	.L31
.L23:
	mov	rax, QWORD PTR __progname[rip]
	mov	rdx, rax
	lea	rsi, .LC9[rip]
	mov	edi, 1
	mov	eax, 0
	call	errx@PLT
.L22:
	mov	rcx, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR -36[rbp]
	lea	rdx, .LC10[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L32
	cmp	DWORD PTR -12[rbp], 0
	je	.L33
	mov	edi, 0
	call	write_wtmp
.L33:
	cmp	DWORD PTR -20[rbp], 0
	je	.L34
	call	sync@PLT
.L34:
	cmp	DWORD PTR -8[rbp], 3
	je	.L35
	cmp	DWORD PTR -8[rbp], 3
	ja	.L36
	cmp	DWORD PTR -8[rbp], 2
	je	.L37
	cmp	DWORD PTR -8[rbp], 2
	ja	.L36
	cmp	DWORD PTR -8[rbp], 0
	je	.L45
	cmp	DWORD PTR -8[rbp], 1
	jne	.L36
	cmp	DWORD PTR -16[rbp], 0
	je	.L39
	mov	edi, -839974621
	call	reboot@PLT
	jmp	.L40
.L39:
	mov	ecx, 0
	lea	rdx, .LC11[rip]
	lea	rsi, .LC12[rip]
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	execl@PLT
.L40:
	lea	rsi, .LC14[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L35:
	cmp	DWORD PTR -16[rbp], 0
	je	.L41
	mov	edi, 1126301404
	call	reboot@PLT
	jmp	.L42
.L41:
	mov	ecx, 0
	lea	rdx, .LC11[rip]
	lea	rsi, .LC12[rip]
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	execl@PLT
.L42:
	lea	rsi, .LC15[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L37:
	cmp	DWORD PTR -16[rbp], 0
	je	.L43
	mov	edi, 19088743
	call	reboot@PLT
	jmp	.L44
.L43:
	mov	ecx, 0
	lea	rdx, .LC16[rip]
	lea	rsi, .LC12[rip]
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	execl@PLT
.L44:
	lea	rsi, .LC17[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L45:
	nop
.L36:
	mov	eax, 0
.L31:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"21017.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/var/log/wtmp\000"
	.align	2
.LC1:
	.ascii	"reboot\000"
	.align	2
.LC2:
	.ascii	"shutdown\000"
	.align	2
.LC3:
	.ascii	"~~\000"
	.align	2
.LC4:
	.ascii	"~\000"
	.align	2
.LC5:
	.ascii	"/run/utmp\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_wtmp
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_wtmp, %function
write_wtmp:
	@ args = 0, pretend = 0, frame = 800
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #800
	str	r0, [fp, #-800]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L17+4
	ldr	r0, .L17+8
	bl	open
	str	r0, [fp, #-796]
	ldr	r3, [fp, #-796]
	cmp	r3, #0
	blt	.L15
	sub	r3, fp, #784
	mov	r2, #384
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #792
	mov	r1, #0
	mov	r0, r3
	bl	gettimeofday
	ldr	r3, [fp, #-792]
	str	r3, [fp, #-444]
	ldr	r3, [fp, #-788]
	str	r3, [fp, #-440]
	ldr	r3, [fp, #-800]
	cmp	r3, #0
	beq	.L4
	mov	r2, #2
	b	.L5
.L4:
	mov	r2, #1
.L5:
	sub	r3, fp, #4
	sub	r3, r3, #780
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-800]
	cmp	r3, #0
	beq	.L6
	ldr	r1, .L17+12
	b	.L7
.L6:
	ldr	r1, .L17+16
.L7:
	sub	r3, fp, #784
	add	r3, r3, #44
	mov	r2, #32
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #784
	add	r3, r3, #40
	mov	r2, #4
	ldr	r1, .L17+20
	mov	r0, r3
	bl	strncpy
	ldr	r3, [fp, #-800]
	cmp	r3, #0
	beq	.L8
	ldr	r1, .L17+24
	b	.L9
.L8:
	ldr	r1, .L17+20
.L9:
	sub	r3, fp, #784
	add	r3, r3, #8
	mov	r2, #32
	mov	r0, r3
	bl	strncpy
	sub	r3, fp, #400
	mov	r0, r3
	bl	uname
	mov	r3, r0
	cmp	r3, #0
	bne	.L10
	sub	r3, fp, #400
	add	r1, r3, #130
	sub	r3, fp, #784
	add	r3, r3, #76
	mov	r2, #256
	mov	r0, r3
	bl	strncpy
.L10:
	sub	r3, fp, #784
	mov	r2, #384
	mov	r1, r3
	ldr	r0, [fp, #-796]
	bl	write
	ldr	r0, [fp, #-796]
	bl	close
	ldr	r3, [fp, #-800]
	cmp	r3, #0
	beq	.L1
	ldr	r1, .L17+4
	ldr	r0, .L17+28
	bl	open
	str	r0, [fp, #-796]
	ldr	r3, [fp, #-796]
	cmp	r3, #0
	blt	.L16
	sub	r3, fp, #784
	mov	r2, #384
	mov	r1, r3
	ldr	r0, [fp, #-796]
	bl	write
	ldr	r0, [fp, #-796]
	bl	close
	b	.L1
.L15:
	nop
	b	.L1
.L16:
	nop
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L14
	bl	__stack_chk_fail
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC6
	.word	1025
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	write_wtmp, .-write_wtmp
	.section	.rodata
	.align	2
.LC7:
	.ascii	"halt\000"
	.align	2
.LC8:
	.ascii	"poweroff\000"
	.align	2
.LC9:
	.ascii	"no default behavior, needs to be called as halt/reb"
	.ascii	"oot/poweroff.\000"
	.align	2
.LC10:
	.ascii	"Usage: %s [-n] [-f] [-d] [-w] [-B]\000"
	.align	2
.LC11:
	.ascii	"dfhinwB\000"
	.align	2
.LC12:
	.ascii	"0\000"
	.align	2
.LC13:
	.ascii	"init\000"
	.align	2
.LC14:
	.ascii	"/sbin/runit-init\000"
	.align	2
.LC15:
	.ascii	"halt failed\000"
	.align	2
.LC16:
	.ascii	"poweroff failed\000"
	.align	2
.LC17:
	.ascii	"6\000"
	.align	2
.LC18:
	.ascii	"reboot failed\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r3, #1
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #4
	ldr	r1, .L49+4
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L20
	mov	r3, #1
	str	r3, [fp, #-12]
	b	.L24
.L20:
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #6
	ldr	r1, .L49+8
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L22
	mov	r3, #2
	str	r3, [fp, #-12]
	b	.L24
.L22:
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #8
	ldr	r1, .L49+12
	mov	r0, r3
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L23
	mov	r3, #3
	str	r3, [fp, #-12]
	b	.L24
.L23:
	ldr	r0, .L49+16
	bl	warnx
	b	.L24
.L34:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #66
	cmp	r3, #53
	ldrls	pc, [pc, r3, asl #2]
	b	.L25
.L27:
	.word	.L32
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L31
	.word	.L25
	.word	.L30
	.word	.L25
	.word	.L24
	.word	.L24
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L28
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L25
	.word	.L26
.L28:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L24
.L26:
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L24
.L31:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L24
.L30:
	mov	r3, #1
	str	r3, [fp, #-20]
	b	.L24
.L32:
	mov	r0, #1
	bl	write_wtmp
	mov	r3, #0
	b	.L33
.L25:
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L49+20
	mov	r0, #1
	bl	errx
.L24:
	ldr	r2, .L49+24
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-32]
	bl	getopt
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L34
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L35
	mov	r0, #0
	bl	write_wtmp
.L35:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L36
	bl	sync
.L36:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L37
.L39:
	.word	.L37
	.word	.L41
	.word	.L40
	.word	.L38
.L41:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L43
	ldr	r0, .L49+28
	bl	reboot
	b	.L44
.L43:
	mov	r3, #0
	ldr	r2, .L49+32
	ldr	r1, .L49+36
	ldr	r0, .L49+40
	bl	execl
.L44:
	ldr	r1, .L49+44
	mov	r0, #1
	bl	err
.L38:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L45
	ldr	r0, .L49+48
	bl	reboot
	b	.L46
.L45:
	mov	r3, #0
	ldr	r2, .L49+32
	ldr	r1, .L49+36
	ldr	r0, .L49+40
	bl	execl
.L46:
	ldr	r1, .L49+52
	mov	r0, #1
	bl	err
.L40:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L47
	ldr	r0, .L49+56
	bl	reboot
	b	.L48
.L47:
	mov	r3, #0
	ldr	r2, .L49+60
	ldr	r1, .L49+36
	ldr	r0, .L49+40
	bl	execl
.L48:
	ldr	r1, .L49+64
	mov	r0, #1
	bl	err
.L37:
	mov	r3, #0
.L33:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	__progname
	.word	.LC7
	.word	.LC1
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	-839974621
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	1126301404
	.word	.LC16
	.word	19088743
	.word	.LC17
	.word	.LC18
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
