// File: /workspace/github_c_makefile_star2_O2/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 0x85c3d
movq %rdx, %r15
testq %rdx, %rdx
je 0x85c3d
movq %rcx, %rbx
testq %rcx, %rcx
je 0x85c3d
movq %r8, %r13
movq %rsi, %rbp
movq %rdi, %r14
callq 0x8596c
movq %rax, %rdi
movq %r14, %rsi
callq 0x8562a
movq %rax, %r14
movq 0x38(%rax), %rdi
callq 0x1452f
movq 0x40(%r14), %rdi
callq 0x1452f
movq 0x28(%r14), %rdi
callq 0x1452f
movq 0x30(%r14), %rdi
callq 0x1452f
movq %r14, %rdi
movq %r13, %rsi
callq 0x85c75
pushq $-0x1
popq %r12
cmpl $-0x1, %eax
je 0x85bbd
movl %eax, %ecx
movl %r12d, %eax
testl %ecx, %ecx
jne 0x85c2e
movq 0x28(%r14), %rdi
callq 0x143d2
movq %rax, (%rbp)
movq 0x28(%r14), %rdi
callq 0x14461
movq %rax, (%r15)
movq 0x30(%r14), %rdi
callq 0x143d2
movq %rax, (%rbx)
cmpq $0x0, 0x20a8(%r14)
je 0x85bb8
movq 0x38(%r14), %rdi
callq 0x143d2
movq 0x20a8(%r14), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rax
jmp 0x85c2e
movq %rbp, (%rsp)
movl 0x8(%r14), %ebp
incl %ebp
movq 0x90(%r14), %rdi
callq 0x157f4
movq %rax, %rcx
xorl %eax, %eax
cmpq %rbp, %rcx
jbe 0x85c2e
movq 0x90(%r14), %rdi
movl 0x8(%r14), %esi
incl %esi
movl %esi, 0x8(%r14)
callq 0x1555e
movq %rax, %rbp
movq 0x48(%r14), %rdi
callq 0x548ae
leaq 0x521ff(%rip), %rsi     # 0xd7e05
movq %rbp, %rdi
movq (%rsp), %rbp
callq 0x540ec
movq %rax, 0x48(%r14)
movq $0x1, 0x68(%r14)
movq %r14, %rdi
movq %r13, %rsi
callq 0x85c75
jmp 0x85b69
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xa8374(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x44418(%rip), %rsi     # 0xca066
leaq 0x5e1b9(%rip), %rdx     # 0xe3e0e
leaq 0x5e1c7(%rip), %rcx     # 0xe3e23
leaq 0x5e0df(%rip), %r8      # 0xe3d42
movl $0x166, %r9d            # imm = 0x166
xorl %eax, %eax
callq 0xb8c0
callq 0xb300