// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrdigest_ppt_visitor.c
// Function: gt_ltrdigest_ppt_visitor_feature_node
static int gt_ltrdigest_ppt_visitor_feature_node(GtNodeVisitor *nv,
                                                 GtFeatureNode *fn,
                                                 GtError *err)
{
  GT_UNUSED GtLTRdigestPPTVisitor *lv;
  GtFeatureNodeIterator *fni;
  GtRange leftltrrng = { 0, 0 }, rightltrrng = { 0, 0 };
  bool seen_left = false;
  GtFeatureNode *curnode = NULL,
                *ltr_retrotrans = NULL;
  int had_err = 0;
  lv = gt_ltrdigest_ppt_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) {
      ltr_retrotrans = curnode;
    }
    if (strcmp(gt_feature_node_get_type(curnode),
               gt_ft_long_terminal_repeat) == 0) {
      if (seen_left)   /* XXX */
        rightltrrng = gt_genome_node_get_range((GtGenomeNode*) curnode);
      else {
        leftltrrng = gt_genome_node_get_range((GtGenomeNode*) curnode);
        seen_left = true;
      }
    }
  }
  gt_feature_node_iterator_delete(fni);

  if (!had_err && ltr_retrotrans != NULL) {
    char *rev_seq;
    GtRange rng;
    GtStrand canonical_strand = gt_feature_node_get_strand(ltr_retrotrans);
    GtPPTResults *res;
    GtUword seqlen;
    GtStr *seq = NULL;
    rng = gt_genome_node_get_range((GtGenomeNode*) ltr_retrotrans);

    if (gt_range_length(&rng) < (GtUword) 10UL) {
      gt_warning("LTR_retrotransposon (%s, line %u) is too short for "
                 "PPT detection (" GT_WU " nt), skipped this step",
            gt_genome_node_get_filename((GtGenomeNode*) ltr_retrotrans),
            gt_genome_node_get_line_number((GtGenomeNode*) ltr_retrotrans),
            gt_range_length(&rng));
      return had_err;
    }

    seq = gt_str_new();
    seqlen = gt_range_length(&rng);

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

    if (!had_err) {
      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);

      res = gt_ppt_find(lv, gt_str_get(seq), rev_seq, seqlen, rightltrrng,
                        leftltrrng);
      if (gt_ppt_results_get_number_of_hits(res) > 0) {
        ppt_attach_results_to_gff3(lv, res, ltr_retrotrans, &canonical_strand);
      }
      gt_ppt_results_delete(res);
      gt_free(rev_seq);
    }
    gt_str_delete(seq);
  }

  return had_err;
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x108(%rsp)
movq %rsi, 0x100(%rsp)
movq %rdx, 0xf8(%rsp)
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19360
leaq 0xc8(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19360
movb $0x0, 0xc7(%rsp)
movq $0x0, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movl $0x0, 0xac(%rsp)
callq 0x30b4f0
movq %rax, %rdi
movq 0x108(%rsp), %rsi
callq 0x1b2350
movq %rax, 0xf0(%rsp)
cmpq $0x0, 0xf0(%rsp)
jne 0x30b612
movq 0x3309bf(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x20aa28(%rip), %rsi    # 0x516013
leaq 0x287a90(%rip), %rdx    # 0x593082
leaq 0x2887ee(%rip), %rcx    # 0x593de7
leaq 0x288756(%rip), %r8     # 0x593d56
movl $0x20f, %r9d            # imm = 0x20F
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30b614
jmp 0x30b616
cmpq $0x0, 0xf8(%rsp)
je 0x30b66c
movq 0xf8(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x30b634
jmp 0x30b66c
movq 0x330965(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x20a9ce(%rip), %rsi    # 0x516013
leaq 0x20ab73(%rip), %rdx    # 0x5161bf
leaq 0x288794(%rip), %rcx    # 0x593de7
leaq 0x2886fc(%rip), %r8     # 0x593d56
movl $0x210, %r9d            # imm = 0x210
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x30b66e
movq 0x100(%rsp), %rdi
callq 0x170b00
movq %rax, 0xe8(%rsp)
xorl %eax, %eax
cmpl $0x0, 0xac(%rsp)
movb %al, 0x3f(%rsp)
jne 0x30b6b3
movq 0xe8(%rsp), %rdi
callq 0x170e30
movq %rax, 0xb8(%rsp)
cmpq $0x0, %rax
setne %al
movb %al, 0x3f(%rsp)
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x30b6c0
jmp 0x30b7ab
movq 0xb8(%rsp), %rdi
callq 0x16d430
movq %rax, %rdi
leaq 0x25be65(%rip), %rsi    # 0x56753c
callq 0x19980
cmpl $0x0, %eax
jne 0x30b6f1
movq 0xb8(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x16d430
movq %rax, %rdi
leaq 0x25e7ae(%rip), %rsi    # 0x569eb6
callq 0x19980
cmpl $0x0, %eax
jne 0x30b7a6
testb $0x1, 0xc7(%rsp)
je 0x30b75f
movq 0xb8(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x98(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0xd0(%rsp)
jmp 0x30b7a4
movq 0xb8(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x88(%rsp)
movq %rdx, 0x90(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0xe0(%rsp)
movb $0x1, 0xc7(%rsp)
jmp 0x30b7a6
jmp 0x30b683
movq 0xe8(%rsp), %rdi
callq 0x170f50
cmpl $0x0, 0xac(%rsp)
jne 0x30ba2e
cmpq $0x0, 0xb0(%rsp)
je 0x30ba2e
movq 0xb0(%rsp), %rdi
callq 0x16cc70
movl %eax, 0x6c(%rsp)
movq $0x0, 0x50(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x171cc0
movq %rax, 0x40(%rsp)
movq %rdx, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x107320
cmpq $0xa, %rax
jae 0x30b884
movq 0xb0(%rsp), %rdi
callq 0x171a90
movq %rax, 0x30(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x171b20
movl %eax, 0x38(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x107320
movq 0x30(%rsp), %rsi
movl 0x38(%rsp), %edx
movq %rax, %rcx
leaq 0x2885a3(%rip), %rdi    # 0x593e0d
movb $0x0, %al
callq 0x1267d0
movl 0xac(%rsp), %eax
movl %eax, 0x114(%rsp)
jmp 0x30ba3c
callq 0x11d4a0
movq %rax, 0x50(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x107320
movq %rax, 0x58(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x25bc81(%rip), %rdi    # 0x56753c
callq 0x120930
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %rax, %rdx
movq 0xf0(%rsp), %rax
movq 0x10(%rax), %r10
movq 0xf8(%rsp), %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %r8d, %r9d
movq %r9, %r8
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x48f4f0
movl %eax, 0xac(%rsp)
cmpl $0x0, 0xac(%rsp)
jne 0x30ba24
movq 0x58(%rsp), %rdi
shlq $0x0, %rdi
leaq 0x288437(%rip), %rsi    # 0x593d56
movl $0x23f, %edx            # imm = 0x23F
callq 0xe80f0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0x11dee0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x58(%rsp), %rdx
shlq $0x0, %rdx
callq 0x19330
movq 0x80(%rsp), %rdi
movq 0x58(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x1cb4f0
movq 0xf0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
callq 0x11dee0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movq 0x80(%rsp), %rdx
movq 0x58(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq 0xd0(%rsp), %r9
leaq 0xd8(%rsp), %rax
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x30c330
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
callq 0x30c770
cmpq $0x0, %rax
jbe 0x30ba01
movq 0xf0(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0xb0(%rsp), %rdx
leaq 0x6c(%rsp), %rcx
callq 0x30c7d0
movq 0x60(%rsp), %rdi
callq 0x30b3a0
movq 0x80(%rsp), %rdi
leaq 0x28833c(%rip), %rsi    # 0x593d56
movl $0x249, %edx            # imm = 0x249
callq 0xe88c0
movq 0x50(%rsp), %rdi
callq 0x11f560
movl 0xac(%rsp), %eax
movl %eax, 0x114(%rsp)
movl 0x114(%rsp), %eax
addq $0x118, %rsp            # imm = 0x118
retq
nopl (%rax,%rax)