	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmu_apm_get_power_status
_pmu_apm_get_power_status:              ## @pmu_apm_get_power_status
	.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
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_APM_BATTERY_STATUS_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rdi)
	movq	_APM_BATTERY_FLAG_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rdi)
	movq	_APM_UNITS_MINS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rdi)
	movq	_pmu_power_flags@GOTPCREL(%rip), %rax
	movq	_PMU_PWR_AC_PRESENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	jne	LBB0_2
## %bb.1:
	movq	_APM_AC_OFFLINE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_APM_AC_ONLINE@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rax
	movq	%rax, 16(%rdi)
	movq	_pmu_battery_count@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.4:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_pmu_batteries@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movq	_PMU_BATT_PRESENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	_PMU_BATT_TYPE_MASK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_PMU_BATT_CHARGING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %r13
	movl	$-1, %r10d
	movq	$-1, %rsi
	xorl	%edi, %edi
	xorl	%r14d, %r14d
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	xorl	%r12d, %r12d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	addq	$24, %rdi
	cmpq	%rdi, %r13
	je	LBB0_8
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rbx,%rdi), %r15
	testl	%r15d, -48(%rbp)                ## 4-byte Folded Reload
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%r12d
	testl	%r10d, %r10d
	movl	$0, %eax
	cmovlel	%eax, %r10d
	testq	%rsi, %rsi
	cmovleq	%rax, %rsi
	movq	%r11, %r8
	movl	%r9d, %r11d
	movslq	4(%rbx,%rdi), %r9
	imull	$100, %r9d, %eax
	cltd
	idivl	8(%rbx,%rdi)
	addl	%eax, %r10d
	addq	%r9, %rsi
	movl	%r11d, %r9d
	movq	%r8, %r11
	addq	16(%rbx,%rdi), %r11
	movq	%r15, %rax
	andq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	testq	%r14, %r14
	cmoveq	%rax, %r14
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	andl	%r15d, %eax
	incl	%r9d
	cmpl	$1, %eax
	sbbb	$-1, %cl
	jmp	LBB0_5
LBB0_8:
	testl	%r12d, %r12d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_11
	jmp	LBB0_10
LBB0_9:
	movl	$-1, %r10d
	xorl	%r14d, %r14d
	movq	$-1, %rsi
	xorl	%r11d, %r11d
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
LBB0_10:
	movq	_APM_AC_ONLINE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rdi)
LBB0_11:
	movl	$-1, %r8d
	testl	%r9d, %r9d
	je	LBB0_28
## %bb.12:
	testq	%r11, %r11
	jns	LBB0_22
## %bb.13:
	movq	_PMU_BATT_TYPE_SMART@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_16
## %bb.14:
	imulq	$59, %rsi, %rax
	negq	%r11
	movq	%rax, %rdx
	orq	%r11, %rdx
	shrq	$32, %rdx
	je	LBB0_19
## %bb.15:
	cqto
	idivq	%r11
	jmp	LBB0_18
LBB0_16:
	imulq	$16440, %rsi, %rax              ## imm = 0x4038
	imulq	$-60, %r11, %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_20
## %bb.17:
	cqto
	idivq	%rsi
LBB0_18:
	movq	%rax, %r8
	jmp	LBB0_22
LBB0_19:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r11d
	jmp	LBB0_21
LBB0_20:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
LBB0_21:
	movl	%eax, %r8d
LBB0_22:
	movl	%r10d, %eax
	cltd
	idivl	%r9d
	movl	%eax, %r10d
	testb	%cl, %cl
	jle	LBB0_24
## %bb.23:
	movq	_APM_BATTERY_FLAG_CHARGING@GOTPCREL(%rip), %rax
	movq	_APM_BATTERY_STATUS_CHARGING@GOTPCREL(%rip), %rdx
	jmp	LBB0_27
LBB0_24:
	movq	_APM_CRITICAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r10d
	jle	LBB0_26
## %bb.25:
	movq	_APM_LOW@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r10d
	movq	_APM_BATTERY_STATUS_LOW@GOTPCREL(%rip), %rdx
	cmovgq	_APM_BATTERY_STATUS_HIGH@GOTPCREL(%rip), %rdx
	movq	_APM_BATTERY_FLAG_LOW@GOTPCREL(%rip), %rax
	cmovgq	_APM_BATTERY_FLAG_HIGH@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_26:
	movq	_APM_BATTERY_FLAG_CRITICAL@GOTPCREL(%rip), %rax
	movq	_APM_BATTERY_STATUS_CRITICAL@GOTPCREL(%rip), %rdx
