// File: /workspace/github_c_makefile_star2_O2/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 0x1bf4a4
movq %rax, %rdi
movq %r14, %rsi
callq 0x102dfe
testq %rax, %rax
je 0x1bfd44
movq %rax, %rbp
testq %r15, %r15
je 0x1bf552
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x1bfd75
movq %r15, 0x60(%rsp)
movq %rbx, %rdi
callq 0xdc6f0
movq %rax, %rbx
leaq 0x28(%rbp), %rax
movq %rax, 0x18(%rsp)
movq %rbp, 0x10(%rsp)
addq $0x30, %rbp
xorl %r13d, %r13d
leaq 0x1759a8(%rip), %r15    # 0x334f26
leaq 0x17828c(%rip), %r12    # 0x337811
movq %rbx, %rdi
callq 0xdc92e
testq %rax, %rax
je 0x1bf652
movq %rax, %r14
movq %rax, %rdi
callq 0xda338
movq %rax, %rdi
movq %r15, %rsi
callq 0x179e0
testl %eax, %eax
jne 0x1bf5b9
movq 0x10(%rsp), %rax
movq %r14, 0x20(%rax)
movq %r14, %rdi
callq 0xda338
movq %rax, %rdi
movq %r12, %rsi
callq 0x179e0
testl %eax, %eax
jne 0x1bf585
movq %r14, %rdi
callq 0xdd1f4
testb $0x1, %r13b
je 0x1bf611
movq %rax, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xa31ee
movq 0x10(%rsp), %rcx
movq %rax, 0x40(%rcx)
movq 0x80(%rsp), %rax
movq %rbp, %rcx
jmp 0x1bf644
movq %rax, 0x90(%rsp)
movq %rdx, 0x98(%rsp)
leaq 0x90(%rsp), %rdi
callq 0xa31ee
movq 0x10(%rsp), %rcx
movq %rax, 0x38(%rcx)
movq 0x98(%rsp), %rax
movq 0x18(%rsp), %rcx
decq %rax
movq %rax, (%rcx)
movb $0x1, %r13b
jmp 0x1bf585
movq %rbx, %rdi
callq 0xdc9f1
movq 0x10(%rsp), %r12
movq 0x20(%r12), %rdi
testq %rdi, %rdi
je 0x1bf7d8
callq 0xd9d99
movl %eax, %r13d
callq 0xacb84
movq %rax, %r15
movq 0x20(%r12), %rdi
callq 0xdd1f4
leaq 0xa0(%rsp), %rdi
movq %rax, (%rdi)
movq %rdx, 0x8(%rdi)
callq 0xa31ee
movq %rax, %rbx
movq 0x20(%r12), %r14
leaq 0x17587c(%rip), %rdi    # 0x334f26
callq 0xaed4b
movq 0x10(%r12), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x29a8d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1bfd28
movl %r13d, 0x24(%rsp)
movl %ebp, 0x34(%rsp)
leaq 0x1a0e34(%rip), %rsi    # 0x360526
movq %rbx, %rdi
movl $0x1d9, %edx            # imm = 0x1D9
callq 0x93160
movq %rax, %r14
movq %r15, %rdi
callq 0xad1fa
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x17350
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x111ab8
movq %r15, 0x70(%rsp)
movq %r15, %rdi
callq 0xad1fa
movq %rax, %r15
callq 0x56967
movq %r14, 0x38(%rsp)
testq %r14, %r14
je 0x1bfda6
testq %r15, %r15
je 0x1bfda6
movq %rax, %rbx
movq %r15, 0x18(%rsp)
movl 0x80(%r12), %r13d
movl 0x84(%r12), %ebp
movl 0x88(%r12), %r14d
movl 0x8c(%r12), %r12d
movq %rax, %rdi
callq 0xa49fc
movq %rax, %r15
movq %rax, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0xa4844
movq %rax, 0x58(%rsp)
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x56cd2
cmpl %eax, %r14d
jae 0x1bf7df
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x56cd2
cmpl %eax, %r12d
jae 0x1bf7d3
cmpl %r12d, %r14d
movl %ebp, %ecx
cmovel %r13d, %ecx
movq %r15, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0xa53c4
incl %r12d
jmp 0x1bf7aa
incl %r14d
jmp 0x1bf79a
xorl %ebp, %ebp
jmp 0x1bfd30
pushq $0x6e
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x57552
movzbl %al, %r12d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x57552
movzbl %al, %edx
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %ecx
callq 0xa53c4
leaq 0x1a0d12(%rip), %rdx    # 0x360526
pushq $0x1
popq %rdi
pushq $0x8
popq %r14
pushq $0x6a
popq %rcx
movq %rdi, 0x40(%rsp)
movq %r14, %rsi
callq 0x9334a
movq %rax, %r15
movq %r14, %rdi
callq 0x5809c
movq %r15, 0x28(%rsp)
movq %rax, (%r15)
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rdi
addq 0x38(%r12), %rdi
movl 0x48(%r12), %eax
subq %rax, %rdi
leal 0x1(,%rax,2), %esi
movq %rbx, %rdx
callq 0xa55d4
movq %rax, 0x50(%rsp)
movq 0x40(%r12), %rdi
addq 0x38(%rsp), %rdi
movl 0x48(%r12), %eax
subq %rax, %rdi
leal 0x1(,%rax,2), %esi
movq %rbx, %rdx
callq 0xa55d4
movq %rax, 0x48(%rsp)
xorl %r14d, %r14d
movq 0x90(%r12), %rdi
callq 0x5ba79
cmpq %rax, %r14
movq 0x60(%rsp), %r13
jae 0x1bf9e4
movq 0x90(%r12), %rdi
movq %r14, %rsi
callq 0x5b113
movq %rax, %r12
movq %rax, %rdi
movq %rax, 0x18(%rsp)
callq 0xa5869
movq %rax, %r15
movq %rax, %rdi
pushq $0x1
popq %rsi
leaq 0x1a0c49(%rip), %rdx    # 0x360526
movl $0x13c, %ecx            # imm = 0x13C
callq 0x9334a
movq %r14, 0x78(%rsp)
movq %rax, %r14
movq %r12, %rdi
callq 0xa5761
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x17630
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x111ab8
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xa5660
movq %rax, 0x68(%rsp)
movq 0x50(%rsp), %rdi
movq %rax, %rsi
movq 0x58(%rsp), %rbp
movq %rbp, %rdx
callq 0x124dc8
movq %rax, %r12
movq 0x28(%rsp), %r14
movq (%r14), %r13
movq 0x18(%rsp), %rdi
callq 0xa5720
movq %r14, (%rsp)
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
xorl %r9d, %r9d
callq 0x1bffaa
movq %r12, %rdi
callq 0xb647f
movq 0x48(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq %rbp, %rdx
callq 0x124dc8
movq %rax, %r12
movq (%r14), %r13
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq 0xa5720
movq %r14, (%rsp)
movq 0x78(%rsp), %r14
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rax, %r8
pushq $0x1
popq %r9
callq 0x1bffaa
movq %r12, %rdi
movq 0x10(%rsp), %r12
callq 0xb647f
movq %rbp, %rdi
callq 0xa58aa
movq 0x68(%rsp), %rdi
callq 0xa58aa
incq %r14
jmp 0x1bf892
movq 0x50(%rsp), %rdi
callq 0xa58aa
movq 0x48(%rsp), %rdi
callq 0xa58aa
movq 0x58(%rsp), %rdi
callq 0xa49c4
movq %rbx, %rdi
callq 0x568b5
movq 0x28(%rsp), %rbp
movq (%rbp), %rdi
leaq 0x7dd(%rip), %rsi       # 0x1c01f7
callq 0x587b0
movq %rbp, %rdi
callq 0x1bff64
testq %rax, %rax
je 0x1bfcb0
movq 0x20(%r12), %rbx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x1c020c
movq %rax, %r15
movl 0x24(%rsp), %r13d
movl %r13d, %eax
leaq 0x14e303(%rip), %r14    # 0x30dd54
movsbl (%rax,%r14), %edx
movl 0x30(%r15), %eax
movsbl (%rax,%r14), %ecx
leaq 0x1a0b68(%rip), %rdi    # 0x3605ce
movq %rbx, %rsi
movl %edx, 0x18(%rsp)
xorl %eax, %eax
callq 0x92a82
cmpl $0x3, %r13d
jne 0x1bfa88
movl 0x30(%r15), %eax
movsbl (%rax,%r14), %esi
jmp 0x1bfb1d
leaq 0x1bafa8(%rip), %r14    # 0x37aa37
leaq 0x13d82d(%rip), %r12    # 0x2fd2c3
leaq 0x1a0b5a(%rip), %r13    # 0x3605f7
movl 0x24(%rsp), %eax
cmpl %eax, 0x30(%r15)
je 0x1bfafb
movq %rbp, %rdi
callq 0x1bff64
movq 0x40(%rsp), %rcx
cmpq %rax, %rcx
jae 0x1bfb06
movq %rbx, %rdi
movq %rcx, %r15
movq %r14, %rsi
callq 0xd9628
testq %rax, %rax
cmoveq %r12, %rax
movq %r13, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x92a82
leaq 0x1(%r15), %rbp
movq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x1c020c
movq %rax, %r15
movq %rbp, 0x40(%rsp)
movq 0x28(%rsp), %rbp
jmp 0x1bfa9d
movq 0x10(%rsp), %r12
movl 0x18(%rsp), %esi
jmp 0x1bfb1d
movl 0x24(%rsp), %eax
cmpl %eax, 0x30(%r15)
movq 0x10(%rsp), %r12
movl 0x18(%rsp), %esi
jne 0x1bfcb0
leaq 0x1a0b05(%rip), %rdi    # 0x360629
xorl %eax, %eax
callq 0x92a82
movq (%r15), %rax
movq 0x8(%r15), %rdx
movq %rax, %rcx
subq %rdx, %rcx
ja 0x1bfdd4
cmpl $0x1, 0x30(%r15)
jne 0x1bfb5a
movl 0x48(%r12), %edx
notq %rax
addq 0x30(%r12), %rax
addq %rdx, %rax
addq %rax, %rcx
jmp 0x1bfb75
movq 0x28(%r12), %rsi
movl 0x48(%r12), %ecx
subq %rcx, %rsi
leaq (%rsi,%rax), %rcx
incq %rcx
leaq (%rsi,%rdx), %rax
incq %rax
leaq 0xb0(%rsp), %rdi
movq %rax, 0x8(%rdi)
movq %rcx, (%rdi)
callq 0xa31ee
movq 0x8(%r15), %rcx
subq (%r15), %rcx
incq %rcx
cmpq %rcx, %rax
jne 0x1bfe00
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %r12
incq %r14
incq %r12
movq %rbx, %rdi
callq 0xdd14a
movl 0x30(%r15), %r8d
leaq 0x1a0264(%rip), %rsi    # 0x35fe29
movq %rax, %rdi
movq %r14, %rdx
movq %r12, %rcx
callq 0xd9acb
movq %rax, %r13
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rsi
movq %r13, %rdi
callq 0xd96be
cvtsd2ss 0x38(%r15), %xmm0
movq %r13, %rdi
callq 0xda425
movq 0x40(%r15), %rdx
testq %rdx, %rdx
je 0x1bfc0d
leaq 0x1a0253(%rip), %rsi    # 0x35fe58
movq %r13, %rdi
callq 0xdb38d
movl 0x30(%r15), %esi
movq %rbx, %rdi
callq 0xdab34
movq 0x20(%r15), %rcx
leaq 0x19c7ea(%rip), %rbp    # 0x35c40e
leaq 0xb0(%rsp), %r14
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x17bf0
leaq 0x19f0fa(%rip), %rsi    # 0x35ed3f
movq %r13, %rdi
movq %r14, %rdx
callq 0xdb38d
movq 0x18(%r15), %rcx
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x17bf0
leaq 0x19f09a(%rip), %rsi    # 0x35ed07
movq %r13, %rdi
movq %r14, %rdx
callq 0xdb38d
movq 0x10(%r15), %rcx
movl $0x1fff, %esi           # imm = 0x1FFF
movq %r14, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x17bf0
leaq 0x1a06a2(%rip), %rsi    # 0x360337
movq %r13, %rdi
movq %r14, %rdx
callq 0xdb38d
movq %rbx, %rdi
movq %r13, %rsi
callq 0xda055
movq 0x28(%rsp), %rbp
movq (%rbp), %rdi
testq %rdi, %rdi
movq 0x70(%rsp), %r15
je 0x1bfcfb
xorl %ebx, %ebx
leaq 0x1a085f(%rip), %r14    # 0x360526
callq 0x586a4
movq (%rbp), %rdi
cmpq %rax, %rbx
jae 0x1bfcf6
movq %rbx, %rsi
callq 0x581aa
movq (%rax), %rdi
movq %r14, %rsi
movl $0x162, %edx            # imm = 0x162
callq 0x936f9
incq %rbx
movq (%rbp), %rdi
jmp 0x1bfcc7
callq 0x58eb9
leaq 0x1a0824(%rip), %rbx    # 0x360526
movq %rbp, %rdi
movq %rbx, %rsi
movl $0x166, %edx            # imm = 0x166
callq 0x936f9
movq 0x38(%rsp), %rdi
movq %rbx, %rsi
movl $0x1e6, %edx            # imm = 0x1E6
callq 0x936f9
movl 0x34(%rsp), %ebp
movq %r15, %rdi
callq 0xae103
movl %ebp, %eax
addq $0x20b8, %rsp           # imm = 0x20B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x27821d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1252be(%rip), %rsi    # 0x2e5013
leaq 0x1a05e5(%rip), %rdx    # 0x360341
leaq 0x1a07e3(%rip), %rcx    # 0x360546
leaq 0x1a07bc(%rip), %r8     # 0x360526
movl $0x1af, %r9d            # imm = 0x1AF
jmp 0x1bfe2c
movq 0x2781ec(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12528d(%rip), %rsi    # 0x2e5013
leaq 0x125432(%rip), %rdx    # 0x2e51bf
leaq 0x1a07b2(%rip), %rcx    # 0x360546
leaq 0x1a078b(%rip), %r8     # 0x360526
movl $0x1b0, %r9d            # imm = 0x1B0
jmp 0x1bfe2c
movq 0x2781bb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12525c(%rip), %rsi    # 0x2e5013
leaq 0x1a07ae(%rip), %rdx    # 0x36056c
leaq 0x1a07bc(%rip), %rcx    # 0x360581
leaq 0x1a075a(%rip), %r8     # 0x360526
movl $0x122, %r9d            # imm = 0x122
jmp 0x1bfe2c
movq 0x27818d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12522e(%rip), %rsi    # 0x2e5013
leaq 0x1a086b(%rip), %rdx    # 0x360657
leaq 0x1a087c(%rip), %rcx    # 0x36066f
leaq 0x1a072c(%rip), %r8     # 0x360526
pushq $0x73
popq %r9
jmp 0x1bfe2c
movq 0x278161(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x125202(%rip), %rsi    # 0x2e5013
leaq 0x1a086d(%rip), %rdx    # 0x360685
leaq 0x1a0850(%rip), %rcx    # 0x36066f
leaq 0x1a0700(%rip), %r8     # 0x360526
movl $0x83, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390