// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/ltr/ltrdigest_pbs_visitor.c
// Function: gt_ltrdigest_pbs_visitor_feature_node
static int gt_ltrdigest_pbs_visitor_feature_node(GtNodeVisitor *nv,
                                                 GtFeatureNode *fn,
                                                 GtError *err)
{
  GT_UNUSED GtLTRdigestPBSVisitor *lv;
  GtFeatureNodeIterator *fni;
  GtRange leftltrrng, rightltrrng;
  bool seen_left = false;
  GtFeatureNode *curnode = NULL;
  int had_err = 0;
  lv = gt_ltrdigest_pbs_visitor_cast(nv);
  gt_assert(lv);
  gt_error_check(err);

  /* traverse annotation subgraph and find LTR element */
  fni = gt_feature_node_iterator_new(fn);
  while (!had_err && (curnode = gt_feature_node_iterator_next(fni))) {
    if (strcmp(gt_feature_node_get_type(curnode),
               gt_ft_LTR_retrotransposon) == 0) {
      lv->ltr_retrotrans = curnode;
    }
    if (strcmp(gt_feature_node_get_type(curnode),
               gt_ft_long_terminal_repeat) == 0) {
      if (seen_left) {
        rightltrrng = gt_genome_node_get_range((GtGenomeNode*) curnode);
        lv->rightltrlen = gt_range_length(&rightltrrng);
        lv->rightLTR_5 = rightltrrng.start - 1;
      } else {
        leftltrrng = gt_genome_node_get_range((GtGenomeNode*) curnode);
        lv->leftltrlen = gt_range_length(&leftltrrng);
        lv->leftLTR_3 = leftltrrng.end - 1;
        seen_left = true;
      }
    }
  }
  gt_feature_node_iterator_delete(fni);

  if (!had_err && lv->ltr_retrotrans != NULL) {
    char *rev_seq;
    GtRange rng;
    GtStrand canonical_strand = gt_feature_node_get_strand(lv->ltr_retrotrans);
    GtUword seqlen;
    GtStr *seq = gt_str_new();
    rng = gt_genome_node_get_range((GtGenomeNode*) lv->ltr_retrotrans);
    seqlen = gt_range_length(&rng);

    had_err = gt_extract_feature_sequence(seq,
                                          (GtGenomeNode*) lv->ltr_retrotrans,
                                          gt_symbol(gt_ft_LTR_retrotransposon),
                                          false, NULL, NULL, lv->rmap, err);

    if (!had_err) {
      GtPBSResults *pbs_results = NULL;
      rev_seq = gt_malloc((size_t) (seqlen * sizeof (char)));
      strncpy(rev_seq, gt_str_get(seq), (size_t) seqlen * sizeof (char));
      (void) gt_reverse_complement(rev_seq, seqlen, NULL);

      pbs_results = gt_pbs_find(lv, gt_str_get(seq), (const char*) rev_seq,
                                err);
       if (gt_pbs_results_get_number_of_hits(pbs_results) > 0)
       {
        pbs_attach_results_to_gff3(lv, pbs_results, lv->ltr_retrotrans,
                                   &canonical_strand);
       }
       gt_pbs_results_delete(pbs_results);

      gt_free(rev_seq);
    }
    gt_str_delete(seq);
  }

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20b8, %rsp           # imm = 0x20B8
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2146ec
movq %rax, %rdi
movq %r14, %rsi
callq 0x16af21
testq %rax, %rax
je 0x214ffb
movq %rax, 0x18(%rsp)
testq %r15, %r15
je 0x2147a3
movq %r15, %rdi
callq 0x101a9a
testb %al, %al
jne 0x215000
movq %r15, 0x58(%rsp)
movq %rbx, %rdi
callq 0x14b1a8
movq %rax, %rbx
movq %rax, %rdi
callq 0x14b33e
testq %rax, %rax
je 0x2148b2
movq %rax, %r13
movq 0x18(%rsp), %rbp
leaq 0x28(%rbp), %rax
movq %rax, 0x20(%rsp)
addq $0x30, %rbp
xorl %r14d, %r14d
leaq 0x18987b(%rip), %r15    # 0x39e05e
leaq 0x18c194(%rip), %r12    # 0x3a097e
movq %r13, %rdi
callq 0x149bb2
movq %rax, %rdi
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x21480a
movq 0x18(%rsp), %rax
movq %r13, 0x20(%rax)
movq %r13, %rdi
callq 0x149bb2
movq %rax, %rdi
movq %r12, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x21489e
movq %r13, %rdi
callq 0x14b8df
testb $0x1, %r14b
je 0x214862
movq %rax, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x117813
movq 0x18(%rsp), %rcx
movq %rax, 0x40(%rcx)
movq 0x80(%rsp), %rax
movq %rbp, %rcx
jmp 0x214898
movq %rax, 0x90(%rsp)
movq %rdx, 0x98(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x117813
movq 0x18(%rsp), %rcx
movq %rax, 0x38(%rcx)
movb $0x1, %r14b
movq 0x98(%rsp), %rax
movq 0x20(%rsp), %rcx
decq %rax
movq %rax, (%rcx)
movq %rbx, %rdi
callq 0x14b33e
movq %rax, %r13
testq %rax, %rax
jne 0x2147ea
movq %rbx, %rdi
callq 0x14b3d0
movq 0x18(%rsp), %r12
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0x214df5
callq 0x14970e
movl %eax, %r13d
callq 0x1208f8
movq %rax, %r14
movq 0x20(%r12), %rdi
callq 0x14b8df
leaq 0xa0(%rsp), %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0x117813
movq %rax, %rbx
movq 0x20(%r12), %r15
leaq 0x189754(%rip), %rdi    # 0x39e05e
callq 0x12234f
movq 0x10(%r12), %rcx
movq 0x58(%rsp), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x307764
movl %eax, %ebp
testl %eax, %eax
jne 0x214fdf
movl %r13d, 0x2c(%rsp)
movl %ebp, 0x3c(%rsp)
leaq 0x1b4e17(%rip), %rsi    # 0x3c9769
movq %rbx, %rdi
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x1092b2
movq %rax, %r13
movq %r14, %rdi
callq 0x120d23
movq %r13, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x17370
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x177290
movq %r14, 0x68(%rsp)
movq %r14, %rdi
callq 0x120d23
movq %rax, %rbx
callq 0xd340f
movq %r13, 0x40(%rsp)
testq %r13, %r13
je 0x215005
testq %rbx, %rbx
je 0x215005
movq %rax, %r15
movq %rbx, 0x20(%rsp)
movl 0x80(%r12), %r14d
movl 0x84(%r12), %ebp
movl 0x88(%r12), %ebx
movl 0x8c(%r12), %r13d
movq %rax, %rdi
callq 0x118a4c
movq %rax, %r12
movq %rax, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x11897c
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0xd3724
testl %eax, %eax
je 0x214a47
xorl %ebx, %ebx
movq %r15, %rdi
callq 0xd3724
testl %eax, %eax
je 0x214a39
xorl %r13d, %r13d
cmpl %r13d, %ebx
movl %ebp, %ecx
cmovel %r14d, %ecx
movq %r12, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x1191fa
incl %r13d
movq %r15, %rdi
callq 0xd3724
cmpl %eax, %r13d
jb 0x214a13
incl %ebx
movq %r15, %rdi
callq 0xd3724
cmpl %eax, %ebx
jb 0x214a04
movq %r15, %rdi
movl $0x6e, %esi
callq 0xd3d89
movzbl %al, %ebx
movq %r15, %rdi
movl $0x6e, %esi
callq 0xd3d89
movzbl %al, %edx
movq %r12, %rdi
movl %ebx, %esi
movl %ebp, %ecx
callq 0x1191fa
leaq 0x1b4cef(%rip), %rdx    # 0x3c9769
movl $0x1, %edi
movl $0x8, %esi
movl $0x6a, %ecx
callq 0x1093ef
movq %rax, %rbx
movl $0x8, %edi
callq 0xd46fc
movq %rbx, 0x50(%rsp)
movq %rax, (%rbx)
movq 0x18(%rsp), %r12
movq 0x20(%rsp), %rdi
addq 0x38(%r12), %rdi
movl 0x48(%r12), %eax
subq %rax, %rdi
leal 0x1(,%rax,2), %esi
movq %r15, %rdx
callq 0x11935c
movq %rax, %rbx
movq 0x40(%r12), %rdi
addq 0x40(%rsp), %rdi
movl 0x48(%r12), %eax
subq %rax, %rdi
leal 0x1(,%rax,2), %esi
movq %r15, %rdx
callq 0x11935c
movq %rax, 0x48(%rsp)
movq 0x90(%r12), %rdi
callq 0xd75d2
testq %rax, %rax
movq 0x30(%rsp), %r13
je 0x214c71
xorl %ecx, %ecx
movq %rbx, 0x70(%rsp)
movq %rcx, 0x20(%rsp)
movq %r13, %rbp
movq %rbx, %r13
movq 0x90(%r12), %rdi
movq 0x20(%rsp), %rsi
callq 0xd7091
movq %rax, %r14
movq %rax, %rdi
movq %rax, 0x78(%rsp)
callq 0x1194a2
movq %rax, %rbx
movl $0x1, %esi
movq %rax, %rdi
leaq 0x1b4c16(%rip), %rdx    # 0x3c9769
movl $0x13c, %ecx            # imm = 0x13C
callq 0x1093ef
movq %rax, %r12
movq %r14, %rdi
callq 0x11942d
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x17660
movq %r12, %rdi
movq %rbx, %rsi
movq 0x58(%rsp), %rdx
callq 0x177290
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1193bd
movq %rax, 0x60(%rsp)
movq %r13, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x18726c
movq %rax, %r14
movq 0x50(%rsp), %r13
movq (%r13), %r12
movq 0x78(%rsp), %rbp
movq %rbp, %rdi
callq 0x11941d
movq %r13, (%rsp)
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x215120
movq %r14, %rdi
callq 0x127c25
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x18726c
movq %rax, %r14
movq (%r13), %r12
movq %rbp, %rdi
callq 0x11941d
movq %r13, (%rsp)
movq 0x30(%rsp), %r13
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %r12
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
movl $0x1, %r9d
callq 0x215120
movq %r14, %rdi
movq 0x70(%rsp), %rbx
callq 0x127c25
movq %rbp, %rdi
callq 0x1194b2
movq 0x60(%rsp), %rdi
callq 0x1194b2
incq 0x20(%rsp)
movq 0x90(%r12), %rdi
callq 0xd75d2
movq 0x20(%rsp), %rcx
cmpq %rax, %rcx
jb 0x214b14
movq %rbx, %rdi
callq 0x1194b2
movq 0x48(%rsp), %rdi
callq 0x1194b2
movq %r13, %rdi
callq 0x118a11
movq %r15, %rdi
callq 0xd335d
movq 0x50(%rsp), %r13
movq (%r13), %rdi
leaq 0x69d(%rip), %rsi       # 0x215340
callq 0xd4ae7
movq %r13, %rdi
callq 0x21510d
testq %rax, %rax
je 0x214f5b
movq 0x20(%r12), %rbx
movq %r13, %rdi
xorl %esi, %esi
callq 0x215355
movq %rax, %r15
movl 0x2c(%rsp), %ebp
movl %ebp, %eax
leaq 0x161fac(%rip), %r14    # 0x376c84
movsbl (%rax,%r14), %edx
movl 0x30(%r15), %eax
movsbl (%rax,%r14), %ecx
leaq 0x1b4b24(%rip), %rdi    # 0x3c9811
movq %rbx, %rsi
xorl %eax, %eax
callq 0x108e02
cmpl $0x3, %ebp
je 0x214d86
cmpl %ebp, 0x30(%r15)
je 0x214d73
movq %r13, %rdi
callq 0x21510d
cmpq $0x2, %rax
jb 0x214d73
movl $0x1, %r12d
leaq 0x1b4b19(%rip), %rbp    # 0x3c983a
movq %rbx, %rdi
leaq 0x1cf041(%rip), %rsi    # 0x3e3d6c
callq 0x14918c
testq %rax, %rax
leaq 0x1516d3(%rip), %rcx    # 0x36640d
cmoveq %rcx, %rax
movq %rbp, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x108e02
movq %r13, %rdi
movq %r12, %rsi
callq 0x215355
movq %rax, %r15
movl 0x2c(%rsp), %eax
cmpl %eax, 0x30(%r15)
je 0x214d73
incq %r12
movq %r13, %rdi
callq 0x21510d
cmpq %rax, %r12
jb 0x214d21
movl 0x2c(%rsp), %eax
cmpl %eax, 0x30(%r15)
movq 0x18(%rsp), %r12
jne 0x214f5b
movl 0x30(%r15), %eax
movsbl (%rax,%r14), %esi
leaq 0x1b4ad6(%rip), %rdi    # 0x3c986c
xorl %eax, %eax
callq 0x108e02
testq %r15, %r15
je 0x21500a
movq (%r15), %rax
movq 0x8(%r15), %rdx
movq %rax, %rcx
subq %rdx, %rcx
ja 0x21500a
movq %rax, 0xb0(%rsp)
movq %rdx, 0xb8(%rsp)
cmpl $0x1, 0x30(%r15)
jne 0x214dfc
movl 0x48(%r12), %edx
notq %rax
addq 0x30(%r12), %rax
addq %rdx, %rax
movq %rax, 0xb8(%rsp)
addq %rax, %rcx
movq %rcx, 0xb0(%rsp)
jmp 0x214e26
xorl %ebp, %ebp
jmp 0x214fe7
movq 0x28(%r12), %rcx
movl 0x48(%r12), %esi
subq %rsi, %rcx
addq %rcx, %rax
incq %rax
movq %rax, 0xb0(%rsp)
leaq (%rcx,%rdx), %rax
incq %rax
movq %rax, 0xb8(%rsp)
movq %r13, %rbp
leaq 0xb0(%rsp), %rdi
callq 0x117813
movq 0x8(%r15), %rcx
subq (%r15), %rcx
incq %rcx
cmpq %rcx, %rax
jne 0x21500f
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %r12
incq %r14
incq %r12
movq %rbx, %rdi
callq 0x14b89b
movl 0x30(%r15), %r8d
leaq 0x1b41e7(%rip), %rsi    # 0x3c9059
movq %rax, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x14952c
movq %rax, %r13
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rsi
movq %r13, %rdi
callq 0x1491f1
cvtsd2ss 0x38(%r15), %xmm0
movq %r13, %rdi
callq 0x149c09
movq 0x40(%r15), %rdx
testq %rdx, %rdx
je 0x214eba
leaq 0x1b41d6(%rip), %rsi    # 0x3c9088
movq %r13, %rdi
callq 0x14a4d2
movl 0x30(%r15), %esi
movq %rbx, %rdi
callq 0x149f2e
movq 0x20(%r15), %rcx
leaq 0x1b075b(%rip), %r12    # 0x3c562c
leaq 0xb0(%rsp), %r14
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17c60
leaq 0x1b307d(%rip), %rsi    # 0x3c7f6f
movq %r13, %rdi
movq %r14, %rdx
callq 0x14a4d2
movq 0x18(%r15), %rcx
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17c60
leaq 0x1b301d(%rip), %rsi    # 0x3c7f37
movq %r13, %rdi
movq %r14, %rdx
callq 0x14a4d2
movq 0x10(%r15), %rcx
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17c60
leaq 0x1b4625(%rip), %rsi    # 0x3c9567
movq %r13, %rdi
movq %r14, %rdx
callq 0x14a4d2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x149997
movq %rbp, %r13
movq (%r13), %rdi
testq %rdi, %rdi
movl 0x3c(%rsp), %ebp
je 0x214fb1
callq 0xd4a9a
testq %rax, %rax
je 0x214fa8
xorl %ebx, %ebx
leaq 0x1b47ee(%rip), %r14    # 0x3c9769
movq (%r13), %rdi
movq %rbx, %rsi
callq 0xd47ba
movq (%rax), %rdi
movq %r14, %rsi
movl $0x162, %edx            # imm = 0x162
callq 0x109670
incq %rbx
movq (%r13), %rdi
callq 0xd4a9a
cmpq %rax, %rbx
jb 0x214f7b
movq (%r13), %rdi
callq 0xd4ef4
leaq 0x1b47b1(%rip), %rbx    # 0x3c9769
movq %r13, %rdi
movq %rbx, %rsi
movl $0x166, %edx            # imm = 0x166
callq 0x109670
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
movl $0x1e6, %edx            # imm = 0x1E6
callq 0x109670
movq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x121b03
movl %ebp, %eax
addq $0x20b8, %rsp           # imm = 0x20B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x82b3a
callq 0x82a58
callq 0x82a91
callq 0x82b03
callq 0x82aca