	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32h7_adc_read_selfcalib
_stm32h7_adc_read_selfcalib:            ## @stm32h7_adc_read_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
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_STM32H7_LINCALFACT_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	testl	%r13d, %r13d
	jle	LBB0_5
## %bb.1:
	movq	_STM32H7_LINCALRDYW6@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	incq	%r13
                                        ## implicit-def: $ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_STM32H7_ADC_CR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_stm32_adc_clr_bits
	movl	(%r14), %edi
	xorl	%edx, %edx
	testl	%r12d, %ebx
	sete	%dl
	movq	_STM32_ADC_TIMEOUT_US@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%ebx, %esi
	movl	$100, %ecx
	callq	_stm32_adc_readl_poll_timeout
	testl	%eax, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-2(%r13), %r14d
	movq	_STM32H7_ADC_CALFACT2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_stm32_adc_readl
	movl	%eax, %ebx
	movq	_STM32H7_LINCALFACT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	(%r15), %rdx
	movl	%eax, (%rdx,%r14,4)
	movq	_STM32H7_LINCALFACT_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	sarl	%cl, %eax
	movl	%eax, (%rdx,%r14,4)
	sarl	%r12d
	decq	%r13
	cmpq	$1, %r13
	jg	LBB0_2
LBB0_5:
	movq	_STM32H7_ADC_CALFACT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_stm32_adc_readl
	movq	_STM32H7_CALFACT_S_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	movq	_STM32H7_CALFACT_S_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	movl	%edx, 8(%r15)
	movq	_STM32H7_CALFACT_D_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_STM32H7_CALFACT_D_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, 12(%r15)
	movl	$1, 16(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STM32H7_LINCALRDYW6,4,2        ## @STM32H7_LINCALRDYW6
	.comm	_STM32H7_LINCALFACT_NUM,4,2     ## @STM32H7_LINCALFACT_NUM
	.comm	_STM32H7_ADC_CR,4,2             ## @STM32H7_ADC_CR
	.comm	_STM32_ADC_TIMEOUT_US,4,2       ## @STM32_ADC_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read calfact\n"

	.comm	_STM32H7_ADC_CALFACT2,4,2       ## @STM32H7_ADC_CALFACT2
	.comm	_STM32H7_LINCALFACT_MASK,4,2    ## @STM32H7_LINCALFACT_MASK
	.comm	_STM32H7_LINCALFACT_SHIFT,4,2   ## @STM32H7_LINCALFACT_SHIFT
	.comm	_STM32H7_ADC_CALFACT,4,2        ## @STM32H7_ADC_CALFACT
	.comm	_STM32H7_CALFACT_S_MASK,4,2     ## @STM32H7_CALFACT_S_MASK
	.comm	_STM32H7_CALFACT_S_SHIFT,4,2    ## @STM32H7_CALFACT_S_SHIFT
	.comm	_STM32H7_CALFACT_D_MASK,4,2     ## @STM32H7_CALFACT_D_MASK
	.comm	_STM32H7_CALFACT_D_SHIFT,4,2    ## @STM32H7_CALFACT_D_SHIFT
	.no_dead_strip	_stm32h7_adc_read_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_read_selfcalib
_stm32h7_adc_read_selfcalib:            ; @stm32h7_adc_read_selfcalib
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_iio_priv_to_dev
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
Lloh0:
	adrp	x8, _STM32H7_LINCALFACT_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STM32H7_LINCALFACT_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
Lloh3:
	adrp	x9, _STM32H7_LINCALRDYW6@GOTPAGE
Lloh4:
	ldr	x9, [x9, _STM32H7_LINCALRDYW6@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x9]
	add	x23, x8, #1
Lloh6:
	adrp	x24, _STM32H7_ADC_CR@GOTPAGE
Lloh7:
	ldr	x24, [x24, _STM32H7_ADC_CR@GOTPAGEOFF]
Lloh8:
	adrp	x25, _STM32_ADC_TIMEOUT_US@GOTPAGE
Lloh9:
	ldr	x25, [x25, _STM32_ADC_TIMEOUT_US@GOTPAGEOFF]
Lloh10:
	adrp	x26, _STM32H7_ADC_CALFACT2@GOTPAGE
Lloh11:
	ldr	x26, [x26, _STM32H7_ADC_CALFACT2@GOTPAGEOFF]
Lloh12:
	adrp	x27, _STM32H7_LINCALFACT_MASK@GOTPAGE
Lloh13:
	ldr	x27, [x27, _STM32H7_LINCALFACT_MASK@GOTPAGEOFF]
Lloh14:
	adrp	x28, _STM32H7_LINCALFACT_SHIFT@GOTPAGE
Lloh15:
	ldr	x28, [x28, _STM32H7_LINCALFACT_SHIFT@GOTPAGEOFF]
                                        ; implicit-def: $w22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x21
	bl	_stm32_adc_clr_bits
	ldr	w0, [x24]
	tst	w22, w21
	cset	w2, eq
	ldr	w4, [x25]
	mov	x1, x22
	mov	w3, #100
	bl	_stm32_adc_readl_poll_timeout
	cbnz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w20, w23, #2
	ldr	w1, [x26]
	mov	x0, x19
	bl	_stm32_adc_readl
	mov	x22, x0
	ldr	w8, [x27]
	and	w8, w8, w0
	ldr	x9, [x19]
	lsl	x10, x20, #2
	str	w8, [x9, x10]
	ldr	w11, [x28]
	asr	w8, w8, w11
	str	w8, [x9, x10]
	asr	w21, w21, #1
	sub	x23, x23, #1
	cmp	x23, #1
	b.gt	LBB0_2
LBB0_4:
Lloh16:
	adrp	x8, _STM32H7_ADC_CALFACT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _STM32H7_ADC_CALFACT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stm32_adc_readl
	mov	w22, #0
Lloh19:
	adrp	x8, _STM32H7_CALFACT_S_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _STM32H7_CALFACT_S_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh22:
	adrp	x9, _STM32H7_CALFACT_S_SHIFT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _STM32H7_CALFACT_S_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh25:
	adrp	x9, _STM32H7_CALFACT_D_MASK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _STM32H7_CALFACT_D_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	and	w9, w9, w0
Lloh28:
	adrp	x10, _STM32H7_CALFACT_D_SHIFT@GOTPAGE
Lloh29:
	ldr	x10, [x10, _STM32H7_CALFACT_D_SHIFT@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	asr	w9, w9, w10
	stp	w8, w9, [x19, #8]
	mov	w8, #1
	str	w8, [x19, #16]
	b	LBB0_6
LBB0_5:
	mov	x22, x0
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_dev_err
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_STM32H7_LINCALRDYW6,4,2        ; @STM32H7_LINCALRDYW6
	.comm	_STM32H7_LINCALFACT_NUM,4,2     ; @STM32H7_LINCALFACT_NUM
	.comm	_STM32H7_ADC_CR,4,2             ; @STM32H7_ADC_CR
	.comm	_STM32_ADC_TIMEOUT_US,4,2       ; @STM32_ADC_TIMEOUT_US
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read calfact\n"

	.comm	_STM32H7_ADC_CALFACT2,4,2       ; @STM32H7_ADC_CALFACT2
	.comm	_STM32H7_LINCALFACT_MASK,4,2    ; @STM32H7_LINCALFACT_MASK
	.comm	_STM32H7_LINCALFACT_SHIFT,4,2   ; @STM32H7_LINCALFACT_SHIFT
	.comm	_STM32H7_ADC_CALFACT,4,2        ; @STM32H7_ADC_CALFACT
	.comm	_STM32H7_CALFACT_S_MASK,4,2     ; @STM32H7_CALFACT_S_MASK
	.comm	_STM32H7_CALFACT_S_SHIFT,4,2    ; @STM32H7_CALFACT_S_SHIFT
	.comm	_STM32H7_CALFACT_D_MASK,4,2     ; @STM32H7_CALFACT_D_MASK
	.comm	_STM32H7_CALFACT_D_SHIFT,4,2    ; @STM32H7_CALFACT_D_SHIFT
	.no_dead_strip	_stm32h7_adc_read_selfcalib
.subsections_via_symbols
