	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pte_remove
_pte_remove:                            ## @pte_remove
	.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
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %r13
	movl	%edi, %r15d
	movl	%edx, %edi
	callq	_PDIR_IDX
	movl	%eax, %ebx
	movl	%r12d, %edi
	callq	_PTBL_IDX
	movl	%eax, %r14d
	movq	8(%r13), %rax
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %ecx
	movq	(%rax,%rcx,8), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_KASSERT
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.1:
	movl	%r14d, %eax
	leaq	(%rbx,%rax,8), %r14
	movq	%r14, %rdi
	callq	_PTE_ISVALID
	testl	%eax, %eax
	je	LBB0_16
## %bb.2:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r14, %rdi
	callq	_PTE_ISWIRED
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	decl	4(%r13)
LBB0_4:
	movq	%r14, %rdi
	callq	_PTE_PA
	movl	%eax, %edi
	callq	_PHYS_TO_VM_PAGE
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_PTE_ISMANAGED
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	%r14, %rdi
	callq	_PTE_ISMODIFIED
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_vm_page_dirty
LBB0_7:
	movq	%r14, %rdi
	callq	_PTE_ISREFERENCED
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_PGA_REFERENCED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_vm_page_aflag_set
LBB0_9:
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	%r15, %rdx
	callq	_pv_remove
LBB0_15:
	movq	_tlbivax_mutex@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mtx_lock_spin
	xorl	%eax, %eax
	callq	_tlb_miss_lock
	movl	%r12d, %edi
	callq	_tlb0_flush_entry
	movq	$0, (%r14)
	xorl	%eax, %eax
	callq	_tlb_miss_unlock
	movq	%rbx, %rdi
	callq	_mtx_unlock_spin
	decl	(%r13)
	movq	_PTBL_UNHOLD@GOTPCREL(%rip), %rax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, (%rax)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_16
## %bb.17:
	movq	%r13, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ptbl_unhold                    ## TAILCALL
LBB0_16:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_kernel_pmap@GOTPCREL(%rip), %rax
	cmpq	%r13, (%rax)
	jne	LBB0_15
## %bb.11:
	testq	%r15, %r15
	je	LBB0_15
## %bb.12:
	cmpl	$0, (%r15)
	je	LBB0_15
## %bb.13:
	movq	%r13, %rdi
	movl	%r12d, %esi
	movq	%r15, %rdx
	callq	_pv_remove
	movq	%r15, %rdi
	addq	$4, %rdi
	callq	_TAILQ_EMPTY
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	movl	$0, (%r15)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pte_remove: null ptbl"

	.comm	_PGA_REFERENCED,4,2             ## @PGA_REFERENCED
	.comm	_kernel_pmap,8,3                ## @kernel_pmap
	.comm	_tlbivax_mutex,4,2              ## @tlbivax_mutex
	.comm	_PTBL_UNHOLD,4,2                ## @PTBL_UNHOLD
	.no_dead_strip	_pte_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pte_remove
_pte_remove:                            ; @pte_remove
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x3
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_PDIR_IDX
	mov	x22, x0
	mov	x0, x23
	bl	_PTBL_IDX
	mov	x24, x0
	ldr	x8, [x19, #8]
	ldr	x25, [x8, w22, uxtw #3]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x25
	bl	_KASSERT
	cbz	x25, LBB0_16
; %bb.1:
	add	x24, x25, w24, uxtw #3
	mov	x0, x24
	bl	_PTE_ISVALID
	cbz	w0, LBB0_16
; %bb.2:
	mov	x0, x24
	bl	_PTE_ISWIRED
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x19, #4]
	sub	w8, w8, #1
	str	w8, [x19, #4]
LBB0_4:
	mov	x0, x24
	bl	_PTE_PA
	bl	_PHYS_TO_VM_PAGE
	mov	x25, x0
	mov	x0, x24
	bl	_PTE_ISMANAGED
	cbz	x0, LBB0_10
; %bb.5:
	mov	x0, x24
	bl	_PTE_ISMODIFIED
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x25
	bl	_vm_page_dirty
LBB0_7:
	mov	x0, x24
	bl	_PTE_ISREFERENCED
	cbz	x0, LBB0_9
; %bb.8:
Lloh2:
	adrp	x8, _PGA_REFERENCED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PGA_REFERENCED@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_vm_page_aflag_set
LBB0_9:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	bl	_pv_remove
	b	LBB0_14
LBB0_10:
Lloh5:
	adrp	x8, _kernel_pmap@GOTPAGE
Lloh6:
	ldr	x8, [x8, _kernel_pmap@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x19
	ccmp	x25, #0, #4, eq
	b.eq	LBB0_14
; %bb.11:
	ldr	w8, [x25]
	cbz	w8, LBB0_14
; %bb.12:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	bl	_pv_remove
	add	x0, x25, #4
	bl	_TAILQ_EMPTY
	cbz	x0, LBB0_14
; %bb.13:
	str	wzr, [x25]
LBB0_14:
Lloh8:
	adrp	x25, _tlbivax_mutex@GOTPAGE
Lloh9:
	ldr	x25, [x25, _tlbivax_mutex@GOTPAGEOFF]
	mov	x0, x25
	bl	_mtx_lock_spin
	bl	_tlb_miss_lock
	mov	x0, x23
	bl	_tlb0_flush_entry
	str	xzr, [x24]
	bl	_tlb_miss_unlock
	mov	x0, x25
	bl	_mtx_unlock_spin
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
Lloh10:
	adrp	x8, _PTBL_UNHOLD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PTBL_UNHOLD@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ptbl_unhold
LBB0_16:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pte_remove: null ptbl"

	.comm	_PGA_REFERENCED,4,2             ; @PGA_REFERENCED
	.comm	_kernel_pmap,8,3                ; @kernel_pmap
	.comm	_tlbivax_mutex,4,2              ; @tlbivax_mutex
	.comm	_PTBL_UNHOLD,4,2                ; @PTBL_UNHOLD
	.no_dead_strip	_pte_remove
.subsections_via_symbols
