// File: /workspace/github_cpp_makefile_star2_O3/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 0x44255
movq %rdx, %r14
movq %rsi, %r15
callq 0x27b00
testb %al, %al
je 0x44255
movq 0x8(%rbx), %rdi
callq 0x27c20
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 0x442f9
movl 0x4(%r15), %eax
leaq (%rsi,%rsi,4), %rdx
cmpl 0x20(%rcx,%rdx,8), %eax
jle 0x442d6
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12488(%rip), %rsi     # 0x56696
leaq 0x12494(%rip), %rdx     # 0x566a9
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1247a(%rip), %rsi     # 0x566aa
leaq 0x124a3(%rip), %rdx     # 0x566da
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x26370
jmp 0x442aa
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x12431(%rip), %rsi     # 0x56696
leaq 0x1243d(%rip), %rdx     # 0x566a9
leaq 0x8(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x11e0e(%rip), %rsi     # 0x56095
leaq 0x11e29(%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 0x442b9
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x442c8
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 0x27f10
movq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x27710
jmp 0x442ca
leaq 0x10fa2(%rip), %rdi     # 0x552a2
xorl %eax, %eax
callq 0x284e0
jmp 0x4434e
jmp 0x44362
movq %rax, %r14
cmpl $0x1, %edx
jne 0x44379
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
addq $0x10, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x27ff0
callq 0x287d0
jmp 0x442c8
movq %rax, %r14
callq 0x287d0
jmp 0x44379
movq %rax, %rdi
callq 0x2f047
jmp 0x44376
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x44365
callq 0x27560
jmp 0x44365
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x44379
callq 0x27560
jmp 0x44379
movq %rax, %r14
movq %r14, %rdi
callq 0x28c10
nop