	.file	"268947.c"
	.intel_syntax noprefix
	.text
	.local	srm
	.comm	srm,296960,32
	.local	files
	.comm	files,2565,32
	.data
	.align 32
	.type	mempack_init, @object
	.size	mempack_init, 272
mempack_init:
	.string	"\201\001\002\003\004\005\006\007\b\t\n\013\f\r\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\377\377\377\377\005\032_\023"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\377\377\377\377\377\377\377\377\377\377\001\377f%\231\315"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\377\377\377\377\005\032_\023"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\377\377\377\377\377\377\377\377\377\377\001\377f%\231\315\377\377\377\377\005\032_\023"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\377\377\377\377\377\377\377\377\377\377\001\377f%\231\315"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\377\377\377\377\005\032_\023"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"\377\377\377\377\377\377\377\377\377\377\001\377f%\231\315"
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	""
	.string	"q"
	.string	"\003"
	.string	"\003"
	.string	"\003"
	.string	"\003"
	.string	"\003"
	.string	"\003"
	.ascii	"\003"
	.text
	.type	die, @function
die:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	puts@PLT
	mov	edi, -1
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	die, .-die
	.section	.rodata
.LC0:
	.string	"Do you want to overwrite %s?"
.LC1:
	.string	"%s (y/n):"
	.text
	.type	overwrite_confirm, @function
