	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9052_bat_check_status
_da9052_bat_check_status:               ## @da9052_bat_check_status
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	$0, -32(%rbp)
	movl	16(%rdi), %edi
	movq	_DA9052_STATUS_A_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rcx
	movl	$2, %edx
	callq	_da9052_group_read
	testl	%eax, %eax
	js	LBB0_14
## %bb.1:
	movl	-32(%rbp), %eax
	movq	_DA9052_STATUSA_DCINSEL@GOTPCREL(%rip), %rsi
	movq	_DA9052_STATUSA_DCINDET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_DA9052_STATUSA_VBUSSEL@GOTPCREL(%rip), %rbx
	movq	_DA9052_STATUSA_VBUSDET@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	testl	%eax, (%rsi)
	setne	%r8b
	testl	%eax, %ecx
	setne	%dl
	testl	%eax, (%rbx)
	setne	%bl
	testl	%eax, %edi
	setne	%sil
	testb	%dl, %r8b
	jne	LBB0_3
## %bb.2:
	andb	%sil, %bl
	jne	LBB0_3
## %bb.8:
	orl	%edi, %ecx
	testl	%eax, %ecx
	je	LBB0_11
## %bb.9:
	movq	_DA9052_CHARGER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	jmp	LBB0_10
LBB0_3:
	movl	-28(%rbp), %eax
	movq	_DA9052_CHARGER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 8(%r15)
	movq	_DA9052_STATUSB_CHGEND@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.4:
	leaq	-40(%rbp), %rsi
	movq	%r15, %rdi
	callq	_da9052_read_chg_current
	testl	%eax, %eax
	js	LBB0_14
## %bb.5:
	leaq	-36(%rbp), %rsi
	movq	%r15, %rdi
	callq	_da9052_read_chgend_current
	testl	%eax, %eax
	js	LBB0_14
## %bb.6:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jge	LBB0_7
LBB0_10:
	movq	_POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_DA9052_NOCHARGER@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	movq	_POWER_SUPPLY_STATUS_DISCHARGING@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	movq	_POWER_SUPPLY_STATUS_CHARGING@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %ecx
	movl	%ecx, (%r15)
	xorl	%eax, %eax
	testq	%r14, %r14
	je	LBB0_14
## %bb.13:
	movl	%ecx, (%r14)
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9052_STATUS_A_REG,4,2        ## @DA9052_STATUS_A_REG
	.comm	_DA9052_STATUSA_DCINSEL,4,2     ## @DA9052_STATUSA_DCINSEL
	.comm	_DA9052_STATUSA_DCINDET,4,2     ## @DA9052_STATUSA_DCINDET
	.comm	_DA9052_STATUSA_VBUSSEL,4,2     ## @DA9052_STATUSA_VBUSSEL
	.comm	_DA9052_STATUSA_VBUSDET,4,2     ## @DA9052_STATUSA_VBUSDET
	.comm	_DA9052_CHARGER,8,3             ## @DA9052_CHARGER
	.comm	_DA9052_STATUSB_CHGEND,4,2      ## @DA9052_STATUSB_CHGEND
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ## @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,8,3 ## @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_DA9052_NOCHARGER,8,3           ## @DA9052_NOCHARGER
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ## @POWER_SUPPLY_STATUS_DISCHARGING
	.no_dead_strip	_da9052_bat_check_status
