	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gru_fault                      ## -- Begin function gru_fault
	.p2align	4, 0x90
_gru_fault:                             ## @gru_fault
	.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), %r14
	movq	_grudev@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_GSEG_BASE
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%r14, %rdx
	movq	%r15, %rcx
	movl	%eax, %r8d
	callq	_gru_dbg
	movq	_nopfn@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STAT
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_TSID
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_gru_find_thread_state
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	xorl	%eax, %eax
	callq	_preempt_disable
	movq	%rbx, %rdi
	callq	_gru_check_context_placement
	cmpl	$0, 16(%rbx)
	jne	LBB0_9
## %bb.3:
	movq	_jiffies@GOTPCREL(%rip), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_mutex_lock
	xorl	%eax, %eax
	callq	_preempt_disable
	movq	%rbx, %rdi
	callq	_gru_check_context_placement
	cmpl	$0, 16(%rbx)
	jne	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_load_user_context@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STAT
	movq	%rbx, %rdi
	callq	_gru_assign_gru_context
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	callq	_preempt_enable
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_set_current_state
	movq	_GRU_ASSIGN_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_schedule_timeout
	movq	_GRU_STEAL_DELAY@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	movl	(%r13), %esi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_gru_steal_context
	jmp	LBB0_7
LBB0_1:
	movq	_VM_FAULT_SIGBUS@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	%rbx, %rdi
	callq	_gru_load_context
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_gseg_physical_address
	movq	_GRU_GSEG_PAGESIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%ebx, %ecx
	negl	%ecx
	movslq	%ecx, %rcx
	andq	%rcx, %r15
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rax
	movl	(%r14), %r8d
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rax, %rdx
	movl	%ebx, %ecx
	callq	_remap_pfn_range
LBB0_9:
	xorl	%eax, %eax
	callq	_preempt_enable
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	_VM_FAULT_NOPAGE@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_grudev,4,2                     ## @grudev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vma %p, vaddr 0x%lx (0x%lx)\n"

	.comm	_nopfn,4,2                      ## @nopfn
	.comm	_VM_FAULT_SIGBUS,4,2            ## @VM_FAULT_SIGBUS
	.comm	_load_user_context,4,2          ## @load_user_context
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_GRU_ASSIGN_DELAY,4,2           ## @GRU_ASSIGN_DELAY
	.comm	_GRU_STEAL_DELAY,8,3            ## @GRU_STEAL_DELAY
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_GRU_GSEG_PAGESIZE,4,2          ## @GRU_GSEG_PAGESIZE
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_VM_FAULT_NOPAGE,4,2            ## @VM_FAULT_NOPAGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gru_fault                      ; -- Begin function gru_fault
	.p2align	2
_gru_fault:                             ; @gru_fault
	.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
	ldp	x20, x19, [x0]
Lloh0:
	adrp	x8, _grudev@GOTPAGE
Lloh1:
	ldr	x8, [x8, _grudev@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_GSEG_BASE
	mov	x4, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	mov	x3, x20
	bl	_gru_dbg
Lloh5:
	adrp	x8, _nopfn@GOTPAGE
Lloh6:
	ldr	x8, [x8, _nopfn@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_STAT
	mov	x0, x20
	mov	x1, x19
	bl	_TSID
	mov	x1, x0
	mov	x0, x19
	bl	_gru_find_thread_state
	cbz	x0, LBB0_7
; %bb.1:
	mov	x22, x0
	add	x21, x0, #8
	mov	x0, x21
	bl	_mutex_lock
	bl	_preempt_disable
	mov	x0, x22
	bl	_gru_check_context_placement
	ldr	w8, [x22, #16]
	cbnz	w8, LBB0_9
; %bb.2:
Lloh8:
	adrp	x23, _load_user_context@GOTPAGE
Lloh9:
	ldr	x23, [x23, _load_user_context@GOTPAGEOFF]
Lloh10:
	adrp	x24, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh11:
	ldr	x24, [x24, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh12:
	adrp	x25, _GRU_ASSIGN_DELAY@GOTPAGE
Lloh13:
	ldr	x25, [x25, _GRU_ASSIGN_DELAY@GOTPAGEOFF]
Lloh14:
	adrp	x26, _GRU_STEAL_DELAY@GOTPAGE
Lloh15:
	ldr	x26, [x26, _GRU_STEAL_DELAY@GOTPAGEOFF]
Lloh16:
	adrp	x27, _jiffies@GOTPAGE
Lloh17:
	ldr	x27, [x27, _jiffies@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_mutex_lock
	bl	_preempt_disable
	mov	x0, x22
	bl	_gru_check_context_placement
	ldr	w8, [x22, #16]
	cbnz	w8, LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_STAT
	mov	x0, x22
	bl	_gru_assign_gru_context
	cbnz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_preempt_enable
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w0, [x24]
	bl	_set_current_state
	ldr	w0, [x25]
	bl	_schedule_timeout
	ldr	x8, [x22]
	ldr	x9, [x26]
	add	x0, x9, x8
	ldr	w1, [x27]
	bl	_time_before
	cbz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	bl	_gru_steal_context
	b	LBB0_3
LBB0_7:
Lloh18:
	adrp	x8, _VM_FAULT_SIGBUS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VM_FAULT_SIGBUS@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	mov	x0, x22
	bl	_gru_load_context
	ldp	w1, w0, [x22, #12]
	bl	_gseg_physical_address
Lloh20:
	adrp	x8, _GRU_GSEG_PAGESIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _GRU_GSEG_PAGESIZE@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	neg	w8, w3
	sxtw	x8, w8
	and	x1, x20, x8
Lloh23:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	lsr	x2, x0, x8
	ldr	w4, [x19]
	mov	x0, x19
	bl	_remap_pfn_range
LBB0_9:
	bl	_preempt_enable
	mov	x0, x21
	bl	_mutex_unlock
Lloh26:
	adrp	x8, _VM_FAULT_NOPAGE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _VM_FAULT_NOPAGE@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_grudev,4,2                     ; @grudev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vma %p, vaddr 0x%lx (0x%lx)\n"

	.comm	_nopfn,4,2                      ; @nopfn
	.comm	_VM_FAULT_SIGBUS,4,2            ; @VM_FAULT_SIGBUS
	.comm	_load_user_context,4,2          ; @load_user_context
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_GRU_ASSIGN_DELAY,4,2           ; @GRU_ASSIGN_DELAY
	.comm	_GRU_STEAL_DELAY,8,3            ; @GRU_STEAL_DELAY
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_GRU_GSEG_PAGESIZE,4,2          ; @GRU_GSEG_PAGESIZE
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_VM_FAULT_NOPAGE,4,2            ; @VM_FAULT_NOPAGE
.subsections_via_symbols
