// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltr_cluster_stream.c
// Function: gt_ltr_cluster_stream_next
static int gt_ltr_cluster_stream_next(GtNodeStream *ns,
                                      GtGenomeNode **gn,
                                      GtError *err)
{
  GtLTRClusterStream *lcs;
  GtGenomeNode *ref_gn;
  int had_err = 0;
  GtUword i = 0;

  gt_error_check(err);
  lcs = gt_ltr_cluster_stream_cast(ns);
  if (lcs->first_next) {
    while (!(had_err = gt_node_stream_next(lcs->in_stream, gn, err)) && *gn) {
      gt_assert(*gn && !had_err);
      ref_gn = gt_genome_node_ref(*gn);
      gt_array_add(lcs->nodes, ref_gn);
      had_err = gt_genome_node_accept(*gn, (GtNodeVisitor*) lcs->lcv, err);
      if (had_err) {
        gt_genome_node_delete(*gn);
        *gn = NULL;
        return had_err;
      }
    }
    lcs->feat_to_encseq =
                       gt_ltr_cluster_prepare_seq_visitor_get_encseqs(lcs->lcv);
    lcs->feat_to_encseq_keys =
                      gt_ltr_cluster_prepare_seq_visitor_get_features(lcs->lcv);
    if (!had_err) {
      for (i = 0; i < gt_str_array_size(lcs->feat_to_encseq_keys); i++) {
        had_err = process_feature(lcs,
                                  gt_str_array_get(lcs->feat_to_encseq_keys, i),
                                  err);
        if (had_err)
          break;
      }
    }
    if (!had_err) {
      *gn = *(GtGenomeNode**) gt_array_get(lcs->nodes, lcs->next_index);
      lcs->next_index++;
      lcs->first_next = false;
      return 0;
    }
  } else {
    if (lcs->next_index >= gt_array_size(lcs->nodes))
      *gn = NULL;
    else {
      *gn = *(GtGenomeNode**) gt_array_get(lcs->nodes, lcs->next_index);
      lcs->next_index++;
    }
    return 0;
  }

  return had_err;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdx, 0x48(%rsp)
movl $0x0, 0x34(%rsp)
movq $0x0, 0x28(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x2ff364
movq 0x48(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x2ff32c
jmp 0x2ff364
movq 0x33cc6d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x216cd6(%rip), %rsi    # 0x516013
leaq 0x216e7b(%rip), %rdx    # 0x5161bf
leaq 0x29330f(%rip), %rcx    # 0x59265a
leaq 0x293323(%rip), %r8     # 0x592675
movl $0x1e9, %r9d            # imm = 0x1E9
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ff366
callq 0x2ff1e0
movq %rax, %rdi
movq 0x58(%rsp), %rsi
callq 0x1b20f0
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
testb $0x1, 0x38(%rax)
je 0x2ff5a5
jmp 0x2ff38e
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x1b1d90
movl %eax, %ecx
movl %ecx, 0x34(%rsp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x27(%rsp)
jne 0x2ff3c7
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x2ff3d4
jmp 0x2ff49d
jmp 0x2ff3d6
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
je 0x2ff3e8
cmpl $0x0, 0x34(%rsp)
je 0x2ff420
movq 0x33cbb1(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x216c1a(%rip), %rsi    # 0x516013
leaq 0x24d800(%rip), %rdx    # 0x54cc00
leaq 0x293253(%rip), %rcx    # 0x59265a
leaq 0x293267(%rip), %r8     # 0x592675
movl $0x1ed, %r9d            # imm = 0x1ED
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ff422
movq 0x50(%rsp), %rax
movq (%rax), %rdi
callq 0x171410
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x38(%rsp), %rsi
movl $0x8, %edx
callq 0x81100
movq 0x50(%rsp), %rax
movq (%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x48(%rsp), %rdx
callq 0x171f90
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x2ff498
movq 0x50(%rsp), %rax
movq (%rax), %rdi
callq 0x173180
movq 0x50(%rsp), %rax
movq $0x0, (%rax)
movl 0x34(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x2ff621
jmp 0x2ff38e
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x4e9660
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x4e9710
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0x30(%rax)
cmpl $0x0, 0x34(%rsp)
jne 0x2ff556
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x11fcc0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x2ff554
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x11f8c0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x48(%rsp), %rdx
callq 0x2ff7f0
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x2ff542
jmp 0x2ff554
jmp 0x2ff544
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x2ff4e1
jmp 0x2ff556
cmpl $0x0, 0x34(%rsp)
jne 0x2ff5a3
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rsi
callq 0x80b60
movq (%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x50(%rax)
movq 0x40(%rsp), %rax
movb $0x0, 0x38(%rax)
movl $0x0, 0x64(%rsp)
jmp 0x2ff621
jmp 0x2ff619
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x81370
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jb 0x2ff5dc
movq 0x50(%rsp), %rax
movq $0x0, (%rax)
jmp 0x2ff60f
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rsi
callq 0x80b60
movq (%rax), %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x50(%rax)
movl $0x0, 0x64(%rsp)
jmp 0x2ff621
movl 0x34(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopw (%rax,%rax)