	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_dma_wait
_nv50_dma_wait:                         ## @nv50_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, %r14d
	movq	%rdi, %r13
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	incl	%esi
	callq	_nv50_dma_push_wait
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_16
## %bb.1:
	cmpl	%r14d, (%r13)
	jge	LBB0_15
## %bb.2:
	leaq	-48(%rbp), %r15
	leaq	-44(%rbp), %r12
	jmp	LBB0_3
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, 4(%r13)
	movq	$0, 16(%r13)
	xorl	%eax, %eax
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	notl	%eax
	addl	%ebx, %eax
	movl	%eax, (%r13)
	cmpl	%r14d, %eax
	jge	LBB0_15
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_READ_GET
	movl	%eax, %ebx
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %eax
	cmpl	%r14d, %eax
	jl	LBB0_3
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r13), %eax
	cmpl	%eax, %ebx
	jg	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r13), %ecx
	subl	%eax, %ecx
	movl	%ecx, (%r13)
	cmpl	%r14d, %ecx
	jge	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_FIRE_RING
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=2
	testl	%ebx, %ebx
	jne	LBB0_12
LBB0_9:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_READ_GET
	movl	%eax, %ebx
	movl	%eax, %edi
	shrl	$31, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_11
	jmp	LBB0_16
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nv50_dma_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv50_dma_wait
_nv50_dma_wait:                         ; @nv50_dma_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x20, x0
	str	xzr, [sp, #8]
	add	w1, w1, #1
	bl	_nv50_dma_push_wait
	mov	x21, x0
	bl	_unlikely
	cbnz	x0, LBB0_15
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, w19
	b.ge	LBB0_14
; %bb.2:
Lloh0:
	adrp	x22, _EINVAL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #0
	str	wzr, [x20, #4]
	str	xzr, [x20, #16]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mvn	w8, w8
	add	w8, w21, w8
	str	w8, [x20]
	cmp	w8, w19
	b.ge	LBB0_14
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	bl	_READ_GET
	mov	x21, x0
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x22]
	cmn	w21, w8
	b.ne	LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	cmp	w8, w19
	b.lt	LBB0_5
	b	LBB0_14
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20, #4]
	cmp	w21, w8
	b.gt	LBB0_4
; %bb.9:                                ;   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.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_FIRE_RING
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	cbnz	w21, LBB0_3
LBB0_12:                                ;   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
	lsr	w0, w0, #31
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	w8, [x22]
	cmn	w21, w8
	b.eq	LBB0_11
	b	LBB0_15
LBB0_14:
	mov	w21, #0
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nv50_dma_wait
.subsections_via_symbols
