// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rsi, %r13
movq %rdi, %rbx
testq %rdx, %rdx
je 0x210331
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0x210ac5
callq 0x21025c
movq %rax, %rdi
movq %rbx, %rsi
callq 0x16ae64
movq %rax, %r15
cmpb $0x1, 0x38(%rax)
jne 0x2103c2
movq 0x10(%r15), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x16ace8
testl %eax, %eax
jne 0x21039d
leaq 0x50(%rsp), %r14
movq (%r13), %rdi
testq %rdi, %rdi
je 0x21040c
callq 0x14b5fc
movq %rax, 0x50(%rsp)
movq 0x18(%r15), %rdi
movl $0x8, %edx
movq %r14, %rsi
callq 0xd49ce
movq 0x10(%r15), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x16ace8
testl %eax, %eax
je 0x210362
movl %eax, %ebx
testl %ebx, %ebx
jne 0x2103f8
movq 0x18(%r15), %rdi
movq 0x40(%r15), %rsi
callq 0xd47ba
movq (%rax), %rax
movq %rax, (%r13)
incq 0x40(%r15)
movb $0x0, 0x38(%r15)
jmp 0x2103f6
movq 0x18(%r15), %rdi
movq 0x40(%r15), %rbx
callq 0xd4a9a
cmpq %rax, %rbx
jae 0x2103ee
movq 0x18(%r15), %rdi
movq 0x40(%r15), %rsi
callq 0xd47ba
movq (%rax), %rax
movq %rax, (%r13)
incq 0x40(%r15)
jmp 0x2103f6
movq $0x0, (%r13)
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 %r13, 0x40(%rsp)
movq 0x18(%r15), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%r15), %r13
movq 0x28(%r15), %rax
movq %rax, 0x48(%rsp)
movq 0x30(%r15), %rbx
movq 0x48(%r15), %rax
movq %rax, 0x10(%rsp)
testq %r12, %r12
je 0x210449
movq %r12, %rdi
callq 0x101a9a
testb %al, %al
jne 0x210ad4
movq %rbx, 0x30(%rsp)
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0x210aca
movq %rbx, %rdi
callq 0xd4a9a
testq %rax, %rax
movq %r15, 0x38(%rsp)
movq %rbx, %r15
movq %r12, 0x20(%rsp)
je 0x2105e2
xorl %r14d, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0xd47ba
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x14aefc
testq %rax, %rax
je 0x2105ce
movl $0x1, %edi
leaq -0x106d79(%rip), %rsi   # 0x10972f
xorl %edx, %edx
callq 0x105830
movq %rax, 0x8(%rsp)
movq %rbx, %r15
movq %rbx, %rdi
callq 0x14b1a8
movq %rax, %rbx
movq %rax, %rdi
callq 0x14b33e
testq %rax, %rax
je 0x2105a6
movq %rax, %r12
movb $0x1, %al
movl %eax, 0x2c(%rsp)
movq %r12, %rdi
callq 0x149bb2
movq %rax, %rbp
movq %rax, %rdi
leaq 0x18f924(%rip), %rsi    # 0x39fe15
callq 0x17a40
testl %eax, %eax
je 0x21050d
movq %rbp, %rdi
leaq 0x18db5a(%rip), %rsi    # 0x39e05e
callq 0x17a40
testl %eax, %eax
jne 0x210522
movq %rbx, %rdi
callq 0x14b33e
movq %rax, %r12
testq %rax, %rax
jne 0x2104dc
jmp 0x2105a6
movq %rbp, %rdi
leaq 0x190452(%rip), %rsi    # 0x3a097e
callq 0x17a40
testl %eax, %eax
je 0x21055c
movq %rbp, %rdi
leaq 0x179a98(%rip), %rsi    # 0x389fd7
callq 0x17a40
testl %eax, %eax
jne 0x210584
movq %r12, %rdi
leaq 0x17b5d0(%rip), %rsi    # 0x38bb22
callq 0x14918c
movq %rax, %rbp
jmp 0x210584
movl 0x2c(%rsp), %ecx
movzbl %cl, %ecx
testb $0x1, %cl
movl $0x0, %eax
cmovnel %eax, %ecx
movl %ecx, 0x2c(%rsp)
leaq 0x1b84ea(%rip), %rbp    # 0x3c8a63
leaq 0x1b84de(%rip), %rax    # 0x3c8a5e
cmovneq %rax, %rbp
testq %rbp, %rbp
je 0x21050d
movq %rbp, %rdi
callq 0xe8760
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x105a4c
jmp 0x21050d
movq %r15, %rdi
leaq 0x1b84b8(%rip), %rsi    # 0x3c8a68
movq 0x8(%rsp), %rdx
leaq 0x8f7(%rip), %rcx       # 0x210eb3
callq 0x14bd18
movq %rbx, %rdi
callq 0x14b3d0
movq 0x18(%rsp), %r15
incq %r14
movq %r15, %rdi
callq 0xd4a9a
cmpq %rax, %r14
jb 0x21047d
movq %r15, %rdi
callq 0xd4a9a
movq %rax, 0x8(%rsp)
movl $0x8, %edi
callq 0xd46fc
movq %rax, %rbp
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0x210629
movq (%rbx), %rdi
leaq 0x1b83ea(%rip), %rsi    # 0x3c89fa
movl $0x14b, %edx            # imm = 0x14B
callq 0x109670
leaq 0x1b8405(%rip), %rdi    # 0x3c8a26
callq 0xe8760
movq %rax, (%rbx)
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x210705
xorl %r14d, %r14d
movq %r15, %rdi
movq %r14, %rsi
callq 0xd47ba
movq (%rax), %r12
movq %r12, %rdi
callq 0x14aefc
testq %rax, %rax
je 0x2106f9
movq %rbp, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x2106a3
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd47ba
movq (%rax), %rbx
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movq 0x20(%rsp), %r8
callq 0x210b6f
testb %al, %al
jne 0x2106d4
incq %r15
movq %rbp, %rdi
callq 0xd4a9a
cmpq %rax, %r15
jb 0x210669
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xd90d0
movq %rax, 0x58(%rsp)
movq %rax, %rdi
movq %r14, %rsi
callq 0xd913c
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
callq 0xd49ce
jmp 0x2106e4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd913c
movq 0x8(%rsp), %rbx
cmpq $0x0, 0x10(%rsp)
movq 0x18(%rsp), %r15
je 0x2106f9
movq 0x10(%rsp), %rax
incq (%rax)
incq %r14
cmpq %rbx, %r14
jne 0x21063a
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0x210732
movq (%rbx), %rdi
leaq 0x1b82e1(%rip), %rsi    # 0x3c89fa
movl $0x166, %edx            # imm = 0x166
callq 0x109670
leaq 0x1b831d(%rip), %rdi    # 0x3c8a47
callq 0xe8760
movq %rax, (%rbx)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x210749
callq 0x101a9a
testb %al, %al
jne 0x210ad9
testq %rbp, %rbp
je 0x210acf
movq %r15, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x210883
xorl %ebx, %ebx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd47ba
movq (%rax), %r12
movq %r12, %rdi
callq 0x14aefc
testq %rax, %rax
je 0x21086f
movl $0x8, %edi
callq 0xd46fc
movq %rax, %r14
movq %rbp, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x2107ef
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd47ba
movq (%rax), %rdx
movq %rdx, 0x60(%rsp)
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rcx
movq 0x20(%rsp), %r8
callq 0x210b6f
testb %al, %al
je 0x2107df
movl $0x8, %edx
movq %r14, %rdi
leaq 0x60(%rsp), %rsi
callq 0xd49ce
incq %r15
movq %rbp, %rdi
callq 0xd4a9a
cmpq %rax, %r15
jb 0x2107a1
movq %r14, %rdi
callq 0xd4a9a
cmpq $0x2, %rax
jb 0x210852
movq %rbp, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x210852
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd47ba
movq (%rax), %rdi
movq %rdi, 0x60(%rsp)
movq %rbx, %rsi
callq 0xd9163
movq 0x60(%rsp), %rdi
callq 0xd964d
testq %rax, %rax
jne 0x210842
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd4819
incq %r15
movq %rbp, %rdi
callq 0xd4a9a
cmpq %rax, %r15
jb 0x21080d
movq %r14, %rdi
callq 0xd4ef4
cmpq $0x0, 0x10(%rsp)
movq 0x18(%rsp), %r15
je 0x21086f
movq 0x10(%rsp), %rax
incq (%rax)
incq %rbx
movq %r15, %rdi
callq 0xd4a9a
cmpq %rax, %rbx
jb 0x210765
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x21089a
callq 0x101a9a
testb %al, %al
jne 0x210ade
movq %rbp, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x2109fa
movq $0x0, 0x10(%rsp)
xorl %r14d, %r14d
movq %rbp, %rdi
movq %r14, %rsi
callq 0xd47ba
movq (%rax), %rbx
movl $0x8, %edi
callq 0xd46fc
movq %rax, %r13
movq %rbx, %rdi
movq %rax, %rsi
callq 0xd9459
movq %r13, %rdi
callq 0xd4a9a
cmpq $0x2, %rax
jae 0x2108f8
movq %r13, %rdi
callq 0xd4ef4
jmp 0x2109e6
movq %r14, 0x8(%rsp)
movq %r13, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x2109d4
xorl %r12d, %r12d
movq %r13, %rdi
movq %r12, %rsi
callq 0xd47ba
movq (%rax), %rsi
movq %r15, %rdi
callq 0xd47ba
movq (%rax), %rdi
callq 0x14b1a8
movq %rax, %r14
movq %rax, %rdi
callq 0x14b33e
movq %rax, %rbx
movq %rax, %rdi
callq 0x149bb2
movq %rax, %rdi
leaq 0x18f4c6(%rip), %rsi    # 0x39fe15
callq 0x17a40
testl %eax, %eax
jne 0x2109fe
movq %r13, %r15
movq 0x48(%rsp), %rcx
movl $0x2000, %esi           # imm = 0x2000
leaq 0x60(%rsp), %r13
movq %r13, %rdi
testq %rcx, %rcx
je 0x21098b
leaq 0x1b8190(%rip), %rdx    # 0x3c8b0d
movq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x17c60
jmp 0x21099e
leaq 0x1b8181(%rip), %rdx    # 0x3c8b13
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x17c60
movq %rbx, %rdi
leaq 0x1b8176(%rip), %rsi    # 0x3c8b1e
movq %r13, %rdx
callq 0x149c3c
movq %r14, %rdi
callq 0x14b3d0
incq %r12
movq %r15, %r13
movq %r15, %rdi
callq 0xd4a9a
cmpq %rax, %r12
movq 0x18(%rsp), %r15
jb 0x210911
movq %r13, %rdi
callq 0xd4ef4
incq 0x10(%rsp)
movq 0x8(%rsp), %r14
incq %r14
movq %rbp, %rdi
callq 0xd4a9a
cmpq %rax, %r14
jb 0x2108b7
xorl %ebx, %ebx
jmp 0x210a26
movq %r14, %rdi
callq 0x14b3d0
leaq 0x1b8118(%rip), %rsi    # 0x3c8b25
movq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x1019cf
movq %r13, %rdi
callq 0xd4ef4
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rbp, %rdi
callq 0xd4a9a
testq %rax, %rax
movq 0x40(%rsp), %r13
je 0x210a5e
xorl %r14d, %r14d
movq %rbp, %rdi
movq %r14, %rsi
callq 0xd47ba
movq (%rax), %rdi
callq 0xd97e0
incq %r14
movq %rbp, %rdi
callq 0xd4a9a
cmpq %rax, %r14
jb 0x210a3b
movq %rbp, %rdi
callq 0xd4ef4
movq %r15, %rdi
callq 0xd4a9a
testq %rax, %rax
je 0x210abb
movq %r15, %r12
xorl %r14d, %r14d
leaq 0x1b7fe8(%rip), %r15    # 0x3c8a68
movq %r12, %rdi
movq %r14, %rsi
callq 0xd47ba
movq (%rax), %r12
movq %r12, %rdi
callq 0x14aefc
testq %rax, %rax
je 0x210aa6
movq %r12, %rdi
movq %r15, %rsi
callq 0x14be36
incq %r14
movq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0xd4a9a
cmpq %rax, %r14
jb 0x210a80
movq 0x38(%rsp), %r15
jmp 0x21039f
callq 0x82067
callq 0x82184
callq 0x8214b
callq 0x820a0
callq 0x820d9
callq 0x82112