	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gf100_gr_chan_new
_gf100_gr_chan_new:                     ## @gf100_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	callq	_gf100_gr
	movq	%rax, %r13
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %r15
	movl	$1, -48(%rbp)
	movq	16(%r13), %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	32(%rax), %r15
	movq	_gf100_gr_chan@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_nvkm_object_ctor
	movq	%r13, 40(%r12)
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_nvkm_vmm_ref
	movl	%eax, 16(%r12)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	_NVKM_MEM_TARGET_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$4096, %edx                     ## imm = 0x1000
	movl	$256, %ecx                      ## imm = 0x100
	xorl	%r8d, %r8d
	movq	%r12, %r9
	callq	_nvkm_memory_new
	testl	%eax, %eax
	jne	LBB0_17
## %bb.3:
	movq	%rbx, %r14
	movq	%r12, %rbx
	movl	(%r14), %edi
	movq	%r12, %rcx
	addq	$24, %rcx
	movl	$12, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_nvkm_vmm_get
	testl	%eax, %eax
	jne	LBB0_17
## %bb.4:
	movl	(%rbx), %edi
	movl	(%r14), %edx
	movq	24(%rbx), %rcx
	leaq	-48(%rbp), %r8
	xorl	%esi, %esi
	movl	$4, %r9d
	callq	_nvkm_memory_map
	testl	%eax, %eax
	jne	LBB0_17
