	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_spi_ctrl
_get_spi_ctrl:                          ## @get_spi_ctrl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdx, %r9
	movl	(%rdi), %ecx
	leal	-1(%rcx), %edi
	addl	%esi, %esi
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%esi
	cmpl	%edi, %esi
	movl	$1, %ebx
	cmovbel	%eax, %ebx
	testq	%r9, %r9
	je	LBB0_2
## %bb.1:
	addl	$500, %ecx                      ## imm = 0x1F4
	movslq	%ecx, %rax
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	leal	(%rbx,%rbx), %r8d
	addl	$2, %r8d
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r8d
	leaq	L_.str(%rip), %rdi
	movq	%r9, %rsi
	movl	%eax, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_pr_debug
LBB0_2:
	movq	_SPI_CTRL_FASTEST@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rb4xx: %s SPI clock %u kHz (AHB %u kHz / %u)\n"

	.comm	_SPI_CTRL_FASTEST,4,2           ## @SPI_CTRL_FASTEST
	.no_dead_strip	_get_spi_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_spi_ctrl
_get_spi_ctrl:                          ; @get_spi_ctrl
	.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]
	sub	w9, w8, #1
	lsl	w10, w1, #1
	udiv	w11, w9, w10
	cmp	w10, w9
	csinc	w19, w11, wzr, ls
	cbz	x2, LBB0_2
; %bb.1:
	add	w8, w8, #500
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w3, w8, w9
	lsl	w8, w19, #1
	add	w4, w8, #2
	udiv	w8, w3, w4
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x2
	mov	x2, x8
	bl	_pr_debug
LBB0_2:
Lloh2:
	adrp	x8, _SPI_CTRL_FASTEST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SPI_CTRL_FASTEST@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	add	w0, w8, w19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rb4xx: %s SPI clock %u kHz (AHB %u kHz / %u)\n"

	.comm	_SPI_CTRL_FASTEST,4,2           ; @SPI_CTRL_FASTEST
	.no_dead_strip	_get_spi_ctrl
.subsections_via_symbols