LBB0_27:
	movl	(%rdx), %edx
	movl	%edx, 12(%rdi)
	movl	(%rax), %eax
	movl	%eax, 8(%rdi)
LBB0_28:
	movl	%r10d, (%rdi)
	movl	%r8d, 4(%rdi)
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_APM_BATTERY_STATUS_UNKNOWN,4,2 ## @APM_BATTERY_STATUS_UNKNOWN
	.comm	_APM_BATTERY_FLAG_UNKNOWN,4,2   ## @APM_BATTERY_FLAG_UNKNOWN
	.comm	_APM_UNITS_MINS,4,2             ## @APM_UNITS_MINS
	.comm	_pmu_power_flags,4,2            ## @pmu_power_flags
	.comm	_PMU_PWR_AC_PRESENT,4,2         ## @PMU_PWR_AC_PRESENT
	.comm	_APM_AC_ONLINE,8,3              ## @APM_AC_ONLINE
	.comm	_APM_AC_OFFLINE,8,3             ## @APM_AC_OFFLINE
	.comm	_pmu_battery_count,4,2          ## @pmu_battery_count
	.comm	_pmu_batteries,8,3              ## @pmu_batteries
	.comm	_PMU_BATT_PRESENT,4,2           ## @PMU_BATT_PRESENT
	.comm	_PMU_BATT_TYPE_MASK,8,3         ## @PMU_BATT_TYPE_MASK
	.comm	_PMU_BATT_CHARGING,4,2          ## @PMU_BATT_CHARGING
	.comm	_PMU_BATT_TYPE_SMART,8,3        ## @PMU_BATT_TYPE_SMART
	.comm	_APM_BATTERY_STATUS_CHARGING,4,2 ## @APM_BATTERY_STATUS_CHARGING
	.comm	_APM_BATTERY_FLAG_CHARGING,4,2  ## @APM_BATTERY_FLAG_CHARGING
	.comm	_APM_CRITICAL,4,2               ## @APM_CRITICAL
	.comm	_APM_BATTERY_STATUS_CRITICAL,4,2 ## @APM_BATTERY_STATUS_CRITICAL
	.comm	_APM_BATTERY_FLAG_CRITICAL,4,2  ## @APM_BATTERY_FLAG_CRITICAL
	.comm	_APM_LOW,4,2                    ## @APM_LOW
	.comm	_APM_BATTERY_STATUS_LOW,4,2     ## @APM_BATTERY_STATUS_LOW
	.comm	_APM_BATTERY_FLAG_LOW,4,2       ## @APM_BATTERY_FLAG_LOW
	.comm	_APM_BATTERY_STATUS_HIGH,4,2    ## @APM_BATTERY_STATUS_HIGH
	.comm	_APM_BATTERY_FLAG_HIGH,4,2      ## @APM_BATTERY_FLAG_HIGH
	.no_dead_strip	_pmu_apm_get_power_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmu_apm_get_power_status
_pmu_apm_get_power_status:              ; @pmu_apm_get_power_status
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	.cfi_offset w19, -8
	.cfi_offset w20, -16
Lloh0:
	adrp	x8, _APM_BATTERY_STATUS_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _APM_BATTERY_STATUS_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _APM_BATTERY_FLAG_UNKNOWN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _APM_BATTERY_FLAG_UNKNOWN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #8]
Lloh6:
	adrp	x8, _APM_UNITS_MINS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _APM_UNITS_MINS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x0, #24]
Lloh9:
	adrp	x8, _pmu_power_flags@GOTPAGE
Lloh10:
	ldr	x8, [x8, _pmu_power_flags@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _PMU_PWR_AC_PRESENT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PMU_PWR_AC_PRESENT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _APM_AC_OFFLINE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _APM_AC_OFFLINE@GOTPAGEOFF]
Lloh17:
	adrp	x13, _APM_AC_ONLINE@GOTPAGE
