// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamReader_p.cpp
// Function: BamTools::Internal::BamReaderPrivate::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool BamReaderPrivate::Open(const string& filename) {

    try {

        // make sure we're starting with fresh state
        Close();

        // open BgzfStream
        m_stream.Open(filename, IBamIODevice::ReadOnly);

        // load BAM metadata
        LoadHeaderData();
        LoadReferenceData();

        // store filename & offset of first alignment
        m_filename = filename;
        m_alignmentsBeginOffset = m_stream.Tell();

        // return success
        return true;

    } catch ( BamException& e ) {
        const string error = e.what();
        const string message = string("could not open file: ") + filename +
                               "\n\t" + error;
        SetErrorString("BamReader::Open", message);
        return false;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x27ce0
leaq 0x1e8(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x28ad0
leaq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x26c10
movq %rbx, %rdi
callq 0x28690
leaq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x26b80
movq %r14, %rdi
callq 0x27bf0
movq %rax, (%rbx)
movb $0x1, %al
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3ba43
movq %r14, %rdi
callq 0x267d0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rax, %rsi
callq 0x26770
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x19c92(%rip), %rsi     # 0x55551
leaq 0x19ca0(%rip), %rdx     # 0x55566
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %r15, %rdx
callq 0x29120
leaq 0x1a206(%rip), %rdx     # 0x55aef
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x27e40
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x29120
leaq 0x18(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x3b922
callq 0x27560
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b935
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b944
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1a243(%rip), %rsi     # 0x55b96
leaq 0x1a24b(%rip), %rdx     # 0x55ba5
callq 0x26750
leaq 0x8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x27a10
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b980
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b993
callq 0x27560
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b9a9
callq 0x27560
callq 0x287d0
xorl %eax, %eax
jmp 0x3b86d
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b9cc
callq 0x27560
jmp 0x3b9cc
movq %rax, %r14
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3ba19
jmp 0x3ba23
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b9f7
callq 0x27560
jmp 0x3b9f7
movq %rax, %r14
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ba0f
callq 0x27560
jmp 0x3ba0f
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3ba23
callq 0x27560
jmp 0x3ba23
movq %rax, %r14
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ba3e
callq 0x27560
jmp 0x3ba3e
movq %rax, %r14
callq 0x287d0
movq %r14, %rdi
callq 0x28c10
movq %rax, %rdi
callq 0x2f047
nop