	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vlv_set_cdclk
_vlv_set_cdclk:                         ## @vlv_set_cdclk
	.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, %r12
	movl	(%rsi), %r15d
	cmpl	$319999, %r15d                  ## imm = 0x4E1FF
	jle	LBB0_1
## %bb.4:
	cmpl	$320000, %r15d                  ## imm = 0x4E200
	je	LBB0_7
## %bb.5:
	cmpl	$333333, %r15d                  ## imm = 0x51615
	je	LBB0_7
## %bb.6:
	cmpl	$400000, %r15d                  ## imm = 0x61A80
	je	LBB0_7
	jmp	LBB0_3
LBB0_1:
	cmpl	$200000, %r15d                  ## imm = 0x30D40
	je	LBB0_7
## %bb.2:
	cmpl	$266667, %r15d                  ## imm = 0x411AB
	jne	LBB0_3
LBB0_7:
	movl	4(%rsi), %r13d
	movq	_POWER_DOMAIN_DISPLAY_CORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_intel_display_power_get
	movl	%eax, %r14d
	movq	_VLV_IOSF_SB_CCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movl	%eax, %ebx
	movq	_VLV_IOSF_SB_BUNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	_VLV_IOSF_SB_PUNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_vlv_iosf_sb_get
	movq	_PUNIT_REG_DSPSSPM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_vlv_punit_read
	movq	_DSPFREQGUAR_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_DSPFREQGUAR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r13d, %edx
	shll	%cl, %edx
	notl	%esi
	andl	%eax, %esi
	orl	%esi, %edx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_vlv_punit_write
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_vlv_punit_read
	movq	_DSPFREQSTAT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_DSPFREQSTAT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r13d
	xorl	%edi, %edi
	cmpl	%r13d, %eax
	sete	%dil
	movl	$50, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_9:
	movl	$12, %ebx
	cmpl	$400000, %r15d                  ## imm = 0x61A80
	jne	LBB0_12
## %bb.10:
	movl	(%r12), %edi
	addl	%edi, %edi
	movl	$400000, %esi                   ## imm = 0x61A80
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %ebx
	decl	%ebx
	movq	_CCK_DISPLAY_CLOCK_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_vlv_cck_read
	movq	_CCK_FREQUENCY_VALUES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	orl	%ebx, %edx
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_vlv_cck_write
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_vlv_cck_read
	movq	_CCK_FREQUENCY_STATUS@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_CCK_FREQUENCY_STATUS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	xorl	%edi, %edi
	cmpl	%ebx, %eax
	sete	%dil
	movl	$50, %esi
	callq	_wait_for
	movl	$18, %ebx
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_12:
	movq	_BUNIT_REG_BISOC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_vlv_bunit_read
	andl	$-128, %eax
	orl	%eax, %ebx
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_vlv_bunit_write
	movq	_VLV_IOSF_SB_CCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movl	%eax, %ebx
	movq	_VLV_IOSF_SB_BUNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	_VLV_IOSF_SB_PUNIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	orl	%eax, %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_vlv_iosf_sb_put
	movq	%r12, %rdi
	callq	_intel_update_cdclk
	movq	%r12, %rdi
	callq	_vlv_program_pfi_credits
	movq	_POWER_DOMAIN_DISPLAY_CORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_display_power_put        ## TAILCALL
