	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32h7_adc_selfcalib
_stm32h7_adc_selfcalib:                 ## @stm32h7_adc_selfcalib
	.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
	movq	%rdi, %r15
	callq	_iio_priv_to_dev
	movl	$1, %ebx
	cmpq	$0, (%r15)
	jne	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movq	_STM32H7_ADC_CR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_STM32H7_ADCALDIF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stm32_adc_clr_bits
	movl	(%r13), %esi
	movq	_STM32H7_ADCALLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stm32_adc_clr_bits
	movl	(%r13), %esi
	movq	_STM32H7_ADCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stm32_adc_set_bits
	movl	(%r13), %edi
	movq	_STM32H7_ADC_CALIB_TIMEOUT_US@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movl	$1, %edx
	movl	$100, %ecx
	callq	_stm32_adc_readl_poll_timeout
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movl	(%r13), %esi
	movq	_STM32H7_ADCALLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_STM32H7_ADCALDIF@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stm32_adc_set_bits
	movl	(%r13), %esi
	movq	_STM32H7_ADCAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stm32_adc_set_bits
	movl	(%r13), %edi
	movl	(%r12), %r8d
	movl	$1, %edx
	movl	$100, %ecx
	callq	_stm32_adc_readl_poll_timeout
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_5:
	movl	(%r13), %esi
	movq	_STM32H7_ADCALLIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_STM32H7_ADCALDIF@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_stm32_adc_clr_bits
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_STM32H7_ADC_CR,4,2             ## @STM32H7_ADC_CR
	.comm	_STM32H7_ADCALDIF,4,2           ## @STM32H7_ADCALDIF
	.comm	_STM32H7_ADCALLIN,4,2           ## @STM32H7_ADCALLIN
	.comm	_STM32H7_ADCAL,4,2              ## @STM32H7_ADCAL
	.comm	_STM32H7_ADC_CALIB_TIMEOUT_US,4,2 ## @STM32H7_ADC_CALIB_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"calibration failed\n"

	.no_dead_strip	_stm32h7_adc_selfcalib
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32h7_adc_selfcalib
_stm32h7_adc_selfcalib:                 ; @stm32h7_adc_selfcalib
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	bl	_iio_priv_to_dev
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w21, #1
	b	LBB0_6
LBB0_2:
	mov	x20, x0
Lloh0:
	adrp	x22, _STM32H7_ADC_CR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _STM32H7_ADC_CR@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x23, _STM32H7_ADCALDIF@GOTPAGE
Lloh3:
	ldr	x23, [x23, _STM32H7_ADCALDIF@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_stm32_adc_clr_bits
	ldr	w1, [x22]
Lloh4:
	adrp	x24, _STM32H7_ADCALLIN@GOTPAGE
Lloh5:
	ldr	x24, [x24, _STM32H7_ADCALLIN@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_stm32_adc_clr_bits
	ldr	w1, [x22]
Lloh6:
	adrp	x25, _STM32H7_ADCAL@GOTPAGE
Lloh7:
	ldr	x25, [x25, _STM32H7_ADCAL@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x19
	bl	_stm32_adc_set_bits
	ldr	w0, [x22]
Lloh8:
	adrp	x26, _STM32H7_ADC_CALIB_TIMEOUT_US@GOTPAGE
Lloh9:
	ldr	x26, [x26, _STM32H7_ADC_CALIB_TIMEOUT_US@GOTPAGEOFF]
	ldr	w4, [x26]
	mov	w2, #1
	mov	w3, #100
	bl	_stm32_adc_readl_poll_timeout
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	w1, [x22]
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_stm32_adc_set_bits
	ldr	w1, [x22]
	ldr	w2, [x25]
	mov	x0, x19
	bl	_stm32_adc_set_bits
	ldr	w0, [x22]
	ldr	w4, [x26]
	mov	w2, #1
	mov	w3, #100
	bl	_stm32_adc_readl_poll_timeout
	mov	x21, x0
	cbz	w0, LBB0_5
LBB0_4:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_5:
	ldr	w1, [x22]
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_stm32_adc_clr_bits
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_STM32H7_ADC_CR,4,2             ; @STM32H7_ADC_CR
	.comm	_STM32H7_ADCALDIF,4,2           ; @STM32H7_ADCALDIF
	.comm	_STM32H7_ADCALLIN,4,2           ; @STM32H7_ADCALLIN
	.comm	_STM32H7_ADCAL,4,2              ; @STM32H7_ADCAL
	.comm	_STM32H7_ADC_CALIB_TIMEOUT_US,4,2 ; @STM32H7_ADC_CALIB_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"calibration failed\n"

	.no_dead_strip	_stm32h7_adc_selfcalib
.subsections_via_symbols
