	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mrb_env_unshare                ## -- Begin function mrb_env_unshare
	.p2align	4, 0x90
_mrb_env_unshare:                       ## @mrb_env_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_MRB_ENV_STACK_LEN
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_MRB_ENV_STACK_SHARED_P
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:
	movq	8(%rbx), %rax
	cmpq	(%r14), %rax
	je	LBB0_3
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	(%rax), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_7
## %bb.4:
	leal	(,%r15,4), %esi
	movq	%r14, %rdi
	callq	_mrb_malloc
	movq	%rax, %r12
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.5:
	movslq	%r15d, %rdx
	movq	(%rbx), %rsi
	movq	%r12, %rdi
	callq	_stack_copy
LBB0_6:
	movq	%r12, (%rbx)
	movq	%rbx, %rdi
	callq	_MRB_ENV_UNSHARE_STACK
	movq	%r14, %rdi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mrb_write_barrier              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mrb_env_unshare                ; -- Begin function mrb_env_unshare
	.p2align	2
_mrb_env_unshare:                       ; @mrb_env_unshare
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x1, LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_MRB_ENV_STACK_LEN
	mov	x21, x0
	mov	x0, x19
	bl	_MRB_ENV_STACK_SHARED_P
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_4
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cmp	x8, x19
	b.eq	LBB0_3
; %bb.5:
	sxtw	x21, w21
	lsl	w1, w21, #2
	mov	x0, x20
	bl	_mrb_malloc
	mov	x22, x0
	cbz	w21, LBB0_7
; %bb.6:
	ldr	x1, [x19]
	mov	x0, x22
	mov	x2, x21
	bl	_stack_copy
LBB0_7:
	str	x22, [x19]
	mov	x0, x19
	bl	_MRB_ENV_UNSHARE_STACK
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mrb_write_barrier
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
