// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
callq 0x14af20
movq %rax, %rdi
movq 0x48(%rsp), %rsi
callq 0x9b9e0
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x14afc5
movq 0x40(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x14af8d
jmp 0x14afc5
movq 0x69044(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0x130c8(%rip), %rsi     # 0x15e066
leaq 0x136a3(%rip), %rdx     # 0x15e648
leaq 0x41f5f(%rip), %rcx     # 0x18cf0b
leaq 0x41f79(%rip), %r8      # 0x18cf2c
movl $0x2c, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x14afc7
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x14aff3
movq 0x40(%rsp), %rdi
leaq 0x41f6e(%rip), %rsi     # 0x18cf4d
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x14b289
jmp 0x14aff5
cmpq $0x2000, 0x30(%rsp)     # imm = 0x2000
jb 0x14b057
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x14b052
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
jmp 0x14b22f
movq 0x18(%rsp), %rax
testb $0x1, 0x10(%rax)
je 0x14b11b
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x14b0af
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rcx
movl (%rcx), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movq 0x18(%rsp), %rax
movb $0x0, 0x10(%rax)
movq 0x18(%rsp), %rax
movb $0x1, 0x11(%rax)
movq $0x0, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq 0x70(%rax), %rdi
movq 0x20(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
callq 0x1b320
movq %rax, %rdi
leaq 0x1fec0(%rip), %rsi     # 0x16afab
callq 0x834c0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x48(%rax)
movq 0x20(%rsp), %rax
movq $0x0, 0x40(%rax)
jmp 0x14b22a
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rsi
callq 0x14b3b0
movl %eax, 0x3c(%rsp)
cmpl $-0x1, 0x3c(%rsp)
jne 0x14b1f7
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdi
callq 0x83f40
movq 0x20(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x14b1aa
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x20(%rsp), %rdx
movl (%rdx), %edx
shlq $0x4, %rdx
addq %rdx, %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x1b720
movq %rax, %rcx
movq 0x10(%rsp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x14b1e0
movq 0x20(%rsp), %rax
movb $0x1, 0x18(%rax)
jmp 0x14b22f
movq 0x20(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x18(%rsp), %rax
movb $0x1, 0x10(%rax)
jmp 0x14b228
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
movl 0x3c(%rsp), %eax
movb %al, %dl
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x30(%rsp)
movb %dl, 0x2079(%rax,%rcx)
jmp 0x14b22a
jmp 0x14aff5
cmpq $0x0, 0x30(%rsp)
jne 0x14b273
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x70(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1b320
movq 0x8(%rsp), %rdi
movq %rax, %rdx
leaq 0x41d0d(%rip), %rsi     # 0x18cf6f
movb $0x0, %al
callq 0xc0d0
movl $0xfffffffe, 0x54(%rsp) # imm = 0xFFFFFFFE
jmp 0x14b289
movq 0x30(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x58(%rax)
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)