	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmspace_unshare                ## -- Begin function vmspace_unshare
	.p2align	4, 0x90
_vmspace_unshare:                       ## @vmspace_unshare
	.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	(%rdi), %r15
	xorl	%r14d, %r14d
	cmpl	$1, (%r15)
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	movq	$0, -40(%rbp)
	leaq	-40(%rbp), %rsi
	movq	%r15, %rdi
	callq	_vmspace_fork
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r12
	movq	-40(%rbp), %rdi
	movl	8(%rbx), %esi
	callq	_swap_reserve_by_cred
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_PROC_VMSPACE_LOCK
	movq	%r12, (%rbx)
	movq	%rbx, %rdi
	callq	_PROC_VMSPACE_UNLOCK
	movq	_curthread@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	cmpq	%rbx, (%rdi)
	jne	LBB0_7
## %bb.6:
	callq	_pmap_activate
LBB0_7:
	movq	%r15, %rdi
	callq	_vmspace_free
	jmp	LBB0_8
LBB0_4:
	movq	%r12, %rdi
	callq	_vmspace_free
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_curthread,8,3                  ## @curthread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmspace_unshare                ; -- Begin function vmspace_unshare
	.p2align	2
_vmspace_unshare:                       ; @vmspace_unshare
	.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
	ldr	x19, [x0]
	ldr	w8, [x19]
	cmp	w8, #1
	b.eq	LBB0_6
; %bb.1:
	mov	x20, x0
	str	xzr, [sp, #8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_vmspace_fork
	cbz	x0, LBB0_8
; %bb.2:
	mov	x21, x0
	ldr	x0, [sp, #8]
	ldr	w1, [x20, #8]
	bl	_swap_reserve_by_cred
	cbz	w0, LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_PROC_VMSPACE_LOCK
	str	x21, [x20]
	mov	x0, x20
	bl	_PROC_VMSPACE_UNLOCK
Lloh0:
	adrp	x8, _curthread@GOTPAGE
Lloh1:
	ldr	x8, [x8, _curthread@GOTPAGEOFF]
Lloh2:
	ldr	x0, [x8]
	ldr	x8, [x0]
	cmp	x8, x20
	b.ne	LBB0_5
; %bb.4:
	bl	_pmap_activate
LBB0_5:
	mov	x0, x19
	bl	_vmspace_free
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
	mov	x0, x21
	bl	_vmspace_free
LBB0_8:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
LBB0_9:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_curthread,8,3                  ; @curthread
.subsections_via_symbols
