	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vm_thread_swapout
_vm_thread_swapout:                     ## @vm_thread_swapout
	.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
	movq	%rdi, %rbx
	callq	_cpu_thread_swapout
	movl	(%rbx), %r14d
	movl	4(%rbx), %edi
	movl	8(%rbx), %r15d
	movl	%r14d, %esi
	callq	_pmap_qremove
	movl	%r15d, %edi
	callq	_VM_OBJECT_WLOCK
	testl	%r14d, %r14d
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	movq	_PQ_LAUNDRY@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	callq	_vm_page_dirty
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_vm_page_unwire
	incl	%ebx
	cmpl	%ebx, %r14d
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_vm_page_lookup
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	callq	_panic
	jmp	LBB0_4
LBB0_5:
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_VM_OBJECT_WUNLOCK              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vm_thread_swapout: kstack already missing?"

	.comm	_PQ_LAUNDRY,4,2                 ## @PQ_LAUNDRY
	.no_dead_strip	_vm_thread_swapout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vm_thread_swapout
_vm_thread_swapout:                     ; @vm_thread_swapout
	.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, x0
	bl	_cpu_thread_swapout
	ldp	w0, w19, [x21, #4]
	ldr	w20, [x21]
	mov	x1, x20
	bl	_pmap_qremove
	mov	x0, x19
	bl	_VM_OBJECT_WLOCK
	cmp	w20, #1
	b.lt	LBB0_5
; %bb.1:
	mov	w21, #0
Lloh0:
	adrp	x22, l_.str@PAGE
Lloh1:
	add	x22, x22, l_.str@PAGEOFF
Lloh2:
	adrp	x24, _PQ_LAUNDRY@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PQ_LAUNDRY@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x23
	bl	_vm_page_dirty
	ldr	w1, [x24]
	mov	x0, x23
	bl	_vm_page_unwire
	add	w21, w21, #1
	cmp	w20, w21
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	bl	_vm_page_lookup
	mov	x23, x0
	cbnz	x0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_panic
	b	LBB0_2
LBB0_5:
	mov	x0, x19
	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
	b	_VM_OBJECT_WUNLOCK
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vm_thread_swapout: kstack already missing?"

	.comm	_PQ_LAUNDRY,4,2                 ; @PQ_LAUNDRY
	.no_dead_strip	_vm_thread_swapout
.subsections_via_symbols
