	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9052_bat_check_health
_da9052_bat_check_health:               ## @da9052_bat_check_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
	leaq	-24(%rbp), %rsi
	callq	_da9052_bat_check_presence
	testl	%eax, %eax
	js	LBB0_11
## %bb.1:
	cmpl	$0, -24(%rbp)
	je	LBB0_3
## %bb.2:
	movq	_POWER_SUPPLY_HEALTH_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_10
LBB0_3:
	movl	(%rbx), %eax
	movq	_POWER_SUPPLY_HEALTH_OVERHEAT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_9
## %bb.4:
	leaq	-20(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_da9052_bat_read_capacity
	testl	%eax, %eax
	js	LBB0_11
## %bb.5:
	movl	-20(%rbp), %eax
	movq	_DA9052_BAT_LOW_CAP@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_6
## %bb.7:
	movq	_POWER_SUPPLY_HEALTH_DEAD@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_9:
	movl	%eax, (%r14)
LBB0_10:
	xorl	%eax, %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_SUPPLY_HEALTH_UNKNOWN,4,2 ## @POWER_SUPPLY_HEALTH_UNKNOWN
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ## @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_DA9052_BAT_LOW_CAP,4,2         ## @DA9052_BAT_LOW_CAP
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ## @POWER_SUPPLY_HEALTH_DEAD
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ## @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_da9052_bat_check_health
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9052_bat_check_health
_da9052_bat_check_health:               ; @da9052_bat_check_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
	add	x1, sp, #12
	bl	_da9052_bat_check_presence
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_3
; %bb.2:
	mov	w0, #0
Lloh0:
	adrp	x8, _POWER_SUPPLY_HEALTH_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_UNKNOWN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_7
LBB0_3:
	ldr	w8, [x20]
Lloh3:
	adrp	x9, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _POWER_SUPPLY_HEALTH_OVERHEAT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_6
; %bb.4:
	add	x1, sp, #8
	mov	x0, x20
	bl	_da9052_bat_read_capacity
	tbnz	w0, #31, LBB0_7
; %bb.5:
	ldr	w8, [sp, #8]
Lloh6:
	adrp	x9, _DA9052_BAT_LOW_CAP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DA9052_BAT_LOW_CAP@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGE
Lloh10:
	ldr	x10, [x10, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGEOFF]
Lloh11:
	adrp	x11, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh12:
	ldr	x11, [x11, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
	cmp	w8, w9
	csel	x8, x10, x11, lt
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_6:
	mov	w0, #0
	str	w8, [x19]
LBB0_7:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_SUPPLY_HEALTH_UNKNOWN,4,2 ; @POWER_SUPPLY_HEALTH_UNKNOWN
	.comm	_POWER_SUPPLY_HEALTH_OVERHEAT,4,2 ; @POWER_SUPPLY_HEALTH_OVERHEAT
	.comm	_DA9052_BAT_LOW_CAP,4,2         ; @DA9052_BAT_LOW_CAP
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ; @POWER_SUPPLY_HEALTH_DEAD
	.comm	_POWER_SUPPLY_HEALTH_GOOD,4,2   ; @POWER_SUPPLY_HEALTH_GOOD
	.no_dead_strip	_da9052_bat_check_health
.subsections_via_symbols
