	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pm860x_init_charger
_pm860x_init_charger:                   ## @pm860x_init_charger
	.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	%rdi, %r14
	movl	16(%rdi), %edi
	movq	_PM8607_STATUS_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pm860x_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_FSM_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movq	_STATUS2_CHG@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%ebx, %eax
	setne	%cl
	movl	%ecx, (%r14)
	movl	%ecx, 4(%r14)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_set_charging_fsm
	xorl	%ebx, %ebx
LBB0_2:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PM8607_STATUS_2,4,2            ## @PM8607_STATUS_2
	.comm	_FSM_INIT,4,2                   ## @FSM_INIT
	.comm	_STATUS2_CHG,4,2                ## @STATUS2_CHG
	.no_dead_strip	_pm860x_init_charger
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pm860x_init_charger
_pm860x_init_charger:                   ; @pm860x_init_charger
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x8, _PM8607_STATUS_2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PM8607_STATUS_2@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_pm860x_reg_read
	mov	x20, x0
	tbnz	w0, #31, LBB0_2
; %bb.1:
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
Lloh3:
	adrp	x8, _FSM_INIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FSM_INIT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _STATUS2_CHG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _STATUS2_CHG@GOTPAGEOFF]
	str	w8, [x19, #12]
Lloh8:
	ldr	w8, [x9]
	tst	w8, w20
	cset	w8, ne
	stp	w8, w8, [x19]
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	bl	_set_charging_fsm
	mov	w20, #0
LBB0_2:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PM8607_STATUS_2,4,2            ; @PM8607_STATUS_2
	.comm	_FSM_INIT,4,2                   ; @FSM_INIT
	.comm	_STATUS2_CHG,4,2                ; @STATUS2_CHG
	.no_dead_strip	_pm860x_init_charger
.subsections_via_symbols
