// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/BnB.cpp
// Function: BnB::Solve(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void BnB::Solve(string filename, string outScoreFile)
{
#if DEBUG == 1
    Timer T;
    T.start();
#endif

    G.Solve(""); 
    sys_lb = -G.GetSolution();

    x = Vector::Zero(nr_cols);
    sys_lo.conservativeResizeLike(Vector::Zero(nr_cols));
    sys_hi.conservativeResizeLike(Vector::Ones(nr_cols));
    sys_x.resize(nr_cols);    
    sys_x.assign(nr_cols, false);

    if (SolveLP())    
    {
        x = sys_s;
        for (size_t i = 0; i < x.size(); ++i)
            x(i) = round(x(i));
        WriteSolution(filename);
    }    
    else
        G.WriteSolution(filename);

#if DEBUG == 1
    T.stop();
    cout << endl;
    cout << "total geno calls: " << geno_calls << endl;
    cout << "total geno time: " << geno_time << endl;
    cout << "total time: " << T.secs() << endl;    
    double f = 0;
    for (size_t i = 0; i < x.size(); ++i)
        f += x(i) * c(i);
    cout << "sol: " << f << endl;    
    cout << gap_amount << ' ' << gap_count << endl;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xb0(%rsp), %rdi
movb $0x0, 0x38(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rdi)
callq 0xb808
leaq 0x31e2b(%rip), %rsi     # 0x6c99a
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xb7a6
leaq 0x166df(%rip), %rsi     # 0x51264
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xb7a6
leaq 0x118(%rbx), %r12
leaq 0x50(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x30438
leaq 0x30(%rsp), %rdi
callq 0x9708
leaq 0x50(%rsp), %rdi
callq 0x9708
movq %r12, %rdi
callq 0x3068c
xorpd 0x167ef(%rip), %xmm0    # 0x513c0
movlpd %xmm0, 0x1e8(%rbx)
movslq 0x10c(%rbx), %rsi
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0xced2
leaq 0xc0(%rbx), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x26bc6
leaq 0x228(%rbx), %r13
movslq 0x10c(%rbx), %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0xced2
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3c2be
leaq 0x238(%rbx), %r13
movslq 0x10c(%rbx), %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0x333bc
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3c2be
leaq 0x1f0(%rbx), %r13
movslq 0x10c(%rbx), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x3bfac
movslq 0x10c(%rbx), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x3ca2a
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testb %al, %al
je 0x3acd0
leaq 0x218(%rbx), %rsi
movq %r14, %rdi
callq 0xe787
xorl %r12d, %r12d
cmpq 0xc8(%rbx), %r12
jae 0x3aced
movq %r14, %rdi
movq %r12, %rsi
callq 0xd27a
movsd (%rax), %xmm0
callq 0x9130
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0xd27a
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
incq %r12
jmp 0x3ac93
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x9470
movq %r12, %rdi
movq %r13, %rsi
callq 0x30550
jmp 0x3ad0c
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x9470
movq (%rbx), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *0x18(%rax)
movq %r13, %rdi
callq 0x9708
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
callq 0xba34
movq 0x5c285(%rip), %r12     # 0x96fb0
movq %r12, %rdi
callq 0x9170
leaq 0x33333(%rip), %rsi     # 0x6e06d
movq %r12, %rdi
callq 0x9330
movl 0x5c6dc(%rip), %esi     # 0x97424
movq %rax, %rdi
callq 0x9610
movq %rax, %rdi
callq 0x9170
leaq 0x33321(%rip), %rsi     # 0x6e080
movq %r12, %rdi
callq 0x9330
movsd 0x5c6b9(%rip), %xmm0    # 0x97428
movq %rax, %rdi
callq 0x9540
movq %rax, %rdi
callq 0x9170
leaq 0x3330c(%rip), %rsi     # 0x6e092
movq %r12, %rdi
callq 0x9330
cvtsi2sdq (%r15), %xmm0
divsd 0x1628d(%rip), %xmm0    # 0x51028
cvtsd2ss %xmm0, %xmm0
movq %rax, %rdi
callq 0x9270
movq %rax, %rdi
callq 0x9170
leaq 0xf8(%rbx), %r15
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r12d, %r12d
cmpq 0xc8(%rbx), %r12
jae 0x3ae0a
movq %r14, %rdi
movq %r12, %rsi
callq 0xd27a
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xd27a
movsd 0x10(%rsp), %xmm1
mulsd (%rax), %xmm1
movsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
incq %r12
jmp 0x3adc2
movq 0x5c19f(%rip), %rbx     # 0x96fb0
leaq 0x33287(%rip), %rsi     # 0x6e09f
movq %rbx, %rdi
callq 0x9330
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x9540
movq %rax, %rdi
callq 0x9170
movsd 0x5c5fa(%rip), %xmm0    # 0x97438
movq %rbx, %rdi
callq 0x9540
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x93b0
movl 0x5c5d9(%rip), %esi     # 0x97430
movq %rax, %rdi
callq 0x9610
movq %rax, %rdi
callq 0x9170
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0x3aea7
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x3aea7
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x9708
jmp 0x3aea2
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x9708
jmp 0x3aeb1
movq %rax, %rbx
movq %rbx, %rdi
callq 0x9640
nop