	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_dmem_fault_copy_one
_nouveau_dmem_fault_copy_one:           ## @nouveau_dmem_fault_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
	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, %r13
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	(%rdx), %rax
	movl	(%rax), %edi
	callq	_migrate_pfn_to_page
	movq	%rax, %r14
	xorl	%eax, %eax
	testq	%r14, %r14
	je	LBB0_9
## %bb.1:
	movq	(%r12), %rcx
	movq	_MIGRATE_PFN_MIGRATE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	je	LBB0_9
## %bb.2:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_HIGHUSER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	callq	_alloc_page_vma
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_lock_page
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_dma_map_page
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_NOUVEAU_APER_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_NOUVEAU_APER_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	callq	_nouveau_dmem_page_addr
	movq	%r15, %rdi
	movl	$1, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	movl	%eax, %r9d
	callq	*-80(%rbp)                      ## 8-byte Folded Reload
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_dma_unmap_page
LBB0_7:
	movq	%r13, %rdi
	callq	___free_page
LBB0_8:
	movq	_VM_FAULT_SIGBUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r13, %rdi
	callq	_page_to_pfn
	movl	%eax, %edi
	callq	_migrate_pfn
	movq	_MIGRATE_PFN_LOCKED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	8(%r12), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MIGRATE_PFN_MIGRATE,4,2        ## @MIGRATE_PFN_MIGRATE
	.comm	_GFP_HIGHUSER,4,2               ## @GFP_HIGHUSER
	.comm	_VM_FAULT_SIGBUS,4,2            ## @VM_FAULT_SIGBUS
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.comm	_NOUVEAU_APER_HOST,4,2          ## @NOUVEAU_APER_HOST
	.comm	_NOUVEAU_APER_VRAM,4,2          ## @NOUVEAU_APER_VRAM
	.comm	_MIGRATE_PFN_LOCKED,4,2         ## @MIGRATE_PFN_LOCKED
	.no_dead_strip	_nouveau_dmem_fault_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_fault_copy_one
_nouveau_dmem_fault_copy_one:           ; @nouveau_dmem_fault_copy_one
	.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	x20, x3
	mov	x19, x2
	mov	x23, x1
	mov	x22, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	ldr	x8, [x2]
	ldr	w0, [x8]
	bl	_migrate_pfn_to_page
	cbz	x0, LBB0_9
; %bb.1:
	ldr	x8, [x19]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _MIGRATE_PFN_MIGRATE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MIGRATE_PFN_MIGRATE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.2:
	mov	x24, x0
Lloh3:
	adrp	x8, _GFP_HIGHUSER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_HIGHUSER@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldp	w2, w1, [x23]
	bl	_alloc_page_vma
	cbz	x0, LBB0_7
; %bb.3:
	mov	x23, x0
	bl	_lock_page
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
Lloh9:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	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, [x22]
Lloh12:
	adrp	x9, _NOUVEAU_APER_HOST@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NOUVEAU_APER_HOST@GOTPAGEOFF]
	ldr	x28, [x8]
Lloh14:
	ldr	w25, [x9]
	ldr	w26, [x20]
Lloh15:
	adrp	x8, _NOUVEAU_APER_VRAM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NOUVEAU_APER_VRAM@GOTPAGEOFF]
Lloh17:
	ldr	w27, [x8]
	mov	x0, x24
	bl	_nouveau_dmem_page_addr
	mov	x5, x0
	mov	x0, x22
	mov	w1, #1
	mov	x2, x25
	mov	x3, x26
	mov	x4, x27
	blr	x28
	cbz	x0, LBB0_10
; %bb.5:
	ldr	w1, [x20]
Lloh18:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_dma_unmap_page
LBB0_6:
	mov	x0, x23
	bl	___free_page
LBB0_7:
Lloh24:
	adrp	x8, _VM_FAULT_SIGBUS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VM_FAULT_SIGBUS@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_8:
	mov	w0, #0
LBB0_9:
	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
LBB0_10:
	mov	x0, x23
	bl	_page_to_pfn
	bl	_migrate_pfn
	mov	x8, x0
	mov	w0, #0
Lloh27:
	adrp	x9, _MIGRATE_PFN_LOCKED@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MIGRATE_PFN_LOCKED@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	x9, [x19, #8]
	str	w8, [x9]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_MIGRATE_PFN_MIGRATE,4,2        ; @MIGRATE_PFN_MIGRATE
	.comm	_GFP_HIGHUSER,4,2               ; @GFP_HIGHUSER
	.comm	_VM_FAULT_SIGBUS,4,2            ; @VM_FAULT_SIGBUS
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.comm	_NOUVEAU_APER_HOST,4,2          ; @NOUVEAU_APER_HOST
	.comm	_NOUVEAU_APER_VRAM,4,2          ; @NOUVEAU_APER_VRAM
	.comm	_MIGRATE_PFN_LOCKED,4,2         ; @MIGRATE_PFN_LOCKED
	.no_dead_strip	_nouveau_dmem_fault_copy_one
.subsections_via_symbols
