	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switch_to_kernel_context_sync
_switch_to_kernel_context_sync:         ## @switch_to_kernel_context_sync
	.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, %r15
	callq	_intel_gt_is_wedged
	xorl	%r13d, %r13d
	testl	%eax, %eax
	sete	%bl
	movq	(%r15), %rdi
	movq	_I915_WAIT_LOCKED@GOTPCREL(%rip), %rax
	movq	_I915_WAIT_FOR_IDLE_BOOST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_I915_GEM_IDLE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i915_gem_wait_for_idle
	movq	_ETIME@GOTPCREL(%rip), %r12
	addl	(%r12), %eax
	jne	LBB0_1
## %bb.2:
	movq	_i915_modparams@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.3:
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	xorl	%eax, %eax
	callq	_GEM_TRACE_DUMP
LBB0_4:
	movq	%r15, %rdi
	callq	_intel_gt_set_wedged
	xorl	%r13d, %r13d
	jmp	LBB0_5
LBB0_1:
	movb	%bl, %r13b
LBB0_5:
	movq	(%r15), %rdi
	callq	_i915_retire_requests
	testq	%rax, %rax
	je	LBB0_13
## %bb.6:
	testl	%r13d, %r13d
	je	LBB0_13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movq	_I915_WAIT_FOR_IDLE_BOOST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_I915_WAIT_LOCKED@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_I915_GEM_IDLE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i915_gem_wait_for_idle
	movl	%eax, %ebx
	xorl	%r14d, %r14d
	subl	(%r12), %r14d
	movl	$1, %r13d
	cmpl	%r14d, %eax
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_i915_modparams@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	xorl	%eax, %eax
	callq	_GEM_TRACE_DUMP
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	callq	_intel_gt_set_wedged
	xorl	%r13d, %r13d
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15), %rdi
	callq	_i915_retire_requests
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%r14d, %ebx
	jne	LBB0_7
LBB0_13:
	movq	%r15, %rdi
	callq	_intel_gt_pm_wait_for_idle
	xorl	%ecx, %ecx
	testq	%rax, %rax
	cmovel	%r13d, %ecx
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_WAIT_LOCKED,4,2           ## @I915_WAIT_LOCKED
	.comm	_I915_WAIT_FOR_IDLE_BOOST,4,2   ## @I915_WAIT_FOR_IDLE_BOOST
	.comm	_I915_GEM_IDLE_TIMEOUT,4,2      ## @I915_GEM_IDLE_TIMEOUT
	.comm	_ETIME,4,2                      ## @ETIME
	.comm	_i915_modparams,8,3             ## @i915_modparams
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to idle engines, declaring wedged!\n"

	.no_dead_strip	_switch_to_kernel_context_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_to_kernel_context_sync
_switch_to_kernel_context_sync:         ; @switch_to_kernel_context_sync
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	bl	_intel_gt_is_wedged
	cmp	w0, #0
	cset	w26, eq
	ldr	x0, [x19]
Lloh0:
	adrp	x22, _I915_WAIT_LOCKED@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I915_WAIT_LOCKED@GOTPAGEOFF]
Lloh2:
	adrp	x23, _I915_WAIT_FOR_IDLE_BOOST@GOTPAGE
Lloh3:
	ldr	x23, [x23, _I915_WAIT_FOR_IDLE_BOOST@GOTPAGEOFF]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w1, w9, w8
Lloh4:
	adrp	x24, _I915_GEM_IDLE_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x24, [x24, _I915_GEM_IDLE_TIMEOUT@GOTPAGEOFF]
	ldr	w2, [x24]
	bl	_i915_gem_wait_for_idle
Lloh6:
	adrp	x25, _ETIME@GOTPAGE
Lloh7:
	ldr	x25, [x25, _ETIME@GOTPAGEOFF]
	ldr	w8, [x25]
	cmn	w0, w8
	b.ne	LBB0_4
; %bb.1:
Lloh8:
	adrp	x8, _i915_modparams@GOTPAGE
Lloh9:
	ldr	x8, [x8, _i915_modparams@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	bl	_GEM_TRACE_DUMP
LBB0_3:
	mov	x0, x19
	bl	_intel_gt_set_wedged
	mov	w26, #0
LBB0_4:
	ldr	x0, [x19]
	bl	_i915_retire_requests
	cmp	x0, #0
	ccmp	w26, #0, #4, ne
	b.ne	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_intel_gt_pm_wait_for_idle
	cmp	x0, #0
	csel	w0, w26, wzr, eq
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh13:
	adrp	x27, _i915_modparams@GOTPAGE
Lloh14:
	ldr	x27, [x27, _i915_modparams@GOTPAGEOFF]
Lloh15:
	adrp	x20, l_.str@PAGE
Lloh16:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	w26, #1
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x0, [x19]
	bl	_i915_retire_requests
	cmp	x0, #0
	ccmp	w21, w28, #4, ne
	b.eq	LBB0_5
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w1, w9, w8
	ldr	w2, [x24]
	bl	_i915_gem_wait_for_idle
	mov	x21, x0
	ldr	w8, [x25]
	neg	w28, w8
	cmn	w0, w8
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x27]
	cbz	x8, LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_dev_err
	bl	_GEM_TRACE_DUMP
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	bl	_intel_gt_set_wedged
	mov	w26, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_WAIT_LOCKED,4,2           ; @I915_WAIT_LOCKED
	.comm	_I915_WAIT_FOR_IDLE_BOOST,4,2   ; @I915_WAIT_FOR_IDLE_BOOST
	.comm	_I915_GEM_IDLE_TIMEOUT,4,2      ; @I915_GEM_IDLE_TIMEOUT
	.comm	_ETIME,4,2                      ; @ETIME
	.comm	_i915_modparams,8,3             ; @i915_modparams
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to idle engines, declaring wedged!\n"

	.no_dead_strip	_switch_to_kernel_context_sync
.subsections_via_symbols
