	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmap_pv_demote_pde
_pmap_pv_demote_pde:                    ## @pmap_pv_demote_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_PMAP_LOCK_ASSERT
	movq	_PDRMASK@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	movl	(%rax), %eax
	andl	%r15d, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	callq	_KASSERT
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_CHANGE_PV_LIST_LOCK_TO_PHYS
	movl	%r15d, %edi
	callq	_pa_to_pvh
	movq	%rax, %r13
	movq	%r12, %rdi
	movq	%rbx, %r12
	callq	_trunc_2mpage
	movq	%rax, %r14
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_pmap_pvh_remove
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	leaq	L_.str.1(%rip), %rsi
	callq	_KASSERT
	movl	%r15d, %edi
	callq	_PHYS_TO_VM_PAGE
	movq	%rax, %rbx
	leaq	8(%rax), %rdi
	movq	_pv_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_TAILQ_INSERT_TAIL
	incl	4(%rbx)
	movq	_NPTEPG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	decq	%rsi
	movq	_pv_entry_allocs@GOTPCREL(%rip), %rdi
	callq	_atomic_add_long
	movl	%eax, %edi
	callq	_PV_STAT
	movq	_NBPDR@GOTPCREL(%rip), %rax
	movq	%r14, %rcx
	addq	(%rax), %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	subq	(%rax), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str.2(%rip), %r13
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##       Child Loop BB0_7 Depth 3
	movq	%r12, %rdi
	callq	_TAILQ_FIRST
	movq	%rax, %r15
	movq	(%rax), %rcx
	movb	$1, %al
	cmpl	$0, (%rcx)
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, 4(%rcx)
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, 8(%rcx)
	setne	%al
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movzbl	%al, %edi
	movq	%r13, %rsi
	callq	_KASSERT
	movq	__NPCM@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%r12d, %r12d
LBB0_6:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_7 Depth 3
	movl	%r12d, %eax
	shll	$6, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addq	$12, %rbx
	movq	%rbx, %r13
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_1 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	(%r15), %rax
	movl	(%rax,%r12,4), %edi
	testl	%edi, %edi
	je	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=3
	callq	_bsfq
	movl	$1, %edx
	movl	%eax, %ecx
	shlq	%cl, %rdx
	movq	(%r15), %rcx
	notl	%edx
	andl	%edx, (%rcx,%r12,4)
	movq	16(%r15), %rcx
	addl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	cltq
	leaq	(%rax,%rax,2), %rax
	leaq	(%rcx,%rax,8), %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	addq	(%rdx), %r14
	movq	%r14, 8(%rcx,%rax,8)
	movq	_VPO_UNMANAGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	(%r13), %eax
	sete	%dil
	movq	%r13, %rsi
	callq	_KASSERT
	leaq	8(%r13), %rdi
	movq	_pv_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_TAILQ_INSERT_TAIL
	incl	4(%r13)
	addq	$12, %r13
	cmpq	-64(%rbp), %r14                 ## 8-byte Folded Reload
	jne	LBB0_7
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=2
	incq	%r12
	movq	__NPCM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	-12(%r13), %rbx
	cmpq	%rax, %r12
	jl	LBB0_6
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	addq	$-12, %r13
	movq	%r13, %rbx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_pc_list@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_TAILQ_REMOVE
	movl	(%r13), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_TAILQ_INSERT_TAIL
	leaq	L_.str.2(%rip), %r13
	jmp	LBB0_1
LBB0_9:
	movq	(%r15), %rax
	cmpl	$0, (%rax)
	jne	LBB0_13
## %bb.10:
	cmpl	$0, 4(%rax)
	jne	LBB0_13
## %bb.11:
	cmpl	$0, 8(%rax)
	jne	LBB0_13
## %bb.12:
	movq	_pc_list@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_TAILQ_REMOVE
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_TAILQ_INSERT_TAIL
LBB0_13:
	movq	_NPTEPG@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	decq	%rsi
	movq	_pv_entry_count@GOTPCREL(%rip), %rdi
	callq	_atomic_add_long
	movl	%eax, %edi
	callq	_PV_STAT
	movq	(%rbx), %rsi
	decq	%rsi
	movq	_pv_entry_spare@GOTPCREL(%rip), %rdi
	callq	_atomic_subtract_int
	movl	%eax, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PV_STAT                        ## TAILCALL
	.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_pv_demote_pde: pa is not 2mpage aligned"

