	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dma_wait               ## -- Begin function nouveau_dma_wait
	.p2align	4, 0x90
_nouveau_dma_wait:                      ## @nouveau_dma_wait
	.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
	movl	%edx, %r15d
	movq	%rdi, %rbx
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	cmpq	$0, 16(%rdi)
	je	LBB0_1
## %bb.18:
	movq	%rbx, %rdi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nv50_dma_wait                  ## TAILCALL
LBB0_1:
	xorl	%eax, %eax
	cmpl	%r15d, (%rbx)
	jge	LBB0_17
## %bb.2:
	leaq	-48(%rbp), %r12
	leaq	-44(%rbp), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rbx), %eax
	cmpl	%r15d, %eax
	jge	LBB0_16
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_READ_GET
	movl	%eax, %r14d
	xorl	%edi, %edi
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edi, %edi
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_NOUVEAU_DMA_SKIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jl	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%rbx), %eax
	cmpl	%eax, %r14d
	jg	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rbx), %ecx
	subl	%eax, %ecx
	movl	%ecx, (%rbx)
	cmpl	%r15d, %ecx
	jge	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	24(%rbx), %esi
	movl	$536870912, %eax                ## imm = 0x20000000
	orl	%eax, %esi
	movq	%rbx, %rdi
	callq	_OUT_RING
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_READ_GET
	movl	%eax, %r14d
	xorl	%edi, %edi
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_4
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	xorl	%edi, %edi
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r14d, %eax
	sete	%dil
	callq	_unlikely
	movq	_NOUVEAU_DMA_SKIPS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpl	%edi, %r14d
	jle	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	callq	_WRITE_PUT
	movq	_NOUVEAU_DMA_SKIPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movl	%eax, 4(%rbx)
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	notl	%eax
	addl	%r14d, %eax
	movl	%eax, (%rbx)
	cmpl	%r15d, %eax
	jl	LBB0_3
LBB0_16:
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_4:
	xorl	%eax, %eax
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NOUVEAU_DMA_SKIPS,4,2          ## @NOUVEAU_DMA_SKIPS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dma_wait               ; -- Begin function nouveau_dma_wait
	.p2align	2
_nouveau_dma_wait:                      ; @nouveau_dma_wait
	.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	x19, x2
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x2, x19
	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
	b	_nv50_dma_wait
LBB0_2:
	ldr	w8, [x20]
	cmp	w8, w19
	b.ge	LBB0_14
; %bb.3:
Lloh0:
	adrp	x22, _EBUSY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EBUSY@GOTPAGEOFF]
Lloh2:
	adrp	x23, _EINVAL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _EINVAL@GOTPAGEOFF]
Lloh4:
	adrp	x24, _NOUVEAU_DMA_SKIPS@GOTPAGE
Lloh5:
	ldr	x24, [x24, _NOUVEAU_DMA_SKIPS@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	cmp	w8, w19
	b.ge	LBB0_14
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	bl	_READ_GET
	mov	x21, x0
	ldr	w8, [x22]
	cmn	w0, w8
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x23]
	cmn	w21, w8
	cset	w0, eq
	bl	_unlikely
	ldr	w8, [x24]
	cmp	x0, #0
	ccmp	w21, w8, #8, eq
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #4]
	cmp	w21, w8
	b.gt	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x20, #8]
	sub	w8, w9, w8
	cmp	w8, w19
	str	w8, [x20]
	b.ge	LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #24]
	orr	w1, w8, #0x20000000
	mov	x0, x20
	bl	_OUT_RING
LBB0_10:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	bl	_READ_GET
	mov	x21, x0
	ldr	w8, [x22]
	cmn	w0, w8
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w8, [x23]
	cmn	w21, w8
	cset	w0, eq
	bl	_unlikely
	ldr	w0, [x24]
	cmp	w21, w0
	b.le	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	bl	_WRITE_PUT
	ldr	w8, [x24]
	str	w8, [x20, #12]
	str	w8, [x20, #4]
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	mvn	w8, w8
	add	w8, w21, w8
	str	w8, [x20]
	cmp	w8, w19
	b.lt	LBB0_5
LBB0_14:
	mov	w0, #0
	b	LBB0_16
LBB0_15:
	ldr	w8, [x22]
	neg	w0, w8
LBB0_16:
	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
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NOUVEAU_DMA_SKIPS,4,2          ; @NOUVEAU_DMA_SKIPS
.subsections_via_symbols
