// File: /workspace/github_cpp_makefile_star2_O2/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 0xbc98
movq 0x8(%rsi), %rsi
leaq 0xc0(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2270
movq 0xc0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xe0(%rsp,%rax)
jne 0xbcca
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0xc0(%rsp), %rdi
callq 0x2616
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xbcfc
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xbe30
leaq 0x80(%rsp), %rdi
callq 0xbe7c
movq 0xa4b6(%rip), %rdi      # 0x15fc0
leaq 0x1a97(%rip), %rsi      # 0xd5a8
callq 0x2160
movq %rax, %rdi
movq 0x8(%rsp), %rax
subq (%rsp), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %rsi
callq 0x2120
leaq 0x1a76(%rip), %rsi      # 0xd5af
movq %rax, %rdi
callq 0x2160
xorl %ebx, %ebx
movq 0xa476(%rip), %r14      # 0x15fc0
pushq $0x2e
popq %r13
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rax, %rbx
jae 0xbc65
movq %r14, %rdi
leaq 0x1a49(%rip), %rsi      # 0xd5bb
callq 0x2160
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2120
movq %rax, %rdi
pushq $0xa
popq %rsi
callq 0x21a0
movq (%rsp), %rax
imulq $0x18, %rbx, %rcx
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rax
movq %rax, 0x28(%rsp)
movq %rbx, 0x20(%rsp)
cmpq 0x28(%rsp), %rdx
je 0xbc5d
movq (%rdx), %r12
movq %rdx, 0x30(%rsp)
movq 0x8(%rdx), %rax
movq %rax, 0x38(%rsp)
xorl %r15d, %r15d
cmpq 0x38(%rsp), %r12
je 0xbc3f
movq 0x8(%r12), %rbp
cmpq %rbp, %r15
movq %r12, %rax
movq %rbp, %r12
cmovaq %r15, %r12
movq %rax, 0x48(%rsp)
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq %r12, %rbx
subq %r15, %rbx
subq $0x1, %rbx
jb 0xbc06
movq %r14, %rdi
movl %r13d, %esi
callq 0x21a0
jmp 0xbbf3
movq 0x40(%rsp), %rax
cmpq %rax, %r15
cmovbeq %rax, %r15
cmpq %rbp, %r15
cmovbeq %rbp, %r15
movq %r15, %rbp
subq %r12, %rbp
pushq $0x23
popq %rbx
movq 0x48(%rsp), %r12
subq $0x1, %rbp
jb 0xbc39
movq %r14, %rdi
movl %ebx, %esi
callq 0x21a0
jmp 0xbc27
addq $0x10, %r12
jmp 0xbbc7
movq %r14, %rdi
pushq $0xa
popq %rsi
callq 0x21a0
movq 0x30(%rsp), %rdx
addq $0x18, %rdx
movq 0x20(%rsp), %rbx
jmp 0xbba8
incq %rbx
jmp 0xbb4e
leaq 0x80(%rsp), %rdi
callq 0xbe84
movq %rsp, %rdi
callq 0xbe9e
leaq 0x50(%rsp), %rdi
callq 0x3274
leaq 0xc0(%rsp), %rdi
callq 0x2030
xorl %eax, %eax
jmp 0xbe06
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r15
leaq 0x18b9(%rip), %rsi      # 0xd563
movq %rax, %rdi
callq 0x2070
movq 0xa337(%rip), %rsi      # 0x15ff0
movq 0xa2f0(%rip), %rdx      # 0x15fb0
movq %r15, %rdi
callq 0x2240
jmp 0xbd2c
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r15
leaq 0x18a3(%rip), %rsi      # 0xd57f
movq %rax, %rdi
callq 0x2070
movq 0xa305(%rip), %rsi      # 0x15ff0
movq 0xa2be(%rip), %rdx      # 0x15fb0
movq %r15, %rdi
callq 0x2240
jmp 0xbd2c
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r15
leaq 0x1882(%rip), %rsi      # 0xd590
movq %rax, %rdi
callq 0x2070
movq 0xa2d3(%rip), %rsi      # 0x15ff0
movq 0xa28c(%rip), %rdx      # 0x15fb0
movq %r15, %rdi
callq 0x2240
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xbda1
movq %rdx, %r14
movq %rax, %rbx
jmp 0xbdab
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xbdab
jmp 0xbd6e
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xbdb8
movq %rdx, %r14
movq %rax, %rbx
jmp 0xbd99
movq %rdx, %r14
movq %rax, %rbx
jmp 0xbdb8
movq %rdx, %r14
movq %rax, %rbx
jmp 0xbda1
jmp 0xbd86
jmp 0xbd86
jmp 0xbd86
jmp 0xbd86
movq %rdx, %r14
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xbe84
movq %rsp, %rdi
callq 0xbe9e
leaq 0x50(%rsp), %rdi
callq 0x3274
leaq 0xc0(%rsp), %rdi
callq 0x2030
cmpl $0x1, %r14d
jne 0xbe20
movq %rbx, %rdi
callq 0x20a0
movq %rax, %rbx
movq 0xa218(%rip), %rdi      # 0x15fe8
leaq 0x17f0(%rip), %rsi      # 0xd5c7
callq 0x2160
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x2160
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x21a0
callq 0x2230
pushq $0x1
popq %rax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x2250
movq %rax, %rdi
callq 0x365a