// File: /workspace/github_cpp_makefile_star2_O3/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, 0x10(%rsp)
movq %rdi, %rbx
leaq 0xc0(%rsp), %rdi
movb $0x0, 0x28(%rdi)
leaq 0xe0(%rsp), %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%r14)
movq %r14, %rsi
callq 0x9590
movb $0x1, 0x8(%r14)
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2f613(%rip), %rdx     # 0x6de66
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0xdadc
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1d9f4(%rip), %rsi     # 0x5c264
leaq 0x1d9f6(%rip), %rdx     # 0x5c26d
leaq 0x18(%rsp), %rdi
callq 0xdadc
leaq 0x118(%rbx), %r15
leaq 0x50(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0x31d5c
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x3e8b1
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9350
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x3e8c8
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x9350
movq %r15, %rdi
callq 0x320ae
xorps 0x1dae9(%rip), %xmm0    # 0x5c3c0
movlps %xmm0, 0x1e8(%rbx)
movslq 0x10c(%rbx), %rbp
testq %rbp, %rbp
js 0x3ee3a
movq %r15, %r12
leaq 0xc0(%rbx), %r14
cmpq %rbp, 0xc8(%rbx)
je 0x3e921
movl $0x1, %ecx
movq %r14, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
callq 0xff4c
cmpq %rbp, 0xc8(%rbx)
jne 0x3ee59
movl %ebp, %r15d
movq %r14, 0x8(%rsp)
movq (%r14), %r14
movl %r15d, %r13d
andl $0x7ffffffe, %r13d      # imm = 0x7FFFFFFE
cmpl $0x2, %r15d
jb 0x3e963
cmpl $0x3, %r13d
movl $0x2, %eax
cmovael %r13d, %eax
leaq -0x8(,%rax,8), %rdx
andq $-0x10, %rdx
addq $0x10, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x91c0
cmpl %ebp, %r13d
je 0x3e986
shrl %r15d
shlq $0x4, %r15
addq %r15, %r14
shlq $0x3, %rbp
subq %r15, %rbp
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x91c0
movslq 0x10c(%rbx), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
testq %rax, %rax
js 0x3ee3a
leaq 0x228(%rbx), %rdi
leaq 0x38(%rsp), %r14
movq %r14, %rsi
callq 0x41168
movslq 0x10c(%rbx), %rax
movq %rax, (%r14)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x10(%r14)
testq %rax, %rax
js 0x3ee3a
movq %r12, %r15
leaq 0x238(%rbx), %rdi
leaq 0x38(%rsp), %rsi
callq 0x41168
leaq 0x1f0(%rbx), %r14
movslq 0x10c(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x40a66
movslq 0x10c(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x418f4
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testb %al, %al
je 0x3eb39
movq 0x218(%rbx), %r14
movq 0x220(%rbx), %r13
cmpq %r13, 0xc8(%rbx)
je 0x3ea69
testq %r13, %r13
js 0x3ee70
movl $0x1, %ecx
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0xff4c
cmpq %r13, 0xc8(%rbx)
jne 0x3ee8f
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %r13, %rcx
shrq $0x3f, %rcx
addq %r13, %rcx
andq $-0x2, %rcx
cmpq $0x2, %r13
jl 0x3ea99
xorl %edx, %edx
movaps (%r14,%rdx,8), %xmm0
movaps %xmm0, (%rax,%rdx,8)
addq $0x2, %rdx
cmpq %rcx, %rdx
jl 0x3ea87
cmpq %r13, %rcx
jge 0x3eab1
movsd (%r14,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
cmpq %rcx, %r13
jne 0x3ea9e
movq 0xc8(%rbx), %r14
testq %r14, %r14
je 0x3eaf7
movq 0x8(%rsp), %rax
movq (%rax), %r15
xorl %r12d, %r12d
testq %r14, %r14
movl $0x0, %r13d
cmovgq %r14, %r13
cmpq %r12, %r13
je 0x3ee1b
movsd (%r15,%r12,8), %xmm0
callq 0x9140
movsd %xmm0, (%r15,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x3ead5
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0xda46
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x18(%rax)
movq 0x90(%rsp), %rdi
jmp 0x3eb72
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0xda46
movq %r15, %rdi
movq %r14, %rsi
callq 0x31ed8
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x3eb83
movq (%r12), %rsi
incq %rsi
callq 0x9350
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x9590
movq (%r14), %rax
movq 0x8(%r14), %r12
subq -0x10(%r14), %rax
subq -0x8(%r14), %r12
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq %rax, %r12
addq -0x20(%r14), %r12
movq 0x47401(%rip), %r14     # 0x85fc0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9330
movsbl %al, %esi
movq %r14, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9230
leaq 0x300a8(%rip), %rsi     # 0x6ec95
movl $0x12, %edx
movq %r14, %rdi
callq 0x93b0
movl 0x4783c(%rip), %esi     # 0x8643c
movq %r14, %rdi
callq 0x9650
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9330
movsbl %al, %esi
movq %r15, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9230
leaq 0x3006f(%rip), %rsi     # 0x6eca8
movl $0x11, %edx
movq %r14, %rdi
callq 0x93b0
movsd 0x477f2(%rip), %xmm0    # 0x86440
movq %r14, %rdi
callq 0x9570
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9330
movsbl %al, %esi
movq %r15, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9230
leaq 0x30033(%rip), %rsi     # 0x6ecba
movl $0xc, %edx
movq %r14, %rdi
callq 0x93b0
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
divsd 0x1d384(%rip), %xmm0    # 0x5c028
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
callq 0x9570
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9330
movsbl %al, %esi
movq %r14, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9230
movq 0xc8(%rbx), %rax
testq %rax, %rax
je 0x3ed4f
movq 0x100(%rbx), %rdx
xorl %ecx, %ecx
testq %rax, %rax
movl $0x0, %esi
cmovgq %rax, %rsi
testq %rdx, %rdx
cmovgq %rdx, %rcx
leaq -0x1(%rax), %rdx
cmpq %rdx, %rcx
cmovbq %rcx, %rdx
cmpq %rdx, %rsi
jbe 0x3ee1b
cmpq %rdx, %rcx
je 0x3ee1b
movq 0xc0(%rbx), %rcx
movq 0xf8(%rbx), %rdx
xorpd %xmm1, %xmm1
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm0
mulsd (%rdx,%rsi,8), %xmm0
addsd %xmm0, %xmm1
incq %rsi
cmpq %rsi, %rax
jne 0x3ed37
jmp 0x3ed53
xorpd %xmm1, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x47260(%rip), %rbx     # 0x85fc0
leaq 0x2ff60(%rip), %rsi     # 0x6ecc7
movl $0x5, %edx
movq %rbx, %rdi
callq 0x93b0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x9570
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9330
movsbl %al, %esi
movq %r14, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9230
movsd 0x4769c(%rip), %xmm0    # 0x86450
movq %rbx, %rdi
callq 0x9570
leaq 0x38(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x93b0
movl 0x47671(%rip), %esi     # 0x86448
movq %rax, %rdi
callq 0x9650
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9230
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e423(%rip), %rdi     # 0x5d245
leaq 0x1e439(%rip), %rsi     # 0x5d262
leaq 0x1e455(%rip), %rcx     # 0x5d285
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x9200
leaq 0x1d71b(%rip), %rdi     # 0x5c55c
leaq 0x1d7a9(%rip), %rsi     # 0x5c5f1
leaq 0x1e59d(%rip), %rcx     # 0x5d3ec
movl $0x4a, %edx
callq 0x9200
leaq 0x1e220(%rip), %rdi     # 0x5d080
leaq 0x1d6d2(%rip), %rsi     # 0x5c539
leaq 0x1e675(%rip), %rcx     # 0x5d4e3
jmp 0x3eea4
leaq 0x1e001(%rip), %rdi     # 0x5ce78
leaq 0x1de59(%rip), %rsi     # 0x5ccd7
leaq 0x1e182(%rip), %rcx     # 0x5d007
movl $0x11d, %edx            # imm = 0x11D
callq 0x9200
leaq 0x1e1ea(%rip), %rdi     # 0x5d080
leaq 0x1d69c(%rip), %rsi     # 0x5c539
leaq 0x1e468(%rip), %rcx     # 0x5d30c
movl $0x2d1, %edx            # imm = 0x2D1
callq 0x9200
movq %rax, %rbx
movq 0x90(%rsp), %rdi
jmp 0x3eee9
movq %rax, %rbx
movq 0x70(%rsp), %rdi
jmp 0x3eee9
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x3eee4
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9350
jmp 0x3eee4
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x3eefa
movq (%r12), %rsi
incq %rsi
callq 0x9350
movq %rbx, %rdi
callq 0x9680