	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmap_mem
_mmap_mem:                              ## @mmap_mem
	.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, %r15
	movq	(%rsi), %r14
	subq	8(%rsi), %r14
	movl	20(%rsi), %edi
	movq	%r14, %rsi
	callq	_valid_mmap_phys_addr_range
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_private_mapping_ok
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	20(%rbx), %edi
	movq	%r14, %rsi
	callq	_range_is_allowed
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	20(%rbx), %esi
	leaq	16(%rbx), %rcx
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_phys_mem_access_prot_allowed
	testl	%eax, %eax
	je	LBB0_1
## %bb.7:
	movl	16(%rbx), %ecx
	movl	20(%rbx), %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_phys_mem_access_prot
	movl	%eax, 16(%rbx)
	movq	_mmap_mem_ops@GOTPCREL(%rip), %rcx
	movq	%rcx, 24(%rbx)
	movq	8(%rbx), %rsi
	movl	20(%rbx), %edx
	movq	%rbx, %rdi
	movq	%r14, %rcx
	movl	%eax, %r8d
	callq	_remap_pfn_range
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_3:
	movq	_ENOSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_10
LBB0_5:
	movq	_EPERM@GOTPCREL(%rip), %rcx
LBB0_10:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_mmap_mem_ops,4,2               ## @mmap_mem_ops
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_mmap_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmap_mem
_mmap_mem:                              ; @mmap_mem
	.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	x21, x0
	ldp	x8, x9, [x1]
	sub	x20, x8, x9
	ldr	w0, [x1, #20]
	mov	x1, x20
	bl	_valid_mmap_phys_addr_range
	cbz	w0, LBB0_6
; %bb.1:
	mov	x0, x19
	bl	_private_mapping_ok
	cbz	w0, LBB0_7
; %bb.2:
	ldr	w0, [x19, #20]
	mov	x1, x20
	bl	_range_is_allowed
	cbz	w0, LBB0_8
; %bb.3:
	ldr	w1, [x19, #20]
	add	x3, x19, #16
	mov	x0, x21
	mov	x2, x20
	bl	_phys_mem_access_prot_allowed
	cbz	w0, LBB0_6
; %bb.4:
	ldp	w3, w1, [x19, #16]
	mov	x0, x21
	mov	x2, x20
	bl	_phys_mem_access_prot
	mov	x4, x0
	str	w0, [x19, #16]
Lloh0:
	adrp	x8, _mmap_mem_ops@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mmap_mem_ops@GOTPAGEOFF]
	str	x8, [x19, #24]
	ldr	x1, [x19, #8]
	ldr	w2, [x19, #20]
	mov	x0, x19
	mov	x3, x20
	bl	_remap_pfn_range
	cbz	x0, LBB0_10
; %bb.5:
Lloh2:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh6:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh8:
	adrp	x8, _EPERM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_mmap_mem_ops,4,2               ; @mmap_mem_ops
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_mmap_mem
.subsections_via_symbols
