// File: /workspace/github_cpp_makefile_star2_O1/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 0xf984
movq 0x10(%rax), %rax
movsd (%rax), %xmm2
movsd 0x8(%rax), %xmm1
movsd (%rbx), %xmm0
ucomisd %xmm2, %xmm0
jb 0xf9cb
ucomisd %xmm0, %xmm1
jbe 0xf9cb
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 0x10e1e
movsd 0x76c7(%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 0xfa30
movsd %xmm0, (%rbx)
movq (%r14), %rax
movq (%rax), %rax
movq %rax, (%r14)
jmp 0xfa2c
movq (%rdi), %rax
movsd 0x30(%rdi), %xmm0
mulsd 0xc8(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rax), %rdi
callq 0x10e1e
movsd 0x765e(%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 0xfa30
ucomisd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
jbe 0xfa3a
movq (%rdi), %rax
movsd 0x30(%rdi), %xmm0
mulsd 0xc8(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%rax), %rdi
callq 0x10e1e
movsd 0x760b(%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 0xfa30
movsd %xmm0, (%rbx)
movb $0x1, %al
jmp 0xfa32
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x105af(%rip), %rdi     # 0x1fff0
leaq 0x980b(%rip), %rsi      # 0x19253
movsd %xmm1, 0x8(%rsp)
callq 0x3250
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x3440
leaq 0x97f8(%rip), %rsi      # 0x19260
movq %rax, %rdi
callq 0x3250
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x3440
leaq 0x97e7(%rip), %rsi      # 0x1926c
movq %rax, %rdi
callq 0x3250
movsd (%rbx), %xmm0
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
callq 0x30f0
movl $0x8, %edi
callq 0x3100
leaq 0x97ca(%rip), %rcx      # 0x1927c
movq %rcx, (%rax)
movq 0x104f4(%rip), %rsi     # 0x1ffb0
movq %rax, %rdi
xorl %edx, %edx
callq 0x33d0