// File: 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:
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, 0x298(%rsp)
movq 0x298(%rsp), %rax
movq %rax, 0x80(%rsp)
testb $0x1, 0x19(%rax)
jne 0x10ac32
movb $0x0, 0x2a7(%rsp)
jmp 0x10afa8
movb $0x1, 0x297(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x86520
movq 0x80(%rsp), %rdi
addq $0x20, %rdi
callq 0x10c3f0
movq %rax, 0x78(%rsp)
jmp 0x10ac5f
movq 0x78(%rsp), %rax
movq %rax, 0xf8(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x10c420
jmp 0x10ac83
movq 0x80(%rsp), %rdi
addq $0x20, %rdi
callq 0x10c460
movq %rax, 0x70(%rsp)
jmp 0x10ac9b
movq 0x70(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0xe0(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x10c420
jmp 0x10acbf
jmp 0x10acc1
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x10c490
movb %al, 0x6f(%rsp)
jmp 0x10acdc
movb 0x6f(%rsp), %al
testb $0x1, %al
jne 0x10ace9
jmp 0x10af78
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x86da0
movq 0x60(%rsp), %rdx
leaq 0x29f6c(%rip), %rsi     # 0x134c73
leaq 0xb8(%rsp), %rdi
callq 0x86a00
jmp 0x10ad16
leaq 0x108(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x86850
jmp 0x10ad2d
leaq 0xb8(%rsp), %rdi
callq 0x86f68
jmp 0x10ad3c
leaq 0xb7(%rsp), %rdi
callq 0x867b0
leaq 0x100(%rsp), %rdi
callq 0x10c4d0
movq %rax, 0x58(%rsp)
jmp 0x10ad5d
movq 0x58(%rsp), %rax
movq %rax, 0xa8(%rsp)
leaq 0x118(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x86640
movq %rax, 0x50(%rsp)
jmp 0x10ad86
movq 0x50(%rsp), %rdi
leaq 0x29ee0(%rip), %rsi     # 0x134c72
callq 0x86700
movq %rax, 0x48(%rsp)
jmp 0x10ad9e
movq 0x48(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl 0x20(%rax), %esi
callq 0x86d40
movq %rax, 0x40(%rsp)
jmp 0x10adba
movq 0x40(%rsp), %rdi
leaq 0x29eac(%rip), %rsi     # 0x134c72
callq 0x86700
movq %rax, 0x38(%rsp)
jmp 0x10add2
movq 0x38(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x28(%rax), %rsi
callq 0x86e10
movq %rax, 0x30(%rsp)
jmp 0x10adef
movq 0x30(%rsp), %rdi
leaq 0x29e77(%rip), %rsi     # 0x134c72
callq 0x86700
movq %rax, 0x28(%rsp)
jmp 0x10ae07
movq 0x28(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl 0x30(%rax), %esi
callq 0x86d40
movq %rax, 0x20(%rsp)
jmp 0x10ae23
movq 0x20(%rsp), %rdi
leaq 0x29e43(%rip), %rsi     # 0x134c72
callq 0x86700
movq %rax, 0x18(%rsp)
jmp 0x10ae3b
movq 0x18(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl 0x34(%rax), %esi
callq 0x86d40
movq %rax, 0x10(%rsp)
jmp 0x10ae57
movq 0x10(%rsp), %rdi
movq 0x5a10d(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x10ae6a
leaq 0x88(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x866f0
jmp 0x10ae81
leaq 0x88(%rsp), %rdi
callq 0x86320
movq %rax, 0x8(%rsp)
jmp 0x10ae95
movq 0x8(%rsp), %rdi
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rsi
callq 0x86820
movl %eax, 0x4(%rsp)
jmp 0x10aeb1
movl 0x4(%rsp), %ecx
notl %ecx
shrl $0x1f, %ecx
movzbl 0x297(%rsp), %eax
andl %ecx, %eax
movb %al, 0x297(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x86f68
jmp 0x10aeda
jmp 0x10aedc
leaq 0x100(%rsp), %rdi
callq 0x10c4e0
jmp 0x10aeeb
jmp 0x10acc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x10af97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x10af44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x86f68
jmp 0x10af42
jmp 0x10af44
leaq 0xb7(%rsp), %rdi
callq 0x867b0
jmp 0x10af97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x86f68
jmp 0x10af76
jmp 0x10af97
movb 0x297(%rsp), %al
andb $0x1, %al
movb %al, 0x2a7(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x86580
jmp 0x10afa8
leaq 0x108(%rsp), %rdi
callq 0x86580
jmp 0x10afa6
jmp 0x10afb9
movb 0x2a7(%rsp), %al
andb $0x1, %al
addq $0x2a8, %rsp            # imm = 0x2A8
retq
movq 0xf0(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nop