	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max14577_get_charger_state
_max14577_get_charger_state:            ## @max14577_get_charger_state
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	movq	_MAX14577_CHG_REG_CHG_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_max14577_read_reg
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	movq	_CHGCTRL2_MBCHOSTEN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %r15
	testl	%ecx, -28(%rbp)
	je	LBB0_7
## %bb.2:
	movq	_MAX14577_CHG_REG_STATUS3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_max14577_read_reg
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movl	-28(%rbp), %ecx
	movq	_STATUS3_CGMBC_MASK@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_7
## %bb.4:
	movq	_STATUS3_EOC_MASK@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	jne	LBB0_5
## %bb.6:
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %r15
	jmp	LBB0_7
LBB0_5:
	movq	_POWER_SUPPLY_STATUS_FULL@GOTPCREL(%rip), %r15
LBB0_7:
	movl	(%r15), %ecx
	movl	%ecx, (%r14)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX14577_CHG_REG_CHG_CTRL2,4,2 ## @MAX14577_CHG_REG_CHG_CTRL2
	.comm	_CHGCTRL2_MBCHOSTEN_MASK,4,2    ## @CHGCTRL2_MBCHOSTEN_MASK
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_MAX14577_CHG_REG_STATUS3,4,2   ## @MAX14577_CHG_REG_STATUS3
	.comm	_STATUS3_CGMBC_MASK,4,2         ## @STATUS3_CGMBC_MASK
	.comm	_STATUS3_EOC_MASK,4,2           ## @STATUS3_EOC_MASK
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ## @POWER_SUPPLY_STATUS_FULL
	.comm	_POWER_SUPPLY_STATUS_CHARGING,4,2 ## @POWER_SUPPLY_STATUS_CHARGING
	.no_dead_strip	_max14577_get_charger_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max14577_get_charger_state
_max14577_get_charger_state:            ; @max14577_get_charger_state
	.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
	ldr	x8, [x0]
	ldr	x20, [x8]
Lloh0:
	adrp	x8, _MAX14577_CHG_REG_CHG_CTRL2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX14577_CHG_REG_CHG_CTRL2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_max14577_read_reg
	tbnz	w0, #31, LBB0_7
; %bb.1:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _CHGCTRL2_MBCHOSTEN_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CHGCTRL2_MBCHOSTEN_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _MAX14577_CHG_REG_STATUS3@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX14577_CHG_REG_STATUS3@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_max14577_read_reg
	tbnz	w0, #31, LBB0_7
; %bb.3:
	ldr	w8, [sp, #12]
Lloh9:
	adrp	x9, _STATUS3_CGMBC_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _STATUS3_CGMBC_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh12:
	adrp	x9, _STATUS3_EOC_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _STATUS3_EOC_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _POWER_SUPPLY_STATUS_FULL@GOTPAGE
Lloh16:
	ldr	x10, [x10, _POWER_SUPPLY_STATUS_FULL@GOTPAGEOFF]
Lloh17:
	adrp	x11, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh18:
	ldr	x11, [x11, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	b	LBB0_6
LBB0_5:
Lloh19:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh20:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX14577_CHG_REG_CHG_CTRL2,4,2 ; @MAX14577_CHG_REG_CHG_CTRL2
	.comm	_CHGCTRL2_MBCHOSTEN_MASK,4,2    ; @CHGCTRL2_MBCHOSTEN_MASK
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.comm	_MAX14577_CHG_REG_STATUS3,4,2   ; @MAX14577_CHG_REG_STATUS3
	.comm	_STATUS3_CGMBC_MASK,4,2         ; @STATUS3_CGMBC_MASK
	.comm	_STATUS3_EOC_MASK,4,2           ; @STATUS3_EOC_MASK
	.comm	_POWER_SUPPLY_STATUS_FULL,4,2   ; @POWER_SUPPLY_STATUS_FULL
	.comm	_POWER_SUPPLY_STATUS_CHARGING,4,2 ; @POWER_SUPPLY_STATUS_CHARGING
	.no_dead_strip	_max14577_get_charger_state
.subsections_via_symbols
