// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx
cmpl $0x0, 0x70(%rcx)
je 0x43165
movq 0x38(%r14), %rax
xorl %edx, %edx
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %r13
movq $0x0, 0x28(%rsp)
cmpl $0x0, 0x70(%rax)
je 0x430d8
xorl %ecx, %ecx
movq 0x8(%rsp), %rax
movq 0xe0(%r14), %rdx
leaq (%rax,%rax,2), %rax
movq (%rdx,%rax,8), %rax
movslq (%rax,%rcx,4), %rax
cmpq $-0x1, %rax
je 0x430b1
testl %eax, %eax
js 0x4341e
cmpq %rax, 0x58(%rbx)
jle 0x4341e
movq 0x50(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x60(%rax)
testb %al, %al
je 0x430b1
movq 0x8(%rsp), %rax
movq 0xe0(%r14), %rcx
leaq (%rax,%rax,2), %rax
movq 0x28(%rsp), %rdx
movq (%rcx,%rax,8), %rax
movslq (%rax,%rdx,4), %rsi
movq %rbx, %rdi
callq 0x41f10
testb %al, %al
jne 0x430b1
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x40c08
movq 0x28(%rsp), %rcx
incq %rcx
movq %rcx, 0x28(%rsp)
movq 0x38(%r14), %rax
movslq 0x70(%rax), %rdx
cmpq %rdx, %rcx
jb 0x43034
movq 0x8(%rsp), %rdx
movq 0x30(%r14), %rcx
incq %rdx
movq %rdx, 0x8(%rsp)
movslq 0x70(%rcx), %rsi
cmpq %rsi, %rdx
jb 0x4301f
movq %rbx, %r13
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r15
cmpq %r15, %r12
je 0x4317b
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 %r13, %r8
callq 0x44473
cmpq $0x101, %rbx            # imm = 0x101
jl 0x4316a
leaq 0x100(%r12), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x44987
cmpq %r15, %rbx
je 0x4317b
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x44a32
addq $0x10, %rbx
jmp 0x4314c
movq %rbx, %r13
jmp 0x4317b
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x44987
xorl %eax, %eax
movq %rax, %rbp
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %rax
movq %rax, %rcx
subq %rbx, %rcx
sarq $0x4, %rcx
movq %rcx, 0x30(%rsp)
cmpq %rbp, %rcx
jbe 0x432d4
movq %rbp, %rax
movb $0x1, %bpl
movq %rax, 0x40(%rsp)
shlq $0x4, %rax
movq %rax, 0x38(%rsp)
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movslq 0x70(%rax), %rax
cmpq %rax, %r15
jae 0x4328a
testb $0x1, %bpl
je 0x43278
leaq (%r15,%r15,2), %rbx
xorl %r12d, %r12d
movq 0x38(%r14), %rax
movslq 0x70(%rax), %rax
cmpq %rax, %r12
jae 0x43278
movq 0xe0(%r14), %rax
movq (%rax,%rbx,8), %rax
movslq (%rax,%r12,4), %rsi
cmpq $-0x1, %rsi
je 0x4326b
movq %r13, %rdi
callq 0x41f10
testb %al, %al
je 0x4326b
movq 0xe0(%r14), %rax
movq (%rax,%rbx,8), %rax
movslq (%rax,%r12,4), %rax
testq %rax, %rax
js 0x4341e
movq %r13, %rcx
cmpq %rax, 0x40(%r13)
jle 0x4341e
movq %rcx, %r13
movq 0x38(%rcx), %rcx
movsd (%rcx,%rax,8), %xmm0
ucomisd 0x191da(%rip), %xmm0    # 0x5c420
jne 0x4324a
jnp 0x4326b
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 0x3417c
movl %eax, %ebp
incq %r12
testb $0x1, %bpl
jne 0x431db
incq %r15
testb $0x1, %bpl
jne 0x431b9
xorl %r12d, %r12d
jmp 0x432b3
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
movq 0x40(%rsp), %rbp
leaq 0x1(%rbp), %rax
testq %r12, %r12
je 0x4317d
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %rax
decq %r12
jmp 0x432db
movq $-0x1, %r12
cmpq %rbx, %rax
je 0x4339f
movl $0x18, %edi
callq 0x9340
movq %rax, %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpq %rbp, 0x30(%rsp)
ja 0x43322
movq 0xe0(%r14), %rax
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movslq (%rax,%rdx,4), %r12
testq %r12, %r12
js 0x4341e
cmpq %r12, 0x58(%r13)
jle 0x4341e
movq 0x50(%r13), %rax
movsd (%rax,%r12,8), %xmm0
movq (%r14), %rax
movq %r14, %rdi
callq *0x70(%rax)
testb %al, %al
je 0x433a4
cmpq %rbp, 0x30(%rsp)
jbe 0x4337a
movq (%r14), %rax
movsd 0x1909a(%rip), %xmm0    # 0x5c3f8
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x458e2
movq (%r14), %rax
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x458e2
jmp 0x433f5
xorl %r15d, %r15d
jmp 0x433f5
movq (%r14), %rax
xorpd %xmm0, %xmm0
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x458e2
cmpq %rbp, 0x30(%rsp)
jbe 0x433f5
movq (%r14), %rax
movsd 0x1901f(%rip), %xmm0    # 0x5c3f8
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq *0x58(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x458e2
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4340c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19e20(%rip), %rdi     # 0x5d245
leaq 0x19e36(%rip), %rsi     # 0x5d262
leaq 0x19e52(%rip), %rcx     # 0x5d285
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x9200
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
jmp 0x4344f
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x43469
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq %rbx, %rdi
callq 0x9680
nop