	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hsw_restore_lcpll
_hsw_restore_lcpll:                     ## @hsw_restore_lcpll
	.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, %r15
	movq	_LCPLL_CTL@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_I915_READ
	movl	%eax, %ebx
	movq	_LCPLL_PLL_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_LCPLL_PLL_DISABLE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	orl	%eax, %ecx
	movq	_LCPLL_CD_SOURCE_FCLK@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movq	_LCPLL_POWER_DOWN_ALLOW@GOTPCREL(%rip), %r14
	orl	(%r14), %ecx
	andl	%ebx, %ecx
	cmpl	%eax, %ecx
	jne	LBB0_1
## %bb.9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	4(%r15), %rdi
	movq	_FORCEWAKE_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_intel_uncore_forcewake_get
	movl	(%r14), %eax
	testl	%ebx, %eax
	je	LBB0_3
## %bb.2:
	notl	%eax
	andl	%eax, %ebx
	movl	(%r13), %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	movl	(%r13), %edi
	callq	_POSTING_READ
LBB0_3:
	movq	%r15, %rdi
	callq	_hsw_read_dcomp
	movq	_D_COMP_COMP_FORCE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_D_COMP_COMP_DISABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movq	%r15, %rdi
	callq	_hsw_write_dcomp
	movl	(%r13), %edi
	callq	_I915_READ
	movl	(%r12), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movl	(%r13), %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	movl	(%r13), %esi
	movq	_LCPLL_PLL_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$5, %ecx
	callq	_intel_de_wait_for_set
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_5:
	movq	_LCPLL_CD_SOURCE_FCLK@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_8
## %bb.6:
	movq	%rax, %rbx
	movl	(%r13), %edi
	callq	_I915_READ
	movl	(%rbx), %esi
	notl	%esi
	andl	%eax, %esi
	movl	(%r13), %edi
	callq	_I915_WRITE
	movl	(%r13), %edi
	callq	_I915_READ
	movq	_LCPLL_CD_SOURCE_FCLK_DONE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %eax
	sete	%dil
	movl	$1, %esi
	callq	_wait_for_us
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_8:
	movq	_FORCEWAKE_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_intel_uncore_forcewake_put
	movq	%r15, %rdi
	callq	_intel_update_cdclk
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_intel_dump_cdclk_state         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_LCPLL_CTL,4,2                  ## @LCPLL_CTL
	.comm	_LCPLL_PLL_LOCK,4,2             ## @LCPLL_PLL_LOCK
	.comm	_LCPLL_PLL_DISABLE,4,2          ## @LCPLL_PLL_DISABLE
	.comm	_LCPLL_CD_SOURCE_FCLK,4,2       ## @LCPLL_CD_SOURCE_FCLK
	.comm	_LCPLL_POWER_DOWN_ALLOW,4,2     ## @LCPLL_POWER_DOWN_ALLOW
	.comm	_FORCEWAKE_ALL,4,2              ## @FORCEWAKE_ALL
	.comm	_D_COMP_COMP_FORCE,4,2          ## @D_COMP_COMP_FORCE
	.comm	_D_COMP_COMP_DISABLE,4,2        ## @D_COMP_COMP_DISABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LCPLL not locked yet\n"

	.comm	_LCPLL_CD_SOURCE_FCLK_DONE,4,2  ## @LCPLL_CD_SOURCE_FCLK_DONE
L_.str.1:                               ## @.str.1
	.asciz	"Switching back to LCPLL failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"Current CDCLK"

	.no_dead_strip	_hsw_restore_lcpll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hsw_restore_lcpll
_hsw_restore_lcpll:                     ; @hsw_restore_lcpll
	.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
Lloh0:
	adrp	x23, _LCPLL_CTL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _LCPLL_CTL@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_I915_READ
Lloh2:
	adrp	x25, _LCPLL_PLL_LOCK@GOTPAGE
