// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/index/BamToolsIndex_p.cpp
// Function: BamTools::Internal::BamToolsIndex::Jump(BamTools::BamRegion const&, bool*)
bool BamToolsIndex::Jump(const BamTools::BamRegion& region, bool* hasAlignmentsInRegion) {

    // clear flag
    *hasAlignmentsInRegion = false;

    // skip if invalid reader or not open
    if ( m_reader == 0 || !m_reader->IsOpen() ) {
        SetErrorString("BamToolsIndex::Jump", "could not jump: reader is not open");
        return false;
    }

    // make sure left-bound position is valid
    const RefVector& references = m_reader->GetReferenceData();
    if ( region.LeftPosition > references.at(region.LeftRefID).RefLength ) {
        SetErrorString("BamToolsIndex::Jump", "could not create index: invalid region requested");
        return false;
    }

    // calculate nearest offset to jump to
    int64_t offset;
    try {
        GetOffset(region, offset, hasAlignmentsInRegion);
    } catch ( BamException& e ) {
        m_errorString = e.what();
        return false;
    }

    // return success/failure of seek
    return m_reader->Seek(offset);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movb $0x0, (%rdx)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x442ad
movq %rdx, %r14
movq %rsi, %r15
callq 0x27b00
testb %al, %al
je 0x442ad
movq 0x8(%rbx), %rdi
callq 0x27c30
movslq (%r15), %rsi
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rdx
cmpq %rsi, %rdx
jbe 0x44351
movl 0x4(%r15), %eax
leaq (%rsi,%rsi,4), %rdx
cmpl 0x20(%rcx,%rdx,8), %eax
jle 0x4432e
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12430(%rip), %rsi     # 0x56696
leaq 0x1243c(%rip), %rdx     # 0x566a9
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x12422(%rip), %rsi     # 0x566aa
leaq 0x1244b(%rip), %rdx     # 0x566da
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x26370
jmp 0x44302
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x123d9(%rip), %rsi     # 0x56696
leaq 0x123e5(%rip), %rdx     # 0x566a9
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x11db6(%rip), %rsi     # 0x56095
leaq 0x11dd1(%rip), %rdx     # 0x560b7
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x26370
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x44311
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x44320
callq 0x27560
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x27f20
movq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x27710
jmp 0x44322
leaq 0x10f4a(%rip), %rdi     # 0x552a2
xorl %eax, %eax
callq 0x284f0
jmp 0x443a6
jmp 0x443ba
movq %rax, %r14
cmpl $0x1, %edx
jne 0x443d1
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
addq $0x10, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x28000
callq 0x287e0
jmp 0x44320
movq %rax, %r14
callq 0x287e0
jmp 0x443d1
movq %rax, %rdi
callq 0x2f0bd
jmp 0x443ce
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x443bd
callq 0x27560
jmp 0x443bd
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x443d1
callq 0x27560
jmp 0x443d1
movq %rax, %r14
movq %r14, %rdi
callq 0x28c20
nop