	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jvp_string_copy_replace_bad
_jvp_string_copy_replace_bad:           ## @jvp_string_copy_replace_bad
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movslq	%edx, %rax
	leaq	(%rsi,%rax), %r12
	leal	(%rax,%rax,2), %r14d
	incl	%r14d
	movl	%r14d, %edi
	callq	_jvp_string_alloc
	movq	%rax, %r15
	movq	(%rax), %rbx
	movl	$0, -44(%rbp)
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_jvp_utf8_next
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r13
	movslq	%r14d, %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rsi
	callq	_jvp_utf8_encode
	cltq
	addq	%rax, %rbx
	movq	(%r15), %rax
	addq	%r14, %rax
	xorl	%edi, %edi
	cmpq	%rax, %rbx
	setb	%dil
	callq	_assert
	movq	%r13, %rdi
	movq	%r12, %rsi
	leaq	-44(%rbp), %rdx
	callq	_jvp_utf8_next
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	-44(%rbp), %edi
	cmpl	$-1, %edi
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$65533, -44(%rbp)               ## imm = 0xFFFD
	movl	$65533, %edi                    ## imm = 0xFFFD
	jmp	LBB0_4
LBB0_5:
	movq	(%r15), %rax
	subq	%rax, %rbx
	movslq	%ebx, %rcx
	movb	$0, (%rax,%rcx)
	addl	%ecx, %ecx
	movl	%ecx, 8(%r15)
	movq	_JVP_FLAGS_STRING@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movq	$0, 8(%rax)
	movl	$0, 16(%rax)
	leal	12(%r15), %ecx
	movl	%ecx, 20(%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_JVP_FLAGS_STRING,4,2           ## @JVP_FLAGS_STRING
	.no_dead_strip	_jvp_string_copy_replace_bad
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jvp_string_copy_replace_bad
_jvp_string_copy_replace_bad:           ; @jvp_string_copy_replace_bad
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x24, x0
	mov	x19, x8
	sxtw	x8, w1
	add	x21, x0, x8
	add	x8, x8, w1, sxtw #1
	add	x22, x8, #1
	mov	x0, x22
	bl	_jvp_string_alloc
	mov	x20, x0
	ldr	x23, [x0]
	str	wzr, [sp, #12]
	add	x2, sp, #12
	mov	x0, x24
	mov	x1, x21
	bl	_jvp_utf8_next
	cbz	x0, LBB0_5
; %bb.1:
	mov	x24, x0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x23
	bl	_jvp_utf8_encode
	add	x23, x23, w0, sxtw
	ldr	x8, [x20]
	add	x8, x8, x22
	cmp	x23, x8
	cset	w0, lo
	bl	_assert
	add	x2, sp, #12
	mov	x0, x24
	mov	x1, x21
	bl	_jvp_utf8_next
	mov	x24, x0
	cbz	x0, LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [sp, #12]
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #65533
	str	w0, [sp, #12]
	b	LBB0_2
LBB0_5:
	ldr	x8, [x20]
	sub	x9, x23, x8
	strb	wzr, [x8, w9, sxtw]
	lsl	w8, w9, #1
	str	w8, [x20, #8]
Lloh0:
	adrp	x8, _JVP_FLAGS_STRING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _JVP_FLAGS_STRING@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	stp	x8, xzr, [x19]
	add	w8, w20, #12
	stp	wzr, w8, [x19, #16]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_JVP_FLAGS_STRING,4,2           ; @JVP_FLAGS_STRING
	.no_dead_strip	_jvp_string_copy_replace_bad
.subsections_via_symbols
