// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movsd %xmm0, 0x8(%rsp)
movq 0x8(%rsi), %rcx
movq %rsi, 0x48(%rsp)
subq (%rsi), %rcx
shrq $0x5, %rcx
xorl %eax, %eax
movq %rax, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq %rax, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
testl %ecx, %ecx
jle 0x12f76
movq %rdi, %rbx
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x2c(%rsp), %rbp
movq %rcx, 0x70(%rsp)
movl %ecx, %r14d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1513e
movl $0x0, 0x2c(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12d44
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12d4f
movq %r13, %rdi
movq %rbp, %rdx
callq 0x117d0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x12d66
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
decl %r14d
jne 0x12d01
movq 0x70(%rsp), %r14
testl %r14d, %r14d
jle 0x12f76
movl %r14d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movq 0x98(%rbx), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
cmpq %r15, %rdx
jbe 0x12fe4
leaq (%r15,%r15,2), %rdx
movq (%rsi,%rdx,8), %rax
movq 0x8(%rsi,%rdx,8), %rcx
cmpq %rax, %rcx
je 0x12e7f
leaq (%rsi,%rdx,8), %r12
movl $0x1, %ebp
xorl %edx, %edx
shlq $0x4, %rdx
movq (%rax,%rdx), %rsi
testq %rsi, %rsi
je 0x12fa6
cmpb $0x0, 0x10(%rsi)
jne 0x12e68
movq 0x20(%rsi), %rdx
testq %rdx, %rdx
je 0x12fc5
movsd 0x8(%rsp), %xmm0
ucomisd 0x70(%rdx), %xmm0
jb 0x12e68
movq 0x18(%rsi), %rsi
testq %rsi, %rsi
je 0x12fc5
movsd 0x70(%rsi), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x12e68
movswq 0x62(%rdx), %rsi
movq 0x10(%rsp), %rdx
incl (%rdx,%rsi,4)
leal -0x1(%rbp), %edx
movq 0x50(%rsp), %rdi
leaq (%rsi,%rsi,2), %rsi
leaq (%rdi,%rsi,8), %rdi
movl %edx, 0x30(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x12e55
movl %edx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x12e68
leaq 0x30(%rsp), %rdx
callq 0x117d0
movq (%r12), %rax
movq 0x8(%r12), %rcx
movl %ebp, %edx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x4, %rsi
incl %ebp
cmpq %rdx, %rsi
ja 0x12dd3
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x12fa6
movq 0x20(%rax), %rcx
testq %rcx, %rcx
je 0x12fc5
movswq 0x62(%rcx), %rdx
movl %edx, %edx
cmpq %rdx, %r15
jne 0x12ed5
movsd 0x8(%rsp), %xmm0
ucomisd 0x70(%rcx), %xmm0
jb 0x12ed5
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x12fc5
movsd 0x70(%rax), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x12ed5
movq 0x10(%rsp), %rax
incl (%rax,%r15,4)
movq 0x88(%rbx), %rax
testq %rax, %rax
je 0x12fa6
movq 0x20(%rax), %rcx
testq %rcx, %rcx
je 0x12fc5
movswq 0x62(%rcx), %rdx
movl %edx, %edx
cmpq %rdx, %r15
jne 0x12f2e
movsd 0x8(%rsp), %xmm0
ucomisd 0x70(%rcx), %xmm0
jb 0x12f2e
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x12fc5
movsd 0x70(%rax), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x12f2e
movq 0x10(%rsp), %rax
incl (%rax,%r15,4)
incq %r15
cmpq %r13, %r15
jne 0x12d86
testl %r14d, %r14d
jle 0x12f76
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rsp), %rcx
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movl $0x4, %r13d
xorl %r15d, %r15d
movl (%rax,%r13,4), %edx
cmpl (%rcx,%r15,4), %edx
jne 0x12ff5
incq %r15
addq $0x8, %r13
cmpq %r15, %r14
jne 0x12f5c
leaq 0x50(%rsp), %rdi
callq 0x1516a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x12f97
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5b4b(%rip), %rdi      # 0x18af8
leaq 0x64b2(%rip), %rsi      # 0x19466
leaq 0x64d7(%rip), %rcx      # 0x19492
movl $0x2d8, %edx            # imm = 0x2D8
callq 0x3170
leaq 0x5b2c(%rip), %rdi      # 0x18af8
leaq 0x5b2d(%rip), %rsi      # 0x18b00
leaq 0x6521(%rip), %rcx      # 0x194fb
movl $0xc7, %edx
callq 0x3170
leaq 0x654d(%rip), %rdi      # 0x19538
movq %r15, %rsi
xorl %eax, %eax
callq 0x3320
movq 0xcff4(%rip), %rdi      # 0x1fff0
leaq 0x66a2(%rip), %rsi      # 0x196a5
movl $0x9, %edx
callq 0x32a0
movq 0xcfdc(%rip), %rdi      # 0x1fff0
movsd 0x8(%rsp), %xmm0
callq 0x3360
movq %rax, %rdi
callq 0x30f0
movq 0xcfc2(%rip), %rdi      # 0x1fff0
leaq 0x68cb(%rip), %rsi      # 0x19900
movl $0x4, %edx
callq 0x32a0
movq 0xcfaa(%rip), %rdi      # 0x1fff0
movl %r15d, %esi
callq 0x33e0
movq %rax, %r12
leaq 0x6657(%rip), %rsi      # 0x196af
movl $0x6, %edx
movq %rax, %rdi
callq 0x32a0
movq 0x48(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r13,4), %esi
movq %r12, %rdi
callq 0x33e0
movq %rax, %rdi
callq 0x30f0
movq 0xcf68(%rip), %rdi      # 0x1fff0
leaq 0x6871(%rip), %rsi      # 0x19900
movl $0x4, %edx
callq 0x32a0
movq 0xcf50(%rip), %rdi      # 0x1fff0
movl %r15d, %esi
callq 0x33e0
movq %rax, %r14
leaq 0x6604(%rip), %rsi      # 0x196b6
movl $0x7, %edx
movq %rax, %rdi
callq 0x32a0
movq 0x10(%rsp), %rax
movl (%rax,%r15,4), %esi
movq %r14, %rdi
callq 0x33e0
movq %rax, %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x13154
movl $0x8, %edi
callq 0x3100
leaq 0x65cd(%rip), %rcx      # 0x196be
movq %rcx, (%rax)
movq 0xceb5(%rip), %rsi      # 0x1ffb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33d0
jmp 0x13110
jmp 0x1310b
jmp 0x1310b
movq %rax, %rbx
jmp 0x1312a
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1312a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x50(%rsp), %rdi
callq 0x1516a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1314b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq %rbx, %rdi
callq 0x33f0
nop