overwrite_confirm:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 1056
	mov	QWORD PTR -1048[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -1048[rbp]
	lea	rax, -1040[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -1040[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdin[rip]
	mov	rdi, rax
	call	getc@PLT
	cmp	eax, 121
	sete	al
	movzx	eax, al
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	overwrite_confirm, .-overwrite_confirm
	.section	.rodata
.LC2:
	.string	"unsupported memory"
	.text
	.type	is_empty_mem, @function
is_empty_mem:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	lea	rax, srm[rip]
	cmp	QWORD PTR -24[rbp], rax
	je	.L6
	lea	rax, srm[rip+133120]
	cmp	QWORD PTR -24[rbp], rax
	jne	.L7
.L6:
	mov	rax, QWORD PTR -32[rbp]
	sub	eax, 1
	mov	DWORD PTR -4[rbp], eax
	jmp	.L8
.L11:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L9
	mov	eax, 0
	jmp	.L10
.L9:
	sub	DWORD PTR -4[rbp], 1
.L8:
	cmp	DWORD PTR -4[rbp], 0
	jns	.L11
	jmp	.L12
.L7:
	lea	rax, srm[rip+165888]
	cmp	QWORD PTR -24[rbp], rax
	jne	.L13
	mov	rax, QWORD PTR -32[rbp]
	sub	eax, 1
	mov	DWORD PTR -4[rbp], eax
	jmp	.L14
.L16:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	je	.L15
	mov	eax, 0
	jmp	.L10
.L15:
	sub	DWORD PTR -4[rbp], 1
.L14:
	cmp	DWORD PTR -4[rbp], 0
	jns	.L16
	jmp	.L12
.L13:
	lea	rax, srm[rip+2048]
	cmp	QWORD PTR -24[rbp], rax
	jne	.L17
	mov	DWORD PTR -4[rbp], 0
	jmp	.L18
.L20:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 15
	lea	rdx, 2048[rax]
	lea	rax, srm[rip]
	add	rdx, rax
	lea	rax, mempack_init[rip]
	mov	rsi, rdx
	mov	edx, 34
	mov	rdi, rax
	mov	rcx, rdx
	rep movsq
	lea	rax, mempack_init[rip]
	test	rax, rax
	je	.L19
	mov	eax, 0
	jmp	.L10
.L19:
	add	DWORD PTR -4[rbp], 1
.L18:
	cmp	DWORD PTR -4[rbp], 3
	jle	.L20
	jmp	.L12
.L17:
	lea	rdi, .LC2[rip]
	call	die
.L12:
	mov	eax, 1
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	is_empty_mem, .-is_empty_mem
	.section	.rodata
.LC3:
	.string	"rb"
	.text
	.type	read_mem, @function
read_mem:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L22
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L22:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rsi, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	je	.L23
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	read_mem, .-read_mem
	.section	.rodata
.LC4:
	.string	"wb"
	.text
	.type	write_mem, @function
write_mem:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L25
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L25:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rsi, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	ferror@PLT
	test	eax, eax
	je	.L26
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	write_mem, .-write_mem
	.type	format_srm, @function
format_srm:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	edx, 32768
	mov	esi, 0
	lea	rdi, srm[rip+133120]
	call	memset@PLT
	mov	edx, 2048
	mov	esi, 0
	lea	rdi, srm[rip]
	call	memset@PLT
	mov	edx, 131072
	mov	esi, 255
	lea	rdi, srm[rip+165888]
	call	memset@PLT
	mov	DWORD PTR -8[rbp], 0
	jmp	.L28
.L31:
	mov	DWORD PTR -4[rbp], 0
	jmp	.L29
.L30:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 15
	add	rdx, rax
	lea	rax, srm[rip+2048]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -4[rbp]
	add	eax, 1
	movsx	rdx, eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 15
	add	rdx, rax
	lea	rax, srm[rip+2048]
	add	rax, rdx
	mov	BYTE PTR [rax], 3
	add	DWORD PTR -4[rbp], 2
.L29:
	cmp	DWORD PTR -4[rbp], 32767
	jle	.L30
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 15
	lea	rdx, 2048[rax]
	lea	rax, srm[rip]
	add	rax, rdx
	mov	rdx, rax
	lea	rax, mempack_init[rip]
	mov	ecx, 272
	mov	rsi, QWORD PTR [rax]
	mov	QWORD PTR [rdx], rsi
	mov	esi, ecx
	add	rsi, rdx
	lea	rdi, 8[rsi]
	mov	esi, ecx
	add	rsi, rax
	add	rsi, 8
	mov	rsi, QWORD PTR -16[rsi]
	mov	QWORD PTR -16[rdi], rsi
	lea	rdi, 8[rdx]
	and	rdi, -8
	sub	rdx, rdi
	sub	rax, rdx
	add	ecx, edx
	and	ecx, -8
	shr	ecx, 3
	mov	edx, ecx
	mov	edx, edx
	mov	rsi, rax
	mov	rcx, rdx
	rep movsq
	add	DWORD PTR -8[rbp], 1
.L28:
	cmp	DWORD PTR -8[rbp], 3
	jle	.L31
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	format_srm, .-format_srm
	.type	ext_matches, @function
ext_matches:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L33
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcasecmp@PLT
	test	eax, eax
	jne	.L33
	mov	eax, 1
	jmp	.L35
.L33:
	mov	eax, 0
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	ext_matches, .-ext_matches
	.type	change_extension, @function
change_extension:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR -32[rbp]
	mov	esi, 46
	mov	rdi, rax
	call	strrchr@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L37
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	jmp	.L38
.L37:
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
.L38:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	change_extension, .-change_extension
	.section	.rodata
.LC5:
	.string	"Usage:"
	.align 8
.LC6:
	.string	"  To create a srm file: %s [file.eep] [file.mpk] [file.sra] [file.fla]\n"
	.align 8
.LC7:
	.string	"  To extract a srm file: %s <file.srm>\n\n"
	.align 8
.LC8:
	.string	"Output files will be placed in the same directory of the input files."
.LC9:
	.string	"-h"
.LC10:
	.string	"--help"
.LC11:
	.string	"/?"
.LC12:
	.string	"srm"
.LC13:
	.string	"eep"
.LC14:
	.string	"mpk"
.LC15:
	.string	"sra"
.LC16:
	.string	"fla"
	.align 8
.LC17:
	.string	"Running in srm extraction mode"
.LC18:
	.string	".eep"
.LC19:
	.string	".mpk"
.LC20:
	.string	".sra"
.LC21:
	.string	".fla"
	.align 8
.LC22:
	.string	"existing saves in the source directory"
.LC23:
	.string	"existing saves unmodified."
	.align 8
.LC24:
	.string	"srm file unspecified, running in srm creation mode"
.LC25:
	.string	".srm"
.LC26:
	.string	"path too long"
.LC27:
	.string	"%s unmodified.\n"
.LC28:
	.string	"Writting srm data to %s...\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	call	format_srm
	mov	edx, 2565
	mov	esi, 0
	lea	rdi, files[rip]
	call	memset@PLT
	cmp	DWORD PTR -36[rbp], 1
	jg	.L40
	nop
	jmp	.L41
.L79:
	nop
.L41:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L40:
	mov	DWORD PTR -20[rbp], 1
	jmp	.L42
.L50:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L79
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L79
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L79
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC12[rip]
	call	ext_matches
	test	eax, eax
	je	.L45
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 512
	mov	rsi, rax
	lea	rdi, files[rip]
	call	strncpy@PLT
.L45:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC13[rip]
	call	ext_matches
	test	eax, eax
	je	.L46
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 512
	mov	rsi, rax
	lea	rdi, files[rip+513]
	call	strncpy@PLT
.L46:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	call	ext_matches
	test	eax, eax
	je	.L47
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 512
	mov	rsi, rax
	lea	rdi, files[rip+1026]
	call	strncpy@PLT
.L47:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC15[rip]
	call	ext_matches
	test	eax, eax
	je	.L48
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 512
	mov	rsi, rax
	lea	rdi, files[rip+1539]
	call	strncpy@PLT
.L48:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	call	ext_matches
	test	eax, eax
	je	.L49
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	edx, 512
	mov	rsi, rax
	lea	rdi, files[rip+2052]
	call	strncpy@PLT
.L49:
	add	DWORD PTR -20[rbp], 1
.L42:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -36[rbp]
	jl	.L50
	movzx	eax, BYTE PTR files[rip]
	test	al, al
	je	.L51
	lea	rdi, .LC17[rip]
	call	puts@PLT
	mov	edx, 296960
	lea	rsi, srm[rip]
	lea	rdi, files[rip]
	call	read_mem
	mov	esi, 2048
	lea	rdi, srm[rip]
	call	is_empty_mem
	test	eax, eax
	jne	.L52
	lea	rdx, .LC18[rip]
	lea	rsi, files[rip]
	lea	rdi, files[rip+513]
	call	change_extension
.L52:
	mov	esi, 131072
	lea	rdi, srm[rip+2048]
	call	is_empty_mem
	test	eax, eax
	jne	.L53
	lea	rdx, .LC19[rip]
	lea	rsi, files[rip]
	lea	rdi, files[rip+1026]
	call	change_extension
.L53:
	mov	esi, 32768
	lea	rdi, srm[rip+133120]
	call	is_empty_mem
	test	eax, eax
	jne	.L54
	lea	rdx, .LC20[rip]
	lea	rsi, files[rip]
	lea	rdi, files[rip+1539]
	call	change_extension
.L54:
	mov	esi, 131072
	lea	rdi, srm[rip+165888]
	call	is_empty_mem
	test	eax, eax
	jne	.L55
	lea	rdx, .LC21[rip]
	lea	rsi, files[rip]
	lea	rdi, files[rip+2052]
	call	change_extension
.L55:
	movzx	eax, BYTE PTR files[rip+513]
	test	al, al
	je	.L56
	mov	esi, 0
	lea	rdi, files[rip+513]
	call	access@PLT
	cmp	eax, -1
	jne	.L57
.L56:
	movzx	eax, BYTE PTR files[rip+1026]
	test	al, al
	je	.L58
	mov	esi, 0
	lea	rdi, files[rip+1026]
	call	access@PLT
	cmp	eax, -1
	jne	.L57
.L58:
	movzx	eax, BYTE PTR files[rip+1539]
	test	al, al
	je	.L59
	mov	esi, 0
	lea	rdi, files[rip+1539]
	call	access@PLT
	cmp	eax, -1
	jne	.L57
.L59:
	movzx	eax, BYTE PTR files[rip+2052]
	test	al, al
	je	.L60
	mov	esi, 0
	lea	rdi, files[rip+2052]
	call	access@PLT
	cmp	eax, -1
	je	.L60
.L57:
	mov	eax, 1
	jmp	.L61
.L60:
	mov	eax, 0
.L61:
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L62
	lea	rdi, .LC22[rip]
	call	overwrite_confirm
	test	eax, eax
	jne	.L62
	lea	rdi, .LC23[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L62:
	movzx	eax, BYTE PTR files[rip+513]
	test	al, al
	je	.L63
	mov	edx, 2048
	lea	rsi, srm[rip]
	lea	rdi, files[rip+513]
	call	write_mem
.L63:
	movzx	eax, BYTE PTR files[rip+1026]
	test	al, al
	je	.L64
	mov	edx, 131072
	lea	rsi, srm[rip+2048]
	lea	rdi, files[rip+1026]
	call	write_mem
.L64:
	movzx	eax, BYTE PTR files[rip+1539]
	test	al, al
	je	.L65
	mov	edx, 32768
	lea	rsi, srm[rip+133120]
	lea	rdi, files[rip+1539]
	call	write_mem
.L65:
	movzx	eax, BYTE PTR files[rip+2052]
	test	al, al
	je	.L66
	mov	edx, 131072
	lea	rsi, srm[rip+165888]
	lea	rdi, files[rip+2052]
	call	write_mem
	jmp	.L66
.L51:
	lea	rdi, .LC24[rip]
	call	puts@PLT
	movzx	eax, BYTE PTR files[rip]
	test	al, al
	jne	.L67
	movzx	eax, BYTE PTR files[rip+513]
	test	al, al
	je	.L68
	lea	rdx, .LC25[rip]
	lea	rsi, files[rip+513]
	lea	rdi, files[rip]
	call	change_extension
	jmp	.L69
.L68:
	movzx	eax, BYTE PTR files[rip+1026]
	test	al, al
	je	.L70
	lea	rdx, .LC25[rip]
	lea	rsi, files[rip+1026]
	lea	rdi, files[rip]
	call	change_extension
	jmp	.L69
.L70:
	movzx	eax, BYTE PTR files[rip+1539]
	test	al, al
	je	.L71
	lea	rdx, .LC25[rip]
	lea	rsi, files[rip+1539]
	lea	rdi, files[rip]
	call	change_extension
	jmp	.L69
.L71:
	movzx	eax, BYTE PTR files[rip+2052]
	test	al, al
	je	.L69
	lea	rdx, .LC25[rip]
	lea	rsi, files[rip+2052]
	lea	rdi, files[rip]
	call	change_extension
.L69:
	lea	rdi, files[rip]
	call	strlen@PLT
	add	rax, 3
	cmp	rax, 512
	jbe	.L67
	lea	rdi, .LC26[rip]
	call	die
.L67:
	movzx	eax, BYTE PTR files[rip+513]
	test	al, al
	je	.L72
	mov	edx, 2048
	lea	rsi, srm[rip]
	lea	rdi, files[rip+513]
	call	read_mem
.L72:
	movzx	eax, BYTE PTR files[rip+1026]
	test	al, al
	je	.L73
	mov	edx, 131072
	lea	rsi, srm[rip+2048]
	lea	rdi, files[rip+1026]
	call	read_mem
.L73:
	movzx	eax, BYTE PTR files[rip+1539]
	test	al, al
	je	.L74
	mov	edx, 32768
	lea	rsi, srm[rip+133120]
	lea	rdi, files[rip+1539]
	call	read_mem
.L74:
	movzx	eax, BYTE PTR files[rip+2052]
	test	al, al
	je	.L75
	mov	edx, 131072
	lea	rsi, srm[rip+165888]
	lea	rdi, files[rip+2052]
	call	read_mem
.L75:
	mov	esi, 0
	lea	rdi, files[rip]
	call	access@PLT
	cmp	eax, -1
	setne	al
	movzx	eax, al
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], 0
	je	.L76
	lea	rdi, files[rip]
	call	overwrite_confirm
	test	eax, eax
	jne	.L76
	lea	rsi, files[rip]
	lea	rdi, .LC27[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
.L76:
	lea	rsi, files[rip]
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rsi, .LC4[rip]
	lea	rdi, files[rip]
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L77
	lea	rdi, files[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L77:
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 2048
	lea	rdi, srm[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 131072
	lea	rdi, srm[rip+2048]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 32768
	lea	rdi, srm[rip+133120]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rcx, rax
	mov	edx, 1
	mov	esi, 131072
	lea	rdi, srm[rip+165888]
	call	fwrite@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L66:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.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	"268947.c"
	.text
	.local	srm
	.comm	srm,296960,4
	.local	files
	.comm	files,2565,4
	.data
	.align	2
	.type	mempack_init, %object
	.size	mempack_init, 272
mempack_init:
	.ascii	"\201\001\002\003\004\005\006\007\010\011\012\013\014"
	.ascii	"\015\016\017\020\021\022\023\024\025\026\027\030\031"
	.ascii	"\032\033\034\035\036\037\377\377\377\377\005\032_\023"
	.ascii	"\000\000\000\000\000\000\000\000\377\377\377\377\377"
	.ascii	"\377\377\377\377\377\001\377f%\231\315\000\000\000\000"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.ascii	"\000\000\377\377\377\377\005\032_\023\000\000\000\000"
	.ascii	"\000\000\000\000\377\377\377\377\377\377\377\377\377"
	.ascii	"\377\001\377f%\231\315\377\377\377\377\005\032_\023"
	.ascii	"\000\000\000\000\000\000\000\000\377\377\377\377\377"
	.ascii	"\377\377\377\377\377\001\377f%\231\315\000\000\000\000"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.ascii	"\000\000\377\377\377\377\005\032_\023\000\000\000\000"
	.ascii	"\000\000\000\000\377\377\377\377\377\377\377\377\377"
	.ascii	"\377\001\377f%\231\315\000\000\000\000\000\000\000\000"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.ascii	"\000\000\000\000\000\000\000\000\000\000\000\000q\000"
	.ascii	"\003\000\003\000\003\000\003\000\003\000\003\000\003"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	die, %function
die:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	puts
	mvn	r0, #0
	bl	exit
	.size	die, .-die
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Do you want to overwrite %s?\000"
	.align	2
.LC1:
	.ascii	"%s (y/n):\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	overwrite_confirm, %function
overwrite_confirm:
	@ args = 0, pretend = 0, frame = 1040
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #1040
	str	r0, [fp, #-1040]
	ldr	r3, .L5
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	ldr	r2, [fp, #-1040]
	ldr	r1, .L5+4
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #1024
	sub	r3, r3, #4
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L5+8
	bl	printf
	ldr	r3, .L5+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	getc
	mov	r3, r0
	cmp	r3, #121
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	ldr	r2, .L5
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L4
	bl	__stack_chk_fail
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L6:
	.align	2
.L5:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.word	stdin
	.size	overwrite_confirm, .-overwrite_confirm
	.section	.rodata
	.align	2
.LC3:
	.ascii	"unsupported memory\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	is_empty_mem, %function
is_empty_mem:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	ldr	r2, .L23
	cmp	r3, r2
	beq	.L8
	ldr	r3, [fp, #-16]
	ldr	r2, .L23+4
	cmp	r3, r2
	bne	.L9
.L8:
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L10
.L13:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L11
	mov	r3, #0
	b	.L12
.L11:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
.L10:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L13
	b	.L14
.L9:
	ldr	r3, [fp, #-16]
	ldr	r2, .L23+8
	cmp	r3, r2
	bne	.L15
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
	b	.L16
.L18:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	beq	.L17
	mov	r3, #0
	b	.L12
.L17:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	str	r3, [fp, #-8]
.L16:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L18
	b	.L14
.L15:
	ldr	r3, [fp, #-16]
	ldr	r2, .L23+12
	cmp	r3, r2
	bne	.L19
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L20
.L22:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #15
	add	r3, r3, #2048
	ldr	r2, .L23
	add	r3, r3, r2
	ldr	r2, .L23+16
	mov	r0, r2
	mov	r1, r3
	mov	r3, #272
	mov	r2, r3
	bl	memcpy
	ldr	r3, .L23+16
	cmp	r3, #0
	beq	.L21
	mov	r3, #0
	b	.L12
.L21:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L20:
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	ble	.L22
	b	.L14
.L19:
	ldr	r0, .L23+20
	bl	die
.L14:
	mov	r3, #1
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	srm
	.word	srm+133120
	.word	srm+165888
	.word	srm+2048
	.word	mempack_init
	.word	.LC3
	.size	is_empty_mem, .-is_empty_mem
	.section	.rodata
	.align	2
.LC4:
	.ascii	"rb\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_mem, %function
read_mem:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r1, .L28
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L26
	ldr	r0, [fp, #-16]
	bl	perror
	mov	r0, #1
	bl	exit
.L26:
	ldr	r3, [fp, #-8]
	mov	r2, #1
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-20]
	bl	fread
	ldr	r0, [fp, #-8]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	beq	.L27
	ldr	r0, [fp, #-16]
	bl	perror
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r0, #1
	bl	exit
.L27:
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L29:
	.align	2
.L28:
	.word	.LC4
	.size	read_mem, .-read_mem
	.section	.rodata
	.align	2
.LC5:
	.ascii	"wb\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_mem, %function
write_mem:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r1, .L33
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L31
	ldr	r0, [fp, #-16]
	bl	perror
	mov	r0, #1
	bl	exit
.L31:
	ldr	r3, [fp, #-8]
	mov	r2, #1
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-20]
	bl	fwrite
	ldr	r0, [fp, #-8]
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	beq	.L32
	ldr	r0, [fp, #-16]
	bl	perror
	ldr	r0, [fp, #-8]
	bl	fclose
	mov	r0, #1
	bl	exit
.L32:
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L34:
	.align	2
.L33:
	.word	.LC5
	.size	write_mem, .-write_mem
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	format_srm, %function
format_srm:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r2, #32768
	mov	r1, #0
	ldr	r0, .L40
	bl	memset
	mov	r2, #2048
	mov	r1, #0
	ldr	r0, .L40+4
	bl	memset
	mov	r2, #131072
	mov	r1, #255
	ldr	r0, .L40+8
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L36
.L39:
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L37
.L38:
	ldr	r2, .L40+4
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #15
	add	r2, r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	add	r3, r3, #2048
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r1, .L40+4
	ldr	r2, [fp, #-12]
	lsl	r2, r2, #15
	add	r2, r1, r2
	add	r3, r2, r3
	add	r3, r3, #2048
	mov	r2, #3
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #2
	str	r3, [fp, #-8]
.L37:
	ldr	r3, [fp, #-8]
	cmp	r3, #32768
	blt	.L38
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #15
	add	r3, r3, #2048
	ldr	r2, .L40+4
	add	r3, r3, r2
	ldr	r2, .L40+12
	mov	r0, r3
	mov	r1, r2
	mov	r3, #272
	mov	r2, r3
	bl	memcpy
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L36:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	ble	.L39
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L41:
	.align	2
.L40:
	.word	srm+133120
	.word	srm
	.word	srm+165888
	.word	mempack_init
	.size	format_srm, .-format_srm
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ext_matches, %function
ext_matches:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r1, #46
	ldr	r0, [fp, #-20]
	bl	strrchr
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L43
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	strcasecmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L43
	mov	r3, #1
	b	.L45
.L43:
	mov	r3, #0
.L45:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	ext_matches, .-ext_matches
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	change_extension, %function
change_extension:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	mov	r1, #46
	ldr	r0, [fp, #-20]
	bl	strrchr
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L47
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	strncpy
	b	.L48
.L47:
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	strcpy
.L48:
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-16]
	bl	strcat
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	change_extension, .-change_extension
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Usage:\000"
	.align	2
.LC7:
	.ascii	"  To create a srm file: %s [file.eep] [file.mpk] [f"
	.ascii	"ile.sra] [file.fla]\012\000"
	.align	2
.LC8:
	.ascii	"  To extract a srm file: %s <file.srm>\012\012\000"
	.align	2
.LC9:
	.ascii	"Output files will be placed in the same directory o"
	.ascii	"f the input files.\000"
	.align	2
.LC10:
	.ascii	"-h\000"
	.align	2
.LC11:
	.ascii	"--help\000"
	.align	2
.LC12:
	.ascii	"/?\000"
	.align	2
.LC13:
	.ascii	"srm\000"
	.align	2
.LC14:
	.ascii	"eep\000"
	.align	2
.LC15:
	.ascii	"mpk\000"
	.align	2
.LC16:
	.ascii	"sra\000"
	.align	2
.LC17:
	.ascii	"fla\000"
	.align	2
.LC18:
	.ascii	"Running in srm extraction mode\000"
	.align	2
.LC19:
	.ascii	".eep\000"
	.align	2
.LC20:
	.ascii	".mpk\000"
	.align	2
.LC21:
	.ascii	".sra\000"
	.align	2
.LC22:
	.ascii	".fla\000"
	.align	2
.LC23:
	.ascii	"existing saves in the source directory\000"
	.align	2
.LC24:
	.ascii	"existing saves unmodified.\000"
	.align	2
.LC25:
	.ascii	"srm file unspecified, running in srm creation mode\000"
	.align	2
.LC26:
	.ascii	".srm\000"
	.align	2
.LC27:
	.ascii	"path too long\000"
	.align	2
.LC28:
	.ascii	"%s unmodified.\012\000"
	.align	2
.LC29:
	.ascii	"Writting srm data to %s...\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	bl	format_srm
	ldr	r2, .L90
	mov	r1, #0
	ldr	r0, .L90+4
	bl	memset
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	bgt	.L50
	nop
	b	.L51
.L89:
	nop
.L51:
	ldr	r0, .L90+8
	bl	puts
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+12
	bl	printf
	ldr	r3, [fp, #-28]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+16
	bl	printf
	ldr	r0, .L90+20
	bl	puts
	mov	r0, #1
	bl	exit
.L50:
	mov	r3, #1
	str	r3, [fp, #-20]
	b	.L52
.L60:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L90+24
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L89
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L90+28
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L89
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L90+32
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L89
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+36
	bl	ext_matches
	mov	r3, r0
	cmp	r3, #0
	beq	.L55
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #512
	mov	r1, r3
	ldr	r0, .L90+4
	bl	strncpy
.L55:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+40
	bl	ext_matches
	mov	r3, r0
	cmp	r3, #0
	beq	.L56
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #512
	mov	r1, r3
	ldr	r0, .L90+44
	bl	strncpy
.L56:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+48
	bl	ext_matches
	mov	r3, r0
	cmp	r3, #0
	beq	.L57
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #512
	mov	r1, r3
	ldr	r0, .L90+52
	bl	strncpy
.L57:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+56
	bl	ext_matches
	mov	r3, r0
	cmp	r3, #0
	beq	.L58
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #512
	mov	r1, r3
	ldr	r0, .L90+60
	bl	strncpy
.L58:
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L90+64
	bl	ext_matches
	mov	r3, r0
	cmp	r3, #0
	beq	.L59
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #512
	mov	r1, r3
	ldr	r0, .L90+68
	bl	strncpy
.L59:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L52:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L60
	ldr	r3, .L90+4
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L61
	ldr	r0, .L90+72
	bl	puts
	ldr	r2, .L90+76
	ldr	r1, .L90+80
	ldr	r0, .L90+4
	bl	read_mem
	mov	r1, #2048
	ldr	r0, .L90+80
	bl	is_empty_mem
	mov	r3, r0
	cmp	r3, #0
	bne	.L62
	ldr	r2, .L90+84
	ldr	r1, .L90+4
	ldr	r0, .L90+44
	bl	change_extension
.L62:
	mov	r1, #131072
	ldr	r0, .L90+88
	bl	is_empty_mem
	mov	r3, r0
	cmp	r3, #0
	bne	.L63
	ldr	r2, .L90+92
	ldr	r1, .L90+4
	ldr	r0, .L90+52
	bl	change_extension
.L63:
	mov	r1, #32768
	ldr	r0, .L90+96
	bl	is_empty_mem
	mov	r3, r0
	cmp	r3, #0
	bne	.L64
	ldr	r2, .L90+100
	ldr	r1, .L90+4
	ldr	r0, .L90+60
	bl	change_extension
.L64:
	mov	r1, #131072
	ldr	r0, .L90+104
	bl	is_empty_mem
	mov	r3, r0
	cmp	r3, #0
	bne	.L65
	ldr	r2, .L90+108
	ldr	r1, .L90+4
	ldr	r0, .L90+68
	bl	change_extension
.L65:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #513]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L66
	mov	r1, #0
	ldr	r0, .L90+44
	bl	access
	mov	r3, r0
	cmn	r3, #1
	bne	.L67
.L66:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1026]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L68
	mov	r1, #0
	ldr	r0, .L90+52
	bl	access
	mov	r3, r0
	cmn	r3, #1
	bne	.L67
.L68:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1539]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L69
	mov	r1, #0
	ldr	r0, .L90+60
	bl	access
	mov	r3, r0
	cmn	r3, #1
	bne	.L67
.L69:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #2052]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L70
	mov	r1, #0
	ldr	r0, .L90+68
	bl	access
	mov	r3, r0
	cmn	r3, #1
	beq	.L70
.L67:
	mov	r3, #1
	b	.L71
.L70:
	mov	r3, #0
.L71:
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L72
	ldr	r0, .L90+112
	bl	overwrite_confirm
	mov	r3, r0
	cmp	r3, #0
	bne	.L72
	ldr	r0, .L90+116
	bl	puts
	mov	r0, #0
	bl	exit
.L72:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #513]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L73
	mov	r2, #2048
	ldr	r1, .L90+80
	ldr	r0, .L90+44
	bl	write_mem
.L73:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1026]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L74
	mov	r2, #131072
	ldr	r1, .L90+88
	ldr	r0, .L90+52
	bl	write_mem
.L74:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1539]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L75
	mov	r2, #32768
	ldr	r1, .L90+96
	ldr	r0, .L90+60
	bl	write_mem
.L75:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #2052]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L76
	mov	r2, #131072
	ldr	r1, .L90+104
	ldr	r0, .L90+68
	bl	write_mem
	b	.L76
.L61:
	ldr	r0, .L90+120
	bl	puts
	ldr	r3, .L90+4
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L77
	ldr	r3, .L90+4
	ldrb	r3, [r3, #513]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L78
	ldr	r2, .L90+124
	ldr	r1, .L90+44
	ldr	r0, .L90+4
	bl	change_extension
	b	.L79
.L78:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1026]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L80
	ldr	r2, .L90+124
	ldr	r1, .L90+52
	ldr	r0, .L90+4
	bl	change_extension
	b	.L79
.L80:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1539]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L81
	ldr	r2, .L90+124
	ldr	r1, .L90+60
	ldr	r0, .L90+4
	bl	change_extension
	b	.L79
.L81:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #2052]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L79
	ldr	r2, .L90+124
	ldr	r1, .L90+68
	ldr	r0, .L90+4
	bl	change_extension
.L79:
	ldr	r0, .L90+4
	bl	strlen
	mov	r3, r0
	add	r3, r3, #3
	cmp	r3, #512
	bls	.L77
	ldr	r0, .L90+128
	bl	die
.L77:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #513]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L82
	mov	r2, #2048
	ldr	r1, .L90+80
	ldr	r0, .L90+44
	bl	read_mem
.L82:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1026]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L83
	mov	r2, #131072
	ldr	r1, .L90+88
	ldr	r0, .L90+52
	bl	read_mem
.L83:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #1539]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L84
	mov	r2, #32768
	ldr	r1, .L90+96
	ldr	r0, .L90+60
	bl	read_mem
.L84:
	ldr	r3, .L90+4
	ldrb	r3, [r3, #2052]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L85
	mov	r2, #131072
	ldr	r1, .L90+104
	ldr	r0, .L90+68
	bl	read_mem
.L85:
	mov	r1, #0
	ldr	r0, .L90+4
	bl	access
	mov	r3, r0
	cmn	r3, #1
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L86
	ldr	r0, .L90+4
	bl	overwrite_confirm
	mov	r3, r0
	cmp	r3, #0
	bne	.L86
	ldr	r1, .L90+4
	ldr	r0, .L90+132
	bl	printf
	mov	r0, #0
	bl	exit
.L86:
	ldr	r1, .L90+4
	ldr	r0, .L90+136
	bl	printf
	ldr	r1, .L90+140
	ldr	r0, .L90+4
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L87
	ldr	r0, .L90+4
	bl	perror
	mov	r0, #1
	bl	exit
.L87:
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #2048
	ldr	r0, .L90+80
	bl	fwrite
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #131072
	ldr	r0, .L90+88
	bl	fwrite
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #32768
	ldr	r0, .L90+96
	bl	fwrite
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #131072
	ldr	r0, .L90+104
	bl	fwrite
	ldr	r0, [fp, #-12]
	bl	fclose
.L76:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L91:
	.align	2
.L90:
	.word	2565
	.word	files
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	files+513
	.word	.LC15
	.word	files+1026
	.word	.LC16
	.word	files+1539
	.word	.LC17
	.word	files+2052
	.word	.LC18
	.word	296960
	.word	srm
	.word	.LC19
	.word	srm+2048
	.word	.LC20
	.word	srm+133120
	.word	.LC21
	.word	srm+165888
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.word	.LC28
	.word	.LC29
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
