	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_grctx_init                ## -- Begin function nv50_grctx_init
	.p2align	4, 0x90
_nv50_grctx_init:                       ## @nv50_grctx_init
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$2048, %edi                     ## imm = 0x800
	callq	_kmalloc
	movq	%rax, %r13
	movq	%rax, -80(%rbp)
	movl	$512, -72(%rbp)                 ## imm = 0x200
	movq	$0, -64(%rbp)
	movl	$0, -56(%rbp)
	movq	_NVKM_GRCTX_PROG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	%r15, -48(%rbp)
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	leaq	-80(%rbp), %rdi
	callq	_nv50_grctx_generate
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movl	$4195108, %esi                  ## imm = 0x400324
	xorl	%edx, %edx
	callq	_nvkm_wr32
	cmpq	$0, -64(%rbp)
	je	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rbx,8), %rdx
	movq	%r15, %rdi
	movl	$4195112, %esi                  ## imm = 0x400328
	callq	_nvkm_wr32
	incq	%rbx
	cmpq	-64(%rbp), %rbx
	jb	LBB0_4
LBB0_5:
	movslq	-56(%rbp), %rax
	shlq	$2, %rax
	movq	%rax, (%r14)
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_NVKM_GRCTX_PROG,4,2            ## @NVKM_GRCTX_PROG
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_grctx_init                ; -- Begin function nv50_grctx_init
	.p2align	2
_nv50_grctx_init:                       ; @nv50_grctx_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #2048
	bl	_kmalloc
	str	x0, [sp, #8]
	mov	w8, #512
	str	w8, [sp, #16]
	str	xzr, [sp, #24]
Lloh3:
	adrp	x8, _NVKM_GRCTX_PROG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NVKM_GRCTX_PROG@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #32]
	str	x20, [sp, #40]
	cbz	x0, LBB0_5
; %bb.1:
	mov	x21, x0
	mov	w22, #804
	movk	w22, #64, lsl #16
	add	x0, sp, #8
	bl	_nv50_grctx_generate
	mov	x0, x20
	mov	w1, #804
	movk	w1, #64, lsl #16
	mov	x2, #0
	bl	_nvkm_wr32
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x23, #0
	add	w22, w22, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x21, x23, lsl #3]
	mov	x0, x20
	mov	x1, x22
	bl	_nvkm_wr32
	add	x23, x23, #1
	ldr	x8, [sp, #24]
	cmp	x23, x8
	b.lo	LBB0_3
LBB0_4:
	ldrsw	x8, [sp, #32]
	lsl	x8, x8, #2
	str	x8, [x19]
	mov	x0, x21
	bl	_kfree
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_NVKM_GRCTX_PROG,4,2            ; @NVKM_GRCTX_PROG
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
