	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function frontend_unix_powerstate_check_acpi
_frontend_unix_powerstate_check_acpi:   ## @frontend_unix_powerstate_check_acpi
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	$0, -52(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movq	_proc_acpi_battery_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_retro_opendir
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_19
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_retro_dirent_error
	testq	%rax, %rax
	je	LBB0_2
## %bb.20:
	movq	%rbx, %rdi
	callq	_retro_closedir
	jmp	LBB0_19
LBB0_2:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_retro_readdir
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	leaq	-52(%rbp), %r14
	leaq	-44(%rbp), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_retro_dirent_get_name
	movl	%eax, %edi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r13, %rcx
	movq	%r12, %r8
	callq	_check_proc_acpi_battery
	movq	%rbx, %rdi
	callq	_retro_readdir
	testq	%rax, %rax
	jne	LBB0_4
LBB0_5:
	movq	%rbx, %rdi
	callq	_retro_closedir
	movq	_proc_acpi_ac_adapter_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_retro_opendir
	testq	%rax, %rax
	movl	$0, %r15d
	je	LBB0_19
## %bb.6:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_retro_readdir
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_retro_dirent_get_name
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_check_proc_acpi_ac_adapter
	movq	%rbx, %rdi
	callq	_retro_readdir
	testq	%rax, %rax
	jne	LBB0_8
LBB0_9:
	movq	%rbx, %rdi
	callq	_retro_closedir
	cmpl	$0, -52(%rbp)
	je	LBB0_10
## %bb.12:
	cmpl	$0, -44(%rbp)
	je	LBB0_14
## %bb.13:
	movq	_FRONTEND_POWERSTATE_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_FRONTEND_POWERSTATE_NO_SOURCE@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_14:
	cmpl	$0, -48(%rbp)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_16
## %bb.15:
	movq	_FRONTEND_POWERSTATE_CHARGED@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_16:
	movq	_FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPCREL(%rip), %rax
LBB0_17:
	movl	(%rax), %eax
LBB0_18:
	movl	%eax, (%rcx)
	movl	$1, %r15d
LBB0_19:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_proc_acpi_battery_path,4,2     ## @proc_acpi_battery_path
	.comm	_proc_acpi_ac_adapter_path,4,2  ## @proc_acpi_ac_adapter_path
	.comm	_FRONTEND_POWERSTATE_NO_SOURCE,4,2 ## @FRONTEND_POWERSTATE_NO_SOURCE
	.comm	_FRONTEND_POWERSTATE_CHARGING,4,2 ## @FRONTEND_POWERSTATE_CHARGING
	.comm	_FRONTEND_POWERSTATE_CHARGED,4,2 ## @FRONTEND_POWERSTATE_CHARGED
	.comm	_FRONTEND_POWERSTATE_ON_POWER_SOURCE,4,2 ## @FRONTEND_POWERSTATE_ON_POWER_SOURCE
	.no_dead_strip	_frontend_unix_powerstate_check_acpi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function frontend_unix_powerstate_check_acpi
_frontend_unix_powerstate_check_acpi:   ; @frontend_unix_powerstate_check_acpi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	str	wzr, [sp, #4]
Lloh0:
	adrp	x8, _proc_acpi_battery_path@GOTPAGE
Lloh1:
	ldr	x8, [x8, _proc_acpi_battery_path@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_retro_opendir
	cbz	x0, LBB0_17
; %bb.1:
	mov	x22, x0
	bl	_retro_dirent_error
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_retro_closedir
	mov	w0, #0
	b	LBB0_17
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	bl	_retro_dirent_get_name
	add	x1, sp, #12
	add	x2, sp, #4
	mov	x3, x21
	mov	x4, x20
	bl	_check_proc_acpi_battery
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_retro_readdir
	cbnz	x0, LBB0_3
; %bb.5:
	mov	x0, x22
	bl	_retro_closedir
Lloh3:
	adrp	x8, _proc_acpi_ac_adapter_path@GOTPAGE
Lloh4:
	ldr	x8, [x8, _proc_acpi_ac_adapter_path@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_retro_opendir
	cbz	x0, LBB0_17
; %bb.6:
	mov	x20, x0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_retro_readdir
	cbz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	bl	_retro_dirent_get_name
	add	x1, sp, #8
	bl	_check_proc_acpi_ac_adapter
	b	LBB0_7
LBB0_9:
	mov	x0, x20
	bl	_retro_closedir
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_12
; %bb.10:
	ldr	w8, [sp, #4]
	cbz	w8, LBB0_13
; %bb.11:
Lloh6:
	adrp	x8, _FRONTEND_POWERSTATE_CHARGING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_CHARGING@GOTPAGEOFF]
	b	LBB0_16
LBB0_12:
Lloh8:
	adrp	x8, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGEOFF]
	b	LBB0_16
LBB0_13:
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_15
; %bb.14:
Lloh10:
	adrp	x8, _FRONTEND_POWERSTATE_CHARGED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_CHARGED@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh12:
	adrp	x8, _FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	w0, #1
LBB0_17:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_proc_acpi_battery_path,4,2     ; @proc_acpi_battery_path
	.comm	_proc_acpi_ac_adapter_path,4,2  ; @proc_acpi_ac_adapter_path
	.comm	_FRONTEND_POWERSTATE_NO_SOURCE,4,2 ; @FRONTEND_POWERSTATE_NO_SOURCE
	.comm	_FRONTEND_POWERSTATE_CHARGING,4,2 ; @FRONTEND_POWERSTATE_CHARGING
	.comm	_FRONTEND_POWERSTATE_CHARGED,4,2 ; @FRONTEND_POWERSTATE_CHARGED
	.comm	_FRONTEND_POWERSTATE_ON_POWER_SOURCE,4,2 ; @FRONTEND_POWERSTATE_ON_POWER_SOURCE
	.no_dead_strip	_frontend_unix_powerstate_check_acpi
.subsections_via_symbols
