	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvc0_grctx_init                ## -- Begin function nvc0_grctx_init
	.p2align	4, 0x90
_nvc0_grctx_init:                       ## @nvc0_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_nouveau_bar
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_nv_object
	movl	$528383, %r12d                  ## imm = 0x80FFF
	addl	(%r14), %r12d
	andl	$-4096, %r12d                   ## imm = 0xF000
	movq	_NVOBJ_FLAG_ZERO_ALLOC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	8(%r13), %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	$4096, %ecx                     ## imm = 0x1000
	movq	%r15, %r9
	callq	_nouveau_gpuobj_new
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nv_error
	jmp	LBB0_12
LBB0_2:
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rbx
	movl	(%rbx), %edi
	movl	$4096, %r15d                    ## imm = 0x1000
	addl	%r15d, %edi
	callq	_lower_32_bits
	movq	%rbx, %rdi
	movl	$512, %esi                      ## imm = 0x200
	movl	%eax, %edx
	callq	_nv_wo32
	movl	(%rbx), %edi
	addl	%r15d, %edi
	callq	_upper_32_bits
	movq	%rbx, %rdi
	movl	$516, %esi                      ## imm = 0x204
	movl	%eax, %edx
	callq	_nv_wo32
	movq	%rbx, %rdi
	movl	$520, %esi                      ## imm = 0x208
	movl	$-1, %edx
	callq	_nv_wo32
	movq	%rbx, %rdi
	movl	$524, %esi                      ## imm = 0x20C
	movl	$255, %edx
	callq	_nv_wo32
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movl	$4096, %esi                     ## imm = 0x1000
	xorl	%edx, %edx
	callq	_nv_wo32
	movl	$8192, %r13d                    ## imm = 0x2000
	movl	(%rbx), %edx
	addl	%r13d, %edx
	sarl	$8, %edx
	orl	$1, %edx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$4100, %esi                     ## imm = 0x1004
	callq	_nv_wo32
	leal	4095(%r12), %eax
	testl	%r12d, %r12d
	cmovnsl	%r12d, %eax
	cmpl	$4096, %r12d                    ## imm = 0x1000
	jl	LBB0_6
## %bb.3:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	sarl	$12, %eax
	movl	$8192, %r14d                    ## imm = 0x2000
	movq	%rax, %rcx
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%eax, %r13d
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %ebx
	addl	%r15d, %ebx
	sarl	$8, %ebx
	orl	$1, %ebx
	movl	%ebx, %edi
	callq	_lower_32_bits
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_nv_wo32
	leal	4(%r14), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_upper_32_bits
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%eax, %edx
	callq	_nv_wo32
	addl	$4096, %r15d                    ## imm = 0x1000
	addl	$8, %r14d
	decl	%r13d
	jne	LBB0_4
## %bb.5:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leal	8192(,%rax,8), %r13d
	movq	-80(%rbp), %r14                 ## 8-byte Reload
LBB0_6:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	$528, %esi                      ## imm = 0x210
	movl	$524292, %edx                   ## imm = 0x80004
	callq	_nv_wo32
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	$532, %esi                      ## imm = 0x214
	xorl	%edx, %edx
	callq	_nv_wo32
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	*(%rdi)
	movl	$4096, %edx                     ## imm = 0x1000
	addl	(%r15), %edx
	sarl	$8, %edx
	movq	%r14, %rdi
	movl	$1051832, %esi                  ## imm = 0x100CB8
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$1051836, %esi                  ## imm = 0x100CBC
	movl	$-2147483647, %edx              ## imm = 0x80000001
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$1051776, %esi                  ## imm = 0x100C80
	movl	$32768, %edx                    ## imm = 0x8000
	movl	$32768, %ecx                    ## imm = 0x8000
	callq	_nv_wait
	movl	20(%r14), %eax
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 36(%rcx)
	movl	16(%r14), %eax
	movl	%eax, 32(%rcx)
	movl	%r13d, (%rcx)
	movq	%r14, 24(%rcx)
	movq	$0, 16(%rcx)
	cmpq	$0, 8(%r14)
	je	LBB0_10
