	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function workload_thread
_workload_thread:                       ## @workload_thread
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r13
	movl	(%rdi), %r14d
	movq	(%r13), %rdi
	callq	_INTEL_GEN
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_woken_wake_function@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DEFINE_WAIT_FUNC
	movq	(%r13), %r12
	movq	%rbx, %rdi
	callq	_kfree
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_gvt_dbg_core
	xorl	%eax, %eax
	callq	_kthread_should_stop
	testl	%eax, %eax
	jne	LBB0_17
## %bb.1:
	movslq	%r14d, %rax
	addq	$4, %r12
	shlq	$2, %rax
	movq	_wait@GOTPCREL(%rip), %r15
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rbx
	xorl	%ecx, %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movq	8(%r13), %rdi
	addq	%rax, %rdi
	movq	%r15, %rsi
	callq	_add_wait_queue
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_pick_next_workload
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r15, %rdi
	callq	_wait_woken
	xorl	%eax, %eax
	callq	_kthread_should_stop
	testl	%eax, %eax
	je	LBB0_3
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r12
	movq	8(%r13), %rdi
	addq	-56(%rbp), %rdi                 ## 8-byte Folded Reload
	movq	%r15, %rsi
	callq	_remove_wait_queue
	movq	16(%r12), %rsi
	movq	24(%r12), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_gvt_dbg_sched
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_intel_runtime_pm_get
	movq	16(%r12), %rsi
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_gvt_dbg_sched
	cmpl	$9, -44(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rdi
	movq	_FORCEWAKE_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_intel_uncore_forcewake_get
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_update_vreg_in_ctx
	movq	%r12, %rdi
	callq	_dispatch_workload
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	L_.str.3(%rip), %rdi
	callq	_gvt_vgpu_err
	jmp	LBB0_11
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r12), %rsi
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_gvt_dbg_sched
	movl	8(%r12), %edi
	movl	(%rbx), %edx
	xorl	%esi, %esi
	callq	_i915_request_wait
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rdx
	leaq	L_.str.5(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_gvt_dbg_sched
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_complete_current_workload
	cmpl	$9, -44(%rbp)                   ## 4-byte Folded Reload
	jl	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rdi
	movq	_FORCEWAKE_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_intel_uncore_forcewake_put
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_intel_runtime_pm_put_unchecked
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	testl	%edi, %edi
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_vgpu_is_vm_unhealthy
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_GVT_FAILSAFE_GUEST_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_enter_failsafe_mode
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_kthread_should_stop
	testl	%eax, %eax
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_2
	jmp	LBB0_17
LBB0_5:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	8(%r13), %rdi
	movq	_wait@GOTPCREL(%rip), %rsi
	callq	_remove_wait_queue
LBB0_17:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_woken_wake_function,4,2        ## @woken_wake_function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"workload thread for ring %d started\n"

	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ## @MAX_SCHEDULE_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"ring id %d next workload %p vgpu %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"ring id %d will dispatch workload %p\n"

	.comm	_FORCEWAKE_ALL,4,2              ## @FORCEWAKE_ALL
L_.str.3:                               ## @.str.3
	.asciz	"fail to dispatch workload, skip\n"

L_.str.4:                               ## @.str.4
	.asciz	"ring id %d wait workload %p\n"

L_.str.5:                               ## @.str.5
	.asciz	"will complete workload %p, status: %d\n"

	.comm	_GVT_FAILSAFE_GUEST_ERR,4,2     ## @GVT_FAILSAFE_GUEST_ERR
	.no_dead_strip	_workload_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function workload_thread
_workload_thread:                       ; @workload_thread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x0
	ldr	x19, [x0, #8]
	ldr	w21, [x0]
	ldr	x0, [x19]
	bl	_INTEL_GEN
	mov	x20, x0
Lloh0:
	adrp	x8, _wait@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wait@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _woken_wake_function@GOTPAGE
Lloh4:
	ldr	x8, [x8, _woken_wake_function@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_DEFINE_WAIT_FUNC
	ldr	x23, [x19]
	mov	x0, x22
	bl	_kfree
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_gvt_dbg_core
	bl	_kthread_should_stop
	cbnz	w0, LBB0_17
; %bb.1:
	mov	x22, #0
	sxtw	x21, w21
	add	x23, x23, #4
Lloh8:
	adrp	x24, _wait@GOTPAGE
Lloh9:
	ldr	x24, [x24, _wait@GOTPAGEOFF]
Lloh10:
	adrp	x26, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh11:
	ldr	x26, [x26, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh12:
	adrp	x28, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh13:
	ldr	x28, [x28, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	ldr	x8, [x19, #8]
	add	x0, x8, x21, lsl #2
	mov	x1, x24
	bl	_add_wait_queue
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x21
	bl	_pick_next_workload
	cbnz	x0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	w1, [x26]
	ldr	w2, [x28]
	mov	x0, x24
	bl	_wait_woken
	bl	_kthread_should_stop
	cbz	w0, LBB0_3
	b	LBB0_16
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x27, x0
	ldr	x8, [x19, #8]
	add	x0, x8, x21, lsl #2
	mov	x1, x24
	bl	_remove_wait_queue
	ldp	x1, x8, [x27, #16]
	ldr	w8, [x8]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x27
	bl	_gvt_dbg_sched
	mov	x0, x23
	bl	_intel_runtime_pm_get
	ldr	x1, [x27, #16]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x27
	bl	_gvt_dbg_sched
	cmp	w20, #9
	b.lt	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x19]
Lloh18:
	adrp	x8, _FORCEWAKE_ALL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FORCEWAKE_ALL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_intel_uncore_forcewake_get
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x27
	bl	_update_vreg_in_ctx
	mov	x0, x27
	bl	_dispatch_workload
	mov	x25, x0
	cbz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x22, [x27, #24]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gvt_vgpu_err
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x1, [x27, #16]
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x2, x27
	bl	_gvt_dbg_sched
	ldr	w0, [x27, #8]
	ldr	w2, [x28]
	mov	w1, #0
	bl	_i915_request_wait
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x2, [x27]
Lloh25:
	adrp	x0, l_.str.5@PAGE
Lloh26:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x27
	bl	_gvt_dbg_sched
	mov	x0, x19
	mov	x1, x21
	bl	_complete_current_workload
	cmp	w20, #9
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x19]
Lloh27:
	adrp	x8, _FORCEWAKE_ALL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FORCEWAKE_ALL@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	bl	_intel_uncore_forcewake_put
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x23
	bl	_intel_runtime_pm_put_unchecked
	cbz	w25, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x25
	bl	_vgpu_is_vm_unhealthy
	cbz	x0, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh30:
	adrp	x8, _GVT_FAILSAFE_GUEST_ERR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _GVT_FAILSAFE_GUEST_ERR@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_enter_failsafe_mode
LBB0_15:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_kthread_should_stop
	cbz	w0, LBB0_2
	b	LBB0_17
LBB0_16:
	ldr	x8, [x19, #8]
	add	x0, x8, x21, lsl #2
Lloh33:
	adrp	x1, _wait@GOTPAGE
Lloh34:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	bl	_remove_wait_queue
LBB0_17:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_woken_wake_function,4,2        ; @woken_wake_function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"workload thread for ring %d started\n"

	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ; @MAX_SCHEDULE_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"ring id %d next workload %p vgpu %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"ring id %d will dispatch workload %p\n"

	.comm	_FORCEWAKE_ALL,4,2              ; @FORCEWAKE_ALL
l_.str.3:                               ; @.str.3
	.asciz	"fail to dispatch workload, skip\n"

l_.str.4:                               ; @.str.4
	.asciz	"ring id %d wait workload %p\n"

l_.str.5:                               ; @.str.5
	.asciz	"will complete workload %p, status: %d\n"

	.comm	_GVT_FAILSAFE_GUEST_ERR,4,2     ; @GVT_FAILSAFE_GUEST_ERR
	.no_dead_strip	_workload_thread
.subsections_via_symbols
