	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_remove_all                ## -- Begin function pmap_remove_all
	.p2align	4, 0x90
_pmap_remove_all:                       ## @pmap_remove_all
	.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
	movq	%rdi, %r15
	movq	_FALSE@GOTPCREL(%rip), %r14
	movq	(%r14), %r12
	movq	_VPO_UNMANAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	(%r15), %eax
	sete	%dil
	movq	%r15, %rsi
	callq	_KASSERT
	leaq	8(%r15), %r13
	movq	%r13, %rdi
	callq	_TAILQ_EMPTY
	testq	%rax, %rax
	je	LBB0_1
## %bb.18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wlock
	movq	_PVF_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pmap_clearbit
	movq	_curproc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_vmspace_pmap
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_TAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %rbx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rbx), %rdi
	movl	16(%rbx), %esi
	callq	_pmap_get_l2_bucket
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movq	%r13, %r12
	movq	%r14, %r13
	movq	(%r15), %r14
	movl	16(%rbx), %edi
	callq	_l2pte_index
	leaq	(%r14,%rax,8), %rsi
	movq	$0, (%r14,%rax,8)
	movq	%r13, %r14
	movq	%r12, %r13
	movq	8(%rbx), %rdi
	callq	_PTE_SYNC_CURRENT
	movq	8(%rbx), %rdi
	movq	%r15, %rsi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movl	$1, %edx
	callq	_pmap_free_l2_bucket
	movq	8(%rbx), %rsi
	decl	(%rsi)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	orl	(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_pmap_nuke_pv
	movq	8(%rbx), %rdi
	callq	_PMAP_UNLOCK
	movq	%rbx, %rdi
	callq	_pmap_free_pv_entry
	movq	%r13, %rdi
	callq	_TAILQ_FIRST
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_13
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rdi
	cmpq	(%r14), %r12
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmoveq	%rax, %r12
	cmpq	-56(%rbp), %rdi                 ## 8-byte Folded Reload
	cmoveq	%rax, %r12
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	callq	_PMAP_LOCK
	movq	8(%rbx), %rdi
	callq	_pmap_is_current
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cpu_dcache_inv_range
	movq	8(%rbx), %rdi
	movl	16(%rbx), %esi
	callq	_pmap_has_valid_mapping
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%rbx), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_cpu_l2cache_inv_range
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_PVF_UNMAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%rbx), %eax
	movl	%eax, 4(%r15)
	movq	8(%rbx), %rsi
	jmp	LBB0_12
LBB0_2:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_13:
	testq	%r12, %r12
	je	LBB0_17
## %bb.14:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_PV_BEEN_EXECD
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_pmap_tlb_flushID
	jmp	LBB0_17
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_pmap_tlb_flushD
LBB0_17:
	movq	_PGA_WRITEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vm_page_aflag_clear
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rw_wunlock                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_VPO_UNMANAGED,4,2              ## @VPO_UNMANAGED
	.comm	_pvh_global_lock,4,2            ## @pvh_global_lock
	.comm	_PVF_WRITE,4,2                  ## @PVF_WRITE
	.comm	_curproc,8,3                    ## @curproc
	.comm	_kernel_pmap,8,3                ## @kernel_pmap
	.comm	_TRUE,8,3                       ## @TRUE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PVF_UNMAN,4,2                  ## @PVF_UNMAN
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"No l2 bucket"

	.comm	_PGA_WRITEABLE,4,2              ## @PGA_WRITEABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_remove_all                ; -- Begin function pmap_remove_all
	.p2align	2
_pmap_remove_all:                       ; @pmap_remove_all
	.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	x27, _FALSE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _FALSE@GOTPAGEOFF]
	mov	x20, x0
	ldr	w8, [x20], #8
	ldr	x26, [x27]
Lloh2:
	adrp	x9, _VPO_UNMANAGED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VPO_UNMANAGED@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	mov	x1, x19
	bl	_KASSERT
	mov	x0, x20
	bl	_TAILQ_EMPTY
	cbz	x0, LBB0_2