Lloh3:
	ldr	x25, [x25, _LCPLL_PLL_LOCK@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh4:
	adrp	x26, _LCPLL_PLL_DISABLE@GOTPAGE
Lloh5:
	ldr	x26, [x26, _LCPLL_PLL_DISABLE@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w9, w9, w8
Lloh6:
	adrp	x24, _LCPLL_CD_SOURCE_FCLK@GOTPAGE
Lloh7:
	ldr	x24, [x24, _LCPLL_CD_SOURCE_FCLK@GOTPAGEOFF]
	ldr	w10, [x24]
	orr	w9, w9, w10
Lloh8:
	adrp	x27, _LCPLL_POWER_DOWN_ALLOW@GOTPAGE
Lloh9:
	ldr	x27, [x27, _LCPLL_POWER_DOWN_ALLOW@GOTPAGEOFF]
	ldr	w10, [x27]
	orr	w9, w9, w10
	and	w9, w9, w0
	cmp	w9, w8
	b.ne	LBB0_2
; %bb.1:
	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
	ret
LBB0_2:
	mov	x21, x0
	add	x20, x19, #4
Lloh10:
	adrp	x22, _FORCEWAKE_ALL@GOTPAGE
Lloh11:
	ldr	x22, [x22, _FORCEWAKE_ALL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_intel_uncore_forcewake_get
	ldr	w8, [x27]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.3:
	bic	w1, w21, w8
	ldr	w0, [x23]
	bl	_I915_WRITE
	ldr	w0, [x23]
	bl	_POSTING_READ
LBB0_4:
	mov	x0, x19
	bl	_hsw_read_dcomp
Lloh12:
	adrp	x8, _D_COMP_COMP_FORCE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _D_COMP_COMP_FORCE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	orr	w8, w8, w0
Lloh15:
	adrp	x9, _D_COMP_COMP_DISABLE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _D_COMP_COMP_DISABLE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	bic	w1, w8, w9
	mov	x0, x19
	bl	_hsw_write_dcomp
	ldr	w0, [x23]
	bl	_I915_READ
	ldr	w8, [x26]
	bic	w21, w0, w8
	ldr	w0, [x23]
	mov	x1, x21
	bl	_I915_WRITE
	ldr	w1, [x23]
	ldr	w2, [x25]
	mov	x0, x19
	mov	w3, #5
	bl	_intel_de_wait_for_set
	cbz	x0, LBB0_6
; %bb.5:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_6:
	ldr	w8, [x24]
	tst	w8, w21
	b.eq	LBB0_9
; %bb.7:
	ldr	w0, [x23]
	bl	_I915_READ
	ldr	w8, [x24]
	bic	w1, w0, w8
	ldr	w0, [x23]
	bl	_I915_WRITE
	ldr	w0, [x23]
	bl	_I915_READ
Lloh20:
	adrp	x8, _LCPLL_CD_SOURCE_FCLK_DONE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _LCPLL_CD_SOURCE_FCLK_DONE@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #1
	bl	_wait_for_us
	cbz	x0, LBB0_9
; %bb.8:
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_9:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_intel_uncore_forcewake_put
	mov	x0, x19
	bl	_intel_update_cdclk
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	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_dump_cdclk_state
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_LCPLL_CTL,4,2                  ; @LCPLL_CTL
	.comm	_LCPLL_PLL_LOCK,4,2             ; @LCPLL_PLL_LOCK
	.comm	_LCPLL_PLL_DISABLE,4,2          ; @LCPLL_PLL_DISABLE
	.comm	_LCPLL_CD_SOURCE_FCLK,4,2       ; @LCPLL_CD_SOURCE_FCLK
	.comm	_LCPLL_POWER_DOWN_ALLOW,4,2     ; @LCPLL_POWER_DOWN_ALLOW
	.comm	_FORCEWAKE_ALL,4,2              ; @FORCEWAKE_ALL
	.comm	_D_COMP_COMP_FORCE,4,2          ; @D_COMP_COMP_FORCE
	.comm	_D_COMP_COMP_DISABLE,4,2        ; @D_COMP_COMP_DISABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LCPLL not locked yet\n"

	.comm	_LCPLL_CD_SOURCE_FCLK_DONE,4,2  ; @LCPLL_CD_SOURCE_FCLK_DONE
l_.str.1:                               ; @.str.1
	.asciz	"Switching back to LCPLL failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"Current CDCLK"

	.no_dead_strip	_hsw_restore_lcpll
.subsections_via_symbols