L_.str.1:                               ## @.str.1
	.asciz	"pmap_pv_demote_pde: pv not found"

	.comm	_pv_next,4,2                    ## @pv_next
	.comm	_pv_entry_allocs,4,2            ## @pv_entry_allocs
	.comm	_NPTEPG,8,3                     ## @NPTEPG
	.comm	_NBPDR,8,3                      ## @NBPDR
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"pmap_pv_demote_pde: missing spare"

	.comm	__NPCM,4,2                      ## @_NPCM
	.comm	_VPO_UNMANAGED,4,2              ## @VPO_UNMANAGED
	.comm	_pc_list,4,2                    ## @pc_list
	.comm	_pv_entry_count,4,2             ## @pv_entry_count
	.comm	_pv_entry_spare,4,2             ## @pv_entry_spare
	.no_dead_strip	_pmap_pv_demote_pde
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmap_pv_demote_pde
_pmap_pv_demote_pde:                    ; @pmap_pv_demote_pde
	.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	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x24, x0
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_PMAP_LOCK_ASSERT
Lloh3:
	adrp	x8, _PDRMASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PDRMASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w0, eq
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	mov	x0, x20
	mov	x1, x21
	bl	_CHANGE_PV_LIST_LOCK_TO_PHYS
	mov	x0, x21
	bl	_pa_to_pvh
	mov	x23, x0
	mov	x0, x22
	bl	_trunc_2mpage
	mov	x20, x0
	mov	x0, x23
	mov	x1, x24
	mov	x2, x20
	bl	_pmap_pvh_remove
	mov	x22, x0
	cmp	x0, #0
	cset	w0, ne
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_KASSERT
	mov	x0, x21
	bl	_PHYS_TO_VM_PAGE
	mov	x23, x0
	add	x0, x0, #8
Lloh10:
	adrp	x8, _pv_next@GOTPAGE
