// File: malcolmyeh[P]CC3K/main.cc
// Function: main
int main() {

	char display[27][89];
	readFile("menu.txt", display);
	printDisplay(display);
	std::string status;

	while (true) {

		std::string str;

		do {
			std::cout << std::endl << std::endl;
			std::cout << "Welcome to CC3K+" << std::endl << std::endl;
			std::cout << "Please choose a race to begin:" << std::endl;
			std::cout << "Human(140 HP, 20 Atk, 20 Def):  h" << std::endl;
			std::cout << "Elf(140 HP, 30 Atk, 10 Def):    e" << std::endl;
			std::cout << "Dwarf(100 HP, 20 Atk, 30 Def):  d" << std::endl;
			std::cout << "Orc(180 HP, 30 Atk, 25 Def):    o" << std::endl;
			std::cin >> str;
		} while(str != "h" && str != "e" && str != "d" && str != "o");
		

		char type = str[0];

		Controller c;
		status = c.runGame(type);
		
		if (status == "restart") {
			std::cout << "\033[2J\033[1;1H";
			std::cout << "Restarting Game" << std::endl << std::endl << std::endl;
			continue;
		} else if (status == "won") {
			readFile("win.txt", display);
			printDisplay(display);
			std::cout << std::endl;
			std::cout << "Final Score: " << c.getScore() << std::endl;
		} else if (status == "loss") {
			readFile("gameover.txt", display);
			printDisplay(display);
		} else if (status == "quit") {
			printEnd();
			break;
		}

		do {
			std::cout << std::endl << std::endl;
			std::cout << "Please enter r to restart or q to quit." << std::endl;
			std::cin >> str;
		} while(str != "r" && str != "q");

		if (str == "r") {
			std::cout << "\033[2J\033[1;1H";
			std::cout << std::endl;
			std::cout << "Restarting Game" << std::endl << std::endl << std::endl;
			continue;
		} else if (str == "q") {
			printEnd();
			break;
		}
	}
	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb80, %rsp            # imm = 0xB80
movl $0x0, -0x4(%rbp)
leaq -0x991(%rbp), %rdi
movq %rdi, -0xa80(%rbp)
callq 0x4300
movq -0xa80(%rbp), %rdx
leaq 0x197ec(%rip), %rsi     # 0x1e06f
leaq -0x990(%rbp), %rdi
callq 0x4270
jmp 0x4891
leaq -0x990(%rbp), %rdi
leaq -0x970(%rbp), %rsi
callq 0x45d0
jmp 0x48a6
leaq -0x990(%rbp), %rdi
callq 0x4130
leaq -0x991(%rbp), %rdi
callq 0x4200
leaq -0x970(%rbp), %rdi
callq 0x4720
leaq -0x9c8(%rbp), %rdi
callq 0x4280
jmp 0x48d8
leaq -0x9e8(%rbp), %rdi
callq 0x4280
movq 0x226e5(%rip), %rdi     # 0x26fd0
movq 0x226ce(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xa88(%rbp)
jmp 0x4900
movq -0xa88(%rbp), %rdi
movq 0x226b2(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4915
movq 0x226b4(%rip), %rdi     # 0x26fd0
leaq 0x19755(%rip), %rsi     # 0x1e078
callq 0x41c0
movq %rax, -0xa90(%rbp)
jmp 0x4931
movq -0xa90(%rbp), %rdi
movq 0x22681(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xa98(%rbp)
jmp 0x494d
movq -0xa98(%rbp), %rdi
movq 0x22665(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4962
movq 0x22667(%rip), %rdi     # 0x26fd0
leaq 0x19719(%rip), %rsi     # 0x1e089
callq 0x41c0
movq %rax, -0xaa0(%rbp)
jmp 0x497e
movq -0xaa0(%rbp), %rdi
movq 0x22634(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4993
movq 0x22636(%rip), %rdi     # 0x26fd0
leaq 0x19707(%rip), %rsi     # 0x1e0a8
callq 0x41c0
movq %rax, -0xaa8(%rbp)
jmp 0x49af
movq -0xaa8(%rbp), %rdi
movq 0x22603(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x49c4
movq 0x22605(%rip), %rdi     # 0x26fd0
leaq 0x196f8(%rip), %rsi     # 0x1e0ca
callq 0x41c0
movq %rax, -0xab0(%rbp)
jmp 0x49e0
movq -0xab0(%rbp), %rdi
movq 0x225d2(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x49f5
movq 0x225d4(%rip), %rdi     # 0x26fd0
leaq 0x196e9(%rip), %rsi     # 0x1e0ec
callq 0x41c0
movq %rax, -0xab8(%rbp)
jmp 0x4a11
movq -0xab8(%rbp), %rdi
movq 0x225a1(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4a26
movq 0x225a3(%rip), %rdi     # 0x26fd0
leaq 0x196da(%rip), %rsi     # 0x1e10e
callq 0x41c0
movq %rax, -0xac0(%rbp)
jmp 0x4a42
movq -0xac0(%rbp), %rdi
movq 0x22570(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4a57
movq 0x22582(%rip), %rdi     # 0x26fe0
leaq -0x9e8(%rbp), %rsi
callq 0x4230
jmp 0x4a6c
jmp 0x4a6e
leaq 0x19653(%rip), %rsi     # 0x1e0c8
leaq -0x9e8(%rbp), %rdi
callq 0x51d0
movb %al, -0xac1(%rbp)
jmp 0x4a89
movb -0xac1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xac2(%rbp)
jne 0x4aa1
jmp 0x4b2a
leaq 0x19642(%rip), %rsi     # 0x1e0ea
leaq -0x9e8(%rbp), %rdi
callq 0x51d0
movb %al, -0xac3(%rbp)
jmp 0x4abc
movb -0xac3(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xac2(%rbp)
jne 0x4ad1
jmp 0x4b2a
leaq 0x19634(%rip), %rsi     # 0x1e10c
leaq -0x9e8(%rbp), %rdi
callq 0x51d0
movb %al, -0xac4(%rbp)
jmp 0x4aec
movb -0xac4(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xac2(%rbp)
jne 0x4b01
jmp 0x4b2a
leaq 0x19626(%rip), %rsi     # 0x1e12e
leaq -0x9e8(%rbp), %rdi
callq 0x51d0
movb %al, -0xac5(%rbp)
jmp 0x4b1c
movb -0xac5(%rbp), %al
movb %al, -0xac2(%rbp)
jmp 0x4b2a
movb -0xac2(%rbp), %al
testb $0x1, %al
jne 0x48e4
xorl %eax, %eax
movl %eax, %esi
leaq -0x9e8(%rbp), %rdi
callq 0x4340
movq %rax, -0xad0(%rbp)
jmp 0x4b51
movq -0xad0(%rbp), %rax
movb (%rax), %al
movb %al, -0x9e9(%rbp)
leaq -0xa00(%rbp), %rdi
callq 0x5200
jmp 0x4b6e
movsbl -0x9e9(%rbp), %edx
leaq -0xa20(%rbp), %rdi
leaq -0xa00(%rbp), %rsi
callq 0x18e80
jmp 0x4b8a
leaq -0x9c8(%rbp), %rdi
movq %rdi, -0xae0(%rbp)
leaq -0xa20(%rbp), %rsi
movq %rsi, -0xae8(%rbp)
callq 0x4220
movq -0xae8(%rbp), %rdi
callq 0x4130
movq -0xae0(%rbp), %rdi
leaq 0x1956b(%rip), %rsi     # 0x1e130
callq 0x5210
movb %al, -0xad1(%rbp)
jmp 0x4bd2
movb -0xad1(%rbp), %al
testb $0x1, %al
jne 0x4be1
jmp 0x4cdf
movq 0x223e8(%rip), %rdi     # 0x26fd0
leaq 0x19415(%rip), %rsi     # 0x1e004
callq 0x41c0
jmp 0x4bf6
movq 0x223d3(%rip), %rdi     # 0x26fd0
leaq 0x19534(%rip), %rsi     # 0x1e138
callq 0x41c0
movq %rax, -0xaf0(%rbp)
jmp 0x4c12
movq -0xaf0(%rbp), %rdi
movq 0x223a0(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xaf8(%rbp)
jmp 0x4c2e
movq -0xaf8(%rbp), %rdi
movq 0x22384(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xb00(%rbp)
jmp 0x4c4a
movq -0xb00(%rbp), %rdi
movq 0x22368(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4c5f
movl $0x2, -0xa24(%rbp)
jmp 0x5144
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
jmp 0x4ca0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
leaq -0x990(%rbp), %rdi
callq 0x4130
leaq -0x991(%rbp), %rdi
callq 0x4200
jmp 0x51c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
jmp 0x5192
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
jmp 0x5186
leaq 0x19462(%rip), %rsi     # 0x1e148
leaq -0x9c8(%rbp), %rdi
callq 0x5210
movb %al, -0xb01(%rbp)
jmp 0x4cfa
movb -0xb01(%rbp), %al
testb $0x1, %al
jne 0x4d09
jmp 0x4e34
leaq -0xa49(%rbp), %rdi
movq %rdi, -0xb10(%rbp)
callq 0x4300
movq -0xb10(%rbp), %rdx
leaq 0x19422(%rip), %rsi     # 0x1e14c
leaq -0xa48(%rbp), %rdi
callq 0x4270
jmp 0x4d38
leaq -0xa48(%rbp), %rdi
leaq -0x970(%rbp), %rsi
callq 0x45d0
jmp 0x4d4d
leaq -0xa48(%rbp), %rdi
callq 0x4130
leaq -0xa49(%rbp), %rdi
callq 0x4200
leaq -0x970(%rbp), %rdi
callq 0x4720
jmp 0x4d73
movq 0x22256(%rip), %rdi     # 0x26fd0
movq 0x2223f(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4d88
movq 0x22241(%rip), %rdi     # 0x26fd0
leaq 0x193be(%rip), %rsi     # 0x1e154
callq 0x41c0
movq %rax, -0xb18(%rbp)
jmp 0x4da4
leaq -0xa00(%rbp), %rdi
callq 0x1ae20
movsd %xmm0, -0xb20(%rbp)
jmp 0x4dba
movsd -0xb20(%rbp), %xmm0
movq -0xb18(%rbp), %rdi
callq 0x4310
movq %rax, -0xb28(%rbp)
jmp 0x4dd7
movq -0xb28(%rbp), %rdi
movq 0x221db(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4dec
jmp 0x4f51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
jmp 0x4e23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
leaq -0xa48(%rbp), %rdi
callq 0x4130
leaq -0xa49(%rbp), %rdi
callq 0x4200
jmp 0x5186
leaq 0x19327(%rip), %rsi     # 0x1e162
leaq -0x9c8(%rbp), %rdi
callq 0x5210
movb %al, -0xb29(%rbp)
jmp 0x4e4f
movb -0xb29(%rbp), %al
testb $0x1, %al
jne 0x4e5e
jmp 0x4f10
leaq -0xa71(%rbp), %rdi
movq %rdi, -0xb38(%rbp)
callq 0x4300
movq -0xb38(%rbp), %rdx
leaq 0x192e8(%rip), %rsi     # 0x1e167
leaq -0xa70(%rbp), %rdi
callq 0x4270
jmp 0x4e8d
leaq -0xa70(%rbp), %rdi
leaq -0x970(%rbp), %rsi
callq 0x45d0
jmp 0x4ea2
leaq -0xa70(%rbp), %rdi
callq 0x4130
leaq -0xa71(%rbp), %rdi
callq 0x4200
leaq -0x970(%rbp), %rdi
callq 0x4720
jmp 0x4ec8
jmp 0x4f4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
jmp 0x4eff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x9a0(%rbp)
movl %eax, -0x9a4(%rbp)
leaq -0xa70(%rbp), %rdi
callq 0x4130
leaq -0xa71(%rbp), %rdi
callq 0x4200
jmp 0x5186
leaq 0x1925d(%rip), %rsi     # 0x1e174
leaq -0x9c8(%rbp), %rdi
callq 0x5210
movb %al, -0xb39(%rbp)
jmp 0x4f2b
movb -0xb39(%rbp), %al
testb $0x1, %al
jne 0x4f37
jmp 0x4f4d
callq 0x47b0
jmp 0x4f3e
movl $0x3, -0xa24(%rbp)
jmp 0x5144
jmp 0x4f4f
jmp 0x4f51
jmp 0x4f53
jmp 0x4f55
movq 0x22074(%rip), %rdi     # 0x26fd0
movq 0x2205d(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xb48(%rbp)
jmp 0x4f71
movq -0xb48(%rbp), %rdi
movq 0x22041(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4f86
movq 0x22043(%rip), %rdi     # 0x26fd0
leaq 0x191e5(%rip), %rsi     # 0x1e179
callq 0x41c0
movq %rax, -0xb50(%rbp)
jmp 0x4fa2
movq -0xb50(%rbp), %rdi
movq 0x22010(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x4fb7
movq 0x22022(%rip), %rdi     # 0x26fe0
leaq -0x9e8(%rbp), %rsi
callq 0x4230
jmp 0x4fcc
jmp 0x4fce
leaq 0x192c9(%rip), %rsi     # 0x1e29e
leaq -0x9e8(%rbp), %rdi
callq 0x51d0
movb %al, -0xb51(%rbp)
jmp 0x4fe9
movb -0xb51(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xb52(%rbp)
jne 0x4ffe
jmp 0x5027
leaq 0x1919c(%rip), %rsi     # 0x1e1a1
leaq -0x9e8(%rbp), %rdi
callq 0x51d0
movb %al, -0xb53(%rbp)
jmp 0x5019
movb -0xb53(%rbp), %al
movb %al, -0xb52(%rbp)
jmp 0x5027
movb -0xb52(%rbp), %al
testb $0x1, %al
jne 0x4f55
leaq 0x19262(%rip), %rsi     # 0x1e29e
leaq -0x9e8(%rbp), %rdi
callq 0x5210
movb %al, -0xb54(%rbp)
jmp 0x5050
movb -0xb54(%rbp), %al
testb $0x1, %al
jne 0x505f
jmp 0x50fe
movq 0x21f6a(%rip), %rdi     # 0x26fd0
leaq 0x18f97(%rip), %rsi     # 0x1e004
callq 0x41c0
jmp 0x5074
movq 0x21f55(%rip), %rdi     # 0x26fd0
movq 0x21f3e(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x5089
movq 0x21f40(%rip), %rdi     # 0x26fd0
leaq 0x190a1(%rip), %rsi     # 0x1e138
callq 0x41c0
movq %rax, -0xb60(%rbp)
jmp 0x50a5
movq -0xb60(%rbp), %rdi
movq 0x21f0d(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xb68(%rbp)
jmp 0x50c1
movq -0xb68(%rbp), %rdi
movq 0x21ef1(%rip), %rsi     # 0x26fc0
callq 0x41f0
movq %rax, -0xb70(%rbp)
jmp 0x50dd
movq -0xb70(%rbp), %rdi
movq 0x21ed5(%rip), %rsi     # 0x26fc0
callq 0x41f0
jmp 0x50f2
movl $0x2, -0xa24(%rbp)
jmp 0x5144
leaq 0x1909c(%rip), %rsi     # 0x1e1a1
leaq -0x9e8(%rbp), %rdi
callq 0x5210
movb %al, -0xb71(%rbp)
jmp 0x5119
movb -0xb71(%rbp), %al
testb $0x1, %al
jne 0x5125
jmp 0x5138
callq 0x47b0
jmp 0x512c
movl $0x3, -0xa24(%rbp)
jmp 0x5144
jmp 0x513a
movl $0x0, -0xa24(%rbp)
leaq -0xa00(%rbp), %rdi
callq 0x18e20
leaq -0x9e8(%rbp), %rdi
callq 0x4130
movl -0xa24(%rbp), %eax
movl %eax, -0xb78(%rbp)
testl %eax, %eax
je 0x5181
jmp 0x516e
movl -0xb78(%rbp), %eax
subl $0x2, %eax
je 0x48d6
jmp 0x517f
jmp 0x51ac
jmp 0x48d6
leaq -0xa00(%rbp), %rdi
callq 0x18e20
leaq -0x9e8(%rbp), %rdi
callq 0x4130
leaq -0x9c8(%rbp), %rdi
callq 0x4130
jmp 0x51c4
leaq -0x9c8(%rbp), %rdi
callq 0x4130
movl -0x4(%rbp), %eax
addq $0xb80, %rsp            # imm = 0xB80
popq %rbp
retq
movq -0x9a0(%rbp), %rdi
callq 0x42f0