// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/sequence_buffer_fasta.c
// Function: gt_sequence_buffer_fasta_advance
static int gt_sequence_buffer_fasta_advance(GtSequenceBuffer *sb, GtError *err)
{
  int currentchar, ret = 0;
  GtUword currentoutpos = 0, currentfileadd = 0, currentfileread = 0;
  GtSequenceBufferMembers *pvt;
  GtSequenceBufferFasta *sbf;

  gt_error_check(err);

  sbf = (GtSequenceBufferFasta*) sb;
  pvt = sb->pvt;
  while (true)
  {
    if (currentoutpos >= (GtUword) OUTBUFSIZE)
    {
      if (pvt->filelengthtab != NULL)
      {
        pvt->filelengthtab[pvt->filenum].length
          += (uint64_t) currentfileread;
        pvt->filelengthtab[pvt->filenum].effectivelength
          += (uint64_t) currentfileadd;
      }
      break;
    }
    if (sbf->nextfile)
    {
      if (pvt->filelengthtab != NULL)
      {
        pvt->filelengthtab[pvt->filenum].length = 0;
        pvt->filelengthtab[pvt->filenum].effectivelength = 0;
      }
      sbf->nextfile = false;
      sbf->indesc = false;
      sbf->firstseqinfile = true;
      currentfileadd = 0;
      currentfileread = 0;
      pvt->linenum = (uint64_t) 1;
      pvt->inputstream = gt_file_xopen(gt_str_array_get(pvt->filenametab,
                                                  (GtUword) pvt->filenum),
                                       "rb");
      pvt->currentinpos = 0;
      pvt->currentfillpos = 0;
    } else
    {
      currentchar = inlinebuf_getchar(sb, pvt->inputstream);
      if (currentchar == EOF)
      {
        gt_file_delete(pvt->inputstream);
        pvt->inputstream = NULL;
        if (pvt->filelengthtab != NULL)
        {
          pvt->filelengthtab[pvt->filenum].length += currentfileread;
          pvt->filelengthtab[pvt->filenum].effectivelength += currentfileadd;
        }
        if ((GtUword) pvt->filenum == gt_str_array_size(pvt->filenametab)-1)
        {
          pvt->complete = true;
          break;
        }
        pvt->filenum++;
        sbf->nextfile = true;
      } else
      {
        currentfileread++;
        if (sbf->indesc)
        {
          if (currentchar == NEWLINESYMBOL)
          {
            pvt->linenum++;
            sbf->indesc = false;
          }
          if (pvt->descptr != NULL)
          {
            if (currentchar == NEWLINESYMBOL)
            {
              gt_desc_buffer_finish(pvt->descptr);
            } else
            {
              if (currentchar != CRSYMBOL)
                gt_desc_buffer_append_char(pvt->descptr, currentchar);
            }
          }
        } else
        {
          if (currentchar == NEWLINESYMBOL)
          {
            pvt->linenum++;
          }
          if (!isspace((int) currentchar))
          {
            if (currentchar == FASTASEPARATOR)
            {
              if (sbf->firstoverallseq)
              {
                sbf->firstoverallseq = false;
                sbf->firstseqinfile = false;
              } else
              {
                if (sbf->firstseqinfile)
                {
                  sbf->firstseqinfile = false;
                } else
                {
                  currentfileadd++;
                }
                pvt->outbuf[currentoutpos++] = (unsigned char) GT_SEPARATOR;
                pvt->lastspeciallength++;
              }
              sbf->indesc = true;
            } else
            {
              if ((ret = process_char(sb, currentoutpos,
                                      (unsigned char) currentchar, err)))
                return ret;
              currentoutpos++;
              currentfileadd++;
            }
          }
        }
      }
    }
  }
  if (sbf->firstoverallseq)
  {
    gt_error_set(err,"no sequences in multiple fasta file(s) %s ...",
              gt_str_array_get(pvt->filenametab,0));
    return -2;
  }
  pvt->nextfree = currentoutpos;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x60584
movq %rbx, %rdi
callq 0xc103
testb %al, %al
jne 0x60897
movq %rbx, 0x8(%rsp)
movq 0x8(%r14), %r13
leaq 0x40(%r13), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
xorps %xmm0, %xmm0
movq $0x0, (%rsp)
xorl %ebx, %ebx
cmpq $0x2000, %rbp           # imm = 0x2000
jae 0x60805
cmpb $0x1, 0x1b(%r14)
je 0x607ad
movq 0x8(%r14), %r12
cmpb $0x1, 0x19(%r12)
jne 0x605d6
movb $0x0, 0x19(%r12)
movb 0x78(%r12), %r15b
jmp 0x6061c
movq 0x48(%r12), %rax
cmpq 0x40(%r12), %rax
jb 0x60609
movq 0x28(%r13), %rdi
leaq 0x79(%r12), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x54709
cltq
movq %rax, 0x40(%r12)
testl %eax, %eax
je 0x6072c
xorl %eax, %eax
xorps %xmm0, %xmm0
leaq 0x1(%rax), %rcx
movq %rcx, 0x48(%r12)
movb 0x79(%r12,%rax), %r15b
movb %r15b, 0x78(%r12)
incq %rbx
cmpb $0x1, 0x18(%r14)
jne 0x6064f
cmpb $0xa, %r15b
jne 0x60690
incq 0x8(%r13)
movb $0x0, 0x18(%r14)
movq 0x20(%r13), %rdi
testq %rdi, %rdi
je 0x605a5
callq 0x83a7f
xorps %xmm0, %xmm0
jmp 0x605a5
cmpb $0xa, %r15b
jne 0x60659
incq 0x8(%r13)
callq 0xb6e0
movq (%rax), %rax
movzbl %r15b, %r12d
testb $0x20, 0x1(%rax,%r12,2)
xorps %xmm0, %xmm0
jne 0x605a5
cmpb $0x3e, %r15b
jne 0x606b8
cmpb $0x1, 0x1a(%r14)
jne 0x60781
andw $0x0, 0x19(%r14)
jmp 0x607a3
movq 0x20(%r13), %rdi
testq %rdi, %rdi
je 0x605a5
cmpb $0xd, %r15b
je 0x605a5
movsbl %r15b, %esi
callq 0x8396b
xorps %xmm0, %xmm0
jmp 0x605a5
movq %rbp, %rsi
movq 0x8(%r14), %rbp
movq 0x6080(%rbp), %rcx
movl %r15d, %eax
testq %rcx, %rcx
je 0x6070a
movzbl (%rcx,%r12), %eax
cmpq $0xfd, %rax
je 0x6086c
leaq 0x60(%rbp), %rcx
movq 0x60(%rbp), %rdx
cmpb $-0x3, %al
ja 0x60704
testq %rdx, %rdx
je 0x606f4
andq $0x0, (%rcx)
movq 0x38(%rbp), %rcx
testq %rcx, %rcx
je 0x6070a
leaq (%rcx,%rax,8), %rcx
movq (%rcx), %rdx
incq %rdx
movq %rdx, (%rcx)
movb %al, 0x2079(%rbp,%rsi)
movb %r15b, 0x4079(%rbp,%rsi)
incq 0x68(%rbp)
movq %rsi, %rbp
incq %rbp
incq (%rsp)
jmp 0x605a5
movq 0x28(%r13), %rdi
callq 0x548ae
andq $0x0, 0x28(%r13)
movq 0x10(%r13), %rax
movl (%r13), %r15d
testq %rax, %rax
je 0x6075b
movq %r15, %rcx
shlq $0x4, %rcx
addq %rbx, (%rax,%rcx)
movq (%rsp), %rdx
addq %rdx, 0x8(%rax,%rcx)
movq 0x70(%r13), %rdi
callq 0x157f4
decq %rax
cmpq %r15, %rax
je 0x60865
incl (%r13)
movb $0x1, 0x1b(%r14)
xorps %xmm0, %xmm0
jmp 0x605a5
cmpb $0x1, 0x19(%r14)
jne 0x6078f
movb $0x0, 0x19(%r14)
jmp 0x60793
incq (%rsp)
movb $-0x1, 0x2079(%r13,%rbp)
incq %rbp
incq 0x60(%r13)
movb $0x1, 0x18(%r14)
jmp 0x605a5
movq 0x10(%r13), %rax
movl (%r13), %esi
testq %rax, %rax
je 0x607c5
movq %rsi, %rcx
shlq $0x4, %rcx
movups %xmm0, (%rax,%rcx)
movb $0x0, 0x1b(%r14)
movw $0x100, 0x18(%r14)      # imm = 0x100
movq $0x1, 0x8(%r13)
movq 0x70(%r13), %rdi
callq 0x1555e
movq %rax, %rdi
leaq 0x763b2(%rip), %rsi     # 0xd6b9e
callq 0x540ec
xorps %xmm0, %xmm0
movq %rax, 0x28(%r13)
movq 0x10(%rsp), %rax
movups %xmm0, (%rax)
jmp 0x6059b
movq 0x10(%r13), %rax
testq %rax, %rax
je 0x60823
movl (%r13), %ecx
shlq $0x4, %rcx
addq %rbx, (%rax,%rcx)
movq (%rsp), %rdx
addq %rdx, 0x8(%rax,%rcx)
cmpb $0x1, 0x1a(%r14)
jne 0x60850
movq 0x70(%r13), %rdi
xorl %esi, %esi
callq 0x1555e
leaq 0x7bf28(%rip), %rsi     # 0xdc764
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
pushq $-0x2
popq %rax
jmp 0x60856
movq %rbp, 0x58(%r13)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x18(%r13)
jmp 0x60823
movq 0x70(%rbp), %rdi
movl (%rbp), %esi
callq 0x1555e
movq 0x8(%rbp), %r8
leaq 0x7bde0(%rip), %rsi     # 0xdc663
movq 0x8(%rsp), %rdi
movl %r12d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0xc007
jmp 0x6084b
movq 0xcd71a(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x697be(%rip), %rsi     # 0xca066
leaq 0x69daa(%rip), %rdx     # 0xca659
leaq 0x7be6c(%rip), %rcx     # 0xdc722
leaq 0x7be86(%rip), %r8      # 0xdc743
pushq $0x30
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300