// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x6db80(%rip), %rdi     # 0x12dcd0
movq %r14, %rsi
callq 0x5e96e
movq %rax, %r15
movq 0x8(%r14), %r13
testq %rbx, %rbx
je 0xc0174
movq %rbx, %rdi
callq 0xc103
testb %al, %al
jne 0xc0364
cmpq $0x0, 0x20(%r13)
je 0xc0194
leaq 0x33060(%rip), %rsi     # 0xf31e2
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %rax
jmp 0xc032f
leaq 0x40(%r13), %rax
movq %rax, 0x18(%rsp)
xorps %xmm1, %xmm1
pxor %xmm2, %xmm2
pshufd $0xee, %xmm2, %xmm0     # xmm0 = xmm2[2,3,2,3]
movq %xmm0, %r12
pshufd $0x44, %xmm2, %xmm0     # xmm0 = xmm2[0,1,0,1]
movdqa %xmm0, 0x20(%rsp)
movdqa %xmm2, (%rsp)
cmpq $0x2000, %r12           # imm = 0x2000
jae 0xc02fc
cmpb $0x1, 0x10(%r15)
je 0xc026f
movq 0x8(%r14), %rbp
cmpb $0x1, 0x19(%rbp)
je 0xc02c5
movq 0x48(%rbp), %rax
cmpq 0x40(%rbp), %rax
jb 0xc02d8
movq 0x28(%r13), %rdi
leaq 0x79(%rbp), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x54709
cltq
movq %rax, 0x40(%rbp)
testl %eax, %eax
jne 0xc02ce
movq 0x28(%r13), %rdi
callq 0x548ae
andq $0x0, 0x28(%r13)
movq 0x10(%r13), %rax
movl (%r13), %ebp
testq %rax, %rax
je 0xc0244
movq %rbp, %rcx
shlq $0x4, %rcx
movdqu (%rax,%rcx), %xmm0
paddq 0x20(%rsp), %xmm0
movdqu %xmm0, (%rax,%rcx)
movq 0x70(%r13), %rdi
callq 0x157f4
decq %rax
cmpq %rbp, %rax
je 0xc031f
incl (%r13)
movb $0x1, 0x10(%r15)
xorps %xmm1, %xmm1
movdqa (%rsp), %xmm2
jmp 0xc01be
movq 0x10(%r13), %rax
movl (%r13), %esi
testq %rax, %rax
je 0xc0287
movq %rsi, %rcx
shlq $0x4, %rcx
movups %xmm1, (%rax,%rcx)
movw $0x100, 0x10(%r15)      # imm = 0x100
movq 0x70(%r13), %rdi
callq 0x1555e
movq %rax, %rdi
leaq 0x168fd(%rip), %rsi     # 0xd6b9e
callq 0x540ec
xorps %xmm1, %xmm1
movq %rax, 0x28(%r13)
movq 0x18(%rsp), %rax
movups %xmm1, (%rax)
movaps (%rsp), %xmm2
movlps 0x1a630(%rip), %xmm2    # xmm2 = mem[0,1],xmm2[2,3]
jmp 0xc01a4
movb $0x0, 0x19(%rbp)
movb 0x78(%rbp), %al
jmp 0xc02e7
xorl %eax, %eax
xorps %xmm1, %xmm1
movdqa (%rsp), %xmm2
leaq 0x1(%rax), %rcx
movq %rcx, 0x48(%rbp)
movb 0x79(%rbp,%rax), %al
movb %al, 0x78(%rbp)
psubq 0x32ea1(%rip), %xmm2    # 0xf3190
movb %al, 0x2079(%r13,%r12)
jmp 0xc01a4
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xc0329
movl (%r13), %ecx
shlq $0x4, %rcx
movdqu (%rax,%rcx), %xmm0
paddq 0x20(%rsp), %xmm0
movdqu %xmm0, (%rax,%rcx)
jmp 0xc0329
movb $0x1, 0x18(%r13)
testq %r12, %r12
je 0xc033e
movq %r12, 0x58(%r13)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x70(%r13), %rdi
xorl %esi, %esi
callq 0x1555e
leaq 0x32eb4(%rip), %rsi     # 0xf3204
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc007
pushq $-0x2
jmp 0xc018e
movq 0x6dc4d(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x9cf1(%rip), %rsi      # 0xca066
leaq 0xa2dd(%rip), %rdx      # 0xca659
leaq 0x32e1d(%rip), %rcx     # 0xf31a0
leaq 0x32e37(%rip), %r8      # 0xf31c1
pushq $0x2c
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300