// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/ltr/ltr_refseq_match_stream.c
// Function: gt_ltr_refseq_match_stream_next
static int gt_ltr_refseq_match_stream_next(GtNodeStream *ns, GtGenomeNode **gn,
                                           GtError *err)
{
  GtLTRRefseqMatchStream *rms;
  GtGenomeNode *ref_gn;
  int had_err = 0;
  GtUword n_to_check = 0;

  gt_error_check(err);
  rms = gt_ltr_refseq_match_stream_cast(ns);
  if (rms->first_next) {
    while (!(had_err = gt_node_stream_next(rms->in_stream, gn, err)) && *gn) {
      gt_assert(*gn && !had_err);
      ref_gn = gt_genome_node_ref(*gn);
      gt_array_add(rms->nodes, ref_gn);
    }
    if (!had_err)
      had_err = gt_ltr_refseq_match_stream_extract_sequences(rms, &n_to_check,
                                                             err);
    if (n_to_check > 0) {
      if (!had_err)
        had_err = gt_ltr_refseq_match_stream_refseq_match(rms, err);
      if (!had_err) {
        *gn = *(GtGenomeNode**) gt_array_get(rms->nodes, rms->next_index);
        rms->next_index++;
        rms->first_next = false;
        return 0;
      }
    }
  } else {
    if (rms->next_index >= gt_array_size(rms->nodes))
      *gn = NULL;
    else {
      *gn = *(GtGenomeNode**) gt_array_get(rms->nodes, rms->next_index);
      rms->next_index++;
    }
    return 0;
  }

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8078, %rsp           # imm = 0x8078
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
testq %rdx, %rdx
je 0x20872a
movq %r12, %rdi
callq 0xfcc32
testb %al, %al
jne 0x2090fa
callq 0x208694
movq %rax, %rdi
movq %rbx, %rsi
callq 0x162ff7
movq %rax, %r14
cmpb $0x1, 0x60(%rax)
jne 0x208795
movq 0x10(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x162e68
testl %eax, %eax
jne 0x208791
leaq 0x58(%rsp), %rbx
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2087dd
callq 0x1443a0
movq %rax, 0x58(%rsp)
movq 0x18(%r14), %rdi
movl $0x8, %edx
movq %rbx, %rsi
callq 0xd2410
movq 0x10(%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x162e68
testl %eax, %eax
je 0x20875b
movl %eax, %ebp
jmp 0x2087c9
movq 0x18(%r14), %rdi
movq 0x58(%r14), %rbx
callq 0xd24e0
cmpq %rax, %rbx
jae 0x2087c0
movq 0x18(%r14), %rdi
movq 0x58(%r14), %rsi
callq 0xd2207
movq (%rax), %rax
movq %rax, (%r15)
incq 0x58(%r14)
jmp 0x2087c7
movq $0x0, (%r15)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8078, %rsp           # imm = 0x8078
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r12
je 0x2087f2
movq %r12, %rdi
callq 0xfcc32
testb %al, %al
jne 0x2090ff
movq 0x38(%r14), %rdi
leaq 0x18adb8(%rip), %rsi    # 0x3935b5
movq %r12, %rdx
callq 0xfea8a
movq %rax, (%rsp)
testq %rax, %rax
je 0x208d7b
cmpq $0x0, 0x48(%r14)
je 0x208824
movq $0x0, 0x18(%rsp)
jmp 0x208846
callq 0xef0cd
movq 0x28(%r14), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0xef129
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x208d7b
movq 0x18(%r14), %rdi
callq 0xd24e0
testq %rax, %rax
je 0x208b68
movq %r12, 0x10(%rsp)
movq %r15, 0x50(%rsp)
leaq 0x2070(%rsp), %r13
movq $0x0, 0x20(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %r14, 0x30(%rsp)
movq 0x18(%r14), %rdi
movq %r12, %rsi
callq 0xd2207
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x143cab
testq %rax, %rax
je 0x208ade
movq %rbx, %rdi
callq 0x143f54
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x1440ea
movq %rax, %r15
movq %rax, %rdi
callq 0x144635
movq %rax, %rbx
movq %r15, %rdi
callq 0x144679
movq %rax, 0x70(%rsp)
movq %rdx, 0x78(%rsp)
cmpb $0x1, 0x62(%r14)
jne 0x2088f1
movq %r15, %rdi
leaq 0x1b6f31(%rip), %rsi    # 0x3bf814
callq 0x141f50
testq %rax, %rax
je 0x208ad4
movq %r13, %r14
movq %r15, %rdi
leaq 0x1b6ba0(%rip), %rsi    # 0x3bf49e
callq 0x141f50
movq %rax, %r13
movq %rbx, %rdi
callq 0x11b0a1
movq 0x70(%rsp), %r9
movq 0x78(%rsp), %r10
testq %r13, %r13
je 0x208945
subq $0x8, %rsp
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
leaq 0x1b6eeb(%rip), %rdx    # 0x3bf81b
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
pushq %r10
callq 0x17c60
addq $0x10, %rsp
jmp 0x208964
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
leaq 0x1b6eca(%rip), %rdx    # 0x3bf81e
movq %rax, %rcx
movq %r9, %r8
movq %r10, %r9
xorl %eax, %eax
callq 0x17c60
movq %r14, %rdi
movl $0x20, %esi
movl $0x2b, %edx
callq 0xe431c
movq %r14, %rdi
movq 0x30(%rsp), %r14
movq 0x20(%r14), %r13
callq 0xe4290
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x100b18
cmpq $0x0, 0x48(%r14)
je 0x208a18
callq 0x11ac6c
movq %rax, %rbx
movq %r15, %rdi
callq 0x142988
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq 0x10(%rsp)
pushq 0x48(%r14)
callq 0x2fda60
addq $0x10, %rsp
movl %eax, %ebp
testl %eax, %eax
leaq 0x2070(%rsp), %r13
jne 0x208a06
movq %rbx, %rdi
callq 0x11b0a1
movq %rax, %r15
movq %rbx, %rdi
callq 0x11b0ca
movl $0x32, %ecx
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq (%rsp), %r8
callq 0xfe000
movq %rbx, %rdi
callq 0x11bdbf
movq 0x30(%rsp), %r14
jmp 0x208acf
movq %rbx, %rdi
callq 0x11b0a1
movq %rax, %rdi
leaq 0x18755d(%rip), %rsi    # 0x38ff87
leaq 0x4070(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
leaq 0x70(%rsp), %r13
movq %r13, %rdi
callq 0x112233
leaq 0x1(%rax), %rdi
movl $0x1, %esi
leaq 0x1b6d6f(%rip), %rdx    # 0x3bf7c5
movl $0x9b, %ecx
callq 0x10436a
movq %rax, %rbx
movq 0x4070(%rsp), %rsi
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0xeb6ee
leaq -0x1(%rax), %rcx
movq 0x70(%rsp), %rdx
addq %rcx, %rdx
addq 0x78(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xe92be
movq %r13, %rdi
callq 0x112233
movl $0x32, %ecx
leaq 0x2070(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq (%rsp), %r8
callq 0xfe000
movq %rbx, %rdi
leaq 0x1b6d00(%rip), %rsi    # 0x3bf7c5
movl $0xa1, %edx
callq 0x1045eb
incq 0x20(%rsp)
movq 0x8(%rsp), %rdi
callq 0x14417c
incq %r12
movq 0x18(%r14), %rdi
callq 0xd24e0
cmpq %rax, %r12
jb 0x20887d
movq (%rsp), %rdi
callq 0xff22c
cmpq $0x0, 0x20(%rsp)
movq 0x10(%rsp), %r15
je 0x2087c9
testl %ebp, %ebp
jne 0x2087c9
movq $0x0, 0x28(%rsp)
testq %r15, %r15
je 0x208b33
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x209113
leaq 0x16f4d2(%rip), %rdi    # 0x37800c
callq 0x17950
movq 0x30(%r14), %r8
testq %rax, %rax
je 0x208b76
leaq 0x1b6d02(%rip), %rdx    # 0x3bf851
leaq 0x4070(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
movq %rax, %rcx
xorl %eax, %eax
callq 0x17c60
jmp 0x208b94
movq (%rsp), %rdi
callq 0xff22c
jmp 0x2087c7
leaq 0x1b6cd7(%rip), %rdx    # 0x3bf854
leaq 0x4070(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
movq %r8, %rcx
xorl %eax, %eax
callq 0x17c60
leaq 0x1522ba(%rip), %rsi    # 0x35ae55
leaq 0x4070(%rsp), %rdi
callq 0x17210
testq %rax, %rax
je 0x208d6a
movq %rax, %rbx
movq %rbx, %rdi
callq 0x17c20
cmpl $-0x1, %eax
jne 0x208bb4
movq %rbx, %rdi
callq 0x17a70
callq 0x127b1e
movq %rax, %r12
movq 0x38(%r14), %rsi
movq %rax, %rdi
callq 0x127b84
movq 0x30(%r14), %rsi
movq %r12, %rdi
callq 0x127bce
movsd 0x80(%r14), %xmm0
ucomisd 0x13f116(%rip), %xmm0   # 0x347d10
jne 0x208bfe
jnp 0x208c06
movq %r12, %rdi
callq 0x127c18
cmpb $0x1, 0x61(%r14)
jne 0x208c1c
leaq 0x17e3f2(%rip), %rsi    # 0x387006
movq %r12, %rdi
callq 0x127f08
movl 0x64(%r14), %esi
movl %esi, %eax
negl %eax
jo 0x208c2e
movq %r12, %rdi
callq 0x127c6b
movl 0x68(%r14), %esi
movl %esi, %eax
negl %eax
jo 0x208c40
movq %r12, %rdi
callq 0x127cb3
movl 0x6c(%r14), %esi
movl %esi, %eax
negl %eax
jo 0x208c52
movq %r12, %rdi
callq 0x127cfb
movl 0x70(%r14), %esi
movl %esi, %eax
negl %eax
jo 0x208c64
movq %r12, %rdi
callq 0x127d43
movl 0x74(%r14), %esi
movl %esi, %eax
negl %eax
jo 0x208c76
movq %r12, %rdi
callq 0x127d96
movsd 0x90(%r14), %xmm0
ucomisd 0x13f089(%rip), %xmm0   # 0x347d10
jne 0x208c8b
jnp 0x208cc1
leaq 0x17e37f(%rip), %rdx    # 0x387011
leaq 0x6070(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
movb $0x1, %al
callq 0x17c60
cmpl $0x2000, %eax           # imm = 0x2000
jae 0x209118
leaq 0x6070(%rsp), %rsi
movq %r12, %rdi
callq 0x127f08
movl 0x78(%r14), %esi
movl %esi, %eax
negl %eax
jo 0x208cd3
movq %r12, %rdi
callq 0x127de9
movsd 0x88(%r14), %xmm0
ucomisd 0x13f02c(%rip), %xmm0   # 0x347d10
jne 0x208ce8
jnp 0x208cf0
movq %r12, %rdi
callq 0x127e31
movq 0xa0(%r14), %rcx
testq %rcx, %rcx
je 0x208d32
leaq 0x1a22d3(%rip), %rdx    # 0x3aafd6
leaq 0x6070(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
xorl %eax, %eax
callq 0x17c60
cmpl $0x2000, %eax           # imm = 0x2000
jae 0x20911d
leaq 0x6070(%rsp), %rsi
movq %r12, %rdi
callq 0x127f08
movq %r12, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x15dfcf
testq %rax, %rax
je 0x208d7b
movq %rax, %r13
leaq 0x28(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x15de2e
testl %eax, %eax
je 0x208d85
leaq 0x1b6b22(%rip), %rsi    # 0x3bf887
movq %rbx, %rdi
jmp 0x208d74
leaq 0x1b6b2c(%rip), %rsi    # 0x3bf89d
movq %r15, %rdi
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x2087c9
movq %r13, 0x48(%rsp)
movq 0x28(%rsp), %r12
testq %r12, %r12
je 0x209104
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x208daf
callq 0xfcc32
testb %al, %al
jne 0x209109
movq %r12, %rdi
callq 0x15da21
movq %rax, %rbx
movq %r12, %rdi
callq 0x15da35
movq %rax, 0x8(%rsp)
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x100add
movq %rax, %rbp
movq %rax, %rdi
callq 0x1446a2
movq %rax, %rbx
movq %rbp, %rdi
callq 0x144679
movsd 0x98(%r14), %xmm0
divsd 0x1409e6(%rip), %xmm0   # 0x3497e0
movq %rbx, %xmm1
punpckldq 0x13ead9(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x13eae1(%rip), %xmm1   # 0x3478f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %rcx
movq %rax, %rbx
movq %rcx, %rax
sarq $0x3f, %rax
subsd 0x13eeea(%rip), %xmm2   # 0x347d20
cvttsd2si %xmm2, %r15
andq %rax, %r15
orq %rcx, %r15
movq %r12, %rdi
callq 0x15dd93
cmpq %r15, %rax
jb 0x2090a9
movq %r12, %rdi
leaq 0x60(%rsp), %rsi
callq 0x15da49
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
callq 0x15da61
movq %rbp, %rdi
callq 0x144635
movq %rax, %r15
movq %r12, %rdi
callq 0x15dab7
testq %rbp, %rbp
je 0x20910e
movl %eax, %r13d
movq %rbp, (%rsp)
movq %rbp, %rdi
callq 0x1424d6
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
xorl %ebp, %ebp
cmpl %ecx, %r13d
sete %bpl
movq %r12, 0x20(%rsp)
movq %r12, %rdi
callq 0x15dda3
movsd %xmm0, 0x18(%rsp)
movq 0x60(%rsp), %rdx
addq %rbx, %rdx
addq 0x68(%rsp), %rbx
movq %r15, %rdi
leaq 0x1b6a1e(%rip), %rsi    # 0x3bf8f0
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x1422f4
movq %rax, %rbp
movl $0x2000, %esi           # imm = 0x2000
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
leaq 0x16e4cd(%rip), %rdx    # 0x3773c1
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
callq 0x17c60
movq %rbp, %rdi
leaq 0x1a1ff6(%rip), %rsi    # 0x3aaf01
movq %rbx, %rdx
callq 0x142a0f
movq 0x40(%r14), %rdi
callq 0x11acc9
movq %rbp, %rdi
movq %rax, %rsi
callq 0x141fb5
movq 0x50(%r14), %rcx
cmpq $-0x1, %rcx
je 0x208f61
movl $0x2000, %esi           # imm = 0x2000
leaq 0x2070(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1b3074(%rip), %rdx    # 0x3bbfbc
xorl %eax, %eax
callq 0x17c60
movq %rbp, %rdi
leaq 0x198fa4(%rip), %rsi    # 0x3a1efd
movq %rbx, %rdx
callq 0x142a0f
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xe4290
movq %rax, %rdi
leaq 0x1b91a8(%rip), %r13    # 0x3c2120
movq %r13, %rsi
callq 0x17c10
testq %rax, %rax
leaq 0x1b683b(%rip), %r12    # 0x3bf7c5
je 0x209056
movq %rax, %r15
movq %rbp, 0x8(%rsp)
movq %rax, %rdi
callq 0xe4290
movq %rax, %rdi
callq 0x11acc9
movq %rax, %rbx
movq %r15, %rdi
movq %r12, %rsi
movl $0xf8, %edx
callq 0x1045eb
xorl %edi, %edi
movq %r13, %rsi
callq 0x17c10
testq %rax, %rax
leaq 0x1b6932(%rip), %rbp    # 0x3bf901
je 0x209014
movq %rax, %r15
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x11acf3
movq %r15, %rdi
callq 0xe4290
movq %rbx, %rdi
movq %rax, %rsi
callq 0x11acf3
movq %r15, %rdi
movq %r12, %rsi
movl $0xfc, %edx
callq 0x1045eb
xorl %edi, %edi
movq %r13, %rsi
callq 0x17c10
movq %rax, %r15
testq %rax, %rax
jne 0x208fd4
movq %rbx, %rdi
callq 0x11b0a1
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
leaq 0x2070(%rsp), %r15
movq %r15, %rdi
leaq 0x15bef9(%rip), %rdx    # 0x364f36
movq %rax, %rcx
xorl %eax, %eax
callq 0x17c60
movq %rbx, %rdi
callq 0x11bdbf
movq 0x8(%rsp), %rbp
jmp 0x209081
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
movl $0x2000, %esi           # imm = 0x2000
leaq 0x2070(%rsp), %r15
movq %r15, %rdi
leaq 0x15bebf(%rip), %rdx    # 0x364f36
movq %rbx, %rcx
xorl %eax, %eax
callq 0x17c60
movq %rbp, %rdi
leaq 0x1625f8(%rip), %rsi    # 0x36b683
movq %r15, %rdx
callq 0x142a0f
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x14275f
movq 0x48(%rsp), %r13
movq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x15dac6
movq %r13, %rdi
leaq 0x28(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x15de2e
testl %eax, %eax
je 0x208d8a
cmpl $0x1, %eax
jne 0x208d7b
movq 0x18(%r14), %rdi
movq 0x58(%r14), %rsi
callq 0xd2207
movq (%rax), %rax
movq 0x50(%rsp), %rcx
movq %rax, (%rcx)
incq 0x58(%r14)
movb $0x0, 0x60(%r14)
jmp 0x2087c7
callq 0x805a8
callq 0x805e1
callq 0x80735
callq 0x806c3
callq 0x806fc
callq 0x80618
callq 0x80651
callq 0x8068a