	.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_sysfs
_frontend_unix_powerstate_check_acpi_sysfs: ## @frontend_unix_powerstate_check_acpi_sysfs
	.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, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	$0, -52(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -48(%rbp)
	movq	_proc_acpi_sysfs_battery_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_retro_opendir
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_20
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_retro_dirent_error
	testq	%rax, %rax
	je	LBB0_2
## %bb.19:
	movq	%rbx, %rdi
	callq	_retro_closedir
	jmp	LBB0_20
LBB0_2:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_retro_readdir
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	leaq	L_.str(%rip), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_retro_readdir
	testq	%rax, %rax
	je	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_retro_dirent_get_name
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rcx
	movq	%r15, %r8
	callq	_check_proc_acpi_sysfs_battery
	jmp	LBB0_7
LBB0_8:
	movq	%rbx, %rdi
	callq	_retro_closedir
	movq	_proc_acpi_sysfs_ac_adapter_path@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_retro_opendir
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_retro_dirent_get_name
	leaq	-44(%rbp), %rsi
	movq	%rax, %rdi
	callq	_check_proc_acpi_sysfs_ac_adapter
	movq	%rbx, %rdi
	callq	_retro_closedir
	jmp	LBB0_11
LBB0_10:
	movl	$0, -44(%rbp)
LBB0_11:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$0, -52(%rbp)
	je	LBB0_12
## %bb.14:
	cmpl	$0, -48(%rbp)
	je	LBB0_16
## %bb.15:
	movq	_FRONTEND_POWERSTATE_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_12:
	movq	_FRONTEND_POWERSTATE_NO_SOURCE@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_16:
	cmpl	$0, -44(%rbp)
	je	LBB0_18
## %bb.17:
	movq	_FRONTEND_POWERSTATE_CHARGED@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_18:
	movq	_FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	$1, %r14d
LBB0_20:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_proc_acpi_sysfs_battery_path,4,2 ## @proc_acpi_sysfs_battery_path
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BAT"

	.comm	_proc_acpi_sysfs_ac_adapter_path,4,2 ## @proc_acpi_sysfs_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_sysfs
.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_sysfs
_frontend_unix_powerstate_check_acpi_sysfs: ; @frontend_unix_powerstate_check_acpi_sysfs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	str	wzr, [sp, #4]
Lloh0:
	adrp	x8, _proc_acpi_sysfs_battery_path@GOTPAGE
Lloh1:
	ldr	x8, [x8, _proc_acpi_sysfs_battery_path@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_retro_opendir
	cbz	x0, LBB0_19
; %bb.1:
	mov	x22, x0
	bl	_retro_dirent_error
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x22
	bl	_retro_closedir
	mov	w0, #0
	b	LBB0_19
LBB0_3:
	mov	x0, x22
	bl	_retro_readdir
	cbz	x0, LBB0_9
; %bb.4:
Lloh3:
	adrp	x23, l_.str@PAGE
Lloh4:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	bl	_retro_readdir
	cbz	x0, LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_retro_dirent_get_name
	cbz	x0, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x24, x0
	mov	x1, x23
	bl	_strstr
	cbz	x0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x1, sp, #12
	add	x2, sp, #4
	mov	x0, x24
	mov	x3, x21
	mov	x4, x20
	bl	_check_proc_acpi_sysfs_battery
	b	LBB0_5
LBB0_9:
	mov	x0, x22
	bl	_retro_closedir
Lloh5:
	adrp	x8, _proc_acpi_sysfs_ac_adapter_path@GOTPAGE
Lloh6:
	ldr	x8, [x8, _proc_acpi_sysfs_ac_adapter_path@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_retro_opendir
	cbz	x0, LBB0_13
; %bb.10:
	mov	x20, x0
	bl	_retro_dirent_get_name
	add	x1, sp, #8
	bl	_check_proc_acpi_sysfs_ac_adapter
	mov	x0, x20
	bl	_retro_closedir
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_14
LBB0_11:
	ldr	w8, [sp, #4]
	cbz	w8, LBB0_15
; %bb.12:
Lloh8:
	adrp	x8, _FRONTEND_POWERSTATE_CHARGING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_CHARGING@GOTPAGEOFF]
	b	LBB0_18
LBB0_13:
	str	wzr, [sp, #8]
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_11
LBB0_14:
Lloh10:
	adrp	x8, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_NO_SOURCE@GOTPAGEOFF]
	b	LBB0_18
LBB0_15:
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_17
; %bb.16:
Lloh12:
	adrp	x8, _FRONTEND_POWERSTATE_CHARGED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_CHARGED@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh14:
	adrp	x8, _FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FRONTEND_POWERSTATE_ON_POWER_SOURCE@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_proc_acpi_sysfs_battery_path,4,2 ; @proc_acpi_sysfs_battery_path
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BAT"

	.comm	_proc_acpi_sysfs_ac_adapter_path,4,2 ; @proc_acpi_sysfs_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_sysfs
.subsections_via_symbols
