// File: /workspace/github_cpp_makefile_star2_O1/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 0x27cf0
leaq 0x1e8(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x28ae0
leaq 0x50(%rbx), %rdi
movq %r14, %rsi
callq 0x26c10
movq %rbx, %rdi
callq 0x286a0
leaq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x26b80
movq %r14, %rdi
callq 0x27c00
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 0x3bafb
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 0x19bda(%rip), %rsi     # 0x55551
leaq 0x19be8(%rip), %rdx     # 0x55566
leaq 0x28(%rsp), %rdi
callq 0x26750
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %r15, %rdx
callq 0x29130
leaq 0x1a14e(%rip), %rdx     # 0x55aef
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x27e50
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x29130
leaq 0x18(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x3b9da
callq 0x27560
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b9ed
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b9fc
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1a18b(%rip), %rsi     # 0x55b96
leaq 0x1a193(%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 0x3ba38
callq 0x27560
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ba4b
callq 0x27560
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ba61
callq 0x27560
callq 0x287e0
xorl %eax, %eax
jmp 0x3b925
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ba84
callq 0x27560
jmp 0x3ba84
movq %rax, %r14
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x3bad1
jmp 0x3badb
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3baaf
callq 0x27560
jmp 0x3baaf
movq %rax, %r14
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bac7
callq 0x27560
jmp 0x3bac7
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3badb
callq 0x27560
jmp 0x3badb
movq %rax, %r14
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3baf6
callq 0x27560
jmp 0x3baf6
movq %rax, %r14
callq 0x287e0
movq %r14, %rdi
callq 0x28c20
movq %rax, %rdi
callq 0x2f0bd
nop