	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmap_protect_pde
_pmap_protect_pde:                      ## @pmap_protect_pde
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movq	%rsi, %r12
	movl	%edi, %ebx
	callq	_pmap_global_bit
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_pmap_modified_bit
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_pmap_rw_bit
	movl	%eax, %r14d
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_PMAP_LOCK_ASSERT
	movq	_PDRMASK@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	andl	%r15d, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	orl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	notl	%r14d
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movl	(%r12), %r14d
	movl	%r14d, %eax
	testl	%r13d, (%rbx)
	jne	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %ebx
	movq	_PG_MANAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%r14d, %ecx
	notl	%ecx
	testl	%ecx, %eax
	jne	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_PG_PS_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	andl	%r14d, %edi
	callq	_PHYS_TO_VM_PAGE
	movq	%rax, %r13
	movq	_NBPDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_6
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r13, %r12
	testq	%rax, %rax
	jg	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, %eax
	andl	-60(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%ebx, %r13d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	_VM_PROT_WRITE@GOTPCREL(%rip), %rbx
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%edx, %edx
	movq	_VM_PROT_EXECUTE@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_pg_nx@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_14:                                ##   in Loop: Header=BB0_1 Depth=1
	orl	%eax, %edx
	cmpl	%r14d, %edx
	je	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_PG_PROMOTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %edx
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_atomic_cmpset_long
	testl	%eax, %eax
	je	LBB0_1
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=2
	xorl	%edx, %edx
	divq	%rcx
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=2
	leaq	(,%rax,4), %rax
	addq	%r13, %rax
	cmpq	%rax, %r12
	jae	LBB0_11
LBB0_7:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	callq	_vm_page_dirty
	addq	$4, %r12
	movq	_NBPDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_10
LBB0_15:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_20
LBB0_17:
	testl	%r14d, -56(%rbp)                ## 4-byte Folded Reload
	je	LBB0_19
## %bb.18:
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	callq	_pmap_invalidate_pde_page
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_20
LBB0_19:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_20:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MA_OWNED,4,2                   ## @MA_OWNED
	.comm	_PDRMASK,4,2                    ## @PDRMASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmap_protect_pde: sva is not 2mpage aligned"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_VM_PROT_WRITE,4,2              ## @VM_PROT_WRITE
	.comm	_PG_MANAGED,4,2                 ## @PG_MANAGED
	.comm	_PG_PS_FRAME,4,2                ## @PG_PS_FRAME
	.comm	_NBPDR,8,3                      ## @NBPDR
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_VM_PROT_EXECUTE,4,2            ## @VM_PROT_EXECUTE
	.comm	_pg_nx,4,2                      ## @pg_nx
	.comm	_PG_PROMOTED,4,2                ## @PG_PROMOTED
	.comm	_kernel_pmap,4,2                ## @kernel_pmap
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_pmap_protect_pde
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmap_protect_pde
_pmap_protect_pde:                      ; @pmap_protect_pde
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x3
	mov	x19, x2
	mov	x21, x1
	mov	x23, x0
	bl	_pmap_global_bit
	str	w0, [sp, #16]                   ; 4-byte Folded Spill
	mov	x0, x23
	bl	_pmap_modified_bit
	mov	x24, x0
	mov	x0, x23
	bl	_pmap_rw_bit
	mov	x25, x0
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_PMAP_LOCK_ASSERT
Lloh3:
	adrp	x8, _PDRMASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PDRMASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w19, [sp, #12]                  ; 4-byte Folded Spill
	tst	w8, w19
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh8:
	adrp	x8, _FALSE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x8]
	orr	w8, w25, w24
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	mvn	w8, w8
	stp	w9, w8, [sp, #20]               ; 8-byte Folded Spill
Lloh11:
	adrp	x22, _VM_PROT_WRITE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _VM_PROT_WRITE@GOTPAGEOFF]
Lloh13:
	adrp	x23, _NBPDR@GOTPAGE
Lloh14:
	ldr	x23, [x23, _NBPDR@GOTPAGEOFF]
Lloh15:
	adrp	x19, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x19, [x19, _PAGE_SIZE@GOTPAGEOFF]
Lloh17:
	adrp	x27, _VM_PROT_EXECUTE@GOTPAGE
Lloh18:
	ldr	x27, [x27, _VM_PROT_EXECUTE@GOTPAGEOFF]
Lloh19:
	adrp	x25, _pg_nx@GOTPAGE
Lloh20:
	ldr	x25, [x25, _pg_nx@GOTPAGEOFF]
Lloh21:
	adrp	x28, _PG_PROMOTED@GOTPAGE
Lloh22:
	ldr	x28, [x28, _PG_PROMOTED@GOTPAGEOFF]
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	w24, [x21]
	ldr	w9, [x22]
	mov	x8, x24
	tst	w9, w20
	b.ne	LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
Lloh23:
	adrp	x8, _PG_MANAGED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PG_MANAGED@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	ldr	w9, [sp, #28]                   ; 4-byte Folded Reload
	orr	w8, w9, w8
	bics	wzr, w8, w24
	b.ne	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
Lloh26:
	adrp	x8, _PG_PS_FRAME@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PG_PS_FRAME@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	and	w0, w8, w24
	bl	_PHYS_TO_VM_PAGE
	ldr	x8, [x23]
	ldr	x9, [x19]
	udiv	x8, x8, x9
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x25, x0
	mov	x26, x0
LBB0_5:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x26
	bl	_vm_page_dirty
	add	x26, x26, #4
	ldr	x8, [x23]
	ldr	x9, [x19]
	udiv	x8, x8, x9
	add	x8, x25, x8, lsl #2
	cmp	x26, x8
	b.lo	LBB0_5
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	and	w8, w24, w8
Lloh29:
	adrp	x25, _pg_nx@GOTPAGE
Lloh30:
	ldr	x25, [x25, _pg_nx@GOTPAGEOFF]
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x27]
	ldr	w10, [x25]
	tst	w9, w20
	csel	w9, w10, wzr, eq
	orr	w8, w9, w8
	cmp	w8, w24
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x28]
	bic	w2, w8, w9
	mov	x0, x21
	mov	x1, x24
	bl	_atomic_cmpset_long
	cbz	w0, LBB0_1
; %bb.9:
	ldr	w8, [sp, #16]                   ; 4-byte Folded Reload
	tst	w24, w8
	b.eq	LBB0_13
; %bb.10:
Lloh31:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh32:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	ldr	w1, [sp, #12]                   ; 4-byte Folded Reload
	mov	x2, x24
	bl	_pmap_invalidate_pde_page
LBB0_11:
	ldr	w0, [sp, #20]                   ; 4-byte Folded Reload
LBB0_12:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_13:
Lloh34:
	adrp	x8, _TRUE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	b	LBB0_12
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_MA_OWNED,4,2                   ; @MA_OWNED
	.comm	_PDRMASK,4,2                    ; @PDRMASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmap_protect_pde: sva is not 2mpage aligned"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_VM_PROT_WRITE,4,2              ; @VM_PROT_WRITE
	.comm	_PG_MANAGED,4,2                 ; @PG_MANAGED
	.comm	_PG_PS_FRAME,4,2                ; @PG_PS_FRAME
	.comm	_NBPDR,8,3                      ; @NBPDR
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_VM_PROT_EXECUTE,4,2            ; @VM_PROT_EXECUTE
	.comm	_pg_nx,4,2                      ; @pg_nx
	.comm	_PG_PROMOTED,4,2                ; @PG_PROMOTED
	.comm	_kernel_pmap,4,2                ; @kernel_pmap
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_pmap_protect_pde
.subsections_via_symbols
