// File: /workspace/github_cpp_makefile_star2_O3/gchen98[P]macs/algorithm.cpp
// Function: GraphBuilder::getNextPos(double&, std::_List_iterator<HotSpotBin*>&)
bool GraphBuilder::getNextPos(double & curPos,HotSpotBinPtrList::iterator & hotSpotIt){
    bool bBinCrossed = false;
    if (hotSpotIt==pConfig->pHotSpotBinPtrList->end()){
        curPos+=pRandNumGenerator->expRV(getRate());
    }else{
        HotSpotBinPtr hotspot = *hotSpotIt;
        double startPos = hotspot->dStart;
        double endPos = hotspot->dEnd;
        if (curPos>=startPos&&curPos<endPos){
            curPos+=pRandNumGenerator->expRV(getRate()*hotspot->dRate);
            if (curPos>endPos){
                bBinCrossed = true;
                curPos = endPos;
                ++hotSpotIt;
            }
        }else if (curPos<startPos){
            curPos+=pRandNumGenerator->expRV(getRate());
            if (curPos>startPos){
                bBinCrossed = true;
                curPos = startPos;
            }
        }else{
            cerr<<"startPos is "<<startPos<<" endPos is "
            <<endPos<<" and curPos is "<<curPos<<endl;
            throw "Shouldn't be here for variable recomb";
        }
    }
    return bBinCrossed;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq 0x8(%rdi), %rcx
movq (%rdx), %rax
cmpq 0x88(%rcx), %rax
je 0xf92e
movq 0x10(%rax), %rax
movsd (%rax), %xmm2
movsd 0x8(%rax), %xmm1
movsd (%rbx), %xmm0
ucomisd %xmm2, %xmm0
jb 0xf975
ucomisd %xmm0, %xmm1
jbe 0xf975
movq %rdx, %r14
movsd 0x30(%rdi), %xmm0
mulsd 0xc8(%rdi), %xmm0
movq (%rdi), %rcx
mulsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq (%rcx), %rdi
movsd %xmm1, 0x8(%rsp)
callq 0x10d90
movsd 0x771d(%rip), %xmm1     # 0x17008
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x31e0
movsd (%rbx), %xmm1
divsd 0x10(%rsp), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
ucomisd 0x8(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
jbe 0xf9da
movsd %xmm0, (%rbx)
movq (%r14), %rax
movq (%rax), %rax
movq %rax, (%r14)
jmp 0xf9d6
movq (%rdi), %rax
movsd 0x30(%rdi), %xmm0
mulsd 0xc8(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rax), %rdi
callq 0x10d90
movsd 0x76b4(%rip), %xmm1     # 0x17008
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x31e0
movsd (%rbx), %xmm1
divsd 0x8(%rsp), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
jmp 0xf9da
ucomisd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
jbe 0xf9e4
movq (%rdi), %rax
movsd 0x30(%rdi), %xmm0
mulsd 0xc8(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rax), %rdi
callq 0x10d90
movsd 0x7661(%rip), %xmm1     # 0x17008
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x31e0
movsd (%rbx), %xmm1
divsd 0x8(%rsp), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
movsd 0x10(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jbe 0xf9da
movsd %xmm0, (%rbx)
movb $0x1, %al
jmp 0xf9dc
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x10605(%rip), %rdi     # 0x1fff0
leaq 0x98c1(%rip), %rsi      # 0x192b3
movsd %xmm1, 0x8(%rsp)
callq 0x3250
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3440
leaq 0x98ae(%rip), %rsi      # 0x192c0
movq %rax, %rdi
callq 0x3250
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x3440
leaq 0x989d(%rip), %rsi      # 0x192cc
movq %rax, %rdi
callq 0x3250
movsd (%rbx), %xmm0
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x30f0
movl $0x8, %edi
callq 0x3100
leaq 0x9880(%rip), %rcx      # 0x192dc
movq %rcx, (%rax)
movq 0x1054a(%rip), %rsi     # 0x1ffb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33d0