	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_mem_new_type              ## -- Begin function nvkm_mem_new_type
	.p2align	4, 0x90
_nvkm_mem_new_type:                     ## @nvkm_mem_new_type
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	$0, -24(%rbp)
	movq	8(%rdi), %r10
	movslq	%esi, %rbx
	movq	_NVKM_MEM_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r10,%rbx,4)
	je	LBB0_2
## %bb.1:
	movq	(%rdi), %rax
	leaq	-24(%rbp), %rbx
	movq	%rbx, (%rsp)
	callq	*(%rax)
	jmp	LBB0_3
LBB0_2:
	leaq	-24(%rbp), %rax
	movq	%rax, (%rsp)
	callq	_nvkm_mem_new_host
LBB0_3:
	movl	%eax, %ebx
	movq	16(%rbp), %r14
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	-24(%rbp), %rdi
	callq	_nvkm_memory_unref
LBB0_5:
	movq	-24(%rbp), %rax
	movq	%rax, (%r14)
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVKM_MEM_VRAM,4,2              ## @NVKM_MEM_VRAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_mem_new_type              ; -- Begin function nvkm_mem_new_type
	.p2align	2
_nvkm_mem_new_type:                     ; @nvkm_mem_new_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x6
	str	xzr, [sp, #8]
	ldr	x8, [x0, #8]
	ldr	w8, [x8, w1, sxtw #2]
Lloh0:
	adrp	x9, _NVKM_MEM_VRAM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NVKM_MEM_VRAM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	ldr	x8, [x0]
	ldr	x8, [x8]
	add	x6, sp, #8
	blr	x8
	mov	x20, x0
	cbz	w0, LBB0_3
LBB0_2:
	add	x0, sp, #8
	bl	_nvkm_memory_unref
LBB0_3:
	ldr	x8, [sp, #8]
	str	x8, [x19]
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
	add	x6, sp, #8
	bl	_nvkm_mem_new_host
	mov	x20, x0
	cbnz	w0, LBB0_2
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NVKM_MEM_VRAM,4,2              ; @NVKM_MEM_VRAM
.subsections_via_symbols
