	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_moea_protect                   ## -- Begin function moea_protect
	.p2align	4, 0x90
_moea_protect:                          ## @moea_protect
	.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	%rsi, %r12
	movq	_curproc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rsi, (%rax)
	sete	%al
	movq	_kernel_pmap@GOTPCREL(%rip), %rsi
	cmpq	%r12, (%rsi)
	movl	%r8d, %ebx
	movq	%rcx, %r14
	movq	%rdx, %r13
	movl	%edi, %r15d
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_VM_PROT_READ@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_VM_PROT_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_1
## %bb.8:
	movl	%r15d, %edi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movq	%r14, %rcx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_moea_remove                    ## TAILCALL
LBB0_1:
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wlock
	movq	%r12, %rdi
	callq	_PMAP_LOCK
	movq	%r13, -56(%rbp)
	movq	_pvo_tree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-56(%rbp), %rdx
	movq	%r12, %rsi
	callq	_RB_NFIND
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, %rbx
	movq	_PTE_BR@GOTPCREL(%rip), %r15
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rbx
	testq	%r13, %r13
	je	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_PVO_VADDR
	cmpq	%r14, %rax
	jge	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_pvo_tree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_RB_NEXT
	movq	%rax, %r13
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_moea_pvo_to_pte
	movq	_PTE_PP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	8(%rbx), %ecx
	orl	(%r15), %ecx
	movl	%ecx, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rdx
	addq	$8, %rbx
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_moea_pte_change
	movq	_moea_table_mutex@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock
	jmp	LBB0_6
LBB0_7:
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wunlock
	movq	%r12, %rdi
	callq	_PMAP_UNLOCK
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_curproc,8,3                    ## @curproc
	.comm	_kernel_pmap,8,3                ## @kernel_pmap
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"moea_protect: non current pmap"

	.comm	_VM_PROT_READ,4,2               ## @VM_PROT_READ
	.comm	_VM_PROT_NONE,4,2               ## @VM_PROT_NONE
	.comm	_pvh_global_lock,4,2            ## @pvh_global_lock
	.comm	_pvo_tree,4,2                   ## @pvo_tree
	.comm	_PTE_PP,4,2                     ## @PTE_PP
	.comm	_PTE_BR,4,2                     ## @PTE_BR
	.comm	_moea_table_mutex,4,2           ## @moea_table_mutex
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_moea_protect                   ; -- Begin function moea_protect
	.p2align	2
_moea_protect:                          ; @moea_protect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _curproc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _curproc@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cmp	x8, x1
Lloh3:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh4:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ccmp	x8, x1, #4, ne
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh8:
	adrp	x8, _VM_PROT_READ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VM_PROT_READ@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	and	w8, w8, w23
Lloh11:
	adrp	x9, _VM_PROT_NONE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _VM_PROT_NONE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x21
	mov	x3, x20
	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
	add	sp, sp, #96
	b	_moea_remove
LBB0_2:
Lloh14:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh15:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wlock
	mov	x0, x19
	bl	_PMAP_LOCK
	str	x21, [sp]
Lloh16:
	adrp	x24, _pvo_tree@GOTPAGE
Lloh17:
	ldr	x24, [x24, _pvo_tree@GOTPAGEOFF]
	ldr	w0, [x24]
	mov	x2, sp
	mov	x1, x19
	bl	_RB_NFIND
	cbz	x0, LBB0_8
; %bb.3:
	mov	x22, x0
Lloh18:
	adrp	x25, _PTE_PP@GOTPAGE
Lloh19:
	ldr	x25, [x25, _PTE_PP@GOTPAGEOFF]
Lloh20:
	adrp	x26, _PTE_BR@GOTPAGE
Lloh21:
	ldr	x26, [x26, _PTE_BR@GOTPAGEOFF]
Lloh22:
	adrp	x21, _moea_table_mutex@GOTPAGE
Lloh23:
	ldr	x21, [x21, _moea_table_mutex@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x22, x23
	cbz	x23, LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_PVO_VADDR
	cmp	x0, x20
	b.ge	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x24]
	mov	x1, x19
	mov	x2, x22
	bl	_RB_NEXT
	mov	x23, x0
	mov	x0, x22
	mov	w1, #-1
	bl	_moea_pvo_to_pte
	ldr	w8, [x25]
	mov	x1, x22
	ldr	w9, [x1, #8]!
	bic	w8, w9, w8
	ldr	w9, [x26]
	orr	w8, w9, w8
	str	w8, [x1]
	cbz	x0, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [x22]
	bl	_moea_pte_change
	mov	x0, x21
	bl	_mtx_unlock
	b	LBB0_4
LBB0_8:
Lloh24:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh25:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_wunlock
	mov	x0, x19
	bl	_PMAP_UNLOCK
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_curproc,8,3                    ; @curproc
	.comm	_kernel_pmap,8,3                ; @kernel_pmap
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"moea_protect: non current pmap"

	.comm	_VM_PROT_READ,4,2               ; @VM_PROT_READ
	.comm	_VM_PROT_NONE,4,2               ; @VM_PROT_NONE
	.comm	_pvh_global_lock,4,2            ; @pvh_global_lock
	.comm	_pvo_tree,4,2                   ; @pvo_tree
	.comm	_PTE_PP,4,2                     ; @PTE_PP
	.comm	_PTE_BR,4,2                     ; @PTE_BR
	.comm	_moea_table_mutex,4,2           ; @moea_table_mutex
.subsections_via_symbols
