// File: /workspace/github_cpp_makefile_star2_O1/gchen98[P]macs/datastructures.cpp
// Function: GraphBuilder::GraphBuilder(Configuration*, RandNumGenerator*)
GraphBuilder::GraphBuilder(Configuration *pConfig,RandNumGenerator * pRG){
    this->iGraphIteration = 0;
    this->bIncrementHistory = false;
    this->iTotalTreeEdges = 0;
    this->dArgLength = 0.;
    this->pConfig = pConfig;
    this->pChrPositionQueue = new ChrPositionQueue;
    this->dTrailingGap = pConfig->dBasesToTrack/pConfig->dSeqLength;
    this->bEndGeneConversion = false;
    this->bBeginGeneConversion = false;
    this->dScaledRecombRate = pConfig->dRecombRateRAcrossSites*
    (pConfig->dGeneConvRatio+1.);
    this->dMigrationMatrix = pConfig->dMigrationMatrix;
    this->pRandNumGenerator = pRG;
    this->pEdgeVectorByPop = new EdgePtrVectorByPop;
    this->pVectorIndicesToRecycle = new EdgeIndexQueueByPop;
    this->pEdgeListInARG = new EdgePtrList;
    this->pTreeEdgesToCoalesceArray = new EdgePtr[pConfig->iSampleSize];
    for (int i=0;i<pConfig->iTotalPops;++i){
        this->pEdgeVectorByPop->push_back(EdgePtrVector());
        cerr<<"DEBUG: Size at "<<i<<" is "<<this->pEdgeVectorByPop->at(i).size()<<endl;
        this->pVectorIndicesToRecycle->push_back(EdgeIndexQueue());
    }
    this->pSampleNodeArray = new NodePtr[pConfig->iSampleSize];
    sites = new bool[pConfig->iSampleSize];
    this->pEdgeVectorInTree = new EdgePtrVector;
    this->pMutationPtrVector = new MutationPtrVector;
    this->pEventList = new EventPtrList;
    EventPtrList::iterator it = pConfig->pEventList->begin();
    for (it=pConfig->pEventList->begin();it!=pConfig->pEventList->end();++it){
        this->pEventList->push_back(*it);
    }
    this->pGeneConversionPtrSet = new GeneConversionPtrSet;
    if (pConfig->pAlleleFreqBinPtrSet!=NULL){
      AlleleFreqBinPtrSet::iterator it2;
      for (it2=pConfig->pAlleleFreqBinPtrSet->begin();it2!=pConfig->pAlleleFreqBinPtrSet->end();++it2){
        AlleleFreqBinPtr ptr = *it2;
        ptr->iObservedCounts = 0;
      }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rdi)
xorl %eax, %eax
movq %rax, 0x48(%rdi)
movabsq $0x3eb0c6f7a0b5ed8d, %rcx # imm = 0x3EB0C6F7A0B5ED8D
movq %rcx, 0x50(%rdi)
leaq 0x60(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movl %eax, 0xd0(%rdi)
movb $0x0, 0xe8(%rdi)
movl %eax, 0x20(%rdi)
movq %rax, 0x28(%rdi)
movupd %xmm0, 0x60(%rdi)
movupd %xmm0, 0x70(%rdi)
movupd %xmm0, 0x80(%rdi)
movq %rax, 0x90(%rdi)
movupd %xmm0, 0x100(%rdi)
movupd %xmm0, 0x110(%rdi)
movq %rsi, 0x8(%rdi)
movl $0x50, %edi
callq 0x3260
movq %rax, %r12
xorpd %xmm0, %xmm0
movupd %xmm0, 0x40(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, 0x10(%rax)
movupd %xmm0, (%rax)
movq %rax, %rdi
xorl %esi, %esi
callq 0x15540
movq %r12, 0xd8(%rbx)
movsd 0x28(%r15), %xmm0
divsd 0x20(%r15), %xmm0
movsd %xmm0, 0xe0(%rbx)
movw $0x0, 0xf8(%rbx)
movsd 0x18(%r15), %xmm0
addsd 0x4639(%rip), %xmm0     # 0x17008
mulsd 0x10(%r15), %xmm0
movsd %xmm0, 0xc8(%rbx)
leaq 0x50(%r15), %rsi
movq 0x8(%rsp), %rdi
callq 0x10908
movq %r14, (%rbx)
movl $0x18, %edi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x98(%rbx)
movl $0x18, %edi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0xa0(%rbx)
movl $0x18, %edi
callq 0x3260
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x10(%rbx)
movl 0x30(%r15), %r13d
movq %r13, %r14
shlq $0x4, %r14
leaq 0x8(%r14), %rdi
callq 0x3030
movq %rax, %r12
movq %r13, (%rax)
addq $0x8, %r12
testq %r13, %r13
je 0x12a7d
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3140
movq %r12, 0xb8(%rbx)
cmpw $0x0, 0x3c(%r15)
je 0x12bcb
movl $0x8, %ebp
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
movq 0x98(%rbx), %rdi
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq %r13, %rsi
callq 0x156b8
movq %r13, %rdi
callq 0x1526a
movl $0xf, %edx
movq 0xd51d(%rip), %rdi      # 0x1fff0
leaq 0x6b5b(%rip), %rsi      # 0x19635
callq 0x32a0
movq 0xd50a(%rip), %rdi      # 0x1fff0
movl %r12d, %esi
callq 0x33e0
movq %rax, %r14
movl $0x4, %edx
movq %rax, %rdi
leaq 0x5131(%rip), %rsi      # 0x17c31
callq 0x32a0
movq 0x98(%rbx), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rdx
cmpq %r12, %rdx
jbe 0x12d02
movq (%rax,%rbp), %rsi
subq -0x8(%rax,%rbp), %rsi
sarq $0x4, %rsi
movq %r14, %rdi
callq 0x31a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3240
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq 0xa0(%rbx), %r14
xorpd %xmm0, %xmm0
movapd %xmm0, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movapd %xmm0, 0x10(%rsp)
movq %r13, %rdi
xorl %esi, %esi
callq 0x158f6
movq %r14, %rdi
movq %r13, %rsi
callq 0x15a50
movq %r13, %rdi
callq 0x154ac
incq %r12
movzwl 0x3c(%r15), %eax
addq $0x18, %rbp
cmpq %rax, %r12
jb 0x12a9d
movl 0x30(%r15), %r14d
leaq 0x8(,%r14,8), %rdi
callq 0x3030
movq %rax, %r12
movq %r14, (%rax)
addq $0x8, %r12
testq %r14, %r14
je 0x12bfd
leaq (,%r14,8), %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x3140
movq %r12, 0xc0(%rbx)
movq %r14, %rdi
callq 0x3030
movq %rax, 0xb0(%rbx)
movl $0x18, %edi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x18(%rbx)
movl $0x18, %edi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0xa8(%rbx)
movl $0x18, %edi
callq 0x3260
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x58(%rbx)
movq 0x80(%r15), %r14
movq (%r14), %r14
cmpq 0x80(%r15), %r14
je 0x12c94
movq 0x58(%rbx), %rdi
leaq 0x10(%r14), %rdx
movq %rdi, %rsi
callq 0x924c
jmp 0x12c76
movl $0x30, %edi
callq 0x3260
movq %rax, %rcx
addq $0x8, %rcx
movl $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rax, 0xf0(%rbx)
movq 0x90(%r15), %rbx
testq %rbx, %rbx
je 0x12cf3
movq 0x18(%rbx), %rax
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x12cf3
movq 0x20(%rax), %rcx
movl $0x0, 0x18(%rcx)
movq %rax, %rdi
callq 0x32b0
jmp 0x12cd9
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x67cf(%rip), %rdi      # 0x194d8
movq %r12, %rsi
xorl %eax, %eax
callq 0x3320
jmp 0x12d4d
movq %rax, %r14
movl $0x50, %esi
movq %r12, %rdi
callq 0x3270
jmp 0x12d50
jmp 0x12d4d
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x1526a
jmp 0x12d50
jmp 0x12d4d
jmp 0x12d4d
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x154ac
jmp 0x12d50
jmp 0x12d4d
movq %rax, %r14
leaq 0x118(%rbx), %rdi
callq 0x10dec
leaq 0x108(%rbx), %rdi
callq 0x10dec
leaq 0x90(%rbx), %rdi
callq 0x10dec
leaq 0x80(%rbx), %rdi
callq 0x10dec
movq 0x8(%rsp), %rdi
callq 0x81fe
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x12d9f
decq 0x8(%rdi)
jne 0x12d9f
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rdi
addq $0x38, %rbx
testq %rdi, %rdi
je 0x12db8
decq 0x8(%rdi)
jne 0x12db8
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x12dcc
decq 0x8(%rdi)
jne 0x12dcc
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x33f0