	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_string_replace_substring       ## -- Begin function string_replace_substring
	.p2align	4, 0x90
_string_replace_substring:              ## @string_replace_substring
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.1:
	movq	%rdx, %r14
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.2:
	movq	%rsi, %r15
	movq	%rsi, %rdi
	callq	_strlen
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_strlen
	movq	%rax, %rbx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_strstr
	testq	%rax, %rax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	addq	%r12, %rax
	incq	%rbx
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_strstr
	testq	%rax, %rax
	jne	LBB0_5
	jmp	LBB0_6
LBB0_14:
	movq	%r13, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_strdup                         ## TAILCALL
LBB0_3:
	xorl	%ebx, %ebx
LBB0_6:
	movq	%r13, %rdi
	callq	_strlen
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	subq	%r12, %rcx
	imulq	%rbx, %rcx
	leaq	(%rax,%rcx), %rdi
	incq	%rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %rbx
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %r14
	subq	%r13, %r14
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_memcpy
	addq	%r12, %r14
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_memcpy
	addq	%r15, %r14
	movq	%rbx, %r13
	addq	-80(%rbp), %r13                 ## 8-byte Folded Reload
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_strstr
	movq	%rax, %rbx
	movq	%r14, %r12
	testq	%rax, %rax
	jne	LBB0_11
	jmp	LBB0_12
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_9:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_12:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_strcpy
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	_string_replace_substring       ; -- Begin function string_replace_substring
	.p2align	2
_string_replace_substring:              ; @string_replace_substring
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x0
	cbz	x1, LBB0_8
; %bb.1:
	mov	x19, x2
	cbz	x2, LBB0_8
; %bb.2:
	mov	x20, x1
	mov	x0, x1
	bl	_strlen
	mov	x22, x0
	mov	x0, x19
	bl	_strlen
	mov	x23, x0
	mov	x0, x21
	mov	x1, x20
	bl	_strstr
	mov	x24, #0
	cbz	x0, LBB0_4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x0, x22
	add	x24, x24, #1
	mov	x1, x20
	bl	_strstr
	cbnz	x0, LBB0_3
LBB0_4:
	mov	x0, x21
	bl	_strlen
	sub	x8, x23, x22
	madd	x8, x8, x24, x0
	add	x0, x8, #1
	bl	_malloc
	mov	x24, x0
	cbz	x0, LBB0_11
; %bb.5:
	mov	x0, x21
	mov	x1, x20
	bl	_strstr
	cbz	x0, LBB0_9
; %bb.6:
	mov	x25, x0
	mov	x26, x24
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	x27, x25, x21
	mov	x0, x26
	mov	x1, x21
	mov	x2, x27
	bl	_memcpy
	add	x21, x26, x27
	mov	x0, x21
	mov	x1, x19
	mov	x2, x23
	bl	_memcpy
	add	x26, x21, x23
	add	x21, x25, x22
	mov	x0, x21
	mov	x1, x20
	bl	_strstr
	mov	x25, x0
	cbnz	x0, LBB0_7
	b	LBB0_10
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_strdup
LBB0_9:
	mov	x26, x24
LBB0_10:
	mov	x0, x26
	mov	x1, x21
	bl	_strcpy
LBB0_11:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
