	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function measure_vbatt
_measure_vbatt:                         ## @measure_vbatt
	.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	%rdx, %rbx
	cmpl	$128, %esi
	je	LBB0_4
## %bb.1:
	cmpl	$129, %esi
	jne	LBB0_8
## %bb.2:
	movq	_PM8607_VBAT_MEAS1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_measure_12bit_voltage
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movl	(%rbx), %eax
	leal	(%rax,%rax,2), %eax
	jmp	LBB0_6
LBB0_4:
	movl	(%rdi), %edi
	movq	_PM8607_LDO5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-13(%rbp), %rcx
	movl	$5, %edx
	callq	_pm860x_bulk_read
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:
	movzbl	(%rbx), %eax
	imull	$675, %eax, %eax                ## imm = 0x2A3
	shrl	$9, %eax
LBB0_6:
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PM8607_VBAT_MEAS1,4,2          ## @PM8607_VBAT_MEAS1
	.comm	_PM8607_LDO5,4,2                ## @PM8607_LDO5
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_measure_vbatt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function measure_vbatt
_measure_vbatt:                         ; @measure_vbatt
	.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, x2
	cmp	w1, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w1, #129
	b.ne	LBB0_7
; %bb.2:
Lloh0:
	adrp	x8, _PM8607_VBAT_MEAS1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PM8607_VBAT_MEAS1@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_measure_12bit_voltage
	cbnz	w0, LBB0_8
; %bb.3:
	ldr	w8, [x19]
	add	w8, w8, w8, lsl #1
	b	LBB0_6
LBB0_4:
	ldr	w0, [x0]
Lloh3:
	adrp	x8, _PM8607_LDO5@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PM8607_LDO5@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x3, sp, #11
	mov	w2, #5
	bl	_pm860x_bulk_read
	tbnz	w0, #31, LBB0_8
; %bb.5:
	ldrb	w8, [x19]
	mov	w9, #675
	mul	w8, w8, w9
	lsr	w8, w8, #9
LBB0_6:
	mov	w0, #0
	str	w8, [x19]
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PM8607_VBAT_MEAS1,4,2          ; @PM8607_VBAT_MEAS1
	.comm	_PM8607_LDO5,4,2                ; @PM8607_LDO5
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_measure_vbatt
.subsections_via_symbols
