	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_audio_set_clock           ## -- Begin function r600_audio_set_clock
	.p2align	4, 0x90
_r600_audio_set_clock:                  ## @r600_audio_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	callq	_to_radeon_encoder
	movq	%rax, %r13
	movq	8(%rax), %r14
	movl	(%rbx), %edi
	callq	_to_radeon_crtc
	movq	%rax, %rbx
	movl	(%r13), %edx
	leal	-128(%rdx), %eax
	cmpl	$6, %eax
	jae	LBB0_1
## %bb.3:
	cltq
	leaq	l_switch.table.r600_audio_set_clock(%rip), %rcx
	movl	(%rcx,%rax,4), %esi
	movq	_R600_AUDIO_TIMING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-770, %edx                     ## imm = 0xFCFE
	callq	_WREG32_P
	movq	%r12, %rdi
	callq	_ASIC_IS_DCE4
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EVERGREEN_AUDIO_PLL1_MUL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$480000, %esi                   ## imm = 0x75300
	callq	_WREG32
	movq	_EVERGREEN_AUDIO_PLL1_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%r15d, %r15d
	leal	(%r15,%r15,4), %esi
	callq	_WREG32
	movq	_EVERGREEN_AUDIO_PLL1_UNK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$113, %esi
	callq	_WREG32
	movl	(%rbx), %esi
	movl	$1452, %edi                     ## imm = 0x5AC
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WREG32                         ## TAILCALL
LBB0_1:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_5:
	movl	(%r14), %eax
	cmpl	$1, %eax
	je	LBB0_9
## %bb.6:
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	_R600_AUDIO_PLL1_MUL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2400000, %esi                  ## imm = 0x249F00
	callq	_WREG32
	movq	_R600_AUDIO_PLL1_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	imull	$100, %r15d, %esi
	callq	_WREG32
	movq	_R600_AUDIO_CLK_SRCSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	jmp	LBB0_8
LBB0_9:
	movq	_R600_AUDIO_PLL2_MUL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$2400000, %esi                  ## imm = 0x249F00
	callq	_WREG32
	movq	_R600_AUDIO_PLL2_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	imull	$100, %r15d, %esi
	callq	_WREG32
	movq	_R600_AUDIO_CLK_SRCSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	jmp	LBB0_8
LBB0_10:
	movl	(%r12), %edi
	movl	(%r13), %edx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_R600_AUDIO_TIMING,4,2          ## @R600_AUDIO_TIMING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported encoder type 0x%02X\n"

	.comm	_EVERGREEN_AUDIO_PLL1_MUL,4,2   ## @EVERGREEN_AUDIO_PLL1_MUL
	.comm	_EVERGREEN_AUDIO_PLL1_DIV,4,2   ## @EVERGREEN_AUDIO_PLL1_DIV
	.comm	_EVERGREEN_AUDIO_PLL1_UNK,4,2   ## @EVERGREEN_AUDIO_PLL1_UNK
	.comm	_R600_AUDIO_PLL1_MUL,4,2        ## @R600_AUDIO_PLL1_MUL
	.comm	_R600_AUDIO_PLL1_DIV,4,2        ## @R600_AUDIO_PLL1_DIV
	.comm	_R600_AUDIO_CLK_SRCSEL,4,2      ## @R600_AUDIO_CLK_SRCSEL
	.comm	_R600_AUDIO_PLL2_MUL,4,2        ## @R600_AUDIO_PLL2_MUL
	.comm	_R600_AUDIO_PLL2_DIV,4,2        ## @R600_AUDIO_PLL2_DIV
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported DIG on encoder 0x%02X\n"

	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.r600_audio_set_clock
l_switch.table.r600_audio_set_clock:
	.long	256                             ## 0x100
	.long	256                             ## 0x100
	.long	256                             ## 0x100
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	256                             ## 0x100

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_audio_set_clock           ; -- Begin function r600_audio_set_clock
	.p2align	2
