// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/sequence_buffer_plain.c
// Function: gt_sequence_buffer_plain_advance
static int gt_sequence_buffer_plain_advance(GtSequenceBuffer *sb, GtError *err)
{
  int currentchar;
  GtUword currentoutpos = 0, currentfileread = 0;
  GtSequenceBufferMembers *pvt;
  GtSequenceBufferPlain *sbp;

  sbp = gt_sequence_buffer_plain_cast(sb);
  pvt = sb->pvt;

  gt_error_check(err);
  if (pvt->descptr != NULL)
  {
    gt_error_set(err, "no headers in plain sequence file");
    return -1;
  }
  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) currentfileread;
      }
      break;
    }
    if (sbp->nextfile)
    {
      if (pvt->filelengthtab != NULL)
      {
        pvt->filelengthtab[pvt->filenum].length = 0;
        pvt->filelengthtab[pvt->filenum].effectivelength = 0;
      }
      sbp->nextfile = false;
      sbp->firstseqinfile = true;
      currentfileread = 0;
      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
            += (uint64_t) currentfileread;
          pvt->filelengthtab[pvt->filenum].effectivelength
            += (uint64_t) currentfileread;
        }
        if ((GtUword) pvt->filenum
                                       == gt_str_array_size(pvt->filenametab)-1)
        {
          pvt->complete = true;
          break;
        }
        pvt->filenum++;
        sbp->nextfile = true;
      } else
      {
        currentfileread++;
        pvt->outbuf[currentoutpos++] = (unsigned char) currentchar;
      }
    }
  }
  if (currentoutpos == 0)
  {
    gt_error_set(err, "no characters in plain 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
leaq 0x7884c(%rip), %rdi     # 0x150ce0
movq %r14, %rsi
callq 0x7f41e
movq %rax, %r15
movq 0x8(%r14), %r13
testq %rbx, %rbx
je 0xd84b8
movq %rbx, %rdi
callq 0x34fea
testb %al, %al
jne 0xd867e
cmpq $0x0, 0x20(%r13)
je 0xd84da
leaq 0x31a5a(%rip), %rsi     # 0x109f20
movq %rbx, %rdi
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xd863d
movq %rbx, 0x8(%rsp)
leaq 0x40(%r13), %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
pxor %xmm0, %xmm0
xorl %r12d, %r12d
cmpb $0x1, 0x10(%r15)
jne 0xd8546
movq 0x10(%r13), %rax
movl (%r13), %esi
testq %rax, %rax
je 0xd8511
movq %rsi, %rcx
shlq $0x4, %rcx
movdqu %xmm0, (%rax,%rcx)
movw $0x100, 0x10(%r15)      # imm = 0x100
movq 0x70(%r13), %rdi
callq 0x3ca6f
movq %rax, %rdi
leaq 0x156cb(%rip), %rsi     # 0xedbf6
callq 0x75bec
pxor %xmm0, %xmm0
movq %rax, 0x28(%r13)
movq 0x10(%rsp), %rax
movdqu %xmm0, (%rax)
xorl %r12d, %r12d
jmp 0xd85a2
movq 0x8(%r14), %rbx
cmpb $0x1, 0x19(%rbx)
jne 0xd8559
movb $0x0, 0x19(%rbx)
movb 0x78(%rbx), %al
jmp 0xd8594
movq 0x48(%rbx), %rax
cmpq 0x40(%rbx), %rax
jb 0xd8585
movq 0x28(%r13), %rdi
leaq 0x79(%rbx), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x75fcd
cltq
movq %rax, 0x40(%rbx)
testl %eax, %eax
je 0xd85b1
xorl %eax, %eax
pxor %xmm0, %xmm0
leaq 0x1(%rax), %rcx
movq %rcx, 0x48(%rbx)
movb 0x79(%rbx,%rax), %al
movb %al, 0x78(%rbx)
incq %r12
movb %al, 0x2079(%r13,%rbp)
incq %rbp
cmpq $0x1fff, %rbp           # imm = 0x1FFF
jbe 0xd84f1
jmp 0xd860e
movq 0x28(%r13), %rdi
callq 0x760c0
movq $0x0, 0x28(%r13)
movq 0x10(%r13), %rax
movl (%r13), %ebx
testq %rax, %rax
je 0xd85ee
movq %rbx, %rcx
shlq $0x4, %rcx
movdqu (%rax,%rcx), %xmm0
movq %r12, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
paddq %xmm0, %xmm1
movdqu %xmm1, (%rax,%rcx)
movq 0x70(%r13), %rdi
callq 0x3cbed
decq %rax
cmpq %rbx, %rax
je 0xd864c
incl (%r13)
movb $0x1, 0x10(%r15)
pxor %xmm0, %xmm0
jmp 0xd85a2
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xd8637
movl (%r13), %ecx
shlq $0x4, %rcx
movdqu (%rax,%rcx), %xmm0
movq %r12, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
paddq %xmm0, %xmm1
movdqu %xmm1, (%rax,%rcx)
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)
testq %rbp, %rbp
jne 0xd8637
movq 0x70(%r13), %rdi
xorl %esi, %esi
callq 0x3ca6f
leaq 0x318da(%rip), %rsi     # 0x109f42
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x34f1f
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0xd863d
callq 0x32835