	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function acpi_capm_get_pwstatus
_acpi_capm_get_pwstatus:                ## @acpi_capm_get_pwstatus
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rdi), %rbx
	movq	_PMDV_ALLDEV@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_1
## %bb.5:
	leaq	-24(%rbp), %rsi
	xorl	%edi, %edi
	jmp	LBB0_6
LBB0_1:
	movq	_PMDV_BATT0@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movl	$1, %eax
	cmpq	%rcx, %rbx
	jl	LBB0_12
## %bb.2:
	movq	_PMDV_BATT_ALL@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rbx
	jg	LBB0_12
## %bb.3:
	subl	%ecx, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_devclass_find
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_devclass_get_device
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	leaq	-24(%rbp), %rsi
	movq	%rax, %rdi
LBB0_6:
	callq	_acpi_battery_get_battinfo
	movl	%eax, %ecx
LBB0_8:
	movl	$1, %eax
	testl	%ecx, %ecx
	jne	LBB0_12
## %bb.9:
	leaq	-24(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_acpi_capm_convert_battstate
	movl	%eax, 24(%r14)
	movq	%rbx, %rdi
	callq	_acpi_capm_convert_battflags
	movl	%eax, 20(%r14)
	movl	-20(%rbp), %eax
	movl	%eax, 16(%r14)
	movl	-24(%rbp), %eax
	imull	$60, %eax, %ecx
	cmpl	$-1, %eax
	cmovel	%eax, %ecx
	movl	%ecx, 8(%r14)
	leaq	-28(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_acpi_acad_get_acline
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_APM_UNKNOWN@GOTPCREL(%rip), %rbx
LBB0_11:
	movl	(%rbx), %eax
	movl	%eax, 12(%r14)
	xorl	%eax, %eax
LBB0_12:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_PMDV_ALLDEV,8,3                ## @PMDV_ALLDEV
	.comm	_PMDV_BATT0,8,3                 ## @PMDV_BATT0
	.comm	_PMDV_BATT_ALL,8,3              ## @PMDV_BATT_ALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"battery"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_APM_UNKNOWN,4,2                ## @APM_UNKNOWN
	.no_dead_strip	_acpi_capm_get_pwstatus
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function acpi_capm_get_pwstatus
_acpi_capm_get_pwstatus:                ; @acpi_capm_get_pwstatus
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PMDV_ALLDEV@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PMDV_ALLDEV@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	x1, sp
	mov	x0, #0
	bl	_acpi_battery_get_battinfo
	cbnz	w0, LBB0_5
	b	LBB0_7
LBB0_2:
Lloh3:
	adrp	x9, _PMDV_BATT0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PMDV_BATT0@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _PMDV_BATT_ALL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PMDV_BATT_ALL@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #0, ge
	b.gt	LBB0_5
; %bb.3:
	sub	w20, w8, w9
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_devclass_find
	mov	x1, x20
	bl	_devclass_get_device
	cbz	x0, LBB0_6
; %bb.4:
	mov	x1, sp
	bl	_acpi_battery_get_battinfo
	cbz	w0, LBB0_7
LBB0_5:
	mov	w0, #1
	b	LBB0_8
LBB0_6:
Lloh11:
	adrp	x8, _ENXIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	cbnz	w0, LBB0_5
LBB0_7:
	mov	x0, sp
	bl	_acpi_capm_convert_battstate
	str	w0, [x19, #24]
	mov	x0, sp
	bl	_acpi_capm_convert_battflags
	ldp	w9, w8, [sp]
	stp	w8, w0, [x19, #16]
	mov	w8, #60
	mul	w8, w9, w8
	cmn	w9, #1
	csinv	w8, w8, wzr, ne
	str	w8, [x19, #8]
	add	x20, sp, #12
	add	x0, sp, #12
	bl	_acpi_acad_get_acline
	mov	x8, x0
	mov	w0, #0
Lloh14:
	adrp	x9, _APM_UNKNOWN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _APM_UNKNOWN@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x20, x9, eq
	ldr	w8, [x8]
	str	w8, [x19, #12]
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PMDV_ALLDEV,8,3                ; @PMDV_ALLDEV
	.comm	_PMDV_BATT0,8,3                 ; @PMDV_BATT0
	.comm	_PMDV_BATT_ALL,8,3              ; @PMDV_BATT_ALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"battery"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_APM_UNKNOWN,4,2                ; @APM_UNKNOWN
	.no_dead_strip	_acpi_capm_get_pwstatus
.subsections_via_symbols
