// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0x8(%rsp)
movq 0x30(%rdi), %rax
cmpl $0x0, 0x70(%rax)
je 0x4389f
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x30(%rsp), %r13
movq $0x0, 0x30(%rsp)
movq 0x38(%r14), %rax
cmpl $0x0, 0x70(%rax)
je 0x43881
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movq 0xe0(%r14), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rcx
movslq (%rcx,%rax,4), %rax
cmpq $-0x1, %rax
je 0x43863
testl %eax, %eax
js 0x43bbb
cmpq %rax, 0x58(%rbx)
jle 0x43bbb
movq 0x50(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x60(%rax)
testb %al, %al
je 0x43863
movq 0x8(%rsp), %rax
movq 0xe0(%r14), %rcx
leaq (%rax,%rax,2), %rax
movq 0x30(%rsp), %rdx
movq (%rcx,%rax,8), %rax
movslq (%rax,%rdx,4), %rsi
movq %rbx, %rdi
callq 0x42678
testb %al, %al
jne 0x43863
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x415f0
movq 0x30(%rsp), %rax
incq %rax
movq %rax, 0x30(%rsp)
movq 0x38(%r14), %rcx
movslq 0x70(%rcx), %rcx
cmpq %rcx, %rax
jb 0x437e6
movq 0x8(%rsp), %rax
incq %rax
movq %rax, 0x8(%rsp)
movq 0x30(%r14), %rcx
movslq 0x70(%rcx), %rcx
cmpq %rcx, %rax
jb 0x437cd
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
cmpq %r15, %r12
je 0x43925
movq %r15, %r13
subq %r12, %r13
movq %r13, %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 %rbx, %r8
callq 0x44c03
cmpq $0x101, %r13            # imm = 0x101
jl 0x43914
leaq 0x100(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x45139
cmpq %r15, %r13
je 0x43925
movq %r13, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4520b
addq $0x10, %r13
jmp 0x438fb
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x45139
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x43a6c
xorl %ecx, %ecx
movb $0x1, %bpl
movq %rcx, 0x40(%rsp)
shlq $0x4, %rcx
movq %rcx, 0x38(%rsp)
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movslq 0x70(%rax), %rax
cmpq %rax, %r15
jae 0x43a16
testb $0x1, %bpl
je 0x43a04
leaq (%r15,%r15,2), %r13
xorl %r12d, %r12d
movq 0x38(%r14), %rax
movslq 0x70(%rax), %rax
cmpq %rax, %r12
jae 0x43a04
movq 0xe0(%r14), %rax
movq (%rax,%r13,8), %rax
movslq (%rax,%r12,4), %rsi
cmpq $-0x1, %rsi
je 0x439f7
movq %rbx, %rdi
callq 0x42678
testb %al, %al
je 0x439f7
movq 0xe0(%r14), %rax
movq (%rax,%r13,8), %rax
movslq (%rax,%r12,4), %rax
testq %rax, %rax
js 0x43bbb
cmpq %rax, 0x40(%rbx)
jle 0x43bbb
movq 0x38(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
ucomisd 0x189fe(%rip), %xmm0    # 0x5c3d0
jne 0x439d6
jnp 0x439f7
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movl (%rax,%rcx), %esi
movl 0x8(%rax,%rcx), %ecx
movq %r14, %rdi
movl %r15d, %edx
movl %r12d, %r8d
callq 0x34be6
movl %eax, %ebp
incq %r12
testb $0x1, %bpl
jne 0x4396d
incq %r15
testb $0x1, %bpl
jne 0x4394b
xorl %r12d, %r12d
jmp 0x43a3f
movq 0x10(%rsp), %rax
movq 0xe0(%r14), %rcx
movq 0x38(%rsp), %rsi
movq (%rax,%rsi), %rdx
movq 0x8(%rax,%rsi), %rax
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %rcx
movslq (%rcx,%rax,4), %r12
incq %r12
testq %r12, %r12
sete %bpl
movq 0x40(%rsp), %rcx
jne 0x43a67
incq %rcx
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x4, %rax
cmpq %rcx, %rax
ja 0x43937
decq %r12
jmp 0x43a76
movb $0x1, %bpl
movq $-0x1, %r12
movq 0x10(%rsp), %r13
cmpq %r13, 0x18(%rsp)
je 0x43b3e
movl $0x18, %edi
callq 0x9330
movq %rax, %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
testb %bpl, %bpl
je 0x43ac3
movq 0xe0(%r14), %rax
movq (%r13), %rcx
movq 0x8(%r13), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movslq (%rax,%rdx,4), %r12
testq %r12, %r12
js 0x43bbb
cmpq %r12, 0x58(%rbx)
jle 0x43bbb
movq 0x50(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x70(%rax)
testb %al, %al
je 0x43b43
testb %bpl, %bpl
jne 0x43b19
movq (%r14), %rax
movsd 0x188ab(%rip), %xmm0    # 0x5c3a8
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x46140
movq (%r14), %rax
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x46140
jmp 0x43b92
xorl %r15d, %r15d
jmp 0x43b92
movq (%r14), %rax
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x46140
testb %bpl, %bpl
jne 0x43b92
movq (%r14), %rax
movsd 0x18832(%rip), %xmm0    # 0x5c3a8
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x46140
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x43ba9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19663(%rip), %rdi     # 0x5d225
leaq 0x19679(%rip), %rsi     # 0x5d242
leaq 0x19695(%rip), %rcx     # 0x5d265
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x9200
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
jmp 0x43bec
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x43c06
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x9340
movq %rbx, %rdi
callq 0x9670