	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispatch_workload
_dispatch_workload:                     ## @dispatch_workload
	.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
	movq	%rdi, %rbx
	movq	32(%rdi), %r15
	movq	8(%r15), %rax
	movq	(%rax), %r14
	movl	(%rdi), %r12d
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movq	%rbx, %rdx
	callq	_gvt_dbg_sched
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_intel_gvt_workload_req_alloc
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	%rbx, %rdi
	callq	_intel_gvt_scan_and_shadow_workload
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_populate_shadow_context
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r13d
	leaq	24(%rbx), %rdi
	callq	_release_shadow_wa_ctx
	jmp	LBB0_4
LBB0_5:
	movq	%rbx, %rdi
	callq	_prepare_workload
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_6
LBB0_4:
	leaq	16(%rbx), %rdi
	callq	_fetch_and_zero
	movq	%rax, %rdi
	callq	_i915_request_put
LBB0_7:
	movq	16(%rbx), %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	testl	%r13d, %r13d
	je	LBB0_10
LBB0_11:
	movl	%r13d, 8(%rbx)
LBB0_12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	16(%rbx), %rdx
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	callq	_gvt_dbg_sched
	movq	16(%rbx), %rdi
	callq	_i915_request_add
	movl	$1, 4(%rbx)
	testl	%r13d, %r13d
	jne	LBB0_11
LBB0_10:
	xorl	%r13d, %r13d
	jmp	LBB0_12
LBB0_6:
	xorl	%r13d, %r13d
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ring id %d prepare to dispatch workload %p\n"

L_.str.1:                               ## @.str.1
	.asciz	"ring id %d submit workload to i915 %p\n"

	.no_dead_strip	_dispatch_workload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dispatch_workload
_dispatch_workload:                     ; @dispatch_workload
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	ldr	x19, [x0, #32]
	ldr	x8, [x19, #8]
	ldr	x20, [x8]
	ldr	w22, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	mov	x2, x21
	bl	_gvt_dbg_sched
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x21
	bl	_intel_gvt_workload_req_alloc
	mov	x23, x0
	cbnz	w0, LBB0_9
; %bb.1:
	mov	x0, x21
	bl	_intel_gvt_scan_and_shadow_workload
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.2:
	mov	x0, x21
	bl	_populate_shadow_context
	cbz	w0, LBB0_4
; %bb.3:
	mov	x23, x0
	add	x0, x21, #24
	bl	_release_shadow_wa_ctx
	b	LBB0_5
LBB0_4:
	mov	x0, x21
	bl	_prepare_workload
	mov	x23, x0
	cbz	w0, LBB0_6
LBB0_5:
	add	x0, x21, #16
	bl	_fetch_and_zero
	bl	_i915_request_put
LBB0_6:
	ldr	x0, [x21, #16]
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_8
; %bb.7:
	ldr	x2, [x21, #16]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_gvt_dbg_sched
	ldr	x0, [x21, #16]
	bl	_i915_request_add
	mov	w8, #1
	str	w8, [x21, #4]
LBB0_8:
	cbz	w23, LBB0_10
LBB0_9:
	str	w23, [x21, #8]
LBB0_10:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ring id %d prepare to dispatch workload %p\n"

l_.str.1:                               ; @.str.1
	.asciz	"ring id %d submit workload to i915 %p\n"

	.no_dead_strip	_dispatch_workload
.subsections_via_symbols
