// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/seq_iterator_fastq.c
// Function: gt_seq_iterator_fastq_next
int gt_seq_iterator_fastq_next(GtSeqIterator *seqit,
                              const GtUchar **sequence,
                              GtUword *len,
                              char **desc,
                              GtError *err)
{
  int errstatus = 0;
  GtSeqIteratorFastQ *seqitf;
  gt_assert(seqit && len && desc);

  seqitf = gt_seq_iterator_fastq_cast(seqit);
  gt_str_reset(seqitf->qualsbuffer);
  gt_str_reset(seqitf->qdescbuffer);
  gt_str_reset(seqitf->sequencebuffer);
  gt_str_reset(seqitf->descbuffer);

  /* parse file */
  errstatus = parse_fastq_block(seqitf, err);

  if (!errstatus) {
    *sequence = (GtUchar*) gt_str_get(seqitf->sequencebuffer);
    *len = gt_str_length(seqitf->sequencebuffer);
    *desc = gt_str_get(seqitf->descbuffer);
    if (seqitf->qualities)
      *seqitf->qualities = (GtUchar*) gt_str_get(seqitf->qualsbuffer);
    errstatus = 1;
  } else {
    if (errstatus == EOF) {
      /* we could not get a next entry from this file */
      /* can we open another? */
      if (seqitf->filenum+1 < gt_str_array_size(seqitf->filenametab)) {
        const char *filename;
        filename = gt_str_array_get(seqitf->filenametab, ++seqitf->filenum);
        gt_file_delete(seqitf->curfile);
        seqitf->curfile = gt_file_xopen(filename, "r");
        seqitf->curline = 1;
        /* get first entry from next file*/
        errstatus = parse_fastq_block(seqitf, err);
        if (!errstatus) {
          *sequence = (GtUchar*) gt_str_get(seqitf->sequencebuffer);
          *len = gt_str_length(seqitf->sequencebuffer);
          *desc = gt_str_get(seqitf->descbuffer);
          if (seqitf->qualities)
            *seqitf->qualities = (GtUchar*) gt_str_get(seqitf->qualsbuffer);
          errstatus = 1;
        } else {
          errstatus = -1;
        }
      } else {
        /* all entries read from all files */
        errstatus = 0;
      }
    } else {
      errstatus = -1;
    }
  }
  return errstatus;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa554a
movq %rdx, %r15
testq %rdx, %rdx
je 0xa554a
movq %rcx, %rbx
testq %rcx, %rcx
je 0xa554a
movq %r8, %r13
movq %rsi, %r12
movq %rdi, %r14
callq 0xa531a
movq %rax, %rdi
movq %r14, %rsi
callq 0xa51c7
movq %rax, %r14
movq 0x38(%rax), %rdi
callq 0x3bbee
movq 0x40(%r14), %rdi
callq 0x3bbee
movq 0x28(%r14), %rdi
callq 0x3bbee
movq 0x30(%r14), %rdi
callq 0x3bbee
movq %r14, %rdi
movq %r13, %rsi
callq 0xa554f
cmpl $-0x1, %eax
je 0xa54d2
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xa553b
movq 0x28(%r14), %rdi
callq 0x3bb5d
movq %rax, (%r12)
movq 0x28(%r14), %rdi
callq 0x3bb86
movq %rax, (%r15)
movq 0x30(%r14), %rdi
callq 0x3bb5d
movq %rax, (%rbx)
cmpq $0x0, 0x20a8(%r14)
je 0xa54cb
movq 0x38(%r14), %rdi
callq 0x3bb5d
movq 0x20a8(%r14), %rcx
movq %rax, (%rcx)
movl $0x1, %eax
jmp 0xa553b
movl 0x8(%r14), %ebp
incl %ebp
movq 0x90(%r14), %rdi
callq 0x3cbed
movq %rax, %rcx
xorl %eax, %eax
cmpq %rbp, %rcx
jbe 0xa553b
movq 0x90(%r14), %rdi
movl 0x8(%r14), %esi
incl %esi
movl %esi, 0x8(%r14)
callq 0x3ca6f
movq %rax, %rbp
movq 0x48(%r14), %rdi
callq 0x760c0
leaq 0x49946(%rip), %rsi     # 0xeee5d
movq %rbp, %rdi
callq 0x75bec
movq %rax, 0x48(%r14)
movq $0x1, 0x68(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0xa554f
jmp 0xa547a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x22d77