	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vf610_adc_calibration
_vf610_adc_calibration:                 ## @vf610_adc_calibration
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	$0, (%rdi)
	je	LBB0_6
## %bb.1:
	movq	%rdi, %rbx
	movq	_VF610_ADC_AIEN@GOTPCREL(%rip), %rax
	movq	_VF610_ADC_CONV_DISABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_VF610_REG_ADC_HC0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	_VF610_REG_ADC_GC@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_VF610_ADC_CAL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%r14), %rsi
	addq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	leaq	16(%rbx), %rdi
	movq	_VF610_ADC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_3:
	movq	_VF610_REG_ADC_GS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_VF610_ADC_CALF@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movl	4(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_5:
	movl	$0, (%rbx)
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VF610_ADC_AIEN,4,2             ## @VF610_ADC_AIEN
	.comm	_VF610_ADC_CONV_DISABLE,4,2     ## @VF610_ADC_CONV_DISABLE
	.comm	_VF610_REG_ADC_HC0,8,3          ## @VF610_REG_ADC_HC0
	.comm	_VF610_REG_ADC_GC,8,3           ## @VF610_REG_ADC_GC
	.comm	_VF610_ADC_CAL,4,2              ## @VF610_ADC_CAL
	.comm	_VF610_ADC_TIMEOUT,4,2          ## @VF610_ADC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout for adc calibration\n"

	.comm	_VF610_REG_ADC_GS,8,3           ## @VF610_REG_ADC_GS
	.comm	_VF610_ADC_CALF,4,2             ## @VF610_ADC_CALF
L_.str.1:                               ## @.str.1
	.asciz	"ADC calibration failed\n"

	.no_dead_strip	_vf610_adc_calibration
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vf610_adc_calibration
_vf610_adc_calibration:                 ; @vf610_adc_calibration
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _VF610_ADC_AIEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VF610_ADC_AIEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _VF610_ADC_CONV_DISABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VF610_ADC_CONV_DISABLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _VF610_REG_ADC_HC0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VF610_REG_ADC_HC0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x20, _VF610_REG_ADC_GC@GOTPAGE
Lloh10:
	ldr	x20, [x20, _VF610_REG_ADC_GC@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh11:
	adrp	x8, _VF610_ADC_CAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VF610_ADC_CAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w0, w8, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
	add	x0, x19, #16
Lloh14:
	adrp	x8, _VF610_ADC_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VF610_ADC_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_wait_for_completion_timeout
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_3:
	ldr	x8, [x19, #8]
Lloh19:
	adrp	x9, _VF610_REG_ADC_GS@GOTPAGE
Lloh20:
	ldr	x9, [x9, _VF610_REG_ADC_GS@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
Lloh22:
	adrp	x8, _VF610_ADC_CALF@GOTPAGE
Lloh23:
	ldr	x8, [x8, _VF610_ADC_CALF@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x19, #4]
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_5:
	str	wzr, [x19]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_VF610_ADC_AIEN,4,2             ; @VF610_ADC_AIEN
	.comm	_VF610_ADC_CONV_DISABLE,4,2     ; @VF610_ADC_CONV_DISABLE
	.comm	_VF610_REG_ADC_HC0,8,3          ; @VF610_REG_ADC_HC0
	.comm	_VF610_REG_ADC_GC,8,3           ; @VF610_REG_ADC_GC
	.comm	_VF610_ADC_CAL,4,2              ; @VF610_ADC_CAL
	.comm	_VF610_ADC_TIMEOUT,4,2          ; @VF610_ADC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout for adc calibration\n"

	.comm	_VF610_REG_ADC_GS,8,3           ; @VF610_REG_ADC_GS
	.comm	_VF610_ADC_CALF,4,2             ; @VF610_ADC_CALF
l_.str.1:                               ; @.str.1
	.asciz	"ADC calibration failed\n"

	.no_dead_strip	_vf610_adc_calibration
.subsections_via_symbols
