	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pcxhr_sub_set_clock
_pcxhr_sub_set_clock:                   ## @pcxhr_sub_set_clock
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %r12
	leaq	-64(%rbp), %rdx
	leaq	-60(%rbp), %rcx
	callq	_pcxhr_get_clock_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_13:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpl	$100000, %r14d                  ## imm = 0x186A0
	movl	$2, %eax
	sbbl	$0, %eax
	xorl	%r13d, %r13d
	cmpl	$55000, %r14d                   ## imm = 0xD6D8
	cmovael	%eax, %r13d
	cmpl	%r13d, (%r12)
	jne	LBB0_2
LBB0_6:
	movl	-64(%rbp), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_snd_printdd
	movq	_PCXHR_FREQ_REG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-64(%rbp), %edx
	movq	%r12, %rdi
	movq	%r15, %rcx
	callq	_pcxhr_write_io_num_reg_cont
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	movl	-60(%rbp), %edx
	movl	%edx, 4(%r12)
	movl	(%r12), %eax
	movl	8(%r12), %ecx
	movl	%ecx, 12(%r12)
	cmpl	%r13d, %eax
	je	LBB0_12
## %bb.8:
	movq	_CMD_ACCESS_IO_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdi
	callq	_pcxhr_init_rmh
	movq	_IO_NUM_REG_MUTE_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx
	orl	%eax, (%rcx)
	movq	%r12, %rdi
	callq	_DSP_EXT_CMD_SET
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	-56(%rbp), %rax
	movl	$1, 4(%rax)
	movl	$2, -48(%rbp)
LBB0_10:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_pcxhr_send_msg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.11:
	movl	%r13d, (%r12)
	movl	-60(%rbp), %edx
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_snd_printdd
	jmp	LBB0_13
LBB0_2:
	movq	_CMD_ACCESS_IO_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdi
	callq	_pcxhr_init_rmh
	movq	_IO_NUM_REG_MUTE_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx
	orl	%eax, (%rcx)
	movq	%r12, %rdi
	callq	_DSP_EXT_CMD_SET
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	-56(%rbp), %rax
	movl	$1, 4(%rax)
	movl	$2, -48(%rbp)
LBB0_4:
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_pcxhr_send_msg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:
	movq	_CMD_ACCESS_IO_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_pcxhr_init_rmh
	movq	_IO_NUM_SPEED_RATIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx
	orl	%eax, (%rcx)
	movl	%r13d, 4(%rcx)
	movl	$2, -48(%rbp)
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_pcxhr_send_msg
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_ACCESS_IO_WRITE,4,2        ## @CMD_ACCESS_IO_WRITE
	.comm	_IO_NUM_REG_MUTE_OUT,4,2        ## @IO_NUM_REG_MUTE_OUT
	.comm	_IO_NUM_SPEED_RATIO,4,2         ## @IO_NUM_SPEED_RATIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"clock register : set %x\n"

	.comm	_PCXHR_FREQ_REG_MASK,4,2        ## @PCXHR_FREQ_REG_MASK
	.comm	_CMD_ACCESS_IO_READ,4,2         ## @CMD_ACCESS_IO_READ
L_.str.1:                               ## @.str.1
	.asciz	"pcxhr_sub_set_clock to %dHz (realfreq=%d)\n"

	.no_dead_strip	_pcxhr_sub_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pcxhr_sub_set_clock
_pcxhr_sub_set_clock:                   ; @pcxhr_sub_set_clock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x19, x1
	mov	x20, x0
	add	x2, sp, #28
	add	x3, sp, #24
	bl	_pcxhr_get_clock_reg
	cbz	w0, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_2:
	lsr	w8, w19, #5
	cmp	w8, #3125
	mov	w8, #1
	cinc	w8, w8, hs
	mov	w9, #55000
	cmp	w19, w9
	csel	w22, wzr, w8, lo
	ldr	w8, [x20]
	cmp	w8, w22
	b.ne	LBB0_10
LBB0_3:
	ldr	w1, [sp, #28]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_snd_printdd
Lloh2:
	adrp	x8, _PCXHR_FREQ_REG_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCXHR_FREQ_REG_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	w2, [sp, #28]
	mov	x0, x20
	mov	x3, x21
	bl	_pcxhr_write_io_num_reg_cont
	cbnz	w0, LBB0_1
; %bb.4:
	ldr	w8, [sp, #24]
	str	w8, [x20, #4]
	ldr	w9, [x20, #8]
	str	w9, [x20, #12]
	ldr	w9, [x20]
	cmp	w9, w22
	b.eq	LBB0_9
; %bb.5:
Lloh5:
	adrp	x8, _CMD_ACCESS_IO_READ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CMD_ACCESS_IO_READ@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_pcxhr_init_rmh
Lloh8:
	adrp	x8, _IO_NUM_REG_MUTE_OUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IO_NUM_REG_MUTE_OUT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	mov	x0, x20
	bl	_DSP_EXT_CMD_SET
	cbz	x0, LBB0_7
; %bb.6:
	ldr	x8, [sp, #8]
	mov	w9, #1
	str	w9, [x8, #4]
	mov	w8, #2
	str	w8, [sp, #16]
LBB0_7:
	add	x1, sp, #8
	mov	x0, x20
	bl	_pcxhr_send_msg
	cbnz	w0, LBB0_1
; %bb.8:
	str	w22, [x20]
	ldr	w8, [sp, #24]
LBB0_9:
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_snd_printdd
	mov	w0, #0
	b	LBB0_1
LBB0_10:
Lloh13:
	adrp	x23, _CMD_ACCESS_IO_WRITE@GOTPAGE
Lloh14:
	ldr	x23, [x23, _CMD_ACCESS_IO_WRITE@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x0, sp, #8
	bl	_pcxhr_init_rmh
Lloh15:
	adrp	x8, _IO_NUM_REG_MUTE_OUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IO_NUM_REG_MUTE_OUT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	mov	x0, x20
	bl	_DSP_EXT_CMD_SET
	cbz	x0, LBB0_12
; %bb.11:
	ldr	x8, [sp, #8]
	mov	w9, #1
	str	w9, [x8, #4]
	mov	w8, #2
	str	w8, [sp, #16]
LBB0_12:
	add	x1, sp, #8
	mov	x0, x20
	bl	_pcxhr_send_msg
	cbnz	w0, LBB0_1
; %bb.13:
	ldr	w1, [x23]
	add	x0, sp, #8
	bl	_pcxhr_init_rmh
Lloh18:
	adrp	x8, _IO_NUM_SPEED_RATIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IO_NUM_SPEED_RATIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	stp	w8, w22, [x9]
	mov	w8, #2
	str	w8, [sp, #16]
	add	x1, sp, #8
	mov	x0, x20
	bl	_pcxhr_send_msg
	cbnz	w0, LBB0_1
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_ACCESS_IO_WRITE,4,2        ; @CMD_ACCESS_IO_WRITE
	.comm	_IO_NUM_REG_MUTE_OUT,4,2        ; @IO_NUM_REG_MUTE_OUT
	.comm	_IO_NUM_SPEED_RATIO,4,2         ; @IO_NUM_SPEED_RATIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"clock register : set %x\n"

	.comm	_PCXHR_FREQ_REG_MASK,4,2        ; @PCXHR_FREQ_REG_MASK
	.comm	_CMD_ACCESS_IO_READ,4,2         ; @CMD_ACCESS_IO_READ
l_.str.1:                               ; @.str.1
	.asciz	"pcxhr_sub_set_clock to %dHz (realfreq=%d)\n"

	.no_dead_strip	_pcxhr_sub_set_clock
.subsections_via_symbols
