// File: /workspace/github_cpp_makefile_star2_O1/zvrba[P]nonogram/main.cpp
// Function: main
int main(int argc, char** argv)
{
  try {
    if (argc != 2)
      throw std::runtime_error("input file argument missing");

    std::ifstream ifs(argv[1]);
    if (!ifs)
      throw std::runtime_error("cannot open file");
    
    Description d;
    if (!(ifs >> d))
      throw std::runtime_error("cannot parse input file");
    
    std::vector<Solver::Solution> solutions;
    Solver solver(d, solutions);
    solver.solve();
    
    cout << "FOUND " << solutions.size() << " SOLUTIONS\n";
    for(size_t i = 0; i < solutions.size(); ++i) {
      cout << "\n\nSOLUTION " << i << '\n';
      print_solution(solutions[i]);
    }
  } catch (std::exception& err) {
    std::cerr << "ERROR: " << err.what() << '\n';
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
cmpl $0x2, %edi
jne 0xc592
movq 0x8(%rsi), %rsi
leaq 0xc0(%rsp), %rdi
movl $0x8, %edx
callq 0x2290
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xe0(%rsp,%rax)
jne 0xc5c6
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0xc0(%rsp), %rdi
callq 0x277b
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc5fa
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc754
leaq 0x80(%rsp), %rdi
xorl %esi, %esi
callq 0xb452
movq 0x8c15(%rip), %rdi      # 0x14fc0
leaq 0x219c(%rip), %rsi      # 0xe54e
movl $0x6, %edx
callq 0x21b0
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq 0x8be1(%rip), %rdi      # 0x14fc0
callq 0x2110
leaq 0x216a(%rip), %rsi      # 0xe555
movl $0xb, %edx
movq %rax, %rdi
callq 0x21b0
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0xc539
xorl %ebx, %ebx
movq 0x8baf(%rip), %r14      # 0x14fc0
leaq 0xf(%rsp), %r12
movl $0xb, %edx
movq %r14, %rdi
leaq 0x213c(%rip), %rsi      # 0xe561
callq 0x21b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2110
movb $0xa, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21b0
movq 0x10(%rsp), %rax
movq %rbx, 0x30(%rsp)
leaq (%rbx,%rbx,2), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rax,%rcx,8), %rax
movq %rax, 0x38(%rsp)
cmpq %rax, %rdx
je 0xc50c
movq (%rdx), %r15
movq %rdx, 0x40(%rsp)
movq 0x8(%rdx), %rax
movq %rax, 0x48(%rsp)
cmpq %rax, %r15
je 0xc4e3
xorl %eax, %eax
movq (%r15), %r13
movq 0x8(%r15), %rbx
movq %rbx, %rbp
subq %rax, %rbp
jbe 0xc4b3
movb $0x2e, 0xf(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21b0
decq %rbp
jne 0xc496
movq %rbx, %rax
movq %r13, %rbx
subq %rax, %rbx
jbe 0xc4d8
movb $0x23, 0xf(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21b0
decq %rbx
jne 0xc4bb
movq %r13, %rax
addq $0x10, %r15
cmpq 0x48(%rsp), %r15
jne 0xc487
movb $0xa, 0xf(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21b0
movq 0x40(%rsp), %rdx
addq $0x18, %rdx
cmpq 0x38(%rsp), %rdx
jne 0xc46f
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
movq 0x30(%rsp), %rbx
incq %rbx
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq %rax, %rbx
jb 0xc416
leaq 0xa8(%rsp), %rdi
callq 0xc7e2
leaq 0x90(%rsp), %rdi
callq 0xc812
leaq 0x10(%rsp), %rdi
callq 0xc7a0
leaq 0x68(%rsp), %rdi
callq 0x3e26
leaq 0x50(%rsp), %rdi
callq 0x3e26
leaq 0xc0(%rsp), %rdi
callq 0x2030
xorl %eax, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20b0
movq %rax, %r15
leaq 0x1f63(%rip), %rsi      # 0xe509
movq %rax, %rdi
callq 0x2070
movq 0x8a3b(%rip), %rsi      # 0x14ff0
movq 0x89f4(%rip), %rdx      # 0x14fb0
movq %r15, %rdi
callq 0x2250
jmp 0xc62c
movl $0x10, %edi
callq 0x20b0
movq %rax, %r15
leaq 0x1f4b(%rip), %rsi      # 0xe525
movq %rax, %rdi
callq 0x2070
movq 0x8a07(%rip), %rsi      # 0x14ff0
movq 0x89c0(%rip), %rdx      # 0x14fb0
movq %r15, %rdi
callq 0x2250
jmp 0xc62c
movl $0x10, %edi
callq 0x20b0
movq %rax, %r15
leaq 0x1f28(%rip), %rsi      # 0xe536
movq %rax, %rdi
callq 0x2070
movq 0x89d3(%rip), %rsi      # 0x14ff0
movq 0x898c(%rip), %rdx      # 0x14fb0
movq %r15, %rdi
callq 0x2250
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xc6b3
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc6c7
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xc6c7
jmp 0xc671
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xc6d4
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc6a9
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc6d4
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc6b3
jmp 0xc689
jmp 0xc689
jmp 0xc689
jmp 0xc689
movq %rdx, %r14
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xc7e2
leaq 0x90(%rsp), %rdi
callq 0xc812
leaq 0x10(%rsp), %rdi
callq 0xc7a0
leaq 0x68(%rsp), %rdi
callq 0x3e26
leaq 0x50(%rsp), %rdi
callq 0x3e26
leaq 0xc0(%rsp), %rdi
callq 0x2030
cmpl $0x1, %r14d
jne 0xc744
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
movq 0x88fc(%rip), %rdi      # 0x14fe8
leaq 0x1e7a(%rip), %rsi      # 0xe56d
movl $0x7, %edx
callq 0x21b0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x88db(%rip), %rdi      # 0x14fe8
movq %rax, %rsi
callq 0x2170
leaq 0xc0(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x21b0
callq 0x2230
movl $0x1, %eax
jmp 0xc580
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x3da2