	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcap_adc_read_bank_scaled
_cpcap_adc_read_bank_scaled:            ## @cpcap_adc_read_bank_scaled
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_CPCAP_VENDOR_TI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movl	8(%rbx), %edi
	movq	_CPCAP_REG_ADCAL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movw	$512, %r15w                     ## imm = 0x200
	movw	$512, %ax                       ## imm = 0x200
	subw	-36(%rbp), %ax
	movq	_bank_conversion@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	_CPCAP_ADC_CHG_ISENSE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movw	%ax, (%rcx,%rdx,2)
	movl	8(%rbx), %edi
	movq	_CPCAP_REG_ADCAL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	subw	-36(%rbp), %r15w
	movq	(%r12), %rax
	movq	_CPCAP_ADC_BATTI@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movw	%r15w, (%rax,%rcx,2)
LBB0_4:
	movq	_CPCAP_REG_ADCD0@GOTPCREL(%rip), %rax
	movl	(%r14), %esi
	shll	$2, %esi
	addl	(%rax), %esi
	movl	8(%rbx), %edi
	leaq	4(%r14), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	andl	$1023, 4(%r14)                  ## imm = 0x3FF
	movq	%r14, %rdi
	callq	_cpcap_adc_phase
	movq	%r14, %rdi
	callq	_cpcap_adc_convert
	xorl	%eax, %eax
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CPCAP_VENDOR_TI,8,3            ## @CPCAP_VENDOR_TI
	.comm	_CPCAP_REG_ADCAL1,4,2           ## @CPCAP_REG_ADCAL1
	.comm	_bank_conversion,8,3            ## @bank_conversion
	.comm	_CPCAP_ADC_CHG_ISENSE,8,3       ## @CPCAP_ADC_CHG_ISENSE
	.comm	_CPCAP_REG_ADCAL2,4,2           ## @CPCAP_REG_ADCAL2
	.comm	_CPCAP_ADC_BATTI,8,3            ## @CPCAP_ADC_BATTI
	.comm	_CPCAP_REG_ADCD0,4,2            ## @CPCAP_REG_ADCD0
	.no_dead_strip	_cpcap_adc_read_bank_scaled
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcap_adc_read_bank_scaled
_cpcap_adc_read_bank_scaled:            ; @cpcap_adc_read_bank_scaled
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CPCAP_VENDOR_TI@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CPCAP_VENDOR_TI@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x8, _CPCAP_REG_ADCAL1@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CPCAP_REG_ADCAL1@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_6
; %bb.2:
	ldrh	w8, [sp, #12]
	mov	w21, #512
	sub	w8, w21, w8
Lloh6:
	adrp	x22, _bank_conversion@GOTPAGE
Lloh7:
	ldr	x22, [x22, _bank_conversion@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh8:
	adrp	x10, _CPCAP_ADC_CHG_ISENSE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CPCAP_ADC_CHG_ISENSE@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	strh	w8, [x9, x10, lsl #1]
	ldr	w0, [x20, #8]
Lloh11:
	adrp	x8, _CPCAP_REG_ADCAL2@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CPCAP_REG_ADCAL2@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_6
; %bb.3:
	ldrh	w8, [sp, #12]
	sub	w8, w21, w8
	ldr	x9, [x22]
Lloh14:
	adrp	x10, _CPCAP_ADC_BATTI@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CPCAP_ADC_BATTI@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	strh	w8, [x9, x10, lsl #1]
LBB0_4:
Lloh17:
	adrp	x8, _CPCAP_REG_ADCD0@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CPCAP_REG_ADCD0@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	mov	x2, x19
	ldr	w9, [x2], #4
	add	w1, w8, w9, lsl #2
	ldr	w0, [x20, #8]
	bl	_regmap_read
	cbnz	w0, LBB0_6
; %bb.5:
	ldr	w8, [x19, #4]
	and	w8, w8, #0x3ff
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_cpcap_adc_phase
	mov	x0, x19
	bl	_cpcap_adc_convert
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_CPCAP_VENDOR_TI,8,3            ; @CPCAP_VENDOR_TI
	.comm	_CPCAP_REG_ADCAL1,4,2           ; @CPCAP_REG_ADCAL1
	.comm	_bank_conversion,8,3            ; @bank_conversion
	.comm	_CPCAP_ADC_CHG_ISENSE,8,3       ; @CPCAP_ADC_CHG_ISENSE
	.comm	_CPCAP_REG_ADCAL2,4,2           ; @CPCAP_REG_ADCAL2
	.comm	_CPCAP_ADC_BATTI,8,3            ; @CPCAP_ADC_BATTI
	.comm	_CPCAP_REG_ADCD0,4,2            ; @CPCAP_REG_ADCD0
	.no_dead_strip	_cpcap_adc_read_bank_scaled
.subsections_via_symbols