; %bb.1:
	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
LBB0_2:
Lloh5:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wlock
Lloh7:
	adrp	x8, _PVF_WRITE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PVF_WRITE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_pmap_clearbit
Lloh10:
	adrp	x8, _curproc@GOTPAGE
Lloh11:
	ldr	x8, [x8, _curproc@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_vmspace_pmap
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x20
	bl	_TAILQ_FIRST
	cbz	x0, LBB0_13
; %bb.3:
	mov	x23, x0
	mov	w22, #0
Lloh13:
	adrp	x28, _PVF_UNMAN@GOTPAGE
Lloh14:
	ldr	x28, [x28, _PVF_UNMAN@GOTPAGEOFF]
Lloh15:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x23, #8]
	ldr	w1, [x23, #16]
	bl	_pmap_get_l2_bucket
	mov	x25, x0
	cmp	x0, #0
	cset	w0, ne
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	ldr	x21, [x25]
	ldr	w0, [x23, #16]
	bl	_l2pte_index
	add	x1, x21, x0, lsl #3
	str	xzr, [x1]
	ldr	x0, [x23, #8]
	bl	_PTE_SYNC_CURRENT
	ldr	x0, [x23, #8]
	mov	x1, x25
	mov	w2, #1
	bl	_pmap_free_l2_bucket
	ldr	x1, [x23, #8]
	ldr	w8, [x1]
	sub	w8, w8, #1
	str	w8, [x1]
	ldr	w8, [x23]
	orr	w22, w8, w22
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	mov	x2, x23
	bl	_pmap_nuke_pv
	ldr	x0, [x23, #8]
	bl	_PMAP_UNLOCK
	mov	x0, x23
	bl	_pmap_free_pv_entry
	mov	x0, x20
	bl	_TAILQ_FIRST
	mov	x23, x0
	cbz	x0, LBB0_14
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	x0, [x23, #8]
	cmp	x26, x8
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh19:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh20:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cmp	x0, x8
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ccmp	x0, x8, #4, ne
Lloh22:
	adrp	x8, _TRUE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	csel	x26, x8, x26, eq
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	bl	_PMAP_LOCK
	ldr	x0, [x23, #8]
	bl	_pmap_is_current
	cbz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23, #16]
	ldr	w1, [x24]
	bl	_cpu_dcache_inv_range
	ldr	x0, [x23, #8]
	ldr	w1, [x23, #16]
	bl	_pmap_has_valid_mapping
	cbz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x23, #16]
	ldr	w1, [x24]
	bl	_cpu_l2cache_inv_range
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x23]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x23, #16]
	str	w8, [x19, #4]
	ldr	x1, [x23, #8]
	b	LBB0_5
LBB0_13:
	mov	w22, #0
LBB0_14:
	cbz	x26, LBB0_18
; %bb.15:
	mov	x0, x22
	bl	_PV_BEEN_EXECD
	cbz	x0, LBB0_17
; %bb.16:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_pmap_tlb_flushID
	b	LBB0_18
LBB0_17:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_pmap_tlb_flushD
LBB0_18:
Lloh25:
	adrp	x8, _PGA_WRITEABLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PGA_WRITEABLE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_vm_page_aflag_clear
Lloh28:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh29:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	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
	b	_rw_wunlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_VPO_UNMANAGED,4,2              ; @VPO_UNMANAGED
	.comm	_pvh_global_lock,4,2            ; @pvh_global_lock
	.comm	_PVF_WRITE,4,2                  ; @PVF_WRITE
	.comm	_curproc,8,3                    ; @curproc
	.comm	_kernel_pmap,8,3                ; @kernel_pmap
	.comm	_TRUE,8,3                       ; @TRUE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PVF_UNMAN,4,2                  ; @PVF_UNMAN
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"No l2 bucket"

	.comm	_PGA_WRITEABLE,4,2              ; @PGA_WRITEABLE
.subsections_via_symbols
