	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_switch
_do_switch:                             ## @do_switch
	.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	%rdi, %r15
	movq	16(%rdi), %r14
	movq	(%r14), %r12
	xorl	%ebx, %ebx
	movl	$0, %edi
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpq	$0, (%r12)
	sete	%dil
LBB0_2:
	callq	_BUG_ON
	movq	8(%r15), %rdi
	cmpq	%rdi, %r12
	je	LBB0_19
## %bb.3:
	movq	_CONTEXT_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_i915_gem_object_pin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.4:
	movq	8(%r15), %rdi
	xorl	%esi, %esi
	callq	_i915_gem_object_set_to_gtt_domain
	movq	8(%r15), %rdi
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	callq	_i915_gem_object_unpin
	jmp	LBB0_19
LBB0_6:
	cmpl	$0, 28(%rdi)
	jne	LBB0_8
## %bb.7:
	movl	24(%rdi), %esi
	callq	_i915_gem_gtt_bind_object
LBB0_8:
	cmpl	$0, (%r15)
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_is_default_context
	testq	%rax, %rax
	je	LBB0_11
LBB0_10:
	movq	_MI_RESTORE_INHIBIT@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %edx
LBB0_14:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_mi_set_context
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	movq	8(%r15), %rdi
	callq	_i915_gem_object_unpin
	jmp	LBB0_19
LBB0_16:
	testq	%r12, %r12
	je	LBB0_18
## %bb.17:
	movq	_I915_GEM_DOMAIN_INSTRUCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	12(%r12), %rbx
	movl	%eax, 12(%r12)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_i915_gem_object_move_to_active
	movl	$1, 8(%r12)
	xorl	%edi, %edi
	cmpq	%r14, 16(%r12)
	setne	%dil
	callq	_BUG_ON
	movq	%r12, %rdi
	callq	_i915_gem_object_unpin
	movq	%rbx, %rdi
	callq	_drm_gem_object_unreference
LBB0_18:
	movq	8(%r15), %rdi
	addq	$12, %rdi
	callq	_drm_gem_object_reference
	movq	8(%r15), %rax
	movq	%rax, (%r14)
	movl	$1, (%r15)
	xorl	%ebx, %ebx
LBB0_19:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%edi, %edi
	cmpq	8(%r15), %r12
	sete	%dil
	callq	_WARN_ON_ONCE
	xorl	%edx, %edx
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	_MI_FORCE_RESTORE@GOTPCREL(%rip), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_CONTEXT_ALIGN,4,2              ## @CONTEXT_ALIGN
	.comm	_MI_RESTORE_INHIBIT,4,2         ## @MI_RESTORE_INHIBIT
	.comm	_MI_FORCE_RESTORE,4,2           ## @MI_FORCE_RESTORE
	.comm	_I915_GEM_DOMAIN_INSTRUCTION,4,2 ## @I915_GEM_DOMAIN_INSTRUCTION
	.no_dead_strip	_do_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_switch
_do_switch:                             ; @do_switch
	.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	x19, x0
	ldr	x20, [x0, #16]
	ldr	x21, [x20]
	cbz	x21, LBB0_2
; %bb.1:
	ldr	x8, [x21]
	cmp	x8, #0
	cset	w0, eq
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	bl	_BUG_ON
	ldr	x0, [x19, #8]
	cmp	x21, x0
	b.eq	LBB0_7
; %bb.4:
Lloh0:
	adrp	x8, _CONTEXT_ALIGN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONTEXT_ALIGN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	mov	w3, #0
	bl	_i915_gem_object_pin
	mov	x22, x0
	cbnz	w0, LBB0_8
; %bb.5:
	ldr	x0, [x19, #8]
	mov	w1, #0
	bl	_i915_gem_object_set_to_gtt_domain
	mov	x22, x0
	ldr	x0, [x19, #8]
	cbz	w22, LBB0_9
; %bb.6:
	bl	_i915_gem_object_unpin
	b	LBB0_8
LBB0_7:
	mov	w22, #0
LBB0_8:
	mov	x0, x22
	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
LBB0_9:
	ldr	w8, [x0, #28]
	cbnz	w8, LBB0_11
; %bb.10:
	ldr	w1, [x0, #24]
	bl	_i915_gem_gtt_bind_object
LBB0_11:
	ldr	w8, [x19]
	cbz	w8, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_is_default_context
	cbz	x0, LBB0_14
LBB0_13:
Lloh3:
	adrp	x8, _MI_RESTORE_INHIBIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MI_RESTORE_INHIBIT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	b	LBB0_15
LBB0_14:
	ldr	x8, [x19, #8]
	cmp	x21, x8
	cset	w0, eq
	bl	_WARN_ON_ONCE
Lloh6:
	adrp	x8, _MI_FORCE_RESTORE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MI_FORCE_RESTORE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w2, wzr, w8, eq
LBB0_15:
	mov	x0, x20
	mov	x1, x19
	bl	_mi_set_context
	cbz	w0, LBB0_17
; %bb.16:
	mov	x22, x0
	ldr	x0, [x19, #8]
	bl	_i915_gem_object_unpin
	b	LBB0_8
LBB0_17:
	cbz	x21, LBB0_19
; %bb.18:
Lloh9:
	adrp	x8, _I915_GEM_DOMAIN_INSTRUCTION@GOTPAGE
Lloh10:
	ldr	x8, [x8, _I915_GEM_DOMAIN_INSTRUCTION@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	mov	x22, x21
	str	w8, [x22, #12]!
	mov	x0, x21
	mov	x1, x20
	bl	_i915_gem_object_move_to_active
	mov	w8, #1
	str	w8, [x21, #8]
	ldr	x8, [x21, #16]
	cmp	x8, x20
	cset	w0, ne
	bl	_BUG_ON
	mov	x0, x21
	bl	_i915_gem_object_unpin
	mov	x0, x22
	bl	_drm_gem_object_unreference
LBB0_19:
	ldr	x8, [x19, #8]
	add	x0, x8, #12
	bl	_drm_gem_object_reference
	mov	w22, #0
	ldr	x8, [x19, #8]
	str	x8, [x20]
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CONTEXT_ALIGN,4,2              ; @CONTEXT_ALIGN
	.comm	_MI_RESTORE_INHIBIT,4,2         ; @MI_RESTORE_INHIBIT
	.comm	_MI_FORCE_RESTORE,4,2           ; @MI_FORCE_RESTORE
	.comm	_I915_GEM_DOMAIN_INSTRUCTION,4,2 ; @I915_GEM_DOMAIN_INSTRUCTION
	.no_dead_strip	_do_switch
.subsections_via_symbols
