	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kern_munmap                    ## -- Begin function kern_munmap
	.p2align	4, 0x90
_kern_munmap:                           ## @kern_munmap
	.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
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	andq	%rsi, %rdi
	subq	%rdi, %rbx
	addq	%rdx, %rdi
	callq	_round_page
	movq	%rax, %r14
	addq	%rbx, %r14
	jb	LBB0_1
## %bb.3:
	movq	(%r15), %rax
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_vm_map_min
	cmpq	%rax, %rbx
	jb	LBB0_1
## %bb.4:
	movq	%r15, %rdi
	callq	_vm_map_max
	cmpq	%rax, %r14
	jbe	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r15, %rdi
	callq	_vm_map_lock
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_vm_map_delete
	movq	%r15, %rdi
	callq	_vm_map_unlock
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_PMC_FN_MUNMAP,4,2              ## @PMC_FN_MUNMAP
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_VM_PROT_EXECUTE,4,2            ## @VM_PROT_EXECUTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kern_munmap                    ; -- Begin function kern_munmap
	.p2align	2
_kern_munmap:                           ; @kern_munmap
	.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
	cbz	x2, LBB0_4
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	and	x8, x8, x1
	sub	x19, x1, x8
	add	x0, x8, x2
	bl	_round_page
	adds	x20, x19, x0
	b.hs	LBB0_4
; %bb.2:
	ldr	x8, [x21]
	ldr	x21, [x8]
	mov	x0, x21
	bl	_vm_map_min
	cmp	x19, x0
	b.lo	LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_vm_map_max
	cmp	x20, x0
	b.ls	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_5:
	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
LBB0_6:
	mov	x0, x21
	bl	_vm_map_lock
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_vm_map_delete
	mov	x0, x21
	bl	_vm_map_unlock
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_PMC_FN_MUNMAP,4,2              ; @PMC_FN_MUNMAP
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_VM_PROT_EXECUTE,4,2            ; @VM_PROT_EXECUTE
.subsections_via_symbols
