	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_umem_map
_nvkm_umem_map:                         ## @nvkm_umem_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movq	%r8, %r12
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movq	%rsi, %r14
	callq	_nvkm_umem
	cmpl	$0, 24(%rax)
	je	LBB0_11
## %bb.1:
	movq	%rax, %rbx
	cmpq	$0, 16(%rax)
	je	LBB0_3
## %bb.2:
	movq	_EEXIST@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_3:
	movq	32(%rbx), %rdi
	movl	(%rbx), %eax
	testl	%r13d, %r13d
	jne	LBB0_7
## %bb.4:
	movq	_NVKM_MEM_HOST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	je	LBB0_7
## %bb.5:
	movq	%rbx, %rsi
	addq	$16, %rsi
	movl	12(%rbx), %edi
	callq	_nvkm_mem_map_host
	testl	%eax, %eax
	jne	LBB0_13
## %bb.6:
	movq	16(%rbx), %rax
	movq	%rax, (%r12)
	movl	12(%rbx), %edi
	callq	_nvkm_memory_size
	movq	%rax, (%r15)
	movq	_NVKM_OBJECT_MAP_VA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_7:
	movq	_NVKM_MEM_VRAM@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_9
## %bb.8:
	movq	_NVKM_MEM_KIND@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
LBB0_9:
	movq	(%rdi), %rax
	movl	12(%rbx), %esi
	movq	%rbx, %rcx
	addq	$8, %rcx
	movq	%rcx, (%rsp)
	movq	%r14, %rdx
	movl	%r13d, %ecx
	movq	%r12, %r8
	movq	%r15, %r9
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movq	_NVKM_OBJECT_MAP_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx)
	xorl	%edx, %edx
	cmpl	(%rax), %ecx
	sete	%dl
	movl	%edx, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_NVKM_MEM_HOST,4,2              ## @NVKM_MEM_HOST
	.comm	_NVKM_OBJECT_MAP_VA,4,2         ## @NVKM_OBJECT_MAP_VA
	.comm	_NVKM_MEM_VRAM,4,2              ## @NVKM_MEM_VRAM
	.comm	_NVKM_MEM_KIND,4,2              ## @NVKM_MEM_KIND
	.comm	_NVKM_OBJECT_MAP_IO,4,2         ## @NVKM_OBJECT_MAP_IO
	.no_dead_strip	_nvkm_umem_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_umem_map
_nvkm_umem_map:                         ; @nvkm_umem_map
	.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	x20, x5
	mov	x22, x4
	mov	x19, x3
	mov	x23, x2
	mov	x24, x1
	bl	_nvkm_umem
	ldr	w8, [x0, #24]
	cbz	w8, LBB0_11
; %bb.1:
	mov	x21, x0
	mov	x1, x0
	ldr	x8, [x1, #16]!
	cbz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EEXIST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_12
LBB0_3:
	ldr	x0, [x21, #32]
	ldr	w8, [x21]
	cbnz	w23, LBB0_7
; %bb.4:
Lloh2:
	adrp	x9, _NVKM_MEM_HOST@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NVKM_MEM_HOST@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w9, w9, w8
	cbz	w9, LBB0_7
; %bb.5:
	ldr	w0, [x21, #12]
	bl	_nvkm_mem_map_host
	cbnz	w0, LBB0_13
; %bb.6:
	ldr	x8, [x21, #16]
	str	x8, [x22]
	ldr	w0, [x21, #12]
	bl	_nvkm_memory_size
	mov	x8, x0
	mov	w0, #0
	str	x8, [x20]
Lloh5:
	adrp	x8, _NVKM_OBJECT_MAP_VA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NVKM_OBJECT_MAP_VA@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_13
LBB0_7:
Lloh8:
	adrp	x9, _NVKM_MEM_VRAM@GOTPAGE
Lloh9:
	ldr	x9, [x9, _NVKM_MEM_VRAM@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.8:
Lloh11:
	adrp	x9, _NVKM_MEM_KIND@GOTPAGE
Lloh12:
	ldr	x9, [x9, _NVKM_MEM_KIND@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
LBB0_9:
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	w1, [x21, #12]
	add	x6, x21, #8
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	mov	x5, x20
	blr	x8
	cbnz	w0, LBB0_13
; %bb.10:
Lloh14:
	adrp	x8, _NVKM_OBJECT_MAP_IO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NVKM_OBJECT_MAP_IO@GOTPAGEOFF]
	ldr	w9, [x8]
	str	w9, [x19]
	ldr	w8, [x8]
	cmp	w9, w8
	cset	w8, eq
	str	w8, [x21, #4]
	b	LBB0_13
LBB0_11:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_NVKM_MEM_HOST,4,2              ; @NVKM_MEM_HOST
	.comm	_NVKM_OBJECT_MAP_VA,4,2         ; @NVKM_OBJECT_MAP_VA
	.comm	_NVKM_MEM_VRAM,4,2              ; @NVKM_MEM_VRAM
	.comm	_NVKM_MEM_KIND,4,2              ; @NVKM_MEM_KIND
	.comm	_NVKM_OBJECT_MAP_IO,4,2         ; @NVKM_OBJECT_MAP_IO
	.no_dead_strip	_nvkm_umem_map
.subsections_via_symbols
