// File: /workspace/github_cpp_makefile_star2_O3/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 0x28810
testb %al, %al
je 0x3bd17
movb $0x1, %bpl
movq %r15, %rdi
movq %r14, %rsi
callq 0x27420
jmp 0x3bd87
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19ed4(%rip), %rsi     # 0x55bfb
leaq 0x19edc(%rip), %rdx     # 0x55c0a
leaq 0x40(%rsp), %rdi
callq 0x26750
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x19ec2(%rip), %rsi     # 0x55c0b
leaq 0x19edb(%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 0x3bd76
callq 0x27560
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bd85
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 0x3bdac
callq 0x27560
jmp 0x3bdac
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bdc0
callq 0x27560
jmp 0x3bdc0
movq %rax, %r14
movq %r14, %rdi
callq 0x28c10
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3bdc0
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 0x19e2b(%rip), %rsi     # 0x55c2c
leaq 0x19e42(%rip), %rdx     # 0x55c4a
leaq 0x20(%rsp), %rdi
callq 0x26750
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x29120
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3be33
callq 0x27560
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x19db9(%rip), %rsi     # 0x55bfb
leaq 0x19dc1(%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 0x3be6d
callq 0x27560
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3be80
callq 0x27560
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3be93
callq 0x27560
callq 0x287d0
jmp 0x3bd85
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3beb4
callq 0x27560
jmp 0x3beb4
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3bed1
jmp 0x3bedb
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bedb
callq 0x27560
jmp 0x3bedb
movq %rax, %r14
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bef3
callq 0x27560
jmp 0x3bef3
movq %rax, %r14
callq 0x287d0
jmp 0x3bdc0
movq %rax, %rdi
callq 0x2f047
nop