// File: canzarlab[P]Trajan/src/AntichainConstraint.cpp
// Function: AntichainConstraint::Reset(std::vector<newick_node*, std::allocator<newick_node*>>&, std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&)
double AntichainConstraint::Reset(vn& P, vvd& R)
{
    double sum = 0;
    for (int i = 0; i < Z; ++i)
    {
        R[S][i] = R[i][S] = R[T][i + Z] = 0;
        for (int j : G[i + Z])
            R[i + Z][j] = 0;

        for (newick_node* nodel : P)
        {
            R[S][i] += GetWeight(nodel->taxoni, i);
            R[i + Z][T] += GetWeight(nodel->taxoni, i);
        }
        sum += R[S][i];
    }
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x70(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x50(%rcx), %eax
jge 0xbc4bb
movq -0x70(%rbp), %rax
movq -0x18(%rbp), %rdi
movslq 0x4c(%rax), %rsi
callq 0x9a070
movq -0x70(%rbp), %rcx
movq %rax, %rdi
movl -0x24(%rbp), %eax
addl 0x50(%rcx), %eax
movslq %eax, %rsi
callq 0x9a090
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
movslq -0x24(%rbp), %rsi
callq 0x9a070
movq %rax, %rdi
movq -0x70(%rbp), %rax
movslq 0x48(%rax), %rsi
callq 0x9a090
movq %rax, %rcx
movq -0x70(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rcx)
movq -0x18(%rbp), %rdi
movslq 0x48(%rax), %rsi
callq 0x9a070
movq %rax, %rdi
movslq -0x24(%rbp), %rsi
callq 0x9a090
movq -0x70(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq 0x38(%rcx), %rdi
movl -0x24(%rbp), %eax
addl 0x50(%rcx), %eax
movslq %eax, %rsi
callq 0x993b0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9e780
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x9e610
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xbcf30
testb $0x1, %al
jne 0xbc35d
jmp 0xbc39f
leaq -0x38(%rbp), %rdi
callq 0x9ec20
movq -0x70(%rbp), %rcx
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addl 0x50(%rcx), %eax
movslq %eax, %rsi
callq 0x9a070
movq %rax, %rdi
movslq -0x44(%rbp), %rsi
callq 0x9a090
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq -0x38(%rbp), %rdi
callq 0xbcf70
jmp 0xbc34a
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x99a50
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x99a80
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x99ab0
testb $0x1, %al
jne 0xbc3d7
jmp 0xbc482
leaq -0x58(%rbp), %rdi
callq 0x99af0
movq -0x70(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl 0x28(%rax), %esi
movl -0x24(%rbp), %edx
callq 0xbd0b0
movq -0x70(%rbp), %rax
movsd %xmm0, -0x80(%rbp)
movq -0x18(%rbp), %rdi
movslq 0x48(%rax), %rsi
callq 0x9a070
movq %rax, %rdi
movslq -0x24(%rbp), %rsi
callq 0x9a090
movsd -0x80(%rbp), %xmm0
movq -0x70(%rbp), %rdi
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x68(%rbp), %rax
movl 0x28(%rax), %esi
movl -0x24(%rbp), %edx
callq 0xbd0b0
movq -0x70(%rbp), %rcx
movsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addl 0x50(%rcx), %eax
movslq %eax, %rsi
callq 0x9a070
movq %rax, %rdi
movq -0x70(%rbp), %rax
movslq 0x4c(%rax), %rsi
callq 0x9a090
movsd -0x78(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x99b10
jmp 0xbc3c1
movq -0x70(%rbp), %rax
movq -0x18(%rbp), %rdi
movslq 0x48(%rax), %rsi
callq 0x9a070
movq %rax, %rdi
movslq -0x24(%rbp), %rsi
callq 0x9a090
movsd (%rax), %xmm0
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xbc28e
movsd -0x20(%rbp), %xmm0
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)