	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_bo_move_m2mf
_nouveau_bo_move_m2mf:                  ## @nouveau_bo_move_m2mf
	.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	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movl	8(%rdi), %edi
	callq	_nouveau_bdev
	movq	%rax, %r12
	movq	16(%rax), %rbx
	movq	%r15, %rdi
	callq	_nouveau_bo
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rdi
	callq	_mutex_lock
	movl	8(%r12), %edi
	callq	_nv_device
	movq	(%rax), %rax
	movq	_NV_50@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_1
LBB0_3:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r15, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	*(%r12)
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_nouveau_bo_move_accel_cleanup
	movl	%eax, %r14d
	jmp	LBB0_5
LBB0_1:
	movq	(%r15), %r13
	movq	(%r13), %rcx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_nouveau_vma_getmap
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movq	(%r13), %rcx
	addq	$4, %rcx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_nouveau_vma_getmap
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:
	movq	(%rbx), %rdi
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_50,8,3                      ## @NV_50
	.comm	_chan,8,3                       ## @chan
	.no_dead_strip	_nouveau_bo_move_m2mf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_bo_move_m2mf
_nouveau_bo_move_m2mf:                  ; @nouveau_bo_move_m2mf
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x22, x1
	mov	x23, x0
	ldr	w0, [x0, #8]
	bl	_nouveau_bdev
	mov	x25, x0
	ldr	x20, [x0, #16]
	mov	x0, x23
	bl	_nouveau_bo
	mov	x24, x0
	ldr	x0, [x20]
	bl	_mutex_lock
	ldr	w0, [x25, #8]
	bl	_nv_device
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NV_50@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NV_50@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_3
LBB0_1:
	ldr	x8, [x25]
	mov	x0, x20
	mov	x1, x23
	mov	x2, x23
	mov	x3, x19
	blr	x8
	mov	x26, x0
	cbnz	w0, LBB0_5
; %bb.2:
	mov	x0, x20
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	mov	x4, x19
	bl	_nouveau_bo_move_accel_cleanup
	mov	x26, x0
	b	LBB0_5
LBB0_3:
	ldr	x27, [x23]
	ldr	x3, [x27]
	mov	x0, x20
	mov	x1, x24
	mov	x2, x23
	bl	_nouveau_vma_getmap
	mov	x26, x0
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x8, [x27]
	add	x3, x8, #4
	mov	x0, x20
	mov	x1, x24
	mov	x2, x19
	bl	_nouveau_vma_getmap
	mov	x26, x0
	cbz	w0, LBB0_1
LBB0_5:
	ldr	x0, [x20]
	bl	_mutex_unlock
	mov	x0, x26
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_50,8,3                      ; @NV_50
	.comm	_chan,8,3                       ; @chan
	.no_dead_strip	_nouveau_bo_move_m2mf
.subsections_via_symbols
