	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_uvmm_mthd_map
_nvkm_uvmm_mthd_map:                    ## @nvkm_uvmm_mthd_map
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rsi, -72(%rbp)
	movl	%edx, -52(%rbp)
	movq	(%rdi), %r14
	movq	8(%rdi), %r15
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	movups	(%rsi), %xmm0
	movups	16(%rsi), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	leaq	-72(%rbp), %rsi
	leaq	-52(%rbp), %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	callq	_nvif_unpack
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_28
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %r14
	movq	16(%rbx), %r13
	movq	24(%rbx), %rbx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_nvkm_umem_search
	movq	%rax, %r12
	movq	%rax, -64(%rbp)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r12, %rdi
	callq	_PTR_ERR
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_VMM_DEBUG
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
	jmp	LBB0_28
LBB0_3:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r14, %rdi
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_nvkm_vmm_node_search
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdx
	xorl	%r13d, %r13d
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	subl	(%rcx), %r13d
	movl	56(%rax), %ecx
	testl	%ecx, %ecx
	jne	LBB0_8
## %bb.6:
	cmpl	$0, (%r15)
	je	LBB0_7
LBB0_8:
	movl	(%rax), %r9d
	testl	%r9d, %r9d
	je	LBB0_11
## %bb.9:
	xorl	%r8d, %r8d
	cmpl	$0, (%r15)
	sete	%r8b
	jmp	LBB0_10
LBB0_4:
	negl	%r13d
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_VMM_DEBUG
	movq	%r14, %rbx
	jmp	LBB0_27
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	subl	(%rcx), %r13d
	cmpq	$0, 48(%rax)
	je	LBB0_14
## %bb.12:
	cmpq	$0, 40(%rax)
	je	LBB0_13
LBB0_14:
	movq	8(%rax), %rbx
	movq	16(%rax), %rsi
	movq	%rdx, %r9
	cmpq	%rdx, %rbx
	movq	-88(%rbp), %r10                 ## 8-byte Reload
	jne	LBB0_16
## %bb.15:
	cmpq	%r10, %rsi
	je	LBB0_24
LBB0_16:
	leaq	(%r10,%r9), %rdx
	leaq	(%rsi,%rbx), %rdi
	movq	40(%rax), %rcx
	cmpq	%rdi, %rdx
	jg	LBB0_21
## %bb.17:
	testq	%rcx, %rcx
	jne	LBB0_21
## %bb.18:
	movq	24(%rax), %rcx
	movq	_NVKM_VMA_PAGE_NONE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_22
## %bb.19:
	cmpl	$0, 32(%rax)
	je	LBB0_20
LBB0_22:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	movq	%r9, %rdx
	movq	%r10, %rcx
	callq	_nvkm_vmm_node_split
	testq	%rax, %rax
	je	LBB0_23
LBB0_24:
	movl	$1, (%rax)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%rax, %r14
	callq	_mutex_unlock
	movq	-72(%rbp), %r8
	movl	-52(%rbp), %r9d
	movq	%r12, %rdi
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	_nvkm_memory_map
	testl	%eax, %eax
	je	LBB0_25
## %bb.26:
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_mutex_lock
	movl	$0, (%r14)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_nvkm_vmm_unmap_region
	jmp	LBB0_27
LBB0_7:
	movl	(%rax), %r9d
	movl	$1, %r8d
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_VMM_DEBUG
LBB0_27:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	leaq	-64(%rbp), %rdi
	callq	_nvkm_memory_unref
LBB0_28:
	movl	%r13d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_VMM_DEBUG
	jmp	LBB0_27
LBB0_25:
	leaq	-64(%rbp), %rdi
	callq	_nvkm_memory_unref
	xorl	%r13d, %r13d
	jmp	LBB0_28
LBB0_23:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_27
LBB0_20:
	xorl	%ecx, %ecx
LBB0_21:
	xorl	%edx, %edx
	testq	%rcx, %rcx
	setne	%dl
	movq	24(%rax), %rcx
	movl	32(%rax), %r8d
	movq	%rsi, 16(%rsp)
	movq	%rbx, 8(%rsp)
	movq	%r10, (%rsp)
	leaq	L_.str.4(%rip), %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_VMM_DEBUG
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"memory %016llx %ld\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
L_.str.1:                               ## @.str.1
	.asciz	"lookup %016llx"

L_.str.2:                               ## @.str.2
	.asciz	"denied %016llx: %d %d %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"pfnmap %016llx"

	.comm	_NVKM_VMA_PAGE_NONE,8,3         ## @NVKM_VMA_PAGE_NONE
L_.str.4:                               ## @.str.4
	.asciz	"split %d %d %d %016llx %016llx %016llx %016llx"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_nvkm_uvmm_mthd_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_uvmm_mthd_map
