// File: /workspace/github_c_makefile_star2_O1/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 0x78f54(%rip), %rdi     # 0x150ce0
movq %r14, %rsi
callq 0x7f396
movq %rax, %r15
movq 0x8(%r14), %r13
testq %rbx, %rbx
je 0xd7db0
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0xd7fa0
cmpq $0x0, 0x20(%r13)
je 0xd7dd2
leaq 0x32342(%rip), %rsi     # 0x10a100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xd7f91
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 0xd7e42
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xd7e06
movl (%r13), %ecx
shlq $0x4, %rcx
movdqu %xmm0, (%rax,%rcx)
movw $0x100, 0x10(%r15)      # imm = 0x100
movq 0x70(%r13), %rdi
movl (%r13), %esi
callq 0x3d3e2
movq %rax, %rdi
leaq 0x15e1a(%rip), %rsi     # 0xedc3e
callq 0x756a8
pxor %xmm0, %xmm0
movq %rax, 0x28(%r13)
movq 0x10(%rsp), %rax
movdqu %xmm0, (%rax)
xorl %r12d, %r12d
jmp 0xd7f11
movq 0x8(%r14), %rbx
cmpb $0x1, 0x19(%rbx)
jne 0xd7e56
movb $0x0, 0x19(%rbx)
movzbl 0x78(%rbx), %eax
jmp 0xd7ea0
movq 0x48(%rbx), %rax
cmpq 0x40(%rbx), %rax
jb 0xd7e8c
movq 0x28(%r13), %rdi
leaq 0x79(%rbx), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x75a89
cltq
movq %rax, 0x40(%rbx)
testl %eax, %eax
je 0xd7f20
movq $0x0, 0x48(%rbx)
pxor %xmm0, %xmm0
movq 0x48(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x48(%rbx)
movzbl 0x79(%rbx,%rax), %eax
movb %al, 0x78(%rbx)
cmpl $-0x1, %eax
je 0xd7eb5
incq %r12
movb %al, 0x2079(%r13,%rbp)
incq %rbp
jmp 0xd7f11
movq 0x28(%r13), %rdi
callq 0x75b7c
movq $0x0, 0x28(%r13)
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xd7eef
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)
movl (%r13), %ebx
movq 0x70(%r13), %rdi
callq 0x3d560
decq %rax
cmpq %rbx, %rax
je 0xd7f59
incl (%r13)
movb $0x1, 0x10(%r15)
pxor %xmm0, %xmm0
cmpq $0x1fff, %rbp           # imm = 0x1FFF
jbe 0xd7de9
jmp 0xd7f2e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
pxor %xmm0, %xmm0
jmp 0xd7ea0
movq 0x10(%r13), %rax
testq %rax, %rax
je 0xd7f5e
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)
jmp 0xd7f5e
movb $0x1, 0x18(%r13)
testq %rbp, %rbp
je 0xd7f6b
movq %rbp, 0x58(%r13)
xorl %eax, %eax
jmp 0xd7f91
movq 0x70(%r13), %rdi
xorl %esi, %esi
callq 0x3d3e2
leaq 0x321a5(%rip), %rsi     # 0x10a122
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3559f
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x32e32