	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atombios_crtc_set_pll
_atombios_crtc_set_pll:                 ## @atombios_crtc_set_pll
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_to_radeon_crtc
	movq	%rax, %rbx
	movq	%rax, %r13
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	60(%rbx), %edi
	callq	_to_radeon_encoder
	movq	%rax, %r12
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movl	(%r14), %eax
	movl	%eax, -60(%rbp)
	movl	$0, -52(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -56(%rbp)
	movl	60(%rbx), %edi
	callq	_atombios_get_encoder_mode
	movl	(%rbx), %ecx
	cmpl	$129, %ecx
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movq	%rbx, %r15
	je	LBB0_3
## %bb.1:
	cmpl	$130, %ecx
	jne	LBB0_4
## %bb.2:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	leaq	32(%r14), %rbx
	jmp	LBB0_5
LBB0_3:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	leaq	16(%r14), %rbx
	jmp	LBB0_5
LBB0_4:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rbx
LBB0_5:
	movl	56(%r13), %eax
	movl	%eax, 12(%rbx)
	movl	52(%r13), %eax
	movl	%eax, 8(%rbx)
	movl	48(%r13), %eax
	movl	%eax, 4(%rbx)
	movq	_ATOM_DEVICE_TV_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.6:
	movl	44(%r13), %esi
LBB0_7:
	subq	$8, %rsp
	leaq	-56(%rbp), %rax
	leaq	-60(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	leaq	-52(%rbp), %r9
	movq	%rbx, %rdi
	pushq	%rax
	callq	_radeon_compute_pll_legacy
	jmp	LBB0_10
LBB0_8:
	movq	%r14, %rdi
	callq	_ASIC_IS_AVIVO
	movl	44(%r13), %esi
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	subq	$8, %rsp
	leaq	-56(%rbp), %rax
	leaq	-60(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	leaq	-52(%rbp), %r9
	movq	%rbx, %rdi
	pushq	%rax
	callq	_radeon_compute_pll_avivo
LBB0_10:
	addq	$16, %rsp
	movq	_ATOM_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movl	24(%r13), %ecx
	movq	%r15, %rbx
	addq	$4, %rbx
	movq	%r14, %rdi
	movq	%rbx, %r8
	callq	_atombios_crtc_program_ss
	movl	(%r13), %edx
	movl	24(%r13), %esi
	movl	4(%r12), %r8d
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r9d
	movl	-52(%rbp), %r10d
	movl	-48(%rbp), %r11d
	movq	%r14, %r15
	movl	-44(%rbp), %r14d
	movl	-56(%rbp), %eax
	movl	40(%r13), %r12d
	subq	$8, %rsp
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movl	-76(%rbp), %ecx                 ## 4-byte Reload
	pushq	%rbx
	pushq	32(%r13)
	pushq	%r12
	pushq	%rax
	pushq	%r14
	pushq	%r11
	pushq	%r10
	callq	_atombios_crtc_program_pll
	addq	$64, %rsp
	cmpq	$0, 32(%r13)
	je	LBB0_14
## %bb.11:
	movq	%r15, %rdi
	callq	_ASIC_IS_DCE4
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movl	-48(%rbp), %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	addl	-44(%rbp), %eax
	imull	4(%r13), %eax
	movslq	%eax, %rcx
	imulq	$1759218605, %rcx, %rax         ## imm = 0x68DB8BAD
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$44, %rax
	addl	%edx, %eax
	imulq	$351843721, %rcx, %rdx          ## imm = 0x14F8B589
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$45, %rdx
	addl	%ecx, %edx
	movq	_ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK@GOTPCREL(%rip), %rcx
	movl	%eax, %esi
	subl	%edx, %esi
	andl	(%rcx), %edx
	movq	_ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	movq	_ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %esi
	orl	%edx, %esi
	movl	%esi, 8(%r13)
	movq	_ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	12(%r13), %ecx
	cmpl	$1, %ecx
	movb	$13, %cl
	sbbb	$0, %cl
	shll	%cl, %eax
	imull	-52(%rbp), %eax
	imull	16(%r13), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	imull	$3125, (%rcx), %ecx             ## imm = 0xC35
	movslq	%ecx, %rcx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$37, %rcx
	addl	%edx, %ecx
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%ecx
	movl	%eax, 20(%r13)
LBB0_13:
	movq	_ATOM_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movl	24(%r13), %ecx
	movq	%r15, %rdi
	movq	%rbx, %r8
	callq	_atombios_crtc_program_ss
LBB0_14:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ## @ATOM_DEVICE_TV_SUPPORT
	.comm	_ATOM_DISABLE,4,2               ## @ATOM_DISABLE
	.comm	_ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK,4,2 ## @ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK
	.comm	_ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT,4,2 ## @ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT
	.comm	_ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK,4,2 ## @ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK
	.comm	_ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD,4,2 ## @ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD
	.comm	_ATOM_ENABLE,4,2                ## @ATOM_ENABLE
	.no_dead_strip	_atombios_crtc_set_pll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atombios_crtc_set_pll
_atombios_crtc_set_pll:                 ; @atombios_crtc_set_pll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x1
	mov	x22, x0
	bl	_to_radeon_crtc
	mov	x19, x0
	ldr	x8, [x22]
	ldr	x20, [x8]
	ldr	w0, [x0, #60]
	bl	_to_radeon_encoder
	mov	x26, x0
	ldr	w8, [x23]
	stp	wzr, w8, [sp, #56]
	str	xzr, [sp, #48]
	str	wzr, [sp, #44]
	ldr	w0, [x19, #60]
	bl	_atombios_get_encoder_mode
	mov	x25, x0
	ldr	w8, [x19]
	add	x9, x20, #16
	cmp	w8, #130
	add	x10, x20, #32
	csel	x10, x20, x10, ne
	cmp	w8, #129
	csel	x21, x9, x10, eq
	ldr	w8, [x19, #56]
	str	w8, [x21, #12]
	ldr	d0, [x19, #48]
	stur	d0, [x21, #4]
	ldr	w8, [x26]
Lloh0:
	adrp	x9, _ATOM_DEVICE_TV_SUPPORT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATOM_DEVICE_TV_SUPPORT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	w1, [x19, #44]
LBB0_2:
	add	x2, sp, #60
	add	x3, sp, #52
	add	x4, sp, #48
	add	x5, sp, #56
	add	x6, sp, #44
	mov	x0, x21
	bl	_radeon_compute_pll_legacy
	b	LBB0_5
LBB0_3:
	mov	x0, x20
	bl	_ASIC_IS_AVIVO
	ldr	w1, [x19, #44]
	cbz	x0, LBB0_2
; %bb.4:
	add	x2, sp, #60
	add	x3, sp, #52
	add	x4, sp, #48
	add	x5, sp, #56
	add	x6, sp, #44
	mov	x0, x21
	bl	_radeon_compute_pll_avivo
LBB0_5:
Lloh3:
	adrp	x8, _ATOM_DISABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATOM_DISABLE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x19]
	ldr	w3, [x19, #24]
	add	x24, x19, #4
	mov	x0, x20
	mov	x4, x24
	bl	_atombios_crtc_program_ss
	ldr	w1, [x19, #24]
	ldr	w2, [x19]
	ldr	w4, [x26, #4]
	ldr	w5, [x23]
	ldp	w7, w6, [sp, #52]
	ldp	w9, w8, [sp, #44]
	ldr	w10, [x19, #40]
	ldr	x11, [x19, #32]
	stp	x11, x24, [sp, #16]
	stp	w9, w10, [sp, #4]
	str	w8, [sp]
	mov	x0, x22
	mov	x3, x25
	bl	_atombios_crtc_program_pll
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
; %bb.6:
	mov	x0, x20
	bl	_ASIC_IS_DCE4
	cbz	x0, LBB0_8
; %bb.7:
	ldp	w10, w8, [sp, #48]
	mov	w9, #10
	madd	w8, w8, w9, w10
	ldr	w9, [x19, #4]
	mul	w8, w8, w9
	mov	w9, #35757
	movk	w9, #26843, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	asr	x9, x9, #44
	mov	w11, #46473
	movk	w11, #5368, lsl #16
	smull	x8, w8, w11
	lsr	x11, x8, #63
	asr	x8, x8, #45
Lloh6:
	adrp	x12, _ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK@GOTPAGE
Lloh7:
	ldr	x12, [x12, _ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	add	w8, w8, w11
	and	w11, w8, w12
	add	w9, w9, w10
	sub	w8, w9, w8
Lloh9:
	adrp	x10, _ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	lsl	w8, w8, w10
Lloh12:
	adrp	x10, _ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	and	w8, w8, w10
	orr	w8, w8, w11
	str	w8, [x19, #8]
Lloh15:
	adrp	x8, _ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w10, [sp, #56]
	ldp	w11, w12, [x19, #12]
	tst	w8, w11
	mov	w8, #12
	cinc	w8, w8, ne
	lsl	w8, w9, w8
	mul	w8, w8, w10
	mul	w8, w8, w12
	ldr	w9, [x21]
	mov	w10, #3125
	mul	w9, w9, w10
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	sdiv	w8, w8, w9
	str	w8, [x19, #20]
LBB0_8:
Lloh18:
	adrp	x8, _ATOM_ENABLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ATOM_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w2, [x19]
	ldr	w3, [x19, #24]
	mov	x0, x20
	mov	x4, x24
	bl	_atombios_crtc_program_ss
LBB0_9:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ; @ATOM_DEVICE_TV_SUPPORT
	.comm	_ATOM_DISABLE,4,2               ; @ATOM_DISABLE
	.comm	_ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK,4,2 ; @ATOM_PPLL_SS_AMOUNT_V2_FBDIV_MASK
	.comm	_ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT,4,2 ; @ATOM_PPLL_SS_AMOUNT_V2_NFRAC_SHIFT
	.comm	_ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK,4,2 ; @ATOM_PPLL_SS_AMOUNT_V2_NFRAC_MASK
	.comm	_ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD,4,2 ; @ATOM_PPLL_SS_TYPE_V2_CENTRE_SPREAD
	.comm	_ATOM_ENABLE,4,2                ; @ATOM_ENABLE
	.no_dead_strip	_atombios_crtc_set_pll
.subsections_via_symbols
