// File: gchen98[P]macs/datastructures.cpp
// Function: GraphBuilder::initializeCurrentTree()
void GraphBuilder::initializeCurrentTree(){
    // this method does two things, traverses the edges
    // to compute the total length, and clears out the status for
    // in current tree
    dLastTreeLength = 0.0;
    dArgLength = 0.;
    if (iGraphIteration==0){
        EdgePtrList::iterator it;
        for (it=pEdgeListInARG->begin();it!=pEdgeListInARG->end();++it){
            EdgePtr curEdge=*it;
            dLastTreeLength+=curEdge->getLength();
            this->addEdgeToCurrentTree(curEdge);
            curEdge->bInCurrentTree = false;
        }
        dArgLength = dLastTreeLength;
    }else{
        EdgePtrList::iterator it1=pEdgeListInARG->begin();
        while(it1!=pEdgeListInARG->end()){
            EdgePtr curEdge = *it1;
            if (!curEdge->bDeleted){
              dArgLength+=curEdge->getLength();
              if (curEdge->bInCurrentTree){
                dLastTreeLength+=curEdge->getLength();
                curEdge->bInCurrentTree = false;
              }
              ++it1;
            }else{
              it1 = pEdgeListInARG->erase(it1);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rax)
cmpl $0x0, 0xd0(%rax)
jne 0x2a7b7
leaq -0x10(%rbp), %rdi
callq 0x2bed0
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1f1f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1f250
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1f220
testb $0x1, %al
jne 0x2a70d
jmp 0x2a7a4
leaq -0x10(%rbp), %rdi
callq 0x1f280
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x1df40
movq -0x88(%rbp), %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1e050
movsd %xmm0, -0x80(%rbp)
jmp 0x2a744
movq -0x78(%rbp), %rdi
movsd -0x80(%rbp), %xmm1
movsd 0x30(%rdi), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rdi)
leaq -0x30(%rbp), %rsi
callq 0x2a5d0
jmp 0x2a766
leaq -0x30(%rbp), %rdi
callq 0x1de60
movb $0x0, 0x12(%rax)
leaq -0x30(%rbp), %rdi
callq 0x1e090
leaq -0x10(%rbp), %rdi
callq 0x1f2e0
jmp 0x2a6e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1e090
jmp 0x2a90a
movq -0x78(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, 0x28(%rax)
jmp 0x2a901
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1f1f0
movq %rax, -0x48(%rbp)
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1f250
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1f220
testb $0x1, %al
jne 0x2a7ef
jmp 0x2a8ff
leaq -0x48(%rbp), %rdi
callq 0x1f280
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x1df40
leaq -0x60(%rbp), %rdi
callq 0x1de60
testb $0x1, 0x10(%rax)
jne 0x2a8b9
leaq -0x60(%rbp), %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1e050
movsd %xmm0, -0x90(%rbp)
jmp 0x2a832
movq -0x78(%rbp), %rax
movsd -0x90(%rbp), %xmm0
addsd 0x28(%rax), %xmm0
movsd %xmm0, 0x28(%rax)
leaq -0x60(%rbp), %rdi
callq 0x1de60
testb $0x1, 0x12(%rax)
je 0x2a8ae
leaq -0x60(%rbp), %rdi
callq 0x1de60
movq %rax, %rdi
callq 0x1e050
movsd %xmm0, -0x98(%rbp)
jmp 0x2a872
movq -0x78(%rbp), %rax
movsd -0x98(%rbp), %xmm0
addsd 0x30(%rax), %xmm0
movsd %xmm0, 0x30(%rax)
leaq -0x60(%rbp), %rdi
callq 0x1de60
movb $0x0, 0x12(%rax)
jmp 0x2a8ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1e090
jmp 0x2a90a
leaq -0x48(%rbp), %rdi
callq 0x1f2e0
jmp 0x2a8f1
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xa0(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x252a0
movq -0xa0(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x2bef0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1e090
jmp 0x2a7c8
jmp 0x2a901
addq $0xa0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x44e0
nopw %cs:(%rax,%rax)