	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv10_gr_chan_new               ## -- Begin function nv10_gr_chan_new
	.p2align	4, 0x90
_nv10_gr_chan_new:                      ## @nv10_gr_chan_new
	.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	%rcx, %r13
	movq	%rdx, %r15
	movq	%rsi, %rbx
	callq	_nv10_gr
	movq	%rax, %r12
	movq	16(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r15, %rsi
	movq	%rbx, %r15
	movq	%rax, %rbx
	addq	$4, %rbx
	movq	_nv10_gr_chan@GOTPCREL(%rip), %rdi
	movq	%rbx, %rdx
	callq	_nvkm_object_ctor
	movq	%r12, 8(%r14)
	movl	(%r15), %eax
	movl	%eax, (%r14)
	movq	%rbx, (%r13)
	movl	$4198024, %edi                  ## imm = 0x400E88
	movl	$134217728, %esi                ## imm = 0x8000000
	callq	_NV_WRITE_CTX
	movl	$4198044, %edi                  ## imm = 0x400E9C
	movl	$1266679807, %esi               ## imm = 0x4B7FFFFF
	callq	_NV_WRITE_CTX
	movq	_NV03_PGRAPH_XY_LOGIC_MISC0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$131071, %esi                   ## imm = 0x1FFFF
	callq	_NV_WRITE_CTX
	movl	$4197904, %edi                  ## imm = 0x400E10
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_NV_WRITE_CTX
	movl	$4197908, %edi                  ## imm = 0x400E14
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_NV_WRITE_CTX
	movl	$4197936, %edi                  ## imm = 0x400E30
	movl	$524296, %esi                   ## imm = 0x80008
	callq	_NV_WRITE_CTX
	movl	$4197940, %edi                  ## imm = 0x400E34
	movl	$524296, %esi                   ## imm = 0x80008
	callq	_NV_WRITE_CTX
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	movq	_NV_11@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_5
## %bb.3:
	cmpl	$23, 8(%rbx)
	jl	LBB0_5
## %bb.4:
	movq	_NV10_PGRAPH_DEBUG_4@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_nvkm_rd32
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_NV17_WRITE_CTX
	movq	%rbx, %rdi
	movl	$4196016, %esi                  ## imm = 0x4006B0
	callq	_nvkm_rd32
	movl	$4196016, %edi                  ## imm = 0x4006B0
	movl	%eax, %esi
	callq	_NV17_WRITE_CTX
	movl	$4198060, %edi                  ## imm = 0x400EAC
	movl	$268369920, %esi                ## imm = 0xFFF0000
	callq	_NV17_WRITE_CTX
	movl	$4198064, %edi                  ## imm = 0x400EB0
	movl	$268369920, %esi                ## imm = 0xFFF0000
	callq	_NV17_WRITE_CTX
	movl	$4198080, %edi                  ## imm = 0x400EC0
	movl	$128, %esi
	callq	_NV17_WRITE_CTX
	movl	$4198096, %edi                  ## imm = 0x400ED0
	movl	$128, %esi
	callq	_NV17_WRITE_CTX
LBB0_5:
	movq	_NV10_PGRAPH_CTX_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	shll	$24, %esi
	callq	_NV_WRITE_CTX
	movq	%r14, %rdi
	callq	_nv10_gr_create_pipe
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r12), %rax
	movslq	(%r14), %rcx
	movq	%r14, (%rax,%rcx,8)
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %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	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_nv10_gr_chan,4,2               ## @nv10_gr_chan
	.comm	_NV03_PGRAPH_XY_LOGIC_MISC0,4,2 ## @NV03_PGRAPH_XY_LOGIC_MISC0
	.comm	_NV_11,8,3                      ## @NV_11
	.comm	_NV10_PGRAPH_DEBUG_4,4,2        ## @NV10_PGRAPH_DEBUG_4
	.comm	_NV10_PGRAPH_CTX_USER,4,2       ## @NV10_PGRAPH_CTX_USER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv10_gr_chan_new               ; -- Begin function nv10_gr_chan_new
	.p2align	2
