	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9030_charger_update_state
_da9030_charger_update_state:           ## @da9030_charger_update_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	16(%rdi), %edi
	movq	_DA9030_CHARGE_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_da903x_read
	movl	-12(%rbp), %eax
	movq	_DA9030_CHRG_CHARGER_ENABLE@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	setne	%dl
	movl	%edx, (%rbx)
	movl	%eax, %ecx
	shrl	$3, %ecx
	andl	$15, %ecx
	imull	$100, %ecx, %ecx
	movl	%ecx, 4(%rbx)
	andl	$7, %eax
	imull	$50, %eax, %eax
	addl	$4000, %eax                     ## imm = 0xFA0
	movl	%eax, 8(%rbx)
	leaq	24(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_da9030_read_adc
	movl	16(%rbx), %edi
	movq	_DA9030_FAULT_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%rbx), %rdx
	callq	_da903x_read
	movl	16(%rbx), %edi
	movq	_DA9030_STATUS_CHDET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_da903x_query_status
	movl	%eax, 20(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9030_CHARGE_CONTROL,4,2      ## @DA9030_CHARGE_CONTROL
	.comm	_DA9030_CHRG_CHARGER_ENABLE,4,2 ## @DA9030_CHRG_CHARGER_ENABLE
	.comm	_DA9030_FAULT_LOG,4,2           ## @DA9030_FAULT_LOG
	.comm	_DA9030_STATUS_CHDET,4,2        ## @DA9030_STATUS_CHDET
	.no_dead_strip	_da9030_charger_update_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_update_state
_da9030_charger_update_state:           ; @da9030_charger_update_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, x0
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x8, _DA9030_CHARGE_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DA9030_CHARGE_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_da903x_read
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _DA9030_CHRG_CHARGER_ENABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DA9030_CHRG_CHARGER_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	ubfx	w9, w8, #3, #4
	mov	w10, #100
	mul	w9, w9, w10
	cset	w10, ne
	stp	w10, w9, [x19]
	and	w8, w8, #0x7
	mov	w9, #50
	mul	w8, w8, w9
	add	w8, w8, #4000
	str	w8, [x19, #8]
	add	x1, x19, #24
	mov	x0, x19
	bl	_da9030_read_adc
	ldr	w0, [x19, #16]
Lloh6:
	adrp	x8, _DA9030_FAULT_LOG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DA9030_FAULT_LOG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, x19, #12
	bl	_da903x_read
	ldr	w0, [x19, #16]
Lloh9:
	adrp	x8, _DA9030_STATUS_CHDET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DA9030_STATUS_CHDET@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_da903x_query_status
	str	w0, [x19, #20]
	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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9030_CHARGE_CONTROL,4,2      ; @DA9030_CHARGE_CONTROL
	.comm	_DA9030_CHRG_CHARGER_ENABLE,4,2 ; @DA9030_CHRG_CHARGER_ENABLE
	.comm	_DA9030_FAULT_LOG,4,2           ; @DA9030_FAULT_LOG
	.comm	_DA9030_STATUS_CHDET,4,2        ; @DA9030_STATUS_CHDET
	.no_dead_strip	_da9030_charger_update_state
.subsections_via_symbols
