	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stm32h7_adc_clk_sel
_stm32h7_adc_clk_sel:                   ## @stm32h7_adc_clk_sel
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	cmpq	$0, 24(%rsi)
	je	LBB0_1
## %bb.2:
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	32(%rsi), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.3:
	callq	_clk_get_rate
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r13
	movq	_stm32h7_adc_ckmodes_spec@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_19
## %bb.5:
	movl	$8, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rcx
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	16(%rcx), %rcx
	cmpq	(%rcx), %rax
	jbe	LBB0_15
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r12
	callq	_ARRAY_SIZE
	cltq
	addq	$12, %rbx
	cmpq	%rax, %r12
	jge	LBB0_19
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	$0, -8(%rdi,%rbx)
	jne	LBB0_18
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	(%rdi,%rbx), %esi
	movslq	%esi, %rcx
	movq	%r13, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_14
LBB0_19:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	24(%rbx), %rdi
	callq	_clk_get_rate
	testq	%rax, %rax
	je	LBB0_30
## %bb.20:
	movq	%rax, %r13
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	_stm32h7_adc_ckmodes_spec@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_29
## %bb.21:
	movl	$8, %r15d
	xorl	%r12d, %r12d
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rcx
LBB0_26:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	16(%rbx), %rcx
	cmpq	(%rcx), %rax
	jbe	LBB0_27
LBB0_28:                                ##   in Loop: Header=BB0_22 Depth=1
	incq	%r12
	callq	_ARRAY_SIZE
	cltq
	addq	$12, %r15
	cmpq	%rax, %r12
	jge	LBB0_29
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	_stm32h7_adc_ckmodes_spec@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	-8(%rdi,%r15), %r14d
	testl	%r14d, %r14d
	je	LBB0_28
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	(%rdi,%r15), %esi
	movslq	%esi, %rcx
	movq	%r13, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	jne	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_26
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_29:
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_30:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
LBB0_10:
	movq	%r15, %rdi
LBB0_11:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	movl	%esi, %r13d
	jmp	LBB0_16
