	.file	"extr_apmd.c_main.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"unknown option `%c'"
.LC1:
	.string	"df:sv"
.LC2:
	.string	"start"
.LC3:
	.string	"pipe"
.LC4:
	.string	"fcntl"
.LC5:
	.string	"cannot open device file `%s'"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC6:
	.string	"cannot set close-on-exec flag for device file '%s'"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, 1
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r12d, DWORD PTR LOG_NDELAY[rip]
	or	r12d, DWORD PTR LOG_PID[rip]
	.p2align 4,,10
	.p2align 3
.L2:
	lea	rdx, .LC1[rip]
	mov	rsi, rbx
	mov	edi, ebp
	call	getopt@PLT
	cmp	eax, -1
	je	.L24
	cmp	eax, 115
	je	.L3
	jg	.L4
	cmp	eax, 100
	je	.L5
	cmp	eax, 102
	jne	.L7
	mov	eax, DWORD PTR optarg[rip]
	mov	DWORD PTR apmd_configfile[rip], eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	eax, 118
	jne	.L7
	mov	DWORD PTR verbose[rip], 1
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	mov	DWORD PTR soft_power_state_change[rip], 1
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edx, eax
	lea	rsi, .LC0[rip]
	mov	edi, 1
	xor	eax, eax
	call	err@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L5:
	add	DWORD PTR debug_level[rip], 1
	xor	r13d, r13d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L24:
	test	r13d, r13d
	jne	.L25
	or	r12d, DWORD PTR LOG_PERROR[rip]
.L20:
	mov	rdi, QWORD PTR [rbx]
	mov	esi, 47
	call	strrchr@PLT
	mov	edx, DWORD PTR LOG_DAEMON[rip]
	lea	rdi, 1[rax]
	test	rax, rax
	je	.L26
.L13:
	mov	esi, r12d
	call	openlog@PLT
	mov	edi, DWORD PTR LOG_NOTICE[rip]
	lea	rsi, .LC2[rip]
	call	syslog@PLT
	mov	rdi, QWORD PTR signal_fd[rip]
	call	pipe@PLT
	test	rax, rax
	js	.L27
.L14:
	mov	rax, QWORD PTR signal_fd[rip]
	mov	edx, DWORD PTR O_NONBLOCK[rip]
	mov	esi, DWORD PTR F_SETFL[rip]
	mov	edi, DWORD PTR [rax]
	call	fcntl@PLT
	test	eax, eax
	js	.L28
.L15:
	mov	edi, DWORD PTR APM_NORM_DEVICEFILE[rip]
	mov	esi, DWORD PTR O_RDWR[rip]
	call	open@PLT
	mov	DWORD PTR apmnorm_fd[rip], eax
	mov	edi, eax
	cmp	eax, -1
	je	.L29
.L16:
	mov	esi, DWORD PTR F_SETFD[rip]
	mov	edx, 1
	call	fcntl@PLT
	cmp	eax, -1
	je	.L30
.L17:
	mov	edi, DWORD PTR APM_CTL_DEVICEFILE[rip]
	mov	esi, DWORD PTR O_RDWR[rip]
	call	open@PLT
	mov	DWORD PTR apmctl_fd[rip], eax
	mov	edi, eax
	cmp	eax, -1
	je	.L31
.L18:
	mov	esi, DWORD PTR F_SETFD[rip]
	mov	edx, 1
	call	fcntl@PLT
	cmp	eax, -1
	je	.L32
.L19:
	xor	eax, eax
	call	restart@PLT
	xor	eax, eax
	call	write_pid@PLT
	xor	eax, eax
	call	event_loop@PLT
	mov	edi, DWORD PTR EXIT_SUCCESS[rip]
	call	exit@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L25:
	.cfi_restore_state
	xor	esi, esi
	xor	edi, edi
	call	daemon@PLT
	jmp	.L20
.L26:
	mov	rdi, QWORD PTR [rbx]
	jmp	.L13
.L27:
	lea	rsi, .LC3[rip]
	mov	edi, 1
	xor	eax, eax
	call	err@PLT
	jmp	.L14
.L28:
	lea	rsi, .LC4[rip]
	mov	edi, 1
	xor	eax, eax
	call	err@PLT
	jmp	.L15
