	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmap_demote_pdpe
_pmap_demote_pdpe:                      ## @pmap_demote_pdpe
	.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	%edx, %r15d
	movq	%rsi, %r13
	movl	%edi, %ebx
	callq	_pmap_accessed_bit
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_pmap_modified_bit
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_pmap_valid_bit
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_pmap_rw_bit
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_PMAP_LOCK_ASSERT
	movl	(%r13), %r14d
	movq	_PG_PS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	orl	%r12d, %eax
	movl	%r14d, %ecx
	notl	%ecx
	xorl	%edi, %edi
	testl	%ecx, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	_PDPSHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r15d, %esi
	sarl	%cl, %esi
	movq	_VM_ALLOC_INTERRUPT@GOTPCREL(%rip), %rax
	movq	_VM_ALLOC_NOOBJ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_VM_ALLOC_WIRED@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	xorl	%edi, %edi
	callq	_vm_page_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	%rax, %rdi
	callq	_VM_PAGE_TO_PHYS
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_PHYS_TO_DMAP
	movq	%rax, %r13
	movq	_PG_U@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r14d, %eax
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	movl	%ebx, %r12d
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	orl	%ecx, %r12d
	orl	-56(%rbp), %r12d                ## 4-byte Folded Reload
	orl	%eax, %r12d
	orl	%r15d, %r12d
	xorl	%edi, %edi
	testl	%ecx, %r14d
	setne	%dil
	leaq	L_.str.2(%rip), %rsi
	callq	_KASSERT
	andl	%r14d, %ebx
	xorl	%edi, %edi
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	setne	%dil
	leaq	L_.str.3(%rip), %rsi
	callq	_KASSERT
	movq	_NPDEPG@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_5
## %bb.3:
	movq	_NBPDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r13, %rdx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, (%rdx)
	addl	%ecx, %r14d
	addq	$4, %rdx
	movslq	(%rax), %rsi
	leaq	(,%rsi,4), %rsi
	addq	%r13, %rsi
	cmpq	%rsi, %rdx
	jb	LBB0_4
LBB0_5:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%r12d, (%rax)
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	callq	_vtopde
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_pmap_invalidate_page
	movq	_pmap_pdpe_demotions@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_TRUE@GOTPCREL(%rip), %r14
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_6
LBB0_1:
	movq	_FALSE@GOTPCREL(%rip), %r14
	leaq	L_.str.1(%rip), %rsi
LBB0_6:
	movq	_KTR_PMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	_CTR2
	movl	(%r14), %eax
	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	_PG_PS,4,2                      ## @PG_PS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmap_demote_pdpe: oldpdpe is missing PG_PS and/or PG_V"

	.comm	_PDPSHIFT,4,2                   ## @PDPSHIFT
	.comm	_VM_ALLOC_INTERRUPT,4,2         ## @VM_ALLOC_INTERRUPT
	.comm	_VM_ALLOC_NOOBJ,4,2             ## @VM_ALLOC_NOOBJ
	.comm	_VM_ALLOC_WIRED,4,2             ## @VM_ALLOC_WIRED
	.comm	_KTR_PMAP,4,2                   ## @KTR_PMAP
L_.str.1:                               ## @.str.1
	.asciz	"pmap_demote_pdpe: failure for va %#lx in pmap %p"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_PG_U,4,2                       ## @PG_U
L_.str.2:                               ## @.str.2
	.asciz	"pmap_demote_pdpe: oldpdpe is missing PG_A"

L_.str.3:                               ## @.str.3
	.asciz	"pmap_demote_pdpe: oldpdpe is missing PG_M"

	.comm	_NPDEPG,4,2                     ## @NPDEPG
	.comm	_NBPDR,8,3                      ## @NBPDR
	.comm	_pmap_pdpe_demotions,4,2        ## @pmap_pdpe_demotions
L_.str.4:                               ## @.str.4
	.asciz	"pmap_demote_pdpe: success for va %#lx in pmap %p"

	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_pmap_demote_pdpe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmap_demote_pdpe
_pmap_demote_pdpe:                      ; @pmap_demote_pdpe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x21, x1
	mov	x20, x0
	bl	_pmap_accessed_bit
	mov	x22, x0
	mov	x0, x20
	bl	_pmap_modified_bit
	mov	x24, x0
	mov	x0, x20
	bl	_pmap_valid_bit
	mov	x25, x0
	mov	x0, x20
	bl	_pmap_rw_bit
	mov	x23, x0
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_PMAP_LOCK_ASSERT
	ldr	w28, [x21]
