	.file	"688300.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s <file> <prefix>\n"
.LC1:
	.string	"open input failed"
.LC2:
	.string	"fstat input failed"
.LC3:
	.string	"mmap failed"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 224
	mov	DWORD PTR -212[rbp], edi
	mov	QWORD PTR -224[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -212[rbp], 3
	je	.L2
	mov	rax, QWORD PTR -224[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	rax, QWORD PTR -224[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -176[rbp], rax
	mov	rax, QWORD PTR -224[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -168[rbp], rax
	mov	rax, QWORD PTR -168[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -204[rbp], eax
	mov	rax, QWORD PTR -176[rbp]
	mov	esi, 2
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -200[rbp], eax
	cmp	DWORD PTR -200[rbp], 0
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	lea	rdx, -160[rbp]
	mov	eax, DWORD PTR -200[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fstat@PLT
	mov	DWORD PTR -196[rbp], eax
	cmp	DWORD PTR -196[rbp], 0
	jns	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -112[rbp]
	mov	QWORD PTR -184[rbp], rax
	mov	rax, QWORD PTR -184[rbp]
	mov	edx, DWORD PTR -200[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -192[rbp], rax
	cmp	QWORD PTR -192[rbp], 0
	jne	.L6
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L13:
	mov	rax, QWORD PTR -192[rbp]
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR -168[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	dl, al
	jne	.L16
	mov	eax, DWORD PTR -204[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -168[rbp]
	mov	rax, QWORD PTR -192[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L17
	mov	eax, DWORD PTR -204[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -192[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L10
	mov	DWORD PTR -208[rbp], 0
	jmp	.L11
.L10:
	mov	eax, DWORD PTR -204[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -192[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 47
	jne	.L12
	mov	eax, DWORD PTR -204[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -192[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	strlen@PLT
	add	eax, 1
	mov	DWORD PTR -208[rbp], eax
	jmp	.L11
.L12:
	mov	eax, DWORD PTR -204[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -192[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	strlen@PLT
	add	eax, 1
	mov	DWORD PTR -208[rbp], eax
.L11:
	mov	eax, DWORD PTR -208[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -204[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	rax, QWORD PTR -192[rbp]
	add	rcx, rax
	mov	rax, QWORD PTR -192[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memmove@PLT
	mov	eax, DWORD PTR -204[rbp]
	cdqe
	mov	edx, DWORD PTR -208[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -192[rbp]
	add	rcx, rdx
	mov	rdx, rax
	mov	esi, 0
	mov	rdi, rcx
	call	memset@PLT
	jmp	.L8
.L16:
	nop
	jmp	.L8
.L17:
	nop
.L8:
	sub	QWORD PTR -184[rbp], 1
	add	QWORD PTR -192[rbp], 1
.L6:
	cmp	QWORD PTR -184[rbp], 0
	jg	.L13
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"688300.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s <file> <prefix>\012\000"
	.align	2
.LC1:
	.ascii	"open input failed\000"
	.align	2
.LC2:
	.ascii	"fstat input failed\000"
	.align	2
.LC3:
	.ascii	"mmap failed\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #144
	str	r0, [fp, #-136]
	str	r1, [fp, #-140]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-136]
	cmp	r3, #3
	beq	.L2
	ldr	r3, .L18+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-140]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L18+8
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	ldr	r3, [fp, #-140]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-120]
	ldr	r3, [fp, #-140]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-116]
	ldr	r0, [fp, #-116]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-112]
	mov	r1, #2
	ldr	r0, [fp, #-120]
	bl	open
	str	r0, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L18+12
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-108]
	bl	fstat
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L18+16
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	ldr	r3, [fp, #-56]
	str	r3, [fp, #-128]
	ldr	r1, [fp, #-128]
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-108]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-132]
	ldr	r3, [fp, #-132]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L18+20
	bl	perror
	mov	r0, #1
	bl	exit
.L13:
	ldr	r3, [fp, #-132]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-116]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r2, r3
	bne	.L16
	ldr	r3, [fp, #-112]
	mov	r2, r3
	ldr	r1, [fp, #-116]
	ldr	r0, [fp, #-132]
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L17
	ldr	r3, [fp, #-112]
	ldr	r2, [fp, #-132]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L10
	mov	r3, #0
	str	r3, [fp, #-124]
	b	.L11
.L10:
	ldr	r3, [fp, #-112]
	ldr	r2, [fp, #-132]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #47
	bne	.L12
	ldr	r3, [fp, #-112]
	add	r3, r3, #1
	ldr	r2, [fp, #-132]
	add	r3, r2, r3
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	str	r3, [fp, #-124]
	b	.L11
.L12:
	ldr	r3, [fp, #-112]
	ldr	r2, [fp, #-132]
	add	r3, r2, r3
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	str	r3, [fp, #-124]
.L11:
	ldr	r3, [fp, #-112]
	add	r3, r3, #1
	ldr	r2, [fp, #-132]
	add	r3, r2, r3
	ldr	r2, [fp, #-124]
	mov	r1, r3
	ldr	r0, [fp, #-132]
	bl	memmove
	ldr	r3, [fp, #-124]
	ldr	r2, [fp, #-132]
	add	r3, r2, r3
	ldr	r2, [fp, #-112]
	mov	r1, #0
	mov	r0, r3
	bl	memset
	b	.L8
.L16:
	nop
	b	.L8
.L17:
	nop
.L8:
	ldr	r3, [fp, #-128]
	sub	r3, r3, #1
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-132]
	add	r3, r3, #1
	str	r3, [fp, #-132]
.L6:
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	bgt	.L13
	mov	r3, #0
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC4
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
