// File: /workspace/github_cpp_makefile_star2_O2/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 0xb9d6(%rip), %rsi      # 0x1006f
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x40b0
leaq -0x98(%rbp), %rdi
leaq -0xa60(%rbp), %rsi
callq 0x44ec
leaq -0x98(%rbp), %rdi
callq 0x40e0
leaq -0xa60(%rbp), %rdi
callq 0x45ac
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x128e5(%rip), %r14     # 0x16fd0
leaq -0x58(%rbp), %rbx
leaq -0xf8(%rbp), %r13
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb957(%rip), %rsi      # 0x10078
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb949(%rip), %rsi      # 0x10089
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb951(%rip), %rsi      # 0x100a8
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb95c(%rip), %rsi      # 0x100ca
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb967(%rip), %rsi      # 0x100ec
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb972(%rip), %rsi      # 0x1010e
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq 0x12830(%rip), %rdi     # 0x16fe0
movq %rbx, %rsi
callq 0x41e0
movq %rbx, %rdi
leaq 0xb906(%rip), %rsi      # 0x100c8
callq 0x4aba
testb %al, %al
je 0x4808
movq %rbx, %rdi
leaq 0xb915(%rip), %rsi      # 0x100ea
callq 0x4aba
testb %al, %al
je 0x4808
movq %rbx, %rdi
leaq 0xb924(%rip), %rsi      # 0x1010c
callq 0x4aba
testb %al, %al
je 0x4808
movq %rbx, %rdi
leaq 0xb933(%rip), %rsi      # 0x1012e
callq 0x4aba
testb %al, %al
jne 0x4707
movq -0x58(%rbp), %rax
movsbl (%rax), %edx
leaq -0xb8(%rbp), %r15
movq %r15, %rdi
leaq -0x38(%rbp), %rsi
callq 0xd4a2
leaq -0x78(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x41d0
movq %r15, %rdi
callq 0x40e0
movq %r12, %rdi
leaq 0xb8ed(%rip), %rsi      # 0x10130
callq 0x4ac7
testb %al, %al
je 0x4860
movq %r14, %rdi
leaq 0xb7ae(%rip), %rsi      # 0x10004
callq 0x4180
jmp 0x49d1
movq %r12, %rdi
leaq 0xb8de(%rip), %rsi      # 0x10148
callq 0x4ac7
testb %al, %al
je 0x48e0
movq %r13, %rdi
leaq 0xb8cf(%rip), %rsi      # 0x1014c
leaq -0xb8(%rbp), %rdx
callq 0x40b0
movq %r13, %rdi
leaq -0xa60(%rbp), %r15
movq %r15, %rsi
callq 0x44ec
movq %r13, %rdi
callq 0x40e0
movq %r15, %rdi
callq 0x45ac
movq %r14, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb897(%rip), %rsi      # 0x10154
callq 0x4180
movq %rax, %r15
leaq -0x38(%rbp), %rdi
callq 0xe4a8
movq %r15, %rdi
callq 0x4240
movq %rax, %rdi
callq 0x40f0
jmp 0x494b
movq %r12, %rdi
leaq 0xb878(%rip), %rsi      # 0x10162
callq 0x4ac7
testb %al, %al
je 0x4934
leaq -0xd8(%rbp), %r12
movq %r12, %rdi
leaq 0xb863(%rip), %rsi      # 0x10167
leaq -0xb8(%rbp), %rdx
callq 0x40b0
movq %r12, %rdi
leaq -0xa60(%rbp), %r15
movq %r15, %rsi
callq 0x44ec
movq %r12, %rdi
callq 0x40e0
movq %r15, %rdi
callq 0x45ac
jmp 0x494b
movq %r12, %rdi
leaq 0xb836(%rip), %rsi      # 0x10174
callq 0x4ac7
testb %al, %al
jne 0x4a23
movq %r14, %rdi
callq 0x40f0
movq %rax, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb814(%rip), %rsi      # 0x10179
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq 0x12667(%rip), %rdi     # 0x16fe0
movq %rbx, %rsi
callq 0x41e0
movq %rbx, %rdi
leaq 0xb993(%rip), %rsi      # 0x1031e
callq 0x4aba
testb %al, %al
je 0x49a7
movq %rbx, %rdi
leaq 0xb803(%rip), %rsi      # 0x101a1
callq 0x4aba
testb %al, %al
jne 0x494b
movq %rbx, %rdi
leaq 0xb96d(%rip), %rsi      # 0x1031e
callq 0x4ac7
testb %al, %al
je 0x49fa
movq %r14, %rdi
leaq 0xb640(%rip), %rsi      # 0x10004
callq 0x4180
movq %r14, %rdi
callq 0x40f0
movq %r14, %rdi
leaq 0xb75d(%rip), %rsi      # 0x10138
callq 0x4180
movq %rax, %rdi
callq 0x40f0
movq %rax, %rdi
callq 0x40f0
movq %rax, %rdi
callq 0x40f0
jmp 0x4a0d
movq %rbx, %rdi
leaq 0xb79d(%rip), %rsi      # 0x101a1
callq 0x4ac7
testb %al, %al
jne 0x4a23
leaq -0x38(%rbp), %rdi
callq 0xd468
movq %rbx, %rdi
callq 0x40e0
jmp 0x46f6
callq 0x460e
leaq -0x38(%rbp), %rdi
callq 0xd468
leaq -0x58(%rbp), %rdi
callq 0x40e0
leaq -0x78(%rbp), %rdi
callq 0x40e0
xorl %eax, %eax
addq $0xa38, %rsp            # imm = 0xA38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a8f
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x4aad
movq %rax, %rbx
jmp 0x4ab2
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
jmp 0x4a84
jmp 0x4a8f
jmp 0x4a8f
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x40e0
jmp 0x4a92
jmp 0x4a8f
jmp 0x4a8f
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0xd468
jmp 0x4aa0
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x40e0
leaq -0x78(%rbp), %rdi
callq 0x40e0
movq %rbx, %rdi
callq 0x4280