	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_psr_disable_locked
_intel_psr_disable_locked:              ## @intel_psr_disable_locked
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_dp_to_i915
	movq	%rax, %rbx
	leaq	16(%rax), %rdi
	callq	_lockdep_assert_held
	cmpl	$0, (%rbx)
	je	LBB0_4
## %bb.1:
	cmpq	$0, 8(%rbx)
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movq	%rbx, %rdi
	callq	_intel_psr_exit
	cmpq	$0, 8(%rbx)
	movq	_EDP_PSR2_STATUS_STATE_MASK@GOTPCREL(%rip), %rax
	cmoveq	_EDP_PSR_STATUS_STATE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_EDP_PSR2_STATUS@GOTPCREL(%rip), %rax
	cmoveq	_EDP_PSR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$2000, %ecx                     ## imm = 0x7D0
	callq	_intel_de_wait_for_clear
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
LBB0_3:
	movq	_DP_PSR_EN_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_drm_dp_dpcd_writeb
	movl	$0, (%rbx)
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Disabling PSR%s\n"

L_.str.1:                               ## @.str.1
	.asciz	"2"

L_.str.2:                               ## @.str.2
	.asciz	"1"

	.comm	_EDP_PSR2_STATUS,4,2            ## @EDP_PSR2_STATUS
	.comm	_EDP_PSR2_STATUS_STATE_MASK,4,2 ## @EDP_PSR2_STATUS_STATE_MASK
	.comm	_EDP_PSR_STATUS,4,2             ## @EDP_PSR_STATUS
	.comm	_EDP_PSR_STATUS_STATE_MASK,4,2  ## @EDP_PSR_STATUS_STATE_MASK
L_.str.3:                               ## @.str.3
	.asciz	"Timed out waiting PSR idle state\n"

	.comm	_DP_PSR_EN_CFG,4,2              ## @DP_PSR_EN_CFG
	.no_dead_strip	_intel_psr_disable_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_psr_disable_locked
_intel_psr_disable_locked:              ; @intel_psr_disable_locked
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	bl	_dp_to_i915
	mov	x19, x0
	add	x0, x0, #16
	bl	_lockdep_assert_held
	ldr	w8, [x19]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, l_.str.1@PAGE
Lloh1:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh2:
	adrp	x10, l_.str.2@PAGE
Lloh3:
	add	x10, x10, l_.str.2@PAGEOFF
	cmp	x8, #0
	csel	x1, x10, x9, eq
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	mov	x0, x19
	bl	_intel_psr_exit
Lloh6:
	adrp	x8, _EDP_PSR_STATUS_STATE_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EDP_PSR_STATUS_STATE_MASK@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh8:
	adrp	x10, _EDP_PSR2_STATUS_STATE_MASK@GOTPAGE
Lloh9:
	ldr	x10, [x10, _EDP_PSR2_STATUS_STATE_MASK@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _EDP_PSR_STATUS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EDP_PSR_STATUS@GOTPAGEOFF]
Lloh12:
	adrp	x9, _EDP_PSR2_STATUS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EDP_PSR2_STATUS@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #2000
	bl	_intel_de_wait_for_clear
	cbz	x0, LBB0_3
; %bb.2:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
LBB0_3:
Lloh16:
	adrp	x8, _DP_PSR_EN_CFG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DP_PSR_EN_CFG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_drm_dp_dpcd_writeb
	str	wzr, [x19]
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Disabling PSR%s\n"

l_.str.1:                               ; @.str.1
	.asciz	"2"

l_.str.2:                               ; @.str.2
	.asciz	"1"

	.comm	_EDP_PSR2_STATUS,4,2            ; @EDP_PSR2_STATUS
	.comm	_EDP_PSR2_STATUS_STATE_MASK,4,2 ; @EDP_PSR2_STATUS_STATE_MASK
	.comm	_EDP_PSR_STATUS,4,2             ; @EDP_PSR_STATUS
	.comm	_EDP_PSR_STATUS_STATE_MASK,4,2  ; @EDP_PSR_STATUS_STATE_MASK
l_.str.3:                               ; @.str.3
	.asciz	"Timed out waiting PSR idle state\n"

	.comm	_DP_PSR_EN_CFG,4,2              ; @DP_PSR_EN_CFG
	.no_dead_strip	_intel_psr_disable_locked
.subsections_via_symbols
