// File: /workspace/github_cpp_makefile_star2_O1/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 0x249c
leaq 0x28(%rsp), %rdi
callq 0x2620
cmpl $0x2, %ebp
jne 0x4532
movq 0x8(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x461e
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x263c
movl %eax, %ebx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41da
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
testb %bl, %bl
jne 0x4224
movq 0x3e0b(%rip), %rbx      # 0x7ff0
leaq 0xf7c(%rip), %rsi       # 0x5168
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x3dd9(%rip), %rdi      # 0x7ff0
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movq 0x3d9d(%rip), %rbx      # 0x7fc8
leaq 0xf75(%rip), %rsi       # 0x51a7
movl $0xe, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x3d6b(%rip), %rdi      # 0x7fc8
callq 0x2030
movq %rax, %rdi
callq 0x20e0
movq 0x3d57(%rip), %r12      # 0x7fc8
leaq 0x28(%rsp), %rsi
movq %r12, %rdi
callq 0x2ec6
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq 0x78(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x465c
leaq 0x8(%rsp), %r14
movl $0x0, (%r14)
leaq 0xf0f(%rip), %rbp       # 0x51d9
movq 0x3d07(%rip), %r15      # 0x7fd8
leaq 0xe80(%rip), %r13       # 0x5158
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 0x20e0
movl $0x8, %edx
movq %r12, %rdi
leaq 0xea7(%rip), %rsi       # 0x51b6
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 0x20e0
movl $0xf, %edx
movq %r12, %rdi
leaq 0xe74(%rip), %rsi       # 0x51bf
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 0x20e0
movl $0x9, %edx
movq %r12, %rdi
leaq 0xe48(%rip), %rsi       # 0x51cf
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 0x20e0
movl $0x8, %edx
movq %r12, %rdi
movq %rbp, %rsi
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 0x20e0
movq %r15, %rdi
movq %r14, %rsi
callq 0x20c0
movl 0x8(%rsp), %eax
decl %eax
cmpl $0x3, %eax
ja 0x44e4
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movl $0x1b, %edx
movq %r12, %rdi
leaq 0xdc3(%rip), %rsi       # 0x51e2
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 0x20e0
leaq 0x78(%rsp), %rdi
callq 0x24a2
jmp 0x4523
movl $0xc, %edx
movq %r12, %rdi
leaq 0xd94(%rip), %rsi       # 0x51fe
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 0x20e0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2aea
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2ec6
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
jmp 0x4510
movl $0x9, %edx
leaq 0xd37(%rip), %rsi       # 0x520b
jmp 0x44f0
movl $0x1b, %edx
leaq 0xd00(%rip), %rsi       # 0x51e2
jmp 0x44f0
movl $0x18, %edx
leaq 0xd25(%rip), %rsi       # 0x5215
movq %r12, %rdi
callq 0x2190
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movq %r12, %rbx
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
cmpl $0x4, 0x8(%rsp)
jne 0x42d8
xorl %ebx, %ebx
jmp 0x457d
movq 0x3ab7(%rip), %rbx      # 0x7ff0
leaq 0xc46(%rip), %rsi       # 0x5186
movl $0x20, %edx
movq %rbx, %rdi
callq 0x2190
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq 0x3a85(%rip), %rdi      # 0x7ff0
callq 0x2030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x20e0
leaq 0x60(%rsp), %rdi
callq 0x4ea0
leaq 0x48(%rsp), %rdi
callq 0x35a2
leaq 0x30(%rsp), %rdi
callq 0x35a2
leaq 0xb0(%rsp), %rdi
callq 0x4ea0
leaq 0x98(%rsp), %rdi
callq 0x35a2
leaq 0x80(%rsp), %rdi
callq 0x35a2
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4602
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2180
jmp 0x4602
jmp 0x45ff
movq %rax, %rbx
jmp 0x460c
jmp 0x45ff
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x46a0
leaq 0x78(%rsp), %rdi
callq 0x46c4
movq %rbx, %rdi
callq 0x2230