	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stfsm_set_freq
_stfsm_set_freq:                        ## @stfsm_set_freq
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	20(%rdi), %edi
	callq	_clk_get_rate
	movl	%eax, %r15d
	leal	(%r14,%r14), %esi
	movl	%eax, %edi
	callq	_DIV_ROUND_UP
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%rax), %ecx
	cmpl	$128, %ecx
	movl	$128, %edx
	cmovll	%ecx, %edx
	testl	%eax, %eax
	movl	$2, %ebx
	cmovgl	%edx, %ebx
	xorl	%eax, %eax
	cmpl	$5, %ebx
	jl	LBB0_3
## %bb.1:
	movl	$1, %eax
	cmpl	$11, %ebx
	jb	LBB0_3
## %bb.2:
	movl	%ebx, %edi
	movl	$10, %esi
	callq	_DIV_ROUND_UP
LBB0_3:
	movl	%eax, (%r12)
	movl	16(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	callq	_dev_dbg
	movq	_SPI_CLOCKDIV@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movl	%ebx, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"emi_clk = %uHZ, spi_freq = %uHZ, clk_div = %u\n"

	.comm	_SPI_CLOCKDIV,8,3               ## @SPI_CLOCKDIV
	.no_dead_strip	_stfsm_set_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stfsm_set_freq
_stfsm_set_freq:                        ; @stfsm_set_freq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_clk_get_rate
	mov	x21, x0
	lsl	w1, w20, #1
	bl	_DIV_ROUND_UP
	lsl	w8, w0, #1
	mov	w9, #128
	cmp	w8, #128
	csel	w8, w8, w9, lt
	mov	w9, #2
	cmp	w0, #1
	csel	w22, w9, w8, lt
	cmp	w22, #5
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_5
LBB0_2:
	cmp	w22, #11
	b.hs	LBB0_4
; %bb.3:
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	mov	x0, x22
	mov	w1, #10
	bl	_DIV_ROUND_UP
LBB0_5:
	str	w0, [x19]
	ldr	w0, [x19, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	mov	x4, x22
	bl	_dev_dbg
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _SPI_CLOCKDIV@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SPI_CLOCKDIV@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_writel
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"emi_clk = %uHZ, spi_freq = %uHZ, clk_div = %u\n"

	.comm	_SPI_CLOCKDIV,8,3               ; @SPI_CLOCKDIV
	.no_dead_strip	_stfsm_set_freq
.subsections_via_symbols
