// File: /workspace/github_cpp_makefile_star2_O3/zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::WriteIndexData()
bool Fasta::FastaPrivate::WriteIndexData(void) {
 
    // skip if no index file available
    if ( !IsIndexOpen ) return false; 
  
    // iterate over index entries
    bool success = true;
    stringstream indexBuffer;
    vector<FastaIndexData>::const_iterator indexIter = Index.begin();
    vector<FastaIndexData>::const_iterator indexEnd  = Index.end();
    for ( ; indexIter != indexEnd; ++indexIter ) {
      
        // clear stream
        indexBuffer.str("");
      
        // write data to stream
        const FastaIndexData& data = (*indexIter);
        indexBuffer << data.Name << "\t"
                    << data.Length << "\t"
                    << data.Offset << "\t"
                    << data.LineLength << "\t"
                    << data.ByteLength << endl;
                    
        // write stream to file
        success &= ( fputs(indexBuffer.str().c_str(), IndexStream) >= 0 );
    }
  
    // return success status
    return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
cmpb $0x1, 0x19(%rdi)
jne 0x623b3
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
callq 0x27440
movq 0x20(%rbx), %r14
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rsp)
cmpq %rax, %r14
je 0x623b7
movq %rbx, (%rsp)
leaq 0x20(%rsp), %r13
movb $0x1, %bl
leaq 0x10(%rsp), %rbp
leaq 0x14597(%rip), %r12     # 0x76816
movq %r13, 0x10(%rsp)
movq %rbp, %rdi
leaq 0x14589(%rip), %rdx     # 0x76817
movq %rdx, %rsi
callq 0x2f1a0
leaq 0x48(%rsp), %rdi
movq %rbp, %rsi
callq 0x278a0
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x622b2
callq 0x27560
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x40(%rsp), %rdi
callq 0x276b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276b0
movl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x27ab0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276b0
movq 0x28(%r14), %rsi
movq %r15, %rdi
callq 0x27570
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276b0
movl 0x30(%r14), %esi
movq %r15, %rdi
callq 0x27ab0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276b0
movl 0x34(%r14), %esi
movq %r15, %rdi
callq 0x27ab0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x27590
movsbl %al, %esi
movq %r15, %rdi
callq 0x27040
movq %rax, %rdi
callq 0x27410
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x27990
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x27670
movl %eax, %r15d
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x6239a
callq 0x27560
testl %r15d, %r15d
setns %al
andb %al, %bl
addq $0x38, %r14
cmpq 0x8(%rsp), %r14
jne 0x6227f
jmp 0x623b9
xorl %ebx, %ebx
jmp 0x623c3
movb $0x1, %bl
leaq 0x30(%rsp), %rdi
callq 0x27490
movl %ebx, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x623ef
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x623f2
callq 0x27560
jmp 0x623f2
jmp 0x623ef
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x27490
movq %rbx, %rdi
callq 0x27b10
movq %rax, %rdi
callq 0x2e1cd