	.file	"467054.c"
	.intel_syntax noprefix
	.text
	.globl	image
	.bss
	.align 8
	.type	image, @object
	.size	image, 8
image:
	.zero	8
	.globl	dsk
	.align 8
	.type	dsk, @object
	.size	dsk, 8
dsk:
	.zero	8
	.globl	file
	.align 8
	.type	file, @object
	.size	file, 8
file:
	.zero	8
	.globl	validdsk
	.align 4
	.type	validdsk, @object
	.size	validdsk, 4
validdsk:
	.zero	4
	.globl	changes
	.align 4
	.type	changes, @object
	.size	changes, 4
changes:
	.zero	4
	.text
	.globl	no_newlines_getchar
	.type	no_newlines_getchar, @function
no_newlines_getchar:
.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
.L2:
	call	getchar@PLT
	mov	BYTE PTR -1[rbp], al
	cmp	BYTE PTR -1[rbp], 10
	je	.L2
	movzx	eax, BYTE PTR -1[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	no_newlines_getchar, .-no_newlines_getchar
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	getfname
	.type	getfname, @function
getfname:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	edi, 256
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	getfname, .-getfname
	.section	.rodata
.LC1:
	.string	"Open file name:"
.LC2:
	.string	"rb"
	.text
	.globl	doOpenCommand
	.type	doOpenCommand, @function
doOpenCommand:
.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	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], 0
	lea	rdi, .LC1[rip]
	call	getfname
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L8
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	doOpenCommand, .-doOpenCommand
	.section	.rodata
.LC3:
	.string	"Save file as:"
.LC4:
	.string	"wb"
	.text
	.globl	doSaveCommand
	.type	doSaveCommand, @function
doSaveCommand:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR [rax], 0
	lea	rdi, .LC3[rip]
	call	getfname
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR [rdx], rax
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	doSaveCommand, .-doSaveCommand
	.section	.rodata
	.align 8
.LC5:
	.string	"Sorry, not enough free memory to load .DSK file"
.LC6:
	.string	"? "
.LC7:
	.string	"%c\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 16
	mov	edi, 819200
	call	malloc@PLT
	mov	QWORD PTR image[rip], rax
	mov	rax, QWORD PTR image[rip]
	test	rax, rax
	jne	.L11
	lea	rdi, .LC5[rip]
	call	puts@PLT
	call	getchar@PLT
	jmp	.L12
.L11:
	mov	BYTE PTR -1[rbp], 88
	mov	DWORD PTR validdsk[rip], 0
	mov	DWORD PTR changes[rip], 0
	call	Menu
	jmp	.L13
.L23:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	getch@PLT
	mov	edi, eax
	call	toupper@PLT
	mov	BYTE PTR -1[rbp], al
	movsx	eax, BYTE PTR -1[rbp]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	movsx	eax, BYTE PTR -1[rbp]
	sub	eax, 63
	cmp	eax, 24
	ja	.L13
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, .L15[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cdqe
	lea	rdx, .L15[rip]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L15:
	.long	.L21-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L22-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L21-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L20-.L15
	.long	.L13-.L15
	.long	.L19-.L15
	.long	.L18-.L15
	.long	.L13-.L15
	.long	.L17-.L15
	.long	.L13-.L15
	.long	.L16-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L13-.L15
	.long	.L14-.L15
	.text
.L21:
	call	Menu
	jmp	.L13
.L19:
	call	AskChanges
	call	NewDsk
	jmp	.L13
.L18:
	call	AskChanges
	call	OpenDsk
	jmp	.L13
.L22:
	call	DirectoryDsk
	jmp	.L13
.L20:
	call	LoadFile
	jmp	.L13
.L16:
	call	SaveFile
	jmp	.L13
.L14:
	call	SaveDsk
	jmp	.L13
.L17:
	call	AskChanges
	nop
.L13:
	cmp	BYTE PTR -1[rbp], 81
	jne	.L23
.L12:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC8:
	.string	"** Andrew Collier's SimCoupe .DSK manipulator **\n"
.LC9:
	.string	"N: New .DSK file"
.LC10:
	.string	"O: Open .DSK file"
.LC11:
	.string	"W: Write changes"
.LC12:
	.string	"D: Directory .DSK file"
.LC13:
	.string	"S: Save file into .DSK"
.LC14:
	.string	"L: Load file from .DSK"
.LC15:
	.string	"Q: Quit program"
	.text
	.globl	Menu
	.type	Menu, @function
Menu:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, .LC8[rip]
	call	puts@PLT
	lea	rdi, .LC9[rip]
	call	puts@PLT
	lea	rdi, .LC10[rip]
	call	puts@PLT
	lea	rdi, .LC11[rip]
	call	puts@PLT
	lea	rdi, .LC12[rip]
	call	puts@PLT
	lea	rdi, .LC13[rip]
	call	puts@PLT
	lea	rdi, .LC14[rip]
	call	puts@PLT
	lea	rdi, .LC15[rip]
	call	puts@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	Menu, .-Menu
	.section	.rodata
	.align 8
.LC16:
	.string	"Unsaved changes to DSK\nSave before continuing? Y/N"
	.text
	.globl	AskChanges
	.type	AskChanges, @function
AskChanges:
.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, 16
	mov	eax, DWORD PTR changes[rip]
	test	eax, eax
	je	.L31
	lea	rdi, .LC16[rip]
	call	puts@PLT
	mov	BYTE PTR -1[rbp], 88
	jmp	.L28
.L30:
	mov	eax, 0
	call	getch@PLT
	mov	edi, eax
	call	toupper@PLT
	mov	BYTE PTR -1[rbp], al
.L28:
	cmp	BYTE PTR -1[rbp], 89
	je	.L29
	cmp	BYTE PTR -1[rbp], 78
	jne	.L30
.L29:
	cmp	BYTE PTR -1[rbp], 89
	jne	.L31
	call	SaveDsk
.L31:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	AskChanges, .-AskChanges
	.section	.rodata
.LC17:
	.string	"OK"
	.align 8
.LC18:
	.string	"Sorry, there has been a disk write error"
	.text
	.globl	SaveDsk
	.type	SaveDsk, @function
SaveDsk:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, dsk[rip]
	call	doSaveCommand
	mov	rax, QWORD PTR dsk[rip]
	test	rax, rax
	je	.L36
	mov	rdx, QWORD PTR dsk[rip]
	mov	rax, QWORD PTR image[rip]
	mov	rcx, rdx
	mov	edx, 819200
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	cmp	rax, 819200
	jne	.L34
	mov	DWORD PTR changes[rip], 0
	lea	rdi, .LC17[rip]
	call	puts@PLT
	jmp	.L35
.L34:
	lea	rdi, .LC18[rip]
	call	puts@PLT
.L35:
	mov	rax, QWORD PTR dsk[rip]
	mov	rdi, rax
	call	fclose@PLT
.L36:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	SaveDsk, .-SaveDsk
	.globl	NewDsk
	.type	NewDsk, @function
NewDsk:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], 0
	jmp	.L38
.L39:
	mov	rdx, QWORD PTR image[rip]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -4[rbp], 1
.L38:
	cmp	DWORD PTR -4[rbp], 819199
	jle	.L39
	mov	DWORD PTR validdsk[rip], 1
	mov	DWORD PTR changes[rip], 1
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	NewDsk, .-NewDsk
	.section	.rodata
.LC19:
	.string	".DSK loaded"
	.align 8
.LC20:
	.string	"Sorry, there has been a disk read error"
	.align 8
.LC21:
	.string	"Sorry this is not a valid .DSK file"
	.text
	.globl	OpenDsk
	.type	OpenDsk, @function
OpenDsk:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rdi, dsk[rip]
	call	doOpenCommand
	mov	rax, QWORD PTR dsk[rip]
	test	rax, rax
	je	.L45
	mov	rax, QWORD PTR dsk[rip]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR dsk[rip]
	mov	rdi, rax
	call	ftell@PLT
	cmp	rax, 819200
	jne	.L42
	mov	rax, QWORD PTR dsk[rip]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR dsk[rip]
	mov	rax, QWORD PTR image[rip]
	mov	rcx, rdx
	mov	edx, 819200
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 819200
	jne	.L43
	mov	DWORD PTR validdsk[rip], 1
	lea	rdi, .LC19[rip]
	call	puts@PLT
	mov	DWORD PTR changes[rip], 0
	jmp	.L44
.L43:
	mov	DWORD PTR validdsk[rip], 0
	lea	rdi, .LC20[rip]
	call	puts@PLT
	jmp	.L44
.L42:
	lea	rdi, .LC21[rip]
	call	puts@PLT
	mov	DWORD PTR validdsk[rip], 0
.L44:
	mov	rax, QWORD PTR dsk[rip]
	mov	rdi, rax
	call	fclose@PLT
.L45:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	OpenDsk, .-OpenDsk
	.section	.rodata
.LC22:
	.string	"*** SAMDOS directory:"
.LC23:
	.string	"*** MasterDos directory: %s\n"
.LC24:
	.string	"%s "
.LC25:
	.string	"%6.0f "
.LC26:
	.string	"\n%d files, %d K free\n"
.LC27:
	.string	"No loaded .DSK file"
	.text
	.globl	DirectoryDsk
	.type	DirectoryDsk, @function
DirectoryDsk:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR validdsk[rip]
	test	eax, eax
	je	.L47
	mov	rax, QWORD PTR image[rip]
	add	rax, 255
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	jne	.L48
	lea	rdi, .LC22[rip]
	call	puts@PLT
	mov	DWORD PTR -56[rbp], 4
	jmp	.L49
