// File: /workspace/github_cpp_makefile_star2_O1/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 0x628ff
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 0x62903
movq %rbx, (%rsp)
leaq 0x20(%rsp), %r13
movb $0x1, %bl
leaq 0x10(%rsp), %rbp
leaq 0x1504f(%rip), %r12     # 0x7781a
movq %r13, 0x10(%rsp)
movq %rbp, %rdi
leaq 0x15041(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
leaq 0x48(%rsp), %rdi
movq %rbp, %rsi
callq 0x278b0
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x627fe
callq 0x27560
movq (%r14), %rsi
movq 0x8(%r14), %rdx
leaq 0x40(%rsp), %rdi
callq 0x276c0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276c0
movl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x27ac0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276c0
movq 0x28(%r14), %rsi
movq %r15, %rdi
callq 0x27570
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276c0
movl 0x30(%r14), %esi
movq %r15, %rdi
callq 0x27ac0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x276c0
movl 0x34(%r14), %esi
movq %r15, %rdi
callq 0x27ac0
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 0x279a0
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x27680
movl %eax, %r15d
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x628e6
callq 0x27560
testl %r15d, %r15d
setns %al
andb %al, %bl
addq $0x38, %r14
cmpq 0x8(%rsp), %r14
jne 0x627cb
jmp 0x62905
xorl %ebx, %ebx
jmp 0x6290f
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 0x6293b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x6293e
callq 0x27560
jmp 0x6293e
jmp 0x6293b
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x27490
movq %rbx, %rdi
callq 0x27b20
movq %rax, %rdi
callq 0x2e1ed