	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function moea_pvo_remove
_moea_pvo_remove:                       ## @moea_pvo_remove
	.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	%rdi, %rbx
	callq	_moea_pvo_to_pte
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	4(%rbx), %rsi
	movl	(%rbx), %edx
	movq	%rax, %rdi
	callq	_moea_pte_unset
	movq	_moea_table_mutex@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	movq	%rbx, %rdi
	callq	_PVO_PTEGIDX_CLR
	jmp	LBB0_3
LBB0_2:
	movq	_moea_pte_overflow@GOTPCREL(%rip), %rax
	decl	(%rax)
LBB0_3:
	movq	8(%rbx), %rax
	decl	8(%rax)
	movq	_PVO_WIRED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_5
## %bb.4:
	decl	4(%rax)
LBB0_5:
	movq	_pvo_vlink@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_LIST_REMOVE
	movq	_pvo_tree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%rbx), %rsi
	movq	%rbx, %rdx
	callq	_RB_REMOVE
	movl	(%rbx), %eax
	movq	_PVO_MANAGED@GOTPCREL(%rip), %r15
	notl	%eax
	testl	%eax, (%r15)
	jne	LBB0_9
## %bb.6:
	movq	_PTE_RPGN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	4(%rbx), %edi
	callq	_PHYS_TO_VM_PAGE
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rax, %r14
	movq	_PTE_REF@GOTPCREL(%rip), %rax
	movq	_PTE_CHG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	andl	4(%rbx), %esi
	movq	%r14, %rdi
	callq	_moea_attr_save
	movq	%r14, %rdi
	callq	_LIST_EMPTY
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_PGA_WRITEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_vm_page_aflag_clear
LBB0_9:
	movq	_pvo_olink@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_LIST_REMOVE
	movl	(%rbx), %eax
	movq	_PVO_BOOTSTRAP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_14
## %bb.10:
	andl	(%r15), %eax
	jne	LBB0_11
## %bb.12:
	movq	_moea_upvo_zone@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_moea_mpvo_zone@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_uma_zfree
