	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv10_gr_context_switch
_nv10_gr_context_switch:                ## @nv10_gr_context_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	addq	$8, %rdi
	movq	8(%rbx), %r14
	callq	_nv04_gr_idle
	movq	%rbx, %rdi
	callq	_nv10_gr_channel
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rdi
	callq	_nv10_gr_unload_context
LBB0_2:
	movq	_NV04_PGRAPH_TRAPPED_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_nvkm_rd32
                                        ## kill: def $eax killed $eax def $rax
	shrl	$20, %eax
	andl	$31, %eax
	movq	(%rbx), %rcx
	movq	(%rcx,%rax,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.4:
	movl	%eax, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_nv10_gr_load_context           ## TAILCALL
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV04_PGRAPH_TRAPPED_ADDR,4,2   ## @NV04_PGRAPH_TRAPPED_ADDR
	.no_dead_strip	_nv10_gr_context_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv10_gr_context_switch
_nv10_gr_context_switch:                ; @nv10_gr_context_switch
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #8]!
	bl	_nv04_gr_idle
	mov	x0, x19
	bl	_nv10_gr_channel
	cbz	x0, LBB0_2
; %bb.1:
	bl	_nv10_gr_unload_context
LBB0_2:
Lloh0:
	adrp	x8, _NV04_PGRAPH_TRAPPED_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NV04_PGRAPH_TRAPPED_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_nvkm_rd32
	ubfx	w1, w0, #20, #5
	ldr	x8, [x19]
	ldr	x0, [x8, w1, uxtw #3]
	cbz	x0, LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_nv10_gr_load_context
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NV04_PGRAPH_TRAPPED_ADDR,4,2   ; @NV04_PGRAPH_TRAPPED_ADDR
	.no_dead_strip	_nv10_gr_context_switch
.subsections_via_symbols
