	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_page_free_prep              ## -- Begin function vm_page_free_prep
	.p2align	4, 0x90
_vm_page_free_prep:                     ## @vm_page_free_prep
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_atomic_thread_fence_acq
	movq	_VPO_UNMANAGED@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_1
## %bb.2:
	movq	16(%rbx), %rax
	movq	_PQ_NONE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	jmp	LBB0_3
LBB0_1:
	movq	%rbx, %rdi
	callq	_pmap_page_is_mapped
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_PGA_EXECUTABLE@GOTPCREL(%rip), %rax
	movq	_PGA_WRITEABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	xorl	%edi, %edi
	andl	8(%rbx), %ecx
LBB0_3:
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_v_tfree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_VM_CNT_INC
	movq	%rbx, %rdi
	callq	_vm_page_sbusied
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rsi
	callq	_panic
LBB0_5:
	cmpq	$0, 40(%rbx)
	je	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_vm_page_object_remove
	movq	_PG_FICTITIOUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	setne	%al
	movq	24(%rbx), %rsi
	movq	_VPRC_OBJREF@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rsi
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_KASSERT
	movq	$0, 40(%rbx)
	movq	(%r15), %rax
	subq	%rax, 24(%rbx)
LBB0_7:
	movq	%rbx, %rdi
	callq	_vm_page_xbusied
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_vm_page_xunbusy
LBB0_9:
	movq	_PG_FICTITIOUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_11
## %bb.10:
	xorl	%edi, %edi
	cmpq	$1, 24(%rbx)
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	16(%rbx), %rax
	movq	_PQ_NONE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	xorl	%r14d, %r14d
	jmp	LBB0_17
LBB0_11:
	movl	(%r14), %eax
	testl	%eax, 4(%rbx)
	jne	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_vm_page_dequeue_deferred_free
LBB0_13:
	movq	$0, 32(%rbx)
	movq	%rbx, %rdi
	callq	_vm_page_undirty
	cmpq	$0, 24(%rbx)
	je	LBB0_15
## %bb.14:
	leaq	L_.str.7(%rip), %rdi
	movq	%rbx, %rsi
	callq	_panic
LBB0_15:
	movq	%rbx, %rdi
	callq	_pmap_page_get_memattr
	movq	_VM_MEMATTR_DEFAULT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movl	$1, %r14d
	cmpq	%rsi, %rax
	je	LBB0_17
## %bb.16:
	movq	%rbx, %rdi
	callq	_pmap_page_set_memattr
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPO_UNMANAGED,4,2              ## @VPO_UNMANAGED
	.comm	_PGA_EXECUTABLE,4,2             ## @PGA_EXECUTABLE
	.comm	_PGA_WRITEABLE,4,2              ## @PGA_WRITEABLE
	.comm	_PQ_NONE,8,3                    ## @PQ_NONE
	.comm	_v_tfree,4,2                    ## @v_tfree
	.section	__TEXT,__cstring,cstring_literals
L_.str.3:                               ## @.str.3
	.asciz	"vm_page_free_prep: freeing shared busy page %p"

	.comm	_PG_FICTITIOUS,4,2              ## @PG_FICTITIOUS
	.comm	_VPRC_OBJREF,8,3                ## @VPRC_OBJREF
L_.str.7:                               ## @.str.7
	.asciz	"vm_page_free_prep: page %p has references"

	.comm	_VM_MEMATTR_DEFAULT,8,3         ## @VM_MEMATTR_DEFAULT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_PG_PCPU_CACHE,4,2              ## @PG_PCPU_CACHE
	.comm	_PG_ZERO,4,2                    ## @PG_ZERO
	.comm	_PMAP_HAS_DMAP,8,3              ## @PMAP_HAS_DMAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_page_free_prep              ; -- Begin function vm_page_free_prep
	.p2align	2