.L48:
	mov	rax, QWORD PTR image[rip]
	add	rax, 255
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	eax, 4
	mov	DWORD PTR -56[rbp], eax
	mov	DWORD PTR -48[rbp], 0
	jmp	.L50
.L51:
	mov	rdx, QWORD PTR image[rip]
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	add	rax, 210
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	mov	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	mov	BYTE PTR -19[rbp+rax], dl
	add	DWORD PTR -48[rbp], 1
.L50:
	cmp	DWORD PTR -48[rbp], 9
	jle	.L51
	mov	BYTE PTR -9[rbp], 0
	lea	rax, -19[rbp]
	mov	rsi, rax
	lea	rdi, .LC23[rip]
	mov	eax, 0
	call	printf@PLT
.L49:
	mov	DWORD PTR -32[rbp], 0
	mov	eax, 160
	sub	eax, DWORD PTR -56[rbp]
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	mov	edx, eax
	cmp	DWORD PTR -56[rbp], 4
	setg	al
	movzx	eax, al
	add	eax, edx
	mov	DWORD PTR -52[rbp], eax
	mov	DWORD PTR -44[rbp], 0
	jmp	.L52
.L68:
	mov	DWORD PTR -40[rbp], 1
	jmp	.L53
.L67:
	mov	DWORD PTR -36[rbp], 0
	jmp	.L54
.L66:
	cmp	DWORD PTR -44[rbp], 4
	jne	.L55
	cmp	DWORD PTR -40[rbp], 1
	je	.L56
.L55:
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	mov	edx, eax
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], 0
	je	.L57
	mov	DWORD PTR -48[rbp], 0
	jmp	.L58
.L61:
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -48[rbp]
	add	edx, eax
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	mov	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	mov	BYTE PTR -19[rbp+rax], dl
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	movzx	eax, BYTE PTR -19[rbp+rax]
	cmp	al, 31
	jle	.L59
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	movzx	eax, BYTE PTR -19[rbp+rax]
	cmp	al, 127
	jne	.L60
.L59:
	mov	eax, DWORD PTR -48[rbp]
	cdqe
	mov	BYTE PTR -19[rbp+rax], 63
.L60:
	add	DWORD PTR -48[rbp], 1
