// File: /workspace/github_cpp_makefile_star2_O2/canzarlab[P]Trajan/src/BnG.cpp
// Function: GenericBnBSolver::EvalBranch(BnBNode*)
vector<BnBNode*>* GenericBnBSolver::EvalBranch(BnBNode* node)
{
    vector<pair<size_t, size_t>> vp;
    size_t p = 0;

    for (size_t i = 0; i < t1.GetNumNodes(); ++i)
        for (size_t j = 0; j < t2.GetNumNodes(); ++j)
            if (K[i][j] != -1 && IsVarFrac(node->sol(K[i][j])) && !node->IsVarFixed(K[i][j]))                
                vp.emplace_back(i, j);                

    sort(vp.begin(), vp.end(), [this, node](pair<size_t, size_t>& p, pair<size_t, size_t>& q)
    {
        return VarScore(K[p.first][p.second], node) > VarScore(K[q.first][q.second], node);  
    });

    for (int i = 0; !p && i < vp.size(); ++i)
    {
        bool flag = 1;
        for (size_t k = 0; flag && k < t1.GetNumNodes(); ++k)          
            for (size_t j = 0; flag && j < t2.GetNumNodes(); ++j)
                if (K[k][j] != -1 && node->IsVarFixed(K[k][j]) && node->var_ub(K[k][j]) != 0)                              
                    flag = IsNotInConflict(vp[i].first, k, vp[i].second, j);                    
        if (flag) p = 1 + K[vp[i].first][vp[i].second];
    }

    if (vp.size())
    {
        vector<BnBNode*>* V = new vector<BnBNode*>;
        bool b0 = !p; 
        p = (b0) ? K[vp[0].first][vp[0].second] : p - 1; 
        if (CheckFix(node->sol(p)))
        {
            if (!b0) V->push_back(MakeNode(node, p, 1));
            V->push_back(MakeNode(node, p, 0));        
        }
        else
        {
            V->push_back(MakeNode(node, p, 0));        
            if (!b0) V->push_back(MakeNode(node, p, 1));
        }
        return V;
    }

    return nullptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %r12
movapd %xmm0, (%r12)
andq $0x0, 0x10(%r12)
movq %rsi, 0x8(%rsp)
leaq 0x50(%rsi), %rbx
xorl %eax, %eax
leaq 0x10(%rsp), %r13
leaq 0x18(%rsp), %rbp
movq %rax, 0x10(%rsp)
movq 0x30(%r14), %rcx
movslq 0x70(%rcx), %rcx
cmpq %rcx, %rax
jae 0x3d9c3
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movq 0x38(%r14), %rcx
movslq 0x70(%rcx), %rcx
cmpq %rcx, %rax
jae 0x3d9b6
imulq $0x18, 0x10(%rsp), %rcx
movq 0xe0(%r14), %rdx
movq (%rdx,%rcx), %rcx
movslq (%rcx,%rax,4), %rsi
cmpq $-0x1, %rsi
je 0x3d9a9
movq %rbx, %rdi
callq 0xd27a
movsd (%rax), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x60(%rax)
testb %al, %al
je 0x3d9a9
imulq $0x18, 0x10(%rsp), %rax
movq 0xe0(%r14), %rcx
movq 0x18(%rsp), %rdx
movq (%rcx,%rax), %rax
movslq (%rax,%rdx,4), %rsi
movq 0x8(%rsp), %rdi
callq 0x3cf8a
testb %al, %al
jne 0x3d9a9
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x3c118
movq 0x18(%rsp), %rax
incq %rax
jmp 0x3d92d
movq 0x10(%rsp), %rax
incq %rax
jmp 0x3d915
movq %rbx, 0x40(%rsp)
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %r15
cmpq %r15, %r12
je 0x3da56
movq %r15, %rbx
subq %r12, %rbx
movq %rbx, %rax
sarq $0x4, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
movq 0x8(%rsp), %r8
callq 0x3e9e6
cmpq $0x101, %rbx            # imm = 0x101
jl 0x3da43
leaq 0x100(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
callq 0x3ee71
cmpq %r15, %r13
je 0x3da56
movq %r13, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x3eeff
addq $0x10, %r13
jmp 0x3da28
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %rcx
callq 0x3ee71
movq 0x8(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x50(%rsp)
xorl %edx, %edx
xorl %r15d, %r15d
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rax
testq %r15, %r15
jne 0x3db7e
movq %rax, %rcx
subq %rbx, %rcx
sarq $0x4, %rcx
cmpq %rdx, %rcx
jbe 0x3db7e
movb $0x1, %bpl
movq %rdx, 0x48(%rsp)
movq %rdx, %rbx
shlq $0x4, %rbx
xorl %r13d, %r13d
testb $0x1, %bpl
je 0x3db4b
movq 0x30(%r14), %rax
movslq 0x70(%rax), %rax
cmpq %rax, %r13
jae 0x3db50
imulq $0x18, %r13, %r12
xorl %r15d, %r15d
testb $0x1, %bpl
je 0x3db43
movq 0x38(%r14), %rax
movslq 0x70(%rax), %rax
cmpq %rax, %r15
jae 0x3db43
movq 0xe0(%r14), %rax
movq (%rax,%r12), %rax
movslq (%rax,%r15,4), %rsi
cmpq $-0x1, %rsi
je 0x3db3e
movq 0x8(%rsp), %rdi
callq 0x3cf8a
testb %al, %al
je 0x3db3e
movq 0xe0(%r14), %rax
movq (%rax,%r12), %rax
movslq (%rax,%r15,4), %rsi
movq 0x50(%rsp), %rdi
callq 0xd27a
movsd (%rax), %xmm0
ucomisd 0x138ea(%rip), %xmm0    # 0x51408
jne 0x3db22
jnp 0x3db3e
movq 0x20(%rsp), %rax
movl (%rax,%rbx), %esi
movl 0x8(%rax,%rbx), %ecx
movq %r14, %rdi
movl %r13d, %edx
movl %r15d, %r8d
callq 0x320c0
movl %eax, %ebp
incq %r15
jmp 0x3dac3
incq %r13
jmp 0x3daa1
xorl %r15d, %r15d
jmp 0x3db71
movq 0x20(%rsp), %rax
movq 0xe0(%r14), %rcx
imulq $0x18, (%rax,%rbx), %rdx
movq 0x8(%rax,%rbx), %rax
movq (%rcx,%rdx), %rcx
movslq (%rcx,%rax,4), %r15
incq %r15
movq 0x48(%rsp), %rdx
incq %rdx
jmp 0x3da69
cmpq %rbx, %rax
je 0x3dba6
pushq $0x18
popq %rdi
callq 0x9340
movq %rax, %r12
andq $0x0, 0x10(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
testq %r15, %r15
je 0x3dbae
leaq -0x1(%r15), %r13
jmp 0x3dbc5
xorl %r12d, %r12d
jmp 0x3dc8b
imulq $0x18, (%rbx), %rax
movq 0xe0(%r14), %rcx
movq 0x8(%rbx), %rdx
movq (%rcx,%rax), %rax
movslq (%rax,%rdx,4), %r13
movq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xd27a
movsd (%rax), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x70(%rax)
testb %al, %al
je 0x3dc38
testq %r15, %r15
je 0x3dc11
movq (%r14), %rax
movsd 0x15c2d(%rip), %xmm0    # 0x53820
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq *0x58(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0x3fa36
movq (%r14), %rax
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq *0x58(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0x3fa36
jmp 0x3dc8b
movq (%r14), %rax
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq *0x58(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0x3fa36
testq %r15, %r15
je 0x3dc8b
movq (%r14), %rax
movsd 0x15bb3(%rip), %xmm0    # 0x53820
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq *0x58(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %r12, %rdi
callq 0x3fa36
leaq 0x20(%rsp), %rdi
callq 0x3cc08
movq %r12, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
jmp 0x3dcb9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3cc08
movq %rbx, %rdi
callq 0x9640