	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sca3000_write_raw_samp_freq
_sca3000_write_raw_samp_freq:           ## @sca3000_write_raw_samp_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	(%rdi), %esi
	leaq	-28(%rbp), %rdx
	callq	___sca3000_get_base_freq
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	_SCA3000_REG_CTRL_SEL_OUT_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_sca3000_read_ctrl_reg
	testl	%eax, %eax
	js	LBB0_9
## %bb.2:
	movq	_SCA3000_REG_OUT_CTRL_BUF_DIV_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %eax
	movl	-28(%rbp), %ecx
	movl	%ecx, %esi
	shrl	$31, %esi
	addl	%ecx, %esi
	sarl	%esi
	xorl	%edx, %edx
	cmpl	%r14d, %esi
	jne	LBB0_4
## %bb.3:
	movq	_SCA3000_REG_OUT_CTRL_BUF_DIV_2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_4:
	orl	%eax, %edx
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	cmpl	%r14d, %eax
	jne	LBB0_7
## %bb.5:
	movq	_SCA3000_REG_OUT_CTRL_BUF_DIV_4@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	jmp	LBB0_6
LBB0_7:
	cmpl	%r14d, %ecx
	jne	LBB0_8
LBB0_6:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_sca3000_write_ctrl_reg
	jmp	LBB0_9
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCA3000_REG_CTRL_SEL_OUT_CTRL,4,2 ## @SCA3000_REG_CTRL_SEL_OUT_CTRL
	.comm	_SCA3000_REG_OUT_CTRL_BUF_DIV_MASK,4,2 ## @SCA3000_REG_OUT_CTRL_BUF_DIV_MASK
	.comm	_SCA3000_REG_OUT_CTRL_BUF_DIV_2,4,2 ## @SCA3000_REG_OUT_CTRL_BUF_DIV_2
	.comm	_SCA3000_REG_OUT_CTRL_BUF_DIV_4,4,2 ## @SCA3000_REG_OUT_CTRL_BUF_DIV_4
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sca3000_write_raw_samp_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sca3000_write_raw_samp_freq
_sca3000_write_raw_samp_freq:           ; @sca3000_write_raw_samp_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	w1, [x0]
	add	x2, sp, #12
	bl	___sca3000_get_base_freq
	cbnz	w0, LBB0_7
; %bb.1:
Lloh0:
	adrp	x21, _SCA3000_REG_CTRL_SEL_OUT_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _SCA3000_REG_CTRL_SEL_OUT_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sca3000_read_ctrl_reg
	tbnz	w0, #31, LBB0_7
; %bb.2:
Lloh2:
	adrp	x8, _SCA3000_REG_OUT_CTRL_BUF_DIV_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SCA3000_REG_OUT_CTRL_BUF_DIV_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w9, w0, w8
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x10, _SCA3000_REG_OUT_CTRL_BUF_DIV_2@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SCA3000_REG_OUT_CTRL_BUF_DIV_2@GOTPAGEOFF]
	add	w11, w8, #3
	cmp	w8, #0
	csel	w11, w11, w8, lt
	cinc	w12, w8, lt
Lloh7:
	ldr	w10, [x10]
	cmp	w20, w12, asr #1
	csel	w10, w10, wzr, eq
	orr	w2, w10, w9
	cmp	w20, w11, asr #2
	b.ne	LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _SCA3000_REG_OUT_CTRL_BUF_DIV_4@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SCA3000_REG_OUT_CTRL_BUF_DIV_4@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w2, w8, w2
	b	LBB0_5
LBB0_4:
	cmp	w8, w20
	b.ne	LBB0_6
LBB0_5:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_sca3000_write_ctrl_reg
	b	LBB0_7
LBB0_6:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SCA3000_REG_CTRL_SEL_OUT_CTRL,4,2 ; @SCA3000_REG_CTRL_SEL_OUT_CTRL
	.comm	_SCA3000_REG_OUT_CTRL_BUF_DIV_MASK,4,2 ; @SCA3000_REG_OUT_CTRL_BUF_DIV_MASK
	.comm	_SCA3000_REG_OUT_CTRL_BUF_DIV_2,4,2 ; @SCA3000_REG_OUT_CTRL_BUF_DIV_2
	.comm	_SCA3000_REG_OUT_CTRL_BUF_DIV_4,4,2 ; @SCA3000_REG_OUT_CTRL_BUF_DIV_4
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sca3000_write_raw_samp_freq
.subsections_via_symbols
