// File: /workspace/github_cpp_makefile_star2_O2/gchen98[P]macs/datastructures.cpp
// Function: GraphBuilder::checkPopCountIntegrity(std::vector<Population, std::allocator<Population>>&, double)
void GraphBuilder::checkPopCountIntegrity(PopVector & pPopList,
double dTime){
    int iTotalPops = pPopList.size();
    vector<int> iCounts;
    vector <vector <int> > edgeIndices;
    for (int k=0;k<iTotalPops;++k){
        vector<int> temp;
        edgeIndices.push_back(temp);
        iCounts.push_back(0);    }
    for (int k=0;k<iTotalPops;++k){
        EdgePtrVector & pEdgeVector = this->pEdgeVectorByPop->at(k);
        for (unsigned int i=0;i<pEdgeVector.size();++i){
            if (!pEdgeVector[i]->bDeleted && pEdgeVector[i]
            ->getBottomNodeRef()->getHeight()<=dTime &&
            pEdgeVector[i]->getTopNodeRef()->getHeight()>dTime){
                int iPopulation = pEdgeVector[i]->getBottomNodeRef()->getPopulation();
                ++iCounts[iPopulation];
                edgeIndices[iPopulation].push_back(i);
            }
        }
        if (coalescingEdge->getBottomNodeRef()->getPopulation()==k &&
            coalescingEdge->getBottomNodeRef()->getHeight()<=dTime &&
            coalescingEdge->getTopNodeRef()->getHeight()>dTime){
                ++iCounts[k];
        }
        if (originExtension->getBottomNodeRef()->getPopulation()==k &&
            originExtension->getBottomNodeRef()->getHeight()<=dTime &&
            originExtension->getTopNodeRef()->getHeight()>dTime){
                ++iCounts[k];
        }
    }

    for (int j=0;j<iTotalPops;++j){
        if (pPopList[j].getChrSampled()!=iCounts[j]){
            cerr<<"At time: "<<dTime<<endl;
            cerr<<"pop:"<<j<<",size:"<<pPopList[j].getChrSampled()<<endl;
            cerr<<"pop:"<<j<<",found:"<<iCounts[j]<<endl;
            printDataStructures();
            throw "Mismatch in pop counts in CheckPopCountIntegrity" ;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movsd %xmm0, (%rsp)
movq 0x8(%rsi), %rax
movq %rsi, 0x28(%rsp)
subq (%rsi), %rax
movq %rdi, 0x8(%rsp)
shrq $0x5, %rax
xorpd %xmm0, %xmm0
leaq 0x30(%rsp), %rbx
movapd %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x70(%rsp), %r14
andq $0x0, 0x10(%r14)
xorl %ebp, %ebp
testl %eax, %eax
cmovgl %eax, %ebp
movapd %xmm0, (%r14)
leaq 0x50(%rsp), %r15
leaq 0x24(%rsp), %r12
movl %ebp, %r13d
subl $0x1, %r13d
jb 0x10409
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x11cfa
andl $0x0, 0x24(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xee94
movq %r15, %rdi
callq 0xee60
jmp 0x103ce
movq 0x8(%rsp), %rax
leaq 0x78(%rax), %rcx
movq %rcx, 0x18(%rsp)
addq $0x88, %rax
movq %rax, 0x10(%rsp)
movl %ebp, %r12d
xorl %r13d, %r13d
leaq 0x50(%rsp), %rbp
cmpq %r12, %r13
je 0x105cf
movq 0x8(%rsp), %rax
movq 0x98(%rax), %rdi
movq %r13, %rsi
callq 0xdab2
movq %rax, %r14
xorl %r15d, %r15d
movl %r15d, %ebx
movq (%r14), %rdi
movq 0x8(%r14), %rax
subq %rdi, %rax
sarq $0x4, %rax
cmpq %rbx, %rax
jbe 0x104fb
shlq $0x4, %rbx
addq %rbx, %rdi
callq 0xda24
cmpb $0x0, 0x10(%rax)
jne 0x104f3
movq (%r14), %rdi
addq %rbx, %rdi
callq 0xda24
leaq 0x20(%rax), %rdi
callq 0xda4e
movsd (%rsp), %xmm0
ucomisd 0x70(%rax), %xmm0
jb 0x104f3
movq (%r14), %rdi
addq %rbx, %rdi
callq 0xda24
leaq 0x18(%rax), %rdi
callq 0xda4e
movsd 0x70(%rax), %xmm0
ucomisd (%rsp), %xmm0
jbe 0x104f3
addq (%r14), %rbx
movq %rbx, %rdi
callq 0xda24
leaq 0x20(%rax), %rdi
callq 0xda4e
movswq 0x62(%rax), %rax
movq 0x30(%rsp), %rcx
incl (%rcx,%rax,4)
imulq $0x18, %rax, %rdi
addq 0x70(%rsp), %rdi
movl %r15d, 0x50(%rsp)
movq %rbp, %rsi
callq 0xee94
incl %r15d
jmp 0x10450
movq 0x18(%rsp), %rdi
callq 0xda24
leaq 0x20(%rax), %rdi
callq 0xda4e
movswq 0x62(%rax), %rax
movl %eax, %eax
cmpq %rax, %r13
jne 0x10561
movq 0x18(%rsp), %rdi
callq 0xda24
leaq 0x20(%rax), %rdi
callq 0xda4e
movsd (%rsp), %xmm0
ucomisd 0x70(%rax), %xmm0
jb 0x10561
movq 0x18(%rsp), %rdi
callq 0xda24
leaq 0x18(%rax), %rdi
callq 0xda4e
movsd 0x70(%rax), %xmm0
ucomisd (%rsp), %xmm0
jbe 0x10561
movq 0x30(%rsp), %rax
incl (%rax,%r13,4)
movq 0x10(%rsp), %rdi
callq 0xda24
leaq 0x20(%rax), %rdi
callq 0xda4e
movswq 0x62(%rax), %rax
movl %eax, %eax
cmpq %rax, %r13
jne 0x105c7
movq 0x10(%rsp), %rdi
callq 0xda24
leaq 0x20(%rax), %rdi
callq 0xda4e
movsd (%rsp), %xmm0
ucomisd 0x70(%rax), %xmm0
jb 0x105c7
movq 0x10(%rsp), %rdi
callq 0xda24
leaq 0x18(%rax), %rdi
callq 0xda4e
movsd 0x70(%rax), %xmm0
ucomisd (%rsp), %xmm0
jbe 0x105c7
movq 0x30(%rsp), %rax
incl (%rax,%r13,4)
incq %r13
jmp 0x1042d
movq 0x28(%rsp), %rax
movq (%rax), %rax
pushq $0x4
popq %rbx
movq 0x30(%rsp), %rcx
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x105f9
movl (%rax,%rbx,4), %edx
cmpl (%rcx,%r15,4), %edx
jne 0x1061f
incq %r15
addq $0x8, %rbx
jmp 0x105e2
leaq 0x70(%rsp), %rdi
callq 0x11d26
leaq 0x30(%rsp), %rdi
callq 0xee60
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe9ca(%rip), %rdi      # 0x1eff0
leaq 0x6028(%rip), %rsi      # 0x16655
callq 0x3250
movq %rax, %rdi
movsd (%rsp), %xmm0
callq 0x3370
movq %rax, %rdi
callq 0x3100
movq 0xe9a2(%rip), %rdi      # 0x1eff0
leaq 0x625b(%rip), %rsi      # 0x168b0
callq 0x3250
movq %rax, %rdi
movl %r15d, %esi
callq 0x33f0
leaq 0x5ff3(%rip), %rsi      # 0x1665f
movq %rax, %rdi
callq 0x3250
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rbx,4), %esi
movq %rax, %rdi
callq 0x33f0
movq %rax, %rdi
callq 0x3100
movq 0xe95a(%rip), %rdi      # 0x1eff0
leaq 0x6213(%rip), %rsi      # 0x168b0
callq 0x3250
movq %rax, %rdi
movl %r15d, %esi
callq 0x33f0
leaq 0x5fb2(%rip), %rsi      # 0x16666
movq %rax, %rdi
callq 0x3250
movq 0x30(%rsp), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x33f0
movq %rax, %rdi
callq 0x3100
movq 0x8(%rsp), %rdi
callq 0x10736
pushq $0x8
popq %rdi
callq 0x3110
leaq 0x5f80(%rip), %rcx      # 0x1666e
movq %rcx, (%rax)
movq 0xe8c8(%rip), %rsi      # 0x1efc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33e0
jmp 0x10717
jmp 0x10717
jmp 0x10708
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xee60
jmp 0x1071a
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x11d26
leaq 0x30(%rsp), %rdi
callq 0xee60
movq %rbx, %rdi
callq 0x3400