	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_dmem_migrate_copy_one
_nouveau_dmem_migrate_copy_one:         ## @nouveau_dmem_migrate_copy_one
	.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
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	movq	%rsi, %rdi
	callq	_migrate_pfn_to_page
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r12
	movq	_MIGRATE_PFN_MIGRATE@GOTPCREL(%rip), %rax
	testq	%rbx, (%rax)
	je	LBB0_8
## %bb.2:
	movq	%r13, %rdi
	callq	_nouveau_dmem_page_alloc_locked
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_dma_map_page
	movl	%eax, (%r15)
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movq	(%r13), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_NOUVEAU_APER_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rbx, %rdi
	callq	_nouveau_dmem_page_addr
	movq	_NOUVEAU_APER_HOST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	(%r15), %r9d
	movq	%r13, %rdi
	movl	$1, %esi
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	*-48(%rbp)                      ## 8-byte Folded Reload
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	(%r15), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_unmap_page
LBB0_7:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_nouveau_dmem_page_free_locked
LBB0_8:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rdi
	callq	_page_to_pfn
	movl	%eax, %edi
	callq	_migrate_pfn
	movq	_MIGRATE_PFN_LOCKED@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MIGRATE_PFN_MIGRATE,8,3        ## @MIGRATE_PFN_MIGRATE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_NOUVEAU_APER_VRAM,4,2          ## @NOUVEAU_APER_VRAM
	.comm	_NOUVEAU_APER_HOST,4,2          ## @NOUVEAU_APER_HOST
	.comm	_MIGRATE_PFN_LOCKED,8,3         ## @MIGRATE_PFN_LOCKED
	.no_dead_strip	_nouveau_dmem_migrate_copy_one
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_dmem_migrate_copy_one
_nouveau_dmem_migrate_copy_one:         ; @nouveau_dmem_migrate_copy_one
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	mov	x0, x1
	bl	_migrate_pfn_to_page
	cbz	x0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _MIGRATE_PFN_MIGRATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MIGRATE_PFN_MIGRATE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	tst	x8, x22
	b.eq	LBB0_7
; %bb.2:
	mov	x23, x0
	mov	x0, x19
	bl	_nouveau_dmem_page_alloc_locked
	cbz	x0, LBB0_8
; %bb.3:
	mov	x22, x0
Lloh3:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w3, [x24]
Lloh5:
	adrp	x25, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh6:
	ldr	x25, [x25, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
	ldr	w4, [x25]
	mov	x0, x21
	mov	x1, x23
	mov	w2, #0
	bl	_dma_map_page
	mov	x1, x0
	str	w0, [x20]
	mov	x0, x21
	bl	_dma_mapping_error
	cbnz	x0, LBB0_6
; %bb.4:
	ldr	x8, [x19]
	ldr	x26, [x8]
Lloh7:
	adrp	x8, _NOUVEAU_APER_VRAM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _NOUVEAU_APER_VRAM@GOTPAGEOFF]
Lloh9:
	ldr	w23, [x8]
	mov	x0, x22
	bl	_nouveau_dmem_page_addr
	mov	x3, x0
Lloh10:
	adrp	x8, _NOUVEAU_APER_HOST@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NOUVEAU_APER_HOST@GOTPAGEOFF]
Lloh12:
	ldr	w4, [x8]
	ldr	w5, [x20]
	mov	x0, x19
	mov	w1, #1
	mov	x2, x23
	blr	x26
	cbz	x0, LBB0_9
; %bb.5:
	ldr	w1, [x20]
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	x0, x21
	bl	_dma_unmap_page
LBB0_6:
	mov	x0, x19
	mov	x1, x22
	bl	_nouveau_dmem_page_free_locked
LBB0_7:
	mov	x0, #0
LBB0_8:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x22
	bl	_page_to_pfn
	bl	_migrate_pfn
Lloh13:
	adrp	x8, _MIGRATE_PFN_LOCKED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MIGRATE_PFN_LOCKED@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	orr	x0, x8, x0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MIGRATE_PFN_MIGRATE,8,3        ; @MIGRATE_PFN_MIGRATE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_NOUVEAU_APER_VRAM,4,2          ; @NOUVEAU_APER_VRAM
	.comm	_NOUVEAU_APER_HOST,4,2          ; @NOUVEAU_APER_HOST
	.comm	_MIGRATE_PFN_LOCKED,8,3         ; @MIGRATE_PFN_LOCKED
	.no_dead_strip	_nouveau_dmem_migrate_copy_one
.subsections_via_symbols
