// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movq %rsi, 0x48(%rsp)
subq (%rsi), %r14
shrq $0x5, %r14
xorl %eax, %eax
movq %rax, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq %rax, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
testl %r14d, %r14d
jle 0x12e9a
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x2c(%rsp), %rbp
movl %r14d, %r13d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x152ac
movl $0x0, 0x2c(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x12e71
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x12e7e
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x1183c
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x12e95
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
decl %r13d
jne 0x12e2e
testl %r14d, %r14d
jle 0x1305e
movl %r14d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movq 0x98(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rdx
cmpq %r15, %rdx
jbe 0x13214
leaq (%r15,%r15,2), %rdx
movq (%rcx,%rdx,8), %rax
cmpq %rax, 0x8(%rcx,%rdx,8)
je 0x12fa3
leaq (%rcx,%rdx,8), %r12
movl $0x1, %ebp
xorl %ecx, %ecx
shlq $0x4, %rcx
movq (%rax,%rcx), %rcx
testq %rcx, %rcx
je 0x130c6
cmpb $0x0, 0x10(%rcx)
jne 0x12f86
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x130e5
movsd 0x8(%rsp), %xmm0
ucomisd 0x70(%rax), %xmm0
jb 0x12f86
movq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x130e5
movsd 0x70(%rcx), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x12f86
movswq 0x62(%rax), %rcx
movq 0x10(%rsp), %rax
incl (%rax,%rcx,4)
leal -0x1(%rbp), %eax
movq 0x50(%rsp), %rdx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rdi
movl %eax, 0x30(%rsp)
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x12f7c
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x12f86
leaq 0x30(%rsp), %rdx
callq 0x1183c
movl %ebp, %ecx
movq (%r12), %rax
movq 0x8(%r12), %rdx
subq %rax, %rdx
sarq $0x4, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x12efa
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x130c6
movq 0x20(%rax), %rcx
testq %rcx, %rcx
je 0x130e5
movswq 0x62(%rcx), %rdx
movl %edx, %edx
cmpq %rdx, %r15
jne 0x12ff9
movsd 0x8(%rsp), %xmm0
ucomisd 0x70(%rcx), %xmm0
jb 0x12ff9
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x130e5
movsd 0x70(%rax), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x12ff9
movq 0x10(%rsp), %rax
incl (%rax,%r15,4)
movq 0x88(%rbx), %rax
testq %rax, %rax
je 0x130c6
movq 0x20(%rax), %rcx
testq %rcx, %rcx
je 0x130e5
movswq 0x62(%rcx), %rdx
movl %edx, %edx
cmpq %rdx, %r15
jne 0x13052
movsd 0x8(%rsp), %xmm0
ucomisd 0x70(%rcx), %xmm0
jb 0x13052
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x130e5
movsd 0x70(%rax), %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0x13052
movq 0x10(%rsp), %rax
incl (%rax,%r15,4)
incq %r15
cmpq %r13, %r15
jne 0x12eb0
testl %r14d, %r14d
jle 0x13096
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 0x13104
incq %r15
addq $0x8, %r13
cmpq %r15, %r14
jne 0x13080
leaq 0x50(%rsp), %rdi
callq 0x152d8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x130b7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a2b(%rip), %rdi      # 0x18af8
leaq 0x6332(%rip), %rsi      # 0x19406
leaq 0x6357(%rip), %rcx      # 0x19432
movl $0x2d8, %edx            # imm = 0x2D8
callq 0x3170
leaq 0x5a0c(%rip), %rdi      # 0x18af8
leaq 0x5a0d(%rip), %rsi      # 0x18b00
leaq 0x63a1(%rip), %rcx      # 0x1949b
movl $0xc7, %edx
callq 0x3170
movq 0xcee5(%rip), %rdi      # 0x1fff0
leaq 0x6533(%rip), %rsi      # 0x19645
movl $0x9, %edx
callq 0x32a0
movq 0xcecd(%rip), %rdi      # 0x1fff0
movsd 0x8(%rsp), %xmm0
callq 0x3360
movq %rax, %rdi
callq 0x30f0
movq 0xceb3(%rip), %rdi      # 0x1fff0
leaq 0x675c(%rip), %rsi      # 0x198a0
movl $0x4, %edx
callq 0x32a0
movq 0xce9b(%rip), %rdi      # 0x1fff0
movl %r15d, %esi
callq 0x33e0
movq %rax, %r12
leaq 0x64e8(%rip), %rsi      # 0x1964f
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 0xce59(%rip), %rdi      # 0x1fff0
leaq 0x6702(%rip), %rsi      # 0x198a0
movl $0x4, %edx
callq 0x32a0
movq 0xce41(%rip), %rdi      # 0x1fff0
movl %r15d, %esi
callq 0x33e0
movq %rax, %r14
leaq 0x6495(%rip), %rsi      # 0x19656
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 0x13274
movl $0x8, %edi
callq 0x3100
leaq 0x645e(%rip), %rcx      # 0x1965e
movq %rcx, (%rax)
movq 0xcda6(%rip), %rsi      # 0x1ffb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33d0
leaq 0x62bd(%rip), %rdi      # 0x194d8
movq %r15, %rsi
xorl %eax, %eax
callq 0x3320
jmp 0x13257
jmp 0x1322b
jmp 0x1322b
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x152d8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1324f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
movq %rbx, %rdi
callq 0x33f0
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1322e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
jmp 0x1322e
nop