## %bb.7:
	movq	%r14, %rdi
	movl	$4233280, %esi                  ## imm = 0x409840
	movl	$48, %edx
	callq	_nv_wr32
	movl	(%r15), %edx
	sarl	$12, %edx
	orl	$-2147483648, %edx              ## imm = 0x80000000
	movq	%r14, %rdi
	movl	$4232448, %esi                  ## imm = 0x409500
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$4232452, %esi                  ## imm = 0x409504
	movl	$3, %edx
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$4233216, %esi                  ## imm = 0x409800
	movl	$16, %edx
	movl	$16, %ecx
	callq	_nv_wait
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_nv_error
LBB0_9:
	movq	%r15, %rdi
	movl	$524316, %esi                   ## imm = 0x8001C
	movl	$1, %edx
	callq	_nv_wo32
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	$524320, %esi                   ## imm = 0x80020
	xorl	%edx, %edx
	callq	_nv_wo32
	movq	%r15, %rdi
	movl	$524328, %esi                   ## imm = 0x80028
	xorl	%edx, %edx
	callq	_nv_wo32
	movq	%r15, %rdi
	movl	$524332, %esi                   ## imm = 0x8002C
	xorl	%edx, %edx
	callq	_nv_wo32
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	*(%rdi)
	jmp	LBB0_12
LBB0_10:
	movq	%r14, %rdi
	movl	$4233280, %esi                  ## imm = 0x409840
	movl	$-2147483648, %edx              ## imm = 0x80000000
	callq	_nv_wr32
	movl	(%r15), %edx
	sarl	$12, %edx
	orl	$-2147483648, %edx              ## imm = 0x80000000
	movq	%r14, %rdi
	movl	$4232448, %esi                  ## imm = 0x409500
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$4232452, %esi                  ## imm = 0x409504
	movl	$1, %edx
	callq	_nv_wr32
	movq	%r14, %rdi
	movl	$4233216, %esi                  ## imm = 0x409800
	movl	$-2147483648, %edx              ## imm = 0x80000000
	movl	$-2147483648, %ecx              ## imm = 0x80000000
	callq	_nv_wait
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_nv_error
	movq	%r14, %rdi
	callq	_nvc0_graph_ctxctl_debug
	xorl	%edi, %edi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_nouveau_gpuobj_ref
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVOBJ_FLAG_ZERO_ALLOC,4,2      ## @NVOBJ_FLAG_ZERO_ALLOC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate channel memory, %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"load_ctx timeout\n"

L_.str.2:                               ## @.str.2
	.asciz	"HUB_SET_CHAN timeout\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvc0_grctx_init                ; -- Begin function nvc0_grctx_init
	.p2align	2
_nvc0_grctx_init:                       ; @nvc0_grctx_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x1
	mov	x19, x0
	mov	w27, #4
	movk	w27, #8, lsl #16
	bl	_nouveau_bar
	mov	x26, x0
	mov	x0, x19
	bl	_nv_object
	ldr	w8, [x19]
	add	w8, w8, w27
	add	w8, w8, #4091
	and	w24, w8, #0xfffff000
Lloh0:
	adrp	x8, _NVOBJ_FLAG_ZERO_ALLOC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVOBJ_FLAG_ZERO_ALLOC@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
	add	x22, x23, #8
	mov	x1, #0
	mov	x2, x24
	mov	w3, #4096
	mov	x5, x22
	bl	_nouveau_gpuobj_new
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	str	x21, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_nv_error
	b	LBB0_14
