	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cnl_set_cdclk
_cnl_set_cdclk:                         ## @cnl_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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rsi), %r12d
	movl	4(%rsi), %r13d
	movq	_SKL_PCODE_CDCLK_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SKL_CDCLK_PREPARE_FOR_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SKL_CDCLK_READY_FOR_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %r8d
	movl	$3, %r9d
	callq	_skl_pcode_request
	testl	%eax, %eax
	je	LBB0_1
## %bb.16:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_1:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%r13d, %edi
	movl	%r12d, %esi
	callq	_DIV_ROUND_CLOSEST
	movq	_BXT_CDCLK_CD2X_DIV_SEL_1@GOTPCREL(%rip), %rbx
	cmpl	$2, %eax
	je	LBB0_5
## %bb.2:
	cmpl	$4, %eax
	jne	LBB0_3
## %bb.4:
	movq	_BXT_CDCLK_CD2X_DIV_SEL_2@GOTPCREL(%rip), %rbx
	jmp	LBB0_5
LBB0_3:
	xorl	%edi, %edi
	cmpl	(%r15), %r12d
	setne	%dil
	callq	_WARN_ON
	xorl	%edi, %edi
	testl	%r13d, %r13d
	setne	%dil
	callq	_WARN_ON
LBB0_5:
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r15), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	cmpl	%r13d, %eax
	je	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	callq	_cnl_cdclk_pll_disable
	movl	4(%r15), %eax
LBB0_8:
	cmpl	%r13d, %eax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_cnl_cdclk_pll_enable
LBB0_10:
	movl	%r12d, %edi
	callq	_skl_cdclk_decimal
	movl	%eax, %ebx
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	_INVALID_PIPE@GOTPCREL(%rip), %r12
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	cmpl	%r13d, (%r12)
	jne	LBB0_12
## %bb.11:
	movq	_BXT_CDCLK_CD2X_PIPE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_12:
	movl	%r13d, %edi
	callq	_BXT_CDCLK_CD2X_PIPE
LBB0_13:
	orl	%eax, %ebx
	movq	_CDCLK_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	cmpl	%r13d, (%r12)
	je	LBB0_15
## %bb.14:
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_intel_wait_for_vblank
LBB0_15:
	movq	_SKL_PCODE_CDCLK_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	movq	%r15, %rdi
	callq	_sandybridge_pcode_write
	movq	%r15, %rdi
	callq	_intel_update_cdclk
	movl	8(%r14), %eax
	movl	%eax, 8(%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SKL_PCODE_CDCLK_CONTROL,4,2    ## @SKL_PCODE_CDCLK_CONTROL
	.comm	_SKL_CDCLK_PREPARE_FOR_CHANGE,4,2 ## @SKL_CDCLK_PREPARE_FOR_CHANGE
	.comm	_SKL_CDCLK_READY_FOR_CHANGE,4,2 ## @SKL_CDCLK_READY_FOR_CHANGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to inform PCU about cdclk change (%d)\n"

	.comm	_BXT_CDCLK_CD2X_DIV_SEL_1,4,2   ## @BXT_CDCLK_CD2X_DIV_SEL_1
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_2,4,2   ## @BXT_CDCLK_CD2X_DIV_SEL_2
	.comm	_INVALID_PIPE,4,2               ## @INVALID_PIPE
	.comm	_BXT_CDCLK_CD2X_PIPE_NONE,4,2   ## @BXT_CDCLK_CD2X_PIPE_NONE
	.comm	_CDCLK_CTL,4,2                  ## @CDCLK_CTL
	.no_dead_strip	_cnl_set_cdclk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnl_set_cdclk
_cnl_set_cdclk:                         ; @cnl_set_cdclk
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldp	w22, w23, [x1]
Lloh0:
	adrp	x24, _SKL_PCODE_CDCLK_CONTROL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SKL_PCODE_CDCLK_CONTROL@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x8, _SKL_CDCLK_PREPARE_FOR_CHANGE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SKL_CDCLK_PREPARE_FOR_CHANGE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x8, _SKL_CDCLK_READY_FOR_CHANGE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SKL_CDCLK_READY_FOR_CHANGE@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	mov	x4, x3
	mov	w5, #3
	bl	_skl_pcode_request
	cbz	w0, LBB0_2
; %bb.1:
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_DRM_ERROR
LBB0_2:
	mov	x0, x23
	mov	x1, x22
	bl	_DIV_ROUND_CLOSEST
	cmp	w0, #2
	b.eq	LBB0_6
; %bb.3:
	cmp	w0, #4
	b.ne	LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _BXT_CDCLK_CD2X_DIV_SEL_2@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BXT_CDCLK_CD2X_DIV_SEL_2@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	ldr	w8, [x19]
	cmp	w22, w8
	cset	w0, ne
	bl	_WARN_ON
	cmp	w23, #0
	cset	w0, ne
	bl	_WARN_ON
LBB0_6:
Lloh12:
	adrp	x8, _BXT_CDCLK_CD2X_DIV_SEL_1@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BXT_CDCLK_CD2X_DIV_SEL_1@GOTPAGEOFF]
