	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl4030battery_current
_twl4030battery_current:                ## @twl4030battery_current
	.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
	movl	%edi, %ebx
	movq	_TWL_MODULE_MAIN_CHARGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TWL4030_BCI_BCICTL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-12(%rbp), %rsi
	callq	_twl_i2c_read_u8
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	_TWL4030_BCI_CGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CURR_STEP_SIZE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %ebx
	testl	%eax, -12(%rbp)
	jne	LBB0_2
## %bb.3:
	movq	_CURR_PSR_R2@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_CURR_PSR_R1@GOTPCREL(%rip), %rcx
LBB0_4:
	movl	%ebx, %eax
	cltd
	idivl	(%rcx)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TWL_MODULE_MAIN_CHARGE,4,2     ## @TWL_MODULE_MAIN_CHARGE
	.comm	_TWL4030_BCI_BCICTL1,4,2        ## @TWL4030_BCI_BCICTL1
	.comm	_TWL4030_BCI_CGAIN,4,2          ## @TWL4030_BCI_CGAIN
	.comm	_CURR_STEP_SIZE,4,2             ## @CURR_STEP_SIZE
	.comm	_CURR_PSR_R1,4,2                ## @CURR_PSR_R1
	.comm	_CURR_PSR_R2,4,2                ## @CURR_PSR_R2
	.no_dead_strip	_twl4030battery_current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl4030battery_current
_twl4030battery_current:                ; @twl4030battery_current
	.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
Lloh0:
	adrp	x8, _TWL_MODULE_MAIN_CHARGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TWL_MODULE_MAIN_CHARGE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _TWL4030_BCI_BCICTL1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TWL4030_BCI_BCICTL1@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x1, sp, #12
	bl	_twl_i2c_read_u8
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w8, [sp, #12]
Lloh6:
	adrp	x9, _TWL4030_BCI_CGAIN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TWL4030_BCI_CGAIN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _CURR_STEP_SIZE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _CURR_STEP_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	mul	w10, w10, w19
Lloh12:
	adrp	x11, _CURR_PSR_R2@GOTPAGE
Lloh13:
	ldr	x11, [x11, _CURR_PSR_R2@GOTPAGEOFF]
Lloh14:
	adrp	x12, _CURR_PSR_R1@GOTPAGE
Lloh15:
	ldr	x12, [x12, _CURR_PSR_R1@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x12, eq
	ldr	w8, [x8]
	sdiv	w0, w10, w8
LBB0_2:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_TWL_MODULE_MAIN_CHARGE,4,2     ; @TWL_MODULE_MAIN_CHARGE
	.comm	_TWL4030_BCI_BCICTL1,4,2        ; @TWL4030_BCI_BCICTL1
	.comm	_TWL4030_BCI_CGAIN,4,2          ; @TWL4030_BCI_CGAIN
	.comm	_CURR_STEP_SIZE,4,2             ; @CURR_STEP_SIZE
	.comm	_CURR_PSR_R1,4,2                ; @CURR_PSR_R1
	.comm	_CURR_PSR_R2,4,2                ; @CURR_PSR_R2
	.no_dead_strip	_twl4030battery_current
.subsections_via_symbols