LBB0_2:
	ldr	x21, [x23, #8]
	ldr	w8, [x21]
	add	w0, w8, #1, lsl #12             ; =4096
	bl	_lower_32_bits
	mov	x2, x0
	mov	x0, x21
	mov	w1, #512
	bl	_nv_wo32
	ldr	w8, [x21]
	add	w0, w8, #1, lsl #12             ; =4096
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x21
	mov	w1, #516
	bl	_nv_wo32
	mov	x0, x21
	mov	w1, #520
	mov	w2, #-1
	bl	_nv_wo32
	mov	x0, x21
	mov	w1, #524
	mov	w2, #255
	bl	_nv_wo32
	mov	x0, x21
	mov	w1, #4096
	mov	w2, #0
	bl	_nv_wo32
	ldr	w8, [x21]
	add	w8, w8, #2, lsl #12             ; =8192
	asr	w8, w8, #8
	orr	w2, w8, #0x1
	mov	x0, x21
	mov	w1, #4100
	bl	_nv_wo32
	add	w8, w24, #4095
	cmp	w24, #0
	csel	w8, w8, w24, lt
	cmp	w24, #1, lsl #12                ; =4096
	b.lt	LBB0_6
; %bb.3:
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	mov	w27, #0
	asr	w20, w8, #12
	mov	w24, #8192
	mov	x28, x20
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	add	w8, w27, w8
	asr	w8, w8, #8
	orr	w25, w8, #0x1
	mov	x0, x25
	bl	_lower_32_bits
	mov	x2, x0
	mov	x0, x21
	mov	x1, x24
	bl	_nv_wo32
	add	w26, w24, #4
	mov	x0, x25
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x21
	mov	x1, x26
	bl	_nv_wo32
	add	w27, w27, #1, lsl #12           ; =4096
	add	w24, w24, #8
	subs	w28, w28, #1
	b.ne	LBB0_4
; %bb.5:
	lsl	w8, w20, #3
	add	w25, w8, #2, lsl #12            ; =8192
	ldr	x26, [sp, #8]                   ; 8-byte Folded Reload
	mov	w27, #4
	movk	w27, #8, lsl #16
	b	LBB0_7
LBB0_6:
	mov	w25, #8192
LBB0_7:
	mov	w24, #38144
	movk	w24, #64, lsl #16
	mov	x0, x21
	mov	w1, #528
	mov	w2, #4
	movk	w2, #8, lsl #16
	bl	_nv_wo32
	mov	x0, x21
	mov	w1, #532
	mov	w2, #0
	bl	_nv_wo32
	ldr	x8, [x26]
	mov	x0, x26
	blr	x8
	ldr	w8, [x21]
	add	w8, w8, #1, lsl #12             ; =4096
	asr	w2, w8, #8
	mov	w20, #3200
	movk	w20, #16, lsl #16
	orr	w1, w20, #0x38
	mov	x0, x19
	bl	_nv_wr32
	orr	w1, w20, #0x3c
	mov	x0, x19
	mov	w2, #-2147483647
	bl	_nv_wr32
	mov	x0, x19
	mov	w1, #3200
	movk	w1, #16, lsl #16
	mov	w2, #32768
	mov	w3, #32768
	bl	_nv_wait
	ldr	d0, [x19, #16]
	str	d0, [x23, #32]
	str	w25, [x23]
	stp	xzr, x19, [x23, #16]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.8:
	add	w1, w24, #832
	mov	x0, x19
	mov	w2, #48
	bl	_nv_wr32
	ldr	w8, [x21]
	asr	w8, w8, #12
	orr	w2, w8, #0x80000000
	mov	x0, x19
	mov	w1, #38144
	movk	w1, #64, lsl #16
	bl	_nv_wr32
	add	w1, w24, #4
	mov	x0, x19
	mov	w2, #3
	bl	_nv_wr32
	add	w1, w24, #768
	mov	x0, x19
	mov	w2, #16
	mov	w3, #16
	bl	_nv_wait
	cbnz	w0, LBB0_10
; %bb.9:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_nv_error
LBB0_10:
	add	w1, w27, #24
	mov	x0, x21
	mov	w2, #1
	bl	_nv_wo32
	add	w1, w27, #28
	mov	x0, x21
	mov	w2, #0
	bl	_nv_wo32
	add	w1, w27, #36
	mov	x0, x21
	mov	w2, #0
	bl	_nv_wo32
	add	w1, w27, #40
	mov	x0, x21
	mov	w2, #0
	bl	_nv_wo32
	ldr	x8, [x26]
	mov	x0, x26
	blr	x8
	mov	w21, #0
	b	LBB0_14
LBB0_11:
	add	w1, w24, #832
	mov	x0, x19
	mov	w2, #-2147483648
	bl	_nv_wr32
	ldr	w8, [x21]
	asr	w8, w8, #12
	orr	w2, w8, #0x80000000
	mov	x0, x19
	mov	w1, #38144
	movk	w1, #64, lsl #16
	bl	_nv_wr32
	add	w1, w24, #4
	mov	x0, x19
	mov	w2, #1
	bl	_nv_wr32
	add	w1, w24, #768
	mov	x0, x19
	mov	w2, #-2147483648
	mov	w3, #-2147483648
	bl	_nv_wait
	cbz	w0, LBB0_13
; %bb.12:
	mov	w21, #0
	b	LBB0_14
LBB0_13:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_nv_error
	mov	x0, x19
	bl	_nvc0_graph_ctxctl_debug
	mov	x0, #0
	mov	x1, x22
	bl	_nouveau_gpuobj_ref
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_14:
	mov	x0, x21
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NVOBJ_FLAG_ZERO_ALLOC,4,2      ; @NVOBJ_FLAG_ZERO_ALLOC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate channel memory, %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"load_ctx timeout\n"

l_.str.2:                               ; @.str.2
	.asciz	"HUB_SET_CHAN timeout\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