_vm_page_free_prep:                     ; @vm_page_free_prep
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_atomic_thread_fence_acq
	ldr	w8, [x19, #4]
Lloh0:
	adrp	x21, _VPO_UNMANAGED@GOTPAGE
Lloh1:
	ldr	x21, [x21, _VPO_UNMANAGED@GOTPAGEOFF]
	ldr	w9, [x21]
Lloh2:
	adrp	x20, _PQ_NONE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _PQ_NONE@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	cmp	x8, x9
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_pmap_page_is_mapped
	cmp	w0, #0
	cset	w0, eq
	mov	x1, x19
	bl	_KASSERT
	ldr	w8, [x19, #8]
Lloh4:
	adrp	x9, _PGA_EXECUTABLE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PGA_EXECUTABLE@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
Lloh7:
	adrp	x10, _PGA_WRITEABLE@GOTPAGE
Lloh8:
	ldr	x10, [x10, _PGA_WRITEABLE@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
LBB0_3:
	cset	w0, eq
	mov	x1, x19
	bl	_KASSERT
Lloh10:
	adrp	x8, _v_tfree@GOTPAGE
Lloh11:
	ldr	x8, [x8, _v_tfree@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_VM_CNT_INC
	mov	x0, x19
	bl	_vm_page_sbusied
	cbz	x0, LBB0_5
; %bb.4:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x19
	bl	_panic
LBB0_5:
	ldr	x8, [x19, #40]
Lloh15:
	adrp	x22, _PG_FICTITIOUS@GOTPAGE
Lloh16:
	ldr	x22, [x22, _PG_FICTITIOUS@GOTPAGEOFF]
	cbz	x8, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_vm_page_object_remove
	ldr	w8, [x19]
	ldr	w9, [x22]
	tst	w9, w8
	ldr	x1, [x19, #24]
Lloh17:
	adrp	x23, _VPRC_OBJREF@GOTPAGE
Lloh18:
	ldr	x23, [x23, _VPRC_OBJREF@GOTPAGEOFF]
	ldr	x8, [x23]
	ccmp	x1, x8, #4, eq
	cset	w0, eq
	bl	_KASSERT
	str	xzr, [x19, #40]
	ldr	x8, [x23]
	ldr	x9, [x19, #24]
	sub	x8, x9, x8
	str	x8, [x19, #24]
LBB0_7:
	mov	x0, x19
	bl	_vm_page_xbusied
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_vm_page_xunbusy
LBB0_9:
	ldr	w8, [x19]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	ldr	x8, [x19, #24]
	cmp	x8, #1
	cset	w0, eq
	mov	x1, x19
	bl	_KASSERT
	ldr	x8, [x19, #16]
	ldr	x9, [x20]
	cmp	x8, x9
	cset	w0, eq
	mov	x1, x19
	bl	_KASSERT
	mov	w0, #0
	b	LBB0_18
LBB0_11:
	ldr	w8, [x19, #4]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_vm_page_dequeue_deferred_free
LBB0_13:
	str	xzr, [x19, #32]
	mov	x0, x19
	bl	_vm_page_undirty
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_15
; %bb.14:
Lloh19:
	adrp	x0, l_.str.7@PAGE
Lloh20:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x1, x19
	bl	_panic
LBB0_15:
	mov	x0, x19
	bl	_pmap_page_get_memattr
Lloh21:
	adrp	x8, _VM_MEMATTR_DEFAULT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VM_MEMATTR_DEFAULT@GOTPAGEOFF]
Lloh23:
	ldr	x1, [x8]
	cmp	x0, x1
	b.eq	LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_pmap_page_set_memattr
LBB0_17:
	mov	w0, #1
LBB0_18:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_VPO_UNMANAGED,4,2              ; @VPO_UNMANAGED
	.comm	_PGA_EXECUTABLE,4,2             ; @PGA_EXECUTABLE
	.comm	_PGA_WRITEABLE,4,2              ; @PGA_WRITEABLE
	.comm	_PQ_NONE,8,3                    ; @PQ_NONE
	.comm	_v_tfree,4,2                    ; @v_tfree
	.section	__TEXT,__cstring,cstring_literals
l_.str.3:                               ; @.str.3
	.asciz	"vm_page_free_prep: freeing shared busy page %p"

	.comm	_PG_FICTITIOUS,4,2              ; @PG_FICTITIOUS
	.comm	_VPRC_OBJREF,8,3                ; @VPRC_OBJREF
l_.str.7:                               ; @.str.7
	.asciz	"vm_page_free_prep: page %p has references"

	.comm	_VM_MEMATTR_DEFAULT,8,3         ; @VM_MEMATTR_DEFAULT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_PG_PCPU_CACHE,4,2              ; @PG_PCPU_CACHE
	.comm	_PG_ZERO,4,2                    ; @PG_ZERO
	.comm	_PMAP_HAS_DMAP,8,3              ; @PMAP_HAS_DMAP
.subsections_via_symbols
