	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___tegra_gem_mmap               ## -- Begin function __tegra_gem_mmap
	.p2align	4, 0x90
___tegra_gem_mmap:                      ## @__tegra_gem_mmap
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_to_tegra_bo
	cmpl	$0, 8(%rax)
	je	LBB0_1
## %bb.4:
	movl	12(%rbx), %edi
	callq	_vm_get_page_prot
	movq	_VM_MIXEDMAP@GOTPCREL(%rip), %rcx
	movl	12(%rbx), %edx
	orl	(%rcx), %edx
	movq	_VM_PFNMAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%edx, %ecx
	movl	%ecx, 12(%rbx)
	movl	%eax, %edi
	callq	_pgprot_writecombine
	movl	%eax, 8(%rbx)
	jmp	LBB0_5
LBB0_1:
	movq	(%rbx), %r15
	movq	_VM_PFNMAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, 12(%rbx)
	movq	$0, (%rbx)
	movq	8(%r14), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	movl	(%r14), %r8d
	movq	%rbx, %rsi
	callq	_dma_mmap_wc
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	%r15, (%rbx)
LBB0_5:
	xorl	%r14d, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_drm_gem_vm_close
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_PFNMAP,4,2                  ## @VM_PFNMAP
	.comm	_VM_MIXEDMAP,4,2                ## @VM_MIXEDMAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___tegra_gem_mmap               ; -- Begin function __tegra_gem_mmap
	.p2align	2
___tegra_gem_mmap:                      ; @__tegra_gem_mmap
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	bl	_to_tegra_bo
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w0, [x19, #12]
	bl	_vm_get_page_prot
Lloh0:
	adrp	x8, _VM_MIXEDMAP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VM_MIXEDMAP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
Lloh3:
	adrp	x9, _VM_PFNMAP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VM_PFNMAP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	bic	w8, w8, w9
	str	w8, [x19, #12]
	bl	_pgprot_writecombine
	mov	w20, #0
	str	w0, [x19, #8]
	b	LBB0_5
LBB0_2:
	ldr	x21, [x19]
Lloh6:
	adrp	x8, _VM_PFNMAP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VM_PFNMAP@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	bic	w8, w9, w8
	str	w8, [x19, #12]
	str	xzr, [x19]
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	ldp	w3, w2, [x0]
	ldr	w4, [x20]
	mov	x0, x8
	mov	x1, x19
	bl	_dma_mmap_wc
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	w20, #0
	str	x21, [x19]
	b	LBB0_5
LBB0_4:
	mov	x20, x0
	mov	x0, x19
	bl	_drm_gem_vm_close
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_PFNMAP,4,2                  ; @VM_PFNMAP
	.comm	_VM_MIXEDMAP,4,2                ; @VM_MIXEDMAP
.subsections_via_symbols
