	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saichan_setspeed
_saichan_setspeed:                      ## @saichan_setspeed
	.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	(%rsi), %rax
	movq	(%rax), %rdi
	movq	_rate_map@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movl	(%r8), %ecx
	xorl	%ebx, %ebx
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.1:
	movq	%r8, %rax
	movl	%ecx, %esi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%edx, %esi
	cmoveq	%rax, %rbx
	movl	4(%rax), %esi
	addq	$4, %rax
	testl	%esi, %esi
	jne	LBB0_2
## %bb.3:
	testq	%rbx, %rbx
	jne	LBB0_10
## %bb.4:
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.5:
	movl	4(%r8), %eax
	movl	%eax, %ebx
	subl	%ecx, %ebx
	sarl	%ebx
	testl	%eax, %eax
	sete	%r9b
	cmovel	%eax, %ebx
	addl	%ecx, %ebx
	cmpl	%edx, %ebx
	jle	LBB0_7
## %bb.6:
	movq	%r8, %rbx
	jmp	LBB0_10
LBB0_7:
	movq	%r8, %rbx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	testb	$1, %r9b
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	8(%rbx), %esi
	movl	%esi, %ecx
	subl	%eax, %ecx
	sarl	%ecx
	testl	%esi, %esi
	cmovel	%esi, %ecx
	sete	%r9b
	addl	%eax, %ecx
	addq	$4, %rbx
	movl	%esi, %eax
	cmpl	%edx, %ecx
	jle	LBB0_8
LBB0_10:
	movq	%rbx, (%rdi)
	callq	_sai_configure_clock
	movl	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_rate_map,8,3                   ## @rate_map
	.no_dead_strip	_saichan_setspeed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saichan_setspeed
_saichan_setspeed:                      ; @saichan_setspeed
	.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	x8, [x1]
	ldr	x0, [x8]
Lloh0:
	adrp	x8, _rate_map@GOTPAGE
Lloh1:
	ldr	x8, [x8, _rate_map@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w9, [x8]
	cbz	w9, LBB0_8
; %bb.1:
	mov	x19, #0
	mov	x10, x8
	mov	x11, x9
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w11, w2
	csel	x19, x10, x19, eq
	ldr	w11, [x10, #4]!
	cbnz	w11, LBB0_2
; %bb.3:
	cbnz	x19, LBB0_9
; %bb.4:
	cbz	w9, LBB0_9
; %bb.5:
	ldr	w10, [x8, #4]
	sub	w11, w10, w9
	asr	w11, w11, #1
	cmp	w10, #0
	csel	w12, wzr, w11, eq
	cset	w11, eq
	add	w9, w12, w9
	mov	x19, x8
	cmp	w9, w2
	b.gt	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	tbnz	w11, #0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x19, #8]
	sub	w9, w8, w10
	asr	w9, w9, #1
	cmp	w8, #0
	csel	w9, wzr, w9, eq
	cset	w11, eq
	add	x19, x19, #4
	add	w9, w9, w10
	cmp	w9, w2
	mov	x10, x8
	b.le	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	x19, #0
LBB0_9:
	str	x19, [x0]
	bl	_sai_configure_clock
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_rate_map,8,3                   ; @rate_map
	.no_dead_strip	_saichan_setspeed
.subsections_via_symbols
