// File: canzarlab[P]Trajan/src/AntichainConstraint.cpp
// Function: AntichainConstraint::Antichain(std::vector<newick_node*, std::allocator<newick_node*>>&, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&)
void AntichainConstraint::Antichain(vn& P, vvd& R)
{
    vi D(SZ, -1);
    double max = Reset(P, R);
    double flow = MaxFlow(D, R);
    if (max - flow <= 1 + EPS)
        return;

    vii PN;
    for (int i = 0; i < Z; ++i)
        if (D[i] != -1 && D[i + Z] == -1)
            for (newick_node* nodel : P)
                PN.emplace_back(nodel->taxoni, i);

    lock_guard<mutex> g(qmutex);
    if (!all_of(P.begin(), P.end(), [&](newick_node* node){return B[node->taxoni];}))
    {
        AddConstraint(nr_rows + ncr++, PN);
        for (newick_node* node : P)
            B[node->taxoni] = true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movslq 0x54(%rax), %rax
movq %rax, -0x100(%rbp)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
leaq -0x35(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x14c70
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rcx
leaq -0x30(%rbp), %rdi
leaq -0x34(%rbp), %rdx
callq 0xaef30
jmp 0xbb9d1
leaq -0x35(%rbp), %rdi
callq 0x14d00
movq -0x108(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xbc260
movsd %xmm0, -0x110(%rbp)
jmp 0xbb9f8
movq -0x108(%rbp), %rdi
movsd -0x110(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rsi
callq 0xbc190
movsd %xmm0, -0x118(%rbp)
jmp 0xbba23
movsd -0x118(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x50(%rbp), %xmm1
subsd -0x58(%rbp), %xmm1
movsd 0x6fe4e(%rip), %xmm0    # 0x12b890
ucomisd %xmm1, %xmm0
jb 0xbba7f
movl $0x1, -0x5c(%rbp)
jmp 0xbbd28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x35(%rbp), %rdi
callq 0x14d00
jmp 0xbbd4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbbd43
leaq -0x78(%rbp), %rdi
callq 0xacd60
movl $0x0, -0x7c(%rbp)
movq -0x108(%rbp), %rcx
movl -0x7c(%rbp), %eax
cmpl 0x50(%rcx), %eax
jge 0xbbb87
movslq -0x7c(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x145d0
cmpl $-0x1, (%rax)
je 0xbbb77
movq -0x108(%rbp), %rcx
movl -0x7c(%rbp), %eax
addl 0x50(%rcx), %eax
movslq %eax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x145d0
cmpl $-0x1, (%rax)
jne 0xbbb77
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x99a50
movq %rax, -0x90(%rbp)
movq -0x88(%rbp), %rdi
callq 0x99a80
movq %rax, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x99ab0
testb $0x1, %al
jne 0xbbb24
jmp 0xbbb75
leaq -0x90(%rbp), %rdi
callq 0x99af0
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rsi
addq $0x28, %rsi
leaq -0x78(%rbp), %rdi
leaq -0x7c(%rbp), %rdx
callq 0xbd110
jmp 0xbbb54
jmp 0xbbb56
leaq -0x90(%rbp), %rdi
callq 0x99b10
jmp 0xbbb0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xbbd3a
jmp 0xbbb77
jmp 0xbbb79
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xbba8f
movq -0x108(%rbp), %rsi
addq $0x58, %rsi
leaq -0xa8(%rbp), %rdi
callq 0xbced0
jmp 0xbbba0
movq -0x10(%rbp), %rdi
callq 0x99a50
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x99a80
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0xb8(%rbp)
movq %rax, -0xc0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
callq 0xbc4d0
movb %al, -0x119(%rbp)
jmp 0xbbbf3
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0xbbd0c
jmp 0xbbc03
movq -0x108(%rbp), %rdi
movl 0x40(%rdi), %eax
movl 0x44(%rdi), %esi
movl %eax, %ecx
incl %ecx
movl %ecx, 0x40(%rdi)
addl %eax, %esi
leaq -0x78(%rbp), %rdx
callq 0xc05c0
jmp 0xbbc24
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x99a50
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x99a80
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x99ab0
testb $0x1, %al
jne 0xbbc71
jmp 0xbbd0a
leaq -0xd0(%rbp), %rdi
callq 0x99af0
movq -0x108(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
subq $-0x80, %rdi
movq -0xe0(%rbp), %rax
movslq 0x28(%rax), %rsi
callq 0x997b0
movq %rdx, -0x130(%rbp)
movq %rax, -0x128(%rbp)
jmp 0xbbcb2
movq -0x130(%rbp), %rax
movq -0x128(%rbp), %rcx
movq %rcx, -0xf0(%rbp)
movq %rax, -0xe8(%rbp)
leaq -0xf0(%rbp), %rdi
movl $0x1, %esi
callq 0x99840
leaq -0xd0(%rbp), %rdi
callq 0x99b10
jmp 0xbbc55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xbcf00
jmp 0xbbd3a
jmp 0xbbd0c
leaq -0xa8(%rbp), %rdi
callq 0xbcf00
leaq -0x78(%rbp), %rdi
callq 0xa9390
movl $0x0, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x14b50
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0xa9390
leaq -0x30(%rbp), %rdi
callq 0x14b50
movq -0x40(%rbp), %rdi
callq 0xa7c0
nopw %cs:(%rax,%rax)