	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chv_set_cdclk
_chv_set_cdclk:                         ## @chv_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, %rbx
	movl	(%rsi), %edi
	cmpl	$319999, %edi                   ## imm = 0x4E1FF
	jg	LBB0_4
## %bb.1:
	cmpl	$200000, %edi                   ## imm = 0x30D40
	je	LBB0_6
## %bb.2:
	cmpl	$266667, %edi                   ## imm = 0x411AB
	je	LBB0_6
	jmp	LBB0_3
LBB0_4:
	cmpl	$320000, %edi                   ## imm = 0x4E200
	je	LBB0_6
## %bb.5:
	cmpl	$333333, %edi                   ## imm = 0x51615
	jne	LBB0_3
LBB0_6:
	movl	4(%rsi), %r12d
	movq	_POWER_DOMAIN_DISPLAY_CORE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_intel_display_power_get
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_vlv_punit_get
	movq	_PUNIT_REG_DSPSSPM@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_vlv_punit_read
	movq	_DSPFREQGUAR_MASK_CHV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_DSPFREQGUAR_SHIFT_CHV@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r12d, %edx
	shll	%cl, %edx
	notl	%esi
	andl	%eax, %esi
	orl	%esi, %edx
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_vlv_punit_write
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_vlv_punit_read
	movq	_DSPFREQSTAT_MASK_CHV@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_DSPFREQSTAT_SHIFT_CHV@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r12d
	xorl	%edi, %edi
	cmpl	%r12d, %eax
	sete	%dil
	movl	$50, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_8:
	movq	%rbx, %rdi
	callq	_vlv_punit_put
	movq	%rbx, %rdi
	callq	_intel_update_cdclk
	movq	%rbx, %rdi
	callq	_vlv_program_pfi_credits
	movl	(%r15), %esi
	movq	%rbx, %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:
	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	_PUNIT_REG_DSPSSPM,4,2          ## @PUNIT_REG_DSPSSPM
	.comm	_DSPFREQGUAR_MASK_CHV,4,2       ## @DSPFREQGUAR_MASK_CHV
	.comm	_DSPFREQGUAR_SHIFT_CHV,4,2      ## @DSPFREQGUAR_SHIFT_CHV
	.comm	_DSPFREQSTAT_MASK_CHV,4,2       ## @DSPFREQSTAT_MASK_CHV
	.comm	_DSPFREQSTAT_SHIFT_CHV,4,2      ## @DSPFREQSTAT_SHIFT_CHV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timed out waiting for CDclk change\n"

	.no_dead_strip	_chv_set_cdclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chv_set_cdclk
_chv_set_cdclk:                         ; @chv_set_cdclk
	.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, x0
	ldr	w0, [x1]
	mov	w8, #57855
	movk	w8, #4, lsl #16
	cmp	w0, w8
	b.gt	LBB0_3
; %bb.1:
	mov	w8, #3392
	movk	w8, #3, lsl #16
	cmp	w0, w8
	mov	w8, #4523
	movk	w8, #4, lsl #16
	ccmp	w0, w8, #4, ne
	b.eq	LBB0_4
LBB0_2:
	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	_MISSING_CASE
LBB0_3:
	mov	w8, #57856
	movk	w8, #4, lsl #16
	cmp	w0, w8
	mov	w8, #5653
	movk	w8, #5, lsl #16
	ccmp	w0, w8, #4, ne
	b.ne	LBB0_2
LBB0_4:
	ldr	w22, [x1, #4]
Lloh0:
	adrp	x21, _POWER_DOMAIN_DISPLAY_CORE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _POWER_DOMAIN_DISPLAY_CORE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_intel_display_power_get
	mov	x20, x0
	mov	x0, x19
	bl	_vlv_punit_get
Lloh2:
	adrp	x23, _PUNIT_REG_DSPSSPM@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PUNIT_REG_DSPSSPM@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_vlv_punit_read
Lloh4:
	adrp	x8, _DSPFREQGUAR_MASK_CHV@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DSPFREQGUAR_MASK_CHV@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh7:
	adrp	x9, _DSPFREQGUAR_SHIFT_CHV@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DSPFREQGUAR_SHIFT_CHV@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	orr	w2, w9, w8
	ldr	w1, [x23]
	mov	x0, x19
	bl	_vlv_punit_write
	ldr	w1, [x23]
	mov	x0, x19
	bl	_vlv_punit_read
Lloh10:
	adrp	x8, _DSPFREQSTAT_MASK_CHV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DSPFREQSTAT_MASK_CHV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh13:
	adrp	x9, _DSPFREQSTAT_SHIFT_CHV@GOTPAGE
Lloh14:
	ldr	x9, [x9, _DSPFREQSTAT_SHIFT_CHV@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	lsl	w9, w22, w9
	cmp	w8, w9
	cset	w0, eq
	mov	w1, #50
	bl	_wait_for
	cbz	x0, LBB0_6
; %bb.5:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_6:
	mov	x0, x19
	bl	_vlv_punit_put
	mov	x0, x19
	bl	_intel_update_cdclk
	mov	x0, x19
	bl	_vlv_program_pfi_credits
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, 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
	b	_intel_display_power_put
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_DOMAIN_DISPLAY_CORE,4,2  ; @POWER_DOMAIN_DISPLAY_CORE
	.comm	_PUNIT_REG_DSPSSPM,4,2          ; @PUNIT_REG_DSPSSPM
	.comm	_DSPFREQGUAR_MASK_CHV,4,2       ; @DSPFREQGUAR_MASK_CHV
	.comm	_DSPFREQGUAR_SHIFT_CHV,4,2      ; @DSPFREQGUAR_SHIFT_CHV
	.comm	_DSPFREQSTAT_MASK_CHV,4,2       ; @DSPFREQSTAT_MASK_CHV
	.comm	_DSPFREQSTAT_SHIFT_CHV,4,2      ; @DSPFREQSTAT_SHIFT_CHV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timed out waiting for CDclk change\n"

	.no_dead_strip	_chv_set_cdclk
.subsections_via_symbols
