// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa38, %rsp            # imm = 0xA38
leaq -0xc8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1886a(%rip), %rsi     # 0x1d06f
leaq 0x1886b(%rip), %rdx     # 0x1d077
leaq -0xd8(%rbp), %rbx
movq %rbx, %rdi
callq 0x501a
leaq -0xa60(%rbp), %rsi
movq %rbx, %rdi
callq 0x450c
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x4845
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0xa60(%rbp), %rdi
callq 0x4604
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x1f762(%rip), %r14     # 0x23fd0
movq 0x1f76b(%rip), %r13     # 0x23fe0
leaq -0x48(%rbp), %rbx
leaq 0x18aca(%rip), %r15     # 0x1d34a
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x10, %edx
movq %r14, %rdi
leaq 0x18784(%rip), %rsi     # 0x1d078
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x1e, %edx
movq %r14, %rdi
leaq 0x18730(%rip), %rsi     # 0x1d089
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x21, %edx
movq %r14, %rdi
leaq 0x18714(%rip), %rsi     # 0x1d0a8
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x21, %edx
movq %r14, %rdi
leaq 0x186fb(%rip), %rsi     # 0x1d0ca
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x21, %edx
movq %r14, %rdi
leaq 0x186e2(%rip), %rsi     # 0x1d0ec
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x21, %edx
movq %r14, %rdi
leaq 0x186c9(%rip), %rsi     # 0x1d10e
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x41d0
movq %rbx, %rdi
leaq 0x18642(%rip), %rsi     # 0x1d0c8
callq 0x4070
testl %eax, %eax
je 0x4acc
movq %rbx, %rdi
leaq 0x18651(%rip), %rsi     # 0x1d0ea
callq 0x4070
testl %eax, %eax
je 0x4acc
movq %rbx, %rdi
leaq 0x18660(%rip), %rsi     # 0x1d10c
callq 0x4070
testl %eax, %eax
je 0x4acc
movq %rbx, %rdi
leaq 0x1866f(%rip), %rsi     # 0x1d12e
callq 0x4070
testl %eax, %eax
jne 0x4894
movq -0x48(%rbp), %rax
movsbl (%rax), %edx
leaq -0xf8(%rbp), %r12
movq %r12, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x17360
leaq -0xa8(%rbp), %rdi
movq %r12, %rsi
callq 0x41c0
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x4b1a
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
leaq 0x18605(%rip), %rsi     # 0x1d130
callq 0x4070
testl %eax, %eax
je 0x4b7e
movq %r12, %rdi
leaq 0x1860a(%rip), %rsi     # 0x1d148
callq 0x4070
testl %eax, %eax
je 0x4c13
movq %r12, %rdi
leaq 0x1860d(%rip), %rsi     # 0x1d162
callq 0x4070
testl %eax, %eax
je 0x4ced
movq %r12, %rdi
leaq 0x18608(%rip), %rsi     # 0x1d174
callq 0x4070
testl %eax, %eax
jne 0x4d43
jmp 0x4e26
movl $0xa, %edx
movq %r14, %rdi
leaq 0x18477(%rip), %rsi     # 0x1d004
callq 0x41a0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x18597(%rip), %rsi     # 0x1d138
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
jmp 0x4eea
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %r12
movq %r12, %rdi
leaq 0x1851d(%rip), %rsi     # 0x1d14c
leaq 0x1851d(%rip), %rdx     # 0x1d153
callq 0x501a
movq %r12, %rdi
leaq -0xa60(%rbp), %rsi
callq 0x450c
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4c66
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0xa60(%rbp), %rdi
callq 0x4604
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0xd, %edx
movq %r14, %rdi
leaq 0x184ac(%rip), %rsi     # 0x1d154
callq 0x41a0
leaq -0xb8(%rbp), %rdi
callq 0x18dec
movq %r14, %rdi
callq 0x4210
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
jmp 0x4d43
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %r12
movq %r12, %rdi
leaq 0x18464(%rip), %rsi     # 0x1d167
leaq 0x18469(%rip), %rdx     # 0x1d173
callq 0x501a
movq %r12, %rdi
leaq -0xa60(%rbp), %rsi
callq 0x450c
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4d37
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x4170
leaq -0xa60(%rbp), %rdi
callq 0x4604
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0x27, %edx
movq %r14, %rdi
leaq 0x183d6(%rip), %rsi     # 0x1d179
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x41d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4070
testl %eax, %eax
je 0x4e00
movq %rbx, %rdi
leaq 0x183ae(%rip), %rsi     # 0x1d1a1
callq 0x4070
testl %eax, %eax
jne 0x4d43
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4070
testl %eax, %eax
je 0x4e33
movq %rbx, %rdi
leaq 0x18388(%rip), %rsi     # 0x1d1a1
callq 0x4070
testl %eax, %eax
jne 0x4efd
movb $0x1, %r12b
callq 0x469e
jmp 0x4f00
movl $0xa, %edx
movq %r14, %rdi
leaq 0x181c2(%rip), %rsi     # 0x1d004
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x182bb(%rip), %rsi     # 0x1d138
callq 0x41a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4150
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x40e0
xorl %r12d, %r12d
leaq -0xb8(%rbp), %rdi
callq 0x1731c
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4f25
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
testb %r12b, %r12b
je 0x4880
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x4f50
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x4170
xorl %eax, %eax
addq $0xa38, %rsp            # imm = 0xA38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x5011
movq -0xc8(%rbp), %rsi
jmp 0x5009
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4fc5
movq -0x58(%rbp), %rsi
jmp 0x4fb4
jmp 0x4fc2
jmp 0x4fc2
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4fc5
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4170
jmp 0x4fc5
jmp 0x4fc2
jmp 0x4fc2
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x1731c
jmp 0x4fd6
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4fef
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x4170
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x5011
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x4170
movq %rbx, %rdi
callq 0x4250
nop