LBB0_3:
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MISSING_CASE                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_DOMAIN_DISPLAY_CORE,4,2  ## @POWER_DOMAIN_DISPLAY_CORE
	.comm	_VLV_IOSF_SB_CCK,4,2            ## @VLV_IOSF_SB_CCK
	.comm	_VLV_IOSF_SB_BUNIT,4,2          ## @VLV_IOSF_SB_BUNIT
	.comm	_VLV_IOSF_SB_PUNIT,4,2          ## @VLV_IOSF_SB_PUNIT
	.comm	_PUNIT_REG_DSPSSPM,4,2          ## @PUNIT_REG_DSPSSPM
	.comm	_DSPFREQGUAR_MASK,4,2           ## @DSPFREQGUAR_MASK
	.comm	_DSPFREQGUAR_SHIFT,4,2          ## @DSPFREQGUAR_SHIFT
	.comm	_DSPFREQSTAT_MASK,4,2           ## @DSPFREQSTAT_MASK
	.comm	_DSPFREQSTAT_SHIFT,4,2          ## @DSPFREQSTAT_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timed out waiting for CDclk change\n"

	.comm	_CCK_DISPLAY_CLOCK_CONTROL,4,2  ## @CCK_DISPLAY_CLOCK_CONTROL
	.comm	_CCK_FREQUENCY_VALUES,4,2       ## @CCK_FREQUENCY_VALUES
	.comm	_CCK_FREQUENCY_STATUS,4,2       ## @CCK_FREQUENCY_STATUS
	.comm	_CCK_FREQUENCY_STATUS_SHIFT,4,2 ## @CCK_FREQUENCY_STATUS_SHIFT
	.comm	_BUNIT_REG_BISOC,4,2            ## @BUNIT_REG_BISOC
	.no_dead_strip	_vlv_set_cdclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vlv_set_cdclk
_vlv_set_cdclk:                         ; @vlv_set_cdclk
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w21, [x1]
	mov	w8, #57855
	movk	w8, #4, lsl #16
	cmp	w21, w8
	b.le	LBB0_8
; %bb.1:
	mov	w8, #57856
	movk	w8, #4, lsl #16
	cmp	w21, w8
	mov	w8, #5653
	movk	w8, #5, lsl #16
	ccmp	w21, w8, #4, ne
	mov	w8, #6784
	movk	w8, #6, lsl #16
	ccmp	w21, w8, #4, ne
	b.ne	LBB0_9
