// File: zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::LoadIndexData()
bool Fasta::FastaPrivate::LoadIndexData(void) {
  
    // skip if no index file available
    if ( !IsIndexOpen ) return false; 
  
    // clear any prior index data
    Index.clear();
  
    char buffer[1024];
    stringstream indexBuffer;
    while ( true ) {
      
        char c = fgetc(IndexStream);
        if ( (c == '\n') || feof(IndexStream) ) break;
        ungetc(c, IndexStream);
      
        // clear index buffer
        indexBuffer.str("");
        
        // read line from index file
        if ( fgets(buffer, 1024, IndexStream) == 0 ) {
            cerr << "FASTA LoadIndexData() error : could not read from index file" << endl;
            HasIndex = false;
            return false;
        }
      
        // store line in indexBuffer
        indexBuffer << buffer;
        
        // retrieve fasta index data from line
        FastaIndexData data;
        indexBuffer >> data.Name;
        indexBuffer >> data.Length;
        indexBuffer >> data.Offset;
        indexBuffer >> data.LineLength;
        indexBuffer >> data.ByteLength;
        
        // store index entry
        Index.push_back(data);
    }
    
    return true;
}

// Assembly:
subq $0x648, %rsp            # imm = 0x648
movq %rdi, 0x638(%rsp)
movq 0x638(%rsp), %rax
movq %rax, 0x28(%rsp)
testb $0x1, 0x19(%rax)
jne 0x10bb8f
movb $0x0, 0x647(%rsp)
jmp 0x10be34
movq 0x28(%rsp), %rdi
addq $0x20, %rdi
callq 0x10c290
leaq 0xa8(%rsp), %rdi
callq 0x86520
jmp 0x10bbac
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x86b70
movl %eax, 0x24(%rsp)
jmp 0x10bbc0
movl 0x24(%rsp), %eax
movb %al, 0xa7(%rsp)
movsbl 0xa7(%rsp), %eax
cmpl $0xa, %eax
je 0x10bbeb
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x86b10
cmpl $0x0, %eax
je 0x10bc09
jmp 0x10be04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x10be23
movq 0x28(%rsp), %rax
movsbl 0xa7(%rsp), %edi
movq 0x10(%rax), %rsi
callq 0x86100
jmp 0x10bc21
leaq 0x6f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x86da0
movq 0x18(%rsp), %rdx
leaq 0x29037(%rip), %rsi     # 0x134c73
leaq 0x70(%rsp), %rdi
callq 0x86a00
jmp 0x10bc48
leaq 0xa8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x86850
jmp 0x10bc5c
leaq 0x70(%rsp), %rdi
callq 0x86f68
jmp 0x10bc68
leaq 0x6f(%rsp), %rdi
callq 0x867b0
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rdx
leaq 0x230(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x86ba0
movq %rax, 0x10(%rsp)
jmp 0x10bc94
movq 0x10(%rsp), %rax
cmpq $0x0, %rax
jne 0x10bd35
movq 0x59336(%rip), %rdi     # 0x164fe0
leaq 0x282e9(%rip), %rsi     # 0x133f9a
callq 0x86700
movq %rax, 0x8(%rsp)
jmp 0x10bcbd
movq 0x8(%rsp), %rdi
movq 0x592a7(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x10bcd0
movq 0x28(%rsp), %rax
movb $0x0, 0x18(%rax)
movb $0x0, 0x647(%rsp)
movl $0x1, 0x68(%rsp)
jmp 0x10be14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x10bd26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x86f68
jmp 0x10bd24
jmp 0x10bd26
leaq 0x6f(%rsp), %rdi
callq 0x867b0
jmp 0x10be23
leaq 0xb8(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x86700
jmp 0x10bd4c
leaq 0x30(%rsp), %rdi
callq 0x10c2b0
jmp 0x10bd58
leaq 0xa8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x86900
jmp 0x10bd6c
leaq 0x50(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x86470
jmp 0x10bd80
leaq 0x58(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x86430
jmp 0x10bd94
leaq 0x60(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x86470
jmp 0x10bda8
leaq 0x64(%rsp), %rsi
leaq 0xa8(%rsp), %rdi
callq 0x86470
jmp 0x10bdbc
movq 0x28(%rsp), %rdi
addq $0x20, %rdi
leaq 0x30(%rsp), %rsi
callq 0x10c2c0
jmp 0x10bdd1
leaq 0x30(%rsp), %rdi
callq 0x10c330
jmp 0x10bddd
jmp 0x10bbaa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x10c330
jmp 0x10be02
jmp 0x10be23
movb $0x1, 0x647(%rsp)
movl $0x1, 0x68(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x86580
jmp 0x10be34
leaq 0xa8(%rsp), %rdi
callq 0x86580
jmp 0x10be32
jmp 0x10be45
movb 0x647(%rsp), %al
andb $0x1, %al
addq $0x648, %rsp            # imm = 0x648
retq
movq 0x98(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopw (%rax,%rax)