	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpcap_adc_setup_calibrate
_cpcap_adc_setup_calibrate:             ## @cpcap_adc_setup_calibrate
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_jiffies@GOTPCREL(%rip), %r12
	movq	(%r12), %r13
	movl	$3000, %edi                     ## imm = 0xBB8
	callq	_msecs_to_jiffies
	movq	%rax, %r14
	movq	_CPCAP_ADC_CHG_ISENSE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_CPCAP_ADC_BATTI@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_13
LBB0_2:
	movq	_CPCAP_BIT_CAL_MODE@GOTPCREL(%rip), %rcx
	movq	_CPCAP_BIT_RAND0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	shll	$4, %ebx
	movq	_CPCAP_BIT_ADA2@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_CPCAP_BIT_ADA1@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_CPCAP_BIT_ADA0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%edx, %ecx
	orl	%esi, %ecx
	andl	%ebx, %ecx
	orl	%eax, %ecx
	movl	%ecx, -44(%rbp)
	movl	(%r15), %edi
	orl	%eax, %edx
	movq	_CPCAP_BIT_ATOX@GOTPCREL(%rip), %rax
	orl	%esi, %edx
	orl	(%rax), %edx
	movq	_CPCAP_BIT_ATO3@GOTPCREL(%rip), %rax
	movq	_CPCAP_BIT_ATO2@GOTPCREL(%rip), %rsi
	orl	(%rax), %edx
	movq	_CPCAP_BIT_ATO1@GOTPCREL(%rip), %rax
	orl	(%rsi), %edx
	movq	_CPCAP_BIT_ATO0@GOTPCREL(%rip), %rsi
	orl	(%rax), %edx
	orl	(%rsi), %edx
	movq	_CPCAP_REG_ADCC1@GOTPCREL(%rip), %rbx
	movq	_CPCAP_BIT_AD_SEL1@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_CPCAP_BIT_RAND1@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	(%rbx), %esi
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movl	(%r15), %edi
	movq	_CPCAP_REG_ADCC2@GOTPCREL(%rip), %rsi
	movq	_CPCAP_BIT_ATOX_PS_FACTOR@GOTPCREL(%rip), %rax
	movq	_CPCAP_BIT_ADC_PS_FACTOR1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	(%rsi), %esi
	movq	_CPCAP_BIT_ADC_PS_FACTOR0@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	movl	(%r15), %edi
	movq	_CPCAP_REG_ADCC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CPCAP_BIT_ADTRIG_DIS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	movl	(%r15), %edi
	movq	_CPCAP_REG_ADCC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CPCAP_BIT_ASC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	jne	LBB0_13
## %bb.6:
	addq	%r13, %r14
	leaq	-44(%rbp), %r13
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %edi
	callq	_schedule_timeout_uninterruptible
	movl	(%r15), %edi
	movq	_CPCAP_REG_ADCC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_CPCAP_BIT_ASC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r12), %rdi
	movq	%r14, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_7
## %bb.10:
	movq	_CPCAP_BIT_ASC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_12
## %bb.11:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_12:
	movl	(%r15), %edi
	movl	(%rbx), %esi
	movq	_CPCAP_BIT_CAL_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_regmap_update_bits
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_CPCAP_ADC_CHG_ISENSE,4,2       ## @CPCAP_ADC_CHG_ISENSE
	.comm	_CPCAP_ADC_BATTI,4,2            ## @CPCAP_ADC_BATTI
	.comm	_CPCAP_BIT_CAL_MODE,4,2         ## @CPCAP_BIT_CAL_MODE
	.comm	_CPCAP_BIT_RAND0,4,2            ## @CPCAP_BIT_RAND0
	.comm	_CPCAP_BIT_ADA2,4,2             ## @CPCAP_BIT_ADA2
	.comm	_CPCAP_BIT_ADA1,4,2             ## @CPCAP_BIT_ADA1
	.comm	_CPCAP_BIT_ADA0,4,2             ## @CPCAP_BIT_ADA0
	.comm	_CPCAP_REG_ADCC1,4,2            ## @CPCAP_REG_ADCC1
	.comm	_CPCAP_BIT_ATOX,4,2             ## @CPCAP_BIT_ATOX
	.comm	_CPCAP_BIT_ATO3,4,2             ## @CPCAP_BIT_ATO3
	.comm	_CPCAP_BIT_ATO2,4,2             ## @CPCAP_BIT_ATO2
	.comm	_CPCAP_BIT_ATO1,4,2             ## @CPCAP_BIT_ATO1
	.comm	_CPCAP_BIT_ATO0,4,2             ## @CPCAP_BIT_ATO0
	.comm	_CPCAP_BIT_AD_SEL1,4,2          ## @CPCAP_BIT_AD_SEL1
	.comm	_CPCAP_BIT_RAND1,4,2            ## @CPCAP_BIT_RAND1
	.comm	_CPCAP_REG_ADCC2,4,2            ## @CPCAP_REG_ADCC2
	.comm	_CPCAP_BIT_ATOX_PS_FACTOR,4,2   ## @CPCAP_BIT_ATOX_PS_FACTOR
	.comm	_CPCAP_BIT_ADC_PS_FACTOR1,4,2   ## @CPCAP_BIT_ADC_PS_FACTOR1
	.comm	_CPCAP_BIT_ADC_PS_FACTOR0,4,2   ## @CPCAP_BIT_ADC_PS_FACTOR0
	.comm	_CPCAP_BIT_ADTRIG_DIS,4,2       ## @CPCAP_BIT_ADTRIG_DIS
	.comm	_CPCAP_BIT_ASC,4,2              ## @CPCAP_BIT_ASC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout waiting for calibration to complete\n"

	.no_dead_strip	_cpcap_adc_setup_calibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpcap_adc_setup_calibrate
