// File: 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:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x148(%rsp)
movq %rsi, 0x140(%rsp)
movq 0x148(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x77980
testb $0x1, %al
jne 0xac19d
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x7b5f0
movq 0x30(%rsp), %rdx
leaq 0x3ed64(%rip), %rsi     # 0xeade3
leaq 0x120(%rsp), %rdi
callq 0x78e70
jmp 0xac08e
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x7b5f0
movq 0x28(%rsp), %rdx
leaq 0x3ed47(%rip), %rsi     # 0xeadf3
leaq 0xe8(%rsp), %rdi
callq 0x78e70
jmp 0xac0bb
movq 0x38(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0x774d0
jmp 0xac0d7
leaq 0xe8(%rsp), %rdi
callq 0x7cce8
jmp 0xac0e6
leaq 0xe7(%rsp), %rdi
callq 0x76f80
leaq 0x120(%rsp), %rdi
callq 0x7cce8
jmp 0xac102
leaq 0x11f(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x157(%rsp)
jmp 0xac435
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xac18b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xac16d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x7cce8
jmp 0xac16b
jmp 0xac16d
leaq 0xe7(%rsp), %rdi
callq 0x76f80
leaq 0x120(%rsp), %rdi
callq 0x7cce8
jmp 0xac189
jmp 0xac18b
leaq 0x11f(%rsp), %rdi
callq 0x76f80
jmp 0xac446
movq 0x38(%rsp), %rdi
addq $0x1e8, %rdi            # imm = 0x1E8
movq 0x140(%rsp), %rsi
callq 0x75f80
jmp 0xac1b8
movb $0x1, 0x157(%rsp)
jmp 0xac435
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
movl 0x10c(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xac446
movq 0x110(%rsp), %rdi
callq 0x72fc0
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, 0x18(%rsp)
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x7b5f0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0xb8(%rsp), %rdi
callq 0x78e70
jmp 0xac243
leaq 0xb7(%rsp), %rdi
callq 0x76f80
leaq 0x6f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x7b5f0
movq 0x10(%rsp), %rdx
leaq 0x3eba9(%rip), %rsi     # 0xeae14
leaq 0x70(%rsp), %rdi
callq 0x78e70
jmp 0xac277
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x7c720
jmp 0xac293
leaq 0x70(%rsp), %rdi
callq 0x7cce8
jmp 0xac29f
leaq 0x6f(%rsp), %rdi
callq 0x76f80
leaq 0x47(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x7b5f0
movq 0x8(%rsp), %rdx
leaq 0x3eb1f(%rip), %rsi     # 0xeade3
leaq 0x48(%rsp), %rdi
callq 0x78e70
jmp 0xac2d0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x774d0
jmp 0xac2e9
leaq 0x48(%rsp), %rdi
callq 0x7cce8
jmp 0xac2f5
leaq 0x47(%rsp), %rdi
callq 0x76f80
movb $0x0, 0x157(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0xac3d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0xb7(%rsp), %rdi
callq 0x76f80
jmp 0xac42c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xac377
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x7cce8
jmp 0xac375
jmp 0xac377
leaq 0x6f(%rsp), %rdi
callq 0x76f80
jmp 0xac41b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xac3be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x7cce8
jmp 0xac3bc
jmp 0xac3be
leaq 0x47(%rsp), %rdi
callq 0x76f80
leaq 0x90(%rsp), %rdi
callq 0x7cce8
jmp 0xac3fc
leaq 0xb8(%rsp), %rdi
callq 0x7cce8
jmp 0xac3fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xac41b
jmp 0xac41b
callq 0x7a790
jmp 0xac435
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x110(%rsp)
movl %eax, 0x10c(%rsp)
jmp 0xac42c
leaq 0xb8(%rsp), %rdi
callq 0x7cce8
jmp 0xac42a
jmp 0xac42c
callq 0x7a790
jmp 0xac433
jmp 0xac446
movb 0x157(%rsp), %al
andb $0x1, %al
addq $0x158, %rsp            # imm = 0x158
retq
movq 0x110(%rsp), %rdi
callq 0x7b550
movq %rax, %rdi
callq 0x88ef0
nopl (%rax,%rax)