	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gk104_fifo_oneinit
_gk104_fifo_oneinit:                    ## @gk104_fifo_oneinit
	.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
	callq	_gk104_fifo
	movq	%rax, %r15
	leaq	32(%rax), %rbx
	movq	32(%rax), %r12
	movq	%r12, %rdi
	callq	_nvkm_bar_bar1_vmm
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	48(%r15), %rax
	movq	8(%rax), %rax
	movq	%r15, %rdi
	callq	*(%rax)
	movl	%eax, (%r15)
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nvkm_debug
	movl	(%r15), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_24
## %bb.1:
	movq	%rax, %r13
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.2:
	movl	$9104, %r14d                    ## imm = 0x2390
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_nvkm_rd32
	movl	%eax, (%r13,%rbx,4)
	incq	%rbx
	movslq	(%r15), %rax
	addl	$4, %r14d
	cmpq	%rax, %rbx
	jl	LBB0_3
LBB0_4:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_nvkm_top_engine
	testl	%eax, %eax
	js	LBB0_12
## %bb.5:
	movl	%eax, %r12d
	movl	$1, %edi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	%esi, %r15d
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	-44(%rbp), %edx
	movq	_nvkm_subdev_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r12d, %esi
	movl	(%rax,%rsi,4), %r9d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_nvkm_debug
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_nvkm_device_engine
	movq	56(%rbx), %rcx
	movslq	-44(%rbp), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movl	%eax, 8(%rcx,%rdx,4)
	movl	-48(%rbp), %eax
	movslq	-44(%rbp), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movslq	-44(%rbp), %rax
	leaq	(%rax,%rax,2), %rax
	movl	%r15d, 4(%rcx,%rax,4)
	movq	%rbx, %r15
	movl	4(%rbx), %edi
	movl	-44(%rbp), %esi
	incl	%esi
	callq	_max
	movl	%eax, 4(%rbx)
	movb	-44(%rbp), %cl
	movl	$1, %eax
	shll	%cl, %eax
	movq	40(%rbx), %rcx
	movslq	-48(%rbp), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	orl	%eax, (%rcx,%rdx,8)
	movl	8(%rbx), %edi
	movl	-48(%rbp), %esi
	incl	%esi
	callq	_max
	movl	%eax, 8(%rbx)
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leal	1(%rsi), %ebx
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	callq	_nvkm_top_engine
	movl	%eax, %r12d
	movl	%ebx, %edi
	testl	%eax, %eax
	js	LBB0_12
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	%r15, %rbx
	movl	(%r15), %eax
	movl	$-1, %r15d
	movl	-48(%rbp), %ecx
	testl	%eax, %eax
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$1, %edx
	shll	%cl, %edx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testl	%edx, (%r13,%rsi,4)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	incq	%rsi
	cmpq	%rsi, %rax
	jne	LBB0_8
	jmp	LBB0_11
LBB0_12:
	movq	%r13, %rdi
	callq	_kfree
	cmpl	$0, 8(%r15)
	jle	LBB0_19
## %bb.13:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	40(%r12), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leaq	(,%rbx,8), %rcx
	leaq	(%rcx,%rcx,2), %r14
	leaq	(%rax,%r14), %rdi
	addq	$12, %rdi
	callq	_init_waitqueue_head
	movq	40(%r12), %rax
	leaq	(%rax,%r14), %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	movq	40(%r12), %rax
	leaq	(%rax,%r14), %rdi
	addq	$4, %rdi
	callq	_INIT_LIST_HEAD
	incq	%rbx
	movslq	8(%r12), %rax
	cmpq	%rax, %rbx
	movq	%r12, %r15
	jge	LBB0_19
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	movq	40(%r15), %rax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%rbx,2), %r13
	movq	16(%rax,%r13,8), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	movq	%r15, %r12
	jle	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_NVKM_MEM_TARGET_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%r12), %edx
	movq	48(%r12), %rax
	movq	(%rax), %rax
	imull	(%rax), %edx
	addl	%edx, %edx
	movq	40(%r12), %rax
	movq	16(%rax,%r13,8), %r9
	addq	%rbx, %r9
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$4096, %ecx                     ## imm = 0x1000
	xorl	%r8d, %r8d
	callq	_nvkm_memory_new
	testl	%eax, %eax
	jne	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=2
	incq	%r15
	movq	40(%r12), %rax
	movq	16(%rax,%r13,8), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %rbx
	cmpq	%rax, %r15
	jl	LBB0_17
	jmp	LBB0_18