## %bb.5:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.6:
	movq	$-1, %r14
	movl	$8, %r12d
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	callq	_ARRAY_SIZE
	cltq
	incq	%r14
	cmpq	%rax, %r14
	jge	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_NVKM_MEM_TARGET_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	movq	8(%rbx), %r9
	addq	%r12, %r9
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_nvkm_memory_new
	testl	%eax, %eax
	jne	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r15d
	movq	8(%rbx), %rax
	movl	(%rax,%r12), %edi
	callq	_nvkm_memory_size
	movq	8(%rbx), %rcx
	addq	%r12, %rcx
	addq	$-8, %rcx
	movl	%r15d, %edi
	movl	$12, %esi
	movl	%eax, %edx
	callq	_nvkm_vmm_get
	testl	%eax, %eax
	jne	LBB0_17
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rcx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %eax
	movl	%eax, -48(%rbp)
	movq	8(%rcx), %rax
	movl	(%rax,%r12), %edi
	movq	%rcx, %r13
	movl	16(%rcx), %edx
	movq	-8(%rax,%r12), %rcx
	xorl	%esi, %esi
	leaq	-48(%rbp), %r8
	movl	$4, %r9d
	callq	_nvkm_memory_map
	testl	%eax, %eax
	jne	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	addq	$16, %r12
	cmpl	$0, 40(%rbx)
	leaq	40(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r13, %rbx
	jne	LBB0_7
LBB0_12:
	movl	(%rbx), %edi
	callq	_nvkm_kmap
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	cmpl	$0, 12(%r13)
	je	LBB0_16
## %bb.13:
	addq	$12, %r13
	movl	$-1, %r12d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	incl	%r12d
	cmpl	%eax, %r12d
	jge	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	8(%rbx), %rax
	movq	12(%r13), %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rax
	movl	(%rax), %r15d
	movzbl	20(%r13), %ecx
	sarl	%cl, %r15d
	movl	(%r13), %edx
	orl	4(%r13), %r15d
	movl	(%rbx), %edi
	movl	4(%rbx), %esi
	leal	1(%rsi), %eax
	movl	%eax, 4(%rbx)
	shll	$2, %esi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_nvkm_wo32
	movl	(%rbx), %edi
	movl	4(%rbx), %esi
	leal	1(%rsi), %eax
	movl	%eax, 4(%rbx)
	shll	$2, %esi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r15d, %edx
	callq	_nvkm_wo32
	cmpl	$0, 40(%r13)
	leaq	40(%r13), %r13
	jne	LBB0_14
LBB0_16:
	movl	(%rbx), %edi
	callq	_nvkm_done
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$56, %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	_gf100_gr_chan,4,2              ## @gf100_gr_chan
	.comm	_NVKM_MEM_TARGET_INST,4,2       ## @NVKM_MEM_TARGET_INST
	.no_dead_strip	_gf100_gr_chan_new
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gf100_gr_chan_new
_gf100_gr_chan_new:                     ; @gf100_gr_chan_new
	.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, x3
	mov	x24, x2
	mov	x21, x1
	bl	_gf100_gr
	mov	x19, x0
	ldp	x26, x27, [x0]
	mov	w8, #1
	str	w8, [sp, #8]
	ldr	x22, [x0, #16]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_16
; %bb.1:
	mov	x20, x0
	add	x25, x0, #32
Lloh3:
	adrp	x0, _gf100_gr_chan@GOTPAGE
Lloh4:
	ldr	x0, [x0, _gf100_gr_chan@GOTPAGEOFF]
	mov	x1, x24
	mov	x2, x25
	bl	_nvkm_object_ctor
	str	x19, [x20, #40]
	ldr	w0, [x21]
	bl	_nvkm_vmm_ref
	str	w0, [x20, #16]
	str	x25, [x23]
Lloh5:
	adrp	x24, _NVKM_MEM_TARGET_INST@GOTPAGE
Lloh6:
	ldr	x24, [x24, _NVKM_MEM_TARGET_INST@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x22
	mov	w2, #4096
	mov	w3, #256
	mov	w4, #0
	mov	x5, x20
	bl	_nvkm_memory_new
	cbnz	w0, LBB0_17
; %bb.2:
	ldr	w0, [x21]
	add	x3, x20, #24
	mov	w1, #12
	mov	w2, #4096
	bl	_nvkm_vmm_get
	cbnz	w0, LBB0_17
; %bb.3:
	ldr	w0, [x20]
	ldr	w2, [x21]
	ldr	x3, [x20, #24]
	add	x4, sp, #8
	mov	w1, #0
	mov	w5, #4
	bl	_nvkm_memory_map
	cbnz	w0, LBB0_17
; %bb.4:
	ldr	w8, [x27]
	cbz	w8, LBB0_11
; %bb.5:
	mov	x25, #0
	mov	x28, #-1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #8]
	bl	_ARRAY_SIZE
	add	x28, x28, #1
	cmp	x28, w0, sxtw
	b.ge	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x24]
	ldp	w2, w3, [x27]
	ldr	x8, [x20, #8]
	add	x8, x8, x25
	add	x5, x8, #8
	mov	x0, x22
	mov	w4, #0
	bl	_nvkm_memory_new
	cbnz	w0, LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w23, [x21]
	ldr	x8, [x20, #8]
	add	x8, x8, x25
	ldr	w0, [x8, #8]
	bl	_nvkm_memory_size
	mov	x2, x0
	ldr	x8, [x20, #8]
	add	x3, x8, x25
	mov	x0, x23
	mov	w1, #12
	bl	_nvkm_vmm_get
	cbnz	w0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x27, #8]
	str	w8, [sp, #8]
	ldr	x8, [x20, #8]
	add	x8, x8, x25
	ldr	w0, [x8, #8]
	ldr	w2, [x20, #16]
	ldr	x3, [x8]
	add	x4, sp, #8
	mov	w1, #0
	mov	w5, #4
	bl	_nvkm_memory_map
	cbnz	w0, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x25, #16
	ldr	w8, [x27, #40]!
	cbnz	w8, LBB0_6
LBB0_11:
	ldr	w0, [x20]
	bl	_nvkm_kmap
	ldr	w8, [x26, #12]
	cbz	w8, LBB0_15
; %bb.12:
	add	x22, x26, #12
	mov	w23, #-1
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19]
	bl	_ARRAY_SIZE
	add	w23, w23, #1
	cmp	w23, w0
	b.ge	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldp	w2, w8, [x22]
	ldr	x9, [x20, #8]
	ldur	x10, [x22, #12]
	lsl	x10, x10, #4
	ldr	x9, [x9, x10]
	ldr	w9, [x9]
	ldr	w10, [x22, #20]
	asr	w9, w9, w10
	orr	w21, w9, w8
	ldp	w0, w8, [x20]
	add	w9, w8, #1
	str	w9, [x20, #4]
	lsl	w1, w8, #2
	bl	_nvkm_wo32
	ldp	w0, w8, [x20]
	add	w9, w8, #1
	str	w9, [x20, #4]
	lsl	w1, w8, #2
	mov	x2, x21
	bl	_nvkm_wo32
	ldr	w8, [x22, #40]!
	cbnz	w8, LBB0_13
LBB0_15:
	ldr	w0, [x20]
	bl	_nvkm_done
	mov	w0, #0
	b	LBB0_17
LBB0_16:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_gf100_gr_chan,4,2              ; @gf100_gr_chan
	.comm	_NVKM_MEM_TARGET_INST,4,2       ; @NVKM_MEM_TARGET_INST
	.no_dead_strip	_gf100_gr_chan_new
.subsections_via_symbols
