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

    bool errorsEncountered = false;
    m_errorString.clear();

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

        // if reader doesn't have an index, create one
        if ( !reader->HasIndex() ) {
            if ( !reader->CreateIndex(type) ) {
                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 creating index files: ") + "\n" + currentError;
        SetErrorString("BamMultiReader::CreateIndexes", message);
        return false;
    } else
        return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq $0x0, 0x30(%rdi)
movq 0x28(%rdi), %rax
movb $0x0, (%rax)
movq (%rdi), %r13
movq 0x8(%rdi), %r14
cmpq %r14, %r13
je 0x35a63
movq %rsi, %r15
movq %rbx, (%rsp)
leaq 0x28(%rbx), %r12
xorl %ebx, %ebx
movq (%r13), %rbp
testq %rbp, %rbp
je 0x35a4d
movq %rbp, %rdi
callq 0x26230
testb %al, %al
jne 0x35a4d
movq %rbp, %rdi
movq %r15, %rsi
callq 0x28c40
testb %al, %al
jne 0x35a4d
movq (%rsp), %rbx
movq 0x30(%rbx), %rsi
movl $0x1, %ecx
movq %r12, %rdi
xorl %edx, %edx
movl $0x9, %r8d
callq 0x28f30
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x26d30
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x265d0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35a32
callq 0x27560
movq 0x30(%rbx), %rsi
movl $0x1, %ecx
movq %r12, %rdi
xorl %edx, %edx
movl $0xa, %r8d
callq 0x28f30
movb $0x1, %bl
addq $0x10, %r13
cmpq %r14, %r13
jne 0x359ba
movq %rbx, %r13
movq (%rsp), %rbx
jmp 0x35a66
xorl %r13d, %r13d
testb $0x1, %r13b
je 0x35b71
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x267c0
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1f99b(%rip), %rsi     # 0x55439
leaq 0x1f9b6(%rip), %rdx     # 0x5545b
leaq 0x48(%rsp), %rdi
callq 0x26750
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x267c0
leaq 0x1fa52(%rip), %rsi     # 0x55529
leaq 0x28(%rsp), %rdi
callq 0x290a0
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x29130
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x35b04
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x35b13
callq 0x27560
leaq 0x28(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1f93a(%rip), %rsi     # 0x5545c
leaq 0x1f950(%rip), %rdx     # 0x55479
callq 0x26750
leaq 0x28(%rsp), %rsi
leaq 0x68(%rsp), %rdx
movq %rbx, %rdi
callq 0x27be0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x35b4f
callq 0x27560
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35b62
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x35b71
callq 0x27560
notb %r13b
andb $0x1, %r13b
movl %r13d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x35ba4
callq 0x27560
jmp 0x35ba4
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x35bd7
jmp 0x35be1
jmp 0x35bb6
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x35bcd
callq 0x27560
jmp 0x35bcd
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x35be1
callq 0x27560
jmp 0x35be1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x35bff
jmp 0x35c04
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x35c04
callq 0x27560
movq %rbx, %rdi
callq 0x28c20