Lloh11:
	ldr	x8, [x8, _pv_next@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_TAILQ_INSERT_TAIL
	ldr	w8, [x23, #4]
	add	w8, w8, #1
	str	w8, [x23, #4]
Lloh13:
	adrp	x8, _NPTEPG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NPTEPG@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	sub	x1, x8, #1
Lloh16:
	adrp	x0, _pv_entry_allocs@GOTPAGE
Lloh17:
	ldr	x0, [x0, _pv_entry_allocs@GOTPAGEOFF]
	bl	_atomic_add_long
	bl	_PV_STAT
Lloh18:
	adrp	x8, _NBPDR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NBPDR@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
Lloh21:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh22:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x9, [x28]
	add	x8, x8, x20
	sub	x27, x8, x9
Lloh23:
	adrp	x26, l_.str.2@PAGE
Lloh24:
	add	x26, x26, l_.str.2@PAGEOFF
	mov	w22, #24
Lloh25:
	adrp	x19, _VPO_UNMANAGED@GOTPAGE
Lloh26:
	ldr	x19, [x19, _VPO_UNMANAGED@GOTPAGEOFF]
Lloh27:
	adrp	x25, _pc_list@GOTPAGE
Lloh28:
	ldr	x25, [x25, _pc_list@GOTPAGEOFF]
	str	x24, [sp, #8]                   ; 8-byte Folded Spill
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;       Child Loop BB0_7 Depth 3
	mov	x0, x24
	bl	_TAILQ_FIRST
	mov	x21, x0
	ldr	x8, [x0]
	ldr	w9, [x8]
	cbnz	w9, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x8, #4]
	cbz	w9, LBB0_12
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #1
LBB0_4:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x1, x26
	bl	_KASSERT
Lloh29:
	adrp	x8, __NPCM@GOTPAGE
Lloh30:
	ldr	x8, [x8, __NPCM@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x26, #0
LBB0_6:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_7 Depth 3
	lsl	w25, w26, #6
	add	x23, x23, #12
LBB0_7:                                 ;   Parent Loop BB0_1 Depth=1
                                        ;     Parent Loop BB0_6 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	x8, [x21]
	ldr	w0, [x8, x26, lsl #2]
	cbz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=3
	bl	_bsfq
                                        ; kill: def $w0 killed $w0 def $x0
	mov	w8, #1
	lsl	x8, x8, x0
	ldr	x9, [x21]
	lsl	x10, x26, #2
	ldr	w11, [x9, x10]
	bic	w8, w11, w8
	str	w8, [x9, x10]
	ldr	x8, [x21, #16]
	add	w9, w0, w25
	smaddl	x24, w9, w22, x8
	ldr	x8, [x28]
	add	x20, x8, x20
	str	x20, [x24, #8]
	ldr	w8, [x23]
	ldr	w9, [x19]
	tst	w9, w8
	cset	w0, eq
	mov	x1, x23
	bl	_KASSERT
	add	x0, x23, #8
Lloh32:
	adrp	x8, _pv_next@GOTPAGE
Lloh33:
	ldr	x8, [x8, _pv_next@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	x1, x24
	bl	_TAILQ_INSERT_TAIL
	ldr	w8, [x23, #4]
	add	w8, w8, #1
	str	w8, [x23, #4]
	add	x23, x23, #12
	cmp	x20, x27
	b.ne	LBB0_7
	b	LBB0_13
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x26, x26, #1
Lloh35:
	adrp	x8, __NPCM@GOTPAGE
Lloh36:
	ldr	x8, [x8, __NPCM@GOTPAGEOFF]
Lloh37:
	ldrsw	x8, [x8]
	sub	x23, x23, #12
	cmp	x26, x8
	b.lt	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x24, [sp, #8]                   ; 8-byte Folded Reload
Lloh38:
	adrp	x25, _pc_list@GOTPAGE
Lloh39:
	ldr	x25, [x25, _pc_list@GOTPAGEOFF]
Lloh40:
	adrp	x26, l_.str.2@PAGE
Lloh41:
	add	x26, x26, l_.str.2@PAGEOFF
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x25]
	mov	x0, x24
	mov	x1, x21
	bl	_TAILQ_REMOVE
	ldr	w2, [x25]
	mov	x0, x24
	mov	x1, x21
	bl	_TAILQ_INSERT_TAIL
	b	LBB0_1
LBB0_12:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x8, #8]
	cmp	w8, #0
	cset	w0, ne
	b	LBB0_4
LBB0_13:
	ldr	x8, [x21]
	ldr	w9, [x8]
	cbnz	w9, LBB0_17
; %bb.14:
	ldr	w9, [x8, #4]
	cbnz	w9, LBB0_17
; %bb.15:
	ldr	w8, [x8, #8]
	cbnz	w8, LBB0_17
; %bb.16:
Lloh42:
	adrp	x20, _pc_list@GOTPAGE
Lloh43:
	ldr	x20, [x20, _pc_list@GOTPAGEOFF]
	ldr	w2, [x20]
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x21
	bl	_TAILQ_REMOVE
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_TAILQ_INSERT_TAIL
LBB0_17:
Lloh44:
	adrp	x19, _NPTEPG@GOTPAGE
Lloh45:
	ldr	x19, [x19, _NPTEPG@GOTPAGEOFF]
	ldr	x8, [x19]
	sub	x1, x8, #1
Lloh46:
	adrp	x0, _pv_entry_count@GOTPAGE
Lloh47:
	ldr	x0, [x0, _pv_entry_count@GOTPAGEOFF]
	bl	_atomic_add_long
	bl	_PV_STAT
	ldr	x8, [x19]
	sub	x1, x8, #1
Lloh48:
	adrp	x0, _pv_entry_spare@GOTPAGE
Lloh49:
	ldr	x0, [x0, _pv_entry_spare@GOTPAGEOFF]
	bl	_atomic_subtract_int
	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
	b	_PV_STAT
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh44, Lloh45
	.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_pv_demote_pde: pa is not 2mpage aligned"

l_.str.1:                               ; @.str.1
	.asciz	"pmap_pv_demote_pde: pv not found"

	.comm	_pv_next,4,2                    ; @pv_next
	.comm	_pv_entry_allocs,4,2            ; @pv_entry_allocs
	.comm	_NPTEPG,8,3                     ; @NPTEPG
	.comm	_NBPDR,8,3                      ; @NBPDR
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"pmap_pv_demote_pde: missing spare"

	.comm	__NPCM,4,2                      ; @_NPCM
	.comm	_VPO_UNMANAGED,4,2              ; @VPO_UNMANAGED
	.comm	_pc_list,4,2                    ; @pc_list
	.comm	_pv_entry_count,4,2             ; @pv_entry_count
	.comm	_pv_entry_spare,4,2             ; @pv_entry_spare
	.no_dead_strip	_pmap_pv_demote_pde
.subsections_via_symbols
