	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9030_charger_check_state
_da9030_charger_check_state:            ## @da9030_charger_check_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_da9030_charger_update_state
	cmpl	$0, 112(%rbx)
	movq	104(%rbx), %rax
	je	LBB0_1
## %bb.4:
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	64(%rbx), %rax
	cmpq	8(%rbx), %rax
	jge	LBB0_6
## %bb.7:
	movq	24(%rbx), %rdx
	cmpq	%rdx, %rax
	jle	LBB0_10
## %bb.8:
	movl	96(%rbx), %edi
	movq	_DA9030_VBATMON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	jmp	LBB0_9
LBB0_1:
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	movq	64(%rbx), %rax
	movl	$1, %r14d
	cmpq	(%rbx), %rax
	jl	LBB0_3
	jmp	LBB0_14
LBB0_6:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_da9030_set_charge
	movl	96(%rbx), %edi
	movq	_DA9030_VBATMON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%rbx), %rdx
LBB0_9:
	callq	_da903x_write
LBB0_10:
	movq	72(%rbx), %rax
	cmpq	32(%rbx), %rax
	jg	LBB0_3
## %bb.11:
	movq	80(%rbx), %rax
	cmpq	40(%rbx), %rax
	jl	LBB0_3
## %bb.12:
	movq	88(%rbx), %rax
	cmpq	48(%rbx), %rax
	jl	LBB0_3
## %bb.13:
	cmpq	56(%rbx), %rax
	jle	LBB0_14
LBB0_3:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_da9030_set_charge              ## TAILCALL
LBB0_14:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9030_VBATMON,4,2             ## @DA9030_VBATMON
	.no_dead_strip	_da9030_charger_check_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9030_charger_check_state
_da9030_charger_check_state:            ; @da9030_charger_check_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_da9030_charger_update_state
	ldr	w9, [x19, #112]
	ldr	x8, [x19, #104]
	cbz	w9, LBB0_5
; %bb.1:
	cbz	x8, LBB0_14
; %bb.2:
	ldr	x8, [x19, #64]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.3:
	ldr	x2, [x19, #24]
	cmp	x8, x2
	b.le	LBB0_10
; %bb.4:
	ldr	w0, [x19, #96]
Lloh0:
	adrp	x8, _DA9030_VBATMON@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DA9030_VBATMON@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	b	LBB0_9
LBB0_5:
	cbz	x8, LBB0_16
; %bb.6:
	ldr	x8, [x19, #64]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ge	LBB0_16
; %bb.7:
	mov	w1, #1
	b	LBB0_15
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	bl	_da9030_set_charge
	ldr	w0, [x19, #96]
Lloh3:
	adrp	x8, _DA9030_VBATMON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DA9030_VBATMON@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x2, [x19, #16]
LBB0_9:
	bl	_da903x_write
LBB0_10:
	ldr	x8, [x19, #72]
	ldr	x9, [x19, #32]
	cmp	x8, x9
	b.gt	LBB0_14
; %bb.11:
	ldr	x8, [x19, #80]
	ldr	x9, [x19, #40]
	cmp	x8, x9
	b.lt	LBB0_14
; %bb.12:
	ldr	x8, [x19, #88]
	ldr	x9, [x19, #48]
	cmp	x8, x9
	b.lt	LBB0_14
; %bb.13:
	ldr	x9, [x19, #56]
	cmp	x8, x9
	b.le	LBB0_16
LBB0_14:
	mov	w1, #0
LBB0_15:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_da9030_set_charge
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9030_VBATMON,4,2             ; @DA9030_VBATMON
	.no_dead_strip	_da9030_charger_check_state
.subsections_via_symbols
