	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_fifo_dma_engine_init
_nv40_fifo_dma_engine_init:             ## @nv40_fifo_dma_engine_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	callq	_nv04_fifo_chan
	movq	%rax, %r13
	movq	16(%rax), %r15
	movq	8(%r15), %r14
	movq	(%r14), %r12
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_nv40_fifo_dma_engine
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r13), %rax
	movq	(%rbx), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax), %r12d
	sarl	$4, %r12d
	leaq	4(%r15), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	movl	$9472, %esi                     ## imm = 0x2500
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_nvkm_mask
	movq	%r14, %rdi
	movl	$12804, %esi                    ## imm = 0x3204
	callq	_nvkm_rd32
	movl	(%r15), %ecx
	decl	%ecx
	andl	%eax, %ecx
	cmpl	4(%r13), %ecx
	jne	LBB0_3
## %bb.2:
	movl	-48(%rbp), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_nvkm_wr32
LBB0_3:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_nvkm_kmap
	movl	(%rbx), %edi
	movl	-44(%rbp), %esi
	addl	(%r13), %esi
	movl	%r12d, %edx
	callq	_nvkm_wo32
	movl	(%rbx), %edi
	callq	_nvkm_done
	movq	%r14, %rdi
	movl	$9472, %esi                     ## imm = 0x2500
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nvkm_mask
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
LBB0_4:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_nv40_fifo_dma_engine_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv40_fifo_dma_engine_init
_nv40_fifo_dma_engine_init:             ; @nv40_fifo_dma_engine_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x1
	bl	_nv04_fifo_chan
	mov	x20, x0
	ldr	x24, [x0, #16]
	ldr	x19, [x24, #8]
	ldr	x23, [x19]
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x21
	bl	_nv40_fifo_dma_engine
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x8, [x20, #8]
	ldr	x9, [x21]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w8, [x8]
	asr	w22, w8, #4
	add	x21, x24, #4
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	w1, #9472
	mov	w2, #1
	mov	w3, #0
	bl	_nvkm_mask
	mov	x0, x19
	mov	w1, #12804
	bl	_nvkm_rd32
	ldr	w8, [x24]
	sub	w8, w8, #1
	and	w8, w8, w0
	ldr	w9, [x20, #4]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.2:
	ldr	w1, [sp, #12]
	mov	x0, x19
	mov	x2, x22
	bl	_nvkm_wr32
LBB0_3:
	ldr	w0, [x23]
	bl	_nvkm_kmap
	ldr	w0, [x23]
	ldr	w8, [x20]
	ldr	w9, [sp, #8]
	add	w1, w9, w8
	mov	x2, x22
	bl	_nvkm_wo32
	ldr	w0, [x23]
	bl	_nvkm_done
	mov	x0, x19
	mov	w1, #9472
	mov	w2, #1
	mov	w3, #1
	bl	_nvkm_mask
	mov	x0, x21
	bl	_spin_unlock_irqrestore
LBB0_4:
	mov	w0, #0
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_nv40_fifo_dma_engine_init
.subsections_via_symbols
