	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max2175_set_nco_freq
_max2175_set_nco_freq:                  ## @max2175_set_nco_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %eax
	cltd
	idivl	4(%rdi)
	movl	%esi, %r13d
	movl	%esi, %ecx
	negl	%ecx
	cmovsl	%esi, %ecx
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	%edx, %ecx
	jge	LBB0_2
## %bb.1:
	leal	(%r13,%r13), %ebx
	jmp	LBB0_3
LBB0_2:
	movl	%eax, %edx
	subl	%ecx, %edx
	addl	%edx, %edx
	movl	%edx, %ebx
	negl	%ebx
	testl	%r13d, %r13d
	cmovnsl	%edx, %ebx
LBB0_3:
	movl	%ebx, %edi
	shll	$20, %edi
	movl	%eax, %esi
	callq	_max2175_round_closest
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_max2175_poll_csm_ready
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	leal	2097152(%r15), %r12d
	testl	%r13d, %r13d
	cmovnsl	%r15d, %r12d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	movl	%eax, %ebx
	callq	_mxm_dbg
	movl	%r12d, %r8d
	shrl	$16, %r8d
	andl	$31, %r8d
	movq	%r14, %rdi
	movl	$7, %esi
	movl	$4, %edx
	xorl	%ecx, %ecx
	callq	_max2175_write_bits
	movl	%r12d, %edx
	sarl	$8, %edx
	movq	%r14, %rdi
	movl	$8, %esi
	callq	_max2175_write
	movq	%r14, %rdi
	movl	$9, %esi
	movl	%r12d, %edx
	callq	_max2175_write
	movl	%ebx, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"freq %d desired %lld reg %u\n"

	.no_dead_strip	_max2175_set_nco_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max2175_set_nco_freq
_max2175_set_nco_freq:                  ; @max2175_set_nco_freq
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x19, x0
	ldp	w8, w9, [x0]
	sdiv	w1, w8, w9
	cmp	w21, #0
	cneg	w8, w21, mi
	cmp	w1, #0
	cinc	w9, w1, lt
	sub	w10, w1, w8
	lsl	w10, w10, #1
	cmp	w21, #0
	cneg	w10, w10, lt
	lsl	w11, w21, #1
	cmp	w8, w9, asr #1
	csel	w22, w10, w11, ge
	lsl	w0, w22, #20
	bl	_max2175_round_closest
	mov	x23, x0
	mov	x0, x19
	bl	_max2175_poll_csm_ready
	mov	x20, x0
	cbnz	w0, LBB0_2
; %bb.1:
	add	w8, w23, #512, lsl #12          ; =2097152
	cmp	w21, #0
	csel	w23, w8, w23, lt
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	mov	x4, x23
	bl	_mxm_dbg
	ubfx	w4, w23, #16, #5
	mov	x0, x19
	mov	w1, #7
	mov	w2, #4
	mov	w3, #0
	bl	_max2175_write_bits
	asr	w2, w23, #8
	mov	x0, x19
	mov	w1, #8
	bl	_max2175_write
	mov	x0, x19
	mov	w1, #9
	mov	x2, x23
	bl	_max2175_write
LBB0_2:
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"freq %d desired %lld reg %u\n"

	.no_dead_strip	_max2175_set_nco_freq
.subsections_via_symbols
