	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_engine_stop_cs           ## -- Begin function intel_engine_stop_cs
	.p2align	4, 0x90
_intel_engine_stop_cs:                  ## @intel_engine_stop_cs
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	16(%rdi), %r14
	movl	8(%rdi), %edi
	callq	_RING_MI_MODE
	movl	%eax, %r15d
	movl	4(%r12), %edi
	callq	_INTEL_GEN
	cmpl	$2, %eax
	jg	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_2:
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_GEM_TRACE
	movq	_STOP_RING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	__MASKED_BIT_ENABLE
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_intel_uncore_write_fw
	movq	_MODE_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	$0, (%rsp)
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ecx, %edx
	movl	$1000, %r8d                     ## imm = 0x3E8
	xorl	%r9d, %r9d
	callq	___intel_wait_for_register_fw
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_GEM_TRACE
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_4:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_intel_uncore_posting_read_fw
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s\n"

	.comm	_STOP_RING,4,2                  ## @STOP_RING
	.comm	_MODE_IDLE,4,2                  ## @MODE_IDLE
L_.str.1:                               ## @.str.1
	.asciz	"%s: timed out on STOP_RING -> IDLE\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_engine_stop_cs           ; -- Begin function intel_engine_stop_cs
	.p2align	2
_intel_engine_stop_cs:                  ; @intel_engine_stop_cs
	.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	x21, x0
	ldr	x19, [x0, #16]
	ldr	w0, [x0, #8]
	bl	_RING_MI_MODE
	mov	x20, x0
	ldr	w0, [x21, #4]
	bl	_INTEL_GEN
	cmp	w0, #2
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_2:
	ldr	w1, [x21]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_GEM_TRACE
Lloh5:
	adrp	x8, _STOP_RING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STOP_RING@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	__MASKED_BIT_ENABLE
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_intel_uncore_write_fw
Lloh8:
	adrp	x8, _MODE_IDLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MODE_IDLE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x2
	mov	w4, #1000
	mov	w5, #0
	mov	x6, #0
	bl	___intel_wait_for_register_fw
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w1, [x21]
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_GEM_TRACE
Lloh13:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_5
LBB0_4:
	mov	w21, #0
LBB0_5:
	mov	x0, x19
	mov	x1, x20
	bl	_intel_uncore_posting_read_fw
LBB0_6:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s\n"

	.comm	_STOP_RING,4,2                  ; @STOP_RING
	.comm	_MODE_IDLE,4,2                  ; @MODE_IDLE
l_.str.1:                               ; @.str.1
	.asciz	"%s: timed out on STOP_RING -> IDLE\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
