	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_kremove                   ## -- Begin function pmap_kremove
	.p2align	4, 0x90
_pmap_kremove:                          ## @pmap_kremove
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_pmap_get_l2_bucket
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_KASSERT
	movq	(%rbx), %r14
	movl	%r15d, %edi
	callq	_l2pte_index
	movq	%rax, %rbx
	movl	(%r14,%rax,4), %r12d
	movl	%r12d, %edi
	callq	_l2pte_valid
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	_L2_TYPE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_L2_TYPE_L@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_L2_L_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_L2_S_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_L2_L_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_L2_S_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wlock
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PMAP_LOCK
	movq	_pvzone@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.3:
	andl	%r12d, %r14d
	cmpl	-48(%rbp), %r14d                ## 4-byte Folded Reload
	cmovel	-44(%rbp), %r13d                ## 4-byte Folded Reload
	cmovel	-52(%rbp), %ebx                 ## 4-byte Folded Reload
	andl	%r15d, %r13d
	andl	%r12d, %ebx
	orl	%r13d, %ebx
	movl	%ebx, %edi
	callq	_vm_phys_paddr_to_vm_page
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movq	_kernel_pmap@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	movl	%r15d, %edx
	callq	_pmap_remove_pv
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rax, %rdi
	callq	_pmap_free_pv_entry
LBB0_6:
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PMAP_UNLOCK
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wunlock
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	andl	%r15d, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_cpu_dcache_wbinv_range
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_cpu_l2cache_wbinv_range
	movl	%ebx, %edi
	callq	_cpu_tlb_flushD_SE
	xorl	%eax, %eax
	callq	_cpu_cpwait
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	$0, (%rax,%rcx,4)
LBB0_7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No L2 Bucket"

	.comm	_L2_TYPE_MASK,4,2               ## @L2_TYPE_MASK
	.comm	_L2_TYPE_L,4,2                  ## @L2_TYPE_L
	.comm	_L2_L_FRAME,4,2                 ## @L2_L_FRAME
	.comm	_L2_L_OFFSET,4,2                ## @L2_L_OFFSET
	.comm	_L2_S_FRAME,4,2                 ## @L2_S_FRAME
	.comm	_L2_S_OFFSET,4,2                ## @L2_S_OFFSET
	.comm	_pvh_global_lock,4,2            ## @pvh_global_lock
	.comm	_pvzone,8,3                     ## @pvzone
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_kremove                   ; -- Begin function pmap_kremove
	.p2align	2
_pmap_kremove:                          ; @pmap_kremove
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x23, _kernel_pmap@GOTPAGE
Lloh1:
	ldr	x23, [x23, _kernel_pmap@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, x19
	bl	_pmap_get_l2_bucket
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_KASSERT
	ldr	x22, [x20]
	mov	x0, x19
	bl	_l2pte_index
	mov	x20, x0
	ldr	w21, [x22, x0, lsl #2]
	mov	x0, x21
	bl	_l2pte_valid
	cbz	x0, LBB0_7
; %bb.2:
	str	x22, [sp, #8]                   ; 8-byte Folded Spill
Lloh4:
	adrp	x8, _L2_TYPE_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _L2_TYPE_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w24, [x8]
Lloh7:
	adrp	x8, _L2_TYPE_L@GOTPAGE
Lloh8:
	ldr	x8, [x8, _L2_TYPE_L@GOTPAGEOFF]
Lloh9:
	ldr	w26, [x8]
Lloh10:
	adrp	x8, _L2_L_FRAME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _L2_L_FRAME@GOTPAGEOFF]
Lloh12:
	ldr	w25, [x8]
Lloh13:
	adrp	x8, _L2_S_FRAME@GOTPAGE
Lloh14:
	ldr	x8, [x8, _L2_S_FRAME@GOTPAGEOFF]
Lloh15:
	ldr	w27, [x8]
Lloh16:
	adrp	x8, _L2_L_OFFSET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _L2_L_OFFSET@GOTPAGEOFF]
Lloh18:
	ldr	w28, [x8]
Lloh19:
	adrp	x8, _L2_S_OFFSET@GOTPAGE
Lloh20:
	ldr	x8, [x8, _L2_S_OFFSET@GOTPAGEOFF]
Lloh21:
	ldr	w22, [x8]
Lloh22:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh23:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wlock
	ldr	w0, [x23]
	bl	_PMAP_LOCK
Lloh24:
	adrp	x8, _pvzone@GOTPAGE
Lloh25:
	ldr	x8, [x8, _pvzone@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.3:
	and	w8, w24, w21
	cmp	w8, w26
	csel	w8, w28, w22, eq
	and	w8, w8, w19
	csel	w9, w25, w27, eq
	and	w9, w9, w21
	orr	w0, w8, w9
	bl	_vm_phys_paddr_to_vm_page
	cbz	w0, LBB0_6
; %bb.4:
Lloh27:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh28:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_pmap_remove_pv
	cbz	x0, LBB0_6
; %bb.5:
	bl	_pmap_free_pv_entry
LBB0_6:
Lloh30:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh31:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_PMAP_UNLOCK
Lloh33:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh34:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wunlock
Lloh35:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	bic	w19, w19, w8
Lloh38:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh39:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_cpu_dcache_wbinv_range
	ldr	w1, [x21]
	mov	x0, x19
	bl	_cpu_l2cache_wbinv_range
	mov	x0, x19
	bl	_cpu_tlb_flushD_SE
	bl	_cpu_cpwait
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	wzr, [x8, x20, lsl #2]
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No L2 Bucket"

	.comm	_L2_TYPE_MASK,4,2               ; @L2_TYPE_MASK
	.comm	_L2_TYPE_L,4,2                  ; @L2_TYPE_L
	.comm	_L2_L_FRAME,4,2                 ; @L2_L_FRAME
	.comm	_L2_L_OFFSET,4,2                ; @L2_L_OFFSET
	.comm	_L2_S_FRAME,4,2                 ; @L2_S_FRAME
	.comm	_L2_S_OFFSET,4,2                ; @L2_S_OFFSET
	.comm	_pvh_global_lock,4,2            ; @pvh_global_lock
	.comm	_pvzone,8,3                     ; @pvzone
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
.subsections_via_symbols
