// File: /workspace/github_cpp_makefile_star2_O2/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
andq $0x0, 0x48(%rdi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x38(%rdi)
movabsq $0x3eb0c6f7a0b5ed8d, %rax # imm = 0x3EB0C6F7A0B5ED8D
movq %rax, 0x50(%rdi)
leaq 0x60(%rdi), %rax
movq %rax, 0x8(%rsp)
andl $0x0, 0xd0(%rdi)
movb $0x0, 0xe8(%rdi)
andl $0x0, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movupd %xmm0, 0x60(%rdi)
movupd %xmm0, 0x70(%rdi)
andq $0x0, 0x90(%rdi)
movupd %xmm0, 0x80(%rdi)
movupd %xmm0, 0x100(%rdi)
movupd %xmm0, 0x110(%rdi)
movq %rsi, 0x8(%rdi)
pushq $0x50
popq %rdi
callq 0x3260
movq %rax, %r12
movq %rax, %rdi
callq 0x11cc2
movq %r12, 0xd8(%rbx)
movsd 0x28(%r15), %xmm0
divsd 0x20(%r15), %xmm0
movsd %xmm0, 0xe0(%rbx)
andw $0x0, 0xf8(%rbx)
movsd 0x18(%r15), %xmm0
addsd 0x3fc1(%rip), %xmm0     # 0x14008
mulsd 0x10(%r15), %xmm0
movsd %xmm0, 0xc8(%rbx)
leaq 0x50(%r15), %rsi
movq 0x8(%rsp), %rdi
callq 0xdc62
movq %r14, (%rbx)
pushq $0x18
popq %rdi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0x98(%rbx)
pushq $0x18
popq %rdi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0xa0(%rbx)
pushq $0x18
popq %rdi
callq 0x3260
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $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 0x100e6
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3140
movq %r12, 0xb8(%rbx)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x4b3e(%rip), %rbp      # 0x14c3a
movzwl 0x3c(%r15), %eax
cmpq %rax, %r12
jae 0x101b1
movq 0x98(%rbx), %rdi
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %r13, %rsi
callq 0x122d6
movq %r13, %rdi
callq 0x11ca0
movq 0xeeb8(%rip), %rdi      # 0x1eff0
leaq 0x6506(%rip), %rsi      # 0x16645
callq 0x3250
movq %rax, %rdi
movl %r12d, %esi
callq 0x33f0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3250
movq %rax, %r14
movq 0x98(%rbx), %rdi
movq %r12, %rsi
callq 0xdab2
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x4, %rsi
movq %r14, %rdi
callq 0x31a0
movq %rax, %rdi
callq 0x3100
movq 0xa0(%rbx), %r14
movq %r13, %rdi
callq 0x11cde
movq %r14, %rdi
movq %r13, %rsi
callq 0x12650
movq %r13, %rdi
callq 0x11f1a
incq %r12
jmp 0x100fc
movl 0x30(%r15), %r14d
leaq 0x8(,%r14,8), %rdi
callq 0x3030
movq %rax, %r12
movq %r14, (%rax)
addq $0x8, %r12
testq %r14, %r14
je 0x101e3
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)
pushq $0x18
popq %rdi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0x18(%rbx)
pushq $0x18
popq %rdi
callq 0x3260
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0xa8(%rbx)
pushq $0x18
popq %rdi
callq 0x3260
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0x58(%rbx)
movq 0x80(%r15), %r14
movq (%r14), %r14
cmpq 0x80(%r15), %r14
je 0x10268
movq 0x58(%rbx), %rdi
leaq 0x10(%r14), %rsi
callq 0x6d50
jmp 0x1024d
pushq $0x30
popq %rdi
callq 0x3260
movq %rax, %rcx
addq $0x8, %rcx
andl $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0xf0(%rbx)
movq 0x90(%r15), %rbx
testq %rbx, %rbx
je 0x102bf
movq 0x18(%rbx), %rax
addq $0x8, %rbx
cmpq %rbx, %rax
je 0x102bf
movq 0x20(%rax), %rcx
andl $0x0, 0x18(%rcx)
movq %rax, %rdi
callq 0x32a0
jmp 0x102a8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10304
movq %rax, %r14
pushq $0x50
popq %rsi
movq %r12, %rdi
callq 0x3270
jmp 0x10307
jmp 0x10304
jmp 0x10304
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x11ca0
jmp 0x10307
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x11f1a
jmp 0x10307
jmp 0x10304
movq %rax, %r14
leaq 0x38(%rbx), %r15
leaq 0x48(%rbx), %r13
leaq 0x40(%rbx), %r12
leaq 0x118(%rbx), %rdi
callq 0xdff8
leaq 0x108(%rbx), %rdi
callq 0xdff8
leaq 0x90(%rbx), %rdi
callq 0xdff8
subq $-0x80, %rbx
movq %rbx, %rdi
callq 0xdff8
movq 0x8(%rsp), %rdi
callq 0x6c12
movq %r13, %rdi
callq 0xdb46
movq %r12, %rdi
callq 0xdb46
movq %r15, %rdi
callq 0xdb46
movq %r14, %rdi
callq 0x3400
nop