LBB0_15:
	movl	%esi, %r13d
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
LBB0_16:
	movl	%r12d, %ecx
	leaq	(%rcx,%rcx,2), %rcx
	movl	4(%rdi,%rcx,4), %ebx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%rax, (%r12)
	movq	_STM32H7_ADC_CCR@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	8(%r12), %rdi
	callq	_readl_relaxed
	movq	_STM32H7_CKMODE_MASK@GOTPCREL(%rip), %rcx
	movq	_STM32H7_PRESC_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_STM32H7_CKMODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r14d, %esi
	shll	%cl, %esi
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %esi
	movq	_STM32H7_PRESC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%esi, %ebx
	movq	(%r15), %rsi
	addq	8(%r12), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	testl	%r14d, %r14d
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.5(%rip), %rcx
	cmoveq	%rax, %rcx
	movq	(%r12), %rax
	shrq	$3, %rax
	movabsq	$2361183241434822607, %rdx      ## imm = 0x20C49BA5E353F7CF
	mulq	%rdx
	movq	%rdx, %r8
	shrq	$4, %r8
	leaq	L_.str.4(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rcx, %rdx
	movl	%r13d, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_dev_dbg
	xorl	%eax, %eax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No 'bus' clock found\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"Invalid adc clock rate: 0\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_stm32h7_adc_ckmodes_spec,8,3   ## @stm32h7_adc_ckmodes_spec
L_.str.2:                               ## @.str.2
	.asciz	"Invalid bus clock rate: 0\n"

L_.str.3:                               ## @.str.3
	.asciz	"adc clk selection failed\n"

	.comm	_STM32H7_ADC_CCR,8,3            ## @STM32H7_ADC_CCR
	.comm	_STM32H7_CKMODE_MASK,4,2        ## @STM32H7_CKMODE_MASK
	.comm	_STM32H7_PRESC_MASK,4,2         ## @STM32H7_PRESC_MASK
	.comm	_STM32H7_CKMODE_SHIFT,4,2       ## @STM32H7_CKMODE_SHIFT
	.comm	_STM32H7_PRESC_SHIFT,4,2        ## @STM32H7_PRESC_SHIFT
L_.str.4:                               ## @.str.4
	.asciz	"Using %s clock/%d source at %ld kHz\n"

L_.str.5:                               ## @.str.5
	.asciz	"bus"

L_.str.6:                               ## @.str.6
	.asciz	"adc"

	.no_dead_strip	_stm32h7_adc_clk_sel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stm32h7_adc_clk_sel
_stm32h7_adc_clk_sel:                   ; @stm32h7_adc_clk_sel
	.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
	ldr	x8, [x1, #24]
	cbz	x8, LBB0_17
; %bb.1:
	mov	x20, x1
	ldr	x0, [x1, #32]
	cbz	x0, LBB0_9
; %bb.2:
	bl	_clk_get_rate
	cbz	x0, LBB0_20
; %bb.3:
	mov	x22, x0
Lloh0:
	adrp	x24, _stm32h7_adc_ckmodes_spec@GOTPAGE
Lloh1:
	ldr	x24, [x24, _stm32h7_adc_ckmodes_spec@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x25, #0
	mov	x23, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	bl	_ARRAY_SIZE
	add	x25, x25, #12
	cmp	x23, w0, sxtw
	b.ge	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x24]
	ldr	w8, [x0, x25]
	cbnz	w8, LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x8, x0, x25
	ldrsw	x21, [x8, #8]
	udiv	x8, x22, x21
	ldr	x9, [x20, #16]
	ldr	x9, [x9]
	cmp	x8, x9
	b.hi	LBB0_5
; %bb.8:
	mov	w22, #0
	b	LBB0_16
LBB0_9:
	ldr	x0, [x20, #24]
	bl	_clk_get_rate
	cbz	x0, LBB0_19
; %bb.10:
	mov	x21, x0
Lloh2:
	adrp	x24, _stm32h7_adc_ckmodes_spec@GOTPAGE
Lloh3:
	ldr	x24, [x24, _stm32h7_adc_ckmodes_spec@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_18
; %bb.11:
	mov	x25, #0
	mov	x23, #0
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x23, x23, #1
	bl	_ARRAY_SIZE
	add	x25, x25, #12
	cmp	x23, w0, sxtw
	b.ge	LBB0_18
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x24]
	ldr	w22, [x0, x25]
	cbz	w22, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x0, x25
	ldrsw	x9, [x8, #8]
	udiv	x8, x21, x9
	ldr	x10, [x20, #16]
	ldr	x10, [x10]
	cmp	x8, x10
	b.hi	LBB0_12
; %bb.15:
	mov	x21, x9
LBB0_16:
	and	x9, x23, #0xffffffff
	mov	w10, #12
	madd	x9, x9, x10, x0
	ldr	w23, [x9, #4]
	str	x8, [x20]
	ldr	x8, [x20, #8]
Lloh4:
	adrp	x24, _STM32H7_ADC_CCR@GOTPAGE
Lloh5:
	ldr	x24, [x24, _STM32H7_ADC_CCR@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh6:
	adrp	x8, _STM32H7_CKMODE_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STM32H7_CKMODE_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _STM32H7_PRESC_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _STM32H7_PRESC_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _STM32H7_CKMODE_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _STM32H7_CKMODE_SHIFT@GOTPAGEOFF]
	bic	w8, w0, w8
Lloh14:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _STM32H7_PRESC_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _STM32H7_PRESC_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	lsl	w9, w23, w9
	orr	w0, w8, w9
	ldr	x8, [x20, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	bl	_writel_relaxed
Lloh18:
	adrp	x8, l_.str.5@PAGE
Lloh19:
	add	x8, x8, l_.str.5@PAGEOFF
Lloh20:
	adrp	x9, l_.str.6@PAGE
Lloh21:
	add	x9, x9, l_.str.6@PAGEOFF
	cmp	w22, #0
	csel	x2, x9, x8, eq
	ldr	x8, [x20]
	lsr	x8, x8, #3
	mov	x9, #63439
	movk	x9, #58195, lsl #16
	movk	x9, #39845, lsl #32
	movk	x9, #8388, lsl #48
	umulh	x8, x8, x9
	lsr	x4, x8, #4
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x3, x21
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_23
LBB0_17:
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh26:
	adrp	x8, _ENOENT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_22
LBB0_18:
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_21
LBB0_19:
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_21
LBB0_20:
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_21:
	mov	x0, x19
	bl	_dev_err
Lloh34:
	adrp	x8, _EINVAL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_23:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No 'bus' clock found\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"Invalid adc clock rate: 0\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_stm32h7_adc_ckmodes_spec,8,3   ; @stm32h7_adc_ckmodes_spec
l_.str.2:                               ; @.str.2
	.asciz	"Invalid bus clock rate: 0\n"

l_.str.3:                               ; @.str.3
	.asciz	"adc clk selection failed\n"

	.comm	_STM32H7_ADC_CCR,8,3            ; @STM32H7_ADC_CCR
	.comm	_STM32H7_CKMODE_MASK,4,2        ; @STM32H7_CKMODE_MASK
	.comm	_STM32H7_PRESC_MASK,4,2         ; @STM32H7_PRESC_MASK
	.comm	_STM32H7_CKMODE_SHIFT,4,2       ; @STM32H7_CKMODE_SHIFT
	.comm	_STM32H7_PRESC_SHIFT,4,2        ; @STM32H7_PRESC_SHIFT
l_.str.4:                               ; @.str.4
	.asciz	"Using %s clock/%d source at %ld kHz\n"

l_.str.5:                               ; @.str.5
	.asciz	"bus"

l_.str.6:                               ; @.str.6
	.asciz	"adc"

	.no_dead_strip	_stm32h7_adc_clk_sel
.subsections_via_symbols
