	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_mmap                    ## -- Begin function pvrdma_mmap
	.p2align	4, 0x90
_pvrdma_mmap:                           ## @pvrdma_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	%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	%rsi, %rbx
	callq	_to_vucontext
	movq	%rax, %r15
	movq	(%rbx), %rax
	movq	8(%rbx), %r14
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	subq	%rax, %r14
	movq	16(%rbx), %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	8(%r15), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_2
## %bb.1:
	movl	%r13d, %ecx
	shlq	%cl, %r12
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	notq	%rax
	testq	%rax, %r12
	je	LBB0_3
LBB0_2:
	movq	8(%r15), %rax
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_6:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_VM_DONTCOPY@GOTPCREL(%rip), %rax
	movq	_VM_DONTEXPAND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 24(%rbx)
	movl	28(%rbx), %edi
	callq	_pgprot_noncached
	movl	%eax, 28(%rbx)
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rcx
	movl	%eax, %r8d
	callq	_io_remap_pfn_range
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	xorl	%eax, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"create mmap region\n"

	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
L_.str.1:                               ## @.str.1
	.asciz	"invalid params for mmap region\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_DONTCOPY,4,2                ## @VM_DONTCOPY
	.comm	_VM_DONTEXPAND,4,2              ## @VM_DONTEXPAND
	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_mmap                    ; -- Begin function pvrdma_mmap
	.p2align	2
_pvrdma_mmap:                           ; @pvrdma_mmap
	.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, x1
	bl	_to_vucontext
	mov	x20, x0
	ldp	x21, x8, [x19]
	sub	x22, x8, x21
	ldr	x23, [x19, #16]
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
	ldr	x8, [x0, #8]
	ldr	x0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh5:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_2
; %bb.1:
	lsl	x8, x23, x24
Lloh8:
	adrp	x9, _PAGE_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PAGE_MASK@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	bics	xzr, x8, x9
	b.eq	LBB0_5
LBB0_2:
	ldr	x8, [x20, #8]
	ldr	x0, [x8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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
LBB0_5:
Lloh15:
	adrp	x8, _VM_DONTCOPY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VM_DONTCOPY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _VM_DONTEXPAND@GOTPAGE
Lloh19:
	ldr	x9, [x9, _VM_DONTEXPAND@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldp	w9, w0, [x19, #24]
	orr	w8, w8, w9
	str	w8, [x19, #24]
	bl	_pgprot_noncached
	mov	x4, x0
	str	w0, [x19, #28]
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x21
	mov	x3, x22
	bl	_io_remap_pfn_range
	cbz	x0, LBB0_4
; %bb.6:
Lloh21:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"create mmap region\n"

	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
l_.str.1:                               ; @.str.1
	.asciz	"invalid params for mmap region\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_DONTCOPY,4,2                ; @VM_DONTCOPY
	.comm	_VM_DONTEXPAND,4,2              ; @VM_DONTEXPAND
	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
