	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmu_booke_protect
_mmu_booke_protect:                     ## @mmu_booke_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movl	%edi, %r12d
	movq	_VM_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r8d, %eax
	movq	_VM_PROT_NONE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_1
## %bb.13:
	movl	%r12d, %edi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mmu_booke_remove               ## TAILCALL
LBB0_1:
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rax
	testl	%r8d, (%rax)
	je	LBB0_2
## %bb.12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%r15d, %edi
	callq	_PMAP_LOCK
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_tlb0_flush_entry
	movq	_PTE_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PTE_UW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_PTE_MODIFIED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, (%r13)
	xorl	%eax, %eax
	callq	_tlb_miss_unlock
	movq	_tlbivax_mutex@GOTPCREL(%rip), %rdi
	callq	_mtx_unlock_spin
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r14, %rbx
	jge	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r12d, %edi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	callq	_pte_find
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_PTE_ISVALID
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_PTE_PA
	movl	%eax, %edi
	callq	_PHYS_TO_VM_PAGE
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_tlbivax_mutex@GOTPCREL(%rip), %rdi
	callq	_mtx_lock_spin
	xorl	%eax, %eax
	callq	_tlb_miss_lock
	movq	%r13, %rdi
	callq	_PTE_ISMODIFIED
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_PTE_ISMANAGED
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_vm_page_dirty
	jmp	LBB0_9
LBB0_11:
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PMAP_UNLOCK                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_PROT_READ,4,2               ## @VM_PROT_READ
	.comm	_VM_PROT_NONE,4,2               ## @VM_PROT_NONE
	.comm	_VM_PROT_WRITE,4,2              ## @VM_PROT_WRITE
	.comm	_tlbivax_mutex,4,2              ## @tlbivax_mutex
	.comm	_PTE_UW,4,2                     ## @PTE_UW
	.comm	_PTE_SW,4,2                     ## @PTE_SW
	.comm	_PTE_MODIFIED,4,2               ## @PTE_MODIFIED
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_mmu_booke_protect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmu_booke_protect
_mmu_booke_protect:                     ; @mmu_booke_protect
	.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, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _VM_PROT_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VM_PROT_READ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w4
Lloh3:
	adrp	x9, _VM_PROT_NONE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VM_PROT_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, 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	_mmu_booke_remove
LBB0_2:
Lloh6:
	adrp	x8, _VM_PROT_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VM_PROT_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w4
	b.eq	LBB0_4
; %bb.3:
	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
	ret
LBB0_4:
	mov	x0, x21
	bl	_PMAP_LOCK
	cmp	x20, x19
	b.ge	LBB0_13
; %bb.5:
Lloh9:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh10:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
Lloh11:
	adrp	x23, _tlbivax_mutex@GOTPAGE
Lloh12:
	ldr	x23, [x23, _tlbivax_mutex@GOTPAGEOFF]
Lloh13:
	adrp	x28, _PTE_SW@GOTPAGE
Lloh14:
	ldr	x28, [x28, _PTE_SW@GOTPAGEOFF]
Lloh15:
	adrp	x27, _PTE_MODIFIED@GOTPAGE
Lloh16:
	ldr	x27, [x27, _PTE_MODIFIED@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_tlb0_flush_entry
Lloh17:
	adrp	x8, _PTE_UW@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PTE_UW@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	w9, [x28]
	orr	w8, w9, w8
	ldr	w9, [x27]
	orr	w8, w8, w9
	ldr	w9, [x24]
	bic	w8, w9, w8
	str	w8, [x24]
	bl	_tlb_miss_unlock
	mov	x0, x23
	bl	_mtx_unlock_spin
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x26]
	add	x20, x8, x20
	cmp	x20, x19
	b.ge	LBB0_13
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_pte_find
	cbz	x0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x24, x0
	bl	_PTE_ISVALID
	cbz	x0, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
	bl	_PTE_PA
	bl	_PHYS_TO_VM_PAGE
	mov	x25, x0
	mov	x0, x23
	bl	_mtx_lock_spin
	bl	_tlb_miss_lock
	mov	x0, x24
	bl	_PTE_ISMODIFIED
	cbz	x0, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
	bl	_PTE_ISMANAGED
	cbz	x0, LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x25
	bl	_vm_page_dirty
	b	LBB0_6
LBB0_13:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_PROT_READ,4,2               ; @VM_PROT_READ
	.comm	_VM_PROT_NONE,4,2               ; @VM_PROT_NONE
	.comm	_VM_PROT_WRITE,4,2              ; @VM_PROT_WRITE
	.comm	_tlbivax_mutex,4,2              ; @tlbivax_mutex
	.comm	_PTE_UW,4,2                     ; @PTE_UW
	.comm	_PTE_SW,4,2                     ; @PTE_SW
	.comm	_PTE_MODIFIED,4,2               ; @PTE_MODIFIED
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_mmu_booke_protect
.subsections_via_symbols
