	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moea64_pvo_remove_from_pmap
_moea64_pvo_remove_from_pmap:           ## @moea64_pvo_remove_from_pmap
	.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
	movl	%edi, %r14d
	xorl	%edi, %edi
	cmpq	$0, 16(%rsi)
	setne	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	16(%rbx), %rdi
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_PMAP_LOCK_ASSERT
	movq	_PVO_DEAD@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	xorl	%edi, %edi
	andl	(%rbx), %eax
	sete	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_MOEA64_PTE_UNSET
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_3
## %bb.1:
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	andl	4(%rbx), %r14d
	je	LBB0_3
## %bb.2:
	movq	_LPTE_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_3:
	movq	16(%rbx), %rsi
	decl	8(%rsi)
	movq	_PVO_WIRED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.4:
	decl	4(%rsi)
LBB0_5:
	movq	_pvo_tree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rdx
	callq	_RB_REMOVE
	movl	(%rbx), %eax
	orl	(%r15), %eax
	movl	%eax, (%rbx)
	movq	_PVO_MANAGED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.6:
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_11
## %bb.7:
	movq	_LPTE_RPGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	8(%rbx), %edi
	callq	_PHYS_TO_VM_PAGE
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_atomic_readandclear_32
	movl	%eax, %ebx
	orl	%r14d, %ebx
	movq	_LPTE_CHG@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_vm_page_dirty
LBB0_10:
	movq	_LPTE_REF@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_11
## %bb.12:
	movq	_PGA_REFERENCED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vm_page_aflag_set              ## TAILCALL
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Trying to remove PVO with no pmap"

	.comm	_MA_OWNED,4,2                   ## @MA_OWNED
	.comm	_PVO_DEAD,4,2                   ## @PVO_DEAD
L_.str.1:                               ## @.str.1
	.asciz	"Trying to remove dead PVO"

	.comm	_VM_PROT_WRITE,4,2              ## @VM_PROT_WRITE
	.comm	_LPTE_CHG,4,2                   ## @LPTE_CHG
	.comm	_PVO_WIRED,4,2                  ## @PVO_WIRED
	.comm	_pvo_tree,4,2                   ## @pvo_tree
	.comm	_PVO_MANAGED,4,2                ## @PVO_MANAGED
	.comm	_LPTE_RPGN,4,2                  ## @LPTE_RPGN
	.comm	_LPTE_REF,4,2                   ## @LPTE_REF
	.comm	_PGA_REFERENCED,4,2             ## @PGA_REFERENCED
	.no_dead_strip	_moea64_pvo_remove_from_pmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moea64_pvo_remove_from_pmap
_moea64_pvo_remove_from_pmap:           ; @moea64_pvo_remove_from_pmap
	.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	x20, x0
	ldr	x8, [x1, #16]
	cmp	x8, #0
	cset	w0, ne
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	ldr	x0, [x19, #16]
Lloh2:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_PMAP_LOCK_ASSERT
	ldr	w8, [x19]
Lloh5:
	adrp	x21, _PVO_DEAD@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PVO_DEAD@GOTPAGEOFF]
	ldr	w9, [x21]
	tst	w9, w8
	cset	w0, eq
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	mov	x0, x20
	mov	x1, x19
	bl	_MOEA64_PTE_UNSET
	mov	x20, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
Lloh9:
	adrp	x9, _VM_PROT_WRITE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VM_PROT_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _LPTE_CHG@GOTPAGE
Lloh13:
	ldr	x10, [x10, _LPTE_CHG@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w20, wzr, w10, eq
LBB0_2:
	ldr	x1, [x19, #16]
	ldr	w8, [x1, #8]
	sub	w8, w8, #1
	str	w8, [x1, #8]
	ldr	w8, [x19]
Lloh15:
	adrp	x9, _PVO_WIRED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PVO_WIRED@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w8, [x1, #4]
	sub	w8, w8, #1
	str	w8, [x1, #4]
LBB0_4:
Lloh18:
	adrp	x8, _pvo_tree@GOTPAGE
Lloh19:
	ldr	x8, [x8, _pvo_tree@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	mov	x2, x19
	bl	_RB_REMOVE
	ldr	w8, [x21]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh21:
	adrp	x9, _PVO_MANAGED@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PVO_MANAGED@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.5:
	ldr	w8, [x19, #4]
Lloh24:
	adrp	x9, _VM_PROT_WRITE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _VM_PROT_WRITE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.6:
	ldr	w8, [x19, #8]
Lloh27:
	adrp	x9, _LPTE_RPGN@GOTPAGE
Lloh28:
	ldr	x9, [x9, _LPTE_RPGN@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_PHYS_TO_VM_PAGE
	cbz	x0, LBB0_11
; %bb.7:
	mov	x19, x0
	bl	_atomic_readandclear_32
	orr	w20, w0, w20
Lloh30:
	adrp	x8, _LPTE_CHG@GOTPAGE
Lloh31:
	ldr	x8, [x8, _LPTE_CHG@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	tst	w20, w8
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_vm_page_dirty
LBB0_9:
Lloh33:
	adrp	x8, _LPTE_REF@GOTPAGE
Lloh34:
	ldr	x8, [x8, _LPTE_REF@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_11
; %bb.10:
Lloh36:
	adrp	x8, _PGA_REFERENCED@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PGA_REFERENCED@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	mov	x0, x19
	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
	b	_vm_page_aflag_set
LBB0_11:
	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 AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Trying to remove PVO with no pmap"

	.comm	_MA_OWNED,4,2                   ; @MA_OWNED
	.comm	_PVO_DEAD,4,2                   ; @PVO_DEAD
l_.str.1:                               ; @.str.1
	.asciz	"Trying to remove dead PVO"

	.comm	_VM_PROT_WRITE,4,2              ; @VM_PROT_WRITE
	.comm	_LPTE_CHG,4,2                   ; @LPTE_CHG
	.comm	_PVO_WIRED,4,2                  ; @PVO_WIRED
	.comm	_pvo_tree,4,2                   ; @pvo_tree
	.comm	_PVO_MANAGED,4,2                ; @PVO_MANAGED
	.comm	_LPTE_RPGN,4,2                  ; @LPTE_RPGN
	.comm	_LPTE_REF,4,2                   ; @LPTE_REF
	.comm	_PGA_REFERENCED,4,2             ; @PGA_REFERENCED
	.no_dead_strip	_moea64_pvo_remove_from_pmap
.subsections_via_symbols
