// File: chulchultrain[P]FactoryHead/BattleSim/BattleSim.cpp
// Function: BattleSim::Menu(std::ostream&, std::istream&, std::ostream&)
void BattleSim::Menu(ostream &pout, istream &fin, ostream &fout) {
	string option;
	str_code sc = INITCODE;
	while(sc != EXIT) {	
		pout << "Enter Choice: SETCRITERIA,EVALUATECRITERIA,SETPARTICIPANTS\n";
		pout << "PRINTCRITERIA, PRINTCANDIDATES, PRINTPARTICIPANTS, SIMULATE\n";
		pout << "RETRIEVERESULTS\n";
		getline(fin,option);
	
		sc = HashString(option);
		//TODO: EVALUATE CRITERIA OPTION, print results option
		switch(sc) {
			case SETCRITERIA:
				SetCriteria(pout,fin); break;
			case EVALUATECRITERIA:
				EvaluateCriteria(pout,fin); break;
			case SETPARTICIPANTS:
				SetParticipants(pout,fin); break;
			case PRINTCRITERIA:
				PrintCriteria(pout,fin); break;
			case PRINTCANDIDATES:
				PrintCandidates(pout,fin); break;
			case PRINTPARTICIPANTS:
				PrintParticipants(pout); break;
			case SIMULATE:
				Simulate(pout,fin,fout); break;
			case RETRIEVERESULTS:
				RetrieveResults(pout,fin,fout); break; 
			case EXIT: break;
			default:
				pout << "Invalid Choice\n";

		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3360
movl $0x0, -0x44(%rbp)
cmpl $0xd, -0x44(%rbp)
je 0x24491
movq -0x10(%rbp), %rdi
leaq 0xafdc(%rip), %rsi      # 0x2f2d4
callq 0x3220
jmp 0x242ff
movq -0x10(%rbp), %rdi
leaq 0xb006(%rip), %rsi      # 0x2f310
callq 0x3220
jmp 0x24311
movq -0x10(%rbp), %rdi
leaq 0xb031(%rip), %rsi      # 0x2f34d
callq 0x3220
jmp 0x24323
movq -0x18(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3080
jmp 0x24332
leaq -0x78(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3100
jmp 0x24341
movq -0x80(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x244c0
movl %eax, -0x84(%rbp)
jmp 0x24356
movl -0x84(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3180
movl -0x44(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x90(%rbp)
subl $0xc, %eax
ja 0x24478
movq -0x90(%rbp), %rax
leaq 0xaeff(%rip), %rcx      # 0x2f28c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x244a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3180
jmp 0x244a3
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x246c0
jmp 0x243d4
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x247a0
jmp 0x243ec
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x24870
jmp 0x24404
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x24940
jmp 0x2441c
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x24a10
jmp 0x24431
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x24ae0
jmp 0x24442
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x24b90
jmp 0x2445b
jmp 0x2448c
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x24cb0
jmp 0x24474
jmp 0x2448c
jmp 0x2448c
movq -0x10(%rbp), %rdi
leaq 0xaedb(%rip), %rsi      # 0x2f35e
callq 0x3220
jmp 0x2448a
jmp 0x2448c
jmp 0x242e3
leaq -0x40(%rbp), %rdi
callq 0x3180
addq $0x90, %rsp
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x3180
movq -0x50(%rbp), %rdi
callq 0x3410
nopw %cs:(%rax,%rax)