_nv10_gr_chan_new:                      ; @nv10_gr_chan_new
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x3
	mov	x24, x2
	mov	x23, x1
	bl	_nv10_gr
	mov	x19, x0
	ldr	x21, [x0, #16]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	mov	w26, #1712
	movk	w26, #64, lsl #16
	add	x25, x0, #4
Lloh3:
	adrp	x0, _nv10_gr_chan@GOTPAGE
Lloh4:
	ldr	x0, [x0, _nv10_gr_chan@GOTPAGEOFF]
	mov	x1, x24
	mov	x2, x25
	bl	_nvkm_object_ctor
	str	x19, [x20, #8]
	ldr	w8, [x23]
	str	w8, [x20]
	str	x25, [x22]
	add	w0, w26, #2008
	mov	w1, #134217728
	bl	_NV_WRITE_CTX
	add	w0, w26, #2028
	mov	w1, #1266679807
	bl	_NV_WRITE_CTX
Lloh5:
	adrp	x8, _NV03_PGRAPH_XY_LOGIC_MISC0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NV03_PGRAPH_XY_LOGIC_MISC0@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	w1, #131071
	bl	_NV_WRITE_CTX
	add	w0, w26, #1888
	mov	w1, #4096
	bl	_NV_WRITE_CTX
	add	w0, w26, #1892
	mov	w1, #4096
	bl	_NV_WRITE_CTX
	add	w0, w26, #1920
	mov	w1, #524296
	bl	_NV_WRITE_CTX
	add	w0, w26, #1924
	mov	w1, #524296
	bl	_NV_WRITE_CTX
	ldr	x8, [x21]
Lloh8:
	adrp	x9, _NV_11@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NV_11@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_4
; %bb.2:
	ldr	w8, [x21, #8]
	cmp	w8, #23
	b.lt	LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _NV10_PGRAPH_DEBUG_4@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NV10_PGRAPH_DEBUG_4@GOTPAGEOFF]
Lloh13:
	ldr	w22, [x8]
	mov	x0, x21
	mov	x1, x22
	bl	_nvkm_rd32
	mov	x1, x0
	mov	x0, x22
	bl	_NV17_WRITE_CTX
	mov	x0, x21
	mov	w1, #1712
	movk	w1, #64, lsl #16
	bl	_nvkm_rd32
	mov	x1, x0
	mov	w0, #1712
	movk	w0, #64, lsl #16
	bl	_NV17_WRITE_CTX
	add	w0, w26, #2044
	mov	w1, #268369920
	bl	_NV17_WRITE_CTX
	add	w0, w26, #2048
	mov	w1, #268369920
	bl	_NV17_WRITE_CTX
	add	w0, w26, #2064
	mov	w1, #128
	bl	_NV17_WRITE_CTX
	add	w0, w26, #2080
	mov	w1, #128
	bl	_NV17_WRITE_CTX
LBB0_4:
Lloh14:
	adrp	x8, _NV10_PGRAPH_CTX_USER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NV10_PGRAPH_CTX_USER@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	w8, [x20]
	lsl	w1, w8, #24
	bl	_NV_WRITE_CTX
	mov	x0, x20
	bl	_nv10_gr_create_pipe
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
	ldrsw	x9, [x20]
	str	x20, [x8, x9, lsl #3]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_nv10_gr_chan,4,2               ; @nv10_gr_chan
	.comm	_NV03_PGRAPH_XY_LOGIC_MISC0,4,2 ; @NV03_PGRAPH_XY_LOGIC_MISC0
	.comm	_NV_11,8,3                      ; @NV_11
	.comm	_NV10_PGRAPH_DEBUG_4,4,2        ; @NV10_PGRAPH_DEBUG_4
	.comm	_NV10_PGRAPH_CTX_USER,4,2       ; @NV10_PGRAPH_CTX_USER
.subsections_via_symbols
