	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switch_context
_switch_context:                        ## @switch_context
	.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
	movq	8(%rdi), %rdi
	movq	24(%r15), %rbx
	callq	_vm_alias
	movq	%rax, %r14
	movl	16(%r15), %edi
	callq	_HAS_EXECLISTS
	movl	%eax, %edi
	callq	_GEM_BUG_ON
	xorl	%r13d, %r13d
	testq	%r14, %r14
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_i915_vm_to_ppgtt
	movq	%rax, %r12
	movq	(%rbx), %rax
	movq	_BCS0@GOTPCREL(%rip), %rcx
	movl	$1, %r13d
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movl	24(%rbx), %edi
	callq	_IS_VALLEYVIEW
	testq	%rax, %rax
	movl	$1, %eax
	movl	$32, %r13d
	cmovel	%eax, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_load_pd_dir
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	decl	%r13d
	jne	LBB0_4
## %bb.7:
	movl	(%r12), %ecx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	movl	$0, %ebx
	testl	%ecx, %eax
	movl	$0, %r13d
	je	LBB0_9
## %bb.8:
	movl	%eax, %edx
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, (%r12)
	movq	_MI_FORCE_RESTORE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%eax, %r13d
	jmp	LBB0_9
LBB0_1:
	xorl	%ebx, %ebx
LBB0_9:
	movq	8(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	_RCS0@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setne	%dil
	callq	_GEM_BUG_ON
	movl	(%r15), %edi
	callq	_i915_gem_context_is_kernel
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_MI_RESTORE_INHIBIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_12:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_mi_set_context
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
LBB0_13:
	testq	%r14, %r14
	je	LBB0_18
## %bb.14:
	movq	_EMIT_INVALIDATE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	callq	*16(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.15:
	movq	%r15, %rdi
	callq	_flush_pd_dir
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.16:
	movl	(%r12), %esi
	movq	%r15, %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	callq	*16(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.17:
	movq	_EMIT_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	callq	*16(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
LBB0_18:
	movq	%r15, %rdi
	callq	_remap_l3
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_19
LBB0_20:
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.21:
	movq	%r14, %rdi
	callq	_i915_vm_to_ppgtt
	orl	%r13d, (%rax)
	jmp	LBB0_22
LBB0_5:
	movl	%eax, %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_BCS0,8,3                       ## @BCS0
	.comm	_MI_FORCE_RESTORE,4,2           ## @MI_FORCE_RESTORE
	.comm	_RCS0,8,3                       ## @RCS0
	.comm	_MI_RESTORE_INHIBIT,4,2         ## @MI_RESTORE_INHIBIT
	.comm	_EMIT_INVALIDATE,4,2            ## @EMIT_INVALIDATE
	.comm	_EMIT_FLUSH,4,2                 ## @EMIT_FLUSH
	.no_dead_strip	_switch_context
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switch_context
_switch_context:                        ; @switch_context
	.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	x20, x0
	ldr	x23, [x0, #24]
	ldr	x0, [x0, #8]
	bl	_vm_alias
	mov	x19, x0
	ldr	w0, [x20, #16]
	bl	_HAS_EXECLISTS
	bl	_GEM_BUG_ON
	cbz	x19, LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_i915_vm_to_ppgtt
	mov	x22, x0
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _BCS0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BCS0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x23, #24]
	bl	_IS_VALLEYVIEW
	cmp	x0, #0
	mov	w8, #32
	csinc	w24, w8, wzr, ne
	b	LBB0_4
LBB0_3:
	mov	w24, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_load_pd_dir
	cbnz	w0, LBB0_19
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	subs	w24, w24, #1
	b.ne	LBB0_4
; %bb.6:
	ldr	w8, [x22]
	ldr	w24, [x23, #8]
	tst	w24, w8
	b.eq	LBB0_8
; %bb.7:
	bic	w8, w8, w24
	str	w8, [x22]
Lloh3:
	adrp	x8, _MI_FORCE_RESTORE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MI_FORCE_RESTORE@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	b	LBB0_9
LBB0_8:
	mov	w24, #0
	mov	w21, #0
LBB0_9:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x8, [x23]
Lloh6:
	adrp	x9, _RCS0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RCS0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, ne
	bl	_GEM_BUG_ON
	ldr	w0, [x20]
	bl	_i915_gem_context_is_kernel
Lloh9:
	adrp	x8, _MI_RESTORE_INHIBIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MI_RESTORE_INHIBIT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w1, w21, w8, eq
	mov	x0, x20
	bl	_mi_set_context
	mov	x21, x0
	cbnz	w0, LBB0_17
LBB0_11:
	cbz	x19, LBB0_16
; %bb.12:
	ldr	x8, [x23, #16]
Lloh12:
	adrp	x22, _EMIT_INVALIDATE@GOTPAGE
Lloh13:
	ldr	x22, [x22, _EMIT_INVALIDATE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.13:
	mov	x0, x20
	bl	_flush_pd_dir
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.14:
	ldr	x8, [x23, #16]
	ldr	w1, [x22]
	mov	x0, x20
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_17
; %bb.15:
	ldr	x8, [x23, #16]
Lloh14:
	adrp	x9, _EMIT_FLUSH@GOTPAGE
Lloh15:
	ldr	x9, [x9, _EMIT_FLUSH@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	mov	x0, x20
	blr	x8
	mov	x21, x0
	cbnz	w0, LBB0_17
LBB0_16:
	mov	x0, x20
	bl	_remap_l3
	mov	x21, x0
	cbz	w0, LBB0_20
LBB0_17:
	cbz	w24, LBB0_20
; %bb.18:
	mov	x0, x19
	bl	_i915_vm_to_ppgtt
	ldr	w8, [x0]
	orr	w8, w8, w24
	str	w8, [x0]
	b	LBB0_20
LBB0_19:
	mov	x21, x0
LBB0_20:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_BCS0,8,3                       ; @BCS0
	.comm	_MI_FORCE_RESTORE,4,2           ; @MI_FORCE_RESTORE
	.comm	_RCS0,8,3                       ; @RCS0
	.comm	_MI_RESTORE_INHIBIT,4,2         ; @MI_RESTORE_INHIBIT
	.comm	_EMIT_INVALIDATE,4,2            ; @EMIT_INVALIDATE
	.comm	_EMIT_FLUSH,4,2                 ; @EMIT_FLUSH
	.no_dead_strip	_switch_context
.subsections_via_symbols
