// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/ltr/ltr_classify_stream.c
// Function: gt_ltr_classify_stream_next
static int gt_ltr_classify_stream_next(GtNodeStream *ns,
                                       GtGenomeNode **gn,
                                       GtError *err)
{
  GtLTRClassifyStream *lcs;
  GtGenomeNode *ref_gn;
  int had_err = 0;

  gt_error_check(err);
  lcs = gt_ltr_classify_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);
    }
    if (!had_err)
      had_err = classify_ltrs(lcs->nodes, lcs->features, lcs->famprefix,
                              lcs->current_state, lcs->progress, err);
    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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2068, %rsp           # imm = 0x2068
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
testq %rdx, %rdx
je 0x206a6d
movq %rbp, %rdi
callq 0xfcc32
testb %al, %al
jne 0x207209
callq 0x206998
movq %rax, %rdi
movq %rbx, %rsi
callq 0x162ff7
movq %rax, %r12
cmpb $0x1, 0x38(%rax)
jne 0x206adf
movq 0x10(%r12), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x162e68
testl %eax, %eax
jne 0x206adb
leaq 0x50(%rsp), %r14
movq (%r15), %rdi
testq %rdi, %rdi
je 0x206b2c
callq 0x1443a0
movq %rax, 0x50(%rsp)
movq 0x18(%r12), %rdi
movl $0x8, %edx
movq %r14, %rsi
callq 0xd2410
movq 0x10(%r12), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x162e68
testl %eax, %eax
je 0x206a9f
movl %eax, %ebx
jmp 0x206b18
movq 0x18(%r12), %rdi
movq 0x40(%r12), %rbx
callq 0xd24e0
cmpq %rax, %rbx
jae 0x206b0f
movq 0x18(%r12), %rdi
movq 0x40(%r12), %rsi
callq 0xd2207
movq (%rax), %rax
movq %rax, (%r15)
incq 0x40(%r12)
jmp 0x206b16
movq $0x0, (%r15)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x2068, %rsp           # imm = 0x2068
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r12), %rax
movq %rax, (%rsp)
movq 0x20(%r12), %r13
movq 0x28(%r12), %rax
movq %rax, 0x48(%rsp)
movq 0x30(%r12), %rax
movq %rax, 0x30(%rsp)
movq 0x48(%r12), %rax
movq %rax, 0x8(%rsp)
testq %rbp, %rbp
je 0x206b6d
movq %rbp, %rdi
callq 0xfcc32
testb %al, %al
jne 0x207218
movq %rbp, 0x18(%rsp)
movq %r12, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movq (%rsp), %r12
testq %r12, %r12
je 0x20720e
movq %r12, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x206cf6
xorl %ebp, %ebp
leaq 0x18fdc2(%rip), %rbx    # 0x396965
movq %r12, %rdi
movq %rbp, %rsi
callq 0xd2207
movq (%rax), %r14
movq %r14, %rdi
callq 0x143cab
testq %rax, %rax
je 0x206ce2
movl $0x1, %edi
leaq -0x102524(%rip), %rsi   # 0x1046aa
xorl %edx, %edx
callq 0x1008fc
movq %rax, 0x10(%rsp)
movq %r14, 0x28(%rsp)
movq %r14, %rdi
callq 0x143f54
movq %rax, %r14
movq %rax, %rdi
callq 0x1440ea
testq %rax, %rax
je 0x206cb9
movq %rax, %r12
movb $0x1, %al
movl %eax, 0x24(%rsp)
movq %r12, %rdi
callq 0x142988
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x17a40
testl %eax, %eax
je 0x206c6e
movq %r15, %rdi
leaq 0x18df8f(%rip), %rsi    # 0x394bb7
callq 0x17a40
testl %eax, %eax
je 0x206c6e
movq %r15, %rdi
leaq 0x19087d(%rip), %rsi    # 0x3974b8
callq 0x17a40
testl %eax, %eax
je 0x206c80
movq %r15, %rdi
leaq 0x179fcb(%rip), %rsi    # 0x380c19
callq 0x17a40
testl %eax, %eax
jne 0x206c69
movq %r12, %rdi
leaq 0x17bafe(%rip), %rsi    # 0x38275f
callq 0x141f50
movq %rax, %r15
testq %r15, %r15
jne 0x206c9f
movq %r14, %rdi
callq 0x1440ea
movq %rax, %r12
testq %rax, %rax
jne 0x206c04
jmp 0x206cb9
testb $0x1, 0x24(%rsp)
leaq 0x1b8757(%rip), %r15    # 0x3bf3e3
leaq 0x1b874b(%rip), %rax    # 0x3bf3de
cmovneq %rax, %r15
movl $0x0, 0x24(%rsp)
movq %r15, %rdi
callq 0xe4290
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x100b18
jmp 0x206c6e
movq 0x28(%rsp), %rdi
leaq 0x1b8723(%rip), %rsi    # 0x3bf3e8
movq 0x10(%rsp), %rdx
leaq 0x939(%rip), %rcx       # 0x20760a
callq 0x144a7d
movq %r14, %rdi
callq 0x14417c
movq (%rsp), %r12
incq %rbp
movq %r12, %rdi
callq 0xd24e0
cmpq %rax, %rbp
jb 0x206ba3
movq %r12, %rdi
callq 0xd24e0
movq %rax, %rbx
movl $0x8, %edi
callq 0xd214c
movq %rax, %rbp
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x206d40
movq (%rax), %rdi
leaq 0x1b8658(%rip), %rsi    # 0x3bf37a
movl $0x14b, %edx            # imm = 0x14B
callq 0x1045eb
leaq 0x1b8673(%rip), %rdi    # 0x3bf3a6
callq 0xe4290
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
testq %rbx, %rbx
je 0x206e1a
xorl %r14d, %r14d
movq %rbx, 0x10(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xd2207
movq (%rax), %r15
movq %r15, %rdi
callq 0x143cab
testq %rax, %rax
je 0x206e0e
movq %rbp, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x206db9
xorl %r12d, %r12d
movq %rbp, %rdi
movq %r12, %rsi
callq 0xd2207
movq (%rax), %rbx
movq (%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movq 0x18(%rsp), %r8
callq 0x2072b3
testb %al, %al
jne 0x206dea
incq %r12
movq %rbp, %rdi
callq 0xd24e0
cmpq %rax, %r12
jb 0x206d80
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xd6a50
movq %rax, 0x58(%rsp)
movq %rax, %rdi
movq %r14, %rsi
callq 0xd6abc
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
callq 0xd2410
jmp 0x206dfa
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd6abc
movq 0x10(%rsp), %rbx
cmpq $0x0, 0x8(%rsp)
movq (%rsp), %r12
je 0x206e0e
movq 0x8(%rsp), %rax
incq (%rax)
incq %r14
cmpq %rbx, %r14
jne 0x206d51
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x206e4a
movq (%rax), %rdi
leaq 0x1b854c(%rip), %rsi    # 0x3bf37a
movl $0x166, %edx            # imm = 0x166
movq %rax, %rbx
callq 0x1045eb
leaq 0x1b8585(%rip), %rdi    # 0x3bf3c7
callq 0xe4290
movq %rax, (%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x206e61
callq 0xfcc32
testb %al, %al
jne 0x20721d
testq %rbp, %rbp
je 0x207213
movq %r12, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x206f99
xorl %ebx, %ebx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd2207
movq (%rax), %r12
movq %r12, %rdi
callq 0x143cab
testq %rax, %rax
je 0x206f81
movl $0x8, %edi
callq 0xd214c
movq %rax, %r14
movq %rbp, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x206f06
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd2207
movq (%rax), %rdx
movq %rdx, 0x60(%rsp)
movq (%rsp), %rdi
movq %r12, %rsi
movq %r13, %rcx
movq 0x18(%rsp), %r8
callq 0x2072b3
testb %al, %al
je 0x206ef6
movl $0x8, %edx
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0xd2410
incq %r15
movq %rbp, %rdi
callq 0xd24e0
cmpq %rax, %r15
jb 0x206eb9
movq %r14, %rdi
callq 0xd24e0
cmpq $0x2, %rax
jb 0x206f69
movq %rbp, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x206f69
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd2207
movq (%rax), %rdi
movq %rdi, 0x60(%rsp)
movq %rbx, %rsi
callq 0xd6ae3
movq 0x60(%rsp), %rdi
callq 0xd6fbe
testq %rax, %rax
jne 0x206f59
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd2266
incq %r15
movq %rbp, %rdi
callq 0xd24e0
cmpq %rax, %r15
jb 0x206f24
movq %r14, %rdi
callq 0xd2938
cmpq $0x0, 0x8(%rsp)
je 0x206f81
movq 0x8(%rsp), %rax
incq (%rax)
incq %rbx
movq (%rsp), %r12
movq %r12, %rdi
callq 0xd24e0
cmpq %rax, %rbx
jb 0x206e7d
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x206fb0
callq 0xfcc32
testb %al, %al
jne 0x207222
movq %rbp, %rdi
callq 0xd24e0
movb $0x1, %cl
movl %ecx, 0x28(%rsp)
testq %rax, %rax
je 0x20710f
movq $0x0, 0x8(%rsp)
xorl %ebx, %ebx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xd2207
movq (%rax), %r14
movl $0x8, %edi
callq 0xd214c
movq %rax, %r13
movq %r14, %rdi
movq %rax, %rsi
callq 0xd6ddc
movq %r13, %rdi
callq 0xd24e0
cmpq $0x2, %rax
jae 0x207013
movq %r13, %rdi
callq 0xd2938
jmp 0x2070fb
movq %rbx, 0x10(%rsp)
movq %r13, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x2070e5
xorl %r12d, %r12d
movq %r13, %rdi
movq %r12, %rsi
callq 0xd2207
movq (%rax), %rsi
movq (%rsp), %rdi
callq 0xd2207
movq (%rax), %rdi
callq 0x143f54
movq %rax, %r15
movq %rax, %rdi
callq 0x1440ea
movq %rax, %r14
movq %rax, %rdi
callq 0x142988
movq %rax, %rdi
leaq 0x18f8fa(%rip), %rsi    # 0x396965
callq 0x17a40
testl %eax, %eax
jne 0x207113
movq 0x48(%rsp), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
testq %rcx, %rcx
je 0x2070a4
leaq 0x1b83f7(%rip), %rdx    # 0x3bf48d
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x17c60
jmp 0x2070b7
leaq 0x1b83e8(%rip), %rdx    # 0x3bf493
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x17c60
movq %r14, %rdi
leaq 0x1b83dd(%rip), %rsi    # 0x3bf49e
movq %rbx, %rdx
callq 0x142a0f
movq %r15, %rdi
callq 0x14417c
incq %r12
movq %r13, %rdi
callq 0xd24e0
cmpq %rax, %r12
jb 0x20702c
movq %r13, %rdi
callq 0xd2938
incq 0x8(%rsp)
movq (%rsp), %r12
movq 0x10(%rsp), %rbx
incq %rbx
movq %rbp, %rdi
callq 0xd24e0
cmpq %rax, %rbx
jb 0x206fd2
xorl %ebx, %ebx
jmp 0x207147
movq %r15, %rdi
callq 0x14417c
leaq 0x1b8383(%rip), %rsi    # 0x3bf4a5
movl $0x0, 0x28(%rsp)
movq 0x18(%rsp), %rdi
xorl %eax, %eax
callq 0xfcb67
movq %r13, %rdi
callq 0xd2938
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq (%rsp), %r12
movq %rbp, %rdi
callq 0xd24e0
testq %rax, %rax
je 0x20717a
xorl %r14d, %r14d
movq %rbp, %rdi
movq %r14, %rsi
callq 0xd2207
movq (%rax), %rdi
callq 0xd7151
incq %r14
movq %rbp, %rdi
callq 0xd24e0
cmpq %rax, %r14
jb 0x207157
movq %rbp, %rdi
callq 0xd2938
movq %r12, %rdi
callq 0xd24e0
testq %rax, %rax
movq 0x40(%rsp), %r13
movq 0x38(%rsp), %rbp
je 0x2071dd
xorl %r14d, %r14d
leaq 0x1b8245(%rip), %r15    # 0x3bf3e8
movq %r12, %rdi
movq %r14, %rsi
callq 0xd2207
movq (%rax), %r12
movq %r12, %rdi
callq 0x143cab
testq %rax, %rax
je 0x2071c9
movq %r12, %rdi
movq %r15, %rsi
callq 0x144b9c
incq %r14
movq (%rsp), %r12
movq %r12, %rdi
callq 0xd24e0
cmpq %rax, %r14
jb 0x2071a3
cmpb $0x0, 0x28(%rsp)
je 0x206b18
movq 0x18(%rbp), %rdi
movq 0x40(%rbp), %rsi
callq 0xd2207
movq (%rax), %rax
movq %rax, (%r13)
incq 0x40(%rbp)
movb $0x0, 0x38(%rbp)
jmp 0x206b16
callq 0x801b2
callq 0x802cf
callq 0x80296
callq 0x801eb
callq 0x80224
callq 0x8025d