	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_thread_new                  ## -- Begin function vm_thread_new
	.p2align	4, 0x90
_vm_thread_new:                         ## @vm_thread_new
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_KSTACK_MAX_PAGES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%esi, %ebx
	cmovgel	%esi, %ebx
	movq	%rdi, %r14
	cmpl	$2, %esi
	movq	_kstack_pages@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmovll	%eax, %ebx
	movq	$0, -40(%rbp)
	cmpl	%eax, %ebx
	jne	LBB0_5
## %bb.1:
	movq	_kstack_cache@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.2:
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uma_zalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_pmap_kextract
	movl	%eax, %edi
	callq	_PHYS_TO_VM_PAGE
	movq	%rax, %r12
	jmp	LBB0_4
LBB0_5:
	movq	_domain@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movl	%eax, %edi
	callq	_DOMAINSET_PREF
	leaq	-40(%rbp), %r12
	movl	%eax, %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_vm_thread_stack_create
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	movq	(%r12), %rax
	movq	%rax, 16(%r14)
	movq	%r15, 8(%r14)
	movl	%ebx, (%r14)
	movl	$1, %eax
	jmp	LBB0_7
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kstack_pages,4,2               ## @kstack_pages
	.comm	_KSTACK_MAX_PAGES,4,2           ## @KSTACK_MAX_PAGES
	.comm	_kstack_cache,8,3               ## @kstack_cache
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_domain,4,2                     ## @domain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_thread_new                  ; -- Begin function vm_thread_new
	.p2align	2
_vm_thread_new:                         ; @vm_thread_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _kstack_pages@GOTPAGE
Lloh1:
	ldr	x8, [x8, _kstack_pages@GOTPAGEOFF]
Lloh2:
	adrp	x9, _KSTACK_MAX_PAGES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _KSTACK_MAX_PAGES@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, w1
	csel	w9, w9, w1, lt
	cmp	w1, #2
	csel	w20, w8, w9, lt
	str	xzr, [sp, #8]
Lloh6:
	adrp	x9, _kstack_cache@GOTPAGE
Lloh7:
	ldr	x9, [x9, _kstack_cache@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x9]
	cmp	w20, w8
	ccmp	x0, #0, #4, eq
	b.eq	LBB0_3
; %bb.1:
Lloh9:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_uma_zalloc
	cbz	x0, LBB0_3
; %bb.2:
	mov	x21, x0
	bl	_pmap_kextract
	bl	_PHYS_TO_VM_PAGE
	mov	x22, x0
	b	LBB0_5
LBB0_3:
Lloh12:
	adrp	x8, _domain@GOTPAGE
Lloh13:
	ldr	x8, [x8, _domain@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_PCPU_GET
	bl	_DOMAINSET_PREF
	add	x22, sp, #8
	add	x1, sp, #8
	mov	x2, x20
	bl	_vm_thread_stack_create
	cbz	x0, LBB0_6
; %bb.4:
	mov	x21, x0
LBB0_5:
	ldr	x8, [x22]
	stp	x21, x8, [x19, #8]
	str	w20, [x19]
	mov	w0, #1
LBB0_6:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_kstack_pages,4,2               ; @kstack_pages
	.comm	_KSTACK_MAX_PAGES,4,2           ; @KSTACK_MAX_PAGES
	.comm	_kstack_cache,8,3               ; @kstack_cache
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_domain,4,2                     ; @domain
.subsections_via_symbols