.L58:
	cmp	DWORD PTR -48[rbp], 9
	jle	.L61
	mov	BYTE PTR -9[rbp], 0
	lea	rax, -19[rbp]
	mov	rsi, rax
	lea	rdi, .LC24[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 128
	test	eax, eax
	je	.L62
	mov	edi, 72
	call	putchar@PLT
	jmp	.L63
.L62:
	mov	edi, 46
	call	putchar@PLT
.L63:
	mov	eax, DWORD PTR -28[rbp]
	and	eax, 64
	test	eax, eax
	je	.L64
	mov	edi, 80
	call	putchar@PLT
	jmp	.L65
.L64:
	mov	edi, 46
	call	putchar@PLT
.L65:
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 240[rax]
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 241[rax]
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	add	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 239[rax]
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 14
	add	DWORD PTR -24[rbp], eax
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, DWORD PTR -24[rbp]
	pxor	xmm1, xmm1
	cvtss2sd	xmm1, xmm0
	movq	rax, xmm1
	movq	xmm0, rax
	lea	rdi, .LC25[rip]
	mov	eax, 1
	call	printf@PLT
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 12[rax]
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sub	DWORD PTR -52[rbp], eax
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 11[rax]
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	sub	DWORD PTR -52[rbp], eax
	jmp	.L56
.L57:
	mov	eax, DWORD PTR -36[rbp]
	sal	eax, 8
	lea	edx, 1[rax]
	mov	ecx, DWORD PTR -40[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L56
	mov	DWORD PTR -36[rbp], 1
	mov	DWORD PTR -40[rbp], 10
	mov	eax, DWORD PTR -56[rbp]
	mov	DWORD PTR -44[rbp], eax
.L56:
	add	DWORD PTR -36[rbp], 1
.L54:
	cmp	DWORD PTR -36[rbp], 1
	jle	.L66
	add	DWORD PTR -40[rbp], 1
.L53:
	cmp	DWORD PTR -40[rbp], 10
	jle	.L67
	add	DWORD PTR -44[rbp], 1
.L52:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -56[rbp]
	jl	.L68
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	mov	eax, DWORD PTR -32[rbp]
	mov	esi, eax
	lea	rdi, .LC26[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L71
.L47:
	lea	rdi, .LC27[rip]
	call	puts@PLT
.L71:
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L70
	call	__stack_chk_fail@PLT
.L70:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	DirectoryDsk, .-DirectoryDsk
	.section	.rodata
.LC28:
	.string	"Filename: "
.LC29:
	.string	"\nFile %s not found\n"
.LC30:
	.string	"Filename %s Length %d "
.LC31:
	.string	"Start %d "
.LC32:
	.string	"Execute %d "
	.text
	.globl	LoadFile
	.type	LoadFile, @function
LoadFile:
.LFB17:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 64
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR validdsk[rip]
	test	eax, eax
	je	.L101
	lea	rdi, .LC28[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -80[rbp], 0
	call	no_newlines_getchar
	mov	edx, DWORD PTR -80[rbp]
	movsx	rdx, edx
	mov	BYTE PTR -35[rbp+rdx], al
	jmp	.L74
.L76:
	call	getchar@PLT
	add	DWORD PTR -80[rbp], 1
	mov	edx, eax
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	mov	BYTE PTR -35[rbp+rax], dl
.L74:
	cmp	DWORD PTR -80[rbp], 9
	jg	.L77
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	movzx	eax, BYTE PTR -35[rbp+rax]
	cmp	al, 10
	jne	.L76
	jmp	.L77
.L78:
	call	getchar@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	mov	BYTE PTR -35[rbp+rax], dl
.L77:
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	movzx	eax, BYTE PTR -35[rbp+rax]
	cmp	al, 10
	jne	.L78
	jmp	.L79
.L80:
	mov	eax, DWORD PTR -80[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -80[rbp], edx
	cdqe
	mov	BYTE PTR -35[rbp+rax], 32
.L79:
	cmp	DWORD PTR -80[rbp], 9
	jle	.L80
	mov	BYTE PTR -25[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	rax, QWORD PTR image[rip]
	add	rax, 255
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	jne	.L81
	mov	DWORD PTR -64[rbp], 4
	jmp	.L82
.L81:
	mov	rax, QWORD PTR image[rip]
	add	rax, 255
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	eax, 4
	mov	DWORD PTR -64[rbp], eax
.L82:
	mov	DWORD PTR -76[rbp], 0
	jmp	.L83
.L92:
	mov	DWORD PTR -72[rbp], 1
	jmp	.L84
.L91:
	mov	DWORD PTR -68[rbp], 0
	jmp	.L85
.L90:
	mov	DWORD PTR -80[rbp], 0
	jmp	.L86
.L89:
	mov	eax, DWORD PTR -68[rbp]
	sal	eax, 8
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -80[rbp]
	add	edx, eax
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	edi, eax
	call	toupper@PLT
	mov	ebx, eax
	mov	eax, DWORD PTR -80[rbp]
	cdqe
	movzx	eax, BYTE PTR -35[rbp+rax]
	movsx	eax, al
	mov	edi, eax
	call	toupper@PLT
	cmp	ebx, eax
	je	.L87
	mov	DWORD PTR -80[rbp], 10
	jmp	.L88
.L87:
	cmp	DWORD PTR -80[rbp], 9
	jne	.L88
	mov	eax, DWORD PTR -68[rbp]
	sal	eax, 8
	mov	edx, eax
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	QWORD PTR -48[rbp], rax
	mov	DWORD PTR -80[rbp], 10
	mov	DWORD PTR -68[rbp], 2
	mov	DWORD PTR -72[rbp], 10
	mov	eax, DWORD PTR -64[rbp]
	mov	DWORD PTR -76[rbp], eax
.L88:
	add	DWORD PTR -80[rbp], 1
.L86:
	cmp	DWORD PTR -80[rbp], 9
	jle	.L89
	add	DWORD PTR -68[rbp], 1
.L85:
	cmp	DWORD PTR -68[rbp], 1
	jle	.L90
	add	DWORD PTR -72[rbp], 1
.L84:
	cmp	DWORD PTR -72[rbp], 10
	jle	.L91
	add	DWORD PTR -76[rbp], 1
.L83:
	mov	eax, DWORD PTR -76[rbp]
	cmp	eax, DWORD PTR -64[rbp]
	jl	.L92
	cmp	QWORD PTR -48[rbp], 0
	jne	.L93
	lea	rax, -35[rbp]
	mov	rsi, rax
	lea	rdi, .LC29[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L101
.L93:
	lea	rdi, file[rip]
	call	doSaveCommand
	mov	rax, QWORD PTR file[rip]
	test	rax, rax
	je	.L101
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 240
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 241
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	add	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 239
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 14
	add	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	mov	DWORD PTR -80[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 13
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -76[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 14
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -72[rbp], eax
	cmp	DWORD PTR -80[rbp], 500
	jle	.L94
	mov	rbx, QWORD PTR file[rip]
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 9
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, rbx
	mov	edx, 501
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	sub	DWORD PTR -80[rbp], 501
	jmp	.L96
.L94:
	mov	r12, QWORD PTR file[rip]
	mov	eax, DWORD PTR -80[rbp]
	movsx	rbx, eax
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 9
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, r12
	mov	rdx, rbx
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -80[rbp], 0
	jmp	.L96
.L98:
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 510
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -56[rbp], eax
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 511
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -52[rbp], eax
	mov	eax, DWORD PTR -56[rbp]
	mov	DWORD PTR -76[rbp], eax
	mov	eax, DWORD PTR -52[rbp]
	mov	DWORD PTR -72[rbp], eax
	cmp	DWORD PTR -80[rbp], 509
	jle	.L97
	mov	rbx, QWORD PTR file[rip]
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 0
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, rbx
	mov	edx, 510
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	sub	DWORD PTR -80[rbp], 510
	jmp	.L96
.L97:
	mov	r12, QWORD PTR file[rip]
	mov	eax, DWORD PTR -80[rbp]
	movsx	rbx, eax
	mov	ecx, DWORD PTR -72[rbp]
	mov	eax, DWORD PTR -76[rbp]
	mov	edx, 0
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, r12
	mov	rdx, rbx
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -80[rbp], 0
.L96:
	cmp	DWORD PTR -80[rbp], 0
	jg	.L98
	mov	rax, QWORD PTR file[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	edx, DWORD PTR -60[rbp]
	lea	rax, -35[rbp]
	mov	rsi, rax
	lea	rdi, .LC30[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 237
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 238
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	add	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 236
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	and	eax, 31
	sub	eax, 1
	sal	eax, 14
	add	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC31[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 243
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 244
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	add	DWORD PTR -60[rbp], eax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 242
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	eax, 1
	and	eax, 31
	sal	eax, 14
	add	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 589823
	je	.L99
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC32[rip]
	mov	eax, 0
	call	printf@PLT
.L99:
	mov	edi, 10
	call	putchar@PLT
.L101:
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L100
	call	__stack_chk_fail@PLT
.L100:
	add	rsp, 64
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	LoadFile, .-LoadFile
	.section	.rodata
	.align 8
.LC33:
	.string	"Sorry, Not enough space on dsk"
.LC34:
	.string	"Save Filename:"
.LC35:
	.string	"t %d s %d, "
	.text
	.globl	SaveFile
	.type	SaveFile, @function
SaveFile:
.LFB18:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 480
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR validdsk[rip]
	test	eax, eax
	je	.L158
	lea	rdi, file[rip]
	call	doOpenCommand
	mov	rax, QWORD PTR file[rip]
	mov	edx, 2
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR file[rip]
	mov	rdi, rax
	call	ftell@PLT
	mov	DWORD PTR -496[rbp], eax
	mov	rax, QWORD PTR file[rip]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR image[rip]
	add	rax, 255
	movzx	eax, BYTE PTR [rax]
	cmp	al, -1
	jne	.L104
	mov	DWORD PTR -492[rbp], 4
	jmp	.L105
.L104:
	mov	rax, QWORD PTR image[rip]
	add	rax, 255
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	eax, 4
	mov	DWORD PTR -492[rbp], eax
.L105:
	mov	DWORD PTR -476[rbp], 0
	jmp	.L106
.L107:
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	mov	BYTE PTR -224[rbp+rax], 0
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	movzx	edx, BYTE PTR -224[rbp+rax]
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	add	DWORD PTR -476[rbp], 1
.L106:
	cmp	DWORD PTR -476[rbp], 194
	jle	.L107
	mov	DWORD PTR -484[rbp], 0
	jmp	.L108
.L115:
	mov	DWORD PTR -488[rbp], 1
	jmp	.L109
.L114:
	mov	DWORD PTR -480[rbp], 0
	jmp	.L110
.L113:
	mov	DWORD PTR -476[rbp], 0
	jmp	.L111
.L112:
	mov	eax, DWORD PTR -480[rbp]
	sal	eax, 8
	lea	edx, 15[rax]
	mov	eax, DWORD PTR -476[rbp]
	add	edx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	edx, BYTE PTR [rax]
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	or	edx, eax
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	add	DWORD PTR -476[rbp], 1
.L111:
	cmp	DWORD PTR -476[rbp], 194
	jle	.L112
	add	DWORD PTR -480[rbp], 1
.L110:
	cmp	DWORD PTR -480[rbp], 1
	jle	.L113
	add	DWORD PTR -488[rbp], 1
.L109:
	cmp	DWORD PTR -488[rbp], 10
	jle	.L114
	add	DWORD PTR -484[rbp], 1
.L108:
	mov	eax, DWORD PTR -484[rbp]
	cmp	eax, DWORD PTR -492[rbp]
	jl	.L115
	cmp	DWORD PTR -492[rbp], 4
	jle	.L116
	movzx	eax, BYTE PTR -432[rbp]
	and	eax, -2
	mov	BYTE PTR -432[rbp], al
	movzx	eax, BYTE PTR -431[rbp]
	and	eax, 3
	mov	BYTE PTR -431[rbp], al
	cmp	DWORD PTR -492[rbp], 5
	jle	.L116
	mov	DWORD PTR -468[rbp], 1
	mov	DWORD PTR -472[rbp], 4
	mov	DWORD PTR -476[rbp], 0
	jmp	.L117
.L119:
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	and	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	sal	DWORD PTR -472[rbp]
	cmp	DWORD PTR -472[rbp], 256
	jne	.L118
	add	DWORD PTR -468[rbp], 1
	mov	DWORD PTR -472[rbp], 1
.L118:
	add	DWORD PTR -476[rbp], 1
.L117:
	mov	eax, DWORD PTR -492[rbp]
	lea	edx, -4[rax]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	cmp	DWORD PTR -476[rbp], eax
	jl	.L119
.L116:
	mov	DWORD PTR -484[rbp], 0
	jmp	.L120
.L126:
	mov	DWORD PTR -488[rbp], 1
	jmp	.L121
.L125:
	mov	DWORD PTR -480[rbp], 0
	jmp	.L122
.L124:
	mov	eax, DWORD PTR -480[rbp]
	sal	eax, 8
	mov	edx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L123
	mov	eax, DWORD PTR -480[rbp]
	sal	eax, 8
	mov	edx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	QWORD PTR -456[rbp], rax
	mov	DWORD PTR -480[rbp], 2
	mov	DWORD PTR -488[rbp], 10
	mov	eax, DWORD PTR -492[rbp]
	mov	DWORD PTR -484[rbp], eax
.L123:
	add	DWORD PTR -480[rbp], 1
.L122:
	cmp	DWORD PTR -480[rbp], 1
	jle	.L124
	add	DWORD PTR -488[rbp], 1
.L121:
	cmp	DWORD PTR -488[rbp], 10
	jle	.L125
	add	DWORD PTR -484[rbp], 1
.L120:
	mov	eax, DWORD PTR -484[rbp]
	cmp	eax, DWORD PTR -492[rbp]
	jl	.L126
	mov	DWORD PTR -476[rbp], 0
	mov	DWORD PTR -468[rbp], 0
	jmp	.L127
.L133:
	mov	DWORD PTR -472[rbp], 1
	jmp	.L128
.L132:
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	test	al, al
	je	.L129
	cmp	DWORD PTR -472[rbp], 0
	jne	.L130
.L129:
	mov	eax, 1
	jmp	.L131
.L130:
	mov	eax, 0
.L131:
	add	DWORD PTR -476[rbp], eax
	sal	DWORD PTR -472[rbp]
.L128:
	cmp	DWORD PTR -472[rbp], 255
	jle	.L132
	add	DWORD PTR -468[rbp], 1
.L127:
	cmp	DWORD PTR -468[rbp], 194
	jle	.L133
	mov	eax, DWORD PTR -476[rbp]
	imul	eax, eax, 510
	sub	eax, 8
	cmp	DWORD PTR -496[rbp], eax
	jl	.L134
	lea	rdi, .LC33[rip]
	call	puts@PLT
	jmp	.L158
.L134:
	mov	DWORD PTR -484[rbp], 4
	mov	DWORD PTR -488[rbp], 1
	mov	DWORD PTR -472[rbp], 1
	mov	DWORD PTR -468[rbp], 0
	jmp	.L135
.L137:
	sal	DWORD PTR -472[rbp]
	cmp	DWORD PTR -472[rbp], 256
	jne	.L136
	mov	DWORD PTR -472[rbp], 1
	add	DWORD PTR -468[rbp], 1
.L136:
	add	DWORD PTR -488[rbp], 1
	cmp	DWORD PTR -488[rbp], 11
	jne	.L135
	mov	DWORD PTR -488[rbp], 1
	add	DWORD PTR -484[rbp], 1
	cmp	DWORD PTR -484[rbp], 80
	jne	.L135
	mov	DWORD PTR -484[rbp], 128
.L135:
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	movzx	eax, al
	and	eax, DWORD PTR -472[rbp]
	test	eax, eax
	jne	.L137
	lea	rdi, .LC34[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -476[rbp], 0
	call	no_newlines_getchar
	mov	edx, DWORD PTR -476[rbp]
	movsx	rdx, edx
	mov	BYTE PTR -443[rbp+rdx], al
	jmp	.L138
.L140:
	call	getchar@PLT
	add	DWORD PTR -476[rbp], 1
	mov	edx, eax
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	mov	BYTE PTR -443[rbp+rax], dl
.L138:
	cmp	DWORD PTR -476[rbp], 9
	jg	.L141
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	movzx	eax, BYTE PTR -443[rbp+rax]
	cmp	al, 10
	jne	.L140
	jmp	.L141
.L142:
	call	getchar@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	mov	BYTE PTR -443[rbp+rax], dl
.L141:
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	movzx	eax, BYTE PTR -443[rbp+rax]
	cmp	al, 10
	jne	.L142
	jmp	.L143
.L144:
	mov	eax, DWORD PTR -476[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -476[rbp], edx
	cdqe
	mov	BYTE PTR -443[rbp+rax], 32
.L143:
	cmp	DWORD PTR -476[rbp], 9
	jle	.L144
	mov	BYTE PTR -433[rbp], 0
	mov	rax, QWORD PTR -456[rbp]
	mov	BYTE PTR [rax], 19
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 0
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 19
	mov	DWORD PTR -476[rbp], 0
	jmp	.L145
.L146:
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	movzx	edx, BYTE PTR -443[rbp+rax]
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	rax, QWORD PTR -456[rbp]
	add	rax, rcx
	mov	BYTE PTR [rax], dl
	add	DWORD PTR -476[rbp], 1
.L145:
	cmp	DWORD PTR -476[rbp], 9
	jle	.L146
	mov	eax, DWORD PTR -496[rbp]
	add	eax, 9
	movsx	rdx, eax
	imul	rdx, rdx, -2139062143
	shr	rdx, 32
	add	edx, eax
	sar	edx, 8
	sar	eax, 31
	mov	ecx, eax
	mov	eax, edx
	sub	eax, ecx
	mov	DWORD PTR -476[rbp], eax
	mov	eax, DWORD PTR -476[rbp]
	lea	edx, 255[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 8
	mov	edx, eax
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 11
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -476[rbp]
	cdq
	shr	edx, 24
	add	eax, edx
	movzx	eax, al
	sub	eax, edx
	mov	edx, eax
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 12
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 13
	mov	edx, DWORD PTR -484[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 14
	mov	edx, DWORD PTR -488[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 220
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 236
	mov	BYTE PTR [rax], 1
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 8
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 1
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 237
	mov	BYTE PTR [rax], 0
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 3
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 238
	mov	BYTE PTR [rax], -128
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 4
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], -128
	mov	eax, DWORD PTR -496[rbp]
	lea	edx, 16383[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 14
	mov	edx, eax
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 239
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -496[rbp]
	lea	edx, 16383[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 14
	mov	ebx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 7
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	edx, ebx
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -496[rbp]
	cdq
	shr	edx, 24
	add	eax, edx
	movzx	eax, al
	sub	eax, edx
	mov	edx, eax
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 240
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -496[rbp]
	cdq
	shr	edx, 24
	add	eax, edx
	movzx	eax, al
	sub	eax, edx
	mov	ebx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 1
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	edx, ebx
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -496[rbp]
	cdq
	shr	edx, 18
	add	eax, edx
	and	eax, 16383
	sub	eax, edx
	lea	edx, 255[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 8
	mov	edx, eax
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 241
	mov	BYTE PTR [rax], dl
	mov	eax, DWORD PTR -496[rbp]
	cdq
	shr	edx, 18
	add	eax, edx
	and	eax, 16383
	sub	eax, edx
	lea	edx, 255[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 8
	mov	ebx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 2
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	edx, ebx
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 242
	mov	BYTE PTR [rax], -1
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 243
	mov	BYTE PTR [rax], -1
	mov	rax, QWORD PTR -456[rbp]
	add	rax, 244
	mov	BYTE PTR [rax], -1
	cmp	DWORD PTR -496[rbp], 501
	jg	.L147
	mov	r12, QWORD PTR file[rip]
	mov	eax, DWORD PTR -496[rbp]
	movsx	rbx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 9
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, r12
	mov	rdx, rbx
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 510
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 0
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 511
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -224[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -224[rbp+rax], dl
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	jmp	.L148
.L147:
	mov	rbx, QWORD PTR file[rip]
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 9
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, rbx
	mov	edx, 501
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	sub	DWORD PTR -496[rbp], 501
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -224[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -224[rbp+rax], dl
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	jmp	.L149
.L154:
	mov	edx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	esi, eax
	lea	rdi, .LC35[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -484[rbp]
	mov	DWORD PTR -464[rbp], eax
	mov	eax, DWORD PTR -488[rbp]
	mov	DWORD PTR -460[rbp], eax
	jmp	.L150
.L152:
	sal	DWORD PTR -472[rbp]
	cmp	DWORD PTR -472[rbp], 256
	jne	.L151
	mov	DWORD PTR -472[rbp], 1
	add	DWORD PTR -468[rbp], 1
.L151:
	add	DWORD PTR -488[rbp], 1
	cmp	DWORD PTR -488[rbp], 11
	jne	.L150
	mov	DWORD PTR -488[rbp], 1
	add	DWORD PTR -484[rbp], 1
	cmp	DWORD PTR -484[rbp], 80
	jne	.L150
	mov	DWORD PTR -484[rbp], 128
.L150:
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	movzx	eax, al
	and	eax, DWORD PTR -472[rbp]
	test	eax, eax
	jne	.L152
	mov	ecx, DWORD PTR -460[rbp]
	mov	eax, DWORD PTR -464[rbp]
	mov	edx, 510
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	edx, DWORD PTR -484[rbp]
	mov	BYTE PTR [rax], dl
	mov	ecx, DWORD PTR -460[rbp]
	mov	eax, DWORD PTR -464[rbp]
	mov	edx, 511
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	edx, DWORD PTR -488[rbp]
	mov	BYTE PTR [rax], dl
	cmp	DWORD PTR -496[rbp], 510
	jle	.L153
	mov	rbx, QWORD PTR file[rip]
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 0
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, rbx
	mov	edx, 510
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	sub	DWORD PTR -496[rbp], 510
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -224[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -224[rbp+rax], dl
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	jmp	.L149
.L153:
	mov	r12, QWORD PTR file[rip]
	mov	eax, DWORD PTR -496[rbp]
	movsx	rbx, eax
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 0
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	rcx, r12
	mov	rdx, rbx
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -496[rbp], 0
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -224[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -224[rbp+rax], dl
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	movzx	eax, BYTE PTR -432[rbp+rax]
	mov	edx, eax
	mov	eax, DWORD PTR -472[rbp]
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -468[rbp]
	cdqe
	mov	BYTE PTR -432[rbp+rax], dl
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 510
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 0
	mov	ecx, DWORD PTR -488[rbp]
	mov	eax, DWORD PTR -484[rbp]
	mov	edx, 511
	mov	esi, ecx
	mov	edi, eax
	call	Addr
	mov	BYTE PTR [rax], 0
.L149:
	cmp	DWORD PTR -496[rbp], 0
	jg	.L154
.L148:
	mov	DWORD PTR -476[rbp], 0
	jmp	.L155
.L156:
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	lea	rdx, 15[rax]
	mov	rax, QWORD PTR -456[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -476[rbp]
	cdqe
	movzx	eax, BYTE PTR -224[rbp+rax]
	mov	BYTE PTR [rdx], al
	add	DWORD PTR -476[rbp], 1
.L155:
	cmp	DWORD PTR -476[rbp], 194
	jle	.L156
	mov	DWORD PTR changes[rip], 1
	lea	rdi, .LC17[rip]
	call	puts@PLT
.L158:
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L157
	call	__stack_chk_fail@PLT
.L157:
	add	rsp, 480
	pop	rbx
	pop	r12
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE18:
	.size	SaveFile, .-SaveFile
	.globl	Addr
	.type	Addr, @function
Addr:
.LFB19:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -20[rbp], edi
	mov	DWORD PTR -24[rbp], esi
	mov	DWORD PTR -28[rbp], edx
	cmp	DWORD PTR -20[rbp], 79
	jg	.L160
	mov	rcx, QWORD PTR image[rip]
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	sal	eax, 11
	movsx	rdx, eax
	mov	eax, DWORD PTR -24[rbp]
	sub	eax, 1
	sal	eax, 9
	cdqe
	add	rdx, rax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	add	rax, rdx
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
	jmp	.L161
.L160:
	mov	rcx, QWORD PTR image[rip]
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, -128[rax]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	sal	eax, 11
	movsx	rdx, eax
	mov	eax, DWORD PTR -24[rbp]
	sub	eax, 1
	sal	eax, 9
	cdqe
	add	rdx, rax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	add	rax, rdx
	add	rax, 5120
	add	rax, rcx
	mov	QWORD PTR -8[rbp], rax
.L161:
	mov	rax, QWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE19:
	.size	Addr, .-Addr
	.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	"467054.c"
	.text
	.comm	image,4,4
	.comm	dsk,4,4
	.comm	file,4,4
	.comm	validdsk,4,4
	.comm	changes,4,4
	.align	2
	.global	no_newlines_getchar
	.syntax unified
	.arm
	.fpu softvfp
	.type	no_newlines_getchar, %function
no_newlines_getchar:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
.L2:
	bl	getchar
	mov	r3, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L2
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	no_newlines_getchar, .-no_newlines_getchar
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%s\000"
	.text
	.align	2
	.global	getfname
	.syntax unified
	.arm
	.fpu softvfp
	.type	getfname, %function
getfname:
	@ 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]
	mov	r0, #256
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-16]
	ldr	r0, .L6
	bl	printf
	ldr	r1, [fp, #-8]
	ldr	r0, .L6
	bl	__isoc99_scanf
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.size	getfname, .-getfname
	.section	.rodata
	.align	2
.LC1:
	.ascii	"Open file name:\000"
	.align	2
.LC2:
	.ascii	"rb\000"
	.text
	.align	2
	.global	doOpenCommand
	.syntax unified
	.arm
	.fpu softvfp
	.type	doOpenCommand, %function
doOpenCommand:
	@ 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]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L11
	bl	getfname
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L10
	ldr	r1, .L11+4
	ldr	r0, [fp, #-8]
	bl	fopen
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3]
.L10:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC1
	.word	.LC2
	.size	doOpenCommand, .-doOpenCommand
	.section	.rodata
	.align	2
.LC3:
	.ascii	"Save file as:\000"
	.align	2
.LC4:
	.ascii	"wb\000"
	.text
	.align	2
	.global	doSaveCommand
	.syntax unified
	.arm
	.fpu softvfp
	.type	doSaveCommand, %function
doSaveCommand:
	@ 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]
	ldr	r3, [fp, #-16]
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L14
	bl	getfname
	str	r0, [fp, #-8]
	ldr	r1, .L14+4
	ldr	r0, [fp, #-8]
	bl	fopen
	mov	r2, r0
	ldr	r3, [fp, #-16]
	str	r2, [r3]
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC3
	.word	.LC4
	.size	doSaveCommand, .-doSaveCommand
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Sorry, not enough free memory to load .DSK file\000"
	.align	2
.LC6:
	.ascii	"? \000"
	.align	2
.LC7:
	.ascii	"%c\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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	r0, #819200
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L31
	str	r2, [r3]
	ldr	r3, .L31
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L17
	ldr	r0, .L31+4
	bl	puts
	bl	getchar
	b	.L18
.L17:
	mov	r3, #88
	strb	r3, [fp, #-5]
	ldr	r3, .L31+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L31+12
	mov	r2, #0
	str	r2, [r3]
	bl	Menu
	b	.L19
.L29:
	ldr	r0, .L31+16
	bl	printf
	bl	getch
	mov	r3, r0
	mov	r0, r3
	bl	toupper
	mov	r3, r0
	strb	r3, [fp, #-5]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r0, .L31+20
	bl	printf
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	sub	r3, r3, #63
	cmp	r3, #24
	ldrls	pc, [pc, r3, asl #2]
	b	.L19
.L21:
	.word	.L27
	.word	.L19
	.word	.L19
	.word	.L19
	.word	.L19
	.word	.L28
	.word	.L19
	.word	.L19
	.word	.L19
	.word	.L27
	.word	.L19
	.word	.L19
	.word	.L19
	.word	.L26
	.word	.L19
	.word	.L25
	.word	.L24
	.word	.L19
	.word	.L23
	.word	.L19
	.word	.L22
	.word	.L19
	.word	.L19
	.word	.L19
	.word	.L20
.L27:
	bl	Menu
	b	.L19
.L25:
	bl	AskChanges
	bl	NewDsk
	b	.L19
.L24:
	bl	AskChanges
	bl	OpenDsk
	b	.L19
.L28:
	bl	DirectoryDsk
	b	.L19
.L26:
	bl	LoadFile
	b	.L19
.L22:
	bl	SaveFile
	b	.L19
.L20:
	bl	SaveDsk
	b	.L19
.L23:
	bl	AskChanges
	nop
.L19:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #81
	bne	.L29
.L18:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	image
	.word	.LC5
	.word	validdsk
	.word	changes
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.section	.rodata
	.align	2
.LC8:
	.ascii	"** Andrew Collier's SimCoupe .DSK manipulator **\012"
	.ascii	"\000"
	.align	2
.LC9:
	.ascii	"N: New .DSK file\000"
	.align	2
.LC10:
	.ascii	"O: Open .DSK file\000"
	.align	2
.LC11:
	.ascii	"W: Write changes\000"
	.align	2
.LC12:
	.ascii	"D: Directory .DSK file\000"
	.align	2
.LC13:
	.ascii	"S: Save file into .DSK\000"
	.align	2
.LC14:
	.ascii	"L: Load file from .DSK\000"
	.align	2
.LC15:
	.ascii	"Q: Quit program\000"
	.text
	.align	2
	.global	Menu
	.syntax unified
	.arm
	.fpu softvfp
	.type	Menu, %function
Menu:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L34
	bl	puts
	ldr	r0, .L34+4
	bl	puts
	ldr	r0, .L34+8
	bl	puts
	ldr	r0, .L34+12
	bl	puts
	ldr	r0, .L34+16
	bl	puts
	ldr	r0, .L34+20
	bl	puts
	ldr	r0, .L34+24
	bl	puts
	ldr	r0, .L34+28
	bl	puts
	nop
	pop	{fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	Menu, .-Menu
	.section	.rodata
	.align	2
.LC16:
	.ascii	"Unsaved changes to DSK\012Save before continuing? Y"
	.ascii	"/N\000"
	.text
	.align	2
	.global	AskChanges
	.syntax unified
	.arm
	.fpu softvfp
	.type	AskChanges, %function
AskChanges:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L42
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L41
	ldr	r0, .L42+4
	bl	puts
	mov	r3, #88
	strb	r3, [fp, #-5]
	b	.L38
.L40:
	bl	getch
	mov	r3, r0
	mov	r0, r3
	bl	toupper
	mov	r3, r0
	strb	r3, [fp, #-5]
.L38:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #89
	beq	.L39
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #78
	bne	.L40
.L39:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #89
	bne	.L41
	bl	SaveDsk
.L41:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L43:
	.align	2
.L42:
	.word	changes
	.word	.LC16
	.size	AskChanges, .-AskChanges
	.section	.rodata
	.align	2
.LC17:
	.ascii	"OK\000"
	.align	2
.LC18:
	.ascii	"Sorry, there has been a disk write error\000"
	.text
	.align	2
	.global	SaveDsk
	.syntax unified
	.arm
	.fpu softvfp
	.type	SaveDsk, %function
SaveDsk:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L49
	bl	doSaveCommand
	ldr	r3, .L49
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L48
	ldr	r3, .L49+4
	ldr	r0, [r3]
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r2, #819200
	mov	r1, #1
	bl	fwrite
	mov	r3, r0
	cmp	r3, #819200
	bne	.L46
	ldr	r3, .L49+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L49+12
	bl	puts
	b	.L47
.L46:
	ldr	r0, .L49+16
	bl	puts
.L47:
	ldr	r3, .L49
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
.L48:
	nop
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	dsk
	.word	image
	.word	changes
	.word	.LC17
	.word	.LC18
	.size	SaveDsk, .-SaveDsk
	.align	2
	.global	NewDsk
	.syntax unified
	.arm
	.fpu softvfp
	.type	NewDsk, %function
NewDsk:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L52
.L53:
	ldr	r3, .L54
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L52:
	ldr	r3, [fp, #-8]
	cmp	r3, #819200
	blt	.L53
	ldr	r3, .L54+4
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L54+8
	mov	r2, #1
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L55:
	.align	2
.L54:
	.word	image
	.word	validdsk
	.word	changes
	.size	NewDsk, .-NewDsk
	.section	.rodata
	.align	2
.LC19:
	.ascii	".DSK loaded\000"
	.align	2
.LC20:
	.ascii	"Sorry, there has been a disk read error\000"
	.align	2
.LC21:
	.ascii	"Sorry this is not a valid .DSK file\000"
	.text
	.align	2
	.global	OpenDsk
	.syntax unified
	.arm
	.fpu softvfp
	.type	OpenDsk, %function
OpenDsk:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r0, .L62
	bl	doOpenCommand
	ldr	r3, .L62
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L61
	ldr	r3, .L62
	ldr	r3, [r3]
	mov	r2, #2
	mov	r1, #0
	mov	r0, r3
	bl	fseek
	ldr	r3, .L62
	ldr	r3, [r3]
	mov	r0, r3
	bl	ftell
	mov	r3, r0
	cmp	r3, #819200
	bne	.L58
	ldr	r3, .L62
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	fseek
	ldr	r3, .L62+4
	ldr	r0, [r3]
	ldr	r3, .L62
	ldr	r3, [r3]
	mov	r2, #819200
	mov	r1, #1
	bl	fread
	mov	r3, r0
	cmp	r3, #819200
	bne	.L59
	ldr	r3, .L62+8
	mov	r2, #1
	str	r2, [r3]
	ldr	r0, .L62+12
	bl	puts
	ldr	r3, .L62+16
	mov	r2, #0
	str	r2, [r3]
	b	.L60
.L59:
	ldr	r3, .L62+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L62+20
	bl	puts
	b	.L60
.L58:
	ldr	r0, .L62+24
	bl	puts
	ldr	r3, .L62+8
	mov	r2, #0
	str	r2, [r3]
.L60:
	ldr	r3, .L62
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
.L61:
	nop
	pop	{fp, pc}
.L63:
	.align	2
.L62:
	.word	dsk
	.word	image
	.word	validdsk
	.word	.LC19
	.word	changes
	.word	.LC20
	.word	.LC21
	.size	OpenDsk, .-OpenDsk
	.section	.rodata
	.align	2
.LC22:
	.ascii	"*** SAMDOS directory:\000"
	.align	2
.LC23:
	.ascii	"*** MasterDos directory: %s\012\000"
	.align	2
.LC24:
	.ascii	"%s \000"
	.global	__aeabi_i2f
	.global	__aeabi_f2d
	.align	2
.LC25:
	.ascii	"%6.0f \000"
	.align	2
.LC26:
	.ascii	"\012%d files, %d K free\012\000"
	.align	2
.LC27:
	.ascii	"No loaded .DSK file\000"
	.align	2
.LC28:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	DirectoryDsk
	.syntax unified
	.arm
	.fpu softvfp
	.type	DirectoryDsk, %function
DirectoryDsk:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	ldr	r3, .L90
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L90+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L65
	ldr	r3, .L90+8
	ldr	r3, [r3]
	add	r3, r3, #255
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L66
	ldr	r0, .L90+12
	bl	puts
	mov	r3, #4
	str	r3, [fp, #-56]
	b	.L67
.L66:
	ldr	r3, .L90+8
	ldr	r3, [r3]
	add	r3, r3, #255
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #4
	str	r3, [fp, #-56]
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L68
.L69:
	ldr	r3, .L90+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-48]
	add	r3, r3, #210
	add	r3, r2, r3
	ldrb	r1, [r3]	@ zero_extendqisi2
	sub	r2, fp, #20
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L68:
	ldr	r3, [fp, #-48]
	cmp	r3, #9
	ble	.L69
	mov	r3, #0
	strb	r3, [fp, #-10]
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, .L90+16
	bl	printf
.L67:
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-56]
	rsb	r2, r3, #160
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-56]
	cmp	r3, #4
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	add	r3, r2, r3
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-44]
	b	.L70
.L86:
	mov	r3, #1
	str	r3, [fp, #-40]
	b	.L71
.L85:
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L72
.L84:
	ldr	r3, [fp, #-44]
	cmp	r3, #4
	bne	.L73
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	beq	.L74
.L73:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L75
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L76
.L79:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r2, r3, #1
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r1, [r3]	@ zero_extendqisi2
	sub	r2, fp, #20
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	sub	r2, fp, #20
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #31
	bls	.L77
	sub	r2, fp, #20
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #126
	bls	.L78
.L77:
	sub	r2, fp, #20
	ldr	r3, [fp, #-48]
	add	r3, r2, r3
	mov	r2, #63
	strb	r2, [r3]
.L78:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L76:
	ldr	r3, [fp, #-48]
	cmp	r3, #9
	ble	.L79
	mov	r3, #0
	strb	r3, [fp, #-10]
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, .L90+20
	bl	printf
	ldr	r3, [fp, #-28]
	and	r3, r3, #128
	cmp	r3, #0
	beq	.L80
	mov	r0, #72
	bl	putchar
	b	.L81
.L80:
	mov	r0, #46
	bl	putchar
.L81:
	ldr	r3, [fp, #-28]
	and	r3, r3, #64
	cmp	r3, #0
	beq	.L82
	mov	r0, #80
	bl	putchar
	b	.L83
.L82:
	mov	r0, #46
	bl	putchar
.L83:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r3, r3, #240
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r3, r3, #241
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r3, r3, #239
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #14
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-24]
	ldr	r0, [fp, #-24]
	bl	__aeabi_i2f
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_f2d
	mov	r2, r0
	mov	r3, r1
	ldr	r0, .L90+24
	bl	printf
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r3, r3, #12
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-52]
	sub	r3, r3, r2
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r3, r3, #11
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	ldr	r2, [fp, #-52]
	sub	r3, r2, r3
	str	r3, [fp, #-52]
	b	.L74
.L75:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #8
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-44]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L74
	mov	r3, #1
	str	r3, [fp, #-36]
	mov	r3, #10
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-56]
	str	r3, [fp, #-44]
.L74:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L72:
	ldr	r3, [fp, #-36]
	cmp	r3, #1
	ble	.L84
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L71:
	ldr	r3, [fp, #-40]
	cmp	r3, #10
	ble	.L85
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	str	r3, [fp, #-44]
.L70:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-56]
	cmp	r2, r3
	blt	.L86
	ldr	r3, [fp, #-52]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r1, [fp, #-32]
	ldr	r0, .L90+28
	bl	printf
	b	.L89
.L65:
	ldr	r0, .L90+32
	bl	puts
.L89:
	nop
	ldr	r3, .L90
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L88
	bl	__stack_chk_fail
.L88:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L91:
	.align	2
.L90:
	.word	.LC28
	.word	validdsk
	.word	image
	.word	.LC22
	.word	.LC23
	.word	.LC24
	.word	.LC25
	.word	.LC26
	.word	.LC27
	.size	DirectoryDsk, .-DirectoryDsk
	.section	.rodata
	.align	2
.LC29:
	.ascii	"Filename: \000"
	.align	2
.LC30:
	.ascii	"\012File %s not found\012\000"
	.align	2
.LC31:
	.ascii	"Filename %s Length %d \000"
	.align	2
.LC32:
	.ascii	"Start %d \000"
	.align	2
.LC33:
	.ascii	"Execute %d \000"
	.align	2
.LC34:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	LoadFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	LoadFile, %function
LoadFile:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #60
	ldr	r3, .L122
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L122+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L121
	ldr	r0, .L122+8
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-64]
	bl	no_newlines_getchar
	mov	r3, r0
	mov	r1, r3
	sub	r2, fp, #28
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	b	.L94
.L96:
	bl	getchar
	mov	r2, r0
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
	and	r1, r2, #255
	sub	r2, fp, #28
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
.L94:
	ldr	r3, [fp, #-64]
	cmp	r3, #9
	bgt	.L97
	sub	r2, fp, #28
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L96
	b	.L97
.L98:
	bl	getchar
	mov	r3, r0
	and	r1, r3, #255
	sub	r2, fp, #28
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
.L97:
	sub	r2, fp, #28
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L98
	b	.L99
.L100:
	ldr	r3, [fp, #-64]
	add	r2, r3, #1
	str	r2, [fp, #-64]
	sub	r2, fp, #12
	add	r3, r2, r3
	mov	r2, #32
	strb	r2, [r3, #-16]
.L99:
	ldr	r3, [fp, #-64]
	cmp	r3, #9
	ble	.L100
	mov	r3, #0
	strb	r3, [fp, #-18]
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r3, .L122+12
	ldr	r3, [r3]
	add	r3, r3, #255
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L101
	mov	r3, #4
	str	r3, [fp, #-48]
	b	.L102
.L101:
	ldr	r3, .L122+12
	ldr	r3, [r3]
	add	r3, r3, #255
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #4
	str	r3, [fp, #-48]
.L102:
	mov	r3, #0
	str	r3, [fp, #-60]
	b	.L103
.L112:
	mov	r3, #1
	str	r3, [fp, #-56]
	b	.L104
.L111:
	mov	r3, #0
	str	r3, [fp, #-52]
	b	.L105
.L110:
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L106
.L109:
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #8
	add	r2, r3, #1
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	toupper
	mov	r4, r0
	sub	r2, fp, #28
	ldr	r3, [fp, #-64]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	toupper
	mov	r3, r0
	cmp	r4, r3
	beq	.L107
	mov	r3, #10
	str	r3, [fp, #-64]
	b	.L108
.L107:
	ldr	r3, [fp, #-64]
	cmp	r3, #9
	bne	.L108
	ldr	r3, [fp, #-52]
	lsl	r3, r3, #8
	mov	r2, r3
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	str	r0, [fp, #-44]
	mov	r3, #10
	str	r3, [fp, #-64]
	mov	r3, #2
	str	r3, [fp, #-52]
	mov	r3, #10
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-60]
.L108:
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L106:
	ldr	r3, [fp, #-64]
	cmp	r3, #9
	ble	.L109
	ldr	r3, [fp, #-52]
	add	r3, r3, #1
	str	r3, [fp, #-52]
.L105:
	ldr	r3, [fp, #-52]
	cmp	r3, #1
	ble	.L110
	ldr	r3, [fp, #-56]
	add	r3, r3, #1
	str	r3, [fp, #-56]
.L104:
	ldr	r3, [fp, #-56]
	cmp	r3, #10
	ble	.L111
	ldr	r3, [fp, #-60]
	add	r3, r3, #1
	str	r3, [fp, #-60]
.L103:
	ldr	r2, [fp, #-60]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	blt	.L112
	ldr	r3, [fp, #-44]
	cmp	r3, #0
	bne	.L113
	sub	r3, fp, #28
	mov	r1, r3
	ldr	r0, .L122+16
	bl	printf
	b	.L121
.L113:
	ldr	r0, .L122+20
	bl	doSaveCommand
	ldr	r3, .L122+20
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L121
	ldr	r3, [fp, #-44]
	add	r3, r3, #240
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #241
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #239
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #14
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-44]
	add	r3, r3, #13
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-44]
	add	r3, r3, #14
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	cmp	r3, #500
	ble	.L114
	mov	r2, #9
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	ldr	r3, .L122+20
	ldr	r3, [r3]
	ldr	r2, .L122+24
	mov	r1, #1
	bl	fwrite
	ldr	r3, [fp, #-64]
	sub	r3, r3, #500
	sub	r3, r3, #1
	str	r3, [fp, #-64]
	b	.L116
.L114:
	mov	r2, #9
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	ldr	r2, [fp, #-64]
	ldr	r3, .L122+20
	ldr	r3, [r3]
	mov	r1, #1
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L116
.L118:
	ldr	r2, .L122+28
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-36]
	ldr	r2, .L122+32
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-60]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	ldr	r2, .L122+36
	cmp	r3, r2
	ble	.L117
	mov	r2, #0
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	ldr	r3, .L122+20
	ldr	r3, [r3]
	ldr	r2, .L122+28
	mov	r1, #1
	bl	fwrite
	ldr	r3, [fp, #-64]
	sub	r3, r3, #508
	sub	r3, r3, #2
	str	r3, [fp, #-64]
	b	.L116
.L117:
	mov	r2, #0
	ldr	r1, [fp, #-56]
	ldr	r0, [fp, #-60]
	bl	Addr
	ldr	r2, [fp, #-64]
	ldr	r3, .L122+20
	ldr	r3, [r3]
	mov	r1, #1
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-64]
.L116:
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bgt	.L118
	ldr	r3, .L122+20
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	sub	r3, fp, #28
	ldr	r2, [fp, #-40]
	mov	r1, r3
	ldr	r0, .L122+40
	bl	printf
	ldr	r3, [fp, #-44]
	add	r3, r3, #237
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #238
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #236
	ldrb	r3, [r3]	@ zero_extendqisi2
	and	r3, r3, #31
	sub	r3, r3, #1
	lsl	r3, r3, #14
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r1, [fp, #-40]
	ldr	r0, .L122+44
	bl	printf
	ldr	r3, [fp, #-44]
	add	r3, r3, #243
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #244
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #8
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-44]
	add	r3, r3, #242
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #1
	and	r3, r3, #31
	lsl	r3, r3, #14
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	ldr	r2, .L122+48
	cmp	r3, r2
	beq	.L119
	ldr	r1, [fp, #-40]
	ldr	r0, .L122+52
	bl	printf
.L119:
	mov	r0, #10
	bl	putchar
.L121:
	nop
	ldr	r3, .L122
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L120
	bl	__stack_chk_fail
.L120:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L123:
	.align	2
.L122:
	.word	.LC34
	.word	validdsk
	.word	.LC29
	.word	image
	.word	.LC30
	.word	file
	.word	501
	.word	510
	.word	511
	.word	509
	.word	.LC31
	.word	.LC32
	.word	589823
	.word	.LC33
	.size	LoadFile, .-LoadFile
	.section	.rodata
	.align	2
.LC35:
	.ascii	"Sorry, Not enough space on dsk\000"
	.align	2
.LC36:
	.ascii	"Save Filename:\000"
	.align	2
.LC37:
	.ascii	"t %d s %d, \000"
	.align	2
.LC38:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	SaveFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	SaveFile, %function
SaveFile:
	@ args = 0, pretend = 0, frame = 456
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #460
	ldr	r3, .L181
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L181+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L180
	ldr	r0, .L181+8
	bl	doOpenCommand
	ldr	r3, .L181+8
	ldr	r3, [r3]
	mov	r2, #2
	mov	r1, #0
	mov	r0, r3
	bl	fseek
	ldr	r3, .L181+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	ftell
	str	r0, [fp, #-460]
	ldr	r3, .L181+8
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	fseek
	ldr	r3, .L181+12
	ldr	r3, [r3]
	add	r3, r3, #255
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #255
	bne	.L126
	mov	r3, #4
	str	r3, [fp, #-456]
	b	.L127
.L126:
	ldr	r3, .L181+12
	ldr	r3, [r3]
	add	r3, r3, #255
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r3, #4
	str	r3, [fp, #-456]
.L127:
	mov	r3, #0
	str	r3, [fp, #-440]
	b	.L128
.L129:
	sub	r2, fp, #212
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	sub	r2, fp, #212
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	ldrb	r1, [r3]	@ zero_extendqisi2
	sub	r2, fp, #408
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
.L128:
	ldr	r3, [fp, #-440]
	cmp	r3, #194
	ble	.L129
	mov	r3, #0
	str	r3, [fp, #-448]
	b	.L130
.L137:
	mov	r3, #1
	str	r3, [fp, #-452]
	b	.L131
.L136:
	mov	r3, #0
	str	r3, [fp, #-444]
	b	.L132
.L135:
	mov	r3, #0
	str	r3, [fp, #-440]
	b	.L133
.L134:
	ldr	r3, [fp, #-444]
	lsl	r3, r3, #8
	add	r2, r3, #15
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	ldrb	r2, [r3]	@ zero_extendqisi2
	sub	r1, fp, #408
	ldr	r3, [fp, #-440]
	add	r3, r1, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	orr	r3, r2, r3
	and	r1, r3, #255
	sub	r2, fp, #408
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
.L133:
	ldr	r3, [fp, #-440]
	cmp	r3, #194
	ble	.L134
	ldr	r3, [fp, #-444]
	add	r3, r3, #1
	str	r3, [fp, #-444]
.L132:
	ldr	r3, [fp, #-444]
	cmp	r3, #1
	ble	.L135
	ldr	r3, [fp, #-452]
	add	r3, r3, #1
	str	r3, [fp, #-452]
.L131:
	ldr	r3, [fp, #-452]
	cmp	r3, #10
	ble	.L136
	ldr	r3, [fp, #-448]
	add	r3, r3, #1
	str	r3, [fp, #-448]
.L130:
	ldr	r2, [fp, #-448]
	ldr	r3, [fp, #-456]
	cmp	r2, r3
	blt	.L137
	ldr	r3, [fp, #-456]
	cmp	r3, #4
	ble	.L138
	ldrb	r3, [fp, #-408]	@ zero_extendqisi2
	bic	r3, r3, #1
	and	r3, r3, #255
	strb	r3, [fp, #-408]
	ldrb	r3, [fp, #-407]	@ zero_extendqisi2
	and	r3, r3, #3
	and	r3, r3, #255
	strb	r3, [fp, #-407]
	ldr	r3, [fp, #-456]
	cmp	r3, #5
	ble	.L138
	mov	r3, #1
	str	r3, [fp, #-432]
	mov	r3, #4
	str	r3, [fp, #-436]
	mov	r3, #0
	str	r3, [fp, #-440]
	b	.L139
.L141:
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, r2
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #1
	str	r3, [fp, #-436]
	ldr	r3, [fp, #-436]
	cmp	r3, #256
	bne	.L140
	ldr	r3, [fp, #-432]
	add	r3, r3, #1
	str	r3, [fp, #-432]
	mov	r3, #1
	str	r3, [fp, #-436]
.L140:
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
.L139:
	ldr	r3, [fp, #-456]
	sub	r2, r3, #4
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-440]
	cmp	r3, r2
	blt	.L141
.L138:
	mov	r3, #0
	str	r3, [fp, #-448]
	b	.L142
.L148:
	mov	r3, #1
	str	r3, [fp, #-452]
	b	.L143
.L147:
	mov	r3, #0
	str	r3, [fp, #-444]
	b	.L144
.L146:
	ldr	r3, [fp, #-444]
	lsl	r3, r3, #8
	mov	r2, r3
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L145
	ldr	r3, [fp, #-444]
	lsl	r3, r3, #8
	mov	r2, r3
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	str	r0, [fp, #-464]
	mov	r3, #2
	str	r3, [fp, #-444]
	mov	r3, #10
	str	r3, [fp, #-452]
	ldr	r3, [fp, #-456]
	str	r3, [fp, #-448]
.L145:
	ldr	r3, [fp, #-444]
	add	r3, r3, #1
	str	r3, [fp, #-444]
.L144:
	ldr	r3, [fp, #-444]
	cmp	r3, #1
	ble	.L146
	ldr	r3, [fp, #-452]
	add	r3, r3, #1
	str	r3, [fp, #-452]
.L143:
	ldr	r3, [fp, #-452]
	cmp	r3, #10
	ble	.L147
	ldr	r3, [fp, #-448]
	add	r3, r3, #1
	str	r3, [fp, #-448]
.L142:
	ldr	r2, [fp, #-448]
	ldr	r3, [fp, #-456]
	cmp	r2, r3
	blt	.L148
	mov	r3, #0
	str	r3, [fp, #-440]
	mov	r3, #0
	str	r3, [fp, #-432]
	b	.L149
.L155:
	mov	r3, #1
	str	r3, [fp, #-436]
	b	.L150
.L154:
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L151
	ldr	r3, [fp, #-436]
	cmp	r3, #0
	bne	.L152
.L151:
	mov	r3, #1
	b	.L153
.L152:
	mov	r3, #0
.L153:
	ldr	r2, [fp, #-440]
	add	r3, r2, r3
	str	r3, [fp, #-440]
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #1
	str	r3, [fp, #-436]
.L150:
	ldr	r3, [fp, #-436]
	cmp	r3, #255
	ble	.L154
	ldr	r3, [fp, #-432]
	add	r3, r3, #1
	str	r3, [fp, #-432]
.L149:
	ldr	r3, [fp, #-432]
	cmp	r3, #194
	ble	.L155
	ldr	r2, [fp, #-440]
	mov	r3, r2
	lsl	r3, r3, #8
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r3, r3, #8
	ldr	r2, [fp, #-460]
	cmp	r2, r3
	blt	.L156
	ldr	r0, .L181+16
	bl	puts
	b	.L180
.L156:
	mov	r3, #4
	str	r3, [fp, #-448]
	mov	r3, #1
	str	r3, [fp, #-452]
	mov	r3, #1
	str	r3, [fp, #-436]
	mov	r3, #0
	str	r3, [fp, #-432]
	b	.L157
.L159:
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #1
	str	r3, [fp, #-436]
	ldr	r3, [fp, #-436]
	cmp	r3, #256
	bne	.L158
	mov	r3, #1
	str	r3, [fp, #-436]
	ldr	r3, [fp, #-432]
	add	r3, r3, #1
	str	r3, [fp, #-432]
.L158:
	ldr	r3, [fp, #-452]
	add	r3, r3, #1
	str	r3, [fp, #-452]
	ldr	r3, [fp, #-452]
	cmp	r3, #11
	bne	.L157
	mov	r3, #1
	str	r3, [fp, #-452]
	ldr	r3, [fp, #-448]
	add	r3, r3, #1
	str	r3, [fp, #-448]
	ldr	r3, [fp, #-448]
	cmp	r3, #80
	bne	.L157
	mov	r3, #128
	str	r3, [fp, #-448]
.L157:
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-436]
	and	r3, r3, r2
	cmp	r3, #0
	bne	.L159
	ldr	r0, .L181+20
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-440]
	bl	no_newlines_getchar
	mov	r3, r0
	mov	r1, r3
	sub	r2, fp, #420
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	b	.L160
.L162:
	bl	getchar
	mov	r2, r0
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
	and	r1, r2, #255
	sub	r2, fp, #420
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
.L160:
	ldr	r3, [fp, #-440]
	cmp	r3, #9
	bgt	.L163
	sub	r2, fp, #420
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L162
	b	.L163
.L164:
	bl	getchar
	mov	r3, r0
	and	r1, r3, #255
	sub	r2, fp, #420
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
.L163:
	sub	r2, fp, #420
	ldr	r3, [fp, #-440]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L164
	b	.L165
.L166:
	ldr	r3, [fp, #-440]
	add	r2, r3, #1
	str	r2, [fp, #-440]
	sub	r2, fp, #12
	add	r3, r2, r3
	mov	r2, #32
	strb	r2, [r3, #-408]
.L165:
	ldr	r3, [fp, #-440]
	cmp	r3, #9
	ble	.L166
	mov	r3, #0
	strb	r3, [fp, #-410]
	ldr	r3, [fp, #-464]
	mov	r2, #19
	strb	r2, [r3]
	mov	r2, #0
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #19
	strb	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-440]
	b	.L167
.L168:
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	ldr	r2, [fp, #-464]
	add	r3, r2, r3
	sub	r1, fp, #420
	ldr	r2, [fp, #-440]
	add	r2, r1, r2
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
.L167:
	ldr	r3, [fp, #-440]
	cmp	r3, #9
	ble	.L168
	ldr	r3, [fp, #-460]
	add	r3, r3, #9
	ldr	r2, .L181+24
	smull	r1, r2, r3, r2
	add	r2, r2, r3
	asr	r2, r2, #8
	asr	r3, r3, #31
	sub	r3, r2, r3
	str	r3, [fp, #-440]
	ldr	r3, [fp, #-440]
	add	r2, r3, #255
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #8
	mov	r2, r3
	ldr	r3, [fp, #-464]
	add	r3, r3, #11
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-440]
	rsbs	r2, r3, #0
	and	r3, r3, #255
	and	r2, r2, #255
	rsbpl	r3, r2, #0
	ldr	r2, [fp, #-464]
	add	r2, r2, #12
	and	r3, r3, #255
	strb	r3, [r2]
	ldr	r3, [fp, #-464]
	add	r3, r3, #13
	ldr	r2, [fp, #-448]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #14
	ldr	r2, [fp, #-452]
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #220
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #236
	mov	r2, #1
	strb	r2, [r3]
	mov	r2, #8
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #237
	mov	r2, #0
	strb	r2, [r3]
	mov	r2, #3
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #238
	mvn	r2, #127
	strb	r2, [r3]
	mov	r2, #4
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mvn	r2, #127
	strb	r2, [r3]
	ldr	r3, [fp, #-460]
	add	r2, r3, #16320
	add	r2, r2, #63
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #14
	mov	r2, r3
	ldr	r3, [fp, #-464]
	add	r3, r3, #239
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-460]
	add	r2, r3, #16320
	add	r2, r2, #63
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #14
	mov	r4, r3
	mov	r2, #7
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	and	r2, r4, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-460]
	rsbs	r2, r3, #0
	and	r3, r3, #255
	and	r2, r2, #255
	rsbpl	r3, r2, #0
	ldr	r2, [fp, #-464]
	add	r2, r2, #240
	and	r3, r3, #255
	strb	r3, [r2]
	ldr	r3, [fp, #-460]
	rsbs	r2, r3, #0
	and	r4, r3, #255
	and	r3, r2, #255
	rsbpl	r4, r3, #0
	mov	r2, #1
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	and	r2, r4, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-460]
	rsbs	r2, r3, #0
	lsl	r3, r3, #18
	lsr	r3, r3, #18
	lsl	r2, r2, #18
	lsr	r2, r2, #18
	rsbpl	r3, r2, #0
	add	r2, r3, #255
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #8
	mov	r2, r3
	ldr	r3, [fp, #-464]
	add	r3, r3, #241
	and	r2, r2, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-460]
	rsbs	r2, r3, #0
	lsl	r3, r3, #18
	lsr	r3, r3, #18
	lsl	r2, r2, #18
	lsr	r2, r2, #18
	rsbpl	r3, r2, #0
	add	r2, r3, #255
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #8
	mov	r4, r3
	mov	r2, #2
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	and	r2, r4, #255
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #242
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #243
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-464]
	add	r3, r3, #244
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-460]
	ldr	r2, .L181+28
	cmp	r3, r2
	bgt	.L169
	mov	r2, #9
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	ldr	r2, [fp, #-460]
	ldr	r3, .L181+8
	ldr	r3, [r3]
	mov	r1, #1
	bl	fread
	ldr	r2, .L181+32
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #0
	strb	r2, [r3]
	ldr	r2, .L181+36
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #0
	strb	r2, [r3]
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	b	.L170
.L169:
	mov	r2, #9
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	ldr	r3, .L181+8
	ldr	r3, [r3]
	ldr	r2, .L181+28
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-460]
	sub	r3, r3, #500
	sub	r3, r3, #1
	str	r3, [fp, #-460]
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	b	.L171
.L176:
	ldr	r2, [fp, #-452]
	ldr	r1, [fp, #-448]
	ldr	r0, .L181+40
	bl	printf
	ldr	r3, [fp, #-448]
	str	r3, [fp, #-428]
	ldr	r3, [fp, #-452]
	str	r3, [fp, #-424]
	b	.L172
.L174:
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #1
	str	r3, [fp, #-436]
	ldr	r3, [fp, #-436]
	cmp	r3, #256
	bne	.L173
	mov	r3, #1
	str	r3, [fp, #-436]
	ldr	r3, [fp, #-432]
	add	r3, r3, #1
	str	r3, [fp, #-432]
.L173:
	ldr	r3, [fp, #-452]
	add	r3, r3, #1
	str	r3, [fp, #-452]
	ldr	r3, [fp, #-452]
	cmp	r3, #11
	bne	.L172
	mov	r3, #1
	str	r3, [fp, #-452]
	ldr	r3, [fp, #-448]
	add	r3, r3, #1
	str	r3, [fp, #-448]
	ldr	r3, [fp, #-448]
	cmp	r3, #80
	bne	.L172
	mov	r3, #128
	str	r3, [fp, #-448]
.L172:
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-436]
	and	r3, r3, r2
	cmp	r3, #0
	bne	.L174
	ldr	r2, .L181+32
	ldr	r1, [fp, #-424]
	ldr	r0, [fp, #-428]
	bl	Addr
	mov	r2, r0
	ldr	r3, [fp, #-448]
	and	r3, r3, #255
	strb	r3, [r2]
	ldr	r2, .L181+36
	ldr	r1, [fp, #-424]
	ldr	r0, [fp, #-428]
	bl	Addr
	mov	r2, r0
	ldr	r3, [fp, #-452]
	and	r3, r3, #255
	strb	r3, [r2]
	ldr	r3, [fp, #-460]
	ldr	r2, .L181+32
	cmp	r3, r2
	ble	.L175
	mov	r2, #0
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	ldr	r3, .L181+8
	ldr	r3, [r3]
	ldr	r2, .L181+32
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-460]
	sub	r3, r3, #508
	sub	r3, r3, #2
	str	r3, [fp, #-460]
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	b	.L171
.L175:
	mov	r2, #0
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	ldr	r2, [fp, #-460]
	ldr	r3, .L181+8
	ldr	r3, [r3]
	mov	r1, #1
	bl	fread
	mov	r3, #0
	str	r3, [fp, #-460]
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #212
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldr	r3, [fp, #-436]
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r1, r3, #255
	sub	r2, fp, #408
	ldr	r3, [fp, #-432]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r2, .L181+32
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #0
	strb	r2, [r3]
	ldr	r2, .L181+36
	ldr	r1, [fp, #-452]
	ldr	r0, [fp, #-448]
	bl	Addr
	mov	r3, r0
	mov	r2, #0
	strb	r2, [r3]
.L171:
	ldr	r3, [fp, #-460]
	cmp	r3, #0
	bgt	.L176
.L170:
	mov	r3, #0
	str	r3, [fp, #-440]
	b	.L177
.L178:
	ldr	r3, [fp, #-440]
	add	r3, r3, #15
	ldr	r2, [fp, #-464]
	add	r3, r2, r3
	sub	r1, fp, #212
	ldr	r2, [fp, #-440]
	add	r2, r1, r2
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-440]
	add	r3, r3, #1
	str	r3, [fp, #-440]
.L177:
	ldr	r3, [fp, #-440]
	cmp	r3, #194
	ble	.L178
	ldr	r3, .L181+44
	mov	r2, #1
	str	r2, [r3]
	ldr	r0, .L181+48
	bl	puts
.L180:
	nop
	ldr	r3, .L181
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L179
	bl	__stack_chk_fail
.L179:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L182:
	.align	2
.L181:
	.word	.LC38
	.word	validdsk
	.word	file
	.word	image
	.word	.LC35
	.word	.LC36
	.word	-2139062143
	.word	501
	.word	510
	.word	511
	.word	.LC37
	.word	changes
	.word	.LC17
	.size	SaveFile, .-SaveFile
	.align	2
	.global	Addr
	.syntax unified
	.arm
	.fpu softvfp
	.type	Addr, %function
Addr:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	cmp	r3, #79
	bgt	.L184
	ldr	r3, .L187
	ldr	r1, [r3]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #11
	mov	r2, r3
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	lsl	r3, r3, #9
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	add	r3, r1, r3
	str	r3, [fp, #-8]
	b	.L185
.L184:
	ldr	r3, .L187
	ldr	r1, [r3]
	ldr	r3, [fp, #-16]
	sub	r2, r3, #128
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #11
	mov	r2, r3
	ldr	r3, [fp, #-20]
	sub	r3, r3, #1
	lsl	r3, r3, #9
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	add	r3, r3, #5120
	add	r3, r1, r3
	str	r3, [fp, #-8]
.L185:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L188:
	.align	2
.L187:
	.word	image
	.size	Addr, .-Addr
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
