	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmap_remove_pages              ## -- Begin function pmap_remove_pages
	.p2align	4, 0x90
_pmap_remove_pages:                     ## @pmap_remove_pages
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wlock
	movq	%rbx, %rdi
	callq	_PMAP_LOCK
	xorl	%eax, %eax
	callq	_cpu_idcache_wbinv_all
	xorl	%eax, %eax
	callq	_cpu_l2cache_wbinv_all
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	4(%rbx), %rdi
	callq	_TAILQ_FIRST
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %rbx
	movq	_PVF_WIRED@GOTPCREL(%rip), %r14
	movq	_PVF_UNMAN@GOTPCREL(%rip), %r12
	movq	_pv_plist@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_TAILQ_NEXT
	movq	%rax, %rbx
	testq	%rbx, %rbx
	je	LBB0_9
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	testl	%eax, (%r14)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, (%r12)
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	decl	(%rdi)
	movl	4(%rbx), %esi
	callq	_pmap_get_l2_bucket
	movq	%rax, %r14
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	(%r14), %r12
	movl	4(%rbx), %edi
	callq	_l2pte_index
	movq	%rax, %r14
	leaq	(%r12,%rax,4), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_L2_S_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	(%r12,%r14,4), %edi
	callq	_PHYS_TO_VM_PAGE
	movq	%rax, %r15
	xorl	%edi, %edi
	movq	_KERNBASE@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	setle	%dil
	movslq	(%r12,%r14,4), %rsi
	callq	_KASSERT
	movl	$0, (%r12,%r14,4)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_PTE_SYNC
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_TAILQ_NEXT
	movq	%rax, %r14
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_pmap_nuke_pv
	movq	%r15, %rdi
	callq	_TAILQ_EMPTY
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_PGA_WRITEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vm_page_aflag_clear
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_pmap_free_pv_entry
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$1, %edx
	callq	_pmap_free_l2_bucket
	movq	%r14, %rbx
	movq	_PVF_WIRED@GOTPCREL(%rip), %r14
	movq	_PVF_UNMAN@GOTPCREL(%rip), %r12
	movq	_pv_plist@GOTPCREL(%rip), %r13
	testq	%rbx, %rbx
	jne	LBB0_2
LBB0_9:
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wunlock
	xorl	%eax, %eax
	callq	_cpu_tlb_flushID
	xorl	%eax, %eax
	callq	_cpu_cpwait
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PMAP_UNLOCK                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_pvh_global_lock,4,2            ## @pvh_global_lock
	.comm	_PVF_WIRED,4,2                  ## @PVF_WIRED
	.comm	_PVF_UNMAN,4,2                  ## @PVF_UNMAN
	.comm	_pv_plist,4,2                   ## @pv_plist
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No L2 bucket in pmap_remove_pages"

	.comm	_L2_S_FRAME,4,2                 ## @L2_S_FRAME
	.comm	_KERNBASE,8,3                   ## @KERNBASE
	.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_pages              ; -- Begin function pmap_remove_pages
	.p2align	2
_pmap_remove_pages:                     ; @pmap_remove_pages
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x0, _pvh_global_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wlock
	mov	x0, x19
	bl	_PMAP_LOCK
	bl	_cpu_idcache_wbinv_all
	bl	_cpu_l2cache_wbinv_all
	add	x0, x19, #4
	bl	_TAILQ_FIRST
	cbz	x0, LBB0_8
; %bb.1:
	mov	x21, x0
Lloh2:
	adrp	x25, _PVF_WIRED@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PVF_WIRED@GOTPAGEOFF]
Lloh4:
	adrp	x26, _PVF_UNMAN@GOTPAGE
Lloh5:
	ldr	x26, [x26, _PVF_UNMAN@GOTPAGEOFF]
Lloh6:
	adrp	x20, l_.str@PAGE
Lloh7:
	add	x20, x20, l_.str@PAGEOFF
Lloh8:
	adrp	x28, _KERNBASE@GOTPAGE
Lloh9:
	ldr	x28, [x28, _KERNBASE@GOTPAGEOFF]
Lloh10:
	adrp	x27, _pv_plist@GOTPAGE
Lloh11:
	ldr	x27, [x27, _pv_plist@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x27]
	mov	x0, x21
	bl	_TAILQ_NEXT
	mov	x21, x0
	cbz	x21, LBB0_8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	ldr	w9, [x25]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x26]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
	ldr	w1, [x21, #4]
	mov	x0, x19
	bl	_pmap_get_l2_bucket
	mov	x22, x0
	cmp	x0, #0
	cset	w0, ne
	mov	x1, x20
	bl	_KASSERT
	ldr	x23, [x22]
	ldr	w0, [x21, #4]
	bl	_l2pte_index
	add	x24, x23, x0, lsl #2
	ldr	w8, [x24]
Lloh12:
	adrp	x9, _L2_S_FRAME@GOTPAGE
Lloh13:
	ldr	x9, [x9, _L2_S_FRAME@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_PHYS_TO_VM_PAGE
	mov	x23, x0
	ldr	x8, [x28]
	cmp	x8, x0
	cset	w0, le
	ldrsw	x1, [x24]
	bl	_KASSERT
	str	wzr, [x24]
	mov	x0, x24
	bl	_PTE_SYNC
	ldr	w1, [x27]
	mov	x0, x21
	bl	_TAILQ_NEXT
	mov	x24, x0
	mov	x0, x23
	mov	x1, x19
	mov	x2, x21
	bl	_pmap_nuke_pv
	mov	x0, x23
	bl	_TAILQ_EMPTY
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh15:
	adrp	x8, _PGA_WRITEABLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PGA_WRITEABLE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_vm_page_aflag_clear
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_pmap_free_pv_entry
	mov	x0, x19
	mov	x1, x22
	mov	w2, #1
	bl	_pmap_free_l2_bucket
	mov	x21, x24
	cbnz	x21, LBB0_3
LBB0_8:
Lloh18:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh19:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wunlock
	bl	_cpu_tlb_flushID
	bl	_cpu_cpwait
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_PMAP_UNLOCK
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_pvh_global_lock,4,2            ; @pvh_global_lock
	.comm	_PVF_WIRED,4,2                  ; @PVF_WIRED
	.comm	_PVF_UNMAN,4,2                  ; @PVF_UNMAN
	.comm	_pv_plist,4,2                   ; @pv_plist
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No L2 bucket in pmap_remove_pages"

	.comm	_L2_S_FRAME,4,2                 ; @L2_S_FRAME
	.comm	_KERNBASE,8,3                   ; @KERNBASE
	.comm	_PGA_WRITEABLE,4,2              ; @PGA_WRITEABLE
.subsections_via_symbols
