	.file	"extr_cmdmisc.c_replace_ext.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	replace_ext
	.type	replace_ext, @function
replace_ext:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	test	rsi, rsi
	je	.L5
	mov	rbp, rsi
	mov	r13, rdi
	mov	esi, 46
	mov	r14, rdx
	mov	rdi, rbp
	call	strrchr@PLT
	mov	r12, rax
	test	rax, rax
	je	.L3
	mov	esi, 47
	mov	rdi, rax
	sub	r12, rbp
	call	strchr@PLT
	test	rax, rax
	je	.L4
.L3:
	mov	rdi, rbp
	call	strlen@PLT
	mov	r12, rax
.L4:
	mov	rdi, r14
	call	strlen@PLT
	mov	rdi, r13
	lea	rsi, 1[r12+rax]
	call	mrb_malloc@PLT
	mov	rdi, r14
	mov	r13, rax
	call	strlen@PLT
	mov	rdi, r13
	xor	esi, esi
	lea	rdx, 1[r12+rax]
	call	memset@PLT
	mov	rdx, r12
	mov	rsi, rbp
	mov	rdi, r13
	call	strncpy@PLT
	mov	rsi, r14
	mov	rdi, r13
	call	strcat@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r13
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 40
	xor	r13d, r13d
	pop	rbp
	.cfi_def_cfa_offset 32
	mov	rax, r13
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	replace_ext, .-replace_ext
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_cmdmisc.c_replace_ext.c"
	.text
	.align	2
	.global	replace_ext
	.syntax unified
	.arm
	.fpu softvfp
	.type	replace_ext, %function
replace_ext:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	subs	r6, r1, #0
	moveq	r5, r6
	beq	.L1
	mov	r5, r0
	mov	r1, #46
	mov	r0, r6
	mov	r7, r2
	bl	strrchr
	subs	r4, r0, #0
	beq	.L3
	mov	r1, #47
	bl	strchr
	cmp	r0, #0
	subeq	r4, r4, r6
	beq	.L4
.L3:
	mov	r0, r6
	bl	strlen
	mov	r4, r0
.L4:
	mov	r0, r7
	bl	strlen
	add	r1, r0, r4
	add	r1, r1, #1
	mov	r0, r5
	bl	mrb_malloc
	mov	r5, r0
	mov	r0, r7
	bl	strlen
	add	r2, r0, r4
	mov	r1, #0
	add	r2, r2, #1
	mov	r0, r5
	bl	memset
	mov	r1, r6
	mov	r2, r4
	mov	r0, r5
	bl	strncpy
	mov	r1, r7
	mov	r0, r5
	bl	strcat
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
	.size	replace_ext, .-replace_ext
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
