	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __psr_wait_for_idle_locked
___psr_wait_for_idle_locked:            ## @__psr_wait_for_idle_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	%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
	xorl	%r14d, %r14d
	cmpq	$0, (%rdi)
	je	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$0, 16(%rdi)
	movq	_EDP_PSR2_STATUS_STATE_MASK@GOTPCREL(%rip), %rax
	cmoveq	_EDP_PSR_STATUS_STATE_MASK@GOTPCREL(%rip), %rax
	movq	_EDP_PSR2_STATUS@GOTPCREL(%rip), %rcx
	cmoveq	_EDP_PSR_STATUS@GOTPCREL(%rip), %rcx
	movl	(%rax), %r12d
	movl	(%rcx), %r13d
	leaq	8(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	movl	$50, %ecx
	callq	_intel_de_wait_for_clear
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r15, %rdi
	callq	_mutex_lock
	jmp	LBB0_4
LBB0_3:
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%r14d, %r14d
	cmpq	$0, (%rbx)
	setne	%r14b
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timed out waiting for PSR Idle for re-enable\n"

	.no_dead_strip	___psr_wait_for_idle_locked
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __psr_wait_for_idle_locked
___psr_wait_for_idle_locked:            ; @__psr_wait_for_idle_locked
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _EDP_PSR_STATUS_STATE_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EDP_PSR_STATUS_STATE_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x10, _EDP_PSR2_STATUS_STATE_MASK@GOTPAGE
Lloh3:
	ldr	x10, [x10, _EDP_PSR2_STATUS_STATE_MASK@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x9, x10, eq
Lloh4:
	adrp	x9, _EDP_PSR_STATUS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _EDP_PSR_STATUS@GOTPAGEOFF]
	ldr	w21, [x8]
Lloh6:
	adrp	x8, _EDP_PSR2_STATUS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EDP_PSR2_STATUS@GOTPAGEOFF]
	csel	x8, x9, x8, eq
	ldr	w22, [x8]
	add	x20, x0, #8
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	w3, #50
	bl	_intel_de_wait_for_clear
	cbz	w0, LBB0_4
; %bb.2:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x20
	bl	_mutex_lock
LBB0_3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, ne
LBB0_5:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timed out waiting for PSR Idle for re-enable\n"

	.no_dead_strip	___psr_wait_for_idle_locked
.subsections_via_symbols