.L32:
	mov	edx, DWORD PTR APM_CTL_DEVICEFILE[rip]
	lea	rsi, .LC6[rip]
	mov	edi, 1
	xor	eax, eax
	call	err@PLT
	jmp	.L19
.L29:
	mov	edx, DWORD PTR APM_NORM_DEVICEFILE[rip]
	mov	edi, 1
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	err@PLT
	mov	edi, DWORD PTR apmnorm_fd[rip]
	jmp	.L16
.L31:
	mov	edx, DWORD PTR APM_CTL_DEVICEFILE[rip]
	mov	edi, 1
	lea	rsi, .LC5[rip]
	xor	eax, eax
	call	err@PLT
	mov	edi, DWORD PTR apmctl_fd[rip]
	jmp	.L18
.L30:
	mov	edx, DWORD PTR APM_NORM_DEVICEFILE[rip]
	lea	rsi, .LC6[rip]
	mov	edi, 1
	xor	eax, eax
	call	err@PLT
	jmp	.L17
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.comm	verbose,4,4
	.comm	soft_power_state_change,4,4
	.comm	signal_fd,8,8
	.comm	optarg,4,4
	.comm	debug_level,4,4
	.comm	apmnorm_fd,4,4
	.comm	apmd_configfile,4,4
	.comm	apmctl_fd,4,4
	.comm	O_RDWR,4,4
	.comm	O_NONBLOCK,4,4
	.comm	NICE_INCR,4,4
	.comm	LOG_PID,4,4
	.comm	LOG_PERROR,4,4
	.comm	LOG_NOTICE,4,4
	.comm	LOG_NDELAY,4,4
	.comm	LOG_DAEMON,4,4
	.comm	F_SETFL,4,4
	.comm	F_SETFD,4,4
	.comm	EXIT_SUCCESS,4,4
	.comm	APM_NORM_DEVICEFILE,4,4
	.comm	APM_CTL_DEVICEFILE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_apmd.c_main.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"unknown option `%c'\000"
	.align	2
.LC1:
	.ascii	"df:sv\000"
	.align	2
.LC2:
	.ascii	"start\000"
	.align	2
.LC3:
	.ascii	"pipe\000"
	.align	2
.LC4:
	.ascii	"fcntl\000"
	.align	2
.LC5:
	.ascii	"cannot open device file `%s'\000"
	.align	2
.LC6:
	.ascii	"cannot set close-on-exec flag for device file '%s'\000"
	.section	.text.startup,"ax",%progbits
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	mov	r4, r1
	mov	r8, #1
	ldr	r2, .L32
	ldr	r3, .L32+4
	ldr	r7, [r2]
	ldr	r3, [r3]
	ldr	r6, .L32+8
	ldr	fp, .L32+12
	ldr	r10, .L32+16
	ldr	r9, .L32+20
	orr	r7, r7, r3
