// File: /workspace/github_cpp_makefile_star2_O1/Juan313[P]RockPaperScissor/play_game.cpp
// Function: main
int main()
{
// human tool choice
  char humanChoice; 
// computer tool choice
  char computerChoice; 
  RPSGame* game;
/*******************************
   hr: human rock strength
   hp: human paper strength
   hs: human scissor strength
   cr: computer rock strength
   cp: computer paper strength
   cs: computer scissor strength
**********************************************************/
  int hr,hp,hs,cr,cp,cs;

  // 'n' if the strength for all the tools are 1; 'y' if use customized strength 
  char strengthChoice = Menu::customizeStrength();

  if (strengthChoice =='y')
  {
    // initialized game with all customized strength 
    Menu::getStrength(hr,hp,hs,cr,cp,cs);
    game = new RPSGame(hr,hp,hs,cr,cp,cs);
    std::cout<<"initialized game with customized strength "<<std::endl;
    
    std::cout<<"human rock strength is "<<hr <<std::endl;
    std::cout<<"human paper strength is "<<hp <<std::endl;
    std::cout<<"human scissor strength is "<<hs <<std::endl;
    std::cout<<"computer rock strength is "<<cr <<std::endl;
    std::cout<<"computer paper strength is "<<cp <<std::endl;
    std::cout<<"computer scissor strength is "<<cs <<std::endl;
  }
  else 
  {
    // initialized game with all tools strength equal to 1
    game = new RPSGame(1,1,1,1,1,1);
    std::cout<<"initialized game with all tools strength equal to 1"<<std::endl;
  }

  humanChoice = Menu::getChoice();
  while (humanChoice != 'e') 
  {
    std::string toolName;
    computerChoice = game->computerChoice();
    toolName = getFullName(computerChoice);
    std::cout<<"Computer chose "<<toolName<<std::endl;
    int result = game->play(humanChoice, computerChoice);
    //std::cout << "RESULT: " << result << std::endl;
    if (result == 1) 
    { 
      std::cout<<"Human wins!"<<std::endl; 
    }
    if (result == 2) 
    { 
      std::cout<<"Computer wins!"<<std::endl; 
    }
    if (result == 3) 
    { 
      std::cout<<"It's a tie!"<<std::endl; 
    }
    // display score so far. Need to interface with RPSGame
    game->print_stats();
    humanChoice = Menu::getChoice();
    
  }
  std::cout<<"Thanks for playing. Goodbye! "<<std::endl;
  delete game;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
callq 0x3554
cmpb $0x79, %al
jne 0x3a37
leaq 0x24(%rsp), %r14
leaq 0x20(%rsp), %r15
leaq 0x1c(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0x14(%rsp), %rbp
leaq 0x10(%rsp), %r9
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x362d
movl $0x48, %edi
callq 0x2170
movq %rax, %rbx
movl (%r14), %esi
movl (%r15), %edx
movl (%r12), %ecx
movl (%r13), %r8d
movl (%rbp), %r9d
leaq 0x10(%rsp), %rax
movl (%rax), %eax
movl %eax, (%rsp)
movq %rbx, %rdi
callq 0x271e
movq 0x376b(%rip), %r14      # 0x6fd0
leaq 0xa55(%rip), %rsi       # 0x42c1
movl $0x2a, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0xa45(%rip), %rsi       # 0x42ec
movl $0x17, %edx
movq %r14, %rdi
callq 0x2190
movl 0x24(%rsp), %esi
movq %r14, %rdi
callq 0x2230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0xa13(%rip), %rsi       # 0x4304
movl $0x18, %edx
movq %r14, %rdi
callq 0x2190
movl 0x20(%rsp), %esi
movq %r14, %rdi
callq 0x2230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x9e2(%rip), %rsi       # 0x431d
movl $0x1a, %edx
movq %r14, %rdi
callq 0x2190
movl 0x1c(%rsp), %esi
movq %r14, %rdi
callq 0x2230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x9b3(%rip), %rsi       # 0x4338
movl $0x1a, %edx
movq %r14, %rdi
callq 0x2190
movl 0x18(%rsp), %esi
movq %r14, %rdi
callq 0x2230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x984(%rip), %rsi       # 0x4353
movl $0x1b, %edx
movq %r14, %rdi
callq 0x2190
movl 0x14(%rsp), %esi
movq %r14, %rdi
callq 0x2230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x956(%rip), %rsi       # 0x436f
movl $0x1d, %edx
movq %r14, %rdi
callq 0x2190
movl 0x10(%rsp), %esi
movq %r14, %rdi
callq 0x2230
movq %rax, %r14
jmp 0x3a89
movl $0x48, %edi
callq 0x2170
movq %rax, %rbx
movl $0x1, (%rsp)
movq %rax, %rdi
movl $0x1, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x271e
movq 0x355b(%rip), %r14      # 0x6fd0
leaq 0x911(%rip), %rsi       # 0x438d
movl $0x33, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
callq 0x378b
cmpb $0x65, %al
je 0x3c93
movl %eax, %ebp
leaq 0x48(%rsp), %r14
movq 0x3505(%rip), %r12      # 0x6fd0
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %rbx, %rdi
callq 0x26a0
movsbl %al, %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x3d35
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x21b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3b23
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2180
movl $0xf, %edx
movq %r12, %rdi
leaq 0x88f(%rip), %rsi       # 0x43c1
callq 0x2190
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x2190
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movsbl %bpl, %esi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x289a
movl %eax, %ebp
cmpl $0x3, %eax
je 0x3c22
cmpl $0x2, %ebp
je 0x3be1
cmpl $0x1, %ebp
jne 0x3c5e
movl $0xb, %edx
movq %r12, %rdi
leaq 0x827(%rip), %rsi       # 0x43d1
callq 0x2190
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
cmpl $0x3, %ebp
je 0x3c22
cmpl $0x2, %ebp
jne 0x3c5e
movl $0xe, %edx
movq %r12, %rdi
leaq 0x7ed(%rip), %rsi       # 0x43dd
callq 0x2190
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
cmpl $0x3, %ebp
jne 0x3c5e
movl $0xb, %edx
movq %r12, %rdi
leaq 0x7bb(%rip), %rsi       # 0x43ec
callq 0x2190
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x294a
callq 0x378b
movl %eax, %ebp
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3c89
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2180
cmpb $0x65, %bpl
jne 0x3acb
movq 0x3336(%rip), %r14      # 0x6fd0
leaq 0x757(%rip), %rsi       # 0x43f8
movl $0x1d, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x283a
movl $0x48, %esi
movq %rbx, %rdi
callq 0x2180
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3cfd
movq %rax, %r14
movl $0x48, %esi
movq %rbx, %rdi
jmp 0x3d28
jmp 0x3d0e
jmp 0x3d0e
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3d2d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2180
movq %r14, %rdi
callq 0x2240