	.file	"extr_..frontenddriversplatform_unix.c_frontend_unix_powerstate_check_acpi.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	frontend_unix_powerstate_check_acpi, @function
frontend_unix_powerstate_check_acpi:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR proc_acpi_battery_path[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 12[rsp], 0
	mov	DWORD PTR 16[rsp], 0
	mov	DWORD PTR 20[rsp], 0
	call	retro_opendir@PLT
	test	rax, rax
	je	.L19
	mov	rdi, rax
	mov	r14, rax
	lea	r12, 20[rsp]
	call	retro_dirent_error@PLT
	test	rax, rax
	je	.L4
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L5:
	call	retro_dirent_get_name@PLT
	lea	rsi, 12[rsp]
	mov	r8, rbp
	mov	rcx, rbx
	mov	edi, eax
	mov	rdx, r12
	call	check_proc_acpi_battery@PLT
.L4:
	mov	rdi, r14
	call	retro_readdir@PLT
	mov	rdi, r14
	test	rax, rax
	jne	.L5
	call	retro_closedir@PLT
	mov	edi, DWORD PTR proc_acpi_ac_adapter_path[rip]
	call	retro_opendir@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L19
	lea	rbx, 16[rsp]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	call	retro_dirent_get_name@PLT
	mov	rsi, rbx
	mov	edi, eax
	call	check_proc_acpi_ac_adapter@PLT
.L7:
	mov	rdi, rbp
	call	retro_readdir@PLT
	mov	rdi, rbp
	test	rax, rax
	jne	.L8
	call	retro_closedir@PLT
	mov	ecx, DWORD PTR 12[rsp]
	test	ecx, ecx
	jne	.L9
	mov	eax, DWORD PTR FRONTEND_POWERSTATE_NO_SOURCE[rip]
	mov	DWORD PTR 0[r13], eax
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, r14
	call	retro_closedir@PLT
.L19:
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L22
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	edx, DWORD PTR 20[rsp]
	test	edx, edx
	jne	.L23
	mov	eax, DWORD PTR 16[rsp]
	test	eax, eax
	je	.L11
	mov	eax, DWORD PTR FRONTEND_POWERSTATE_CHARGED[rip]
	mov	DWORD PTR 0[r13], eax
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	eax, DWORD PTR FRONTEND_POWERSTATE_CHARGING[rip]
	mov	DWORD PTR 0[r13], eax
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	eax, DWORD PTR FRONTEND_POWERSTATE_ON_POWER_SOURCE[rip]
	mov	DWORD PTR 0[r13], eax
	mov	eax, 1
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	frontend_unix_powerstate_check_acpi, .-frontend_unix_powerstate_check_acpi
	.comm	proc_acpi_battery_path,4,4
	.comm	proc_acpi_ac_adapter_path,4,4
	.comm	FRONTEND_POWERSTATE_ON_POWER_SOURCE,4,4
	.comm	FRONTEND_POWERSTATE_NO_SOURCE,4,4
	.comm	FRONTEND_POWERSTATE_CHARGING,4,4
	.comm	FRONTEND_POWERSTATE_CHARGED,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_..frontenddriversplatform_unix.c_frontend_unix_powerstate_check_acpi.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	frontend_unix_powerstate_check_acpi, %function
frontend_unix_powerstate_check_acpi:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r8, #0
	ldr	r3, .L22
	mov	r6, r0
	ldr	r0, [r3]
	ldr	r3, .L22+4
	sub	sp, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r5, r1
	mov	r7, r2
	str	r8, [sp, #8]
	str	r8, [sp, #12]
	str	r8, [sp, #16]
	bl	retro_opendir
	subs	r4, r0, #0
	beq	.L6
	bl	retro_dirent_error
	cmp	r0, #0
	beq	.L4
	b	.L20
.L5:
	bl	retro_dirent_get_name
	mov	r3, r5
	str	r7, [sp]
	add	r2, sp, #16
	add	r1, sp, #8
	bl	check_proc_acpi_battery
.L4:
	mov	r0, r4
	bl	retro_readdir
	cmp	r0, #0
	mov	r0, r4
	bne	.L5
	bl	retro_closedir
	ldr	r3, .L22+8
	ldr	r0, [r3]
	bl	retro_opendir
	subs	r4, r0, #0
	bne	.L7
.L6:
	mov	r0, #0
	b	.L1
.L8:
	bl	retro_dirent_get_name
	add	r1, sp, #12
	bl	check_proc_acpi_ac_adapter
.L7:
	mov	r0, r4
	bl	retro_readdir
	cmp	r0, #0
	mov	r0, r4
	bne	.L8
	bl	retro_closedir
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bne	.L9
	mov	r0, #1
	ldr	r3, .L22+12
	ldr	r3, [r3]
	str	r3, [r6]
.L1:
	ldr	r3, .L22+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	ldr	r3, [sp, #16]
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L22+16
	mov	r0, #1
	ldr	r3, [r3]
	str	r3, [r6]
	b	.L1
.L10:
	ldr	r3, [sp, #12]
	cmp	r3, #0
	ldrne	r3, .L22+20
	ldreq	r3, .L22+24
	movne	r0, #1
	ldr	r3, [r3]
	moveq	r0, #1
	str	r3, [r6]
	b	.L1
.L20:
	mov	r0, r4
	bl	retro_closedir
	mov	r0, r8
	b	.L1
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	proc_acpi_battery_path
	.word	.LC0
	.word	proc_acpi_ac_adapter_path
	.word	FRONTEND_POWERSTATE_NO_SOURCE
	.word	FRONTEND_POWERSTATE_CHARGING
	.word	FRONTEND_POWERSTATE_CHARGED
	.word	FRONTEND_POWERSTATE_ON_POWER_SOURCE
	.size	frontend_unix_powerstate_check_acpi, .-frontend_unix_powerstate_check_acpi
	.comm	proc_acpi_battery_path,4,4
	.comm	proc_acpi_ac_adapter_path,4,4
	.comm	FRONTEND_POWERSTATE_ON_POWER_SOURCE,4,4
	.comm	FRONTEND_POWERSTATE_NO_SOURCE,4,4
	.comm	FRONTEND_POWERSTATE_CHARGING,4,4
	.comm	FRONTEND_POWERSTATE_CHARGED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
