	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_copy_string                    ## -- Begin function copy_string
	.p2align	4, 0x90
_copy_string:                           ## @copy_string
	.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
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	testl	%r14d, %r14d
	jne	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_strlen
	movl	%eax, %r14d
LBB0_3:
	movl	(%rbx), %esi
	movl	4(%rbx), %eax
	movl	%eax, %ecx
	notl	%ecx
	addl	%esi, %ecx
	xorl	%r12d, %r12d
	cmpl	%ecx, %r14d
	jg	LBB0_16
## %bb.4:
	jge	LBB0_5
## %bb.6:
	leal	(%r14,%r14), %eax
	addl	%eax, %esi
	js	LBB0_7
## %bb.8:
	incl	%esi
	movl	%esi, (%rbx)
	movq	8(%rbx), %rdi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	%rax, %rdi
	movq	%rax, 8(%rbx)
	movl	4(%rbx), %eax
	testq	%rdi, %rdi
	jne	LBB0_11
	jmp	LBB0_16
LBB0_5:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
LBB0_11:
	cltq
	addq	%rax, %rdi
	testq	%r15, %r15
	je	LBB0_13
## %bb.12:
	leal	1(%r14), %edx
	movq	%r15, %rsi
	callq	_r_str_ncpy
	jmp	LBB0_14
LBB0_7:
	movq	8(%rbx), %rdi
	callq	_R_FREE
	movl	$1, %r12d
	jmp	LBB0_16
LBB0_13:
	xorl	%esi, %esi
	movl	%r14d, %edx
	callq	_memset
LBB0_14:
	movslq	4(%rbx), %rcx
	movslq	%r14d, %rax
	addq	%rcx, %rax
	movl	%eax, 4(%rbx)
	movq	8(%rbx), %rcx
	movl	$1, %r12d
	testq	%rcx, %rcx
	je	LBB0_16
## %bb.15:
	movb	$0, (%rcx,%rax)
LBB0_16:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_copy_string                    ; -- Begin function copy_string
	.p2align	2
_copy_string:                           ; @copy_string
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	cbz	x1, LBB0_3
; %bb.1:
	cbnz	w20, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_strlen
	mov	x20, x0
LBB0_3:
	ldp	w9, w8, [x19]
	mvn	w10, w8
	add	w10, w9, w10
	cmp	w20, w10
	b.le	LBB0_5
; %bb.4:
	mov	w0, #0
	b	LBB0_17
LBB0_5:
	cmp	w10, w20
	b.le	LBB0_9
; %bb.6:
	adds	w8, w9, w20, lsl #1
	b.mi	LBB0_12
; %bb.7:
	add	w1, w8, #1
	str	w1, [x19]
	ldr	x0, [x19, #8]
	bl	_realloc
	cbz	x0, LBB0_12
; %bb.8:
	str	x0, [x19, #8]
	ldr	w8, [x19, #4]
	cbnz	x0, LBB0_10
	b	LBB0_17
LBB0_9:
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_17
LBB0_10:
	add	x0, x0, w8, sxtw
	cbz	x21, LBB0_13
; %bb.11:
	add	w2, w20, #1
	mov	x1, x21
	bl	_r_str_ncpy
	b	LBB0_14
LBB0_12:
	ldr	x0, [x19, #8]
	bl	_R_FREE
	b	LBB0_16
LBB0_13:
	mov	w1, #0
	mov	x2, x20
	bl	_memset
LBB0_14:
	ldrsw	x8, [x19, #4]
	add	x8, x8, w20, sxtw
	str	w8, [x19, #4]
	ldr	x9, [x19, #8]
	cbz	x9, LBB0_16
; %bb.15:
	strb	wzr, [x9, x8]
LBB0_16:
	mov	w0, #1
LBB0_17:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
