// File: /workspace/github_c_makefile_star2_O1/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 0xa5dba
movq %rdx, %r15
testq %rdx, %rdx
je 0xa5dba
movq %rcx, %rbx
testq %rcx, %rcx
je 0xa5dba
movq %r8, %r13
movq %rsi, %r12
movq %rdi, %r14
callq 0xa5b8a
movq %rax, %rdi
movq %r14, %rsi
callq 0xa5a37
movq %rax, %r14
movq 0x38(%rax), %rdi
callq 0x3c49c
movq 0x40(%r14), %rdi
callq 0x3c49c
movq 0x28(%r14), %rdi
callq 0x3c49c
movq 0x30(%r14), %rdi
callq 0x3c49c
movq %r14, %rdi
movq %r13, %rsi
callq 0xa5dbf
cmpl $-0x1, %eax
je 0xa5d42
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0xa5dab
movq 0x28(%r14), %rdi
callq 0x3c40b
movq %rax, (%r12)
movq 0x28(%r14), %rdi
callq 0x3c434
movq %rax, (%r15)
movq 0x30(%r14), %rdi
callq 0x3c40b
movq %rax, (%rbx)
cmpq $0x0, 0x20a8(%r14)
je 0xa5d3b
movq 0x38(%r14), %rdi
callq 0x3c40b
movq 0x20a8(%r14), %rcx
movq %rax, (%rcx)
movl $0x1, %eax
jmp 0xa5dab
movl 0x8(%r14), %ebp
incl %ebp
movq 0x90(%r14), %rdi
callq 0x3d560
movq %rax, %rcx
xorl %eax, %eax
cmpq %rbp, %rcx
jbe 0xa5dab
movq 0x90(%r14), %rdi
movl 0x8(%r14), %esi
incl %esi
movl %esi, 0x8(%r14)
callq 0x3d3e2
movq %rax, %rbp
movq 0x48(%r14), %rdi
callq 0x75b7c
leaq 0x49121(%rip), %rsi     # 0xeeea8
movq %rbp, %rdi
callq 0x756a8
movq %rax, 0x48(%r14)
movq $0x1, 0x68(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0xa5dbf
jmp 0xa5cea
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x22e4f