// File: zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::GetNextSequence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool Fasta::FastaPrivate::GetNextSequence(string& sequence) {
  
    // validate input stream
    if ( !IsOpen || feof(Stream) ) 
        return false;
    
    // read in sequence  
    char buffer[1024];
    ostringstream seqBuffer("");
    while(true) {
        
        char ch = fgetc(Stream);
        ungetc(ch, Stream);
        if( (ch == '>') || feof(Stream) ) 
              break;       
        
        if ( fgets(buffer, 1024, Stream) == 0 ) {
            cerr << "FASTA error : could not read from file" << endl;
            return false;
        }
        
        Chomp(buffer);
        seqBuffer << buffer;
    }
    
    // import buffer contents to sequence string
    sequence = seqBuffer.str();
  
    // return success
    return true;
}

// Assembly:
subq $0x628, %rsp            # imm = 0x628
movq %rdi, 0x618(%rsp)
movq %rsi, 0x610(%rsp)
movq 0x618(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x1, 0x8(%rax)
je 0x10a9ac
movq 0x30(%rsp), %rax
movq (%rax), %rdi
callq 0x86b10
cmpl $0x0, %eax
je 0x10a9b9
movb $0x0, 0x627(%rsp)
jmp 0x10abcf
leaq 0x77(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x86da0
movq 0x28(%rsp), %rdx
leaq 0x2a29f(%rip), %rsi     # 0x134c73
leaq 0x78(%rsp), %rdi
callq 0x86a00
jmp 0x10a9e0
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
movl $0x10, %edx
callq 0x86a50
jmp 0x10a9f9
leaq 0x78(%rsp), %rdi
callq 0x86f68
jmp 0x10aa05
leaq 0x77(%rsp), %rdi
callq 0x867b0
jmp 0x10aa11
movq 0x30(%rsp), %rax
movq (%rax), %rdi
callq 0x86b70
movl %eax, 0x24(%rsp)
jmp 0x10aa24
movq 0x30(%rsp), %rax
movl 0x24(%rsp), %ecx
movb %cl, 0x63(%rsp)
movsbl 0x63(%rsp), %edi
movq (%rax), %rsi
callq 0x86100
jmp 0x10aa40
movsbl 0x63(%rsp), %eax
cmpl $0x3e, %eax
je 0x10aa5c
movq 0x30(%rsp), %rax
movq (%rax), %rdi
callq 0x86b10
cmpl $0x0, %eax
je 0x10aaaf
jmp 0x10ab4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x10aa8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x86f68
jmp 0x10aa8b
jmp 0x10aa8d
leaq 0x77(%rsp), %rdi
callq 0x867b0
jmp 0x10abe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x10abbe
movq 0x30(%rsp), %rax
movq (%rax), %rdx
leaq 0x210(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x86ba0
movq %rax, 0x18(%rsp)
jmp 0x10aad0
movq 0x18(%rsp), %rax
cmpq $0x0, %rax
jne 0x10ab1d
movq 0x5a4fe(%rip), %rdi     # 0x164fe0
leaq 0x2928c(%rip), %rsi     # 0x133d75
callq 0x86700
movq %rax, 0x10(%rsp)
jmp 0x10aaf5
movq 0x10(%rsp), %rdi
movq 0x5a46f(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x10ab08
movb $0x0, 0x627(%rsp)
movl $0x1, 0x5c(%rsp)
jmp 0x10abaf
movq 0x30(%rsp), %rdi
leaq 0x210(%rsp), %rsi
movq %rsi, 0x8(%rsp)
callq 0x109c60
movq 0x8(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x86700
jmp 0x10ab48
jmp 0x10aa0f
leaq 0x38(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x86740
jmp 0x10ab61
movq 0x610(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x86070
jmp 0x10ab75
leaq 0x38(%rsp), %rdi
callq 0x86f68
jmp 0x10ab81
movb $0x1, 0x627(%rsp)
movl $0x1, 0x5c(%rsp)
jmp 0x10abaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x86f68
jmp 0x10abad
jmp 0x10abbe
leaq 0x98(%rsp), %rdi
callq 0x861b0
jmp 0x10abcf
leaq 0x98(%rsp), %rdi
callq 0x861b0
jmp 0x10abcd
jmp 0x10abe0
movb 0x627(%rsp), %al
andb $0x1, %al
addq $0x628, %rsp            # imm = 0x628
retq
movq 0x68(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopw %cs:(%rax,%rax)