LBB0_2:
	ldr	w26, [x1, #4]
Lloh0:
	adrp	x23, _POWER_DOMAIN_DISPLAY_CORE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _POWER_DOMAIN_DISPLAY_CORE@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_intel_display_power_get
	mov	x20, x0
Lloh2:
	adrp	x24, _VLV_IOSF_SB_CCK@GOTPAGE
Lloh3:
	ldr	x24, [x24, _VLV_IOSF_SB_CCK@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_BIT
	mov	x22, x0
Lloh4:
	adrp	x25, _VLV_IOSF_SB_BUNIT@GOTPAGE
Lloh5:
	ldr	x25, [x25, _VLV_IOSF_SB_BUNIT@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_BIT
	orr	w27, w0, w22
Lloh6:
	adrp	x22, _VLV_IOSF_SB_PUNIT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _VLV_IOSF_SB_PUNIT@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_BIT
	orr	w1, w27, w0
	mov	x0, x19
	bl	_vlv_iosf_sb_get
Lloh8:
	adrp	x27, _PUNIT_REG_DSPSSPM@GOTPAGE
Lloh9:
	ldr	x27, [x27, _PUNIT_REG_DSPSSPM@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x19
	bl	_vlv_punit_read
Lloh10:
	adrp	x8, _DSPFREQGUAR_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DSPFREQGUAR_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh13:
	adrp	x9, _DSPFREQGUAR_SHIFT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _DSPFREQGUAR_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	lsl	w9, w26, w9
	orr	w2, w9, w8
	ldr	w1, [x27]
	mov	x0, x19
	bl	_vlv_punit_write
	ldr	w1, [x27]
	mov	x0, x19
	bl	_vlv_punit_read
Lloh16:
	adrp	x8, _DSPFREQSTAT_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DSPFREQSTAT_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh19:
	adrp	x9, _DSPFREQSTAT_SHIFT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DSPFREQSTAT_SHIFT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	lsl	w9, w26, w9
	cmp	w8, w9
	cset	w0, eq
	mov	w1, #50
	bl	_wait_for
	cbz	x0, LBB0_4
; %bb.3:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_4:
	mov	w8, #6784
	movk	w8, #6, lsl #16
	cmp	w21, w8
	b.ne	LBB0_10
; %bb.5:
	ldr	w8, [x19]
	lsl	w0, w8, #1
	mov	w1, #6784
	movk	w1, #6, lsl #16
	bl	_DIV_ROUND_CLOSEST
	sub	w21, w0, #1
Lloh24:
	adrp	x26, _CCK_DISPLAY_CLOCK_CONTROL@GOTPAGE
Lloh25:
	ldr	x26, [x26, _CCK_DISPLAY_CLOCK_CONTROL@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_vlv_cck_read
Lloh26:
	adrp	x8, _CCK_FREQUENCY_VALUES@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CCK_FREQUENCY_VALUES@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	bic	w8, w0, w8
	orr	w2, w8, w21
	ldr	w1, [x26]
	mov	x0, x19
	bl	_vlv_cck_write
	ldr	w1, [x26]
	mov	x0, x19
	bl	_vlv_cck_read
Lloh29:
	adrp	x8, _CCK_FREQUENCY_STATUS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CCK_FREQUENCY_STATUS@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh32:
	adrp	x9, _CCK_FREQUENCY_STATUS_SHIFT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _CCK_FREQUENCY_STATUS_SHIFT@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	lsl	w9, w21, w9
	cmp	w8, w9
	cset	w0, eq
	mov	w1, #50
	bl	_wait_for
	cbz	x0, LBB0_7
; %bb.6:
Lloh35:
	adrp	x0, l_.str@PAGE
Lloh36:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_7:
	mov	w21, #18
	b	LBB0_11
LBB0_8:
	mov	w8, #3392
	movk	w8, #3, lsl #16
	cmp	w21, w8
	mov	w8, #4523
	movk	w8, #4, lsl #16
	ccmp	w21, w8, #4, ne
	b.eq	LBB0_2
LBB0_9:
	mov	x0, x21
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_MISSING_CASE
LBB0_10:
	mov	w21, #12
LBB0_11:
Lloh37:
	adrp	x26, _BUNIT_REG_BISOC@GOTPAGE
Lloh38:
	ldr	x26, [x26, _BUNIT_REG_BISOC@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_vlv_bunit_read
	and	w8, w0, #0xffffff80
	orr	w2, w8, w21
	ldr	w1, [x26]
	mov	x0, x19
	bl	_vlv_bunit_write
	ldr	w0, [x24]
	bl	_BIT
	mov	x21, x0
	ldr	w0, [x25]
	bl	_BIT
	orr	w21, w0, w21
	ldr	w0, [x22]
	bl	_BIT
	orr	w1, w21, w0
	mov	x0, x19
	bl	_vlv_iosf_sb_put
	mov	x0, x19
	bl	_intel_update_cdclk
	mov	x0, x19
	bl	_vlv_program_pfi_credits
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_intel_display_power_put
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_DOMAIN_DISPLAY_CORE,4,2  ; @POWER_DOMAIN_DISPLAY_CORE
	.comm	_VLV_IOSF_SB_CCK,4,2            ; @VLV_IOSF_SB_CCK
	.comm	_VLV_IOSF_SB_BUNIT,4,2          ; @VLV_IOSF_SB_BUNIT
	.comm	_VLV_IOSF_SB_PUNIT,4,2          ; @VLV_IOSF_SB_PUNIT
	.comm	_PUNIT_REG_DSPSSPM,4,2          ; @PUNIT_REG_DSPSSPM
	.comm	_DSPFREQGUAR_MASK,4,2           ; @DSPFREQGUAR_MASK
	.comm	_DSPFREQGUAR_SHIFT,4,2          ; @DSPFREQGUAR_SHIFT
	.comm	_DSPFREQSTAT_MASK,4,2           ; @DSPFREQSTAT_MASK
	.comm	_DSPFREQSTAT_SHIFT,4,2          ; @DSPFREQSTAT_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timed out waiting for CDclk change\n"

	.comm	_CCK_DISPLAY_CLOCK_CONTROL,4,2  ; @CCK_DISPLAY_CLOCK_CONTROL
	.comm	_CCK_FREQUENCY_VALUES,4,2       ; @CCK_FREQUENCY_VALUES
	.comm	_CCK_FREQUENCY_STATUS,4,2       ; @CCK_FREQUENCY_STATUS
	.comm	_CCK_FREQUENCY_STATUS_SHIFT,4,2 ; @CCK_FREQUENCY_STATUS_SHIFT
	.comm	_BUNIT_REG_BISOC,4,2            ; @BUNIT_REG_BISOC
	.no_dead_strip	_vlv_set_cdclk
.subsections_via_symbols