Lloh18:
	ldr	x13, [x13, _APM_AC_ONLINE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x13, eq
	ldr	x8, [x8]
	str	x8, [x0, #16]
Lloh19:
	adrp	x8, _pmu_battery_count@GOTPAGE
Lloh20:
	ldr	x8, [x8, _pmu_battery_count@GOTPAGEOFF]
Lloh21:
	ldr	w16, [x8]
	cmp	w16, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x12, #0
	mov	x11, #0
	mov	w9, #0
	mov	w10, #0
	mov	w15, #0
	mov	w8, #-1
Lloh22:
	adrp	x14, _pmu_batteries@GOTPAGE
Lloh23:
	ldr	x14, [x14, _pmu_batteries@GOTPAGEOFF]
Lloh24:
	ldr	x14, [x14]
Lloh25:
	adrp	x17, _PMU_BATT_PRESENT@GOTPAGE
Lloh26:
	ldr	x17, [x17, _PMU_BATT_PRESENT@GOTPAGEOFF]
Lloh27:
	ldr	w17, [x17]
Lloh28:
	adrp	x1, _PMU_BATT_TYPE_MASK@GOTPAGE
Lloh29:
	ldr	x1, [x1, _PMU_BATT_TYPE_MASK@GOTPAGEOFF]
Lloh30:
	ldr	x1, [x1]
Lloh31:
	adrp	x2, _PMU_BATT_CHARGING@GOTPAGE
Lloh32:
	ldr	x2, [x2, _PMU_BATT_CHARGING@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x2]
	add	x3, x14, #8
	mov	x14, #-1
	mov	w4, #100
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x3, x3, #24
	subs	x16, x16, #1
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldursw	x5, [x3, #-8]
	tst	w17, w5
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w15, w15, #1
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	cmp	x14, #0
	csel	x14, x14, xzr, gt
	ldursw	x6, [x3, #-4]
	ldr	w7, [x3]
	mul	w19, w6, w4
	sdiv	w7, w19, w7
	add	w8, w7, w8
	add	x14, x14, x6
	ldr	x6, [x3, #8]
	add	x11, x6, x11
	and	x6, x1, x5
	cmp	x12, #0
	csel	x12, x6, x12, eq
	add	w10, w10, #1
	tst	w2, w5
	cinc	w9, w9, ne
	b	LBB0_2
LBB0_5:
	cbz	w15, LBB0_10
; %bb.6:
	cbz	w10, LBB0_11
LBB0_7:
	tbnz	x11, #63, LBB0_12
; %bb.8:
	mov	w11, #-1
	b	LBB0_15
LBB0_9:
	mov	x12, #0
	mov	x11, #0
	mov	w9, #0
	mov	w10, #0
	mov	w8, #-1
	mov	x14, #-1
LBB0_10:
	ldr	x13, [x13]
	str	x13, [x0, #16]
	cbnz	w10, LBB0_7
LBB0_11:
	mov	w11, #-1
	b	LBB0_21
LBB0_12:
Lloh34:
	adrp	x13, _PMU_BATT_TYPE_SMART@GOTPAGE
Lloh35:
	ldr	x13, [x13, _PMU_BATT_TYPE_SMART@GOTPAGEOFF]
Lloh36:
	ldr	x13, [x13]
	cmp	x12, x13
	b.ne	LBB0_14
; %bb.13:
	mov	w12, #59
	mul	x12, x14, x12
	neg	x11, x11
	sdiv	x11, x12, x11
	b	LBB0_15
LBB0_14:
	mov	w12, #16440
	mul	x12, x14, x12
	mov	x13, #-60
	mul	x11, x11, x13
	sdiv	x11, x12, x11
                                        ; kill: def $w11 killed $w11 killed $x11 def $x11
LBB0_15:
	sxtb	w9, w9
	sdiv	w8, w8, w10
	cmp	w9, #0
	b.le	LBB0_17
; %bb.16:
Lloh37:
	adrp	x9, _APM_BATTERY_FLAG_CHARGING@GOTPAGE
Lloh38:
	ldr	x9, [x9, _APM_BATTERY_FLAG_CHARGING@GOTPAGEOFF]
Lloh39:
	adrp	x10, _APM_BATTERY_STATUS_CHARGING@GOTPAGE
Lloh40:
	ldr	x10, [x10, _APM_BATTERY_STATUS_CHARGING@GOTPAGEOFF]
	b	LBB0_20
LBB0_17:
Lloh41:
	adrp	x9, _APM_CRITICAL@GOTPAGE
Lloh42:
	ldr	x9, [x9, _APM_CRITICAL@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_19
; %bb.18:
Lloh44:
	adrp	x9, _APM_LOW@GOTPAGE
Lloh45:
	ldr	x9, [x9, _APM_LOW@GOTPAGEOFF]
Lloh46:
	ldr	w9, [x9]
Lloh47:
	adrp	x10, _APM_BATTERY_STATUS_LOW@GOTPAGE
Lloh48:
	ldr	x10, [x10, _APM_BATTERY_STATUS_LOW@GOTPAGEOFF]
Lloh49:
	adrp	x12, _APM_BATTERY_STATUS_HIGH@GOTPAGE
Lloh50:
	ldr	x12, [x12, _APM_BATTERY_STATUS_HIGH@GOTPAGEOFF]
	cmp	w8, w9
	csel	x10, x12, x10, gt
Lloh51:
	adrp	x9, _APM_BATTERY_FLAG_LOW@GOTPAGE
Lloh52:
	ldr	x9, [x9, _APM_BATTERY_FLAG_LOW@GOTPAGEOFF]
Lloh53:
	adrp	x12, _APM_BATTERY_FLAG_HIGH@GOTPAGE
Lloh54:
	ldr	x12, [x12, _APM_BATTERY_FLAG_HIGH@GOTPAGEOFF]
	csel	x9, x12, x9, gt
	b	LBB0_20
LBB0_19:
Lloh55:
	adrp	x9, _APM_BATTERY_FLAG_CRITICAL@GOTPAGE
Lloh56:
	ldr	x9, [x9, _APM_BATTERY_FLAG_CRITICAL@GOTPAGEOFF]
Lloh57:
	adrp	x10, _APM_BATTERY_STATUS_CRITICAL@GOTPAGE
Lloh58:
	ldr	x10, [x10, _APM_BATTERY_STATUS_CRITICAL@GOTPAGEOFF]
LBB0_20:
	ldr	w10, [x10]
	ldr	w9, [x9]
	stp	w9, w10, [x0, #8]
LBB0_21:
	stp	w8, w11, [x0]
	ldp	x20, x19, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh55, Lloh56
	.cfi_endproc
                                        ; -- End function
	.comm	_APM_BATTERY_STATUS_UNKNOWN,4,2 ; @APM_BATTERY_STATUS_UNKNOWN
	.comm	_APM_BATTERY_FLAG_UNKNOWN,4,2   ; @APM_BATTERY_FLAG_UNKNOWN
	.comm	_APM_UNITS_MINS,4,2             ; @APM_UNITS_MINS
	.comm	_pmu_power_flags,4,2            ; @pmu_power_flags
	.comm	_PMU_PWR_AC_PRESENT,4,2         ; @PMU_PWR_AC_PRESENT
	.comm	_APM_AC_ONLINE,8,3              ; @APM_AC_ONLINE
	.comm	_APM_AC_OFFLINE,8,3             ; @APM_AC_OFFLINE
	.comm	_pmu_battery_count,4,2          ; @pmu_battery_count
	.comm	_pmu_batteries,8,3              ; @pmu_batteries
	.comm	_PMU_BATT_PRESENT,4,2           ; @PMU_BATT_PRESENT
	.comm	_PMU_BATT_TYPE_MASK,8,3         ; @PMU_BATT_TYPE_MASK
	.comm	_PMU_BATT_CHARGING,4,2          ; @PMU_BATT_CHARGING
	.comm	_PMU_BATT_TYPE_SMART,8,3        ; @PMU_BATT_TYPE_SMART
	.comm	_APM_BATTERY_STATUS_CHARGING,4,2 ; @APM_BATTERY_STATUS_CHARGING
	.comm	_APM_BATTERY_FLAG_CHARGING,4,2  ; @APM_BATTERY_FLAG_CHARGING
	.comm	_APM_CRITICAL,4,2               ; @APM_CRITICAL
	.comm	_APM_BATTERY_STATUS_CRITICAL,4,2 ; @APM_BATTERY_STATUS_CRITICAL
	.comm	_APM_BATTERY_FLAG_CRITICAL,4,2  ; @APM_BATTERY_FLAG_CRITICAL
	.comm	_APM_LOW,4,2                    ; @APM_LOW
	.comm	_APM_BATTERY_STATUS_LOW,4,2     ; @APM_BATTERY_STATUS_LOW
	.comm	_APM_BATTERY_FLAG_LOW,4,2       ; @APM_BATTERY_FLAG_LOW
	.comm	_APM_BATTERY_STATUS_HIGH,4,2    ; @APM_BATTERY_STATUS_HIGH
	.comm	_APM_BATTERY_FLAG_HIGH,4,2      ; @APM_BATTERY_FLAG_HIGH
	.no_dead_strip	_pmu_apm_get_power_status
.subsections_via_symbols