_nvkm_uvmm_mthd_map:                    ; @nvkm_uvmm_mthd_map
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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, x1
	str	x1, [sp, #88]
	str	w2, [sp, #84]
	ldp	x19, x26, [x0]
Lloh0:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	q0, q1, [x1]
	stp	q0, q1, [sp, #48]
	add	x1, sp, #88
	add	x2, sp, #84
	add	x3, sp, #48
	mov	w4, #0
	mov	w5, #0
	mov	w6, #1
	bl	_nvif_unpack
	mov	x21, x0
	cbnz	w0, LBB0_26
; %bb.1:
	ldp	x20, x25, [x22]
	ldp	x21, x24, [x22, #16]
	mov	x0, x26
	mov	x1, x21
	bl	_nvkm_umem_search
	mov	x22, x0
	str	x0, [sp, #48]
	bl	_IS_ERR
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x22
	bl	_PTR_ERR
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_VMM_DEBUG
	mov	x0, x22
	bl	_PTR_ERR
	mov	x21, x0
	b	LBB0_26
LBB0_3:
	mov	x0, x19
	bl	_mutex_lock
Lloh5:
	adrp	x21, _ENOENT@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ENOENT@GOTPAGEOFF]
	ldr	w27, [x21]
	mov	x0, x19
	mov	x1, x20
	bl	_nvkm_vmm_node_search
	cbz	x0, LBB0_8
; %bb.4:
	mov	x23, x0
	ldr	w9, [x21]
	ldr	w8, [x0, #56]
	cbnz	w8, LBB0_6
; %bb.5:
	ldr	w10, [x26]
	cbz	w10, LBB0_20
LBB0_6:
	ldr	w10, [x23]
	cbz	w10, LBB0_9
; %bb.7:
	ldr	w11, [x26]
	cmp	w11, #0
	cset	w11, eq
	b	LBB0_21
LBB0_8:
	neg	w21, w27
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_22
LBB0_9:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x8, [x23, #48]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x8, [x23, #40]
	cbz	x8, LBB0_27
LBB0_11:
	ldp	x8, x9, [x23, #8]
	cmp	x8, x20
	b.ne	LBB0_13
; %bb.12:
	cmp	x9, x25
	b.eq	LBB0_18
LBB0_13:
	add	x11, x25, x20
	ldr	x10, [x23, #40]
	add	x12, x9, x8
	cmp	x11, x12
	b.gt	LBB0_30
; %bb.14:
	cbnz	x10, LBB0_30
; %bb.15:
	ldr	x10, [x23, #24]
Lloh12:
	adrp	x11, _NVKM_VMA_PAGE_NONE@GOTPAGE
Lloh13:
	ldr	x11, [x11, _NVKM_VMA_PAGE_NONE@GOTPAGEOFF]
Lloh14:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_17
; %bb.16:
	ldr	w10, [x23, #32]
	cbz	w10, LBB0_29
LBB0_17:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	mov	x3, x25
	bl	_nvkm_vmm_node_split
	mov	x23, x0
	cbz	x0, LBB0_28
LBB0_18:
	mov	w8, #1
	str	w8, [x23]
	mov	x0, x19
	bl	_mutex_unlock
	ldr	x4, [sp, #88]
	ldr	w5, [sp, #84]
	mov	x0, x22
	mov	x1, x24
	mov	x2, x19
	mov	x3, x23
	bl	_nvkm_memory_map
	mov	x21, x0
	cbz	w0, LBB0_25
; %bb.19:
	mov	x0, x19
	bl	_mutex_lock
	str	wzr, [x23]
	mov	x0, x19
	mov	x1, x23
	bl	_nvkm_vmm_unmap_region
	b	LBB0_24
LBB0_20:
	ldr	w10, [x23]
	mov	w11, #1
LBB0_21:
	neg	w21, w9
	stp	x11, x10, [sp, #8]
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_22:
	mov	x0, x19
	mov	x2, x20
LBB0_23:
	bl	_VMM_DEBUG
LBB0_24:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_25:
	add	x0, sp, #48
	bl	_nvkm_memory_unref
LBB0_26:
	mov	x0, x21
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
LBB0_27:
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_22
LBB0_28:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_24
LBB0_29:
	mov	x10, #0
LBB0_30:
	cmp	x10, #0
	cset	w2, ne
	ldr	x10, [x23, #24]
	ldr	w11, [x23, #32]
	stp	x8, x9, [sp, #32]
	stp	x20, x25, [sp, #16]
	stp	x10, x11, [sp]
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	b	LBB0_23
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memory %016llx %ld\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
l_.str.1:                               ; @.str.1
	.asciz	"lookup %016llx"

l_.str.2:                               ; @.str.2
	.asciz	"denied %016llx: %d %d %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"pfnmap %016llx"

	.comm	_NVKM_VMA_PAGE_NONE,8,3         ; @NVKM_VMA_PAGE_NONE
l_.str.4:                               ; @.str.4
	.asciz	"split %d %d %d %016llx %016llx %016llx %016llx"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_nvkm_uvmm_mthd_map
.subsections_via_symbols
