	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_bo_vma_add             ## -- Begin function nouveau_bo_vma_add
	.p2align	4, 0x90
_nouveau_bo_vma_add:                    ## @nouveau_bo_vma_add
	.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, %r14
	movq	%rdi, %r12
	movl	8(%rdi), %ebx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	24(%rdi), %r13
	movl	32(%rdi), %edx
	movq	_NV_MEM_ACCESS_RW@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rsi, %rdi
	movl	%ebx, %esi
	movq	%r14, %r8
	callq	_nouveau_vm_get
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	16(%r12), %rax
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movq	24(%r12), %rsi
	movq	%r14, %rdi
	callq	_nouveau_vm_map
	jmp	LBB0_7
LBB0_3:
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.4:
	cmpq	$0, (%r13)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%r13, %rcx
	callq	_nouveau_vm_map_sg_table
	jmp	LBB0_7
LBB0_6:
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%r13, %rcx
	callq	_nouveau_vm_map_sg
LBB0_7:
	leaq	4(%r14), %rdi
	movq	%r12, %rsi
	callq	_list_add_tail
	movl	$1, (%r14)
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %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	_NV_MEM_ACCESS_RW,4,2           ## @NV_MEM_ACCESS_RW
	.comm	_TTM_PL_VRAM,8,3                ## @TTM_PL_VRAM
	.comm	_TTM_PL_TT,8,3                  ## @TTM_PL_TT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_bo_vma_add             ; -- Begin function nouveau_bo_vma_add
	.p2align	2
_nouveau_bo_vma_add:                    ; @nouveau_bo_vma_add
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x20, x0
	ldr	w8, [x0, #8]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	lsl	w23, w8, w9
	ldr	x22, [x0, #24]
	ldr	w2, [x0, #32]
Lloh3:
	adrp	x8, _NV_MEM_ACCESS_RW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NV_MEM_ACCESS_RW@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x1
	mov	x1, x23
	mov	x4, x19
	bl	_nouveau_vm_get
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	x8, [x20, #16]
Lloh6:
	adrp	x9, _TTM_PL_VRAM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	x1, [x20, #24]
	mov	x0, x19
	bl	_nouveau_vm_map
	b	LBB0_7
LBB0_3:
Lloh9:
	adrp	x9, _TTM_PL_TT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TTM_PL_TT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	ldr	x8, [x22]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x23
	mov	x3, x22
	bl	_nouveau_vm_map_sg_table
	b	LBB0_7
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x23
	mov	x3, x22
	bl	_nouveau_vm_map_sg
LBB0_7:
	add	x0, x19, #4
	mov	x1, x20
	bl	_list_add_tail
	mov	w8, #1
	str	w8, [x19]
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_NV_MEM_ACCESS_RW,4,2           ; @NV_MEM_ACCESS_RW
	.comm	_TTM_PL_VRAM,8,3                ; @TTM_PL_VRAM
	.comm	_TTM_PL_TT,8,3                  ; @TTM_PL_TT
.subsections_via_symbols
