	.file	"246443.c"
	.intel_syntax noprefix
	.text
	.globl	replace_str
	.type	replace_str, @function
replace_str:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	QWORD PTR -40[rbp], 0
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -32[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L2
	mov	eax, 0
	jmp	.L3
.L2:
	cmp	QWORD PTR -64[rbp], 0
	je	.L4
	cmp	QWORD PTR -72[rbp], 0
	jne	.L5
.L4:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	strdup@PLT
	jmp	.L3
.L5:
	mov	edi, 1
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR -32[rbp]
	mov	rbx, rax
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	strlen@PLT
	add	rax, rbx
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncat@PLT
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	mov	rax, QWORD PTR -64[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -32[rbp], rax
.L6:
	mov	rdx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strstr@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L7
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L8
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	mov	rax, QWORD PTR -40[rbp]
	jmp	.L3
.L8:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	strdup@PLT
.L3:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	replace_str, .-replace_str
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"246443.c"
	.text
	.align	2
	.global	replace_str
	.syntax unified
	.arm
	.fpu softvfp
	.type	replace_str, %function
replace_str:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L2
	mov	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L5
.L4:
	ldr	r0, [fp, #-32]
	bl	strdup
	mov	r3, r0
	b	.L3
.L5:
	mov	r0, #1
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	mov	r2, #1
	mov	r1, #0
	ldr	r0, [fp, #-24]
	bl	memset
	b	.L6
.L7:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	mov	r4, r3
	ldr	r0, [fp, #-40]
	bl	strlen
	mov	r3, r0
	add	r3, r4, r3
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	realloc
	str	r0, [fp, #-24]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	strncat
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-24]
	bl	strcat
	ldr	r0, [fp, #-36]
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	str	r3, [fp, #-20]
.L6:
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-20]
	bl	strstr
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L7
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L8
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-24]
	bl	strcat
	ldr	r3, [fp, #-24]
	b	.L3
.L8:
	ldr	r0, [fp, #-32]
	bl	strdup
	mov	r3, r0
.L3:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
	.size	replace_str, .-replace_str
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
