	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function act8945a_get_battery_health
_act8945a_get_battery_health:           ## @act8945a_get_battery_health
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_ACT8945A_APCH_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movq	_ACT8945A_APCH_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_13
## %bb.2:
	movq	_ACT8945A_APCH_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_13
## %bb.3:
	movq	_APCH_STATE_CSTATE@GOTPCREL(%rip), %rax
	movl	-24(%rbp), %edx
	andl	(%rax), %edx
	movq	_APCH_STATE_CSTATE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %edx
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rax
	cmpl	$131, %edx
	jne	LBB0_12
## %bb.4:
	movq	_APCH_CFG_SUSCHG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, -20(%rbp)
	je	LBB0_6
## %bb.5:
	movq	_POWER_SUPPLY_HEALTH_UNKNOWN@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movl	-28(%rbp), %ecx
	movq	_APCH_STATUS_INDAT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_12
## %bb.7:
	movq	_APCH_STATUS_TEMPDAT@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_8
## %bb.9:
	movq	_APCH_STATUS_TIMRDAT@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	jne	LBB0_10
## %bb.11:
	movq	_POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_8:
	movq	_POWER_SUPPLY_HEALTH_OVERHEAT@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_10:
	movq	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ACT8945A_APCH_STATUS,4,2       ## @ACT8945A_APCH_STATUS
	.comm	_ACT8945A_APCH_CFG,4,2          ## @ACT8945A_APCH_CFG
	.comm	_ACT8945A_APCH_STATE,4,2        ## @ACT8945A_APCH_STATE
	.comm	_APCH_STATE_CSTATE,4,2          ## @APCH_STATE_CSTATE
	.comm	_APCH_STATE_CSTATE_SHIFT,4,2    ## @APCH_STATE_CSTATE_SHIFT
	.comm	_APCH_CFG_SUSCHG,4,2            ## @APCH_CFG_SUSCHG
	.comm	_POWER_SUPPLY_HEALTH_UNKNOWN,4,2 ## @POWER_SUPPLY_HEALTH_UNKNOWN
	.comm	_APCH_STATUS_INDAT,4,2          ## @APCH_STATUS_INDAT
	.comm	_APCH_STATUS_TEMPDAT,4,2        ## @APCH_STATUS_TEMPDAT
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ## @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_APCH_STATUS_TIMRDAT,4,2        ## @APCH_STATUS_TIMRDAT
	.comm	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,4,2 ## @POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ## @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ## @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_act8945a_get_battery_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function act8945a_get_battery_health
_act8945a_get_battery_health:           ; @act8945a_get_battery_health
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ACT8945A_APCH_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ACT8945A_APCH_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_11
; %bb.1:
Lloh3:
	adrp	x8, _ACT8945A_APCH_CFG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ACT8945A_APCH_CFG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #4
	mov	x0, x20
	bl	_regmap_read
	tbnz	w0, #31, LBB0_11
; %bb.2:
Lloh6:
	adrp	x8, _ACT8945A_APCH_STATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ACT8945A_APCH_STATE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_regmap_read
	tbnz	w0, #31, LBB0_11
; %bb.3:
Lloh9:
	adrp	x8, _APCH_STATE_CSTATE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _APCH_STATE_CSTATE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [sp, #8]
	and	w8, w9, w8
Lloh12:
	adrp	x9, _APCH_STATE_CSTATE_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _APCH_STATE_CSTATE_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	cmp	w8, #131
	b.ne	LBB0_9
; %bb.4:
	ldr	w8, [sp, #4]
Lloh15:
	adrp	x9, _APCH_CFG_SUSCHG@GOTPAGE
Lloh16:
	ldr	x9, [x9, _APCH_CFG_SUSCHG@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh18:
	adrp	x8, _POWER_SUPPLY_HEALTH_UNKNOWN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_UNKNOWN@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	ldr	w8, [sp, #12]
Lloh20:
	adrp	x9, _APCH_STATUS_INDAT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _APCH_STATUS_INDAT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
Lloh23:
	adrp	x9, _APCH_STATUS_TEMPDAT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _APCH_STATUS_TEMPDAT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.8:
Lloh26:
	adrp	x9, _APCH_STATUS_TIMRDAT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _APCH_STATUS_TIMRDAT@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
Lloh29:
	adrp	x10, _POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPAGE
Lloh30:
	ldr	x10, [x10, _POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE@GOTPAGEOFF]
Lloh31:
	adrp	x11, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGE
Lloh32:
	ldr	x11, [x11, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	b	LBB0_10
LBB0_9:
Lloh33:
	adrp	x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh34:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
LBB0_10:
	mov	w0, #0
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_12:
Lloh35:
	adrp	x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGEOFF]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_ACT8945A_APCH_STATUS,4,2       ; @ACT8945A_APCH_STATUS
	.comm	_ACT8945A_APCH_CFG,4,2          ; @ACT8945A_APCH_CFG
	.comm	_ACT8945A_APCH_STATE,4,2        ; @ACT8945A_APCH_STATE
	.comm	_APCH_STATE_CSTATE,4,2          ; @APCH_STATE_CSTATE
	.comm	_APCH_STATE_CSTATE_SHIFT,4,2    ; @APCH_STATE_CSTATE_SHIFT
	.comm	_APCH_CFG_SUSCHG,4,2            ; @APCH_CFG_SUSCHG
	.comm	_POWER_SUPPLY_HEALTH_UNKNOWN,4,2 ; @POWER_SUPPLY_HEALTH_UNKNOWN
	.comm	_APCH_STATUS_INDAT,4,2          ; @APCH_STATUS_INDAT
	.comm	_APCH_STATUS_TEMPDAT,4,2        ; @APCH_STATUS_TEMPDAT
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ; @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_APCH_STATUS_TIMRDAT,4,2        ; @APCH_STATUS_TIMRDAT
	.comm	_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,4,2 ; @POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE
	.comm	_POWER_SUPPLY_HEALTH_OVERVOLTAGE,4,2 ; @POWER_SUPPLY_HEALTH_OVERVOLTAGE
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ; @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_act8945a_get_battery_health
.subsections_via_symbols