LBB0_7:
	ldr	w25, [x8]
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_10
; %bb.8:
	cmp	w8, w23
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_cnl_cdclk_pll_disable
	ldr	w8, [x19, #4]
LBB0_10:
	cmp	w8, w23
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x19
	mov	x1, x23
	bl	_cnl_cdclk_pll_enable
LBB0_12:
	mov	x0, x22
	bl	_skl_cdclk_decimal
	orr	w23, w0, w25
Lloh14:
	adrp	x22, _INVALID_PIPE@GOTPAGE
Lloh15:
	ldr	x22, [x22, _INVALID_PIPE@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, w21
	b.ne	LBB0_14
; %bb.13:
Lloh16:
	adrp	x8, _BXT_CDCLK_CD2X_PIPE_NONE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BXT_CDCLK_CD2X_PIPE_NONE@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	b	LBB0_15
LBB0_14:
	mov	x0, x21
	bl	_BXT_CDCLK_CD2X_PIPE
LBB0_15:
	orr	w1, w23, w0
Lloh19:
	adrp	x8, _CDCLK_CTL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CDCLK_CTL@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_I915_WRITE
	ldr	w8, [x22]
	cmp	w8, w21
	b.eq	LBB0_17
; %bb.16:
	mov	x0, x19
	mov	x1, x21
	bl	_intel_wait_for_vblank
LBB0_17:
	ldr	w1, [x24]
	ldr	w2, [x20, #8]
	mov	x0, x19
	bl	_sandybridge_pcode_write
	mov	x0, x19
	bl	_intel_update_cdclk
	ldr	w8, [x20, #8]
	str	w8, [x19, #8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SKL_PCODE_CDCLK_CONTROL,4,2    ; @SKL_PCODE_CDCLK_CONTROL
	.comm	_SKL_CDCLK_PREPARE_FOR_CHANGE,4,2 ; @SKL_CDCLK_PREPARE_FOR_CHANGE
	.comm	_SKL_CDCLK_READY_FOR_CHANGE,4,2 ; @SKL_CDCLK_READY_FOR_CHANGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to inform PCU about cdclk change (%d)\n"

	.comm	_BXT_CDCLK_CD2X_DIV_SEL_1,4,2   ; @BXT_CDCLK_CD2X_DIV_SEL_1
	.comm	_BXT_CDCLK_CD2X_DIV_SEL_2,4,2   ; @BXT_CDCLK_CD2X_DIV_SEL_2
	.comm	_INVALID_PIPE,4,2               ; @INVALID_PIPE
	.comm	_BXT_CDCLK_CD2X_PIPE_NONE,4,2   ; @BXT_CDCLK_CD2X_PIPE_NONE
	.comm	_CDCLK_CTL,4,2                  ; @CDCLK_CTL
	.no_dead_strip	_cnl_set_cdclk
.subsections_via_symbols
