// File: /workspace/github_cpp_makefile_star2_O1/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, 0x8(%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 0x9580
movb $0x1, 0x8(%r14)
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x30147(%rip), %rdx     # 0x6f2b6
leaq 0x50(%rsp), %rdi
movq %rdx, %rsi
callq 0xdb24
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1d0d8(%rip), %rsi     # 0x5c264
leaq 0x1d0da(%rip), %rdx     # 0x5c26d
leaq 0x18(%rsp), %rdi
callq 0xdb24
leaq 0x118(%rbx), %r15
leaq 0x50(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movq %r15, %rdi
callq 0x328fe
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f1cd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9340
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x3f1e4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x9340
movq %r15, %rdi
callq 0x32c50
xorps 0x1d1ed(%rip), %xmm0    # 0x5c3e0
movlps %xmm0, 0x1e8(%rbx)
movslq 0x10c(%rbx), %r14
testq %r14, %r14
js 0x3f76b
movq %r15, 0x10(%rsp)
leaq 0xc0(%rbx), %r12
cmpq %r14, 0xc8(%rbx)
je 0x3f232
movl $0x1, %ecx
movq %r12, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x10056
movq 0xc8(%rbx), %r15
cmpq %r14, %r15
jne 0x3f78a
movq %r12, %r13
movq (%r12), %r14
movq %r15, %rbp
shrq $0x3f, %rbp
addq %r15, %rbp
movq %rbp, %r12
andq $-0x2, %r12
cmpq $0x2, %r15
jl 0x3f287
cmpq $0x3, %r12
movl $0x2, %eax
cmovgeq %r12, %rax
leaq -0x8(,%rax,8), %rdx
andq $-0x10, %rdx
addq $0x10, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x91c0
cmpq %r15, %r12
jge 0x3f2aa
sarq %rbp
shlq $0x4, %rbp
addq %rbp, %r14
shlq $0x3, %r15
subq %rbp, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x91c0
movslq 0x10c(%rbx), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x48(%rsp)
testq %rax, %rax
js 0x3f76b
leaq 0x228(%rbx), %rdi
leaq 0x38(%rsp), %r14
movq %r14, %rsi
callq 0x41a26
movslq 0x10c(%rbx), %rax
movq %rax, (%r14)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x10(%r14)
testq %rax, %rax
js 0x3f76b
movq %r13, %r15
leaq 0x238(%rbx), %rdi
leaq 0x38(%rsp), %rsi
callq 0x41a26
leaq 0x1f0(%rbx), %r14
movslq 0x10c(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x41444
movslq 0x10c(%rbx), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x42056
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testb %al, %al
je 0x3f456
movq 0x218(%rbx), %r13
movq 0x220(%rbx), %r14
cmpq %r14, 0xc8(%rbx)
je 0x3f37e
testq %r14, %r14
js 0x3f7c0
movl $0x1, %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x10056
movq 0xc8(%rbx), %rax
cmpq %r14, %rax
jne 0x3f7a1
movq (%r15), %rcx
movq %rax, %rdx
shrq $0x3f, %rdx
addq %rax, %rdx
andq $-0x2, %rdx
cmpq $0x2, %rax
jl 0x3f3ba
xorl %esi, %esi
movaps (%r13,%rsi,8), %xmm0
movaps %xmm0, (%rcx,%rsi,8)
addq $0x2, %rsi
cmpq %rdx, %rsi
jl 0x3f3a7
cmpq %rax, %rdx
jge 0x3f3d3
movsd (%r13,%rdx,8), %xmm0
movsd %xmm0, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x3f3bf
movq 0xc8(%rbx), %r14
testq %r14, %r14
je 0x3f414
movq (%r15), %r15
xorl %r12d, %r12d
testq %r14, %r14
movl $0x0, %r13d
cmovgq %r14, %r13
cmpq %r12, %r13
je 0x3f74c
movsd (%r15,%r12,8), %xmm0
callq 0x9140
movsd %xmm0, (%r15,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x3f3f2
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0xda94
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x18(%rax)
movq 0x90(%rsp), %rdi
jmp 0x3f491
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0xda94
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x32a7a
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x3f4a2
movq (%r12), %rsi
incq %rsi
callq 0x9340
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x9580
movb $0x0, 0x18(%r14)
movq (%r14), %rax
subq -0x10(%r14), %rax
movq 0x8(%r14), %r12
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
subq -0x8(%r14), %r12
addq %rax, %r12
addq -0x20(%r14), %r12
movq %r12, -0x20(%r14)
movq 0x48ad9(%rip), %r14     # 0x87fc0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9320
movsbl %al, %esi
movq %r14, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9220
leaq 0x30acb(%rip), %rsi     # 0x6ffe0
movl $0x12, %edx
movq %r14, %rdi
callq 0x93a0
movl 0x48f0c(%rip), %esi     # 0x88434
movq %r14, %rdi
callq 0x9640
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9320
movsbl %al, %esi
movq %r15, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9220
leaq 0x30a92(%rip), %rsi     # 0x6fff3
movl $0x11, %edx
movq %r14, %rdi
callq 0x93a0
movsd 0x48ec2(%rip), %xmm0    # 0x88438
movq %r14, %rdi
callq 0x9560
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x9320
movsbl %al, %esi
movq %r15, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9220
leaq 0x30a56(%rip), %rsi     # 0x70005
movl $0xc, %edx
movq %r14, %rdi
callq 0x93a0
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
divsd 0x1ca5c(%rip), %xmm0    # 0x5c028
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
callq 0x9560
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9320
movsbl %al, %esi
movq %r14, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9220
movq 0xc8(%rbx), %rax
testq %rax, %rax
je 0x3f680
movq 0x100(%rbx), %rcx
movq 0xc0(%rbx), %rdx
movq 0xf8(%rbx), %rsi
xorl %edi, %edi
testq %rax, %rax
movl $0x0, %r8d
cmovgq %rax, %r8
testq %rcx, %rcx
cmovleq %rdi, %rcx
leaq -0x1(%rax), %r9
cmpq %r9, %rcx
cmovbq %rcx, %r9
cmpq %r8, %r9
movq %r8, %r10
cmovbq %r9, %r10
xorpd %xmm1, %xmm1
cmpq %r9, %r8
jbe 0x3f74c
cmpq %r10, %rcx
je 0x3f74c
movsd (%rdx,%rdi,8), %xmm0
mulsd (%rsi,%rdi,8), %xmm0
addsd %xmm0, %xmm1
incq %rdi
cmpq %rdi, %rax
jne 0x3f656
jmp 0x3f684
xorpd %xmm1, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x4892f(%rip), %rbx     # 0x87fc0
leaq 0x3097a(%rip), %rsi     # 0x70012
movl $0x5, %edx
movq %rbx, %rdi
callq 0x93a0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x9560
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x9320
movsbl %al, %esi
movq %r14, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9220
movsd 0x48d63(%rip), %xmm0    # 0x88448
movq %rbx, %rdi
callq 0x9560
leaq 0x38(%rsp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x93a0
movl 0x48d38(%rip), %esi     # 0x88440
movq %rax, %rdi
callq 0x9640
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x9320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x9040
movq %rax, %rdi
callq 0x9220
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1dad2(%rip), %rdi     # 0x5d225
leaq 0x1dae8(%rip), %rsi     # 0x5d242
leaq 0x1db04(%rip), %rcx     # 0x5d265
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x9200
leaq 0x1cdca(%rip), %rdi     # 0x5c53c
leaq 0x1ce58(%rip), %rsi     # 0x5c5d1
leaq 0x1dc4c(%rip), %rcx     # 0x5d3cc
movl $0x4a, %edx
callq 0x9200
leaq 0x1d8cf(%rip), %rdi     # 0x5d060
leaq 0x1cd81(%rip), %rsi     # 0x5c519
leaq 0x1dd24(%rip), %rcx     # 0x5d4c3
jmp 0x3f7b6
leaq 0x1d8b8(%rip), %rdi     # 0x5d060
leaq 0x1cd6a(%rip), %rsi     # 0x5c519
leaq 0x1db36(%rip), %rcx     # 0x5d2ec
movl $0x2d1, %edx            # imm = 0x2D1
callq 0x9200
leaq 0x1d691(%rip), %rdi     # 0x5ce58
leaq 0x1d4e9(%rip), %rsi     # 0x5ccb7
leaq 0x1d812(%rip), %rcx     # 0x5cfe7
movl $0x11d, %edx            # imm = 0x11D
callq 0x9200
movq %rax, %rbx
movq 0x90(%rsp), %rdi
jmp 0x3f81a
movq %rax, %rbx
movq 0x70(%rsp), %rdi
jmp 0x3f81a
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f815
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x9340
jmp 0x3f815
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x3f82b
movq (%r12), %rsi
incq %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9670
nop