_cpcap_adc_setup_calibrate:             ; @cpcap_adc_setup_calibrate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _jiffies@GOTPAGE
Lloh1:
	ldr	x23, [x23, _jiffies@GOTPAGEOFF]
	ldr	x24, [x23]
	mov	w0, #3000
	bl	_msecs_to_jiffies
Lloh2:
	adrp	x8, _CPCAP_ADC_CHG_ISENSE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CPCAP_ADC_CHG_ISENSE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _CPCAP_ADC_BATTI@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CPCAP_ADC_BATTI@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w21
	ccmp	w9, w21, #4, ne
	b.ne	LBB0_12
; %bb.1:
	mov	x20, x0
Lloh8:
	adrp	x22, _CPCAP_BIT_CAL_MODE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _CPCAP_BIT_CAL_MODE@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh10:
	adrp	x9, _CPCAP_BIT_RAND0@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CPCAP_BIT_RAND0@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _CPCAP_BIT_ADA2@GOTPAGE
Lloh14:
	ldr	x10, [x10, _CPCAP_BIT_ADA2@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh15:
	ldr	w9, [x10]
Lloh16:
	adrp	x10, _CPCAP_BIT_ADA1@GOTPAGE
Lloh17:
	ldr	x10, [x10, _CPCAP_BIT_ADA1@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w11, w10, w9
Lloh19:
	adrp	x12, _CPCAP_BIT_ADA0@GOTPAGE
Lloh20:
	ldr	x12, [x12, _CPCAP_BIT_ADA0@GOTPAGEOFF]
Lloh21:
	ldr	w12, [x12]
	orr	w11, w11, w12
	and	w11, w11, w21, lsl #4
	orr	w3, w11, w8
	str	w3, [sp, #12]
	ldr	w0, [x19]
Lloh22:
	adrp	x21, _CPCAP_REG_ADCC1@GOTPAGE
Lloh23:
	ldr	x21, [x21, _CPCAP_REG_ADCC1@GOTPAGEOFF]
Lloh24:
	adrp	x11, _CPCAP_BIT_ATOX@GOTPAGE
Lloh25:
	ldr	x11, [x11, _CPCAP_BIT_ATOX@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh26:
	ldr	w11, [x11]
Lloh27:
	adrp	x13, _CPCAP_BIT_ATO3@GOTPAGE
Lloh28:
	ldr	x13, [x13, _CPCAP_BIT_ATO3@GOTPAGEOFF]
Lloh29:
	adrp	x14, _CPCAP_BIT_ATO2@GOTPAGE
Lloh30:
	ldr	x14, [x14, _CPCAP_BIT_ATO2@GOTPAGEOFF]
Lloh31:
	ldr	w13, [x13]
Lloh32:
	ldr	w14, [x14]
Lloh33:
	adrp	x15, _CPCAP_BIT_ATO1@GOTPAGE
Lloh34:
	ldr	x15, [x15, _CPCAP_BIT_ATO1@GOTPAGEOFF]
Lloh35:
	adrp	x16, _CPCAP_BIT_ATO0@GOTPAGE
Lloh36:
	ldr	x16, [x16, _CPCAP_BIT_ATO0@GOTPAGEOFF]
Lloh37:
	ldr	w15, [x15]
Lloh38:
	ldr	w16, [x16]
Lloh39:
	adrp	x17, _CPCAP_BIT_AD_SEL1@GOTPAGE
Lloh40:
	ldr	x17, [x17, _CPCAP_BIT_AD_SEL1@GOTPAGEOFF]
Lloh41:
	adrp	x2, _CPCAP_BIT_RAND1@GOTPAGE
Lloh42:
	ldr	x2, [x2, _CPCAP_BIT_RAND1@GOTPAGEOFF]
Lloh43:
	ldr	w17, [x17]
Lloh44:
	ldr	w2, [x2]
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w8, w8, w12
	orr	w8, w8, w11
	orr	w8, w8, w13
	orr	w8, w8, w14
	orr	w8, w8, w15
	orr	w8, w8, w16
	orr	w8, w8, w17
	orr	w2, w8, w2
	bl	_regmap_update_bits
	cbnz	w0, LBB0_12
; %bb.2:
	ldr	w0, [x19]
Lloh45:
	adrp	x25, _CPCAP_REG_ADCC2@GOTPAGE
Lloh46:
	ldr	x25, [x25, _CPCAP_REG_ADCC2@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh47:
	adrp	x8, _CPCAP_BIT_ATOX_PS_FACTOR@GOTPAGE
Lloh48:
	ldr	x8, [x8, _CPCAP_BIT_ATOX_PS_FACTOR@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
Lloh50:
	adrp	x9, _CPCAP_BIT_ADC_PS_FACTOR1@GOTPAGE
Lloh51:
	ldr	x9, [x9, _CPCAP_BIT_ADC_PS_FACTOR1@GOTPAGEOFF]
Lloh52:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh53:
	adrp	x9, _CPCAP_BIT_ADC_PS_FACTOR0@GOTPAGE
Lloh54:
	ldr	x9, [x9, _CPCAP_BIT_ADC_PS_FACTOR0@GOTPAGEOFF]
Lloh55:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	w3, #0
	bl	_regmap_update_bits
	cbnz	w0, LBB0_12
; %bb.3:
	ldr	w0, [x19]
	ldr	w1, [x25]
Lloh56:
	adrp	x8, _CPCAP_BIT_ADTRIG_DIS@GOTPAGE
Lloh57:
	ldr	x8, [x8, _CPCAP_BIT_ADTRIG_DIS@GOTPAGEOFF]
Lloh58:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	cbnz	w0, LBB0_12
; %bb.4:
	ldr	w0, [x19]
	ldr	w1, [x25]
Lloh59:
	adrp	x26, _CPCAP_BIT_ASC@GOTPAGE
Lloh60:
	ldr	x26, [x26, _CPCAP_BIT_ASC@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x3, x2
	bl	_regmap_update_bits
	cbnz	w0, LBB0_12
; %bb.5:
	add	x20, x20, x24
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1
	bl	_schedule_timeout_uninterruptible
	ldr	w0, [x19]
	ldr	w1, [x25]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x23]
	mov	x1, x20
	bl	_time_before
	cbnz	x0, LBB0_6
; %bb.9:
	ldr	w8, [sp, #12]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	ldr	w0, [x19, #4]
Lloh61:
	adrp	x1, l_.str@PAGE
Lloh62:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_11:
	ldr	w0, [x19]
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	w3, #0
	bl	_regmap_update_bits
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh43
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh37
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGot	Lloh59, Lloh60
	.loh AdrpAdd	Lloh61, Lloh62
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_CPCAP_ADC_CHG_ISENSE,4,2       ; @CPCAP_ADC_CHG_ISENSE
	.comm	_CPCAP_ADC_BATTI,4,2            ; @CPCAP_ADC_BATTI
	.comm	_CPCAP_BIT_CAL_MODE,4,2         ; @CPCAP_BIT_CAL_MODE
	.comm	_CPCAP_BIT_RAND0,4,2            ; @CPCAP_BIT_RAND0
	.comm	_CPCAP_BIT_ADA2,4,2             ; @CPCAP_BIT_ADA2
	.comm	_CPCAP_BIT_ADA1,4,2             ; @CPCAP_BIT_ADA1
	.comm	_CPCAP_BIT_ADA0,4,2             ; @CPCAP_BIT_ADA0
	.comm	_CPCAP_REG_ADCC1,4,2            ; @CPCAP_REG_ADCC1
	.comm	_CPCAP_BIT_ATOX,4,2             ; @CPCAP_BIT_ATOX
	.comm	_CPCAP_BIT_ATO3,4,2             ; @CPCAP_BIT_ATO3
	.comm	_CPCAP_BIT_ATO2,4,2             ; @CPCAP_BIT_ATO2
	.comm	_CPCAP_BIT_ATO1,4,2             ; @CPCAP_BIT_ATO1
	.comm	_CPCAP_BIT_ATO0,4,2             ; @CPCAP_BIT_ATO0
	.comm	_CPCAP_BIT_AD_SEL1,4,2          ; @CPCAP_BIT_AD_SEL1
	.comm	_CPCAP_BIT_RAND1,4,2            ; @CPCAP_BIT_RAND1
	.comm	_CPCAP_REG_ADCC2,4,2            ; @CPCAP_REG_ADCC2
	.comm	_CPCAP_BIT_ATOX_PS_FACTOR,4,2   ; @CPCAP_BIT_ATOX_PS_FACTOR
	.comm	_CPCAP_BIT_ADC_PS_FACTOR1,4,2   ; @CPCAP_BIT_ADC_PS_FACTOR1
	.comm	_CPCAP_BIT_ADC_PS_FACTOR0,4,2   ; @CPCAP_BIT_ADC_PS_FACTOR0
	.comm	_CPCAP_BIT_ADTRIG_DIS,4,2       ; @CPCAP_BIT_ADTRIG_DIS
	.comm	_CPCAP_BIT_ASC,4,2              ; @CPCAP_BIT_ASC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout waiting for calibration to complete\n"

	.no_dead_strip	_cpcap_adc_setup_calibrate
.subsections_via_symbols
