// File: /workspace/github_c_makefile_star2_O3/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 0x20ad6c
movq %rax, %rdi
movq %r14, %rsi
callq 0x1630b1
testq %rax, %rax
je 0x20b652
movq %rax, 0x18(%rsp)
testq %r15, %r15
je 0x20ae1f
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x20b657
movq %r15, 0x58(%rsp)
movq %rbx, %rdi
callq 0x143f54
movq %rax, %rbx
movq %rax, %rdi
callq 0x1440ea
testq %rax, %rax
je 0x20af2e
movq %rax, %r13
movq 0x18(%rsp), %rbp
leaq 0x28(%rbp), %rax
movq %rax, 0x20(%rsp)
addq $0x30, %rbp
xorl %r14d, %r14d
leaq 0x189d58(%rip), %r15    # 0x394bb7
leaq 0x18c652(%rip), %r12    # 0x3974b8
movq %r13, %rdi
callq 0x142988
movq %rax, %rdi
movq %r15, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x20ae86
movq 0x18(%rsp), %rax
movq %r13, 0x20(%rax)
movq %r13, %rdi
callq 0x142988
movq %rax, %rdi
movq %r12, %rsi
callq 0x17a40
testl %eax, %eax
jne 0x20af1a
movq %r13, %rdi
callq 0x144679
testb $0x1, %r14b
je 0x20aede
movq %rax, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x112233
movq 0x18(%rsp), %rcx
movq %rax, 0x40(%rcx)
movq 0x80(%rsp), %rax
movq %rbp, %rcx
jmp 0x20af11
movq %rax, 0x90(%rsp)
movq %rdx, 0x98(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x112233
movq 0x18(%rsp), %rcx
movq %rax, 0x38(%rcx)
movq 0x98(%rsp), %rax
movq 0x20(%rsp), %rcx
decq %rax
movq %rax, (%rcx)
movb $0x1, %r14b
movq %rbx, %rdi
callq 0x1440ea
movq %rax, %r13
testq %rax, %rax
jne 0x20ae66
movq %rbx, %rdi
callq 0x14417c
movq 0x18(%rsp), %r12
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0x20b382
callq 0x1424d6
movl %eax, %r13d
callq 0x11ac6c
movq %rax, %r14
movq 0x20(%r12), %rdi
callq 0x144679
leaq 0xa0(%rsp), %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0x112233
movq %rax, %rbx
movq 0x20(%r12), %r15
leaq 0x189c31(%rip), %rdi    # 0x394bb7
callq 0x11c5ff
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 0x2fda60
movl %eax, %ebp
testl %eax, %eax
jne 0x20b636
movl %r13d, 0x2c(%rsp)
movl %ebp, 0x3c(%rsp)
leaq 0x1b5108(%rip), %rsi    # 0x3c00d6
movq %rbx, %rdi
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x104226
movq %rax, %r13
movq %r14, %rdi
callq 0x11b0a1
movq %r13, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x17370
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x16eef8
movq %r14, 0x68(%rsp)
movq %r14, %rdi
callq 0x11b0a1
movq %rax, %rbx
callq 0xd0ece
movq %r13, 0x40(%rsp)
testq %r13, %r13
je 0x20b65c
testq %rbx, %rbx
je 0x20b65c
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 0x1133ac
movq %rax, %r12
movq %rax, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x1132e0
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0xd11cf
testl %eax, %eax
je 0x20b0c3
xorl %ebx, %ebx
movq %r15, %rdi
callq 0xd11cf
testl %eax, %eax
je 0x20b0b5
xorl %r13d, %r13d
cmpl %r13d, %ebx
movl %ebp, %ecx
cmovel %r14d, %ecx
movq %r12, %rdi
movl %ebx, %esi
movl %r13d, %edx
callq 0x113b22
incl %r13d
movq %r15, %rdi
callq 0xd11cf
cmpl %eax, %r13d
jb 0x20b08f
incl %ebx
movq %r15, %rdi
callq 0xd11cf
cmpl %eax, %ebx
jb 0x20b080
movq %r15, %rdi
movl $0x6e, %esi
callq 0xd185d
movzbl %al, %ebx
movq %r15, %rdi
movl $0x6e, %esi
callq 0xd185d
movzbl %al, %edx
movq %r12, %rdi
movl %ebx, %esi
movl %ebp, %ecx
callq 0x113b22
leaq 0x1b4fe0(%rip), %rdx    # 0x3c00d6
movl $0x1, %edi
movl $0x8, %esi
movl $0x6a, %ecx
callq 0x10436a
movq %rax, %rbx
movl $0x8, %edi
callq 0xd214c
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 0x113c84
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 0x113c84
movq %rax, 0x48(%rsp)
movq 0x90(%r12), %rdi
callq 0xd4fc8
testq %rax, %rax
movq 0x30(%rsp), %r13
je 0x20b2ed
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 0xd4a86
movq %rax, %r14
movq %rax, %rdi
movq %rax, 0x78(%rsp)
callq 0x113dcc
movq %rax, %rbx
movl $0x1, %esi
movq %rax, %rdi
leaq 0x1b4f07(%rip), %rdx    # 0x3c00d6
movl $0x13c, %ecx            # imm = 0x13C
callq 0x10436a
movq %rax, %r12
movq %r14, %rdi
callq 0x113d55
movq %r12, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x17660
movq %r12, %rdi
movq %rbx, %rsi
movq 0x58(%rsp), %rdx
callq 0x16eef8
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x113ce5
movq %rax, 0x60(%rsp)
movq %r13, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x17eba0
movq %rax, %r14
movq 0x50(%rsp), %r13
movq (%r13), %r12
movq 0x78(%rsp), %rbp
movq %rbp, %rdi
callq 0x113d45
movq %r13, (%rsp)
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x20b777
movq %r14, %rdi
callq 0x121e3c
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x30(%rsp), %rdx
callq 0x17eba0
movq %rax, %r14
movq (%r13), %r12
movq %rbp, %rdi
callq 0x113d45
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 0x20b777
movq %r14, %rdi
movq 0x70(%rsp), %rbx
callq 0x121e3c
movq %rbp, %rdi
callq 0x113ddc
movq 0x60(%rsp), %rdi
callq 0x113ddc
incq 0x20(%rsp)
movq 0x90(%r12), %rdi
callq 0xd4fc8
movq 0x20(%rsp), %rcx
cmpq %rax, %rcx
jb 0x20b190
movq %rbx, %rdi
callq 0x113ddc
movq 0x48(%rsp), %rdi
callq 0x113ddc
movq %r13, %rdi
callq 0x113372
movq %r15, %rdi
callq 0xd0e1c
movq 0x50(%rsp), %r13
movq (%r13), %rdi
leaq 0x678(%rip), %rsi       # 0x20b997
callq 0xd252d
movq %r13, %rdi
callq 0x20b764
testq %rax, %rax
je 0x20b5b2
movq 0x20(%r12), %r15
movq %r13, %rdi
xorl %esi, %esi
callq 0x20b9ac
movq %rax, %rbx
movl 0x2c(%rsp), %ebp
movl %ebp, %r14d
leaq 0x1626df(%rip), %rcx    # 0x36da34
movsbl (%r14,%rcx), %edx
movl 0x30(%rax), %eax
movsbl (%rax,%rcx), %ecx
leaq 0x1b4e16(%rip), %rdi    # 0x3c017e
movq %r15, %rsi
xorl %eax, %eax
callq 0x103d72
movl 0x30(%rbx), %eax
cmpl $0x3, %ebp
jne 0x20b389
movq %rax, %r14
jmp 0x20b415
xorl %ebp, %ebp
jmp 0x20b63e
cmpl %ebp, %eax
je 0x20b415
movq %r13, %rdi
callq 0x20b764
cmpq $0x2, %rax
jb 0x20b3fd
movl $0x1, %r12d
leaq 0x1b4dfb(%rip), %rbp    # 0x3c01a7
movq %r15, %rdi
leaq 0x1cf261(%rip), %rsi    # 0x3da617
callq 0x141f50
testq %rax, %rax
leaq 0x151f77(%rip), %rcx    # 0x35d33c
cmoveq %rcx, %rax
movq %rbp, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x103d72
movq %r13, %rdi
movq %r12, %rsi
callq 0x20b9ac
movq %rax, %rbx
movl 0x2c(%rsp), %eax
cmpl %eax, 0x30(%rbx)
je 0x20b410
incq %r12
movq %r13, %rdi
callq 0x20b764
cmpq %rax, %r12
jb 0x20b3ac
movl 0x2c(%rsp), %eax
cmpl %eax, 0x30(%rbx)
movq 0x18(%rsp), %r12
je 0x20b415
jmp 0x20b5b2
movq 0x18(%rsp), %r12
leaq 0x162618(%rip), %rax    # 0x36da34
movsbl (%r14,%rax), %esi
leaq 0x1b4db1(%rip), %rdi    # 0x3c01d9
xorl %eax, %eax
callq 0x103d72
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movq %rax, %rcx
subq %rdx, %rcx
ja 0x20b661
cmpl $0x1, 0x30(%rbx)
jne 0x20b45d
movl 0x48(%r12), %edx
notq %rax
addq 0x30(%r12), %rax
addq %rdx, %rax
addq %rax, %rcx
jmp 0x20b478
movq 0x28(%r12), %rsi
movl 0x48(%r12), %ecx
subq %rcx, %rsi
leaq (%rsi,%rax), %rcx
incq %rcx
leaq (%rsi,%rdx), %rax
incq %rax
movq %r13, %rbp
leaq 0xb0(%rsp), %rdi
movq %rax, 0x8(%rdi)
movq %rcx, (%rdi)
callq 0x112233
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
incq %rcx
cmpq %rcx, %rax
jne 0x20b666
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %r12
incq %r14
incq %r12
movq %r15, %rdi
callq 0x144635
movl 0x30(%rbx), %r8d
leaq 0x1b450e(%rip), %rsi    # 0x3bf9d9
movq %rax, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0x1422f4
movq %rax, %r13
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rsi
movq %r13, %rdi
callq 0x141fb5
cvtsd2ss 0x38(%rbx), %xmm0
movq %r13, %rdi
callq 0x1429dc
movq 0x40(%rbx), %rdx
testq %rdx, %rdx
je 0x20b512
leaq 0x1b44fe(%rip), %rsi    # 0x3bfa08
movq %r13, %rdi
callq 0x14329d
movl 0x30(%rbx), %esi
movq %r15, %rdi
callq 0x142d01
movq 0x20(%rbx), %rcx
leaq 0x1b0a94(%rip), %r12    # 0x3bbfbc
leaq 0xb0(%rsp), %r14
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17c60
leaq 0x1b33a6(%rip), %rsi    # 0x3be8ef
movq %r13, %rdi
movq %r14, %rdx
callq 0x14329d
movq 0x18(%rbx), %rcx
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17c60
leaq 0x1b3346(%rip), %rsi    # 0x3be8b7
movq %r13, %rdi
movq %r14, %rdx
callq 0x14329d
movq 0x10(%rbx), %rcx
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x17c60
leaq 0x1b494e(%rip), %rsi    # 0x3bfee7
movq %r13, %rdi
movq %r14, %rdx
callq 0x14329d
movq %r15, %rdi
movq %r13, %rsi
callq 0x14275f
movq %rbp, %r13
movq (%r13), %rdi
testq %rdi, %rdi
movl 0x3c(%rsp), %ebp
je 0x20b608
callq 0xd24e0
testq %rax, %rax
je 0x20b5ff
xorl %ebx, %ebx
leaq 0x1b4b04(%rip), %r14    # 0x3c00d6
movq (%r13), %rdi
movq %rbx, %rsi
callq 0xd2207
movq (%rax), %rdi
movq %r14, %rsi
movl $0x162, %edx            # imm = 0x162
callq 0x1045eb
incq %rbx
movq (%r13), %rdi
callq 0xd24e0
cmpq %rax, %rbx
jb 0x20b5d2
movq (%r13), %rdi
callq 0xd2938
leaq 0x1b4ac7(%rip), %rbx    # 0x3c00d6
movq %r13, %rdi
movq %rbx, %rsi
movl $0x166, %edx            # imm = 0x166
callq 0x1045eb
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
movl $0x1e6, %edx            # imm = 0x1E6
callq 0x1045eb
movq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x11bdbf
movl %ebp, %eax
addq $0x20b8, %rsp           # imm = 0x20B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x80bdc
callq 0x80afa
callq 0x80b33
callq 0x80ba5
callq 0x80b6c