LBB0_14:
	movq	_moea_pvo_entries@GOTPCREL(%rip), %rax
	decl	(%rax)
	movq	_moea_pvo_remove_calls@GOTPCREL(%rip), %rax
	incl	(%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_moea_table_mutex,4,2           ## @moea_table_mutex
	.comm	_moea_pte_overflow,4,2          ## @moea_pte_overflow
	.comm	_PVO_WIRED,4,2                  ## @PVO_WIRED
	.comm	_pvo_vlink,4,2                  ## @pvo_vlink
	.comm	_pvo_tree,4,2                   ## @pvo_tree
	.comm	_PVO_MANAGED,4,2                ## @PVO_MANAGED
	.comm	_PTE_RPGN,4,2                   ## @PTE_RPGN
	.comm	_PTE_REF,4,2                    ## @PTE_REF
	.comm	_PTE_CHG,4,2                    ## @PTE_CHG
	.comm	_PGA_WRITEABLE,4,2              ## @PGA_WRITEABLE
	.comm	_pvo_olink,4,2                  ## @pvo_olink
	.comm	_PVO_BOOTSTRAP,4,2              ## @PVO_BOOTSTRAP
	.comm	_moea_mpvo_zone,4,2             ## @moea_mpvo_zone
	.comm	_moea_upvo_zone,4,2             ## @moea_upvo_zone
	.comm	_moea_pvo_entries,4,2           ## @moea_pvo_entries
	.comm	_moea_pvo_remove_calls,4,2      ## @moea_pvo_remove_calls
	.no_dead_strip	_moea_pvo_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function moea_pvo_remove
_moea_pvo_remove:                       ; @moea_pvo_remove
	.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, x0
	bl	_moea_pvo_to_pte
	cbz	x0, LBB0_2
; %bb.1:
	mov	x1, x19
	ldr	w2, [x1], #4
	bl	_moea_pte_unset
Lloh0:
	adrp	x0, _moea_table_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _moea_table_mutex@GOTPAGEOFF]
	bl	_mtx_unlock
	mov	x0, x19
	bl	_PVO_PTEGIDX_CLR
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _moea_pte_overflow@GOTPAGE
Lloh3:
	ldr	x8, [x8, _moea_pte_overflow@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
LBB0_3:
	ldr	x8, [x19, #8]
	ldr	w9, [x8, #8]
	sub	w9, w9, #1
	str	w9, [x8, #8]
	ldr	w9, [x19]
Lloh4:
	adrp	x10, _PVO_WIRED@GOTPAGE
Lloh5:
	ldr	x10, [x10, _PVO_WIRED@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
; %bb.4:
	ldr	w9, [x8, #4]
	sub	w9, w9, #1
	str	w9, [x8, #4]
LBB0_5:
Lloh7:
	adrp	x8, _pvo_vlink@GOTPAGE
Lloh8:
	ldr	x8, [x8, _pvo_vlink@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_LIST_REMOVE
Lloh10:
	adrp	x8, _pvo_tree@GOTPAGE
Lloh11:
	ldr	x8, [x8, _pvo_tree@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	x1, [x19, #8]
	mov	x2, x19
	bl	_RB_REMOVE
	ldr	w8, [x19]
Lloh13:
	adrp	x21, _PVO_MANAGED@GOTPAGE
Lloh14:
	ldr	x21, [x21, _PVO_MANAGED@GOTPAGEOFF]
	ldr	w9, [x21]
	bics	wzr, w9, w8
	b.ne	LBB0_9
; %bb.6:
	ldr	w8, [x19, #4]
Lloh15:
	adrp	x9, _PTE_RPGN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PTE_RPGN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	and	w0, w9, w8
	bl	_PHYS_TO_VM_PAGE
	cbz	x0, LBB0_9
; %bb.7:
	mov	x20, x0
	ldr	w8, [x19, #4]
Lloh18:
	adrp	x9, _PTE_REF@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PTE_REF@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _PTE_CHG@GOTPAGE
Lloh22:
	ldr	x10, [x10, _PTE_CHG@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	orr	w9, w10, w9
	and	w1, w9, w8
	bl	_moea_attr_save
	mov	x0, x20
	bl	_LIST_EMPTY
	cbz	x0, LBB0_9
; %bb.8:
Lloh24:
	adrp	x8, _PGA_WRITEABLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PGA_WRITEABLE@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_vm_page_aflag_clear
LBB0_9:
Lloh27:
	adrp	x8, _pvo_olink@GOTPAGE
Lloh28:
	ldr	x8, [x8, _pvo_olink@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_LIST_REMOVE
	ldr	w8, [x19]
Lloh30:
	adrp	x9, _PVO_BOOTSTRAP@GOTPAGE
Lloh31:
	ldr	x9, [x9, _PVO_BOOTSTRAP@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_11
; %bb.10:
Lloh33:
	adrp	x9, _moea_mpvo_zone@GOTPAGE
Lloh34:
	ldr	x9, [x9, _moea_mpvo_zone@GOTPAGEOFF]
	ldr	w10, [x21]
Lloh35:
	adrp	x11, _moea_upvo_zone@GOTPAGE
Lloh36:
	ldr	x11, [x11, _moea_upvo_zone@GOTPAGEOFF]
	tst	w10, w8
	csel	x8, x11, x9, eq
	ldr	w0, [x8]
	mov	x1, x19
	bl	_uma_zfree
LBB0_11:
Lloh37:
	adrp	x8, _moea_pvo_entries@GOTPAGE
Lloh38:
	ldr	x8, [x8, _moea_pvo_entries@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
Lloh39:
	adrp	x8, _moea_pvo_remove_calls@GOTPAGE
Lloh40:
	ldr	x8, [x8, _moea_pvo_remove_calls@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_moea_table_mutex,4,2           ; @moea_table_mutex
	.comm	_moea_pte_overflow,4,2          ; @moea_pte_overflow
	.comm	_PVO_WIRED,4,2                  ; @PVO_WIRED
	.comm	_pvo_vlink,4,2                  ; @pvo_vlink
	.comm	_pvo_tree,4,2                   ; @pvo_tree
	.comm	_PVO_MANAGED,4,2                ; @PVO_MANAGED
	.comm	_PTE_RPGN,4,2                   ; @PTE_RPGN
	.comm	_PTE_REF,4,2                    ; @PTE_REF
	.comm	_PTE_CHG,4,2                    ; @PTE_CHG
	.comm	_PGA_WRITEABLE,4,2              ; @PGA_WRITEABLE
	.comm	_pvo_olink,4,2                  ; @pvo_olink
	.comm	_PVO_BOOTSTRAP,4,2              ; @PVO_BOOTSTRAP
	.comm	_moea_mpvo_zone,4,2             ; @moea_mpvo_zone
	.comm	_moea_upvo_zone,4,2             ; @moea_upvo_zone
	.comm	_moea_pvo_entries,4,2           ; @moea_pvo_entries
	.comm	_moea_pvo_remove_calls,4,2      ; @moea_pvo_remove_calls
	.no_dead_strip	_moea_pvo_remove
.subsections_via_symbols
