	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elsp_mmio_write
_elsp_mmio_write:                       ## @elsp_mmio_write
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_intel_gvt_render_mmio_to_ring_id
	movl	%eax, %r15d
	testl	%eax, %eax
	sets	%al
	movq	_I915_NUM_ENGINES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r15d
	movl	(%rbx), %ebx
	setge	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_2:
	movq	(%r14), %rax
	movslq	%r15d, %rcx
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %r12
	movq	8(%rax,%rcx), %rdx
	movslq	(%rax,%rcx), %rsi
	movl	$3, %edi
	subq	%rsi, %rdi
	movl	%ebx, (%rdx,%rdi,4)
	xorl	%ebx, %ebx
	cmpl	$3, (%rax,%rcx)
	jne	LBB0_5
## %bb.3:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_intel_vgpu_submit_execlist
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	callq	_gvt_vgpu_err
	movl	%r14d, %ebx
LBB0_5:
	movl	(%r12), %eax
	incl	%eax
	andl	$3, %eax
	movl	%eax, (%r12)
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_NUM_ENGINES,4,2           ## @I915_NUM_ENGINES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail submit workload on ring %d\n"

	.no_dead_strip	_elsp_mmio_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elsp_mmio_write
_elsp_mmio_write:                       ; @elsp_mmio_write
	.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, x2
	mov	x20, x0
	ldr	w0, [x0, #8]
	bl	_intel_gvt_render_mmio_to_ring_id
	mov	x19, x0
	ldr	w22, [x21]
	cmp	w0, #0
Lloh0:
	adrp	x8, _I915_NUM_ENGINES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_NUM_ENGINES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ccmp	w0, w8, #0, ge
	cset	w0, ge
	bl	_WARN_ON
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_2:
	ldr	x8, [x20]
	add	x21, x8, w19, sxtw #4
	ldr	x8, [x21, #8]
	ldrsw	x9, [x21]
	mov	w10, #3
	sub	x9, x10, x9
	str	w22, [x8, x9, lsl #2]
	ldr	w8, [x21]
	cmp	w8, #3
	b.ne	LBB0_5
; %bb.3:
	mov	x0, x20
	mov	x1, x19
	bl	_intel_vgpu_submit_execlist
	mov	x20, x0
	cbz	w0, LBB0_6
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_gvt_vgpu_err
	b	LBB0_6
LBB0_5:
	mov	w20, #0
LBB0_6:
	ldr	w8, [x21]
	add	w8, w8, #1
	and	w8, w8, #0x3
	str	w8, [x21]
LBB0_7:
	mov	x0, x20
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_NUM_ENGINES,4,2           ; @I915_NUM_ENGINES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail submit workload on ring %d\n"

	.no_dead_strip	_elsp_mmio_write
.subsections_via_symbols
