// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamRandomAccessController_p.cpp
// Function: BamTools::Internal::BamRandomAccessController::OpenIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, BamTools::Internal::BamReaderPrivate*)
bool BamRandomAccessController::OpenIndex(const string& indexFilename, BamReaderPrivate* reader) {

    // attempt create new index of type based on filename
    BamIndex* index = BamIndexFactory::CreateIndexFromFilename(indexFilename, reader);
    if ( index == 0 ) {
        const string message = string("could not open index file: ") + indexFilename;
        SetErrorString("BamRandomAccessController::OpenIndex", message);
        return false;
    }

    // attempt to load data from index file
    if ( !index->Load(indexFilename) ) {
        const string indexError = index->GetErrorString();
        const string message = string("could not load index data from file: ") + indexFilename +
                               "\n\t" + indexError;
        SetErrorString("BamRandomAccessController::OpenIndex", message);
        return false;
    }

    // save new index & return success
    SetIndex(index);
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x35510
testq %rax, %rax
je 0x4375b
movq %rax, %r15
movq (%rax), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x28(%rax)
testb %al, %al
je 0x437c4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x338a0
movb $0x1, %al
jmp 0x43896
leaq 0x18278(%rip), %rsi     # 0x5b9da
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x31b30
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x355e0
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x18262(%rip), %rsi     # 0x5b9f6
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x31b30
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0x31560
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x4388a
addq $0x10, %r15
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x33ff0
leaq 0x1823f(%rip), %rsi     # 0x5ba1b
leaq 0x90(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x31b30
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r14, %rdx
callq 0x355e0
leaq 0x1832a(%rip), %rdx     # 0x5bb34
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x33c40
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x355e0
leaq 0x30(%rsp), %rdi
callq 0x33a00
leaq 0x70(%rsp), %rdi
callq 0x33a00
leaq 0x90(%rsp), %rdi
callq 0x33a00
leaq 0x181a1(%rip), %rsi     # 0x5b9f6
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x31b30
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x31560
leaq 0x30(%rsp), %rdi
callq 0x33a00
leaq 0x10(%rsp), %rdi
callq 0x33a00
leaq 0x50(%rsp), %rdi
callq 0x33a00
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x438f0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x438e4
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x33a00
jmp 0x438fd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x43923
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x43932
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x33a00
jmp 0x43914
movq %rax, %rbx
jmp 0x43914
movq %rax, %rbx
jmp 0x43907
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x33a00
leaq 0x90(%rsp), %rdi
callq 0x33a00
leaq 0x50(%rsp), %rdi
callq 0x33a00
jmp 0x43932
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x33a00
jmp 0x43932
movq %rax, %rbx
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f