// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::Seek(long const&)
bool BamReaderPrivate::Seek(const int64_t& position) {

    // skip if BAM file not open
    if ( !IsOpen() ) {
        SetErrorString("BamReader::Seek", "cannot seek on unopened BAM file");
        return false;
    }

    try {
        m_stream.Seek(position);
        return true;
    }
    catch ( BamException& e ) {
        const string streamError = e.what();
        const string message = string("could not seek in BAM file: \n\t") + streamError;
        SetErrorString("BamReader::Seek", message);
        return false;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1e8(%rdi), %r15
movq %r15, %rdi
callq 0x28820
testb %al, %al
je 0x3bdcf
movb $0x1, %bpl
movq %r15, %rdi
movq %r14, %rsi
callq 0x27420
jmp 0x3be3f
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19e1c(%rip), %rsi     # 0x55bfb
leaq 0x19e24(%rip), %rdx     # 0x55c0a
leaq 0x40(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x19e0a(%rip), %rsi     # 0x55c0b
leaq 0x19e23(%rip), %rdx     # 0x55c2b
movq %rsp, %rdi
callq 0x26750
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x27a10
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3be2e
callq 0x27560
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3be3d
callq 0x27560
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3be64
callq 0x27560
jmp 0x3be64
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3be78
callq 0x27560
jmp 0x3be78
movq %rax, %r14
movq %r14, %rdi
callq 0x28c20
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3be78
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x40(%rsp), %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq 0x26770
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19d73(%rip), %rsi     # 0x55c2c
leaq 0x19d8a(%rip), %rdx     # 0x55c4a
leaq 0x20(%rsp), %rdi
callq 0x26750
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x29130
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3beeb
callq 0x27560
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x19d01(%rip), %rsi     # 0x55bfb
leaq 0x19d09(%rip), %rdx     # 0x55c0a
callq 0x26750
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x27a10
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bf25
callq 0x27560
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bf38
callq 0x27560
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bf4b
callq 0x27560
callq 0x287e0
jmp 0x3be3d
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bf6c
callq 0x27560
jmp 0x3bf6c
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3bf89
jmp 0x3bf93
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bf93
callq 0x27560
jmp 0x3bf93
movq %rax, %r14
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bfab
callq 0x27560
jmp 0x3bfab
movq %rax, %r14
callq 0x287e0
jmp 0x3be78
movq %rax, %rdi
callq 0x2f0bd
nop