	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max14577_get_battery_health
_max14577_get_battery_health:           ## @max14577_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	8(%rax), %r15
	movq	_MAX14577_MUIC_REG_STATUS2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_max14577_read_reg
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movq	_STATUS2_CHGTYP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	-36(%rbp), %esi
	movq	_STATUS2_CHGTYP_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %esi
	movl	%esi, -36(%rbp)
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_maxim_get_charger_type
	movq	_MAX14577_CHARGER_TYPE_DEAD_BATTERY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_3
## %bb.2:
	movq	_POWER_SUPPLY_HEALTH_DEAD@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movq	_MAX14577_CHG_REG_STATUS3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_max14577_read_reg
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_8
## %bb.4:
	movq	_STATUS3_OVP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -36(%rbp)
	jne	LBB0_5
## %bb.6:
	movq	_POWER_SUPPLY_HEALTH_GOOD@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_8:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX14577_MUIC_REG_STATUS2,4,2  ## @MAX14577_MUIC_REG_STATUS2
	.comm	_STATUS2_CHGTYP_MASK,4,2        ## @STATUS2_CHGTYP_MASK
	.comm	_STATUS2_CHGTYP_SHIFT,4,2       ## @STATUS2_CHGTYP_SHIFT
	.comm	_MAX14577_CHARGER_TYPE_DEAD_BATTERY,4,2 ## @MAX14577_CHARGER_TYPE_DEAD_BATTERY
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ## @POWER_SUPPLY_HEALTH_DEAD
	.comm	_MAX14577_CHG_REG_STATUS3,4,2   ## @MAX14577_CHG_REG_STATUS3
	.comm	_STATUS3_OVP_MASK,4,2           ## @STATUS3_OVP_MASK
	.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	_max14577_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 max14577_get_battery_health
_max14577_get_battery_health:           ; @max14577_get_battery_health
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x22, x0
	ldr	x8, [x0]
	ldr	x21, [x8, #8]
Lloh0:
	adrp	x8, _MAX14577_MUIC_REG_STATUS2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX14577_MUIC_REG_STATUS2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x21
	bl	_max14577_read_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _STATUS2_CHGTYP_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _STATUS2_CHGTYP_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _STATUS2_CHGTYP_SHIFT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _STATUS2_CHGTYP_SHIFT@GOTPAGEOFF]
	and	w8, w9, w8
Lloh8:
	ldr	w9, [x10]
	asr	w1, w8, w9
	str	w1, [sp, #12]
	ldr	x8, [x22]
	ldr	w0, [x8]
	bl	_maxim_get_charger_type
Lloh9:
	adrp	x8, _MAX14577_CHARGER_TYPE_DEAD_BATTERY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAX14577_CHARGER_TYPE_DEAD_BATTERY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _POWER_SUPPLY_HEALTH_DEAD@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh14:
	adrp	x8, _MAX14577_CHG_REG_STATUS3@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAX14577_CHG_REG_STATUS3@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x21
	bl	_max14577_read_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	w8, [sp, #12]
Lloh17:
	adrp	x9, _STATUS3_OVP_MASK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _STATUS3_OVP_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGE
Lloh21:
	ldr	x10, [x10, _POWER_SUPPLY_HEALTH_OVERVOLTAGE@GOTPAGEOFF]
Lloh22:
	adrp	x11, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGE
Lloh23:
	ldr	x11, [x11, _POWER_SUPPLY_HEALTH_GOOD@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
LBB0_5:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX14577_MUIC_REG_STATUS2,4,2  ; @MAX14577_MUIC_REG_STATUS2
	.comm	_STATUS2_CHGTYP_MASK,4,2        ; @STATUS2_CHGTYP_MASK
	.comm	_STATUS2_CHGTYP_SHIFT,4,2       ; @STATUS2_CHGTYP_SHIFT
	.comm	_MAX14577_CHARGER_TYPE_DEAD_BATTERY,4,2 ; @MAX14577_CHARGER_TYPE_DEAD_BATTERY
	.comm	_POWER_SUPPLY_HEALTH_DEAD,4,2   ; @POWER_SUPPLY_HEALTH_DEAD
	.comm	_MAX14577_CHG_REG_STATUS3,4,2   ; @MAX14577_CHG_REG_STATUS3
	.comm	_STATUS3_OVP_MASK,4,2           ; @STATUS3_OVP_MASK
	.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	_max14577_get_battery_health
.subsections_via_symbols
