	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ring_is_idle
_ring_is_idle:                          ## @ring_is_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	%rdi, %r14
	xorl	%edi, %edi
	cmpl	$0, 4(%r14)
	sete	%dil
	callq	_I915_SELFTEST_ONLY
	movl	$1, %ebx
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movq	%r14, %rdi
	callq	_intel_engine_pm_get_if_awake
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	_RING_HEAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ENGINE_READ
	movl	%eax, %r15d
	movq	_HEAD_ADDR@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_RING_TAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ENGINE_READ
	movq	_TAIL_ADDR@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	xorl	%ebx, %ebx
	cmpl	%eax, %r15d
	sete	%bl
	movl	(%r14), %edi
	callq	_INTEL_GEN
	cmpl	$3, %eax
	jl	LBB0_4
## %bb.3:
	movq	_RING_MI_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ENGINE_READ
	movq	_MODE_IDLE@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmovel	%eax, %ebx
LBB0_4:
	movq	%r14, %rdi
	callq	_intel_engine_pm_put
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RING_HEAD,4,2                  ## @RING_HEAD
	.comm	_HEAD_ADDR,4,2                  ## @HEAD_ADDR
	.comm	_RING_TAIL,4,2                  ## @RING_TAIL
	.comm	_TAIL_ADDR,4,2                  ## @TAIL_ADDR
	.comm	_RING_MI_MODE,4,2               ## @RING_MI_MODE
	.comm	_MODE_IDLE,4,2                  ## @MODE_IDLE
	.no_dead_strip	_ring_is_idle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ring_is_idle
_ring_is_idle:                          ; @ring_is_idle
	.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	x19, x0
	ldr	w8, [x0, #4]
	cmp	w8, #0
	cset	w0, eq
	bl	_I915_SELFTEST_ONLY
	cbz	x0, LBB0_2
LBB0_1:
	mov	w20, #1
	b	LBB0_6
LBB0_2:
	mov	x0, x19
	bl	_intel_engine_pm_get_if_awake
	cbz	w0, LBB0_1
; %bb.3:
Lloh0:
	adrp	x8, _RING_HEAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RING_HEAD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ENGINE_READ
Lloh3:
	adrp	x8, _HEAD_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HEAD_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w20, w8, w0
Lloh6:
	adrp	x8, _RING_TAIL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RING_TAIL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ENGINE_READ
Lloh9:
	adrp	x8, _TAIL_ADDR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TAIL_ADDR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
	cmp	w20, w8
	cset	w20, eq
	ldr	w0, [x19]
	bl	_INTEL_GEN
	cmp	w0, #3
	b.lt	LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _RING_MI_MODE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RING_MI_MODE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ENGINE_READ
Lloh15:
	adrp	x8, _MODE_IDLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MODE_IDLE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w0
	csel	w20, wzr, w20, eq
LBB0_5:
	mov	x0, x19
	bl	_intel_engine_pm_put
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_RING_HEAD,4,2                  ; @RING_HEAD
	.comm	_HEAD_ADDR,4,2                  ; @HEAD_ADDR
	.comm	_RING_TAIL,4,2                  ; @RING_TAIL
	.comm	_TAIL_ADDR,4,2                  ; @TAIL_ADDR
	.comm	_RING_MI_MODE,4,2               ; @RING_MI_MODE
	.comm	_MODE_IDLE,4,2                  ; @MODE_IDLE
	.no_dead_strip	_ring_is_idle
.subsections_via_symbols
