// File: /workspace/github_cpp_makefile_star2_O2/zeeev[P]DASVC/bamtools/src/api/internal/bam/BamMultiReader_p.cpp
// Function: BamTools::Internal::BamMultiReaderPrivate::LocateIndexes(BamTools::BamIndex::IndexType const&)
bool BamMultiReaderPrivate::LocateIndexes(const BamIndex::IndexType& preferredType) {

    bool errorsEncountered = false;
    m_errorString.clear();

    // iterate over readers
    vector<MergeItem>::iterator readerIter = m_readers.begin();
    vector<MergeItem>::iterator readerEnd  = m_readers.end();
    for ( ; readerIter != readerEnd; ++readerIter ) {
        MergeItem& item = (*readerIter);
        BamReader* reader = item.Reader;
        if ( reader == 0 ) continue;

        // if reader has no index, try to locate one
        if ( !reader->HasIndex() ) {
            if ( !reader->LocateIndex(preferredType) ) {
                m_errorString.append(1, '\t');
                m_errorString.append(reader->GetErrorString());
                m_errorString.append(1, '\n');
                errorsEncountered = true;
            }
        }
    }

    // check for errors encountered before returning success/fail
    if ( errorsEncountered ) {
        const string currentError = m_errorString;
        const string message = string("error while locating index files: ") + "\n" + currentError;
        SetErrorString("BamMultiReader::LocatingIndexes", message);
        return false;
    } else
        return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, 0x10(%rsp)
leaq 0x28(%rdi), %r14
andq $0x0, 0x30(%rdi)
movq 0x28(%rdi), %rax
movb $0x0, (%rax)
movq (%rdi), %r12
movq %rdi, 0x8(%rsp)
movq 0x8(%rdi), %rbp
xorl %r13d, %r13d
leaq 0x38(%rsp), %r15
cmpq %rbp, %r12
je 0x3fdd6
movq (%r12), %rbx
testq %rbx, %rbx
je 0x3fdd0
movq %rbx, %rdi
callq 0x31340
testb %al, %al
jne 0x3fdd0
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x31960
testb %al, %al
jne 0x3fdd0
movq %r14, %rdi
pushq $0x1
popq %r13
movq %r13, %rsi
pushq $0x9
popq %rdx
callq 0x333e0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x32330
movq %r14, %rdi
movq %r15, %rsi
callq 0x35680
movq %r15, %rdi
callq 0x33a00
movq %r14, %rdi
movq %r13, %rsi
pushq $0xa
popq %rdx
callq 0x333e0
movb $0x1, %r13b
addq $0x10, %r12
jmp 0x3fd64
testb $0x1, %r13b
je 0x3fe89
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x33ff0
leaq 0x1b6cb(%rip), %rsi     # 0x5b4bf
leaq 0x58(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x31b30
leaq 0x1b764(%rip), %rdx     # 0x5b56e
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x33c40
leaq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x355e0
leaq 0x18(%rsp), %rdi
callq 0x33a00
leaq 0x58(%rsp), %rdi
callq 0x33a00
leaq 0x1b69a(%rip), %rsi     # 0x5b4e2
leaq 0x18(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x31b30
leaq 0x18(%rsp), %rsi
leaq 0x78(%rsp), %rdx
movq 0x8(%rsp), %rdi
callq 0x338e0
leaq 0x18(%rsp), %rdi
callq 0x33a00
leaq 0x78(%rsp), %rdi
callq 0x33a00
leaq 0x38(%rsp), %rdi
callq 0x33a00
notb %r13b
andb $0x1, %r13b
movl %r13d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3fed4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x33a00
jmp 0x3fec8
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x33a00
jmp 0x3fedc
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x33a00
jmp 0x3fee6
movq %rax, %rbx
jmp 0x3fee6
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x33a00
leaq 0x38(%rsp), %rdi
callq 0x33a00
jmp 0x3feff
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x33a00
movq %rbx, %rdi
callq 0x34ed0
movq %rax, %rdi
callq 0x39b2f
nop