	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gru_load_kernel_context
_gru_load_kernel_context:               ## @gru_load_kernel_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_up_read
	movq	%r14, %rdi
	callq	_down_write
	movq	16(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.4:
	cmpq	$0, 8(%rbx)
	jne	LBB0_9
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_1:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_msleep
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_gru_alloc_gts
	movq	%rax, 16(%r14)
	movq	%rax, %rdi
	callq	_IS_ERR
	testl	%eax, %eax
	jne	LBB0_1
## %bb.3:
	movq	16(%r14), %rbx
	movl	%r15d, (%rbx)
	cmpq	$0, 8(%rbx)
	jne	LBB0_9
LBB0_5:
	movq	_load_kernel_context@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STAT
	movl	%r15d, %edi
	callq	_uv_blade_nr_possible_cpus
	movq	_GRU_NUM_KERNEL_CBR@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdi
	movslq	%eax, %r15
	imulq	%r15, %rdi
	addq	32(%r14), %rdi
	callq	_GRU_CB_COUNT_TO_AU
	movl	%eax, 20(%rbx)
	movq	_GRU_NUM_KERNEL_DSR_BYTES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rdi
	imulq	%r15, %rdi
	addq	24(%r14), %rdi
	callq	_GRU_DS_BYTES_TO_AU
	movl	%eax, 16(%rbx)
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_gru_assign_gru_context
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	$1, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_gru_steal_context
	jmp	LBB0_7
LBB0_8:
	movq	%rbx, %rdi
	callq	_gru_load_context
	movq	16(%r14), %rax
	movq	8(%rax), %rax
	movq	(%rax), %r15
	movl	4(%rbx), %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_get_gseg_base_address_cb
	movl	%eax, 8(%r14)
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_get_gseg_base_address_ds
	movl	%eax, 4(%r14)
LBB0_9:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_downgrade_write                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_load_kernel_context,4,2        ## @load_kernel_context
	.comm	_GRU_NUM_KERNEL_CBR,4,2         ## @GRU_NUM_KERNEL_CBR
	.comm	_GRU_NUM_KERNEL_DSR_BYTES,4,2   ## @GRU_NUM_KERNEL_DSR_BYTES
	.no_dead_strip	_gru_load_kernel_context
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gru_load_kernel_context
_gru_load_kernel_context:               ; @gru_load_kernel_context
	.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	x20, x1
	mov	x19, x0
	bl	_up_read
	mov	x0, x19
	bl	_down_write
	ldr	x21, [x19, #16]
	cbz	x21, LBB0_3
; %bb.1:
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_9
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_msleep
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, #0
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_gru_alloc_gts
	str	x0, [x19, #16]
	bl	_IS_ERR
	cbnz	w0, LBB0_2
; %bb.4:
	ldr	x21, [x19, #16]
	str	w20, [x21]
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_9
LBB0_5:
Lloh0:
	adrp	x8, _load_kernel_context@GOTPAGE
Lloh1:
	ldr	x8, [x8, _load_kernel_context@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_STAT
	mov	x0, x20
	bl	_uv_blade_nr_possible_cpus
                                        ; kill: def $w0 killed $w0 def $x0
Lloh3:
	adrp	x8, _GRU_NUM_KERNEL_CBR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GRU_NUM_KERNEL_CBR@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	sxtw	x20, w0
	ldr	x9, [x19, #32]
	madd	x0, x8, x20, x9
	bl	_GRU_CB_COUNT_TO_AU
	str	w0, [x21, #20]
Lloh6:
	adrp	x8, _GRU_NUM_KERNEL_DSR_BYTES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GRU_NUM_KERNEL_DSR_BYTES@GOTPAGEOFF]
Lloh8:
	ldrsw	x8, [x8]
	ldr	x9, [x19, #24]
	madd	x0, x8, x20, x9
	bl	_GRU_DS_BYTES_TO_AU
	str	w0, [x21, #16]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_gru_assign_gru_context
	cbnz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #1
	bl	_msleep
	mov	x0, x21
	bl	_gru_steal_context
	b	LBB0_6
LBB0_8:
	mov	x0, x21
	bl	_gru_load_context
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	ldr	x20, [x8]
	ldr	w21, [x21, #4]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_get_gseg_base_address_cb
	str	w0, [x19, #8]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #0
	bl	_get_gseg_base_address_ds
	str	w0, [x19, #4]
LBB0_9:
	mov	x0, x19
	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
	b	_downgrade_write
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_load_kernel_context,4,2        ; @load_kernel_context
	.comm	_GRU_NUM_KERNEL_CBR,4,2         ; @GRU_NUM_KERNEL_CBR
	.comm	_GRU_NUM_KERNEL_DSR_BYTES,4,2   ; @GRU_NUM_KERNEL_DSR_BYTES
	.no_dead_strip	_gru_load_kernel_context
.subsections_via_symbols
