	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ary_replace
_ary_replace:                           ## @ary_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
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rdx, %rdi
	callq	_ARY_LEN
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_ary_modify_check
	cmpq	%r12, %rbx
	je	LBB0_14
## %bb.1:
	movq	%rbx, %rdi
	callq	_ARY_SHARED_P
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_mrb_ary_decref
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	movq	$0, 24(%rbx)
	movq	%rbx, %rdi
	callq	_ARY_UNSET_SHARED_FLAG
LBB0_3:
	movq	%r12, %rdi
	callq	_ARY_SHARED_P
	testq	%rax, %rax
	jne	LBB0_4
## %bb.8:
	movq	%r12, %rdi
	callq	_MRB_FROZEN_P
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movq	_ARY_REPLACE_SHARED_MIN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jle	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_ary_make_shared
LBB0_4:
	movq	%rbx, %rdi
	callq	_ARY_EMBED_P
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_ARY_UNSET_EMBED_FLAG
	jmp	LBB0_7
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	24(%rbx), %rsi
	movq	%r14, %rdi
	callq	_mrb_free
LBB0_7:
	movq	24(%r12), %rax
	movq	%rax, 24(%rbx)
	movq	%r15, 16(%rbx)
	movq	(%r12), %rax
	movq	%rax, (%rbx)
	incl	(%rax)
	movq	%rbx, %rdi
	callq	_ARY_SET_SHARED_FLAG
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mrb_write_barrier              ## TAILCALL
LBB0_11:
	movq	%rbx, %rdi
	callq	_ARY_CAPA
	cmpq	%r15, %rax
	jge	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_ary_expand_capa
LBB0_13:
	movq	%rbx, %rdi
	callq	_ARY_PTR
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_ARY_PTR
	movl	%r13d, %edi
	movl	%eax, %esi
	movq	%r15, %rdx
	callq	_array_copy
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mrb_write_barrier
	movq	%rbx, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ARY_SET_LEN                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ARY_REPLACE_SHARED_MIN,8,3     ## @ARY_REPLACE_SHARED_MIN
	.no_dead_strip	_ary_replace
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ary_replace
_ary_replace:                           ; @ary_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	x22, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x2
	bl	_ARY_LEN
	mov	x21, x0
	mov	x0, x20
	mov	x1, x19
	bl	_ary_modify_check
	cmp	x19, x22
	b.eq	LBB0_9
; %bb.1:
	mov	x0, x19
	bl	_ARY_SHARED_P
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x1, [x19]
	mov	x0, x20
	bl	_mrb_ary_decref
	stp	xzr, xzr, [x19, #16]
	str	xzr, [x19, #8]
	mov	x0, x19
	bl	_ARY_UNSET_SHARED_FLAG
LBB0_3:
	mov	x0, x22
	bl	_ARY_SHARED_P
	cbnz	x0, LBB0_7
; %bb.4:
	mov	x0, x22
	bl	_MRB_FROZEN_P
	cbnz	w0, LBB0_12
; %bb.5:
Lloh0:
	adrp	x8, _ARY_REPLACE_SHARED_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ARY_REPLACE_SHARED_MIN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.le	LBB0_12
; %bb.6:
	mov	x0, x20
	mov	x1, x22
	bl	_ary_make_shared
LBB0_7:
	mov	x0, x19
	bl	_ARY_EMBED_P
	cbz	x0, LBB0_10
; %bb.8:
	mov	x0, x19
	bl	_ARY_UNSET_EMBED_FLAG
	b	LBB0_11
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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	x1, [x19, #24]
	mov	x0, x20
	bl	_mrb_free
LBB0_11:
	ldr	x8, [x22, #24]
	stp	x21, x8, [x19, #16]
	ldr	x8, [x22]
	str	x8, [x19]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	mov	x0, x19
	bl	_ARY_SET_SHARED_FLAG
	mov	x0, x20
	mov	x1, 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	_mrb_write_barrier
LBB0_12:
	mov	x0, x19
	bl	_ARY_CAPA
	cmp	x0, x21
	b.ge	LBB0_14
; %bb.13:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_ary_expand_capa
LBB0_14:
	mov	x0, x19
	bl	_ARY_PTR
	mov	x23, x0
	mov	x0, x22
	bl	_ARY_PTR
	mov	x1, x0
	mov	x0, x23
	mov	x2, x21
	bl	_array_copy
	mov	x0, x20
	mov	x1, x19
	bl	_mrb_write_barrier
	mov	x0, x19
	mov	x1, 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
	b	_ARY_SET_LEN
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ARY_REPLACE_SHARED_MIN,8,3     ; @ARY_REPLACE_SHARED_MIN
	.no_dead_strip	_ary_replace
.subsections_via_symbols