.L2:
	mov	r2, r6
	mov	r1, r4
	mov	r0, r5
	bl	getopt
	cmn	r0, #1
	mov	r2, r0
	sub	r3, r0, #100
	beq	.L24
	cmp	r3, #18
	ldrls	pc, [pc, r3, asl #2]
	b	.L3
.L5:
	.word	.L8
	.word	.L3
	.word	.L7
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L3
	.word	.L6
	.word	.L3
	.word	.L3
	.word	.L4
.L4:
	mov	r3, #1
	str	r3, [r10]
	b	.L2
.L6:
	mov	r3, #1
	ldr	r2, .L32+24
	str	r3, [r2]
	b	.L2
.L7:
	ldr	r3, [r9]
	ldr	r2, .L32+28
	str	r3, [r2]
	b	.L2
.L8:
	ldr	r2, .L32+32
	mov	r8, #0
	ldr	r3, [r2]
	add	r3, r3, #1
	str	r3, [r2]
	b	.L2
.L3:
	mov	r1, fp
	mov	r0, #1
	bl	err
	b	.L2
.L24:
	cmp	r8, #0
	bne	.L25
	ldr	r3, .L32+36
	ldr	r3, [r3]
	orr	r7, r7, r3
.L20:
	mov	r1, #47
	ldr	r0, [r4]
	bl	strrchr
	ldr	r3, .L32+40
	cmp	r0, #0
	ldreq	r0, [r4]
	ldr	r2, [r3]
	addne	r0, r0, #1
	mov	r1, r7
	bl	openlog
	ldr	r3, .L32+44
	ldr	r4, .L32+48
	ldr	r0, [r3]
	ldr	r1, .L32+52
	bl	syslog
	ldr	r0, [r4]
	bl	pipe
	cmp	r0, #0
	blt	.L26
.L14:
	ldr	r1, [r4]
	ldr	r3, .L32+56
	ldr	r2, .L32+60
	ldr	r0, [r1]
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	fcntl
	cmp	r0, #0
	blt	.L27
.L15:
	ldr	r5, .L32+64
	ldr	r6, .L32+68
	ldr	r1, [r5]
	ldr	r0, [r6]
	bl	open
	ldr	r4, .L32+72
	cmn	r0, #1
	str	r0, [r4]
	beq	.L28
.L16:
	ldr	r4, .L32+76
	mov	r2, #1
	ldr	r1, [r4]
	bl	fcntl
	cmn	r0, #1
	beq	.L29
.L17:
	ldr	r6, .L32+80
	ldr	r1, [r5]
	ldr	r0, [r6]
	bl	open
	ldr	r5, .L32+84
	cmn	r0, #1
	str	r0, [r5]
	beq	.L30
.L18:
	mov	r2, #1
	ldr	r1, [r4]
	bl	fcntl
	cmn	r0, #1
	beq	.L31
.L19:
	bl	restart
	bl	write_pid
	bl	event_loop
	ldr	r3, .L32+88
	ldr	r0, [r3]
	bl	exit
	mov	r0, #0
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	mov	r1, #0
	mov	r0, r1
	bl	daemon
	b	.L20
.L27:
	ldr	r1, .L32+92
	mov	r0, #1
	bl	err
	b	.L15
.L26:
	ldr	r1, .L32+96
	mov	r0, #1
	bl	err
	b	.L14
.L31:
	ldr	r2, [r6]
	ldr	r1, .L32+100
	mov	r0, #1
	bl	err
	b	.L19
.L30:
	mov	r0, #1
	ldr	r2, [r6]
	ldr	r1, .L32+104
	bl	err
	ldr	r0, [r5]
	b	.L18
.L29:
	ldr	r2, [r6]
	ldr	r1, .L32+100
	mov	r0, #1
	bl	err
	b	.L17
.L28:
	mov	r0, #1
	ldr	r2, [r6]
	ldr	r1, .L32+104
	bl	err
	ldr	r0, [r4]
	b	.L16
.L33:
	.align	2
.L32:
	.word	LOG_NDELAY
	.word	LOG_PID
	.word	.LC1
	.word	.LC0
	.word	verbose
	.word	optarg
	.word	soft_power_state_change
	.word	apmd_configfile
	.word	debug_level
	.word	LOG_PERROR
	.word	LOG_DAEMON
	.word	LOG_NOTICE
	.word	signal_fd
	.word	.LC2
	.word	F_SETFL
	.word	O_NONBLOCK
	.word	O_RDWR
	.word	APM_NORM_DEVICEFILE
	.word	apmnorm_fd
	.word	F_SETFD
	.word	APM_CTL_DEVICEFILE
	.word	apmctl_fd
	.word	EXIT_SUCCESS
	.word	.LC4
	.word	.LC3
	.word	.LC6
	.word	.LC5
	.size	main, .-main
	.comm	verbose,4,4
	.comm	soft_power_state_change,4,4
	.comm	signal_fd,4,4
	.comm	optarg,4,4
	.comm	debug_level,4,4
	.comm	apmnorm_fd,4,4
	.comm	apmd_configfile,4,4
	.comm	apmctl_fd,4,4
	.comm	O_RDWR,4,4
	.comm	O_NONBLOCK,4,4
	.comm	NICE_INCR,4,4
	.comm	LOG_PID,4,4
	.comm	LOG_PERROR,4,4
	.comm	LOG_NOTICE,4,4
	.comm	LOG_NDELAY,4,4
	.comm	LOG_DAEMON,4,4
	.comm	F_SETFL,4,4
	.comm	F_SETFD,4,4
	.comm	EXIT_SUCCESS,4,4
	.comm	APM_NORM_DEVICEFILE,4,4
	.comm	APM_CTL_DEVICEFILE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
