// File: 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
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10100
movl %eax, -0x1c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1f0c0
leaq -0x50(%rbp), %rdi
callq 0x2bcb0
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x28dd6
leaq -0x70(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x1f0c0
movq -0xb0(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x2bcd0
jmp 0x28d92
movl $0x0, -0x80(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1f0e0
jmp 0x28da8
leaq -0x70(%rbp), %rdi
callq 0x1f150
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x28d68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x1f150
jmp 0x29470
movl $0x0, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x29231
movq -0xa8(%rbp), %rax
movq 0x98(%rax), %rdi
movslq -0x84(%rbp), %rsi
callq 0x1e0d0
movq %rax, -0xb8(%rbp)
jmp 0x28e12
movq -0xb8(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
movq %rax, -0xc0(%rbp)
movq -0x90(%rbp), %rdi
callq 0x1e150
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0x29000
movq -0x90(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, %esi
callq 0x1e190
movq %rax, %rdi
callq 0x1de60
testb $0x1, 0x10(%rax)
jne 0x28fea
movq -0x90(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, %esi
callq 0x1e190
movq %rax, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1deb0
movq %rax, -0xc8(%rbp)
jmp 0x28ea9
movq -0xc8(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1df20
movsd %xmm0, -0xd0(%rbp)
jmp 0x28ec7
movsd -0xd0(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x28fea
movq -0x90(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, %esi
callq 0x1e190
movq %rax, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1e1e0
movq %rax, -0xd8(%rbp)
jmp 0x28f0b
movq -0xd8(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1df20
movsd %xmm0, -0xe0(%rbp)
jmp 0x28f29
movsd -0xe0(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x28fea
movq -0x90(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, %esi
callq 0x1e190
movq %rax, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1deb0
movq %rax, -0xe8(%rbp)
jmp 0x28f69
movq -0xe8(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1e0b0
movw %ax, -0xea(%rbp)
jmp 0x28f86
movw -0xea(%rbp), %ax
cwtl
movl %eax, -0x98(%rbp)
movslq -0x98(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1f130
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movslq -0x98(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x2bd40
movq %rax, %rdi
movl -0x94(%rbp), %eax
movl %eax, -0x9c(%rbp)
leaq -0x9c(%rbp), %rsi
callq 0x1f0e0
jmp 0x28fd7
jmp 0x28fea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x29470
jmp 0x28fec
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x28e2a
movq -0xa8(%rbp), %rdi
addq $0x78, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1deb0
movq %rax, -0xf8(%rbp)
jmp 0x29021
movq -0xf8(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1e0b0
movw %ax, -0xfa(%rbp)
jmp 0x2903e
movw -0xfa(%rbp), %ax
cwtl
cmpl -0x84(%rbp), %eax
jne 0x29109
movq -0xa8(%rbp), %rdi
addq $0x78, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1deb0
movq %rax, -0x108(%rbp)
jmp 0x29073
movq -0x108(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1df20
movsd %xmm0, -0x110(%rbp)
jmp 0x29091
movsd -0x110(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x29109
movq -0xa8(%rbp), %rdi
addq $0x78, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1e1e0
movq %rax, -0x118(%rbp)
jmp 0x290c5
movq -0x118(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1df20
movsd %xmm0, -0x120(%rbp)
jmp 0x290e3
movsd -0x120(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x29109
movslq -0x84(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1f130
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0xa8(%rbp), %rdi
addq $0x88, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1deb0
movq %rax, -0x128(%rbp)
jmp 0x2912d
movq -0x128(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1e0b0
movw %ax, -0x12a(%rbp)
jmp 0x2914a
movw -0x12a(%rbp), %ax
cwtl
cmpl -0x84(%rbp), %eax
jne 0x2921b
movq -0xa8(%rbp), %rdi
addq $0x88, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1deb0
movq %rax, -0x138(%rbp)
jmp 0x29182
movq -0x138(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1df20
movsd %xmm0, -0x140(%rbp)
jmp 0x291a0
movsd -0x140(%rbp), %xmm1
movsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x2921b
movq -0xa8(%rbp), %rdi
addq $0x88, %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1e1e0
movq %rax, -0x148(%rbp)
jmp 0x291d7
movq -0x148(%rbp), %rdi
callq 0x1ded0
movq %rax, %rdi
callq 0x1df20
movsd %xmm0, -0x150(%rbp)
jmp 0x291f5
movsd -0x150(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x2921b
movslq -0x84(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1f130
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x2921d
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x28de0
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x29455
movq -0x10(%rbp), %rdi
movslq -0xa0(%rbp), %rsi
callq 0xbfa0
movq %rax, %rdi
callq 0xbef0
movl %eax, -0x154(%rbp)
jmp 0x2926a
movslq -0xa0(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1f130
movq %rax, %rcx
movl -0x154(%rbp), %eax
cmpl (%rcx), %eax
je 0x2943f
movq 0x1fd5e(%rip), %rdi     # 0x48ff0
leaq 0xb4b4(%rip), %rsi      # 0x3474d
callq 0x42b0
movq %rax, -0x160(%rbp)
jmp 0x292a7
movq -0x160(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
callq 0x4550
movq %rax, -0x168(%rbp)
jmp 0x292c1
movq -0x168(%rbp), %rdi
movq 0x1fce1(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0x292d6
movq 0x1fd13(%rip), %rdi     # 0x48ff0
leaq 0xb72f(%rip), %rsi      # 0x34a13
callq 0x42b0
movq %rax, -0x170(%rbp)
jmp 0x292f2
movq -0x170(%rbp), %rdi
movl -0xa0(%rbp), %esi
callq 0x44d0
movq %rax, -0x178(%rbp)
jmp 0x2930d
movq -0x178(%rbp), %rdi
leaq 0xb43c(%rip), %rsi      # 0x34757
callq 0x42b0
movq %rax, -0x180(%rbp)
jmp 0x29329
movq -0x10(%rbp), %rdi
movslq -0xa0(%rbp), %rsi
callq 0xbfa0
movq %rax, %rdi
callq 0xbef0
movl %eax, -0x184(%rbp)
jmp 0x29349
movl -0x184(%rbp), %esi
movq -0x180(%rbp), %rdi
callq 0x44d0
movq %rax, -0x190(%rbp)
jmp 0x29364
movq -0x190(%rbp), %rdi
movq 0x1fc3e(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0x29379
movq 0x1fc70(%rip), %rdi     # 0x48ff0
leaq 0xb68c(%rip), %rsi      # 0x34a13
callq 0x42b0
movq %rax, -0x198(%rbp)
jmp 0x29395
movq -0x198(%rbp), %rdi
movl -0xa0(%rbp), %esi
callq 0x44d0
movq %rax, -0x1a0(%rbp)
jmp 0x293b0
movq -0x1a0(%rbp), %rdi
leaq 0xb3a0(%rip), %rsi      # 0x3475e
callq 0x42b0
movq %rax, -0x1a8(%rbp)
jmp 0x293cc
movslq -0xa0(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1f130
movq -0x1a8(%rbp), %rdi
movl (%rax), %esi
callq 0x44d0
movq %rax, -0x1b0(%rbp)
jmp 0x293f3
movq -0x1b0(%rbp), %rdi
movq 0x1fbaf(%rip), %rsi     # 0x48fb0
callq 0x4300
jmp 0x29408
movq -0xa8(%rbp), %rdi
callq 0x29490
jmp 0x29416
movl $0x8, %edi
callq 0x4130
movq %rax, %rdi
leaq 0xb33c(%rip), %rax      # 0x34766
movq %rax, (%rdi)
movq 0x1fb84(%rip), %rsi     # 0x48fb8
xorl %eax, %eax
movl %eax, %edx
callq 0x44c0
jmp 0x2948b
jmp 0x29441
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0x2923b
leaq -0x50(%rbp), %rdi
callq 0x2bd60
leaq -0x38(%rbp), %rdi
callq 0x1f150
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x2bd60
leaq -0x38(%rbp), %rdi
callq 0x1f150
movq -0x78(%rbp), %rdi
callq 0x44e0
nopl (%rax,%rax)