	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gru_unload_context             ## -- Begin function gru_unload_context
	.p2align	4, 0x90
_gru_unload_context:                    ## @gru_unload_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
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	24(%rdi), %r15
	movl	(%rdi), %r14d
	callq	_is_kernel_context
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	20(%rbx), %r12d
	movq	%rbx, %rdi
	callq	_UGRUADDR
	movq	_GRU_GSEG_PAGESIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_zap_vma_ptes
LBB0_2:
	movl	(%r15), %edi
	movl	%r14d, %esi
	callq	_get_cch
	movq	%rax, %r12
	movq	_grudev@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%rbx), %r8d
	movl	12(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_gru_dbg
	movq	%r12, %rdi
	callq	_lock_cch_handle
	movq	%r12, %rdi
	callq	_cch_interrupt_sync
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_BUG
LBB0_4:
	movq	%rbx, %rdi
	callq	_is_kernel_context
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	testl	%r13d, %r13d
	je	LBB0_8
LBB0_7:
	movl	16(%rbx), %edi
	movl	(%r15), %esi
	movl	8(%rbx), %r8d
	movl	12(%rbx), %ecx
	movl	%r14d, %edx
	callq	_gru_unload_context_data
	movl	$1, 4(%rbx)
LBB0_8:
	movq	%r12, %rdi
	callq	_cch_deallocate
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	callq	_BUG
LBB0_10:
	movq	%r12, %rdi
	callq	_unlock_cch_handle
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gru_free_gru_context           ## TAILCALL
LBB0_5:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_gru_unload_mm_tracker
	testl	%r13d, %r13d
	jne	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_GRU_GSEG_PAGESIZE,4,2          ## @GRU_GSEG_PAGESIZE
	.comm	_grudev,4,2                     ## @grudev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gts %p, cbrmap 0x%lx, dsrmap 0x%lx\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gru_unload_context             ; -- Begin function gru_unload_context
	.p2align	2
_gru_unload_context:                    ; @gru_unload_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	x22, x1
	mov	x19, x0
	ldr	x21, [x0, #24]
	ldr	w20, [x0]
	bl	_is_kernel_context
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w23, [x19, #20]
	mov	x0, x19
	bl	_UGRUADDR
	mov	x1, x0
Lloh0:
	adrp	x8, _GRU_GSEG_PAGESIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GRU_GSEG_PAGESIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x23
	bl	_zap_vma_ptes
LBB0_2:
	ldr	w0, [x21]
	mov	x1, x20
	bl	_get_cch
	mov	x23, x0
Lloh3:
	adrp	x8, _grudev@GOTPAGE
Lloh4:
	ldr	x8, [x8, _grudev@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldp	w4, w3, [x19, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_gru_dbg
	mov	x0, x23
	bl	_lock_cch_handle
	mov	x0, x23
	bl	_cch_interrupt_sync
	cbz	x0, LBB0_4
; %bb.3:
	bl	_BUG
LBB0_4:
	mov	x0, x19
	bl	_is_kernel_context
	cbz	w0, LBB0_10
; %bb.5:
	cbz	w22, LBB0_7
LBB0_6:
	ldp	w3, w0, [x19, #12]
	ldr	w1, [x21]
	ldr	w4, [x19, #8]
	mov	x2, x20
	bl	_gru_unload_context_data
	mov	w8, #1
	str	w8, [x19, #4]
LBB0_7:
	mov	x0, x23
	bl	_cch_deallocate
	cbz	x0, LBB0_9
; %bb.8:
	bl	_BUG
LBB0_9:
	mov	x0, x23
	bl	_unlock_cch_handle
	mov	x0, x19
	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
	b	_gru_free_gru_context
LBB0_10:
	mov	x0, x21
	mov	x1, x19
	bl	_gru_unload_mm_tracker
	cbnz	w22, LBB0_6
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GRU_GSEG_PAGESIZE,4,2          ; @GRU_GSEG_PAGESIZE
	.comm	_grudev,4,2                     ; @grudev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gts %p, cbrmap 0x%lx, dsrmap 0x%lx\n"

.subsections_via_symbols