Lloh3:
	adrp	x8, _PG_PS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PG_PS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	orr	w8, w8, w25
	bics	wzr, w8, w28
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
Lloh8:
	adrp	x8, _PDPSHIFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PDPSHIFT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	asr	w1, w19, w8
Lloh11:
	adrp	x8, _VM_ALLOC_INTERRUPT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VM_ALLOC_INTERRUPT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _VM_ALLOC_NOOBJ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _VM_ALLOC_NOOBJ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh17:
	adrp	x9, _VM_ALLOC_WIRED@GOTPAGE
Lloh18:
	ldr	x9, [x9, _VM_ALLOC_WIRED@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, #0
	bl	_vm_page_alloc
	cbz	x0, LBB0_5
; %bb.1:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	bl	_VM_PAGE_TO_PHYS
	mov	x27, x0
	bl	_PHYS_TO_DMAP
	mov	x26, x0
Lloh20:
	adrp	x8, _PG_U@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PG_U@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w28
	orr	w21, w23, w24
	orr	w9, w21, w22
	orr	w9, w9, w25
	orr	w9, w9, w27
	orr	w24, w9, w8
	tst	w28, w22
	cset	w0, ne
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_KASSERT
	and	w8, w28, w21
	cmp	w8, w23
	cset	w0, ne
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_KASSERT
Lloh27:
	adrp	x8, _NPDEPG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _NPDEPG@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.2:
Lloh29:
	adrp	x9, _NBPDR@GOTPAGE
Lloh30:
	ldr	x9, [x9, _NBPDR@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	mov	x10, x26
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	w28, [x10], #4
	add	w28, w28, w9
	ldrsw	x11, [x8]
	add	x11, x26, x11, lsl #2
	cmp	x10, x11
	b.lo	LBB0_3
LBB0_4:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	w24, [x8]
	mov	x0, x19
	bl	_vtopde
	mov	x1, x0
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pmap_invalidate_page
Lloh32:
	adrp	x8, _pmap_pdpe_demotions@GOTPAGE
Lloh33:
	ldr	x8, [x8, _pmap_pdpe_demotions@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh34:
	adrp	x21, _TRUE@GOTPAGE
Lloh35:
	ldr	x21, [x21, _TRUE@GOTPAGEOFF]
Lloh36:
	adrp	x1, l_.str.4@PAGE
Lloh37:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh38:
	adrp	x21, _FALSE@GOTPAGE
Lloh39:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
Lloh40:
	adrp	x1, l_.str.1@PAGE
Lloh41:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
Lloh42:
	adrp	x8, _KTR_PMAP@GOTPAGE
Lloh43:
	ldr	x8, [x8, _KTR_PMAP@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
	mov	x2, x19
	mov	x3, x20
	bl	_CTR2
	ldr	w0, [x21]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.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	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_MA_OWNED,4,2                   ; @MA_OWNED
	.comm	_PG_PS,4,2                      ; @PG_PS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmap_demote_pdpe: oldpdpe is missing PG_PS and/or PG_V"

	.comm	_PDPSHIFT,4,2                   ; @PDPSHIFT
	.comm	_VM_ALLOC_INTERRUPT,4,2         ; @VM_ALLOC_INTERRUPT
	.comm	_VM_ALLOC_NOOBJ,4,2             ; @VM_ALLOC_NOOBJ
	.comm	_VM_ALLOC_WIRED,4,2             ; @VM_ALLOC_WIRED
	.comm	_KTR_PMAP,4,2                   ; @KTR_PMAP
l_.str.1:                               ; @.str.1
	.asciz	"pmap_demote_pdpe: failure for va %#lx in pmap %p"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_PG_U,4,2                       ; @PG_U
l_.str.2:                               ; @.str.2
	.asciz	"pmap_demote_pdpe: oldpdpe is missing PG_A"

l_.str.3:                               ; @.str.3
	.asciz	"pmap_demote_pdpe: oldpdpe is missing PG_M"

	.comm	_NPDEPG,4,2                     ; @NPDEPG
	.comm	_NBPDR,8,3                      ; @NBPDR
	.comm	_pmap_pdpe_demotions,4,2        ; @pmap_pdpe_demotions
l_.str.4:                               ; @.str.4
	.asciz	"pmap_demote_pdpe: success for va %#lx in pmap %p"

	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_pmap_demote_pdpe
.subsections_via_symbols