.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_status
_da9052_bat_check_status:               ; @da9052_bat_check_status
	.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
	str	xzr, [sp, #8]
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x8, _DA9052_STATUS_A_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DA9052_STATUS_A_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	w2, #2
	bl	_da9052_group_read
	tbnz	w0, #31, LBB0_13
; %bb.1:
	ldr	w9, [sp, #8]
Lloh3:
	adrp	x8, _DA9052_STATUSA_DCINSEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DA9052_STATUSA_DCINSEL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w10, w8, w9
Lloh6:
	adrp	x8, _DA9052_STATUSA_DCINDET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DA9052_STATUSA_DCINDET@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x8]
Lloh9:
	adrp	x8, _DA9052_STATUSA_VBUSSEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DA9052_STATUSA_VBUSSEL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x12, _DA9052_STATUSA_VBUSDET@GOTPAGE
Lloh13:
	ldr	x12, [x12, _DA9052_STATUSA_VBUSDET@GOTPAGEOFF]
Lloh14:
	ldr	w12, [x12]
	tst	w8, w9
	cset	w13, ne
	ands	w8, w12, w9
	cset	w12, ne
	ands	w9, w11, w9
	ccmp	w10, #0, #4, ne
	and	w10, w13, w12
	ccmp	w10, #0, #0, eq
	b.eq	LBB0_7
; %bb.2:
	ldr	w8, [sp, #12]
Lloh15:
	adrp	x9, _DA9052_CHARGER@GOTPAGE
Lloh16:
	ldr	x9, [x9, _DA9052_CHARGER@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	str	x9, [x20, #8]
Lloh18:
	adrp	x9, _DA9052_STATUSB_CHGEND@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DA9052_STATUSB_CHGEND@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.3:
	add	x1, sp, #4
	mov	x0, x20
	bl	_da9052_read_chg_current
	tbnz	w0, #31, LBB0_13
; %bb.4:
	mov	x1, sp
	mov	x0, x20
	bl	_da9052_read_chgend_current
	tbnz	w0, #31, LBB0_13
; %bb.5:
	ldp	w9, w8, [sp]
	cmp	w8, w9
	b.lt	LBB0_9
LBB0_6:
Lloh21:
	adrp	x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_CHARGING@GOTPAGEOFF]
	b	LBB0_11
LBB0_7:
	orr	w8, w9, w8
	cbz	w8, LBB0_10
; %bb.8:
Lloh23:
	adrp	x8, _DA9052_CHARGER@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DA9052_CHARGER@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x8, [x20, #8]
LBB0_9:
Lloh26:
	adrp	x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGE
Lloh27:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_NOT_CHARGING@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh28:
	adrp	x8, _DA9052_NOCHARGER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DA9052_NOCHARGER@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	str	x8, [x20, #8]
Lloh31:
	adrp	x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGE
Lloh32:
	ldr	x8, [x8, _POWER_SUPPLY_STATUS_DISCHARGING@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	str	w8, [x20]
	mov	w0, #0
	cbz	x19, LBB0_13
; %bb.12:
	str	w8, [x19]
LBB0_13:
	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	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9052_STATUS_A_REG,4,2        ; @DA9052_STATUS_A_REG
	.comm	_DA9052_STATUSA_DCINSEL,4,2     ; @DA9052_STATUSA_DCINSEL
	.comm	_DA9052_STATUSA_DCINDET,4,2     ; @DA9052_STATUSA_DCINDET
	.comm	_DA9052_STATUSA_VBUSSEL,4,2     ; @DA9052_STATUSA_VBUSSEL
	.comm	_DA9052_STATUSA_VBUSDET,4,2     ; @DA9052_STATUSA_VBUSDET
	.comm	_DA9052_CHARGER,8,3             ; @DA9052_CHARGER
	.comm	_DA9052_STATUSB_CHGEND,4,2      ; @DA9052_STATUSB_CHGEND
	.comm	_POWER_SUPPLY_STATUS_CHARGING,8,3 ; @POWER_SUPPLY_STATUS_CHARGING
	.comm	_POWER_SUPPLY_STATUS_NOT_CHARGING,8,3 ; @POWER_SUPPLY_STATUS_NOT_CHARGING
	.comm	_DA9052_NOCHARGER,8,3           ; @DA9052_NOCHARGER
	.comm	_POWER_SUPPLY_STATUS_DISCHARGING,4,2 ; @POWER_SUPPLY_STATUS_DISCHARGING
	.no_dead_strip	_da9052_bat_check_status
.subsections_via_symbols
