// File: /workspace/github_cpp_makefile_star2_O2/Razakhel[P]RaZonogram/main.cpp
// Function: main
int main(int argc, char* argv[]) {
  Game game;
  Grid grid;

  if (argc == 2) {
    if (!grid.loadFromFile(argv[1]))
      std::cerr << "Error while opening the file." << std::endl;
  } else {
    std::cerr << "No input file provided, exiting." << std::endl;
    return 1;
  }

  std::cout << "Original grid:" << std::endl;
  std::cout << grid << std::endl;
  game.setGrid(grid);

  int choice = 0;

  do {
    std::cout << std::endl;
    std::cout << "1 - Play" << std::endl;
    std::cout << "2 - How to play" << std::endl;
    std::cout << "3 - Solve" << std::endl;
    std::cout << "4 - Quit" << std::endl;
    std::cin >> choice;

    if (choice == 1) { // Playing the game
      std::cout << "Implementation in progress." << std::endl;
      game.play();
    } else if (choice == 2) { // Printing the game explanations
      std::cout << "Implementation in progress." << std::endl;
    } else if (choice == 3) { // Solving the grid
      std::cout << "Solved grid:" << std::endl << grid.solve() << std::endl;
    } else if (choice == 4) { // Exiting the game
      std::cout << "Bye then!" << std::endl;
    } else { // Number entered nonexistant
      std::cout << "Wrong choice, try again." << std::endl;
    }
  } while (choice != 4);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x78(%rsp), %rdi
callq 0x23ec
leaq 0x28(%rsp), %rdi
callq 0x24d4
cmpl $0x2, %ebp
jne 0x3e45
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x3ec2
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x24ee
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x2090
testb %bl, %bl
jne 0x3cd8
movq 0x432c(%rip), %rdi      # 0x7ff0
leaq 0x1475(%rip), %rsi      # 0x5140
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq 0x42e9(%rip), %rdi      # 0x7fc8
leaq 0x1499(%rip), %rsi      # 0x517f
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq 0x42ce(%rip), %rdi      # 0x7fc8
leaq 0x28(%rsp), %rsi
callq 0x2aea
movq %rax, %rdi
callq 0x20a0
leaq 0x78(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x3f22
leaq 0x8(%rsp), %rbx
andl $0x0, (%rbx)
movq 0x429e(%rip), %r14      # 0x7fc8
movq 0x42a7(%rip), %r15      # 0x7fd8
leaq 0x1482(%rip), %r12      # 0x51ba
leaq 0x13f1(%rip), %rbp      # 0x5130
movq %r14, %rdi
callq 0x20a0
movq %r14, %rdi
leaq 0x143d(%rip), %rsi      # 0x518e
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %r14, %rdi
leaq 0x142f(%rip), %rsi      # 0x5197
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %r14, %rdi
leaq 0x1428(%rip), %rsi      # 0x51a7
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %r14, %rdi
leaq 0x141b(%rip), %rsi      # 0x51b1
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20c0
movl 0x8(%rsp), %eax
decl %eax
cmpl $0x3, %eax
ja 0x3e1f
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
movq %r12, %rsi
jmpq *%rax
movq %r14, %rdi
movq %r12, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
leaq 0x78(%rsp), %rdi
callq 0x23f2
jmp 0x3e36
movq %r14, %rdi
leaq 0x13e7(%rip), %rsi      # 0x51d6
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rax, %r13
leaq 0x28(%rsp), %rdi
callq 0x2860
movq %r13, %rdi
movq %rax, %rsi
callq 0x2aea
jmp 0x3e2e
leaq 0x13c6(%rip), %rsi      # 0x51e3
jmp 0x3e26
leaq 0x13c7(%rip), %rsi      # 0x51ed
movq %r14, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
cmpl $0x4, 0x8(%rsp)
jne 0x3d3f
xorl %ebx, %ebx
jmp 0x3e63
movq 0x41a4(%rip), %rdi      # 0x7ff0
leaq 0x130b(%rip), %rsi      # 0x515e
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %rbx
leaq 0x28(%rsp), %rdi
callq 0x3efe
leaq 0x78(%rsp), %rdi
callq 0x3efe
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2090
jmp 0x3ea6
jmp 0x3ea3
movq %rax, %rbx
jmp 0x3eb0
jmp 0x3ea3
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3efe
leaq 0x78(%rsp), %rdi
callq 0x3efe
movq %rbx, %rdi
callq 0x2240