	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_fifo_dma_engine_fini
_nv40_fifo_dma_engine_fini:             ## @nv40_fifo_dma_engine_fini
	.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, %r15
	movq	16(%rax), %r14
	movq	8(%r14), %r12
	movq	(%r12), %r13
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_nv40_fifo_dma_engine
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	%r12, %rdi
	movl	$9472, %esi                     ## imm = 0x2500
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_nvkm_mask
	movq	%r12, %rdi
	movl	$12804, %esi                    ## imm = 0x3204
	callq	_nvkm_rd32
	movl	(%r14), %ecx
	decl	%ecx
	andl	%eax, %ecx
	cmpl	8(%r15), %ecx
	jne	LBB0_3
## %bb.2:
	movq	-56(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_nvkm_wr32
LBB0_3:
	movl	(%r13), %edi
	callq	_nvkm_kmap
	movl	(%r13), %edi
	movq	-48(%rbp), %rsi
	addq	(%r15), %rsi
	xorl	%edx, %edx
	callq	_nvkm_wo32
	movl	(%r13), %edi
	callq	_nvkm_done
	movq	%r12, %rdi
	movl	$9472, %esi                     ## imm = 0x2500
	movl	$1, %edx
	movl	$1, %ecx
	callq	_nvkm_mask
	movq	%rbx, %rdi
	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_fini
.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_fini
_nv40_fifo_dma_engine_fini:             ; @nv40_fifo_dma_engine_fini
	.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	x20, x1
	bl	_nv04_fifo_chan
	mov	x21, x0
	ldr	x23, [x0, #16]
	ldr	x19, [x23, #8]
	ldr	x22, [x19]
	add	x1, sp, #8
	mov	x2, sp
	mov	x0, x20
	bl	_nv40_fifo_dma_engine
	cbz	w0, LBB0_4
; %bb.1:
	add	x20, x23, #4
	mov	x0, x20
	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, [x23]
	sub	w8, w8, #1
	and	w8, w8, w0
	ldr	w9, [x21, #8]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.2:
	ldr	x1, [sp, #8]
	mov	x0, x19
	mov	w2, #0
	bl	_nvkm_wr32
LBB0_3:
	ldr	w0, [x22]
	bl	_nvkm_kmap
	ldr	w0, [x22]
	ldr	x8, [x21]
	ldr	x9, [sp]
	add	x1, x9, x8
	mov	w2, #0
	bl	_nvkm_wo32
	ldr	w0, [x22]
	bl	_nvkm_done
	mov	x0, x19
	mov	w1, #9472
	mov	w2, #1
	mov	w3, #1
	bl	_nvkm_mask
	mov	x0, x20
	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_fini
.subsections_via_symbols