_r600_audio_set_clock:                  ; @r600_audio_set_clock
	.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	x19, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	bl	_to_radeon_encoder
	mov	x22, x0
	ldr	x23, [x0, #8]
	ldr	w0, [x21]
	bl	_to_radeon_crtc
	ldr	w2, [x22]
	sub	w8, w2, #128
	cmp	w8, #6
	b.hs	LBB0_4
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x9, l_switch.table.r600_audio_set_clock@PAGE
Lloh1:
	add	x9, x9, l_switch.table.r600_audio_set_clock@PAGEOFF
	ldr	w1, [x9, w8, sxtw #2]
Lloh2:
	adrp	x8, _R600_AUDIO_TIMING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _R600_AUDIO_TIMING@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	w2, #-770
	bl	_WREG32_P
	mov	x0, x20
	bl	_ASIC_IS_DCE4
	cbz	x0, LBB0_6
; %bb.2:
Lloh5:
	adrp	x8, _EVERGREEN_AUDIO_PLL1_MUL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EVERGREEN_AUDIO_PLL1_MUL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	w1, #21248
	movk	w1, #7, lsl #16
	bl	_WREG32
Lloh8:
	adrp	x8, _EVERGREEN_AUDIO_PLL1_DIV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EVERGREEN_AUDIO_PLL1_DIV@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	add	w8, w19, w19, lsl #2
	lsl	w1, w8, #1
	bl	_WREG32
Lloh11:
	adrp	x8, _EVERGREEN_AUDIO_PLL1_UNK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EVERGREEN_AUDIO_PLL1_UNK@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	w1, #113
	bl	_WREG32
	ldr	w1, [x21]
	mov	w0, #1452
LBB0_3:
	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
	b	_WREG32
LBB0_4:
	ldr	w0, [x20]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	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
	b	_dev_err
LBB0_6:
	ldr	w8, [x23]
	cmp	w8, #1
	b.eq	LBB0_9
; %bb.7:
	cbnz	w8, LBB0_10
; %bb.8:
Lloh16:
	adrp	x8, _R600_AUDIO_PLL1_MUL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _R600_AUDIO_PLL1_MUL@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	w1, #40704
	movk	w1, #36, lsl #16
	bl	_WREG32
Lloh19:
	adrp	x8, _R600_AUDIO_PLL1_DIV@GOTPAGE
Lloh20:
	ldr	x8, [x8, _R600_AUDIO_PLL1_DIV@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	w8, #100
	mul	w1, w19, w8
	bl	_WREG32
Lloh22:
	adrp	x8, _R600_AUDIO_CLK_SRCSEL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _R600_AUDIO_CLK_SRCSEL@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	w1, #0
	b	LBB0_3
LBB0_9:
Lloh25:
	adrp	x8, _R600_AUDIO_PLL2_MUL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _R600_AUDIO_PLL2_MUL@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	w1, #40704
	movk	w1, #36, lsl #16
	bl	_WREG32
Lloh28:
	adrp	x8, _R600_AUDIO_PLL2_DIV@GOTPAGE
Lloh29:
	ldr	x8, [x8, _R600_AUDIO_PLL2_DIV@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	mov	w8, #100
	mul	w1, w19, w8
	bl	_WREG32
Lloh31:
	adrp	x8, _R600_AUDIO_CLK_SRCSEL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _R600_AUDIO_CLK_SRCSEL@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	mov	w1, #1
	b	LBB0_3
LBB0_10:
	ldr	w0, [x20]
	ldr	w2, [x22]
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_R600_AUDIO_TIMING,4,2          ; @R600_AUDIO_TIMING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported encoder type 0x%02X\n"

	.comm	_EVERGREEN_AUDIO_PLL1_MUL,4,2   ; @EVERGREEN_AUDIO_PLL1_MUL
	.comm	_EVERGREEN_AUDIO_PLL1_DIV,4,2   ; @EVERGREEN_AUDIO_PLL1_DIV
	.comm	_EVERGREEN_AUDIO_PLL1_UNK,4,2   ; @EVERGREEN_AUDIO_PLL1_UNK
	.comm	_R600_AUDIO_PLL1_MUL,4,2        ; @R600_AUDIO_PLL1_MUL
	.comm	_R600_AUDIO_PLL1_DIV,4,2        ; @R600_AUDIO_PLL1_DIV
	.comm	_R600_AUDIO_CLK_SRCSEL,4,2      ; @R600_AUDIO_CLK_SRCSEL
	.comm	_R600_AUDIO_PLL2_MUL,4,2        ; @R600_AUDIO_PLL2_MUL
	.comm	_R600_AUDIO_PLL2_DIV,4,2        ; @R600_AUDIO_PLL2_DIV
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported DIG on encoder 0x%02X\n"

	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.r600_audio_set_clock
l_switch.table.r600_audio_set_clock:
	.long	256                             ; 0x100
	.long	256                             ; 0x100
	.long	256                             ; 0x100
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	256                             ; 0x100

.subsections_via_symbols