LBB0_24:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_23
LBB0_19:
	movq	_NVKM_MEM_TARGET_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	24(%r15), %edx
	shll	$9, %edx
	leaq	16(%r15), %rbx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$4096, %ecx                     ## imm = 0x1000
	movl	$1, %r8d
	movq	%rbx, %r9
	callq	_nvkm_memory_new
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.20:
	movl	16(%r15), %edi
	callq	_nvkm_memory_size
	addq	$12, %r15
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	$12, %esi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_nvkm_vmm_get
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.21:
	movl	(%rbx), %edi
	movl	(%r15), %ecx
	xorl	%esi, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_nvkm_memory_map
LBB0_22:
	movl	%eax, %r14d
LBB0_23:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d PBDMA(s)\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"engine %2d: runlist %2d pbdma %2d (%s)\n"

	.comm	_nvkm_subdev_name,8,3           ## @nvkm_subdev_name
	.comm	_NVKM_MEM_TARGET_INST,4,2       ## @NVKM_MEM_TARGET_INST
	.no_dead_strip	_gk104_fifo_oneinit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gk104_fifo_oneinit
_gk104_fifo_oneinit:                    ; @gk104_fifo_oneinit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	bl	_gk104_fifo
	mov	x20, x0
	mov	x22, x0
	ldr	x21, [x22, #32]!
	mov	x0, x21
	bl	_nvkm_bar_bar1_vmm
	mov	x19, x0
	ldr	x8, [x20, #48]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
	mov	x2, x0
	str	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_nvkm_debug
	ldr	w0, [x20]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kcalloc
	cbz	x0, LBB0_20
; %bb.1:
	mov	x23, x0
	str	x19, [sp, #32]                  ; 8-byte Folded Spill
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x19, #0
	mov	w24, #9104
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_nvkm_rd32
	str	w0, [x23, x19, lsl #2]
	add	x19, x19, #1
	ldrsw	x8, [x20]
	add	w24, w24, #4
	cmp	x19, x8
	b.lt	LBB0_3
LBB0_4:
	add	x2, sp, #40
	add	x3, sp, #44
	mov	x0, x21
	mov	w1, #0
	bl	_nvkm_top_engine
	tbnz	w0, #31, LBB0_13
; %bb.5:
	mov	x26, x0
	mov	w28, #1
	mov	w19, #12
	mov	w25, #1
Lloh5:
	adrp	x24, l_.str.1@PAGE
Lloh6:
	add	x24, x24, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	w27, #-1
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w2, [sp, #44]
Lloh7:
	adrp	x9, _nvkm_subdev_name@GOTPAGE
Lloh8:
	ldr	x9, [x9, _nvkm_subdev_name@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	ldr	w9, [x9, w26, uxtw #2]
	stp	x27, x9, [sp, #8]
	str	x8, [sp]
	mov	x0, x22
	mov	x1, x24
	bl	_nvkm_debug
	mov	x0, x21
	mov	x1, x26
	bl	_nvkm_device_engine
	ldr	x8, [x20, #56]
	ldrsw	x9, [sp, #44]
	madd	x9, x9, x19, x8
	str	w0, [x9, #8]
	ldp	w9, w10, [sp, #40]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	mul	x10, x10, x19
	str	w9, [x8, x10]
	ldrsw	x9, [sp, #44]
	madd	x8, x9, x19, x8
	str	w27, [x8, #4]
	ldr	w0, [x20, #4]
	ldr	w8, [sp, #44]
	add	w1, w8, #1
	bl	_max
	str	w0, [x20, #4]
	ldp	w10, w8, [sp, #40]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	lsl	w8, w28, w8
	ldr	x9, [x20, #40]
	mov	w11, #24
	mul	x10, x10, x11
	ldr	w11, [x9, x10]
	orr	w8, w11, w8
	str	w8, [x9, x10]
	ldr	w0, [x20, #8]
	ldr	w8, [sp, #40]
	add	w1, w8, #1
	bl	_max
	str	w0, [x20, #8]
	add	w27, w25, #1
	add	x2, sp, #40
	add	x3, sp, #44
	mov	x0, x21
	mov	x1, x25
	bl	_nvkm_top_engine
	mov	x26, x0
	mov	x25, x27
	tbnz	w0, #31, LBB0_13
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	w9, [x20]
	ldr	w8, [sp, #40]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x27, #0
	lsl	w10, w28, w8
LBB0_10:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x23, x27, lsl #2]
	tst	w10, w11
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x27, x27, #1
	cmp	x9, x27
	b.ne	LBB0_10
	b	LBB0_6
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	b	LBB0_7
LBB0_13:
	mov	x0, x23
	bl	_kfree
	ldr	w8, [x20, #8]
Lloh10:
	adrp	x19, _NVKM_MEM_TARGET_INST@GOTPAGE
Lloh11:
	ldr	x19, [x19, _NVKM_MEM_TARGET_INST@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.14:
	mov	x22, #0
	mov	w23, #24
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x20, #40]
	add	x9, x22, x22, lsl #1
	lsl	x24, x9, #3
	add	x8, x8, x24
	add	x0, x8, #12
	bl	_init_waitqueue_head
	ldr	x8, [x20, #40]
	add	x8, x8, x24
	add	x0, x8, #8
	bl	_INIT_LIST_HEAD
	ldr	x8, [x20, #40]
	add	x8, x8, x24
	add	x0, x8, #4
	bl	_INIT_LIST_HEAD
	add	x22, x22, #1
	ldrsw	x8, [x20, #8]
	cmp	x22, x8
	b.ge	LBB0_21
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x8, [x20, #40]
	madd	x8, x22, x23, x8
	ldr	x0, [x8, #16]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x24, #0
	mov	x25, #0
LBB0_18:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x19]
	ldr	w8, [x20, #24]
	ldp	x10, x9, [x20, #40]
	ldr	x9, [x9]
	ldr	w9, [x9]
	mul	w8, w8, w9
	lsl	w2, w8, #1
	madd	x8, x22, x23, x10
	ldr	x8, [x8, #16]
	add	x5, x8, x24
	mov	x0, x21
	mov	w3, #4096
	mov	w4, #0
	bl	_nvkm_memory_new
	cbnz	w0, LBB0_24
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	add	x25, x25, #1
	ldr	x8, [x20, #40]
	madd	x8, x22, x23, x8
	ldr	x0, [x8, #16]
	bl	_ARRAY_SIZE
	add	x24, x24, #4
	cmp	x25, w0, sxtw
	b.lt	LBB0_18
	b	LBB0_15
LBB0_20:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_24
LBB0_21:
	ldr	w1, [x19]
	ldr	w8, [x20, #24]
	lsl	w2, w8, #9
	add	x22, x20, #16
	mov	x0, x21
	mov	w3, #4096
	mov	w4, #1
	mov	x5, x22
	bl	_nvkm_memory_new
	cbnz	w0, LBB0_24
; %bb.22:
	ldr	w0, [x20, #16]
	bl	_nvkm_memory_size
	mov	x2, x0
	add	x20, x20, #12
	ldr	x0, [sp, #32]                   ; 8-byte Folded Reload
	mov	w1, #12
	mov	x3, x20
	bl	_nvkm_vmm_get
	cbnz	w0, LBB0_24
; %bb.23:
	ldr	w0, [x22]
	ldr	w3, [x20]
	mov	w1, #0
	ldr	x2, [sp, #32]                   ; 8-byte Folded Reload
	mov	x4, #0
	mov	w5, #0
	bl	_nvkm_memory_map
LBB0_24:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d PBDMA(s)\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"engine %2d: runlist %2d pbdma %2d (%s)\n"

	.comm	_nvkm_subdev_name,8,3           ; @nvkm_subdev_name
	.comm	_NVKM_MEM_TARGET_INST,4,2       ; @NVKM_MEM_TARGET_INST
	.no_dead_strip	_gk104_fifo_oneinit
.subsections_via_symbols
