// File: /workspace/github_cpp_makefile_star2_O3/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 0xc409
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 0xc43d
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
leaq 0xc0(%rsp), %rdi
callq 0x27cb
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc471
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
leaq 0x80(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xc5cc
leaq 0x80(%rsp), %rdi
xorl %esi, %esi
callq 0xb2fc
movq 0x8da1(%rip), %rdi      # 0x14fc0
leaq 0x2328(%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 0x8d6d(%rip), %rdi      # 0x14fc0
callq 0x2110
leaq 0x22f6(%rip), %rsi      # 0xe555
movl $0xb, %edx
movq %rax, %rdi
callq 0x21b0
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0xc3b0
xorl %ebx, %ebx
movq 0x8d3b(%rip), %r14      # 0x14fc0
leaq 0xf(%rsp), %r12
movl $0xb, %edx
movq %r14, %rdi
leaq 0x22c8(%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
leaq (%rbx,%rbx,2), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x8(%rax,%rcx,8), %rcx
movq %rcx, 0x38(%rsp)
cmpq %rcx, %rdx
je 0xc38a
movq %rbx, 0x30(%rsp)
movq (%rdx), %r15
movq %rdx, 0x40(%rsp)
movq 0x8(%rdx), %rax
movq %rax, 0x48(%rsp)
cmpq %rax, %r15
je 0xc357
xorl %eax, %eax
movq (%r15), %r13
movq 0x8(%r15), %rbx
movq %rbx, %rbp
subq %rax, %rbp
jbe 0xc327
movb $0x2e, 0xf(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21b0
decq %rbp
jne 0xc30a
movq %rbx, %rax
movq %r13, %rbx
subq %rax, %rbx
jbe 0xc34c
movb $0x23, 0xf(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21b0
decq %rbx
jne 0xc32f
movq %r13, %rax
addq $0x10, %r15
cmpq 0x48(%rsp), %r15
jne 0xc2fb
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 0xc2e3
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rbx
incq %rbx
movq 0x18(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
cmpq %rcx, %rbx
jb 0xc28a
leaq 0xa8(%rsp), %rdi
callq 0xc660
leaq 0x90(%rsp), %rdi
callq 0xc690
leaq 0x10(%rsp), %rdi
callq 0xc618
leaq 0x68(%rsp), %rdi
callq 0x3e22
leaq 0x50(%rsp), %rdi
callq 0x3e22
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 0x20ec(%rip), %rsi      # 0xe509
movq %rax, %rdi
callq 0x2070
movq 0x8bc4(%rip), %rsi      # 0x14ff0
movq 0x8b7d(%rip), %rdx      # 0x14fb0
movq %r15, %rdi
callq 0x2250
jmp 0xc4a3
movl $0x10, %edi
callq 0x20b0
movq %rax, %r15
leaq 0x20d4(%rip), %rsi      # 0xe525
movq %rax, %rdi
callq 0x2070
movq 0x8b90(%rip), %rsi      # 0x14ff0
movq 0x8b49(%rip), %rdx      # 0x14fb0
movq %r15, %rdi
callq 0x2250
jmp 0xc4a3
movl $0x10, %edi
callq 0x20b0
movq %rax, %r15
leaq 0x20b1(%rip), %rsi      # 0xe536
movq %rax, %rdi
callq 0x2070
movq 0x8b5c(%rip), %rsi      # 0x14ff0
movq 0x8b15(%rip), %rdx      # 0x14fb0
movq %r15, %rdi
callq 0x2250
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xc52a
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc53e
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xc53e
jmp 0xc4e8
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0x2130
jmp 0xc54b
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc520
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc54b
movq %rdx, %r14
movq %rax, %rbx
jmp 0xc52a
jmp 0xc500
jmp 0xc500
jmp 0xc500
jmp 0xc500
movq %rdx, %r14
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xc660
leaq 0x90(%rsp), %rdi
callq 0xc690
leaq 0x10(%rsp), %rdi
callq 0xc618
leaq 0x68(%rsp), %rdi
callq 0x3e22
leaq 0x50(%rsp), %rdi
callq 0x3e22
leaq 0xc0(%rsp), %rdi
callq 0x2030
cmpl $0x1, %r14d
jne 0xc5bb
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
movq 0x8a85(%rip), %rdi      # 0x14fe8
leaq 0x2003(%rip), %rsi      # 0xe56d
movl $0x7, %edx
callq 0x21b0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x8a64(%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 0xc3f7
movq %rax, %rbx
callq 0x2230
movq %rbx, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x3d9e
nop