	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_page_replace                ## -- Begin function vm_page_replace
	.p2align	4, 0x90
_vm_page_replace:                       ## @vm_page_replace
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_VM_OBJECT_ASSERT_WLOCKED
	xorl	%edi, %edi
	cmpq	$0, 16(%r15)
	jne	LBB0_2
## %bb.1:
	movq	_VPRC_OBJREF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	testl	%eax, (%r15)
	sete	%dil
LBB0_2:
	movq	%r15, %rsi
	callq	_KASSERT
	movq	%r14, 16(%r15)
	movl	%ebx, 24(%r15)
	movq	_VPRC_OBJREF@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_atomic_set_int
	leaq	4(%r14), %rdi
	movq	%r15, %rsi
	callq	_vm_radix_replace
	movq	%rax, %rbx
	movq	8(%rax), %rax
	movq	_PQ_NONE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	movq	%rbx, %rsi
	callq	_KASSERT
	movq	_listq@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_TAILQ_INSERT_AFTER
	movl	(%r13), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_TAILQ_REMOVE
	movq	$0, 16(%rbx)
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_atomic_clear_int
	movq	%rbx, %rdi
	callq	_vm_page_xunbusy
	movq	%r15, %rdi
	callq	_pmap_page_is_write_mapped
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_vm_object_set_writeable_dirty
LBB0_4:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VPRC_OBJREF,4,2                ## @VPRC_OBJREF
	.comm	_PQ_NONE,8,3                    ## @PQ_NONE
	.comm	_listq,4,2                      ## @listq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_page_replace                ; -- Begin function vm_page_replace
	.p2align	2
_vm_page_replace:                       ; @vm_page_replace
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_VM_OBJECT_ASSERT_WLOCKED
	ldr	x8, [x20, #16]
Lloh0:
	adrp	x22, _VPRC_OBJREF@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VPRC_OBJREF@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	ldr	w8, [x20]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w0, eq
LBB0_3:
	mov	x1, x20
	bl	_KASSERT
	str	x19, [x20, #16]
	str	w21, [x20, #24]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_atomic_set_int
	add	x0, x19, #4
	mov	x1, x20
	bl	_vm_radix_replace
	mov	x21, x0
	ldr	x8, [x0, #8]
Lloh2:
	adrp	x9, _PQ_NONE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PQ_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	mov	x1, x21
	bl	_KASSERT
Lloh5:
	adrp	x23, _listq@GOTPAGE
Lloh6:
	ldr	x23, [x23, _listq@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_TAILQ_INSERT_AFTER
	ldr	w2, [x23]
	mov	x0, x19
	mov	x1, x21
	bl	_TAILQ_REMOVE
	str	xzr, [x21, #16]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_atomic_clear_int
	mov	x0, x21
	bl	_vm_page_xunbusy
	mov	x0, x20
	bl	_pmap_page_is_write_mapped
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_vm_object_set_writeable_dirty
LBB0_5:
	mov	x0, x21
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_VPRC_OBJREF,4,2                ; @VPRC_OBJREF
	.comm	_PQ_NONE,8,3                    ; @PQ_NONE
	.comm	_listq,4,2                      ; @listq
.subsections_via_symbols
