	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_psr_wait_for_idle        ## -- Begin function intel_psr_wait_for_idle
	.p2align	4, 0x90
_intel_psr_wait_for_idle:               ## @intel_psr_wait_for_idle
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_to_intel_crtc
	movl	(%rax), %edi
	callq	_to_i915
	cmpl	$0, 8(%rax)
	je	LBB0_4
## %bb.1:
	cmpl	$0, (%rbx)
	je	LBB0_4
## %bb.2:
	movq	%rax, %r15
	movl	4(%rax), %edi
	callq	_READ_ONCE
	testq	%rax, %rax
	je	LBB0_3
LBB0_4:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_EDP_PSR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_EDP_PSR_STATUS_STATE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_EDP_PSR_STATUS_STATE_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, (%rsp)
	movq	%r15, %rdi
	movl	$2, %r8d
	movl	$50, %r9d
	callq	___intel_wait_for_register
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_EDP_PSR_STATUS,4,2             ## @EDP_PSR_STATUS
	.comm	_EDP_PSR_STATUS_STATE_MASK,4,2  ## @EDP_PSR_STATUS_STATE_MASK
	.comm	_EDP_PSR_STATUS_STATE_IDLE,4,2  ## @EDP_PSR_STATUS_STATE_IDLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_psr_wait_for_idle        ; -- Begin function intel_psr_wait_for_idle
	.p2align	2
_intel_psr_wait_for_idle:               ; @intel_psr_wait_for_idle
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x21, x0
	ldr	w0, [x0, #4]
	bl	_to_intel_crtc
	ldr	w0, [x0]
	bl	_to_i915
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	w8, [x21]
	cbz	w8, LBB0_3
; %bb.2:
	mov	x20, x0
	ldr	w0, [x0, #4]
	bl	_READ_ONCE
	cbz	x0, LBB0_4
LBB0_3:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh0:
	adrp	x8, _EDP_PSR_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EDP_PSR_STATUS@GOTPAGEOFF]
Lloh2:
	adrp	x9, _EDP_PSR_STATUS_STATE_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _EDP_PSR_STATUS_STATE_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	ldr	w2, [x9]
Lloh6:
	adrp	x8, _EDP_PSR_STATUS_STATE_IDLE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EDP_PSR_STATUS_STATE_IDLE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x20
	mov	w4, #2
	mov	w5, #50
	mov	x6, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	___intel_wait_for_register
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EDP_PSR_STATUS,4,2             ; @EDP_PSR_STATUS
	.comm	_EDP_PSR_STATUS_STATE_MASK,4,2  ; @EDP_PSR_STATUS_STATE_MASK
	.comm	_EDP_PSR_STATUS_STATE_IDLE,4,2  ; @EDP_PSR_STATUS_STATE_IDLE
.subsections_via_symbols
