	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv50_bo_move_m2mf
_nv50_bo_move_m2mf:                     ## @nv50_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdi, %rbx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	16(%rdx), %r14
	movq	%rsi, %rdi
	callq	_nouveau_bo
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	(%r15), %edi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	testl	%edi, %edi
	je	LBB0_16
## %bb.1:
	movq	(%r14), %rax
	movl	(%rax), %r14d
	movl	4(%rax), %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	$4194304, %esi                  ## imm = 0x400000
	callq	_min
                                        ## kill: def $eax killed $eax def $rax
	leal	63(%rax), %r13d
	testl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	cmovnsl	%eax, %r13d
	sarl	$6, %r13d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_nouveau_bo_tile_layout
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	$8, %esi
	callq	_RING_SPACE
	testl	%eax, %eax
	jne	LBB0_21
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_NvSubCopy@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$512, %edx                      ## imm = 0x200
	movl	$7, %ecx
	callq	_BEGIN_NV04
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$64, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_RING_SPACE
	testl	%eax, %eax
	jne	LBB0_21
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_NvSubCopy@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %r12d
	movq	%rbx, %rdi
	movl	$512, %edx                      ## imm = 0x200
	movl	$1, %ecx
	callq	_BEGIN_NV04
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_OUT_RING
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_nouveau_bo_tile_layout
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	$8, %esi
	callq	_RING_SPACE
	testl	%eax, %eax
	jne	LBB0_21
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_NvSubCopy@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$540, %edx                      ## imm = 0x21C
	movl	$7, %ecx
	callq	_BEGIN_NV04
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$64, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_RING_SPACE
	testl	%eax, %eax
	jne	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_NvSubCopy@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %r12d
	movq	%rbx, %rdi
	movl	$540, %edx                      ## imm = 0x21C
	movl	$1, %ecx
	callq	_BEGIN_NV04
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$14, %esi
	callq	_RING_SPACE
	testl	%eax, %eax
	jne	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_NvSubCopy@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rax, %r12
	movq	%rbx, %rdi
	movl	$568, %edx                      ## imm = 0x238
	movl	$2, %ecx
	callq	_BEGIN_NV04
	movl	%r14d, %edi
	callq	_upper_32_bits
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_OUT_RING
	movl	%r15d, %edi
	callq	_upper_32_bits
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_OUT_RING
	movl	(%r12), %esi
	movq	%rbx, %rdi
	movl	$780, %edx                      ## imm = 0x30C
	movl	$8, %ecx
	callq	_BEGIN_NV04
	movl	%r14d, %edi
	callq	_lower_32_bits
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_OUT_RING
	movl	%r15d, %edi
	callq	_lower_32_bits
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$64, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$64, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$64, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_OUT_RING
	movq	%rbx, %rdi
	movl	$257, %esi                      ## imm = 0x101
	callq	_OUT_RING
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	_NvSubCopy@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NV_MEMORY_TO_MEMORY_FORMAT_NOP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_BEGIN_NV04
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	addl	%eax, %r14d
	addl	%eax, %r15d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	subl	%eax, %edi
	jne	LBB0_2
	jmp	LBB0_22
LBB0_21:
	movl	%eax, %r12d
	jmp	LBB0_22
LBB0_16:
	xorl	%r12d, %r12d
LBB0_22:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_TTM_PL_VRAM,8,3                ## @TTM_PL_VRAM
	.comm	_NvSubCopy,4,2                  ## @NvSubCopy
	.comm	_NV_MEMORY_TO_MEMORY_FORMAT_NOP,4,2 ## @NV_MEMORY_TO_MEMORY_FORMAT_NOP
	.no_dead_strip	_nv50_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 nv50_bo_move_m2mf
_nv50_bo_move_m2mf:                     ; @nv50_bo_move_m2mf
	.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	x19, x3
	mov	x20, x2
	mov	x21, x0
	ldr	x22, [x2, #16]
	mov	x0, x1
	bl	_nouveau_bo
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w23, w8, w9
	cbz	w23, LBB0_16
; %bb.1:
	ldr	x8, [x22]
	ldp	w25, w24, [x8]
Lloh3:
	adrp	x22, _NvSubCopy@GOTPAGE
Lloh4:
	ldr	x22, [x22, _NvSubCopy@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	w1, #4194304
	bl	_min
	mov	x26, x0
	add	w8, w0, #63
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w27, w8, #6
	ldr	x8, [x20, #8]
Lloh5:
	adrp	x9, _TTM_PL_VRAM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_nouveau_bo_tile_layout
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	w1, #8
	bl	_RING_SPACE
	cbnz	w0, LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	mov	x0, x21
	mov	w2, #512
	mov	w3, #7
	bl	_BEGIN_NV04
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #64
	bl	_OUT_RING
	mov	x0, x21
	mov	x1, x27
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #1
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	mov	w28, #0
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	w1, #2
	bl	_RING_SPACE
	cbnz	w0, LBB0_17
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	mov	w28, #1
	mov	x0, x21
	mov	w2, #512
	mov	w3, #1
	bl	_BEGIN_NV04
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	x1, x28
	bl	_OUT_RING
	ldr	x8, [x19, #8]
Lloh8:
	adrp	x9, _TTM_PL_VRAM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_nouveau_bo_tile_layout
	cbz	x0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	w1, #8
	bl	_RING_SPACE
	cbnz	w0, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	mov	x0, x21
	mov	w2, #540
	mov	w3, #7
	bl	_BEGIN_NV04
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #64
	bl	_OUT_RING
	mov	x0, x21
	mov	x1, x27
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #1
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	mov	w28, #0
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	w1, #2
	bl	_RING_SPACE
	cbnz	w0, LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	mov	w28, #1
	mov	x0, x21
	mov	w2, #540
	mov	w3, #1
	bl	_BEGIN_NV04
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	x1, x28
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #14
	bl	_RING_SPACE
	cbnz	w0, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x22]
	mov	x0, x21
	mov	w2, #568
	mov	w3, #2
	bl	_BEGIN_NV04
	mov	x0, x25
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x21
	bl	_OUT_RING
	mov	x0, x24
	bl	_upper_32_bits
	mov	x1, x0
	mov	x0, x21
	bl	_OUT_RING
	ldr	w1, [x22]
	mov	x0, x21
	mov	w2, #780
	mov	w3, #8
	bl	_BEGIN_NV04
	mov	x0, x25
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x21
	bl	_OUT_RING
	mov	x0, x24
	bl	_lower_32_bits
	mov	x1, x0
	mov	x0, x21
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #64
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #64
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #64
	bl	_OUT_RING
	mov	x0, x21
	mov	x1, x27
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #257
	bl	_OUT_RING
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	ldr	w1, [x22]
Lloh11:
	adrp	x8, _NV_MEMORY_TO_MEMORY_FORMAT_NOP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NV_MEMORY_TO_MEMORY_FORMAT_NOP@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w3, #1
	bl	_BEGIN_NV04
	mov	x0, x21
	mov	w1, #0
	bl	_OUT_RING
	add	w25, w26, w25
	add	w24, w26, w24
	subs	w23, w23, w26
	b.ne	LBB0_2
LBB0_16:
	mov	w0, #0
LBB0_17:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_TTM_PL_VRAM,8,3                ; @TTM_PL_VRAM
	.comm	_NvSubCopy,4,2                  ; @NvSubCopy
	.comm	_NV_MEMORY_TO_MEMORY_FORMAT_NOP,4,2 ; @NV_MEMORY_TO_MEMORY_FORMAT_NOP
	.no_dead_strip	_nv50_bo_move_m2mf
.subsections_via_symbols
