	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_bo_move
_nouveau_bo_move:                       ## @nouveau_bo_move
	.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, %r12
	movl	%ecx, %r13d
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	callq	_nouveau_bdev
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_nouveau_bo
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	$0, -56(%rbp)
	movl	(%r15), %edi
	callq	_nv_device
	movq	(%rax), %rax
	movq	_NV_50@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_2
## %bb.1:
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_nouveau_bo_vm_bind
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_19
LBB0_2:
	movq	(%rbx), %rax
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.3:
	cmpl	$0, 16(%rbx)
	je	LBB0_4
LBB0_5:
	cmpl	$0, 4(%r15)
	je	LBB0_6
## %bb.7:
	cmpq	%rcx, (%r12)
	jne	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %r14d
	movl	%r13d, %ecx
	movq	%r12, %r8
	callq	_nouveau_bo_move_flipd
	jmp	LBB0_12
LBB0_6:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r13d, %edx
	movq	%r12, %rcx
	callq	_ttm_bo_move_memcpy
	movl	%eax, %r14d
	movq	_NV_50@GOTPCREL(%rip), %r13
	jmp	LBB0_15
LBB0_9:
	cmpq	%rcx, %rax
	movl	%r13d, %r14d
	movq	%rbx, %rdi
	jne	LBB0_11
## %bb.10:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movq	%r12, %r8
	callq	_nouveau_bo_move_flips
	jmp	LBB0_12
LBB0_4:
	xorl	%edi, %edi
	cmpq	$0, 8(%rbx)
	setne	%dil
	callq	_BUG_ON
	movups	(%r12), %xmm0
	movups	%xmm0, (%rbx)
	movq	$0, 8(%r12)
	xorl	%r14d, %r14d
	movq	_NV_50@GOTPCREL(%rip), %r13
	jmp	LBB0_15
LBB0_11:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movq	%r12, %r8
	callq	_nouveau_bo_move_m2mf
LBB0_12:
	testl	%eax, %eax
	movq	_NV_50@GOTPCREL(%rip), %r13
	je	LBB0_13
## %bb.14:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	movq	%r12, %rcx
	callq	_ttm_bo_move_memcpy
	movl	%eax, %r14d
	jmp	LBB0_15
LBB0_13:
	xorl	%r14d, %r14d
LBB0_15:
	movl	(%r15), %edi
	callq	_nv_device
	movq	(%rax), %rax
	cmpq	(%r13), %rax
	jge	LBB0_19
## %bb.16:
	testl	%r14d, %r14d
	je	LBB0_18
## %bb.17:
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_nouveau_bo_vm_cleanup
	jmp	LBB0_19
LBB0_18:
	movq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_nouveau_bo_vm_cleanup
	xorl	%r14d, %r14d
LBB0_19:
	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	_TTM_PL_SYSTEM,8,3              ## @TTM_PL_SYSTEM
	.no_dead_strip	_nouveau_bo_move
.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
_nouveau_bo_move:                       ; @nouveau_bo_move
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x4
	mov	x23, x3
	mov	x25, x2
	mov	x24, x1
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_nouveau_bdev
	mov	x21, x0
	mov	x0, x19
	bl	_nouveau_bo
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	w0, [x21]
	bl	_nv_device
	ldr	x8, [x0]
Lloh0:
	adrp	x27, _NV_50@GOTPAGE
Lloh1:
	ldr	x27, [x27, _NV_50@GOTPAGEOFF]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x22
	bl	_nouveau_bo_vm_bind
	mov	x26, x0
	cbnz	w0, LBB0_18
LBB0_2:
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _TTM_PL_SYSTEM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	w10, [x19, #16]
	cbz	w10, LBB0_10
LBB0_4:
	ldr	w10, [x21, #4]
	cbz	w10, LBB0_12
; %bb.5:
	ldr	x10, [x22]
	mov	x0, x19
	mov	x1, x24
	mov	x2, x25
	mov	x3, x23
	mov	x4, x22
	cmp	x10, x9
	b.ne	LBB0_7
; %bb.6:
	bl	_nouveau_bo_move_flipd
	cbnz	w0, LBB0_12
	b	LBB0_9
LBB0_7:
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.8:
	bl	_nouveau_bo_move_flips
	cbnz	w0, LBB0_12
LBB0_9:
	mov	w26, #0
	b	LBB0_13
LBB0_10:
	ldr	x8, [x19, #8]
	cmp	x8, #0
	cset	w0, ne
	bl	_BUG_ON
	mov	w26, #0
	ldr	q0, [x22]
	str	q0, [x19]
	str	xzr, [x22, #8]
	b	LBB0_13
LBB0_11:
	bl	_nouveau_bo_move_m2mf
	cbz	w0, LBB0_9
LBB0_12:
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	bl	_ttm_bo_move_memcpy
	mov	x26, x0
LBB0_13:
	ldr	w0, [x21]
	bl	_nv_device
	ldr	x8, [x0]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ge	LBB0_18
; %bb.14:
	cbz	w26, LBB0_16
; %bb.15:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, #0
	b	LBB0_17
LBB0_16:
	ldr	x1, [sp, #8]
	mov	x0, x19
	mov	x2, x20
LBB0_17:
	bl	_nouveau_bo_vm_cleanup
LBB0_18:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_50,8,3                      ; @NV_50
	.comm	_TTM_PL_SYSTEM,8,3              ; @TTM_PL_SYSTEM
	.no_dead_strip	_nouveau_bo_move
.subsections_via_symbols
