// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/ltr/ltr_cluster_prepare_seq_visitor.c
// Function: gt_ltr_cluster_prepare_seq_visitor_feature_node
static int gt_ltr_cluster_prepare_seq_visitor_feature_node(GtNodeVisitor *nv,
                                               GtFeatureNode *fn,
                                               GtError *err)
{
  GtLTRClusterPrepareSeqVisitor *lcv;
  GtFeatureNode *curnode;
  GtFeatureNodeIterator *fni;
  GtStr *seqid = NULL;
  const char *fnt;
  char buffer[BUFSIZ];
  int had_err = 0;
  bool first_ltr = true;
  gt_error_check(err);

  lcv = gt_ltr_cluster_prepare_seq_visitor_cast(nv);
  gt_assert(lcv);
  gt_error_check(err);
  fni = gt_feature_node_iterator_new(fn);

  while (!had_err && (curnode = gt_feature_node_iterator_next(fni))) {
    GtFile *file = NULL;
    fnt = gt_feature_node_get_type(curnode);
    if (strcmp(fnt, gt_ft_repeat_region) == 0) {
      const char *rid;
      GtUword id;
      seqid = gt_genome_node_get_seqid((GtGenomeNode*) curnode);
      rid = gt_feature_node_get_attribute(curnode, "ID");
      (void) sscanf(rid, "repeat_region"GT_WU"", &id);
      (void) snprintf(buffer, BUFSIZ, "%s_"GT_WU"", gt_str_get(seqid), id);
    } else if (strcmp(fnt, gt_ft_protein_match) == 0) {
      GtRange range;
      const char *attr;
      GtEncseqBuilder *eb;
      char header[2*BUFSIZ];
      attr = gt_feature_node_get_attribute(curnode, "name");
      if (!attr)
        continue;
      range = gt_genome_node_get_range((GtGenomeNode*) curnode);
      (void) snprintf(header, 2*BUFSIZ, "%s_"GT_WU"_"GT_WU"", buffer,
                      range.start, range.end);
      if (!gt_hashmap_get(lcv->encseq_builders, attr)) {
        eb = gt_encseq_builder_new(gt_encseq_alphabet(lcv->src_encseq));
        gt_encseq_builder_create_ssp_tab(eb);
        gt_encseq_builder_create_sds_tab(eb);
        gt_encseq_builder_create_des_tab(eb);
        gt_hashmap_add(lcv->encseq_builders, gt_cstr_dup(attr),
                       eb);
        gt_log_log("builder %p added for feature %s", eb, attr);
        gt_str_array_add_cstr(lcv->feat_to_encseq_keys, attr);
      } else {
        eb = (GtEncseqBuilder*) gt_hashmap_get(lcv->encseq_builders, attr);
      }
      had_err = extract_feature_seq(eb, header, seqid, lcv->src_encseq, range,
                                    fnt, err);
      gt_file_delete(file);
    } else if (strcmp(fnt, gt_ft_LTR_retrotransposon) == 0) {
      continue;
    } else {
      char *tmp;
      GtRange range;
      GtEncseqBuilder *eb;
      char header[2*BUFSIZ];  /* XXX: use GtStr for safety */
      if (strcmp(fnt, gt_ft_long_terminal_repeat) == 0) {
        if (first_ltr) {
          tmp = gt_cstr_dup("lLTR");
          first_ltr = false;
        } else
          tmp = gt_cstr_dup("rLTR");
      } else
        tmp = gt_cstr_dup(fnt);
      range = gt_genome_node_get_range((GtGenomeNode*) curnode);
      if ((range.end - range.start + 1) < 10UL) {
        gt_free(tmp);
        continue;
      }
      (void) snprintf(header, 2*BUFSIZ, "%s_"GT_WU"_"GT_WU"", buffer,
                      range.start, range.end);
      if (!gt_hashmap_get(lcv->encseq_builders, tmp)) {
        eb = gt_encseq_builder_new(gt_encseq_alphabet(lcv->src_encseq));
        gt_encseq_builder_create_ssp_tab(eb);
        gt_encseq_builder_create_sds_tab(eb);
        gt_encseq_builder_create_des_tab(eb);
        gt_hashmap_add(lcv->encseq_builders, gt_cstr_dup(tmp),
                       eb);
        gt_str_array_add_cstr(lcv->feat_to_encseq_keys, tmp);
      } else {
        eb = (GtEncseqBuilder*) gt_hashmap_get(lcv->encseq_builders, tmp);
      }
      had_err = extract_feature_seq(eb, header, seqid, lcv->src_encseq, range,
                                    fnt, err);
      gt_free(tmp);
      gt_file_delete(file);
    }
  }
  gt_feature_node_iterator_delete(fni);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6048, %rsp           # imm = 0x6048
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x2cd967
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x2cdd86
movq %r15, 0x18(%rsp)
callq 0x2cd8f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x102dfe
testq %rax, %rax
je 0x2cdd5c
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %r14
testq %r14, %r14
je 0x2cd9a4
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0x2cddb0
movq %rbx, %rdi
callq 0xdc6f0
movq %rax, %r15
movb $0x1, %al
movl %eax, 0xc(%rsp)
leaq 0x69302(%rip), %rbp     # 0x336cbe
xorl %ebx, %ebx
movq $0x0, 0x20(%rsp)
movq %r15, 0x28(%rsp)
testl %ebx, %ebx
jne 0x2cdd39
movq %r15, %rdi
callq 0xdc92e
testq %rax, %rax
je 0x2cdd3e
movq %rax, %r13
movq %rax, %rdi
callq 0xda338
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
callq 0x179e0
testl %eax, %eax
je 0x2cdb73
movq %r12, %rdi
leaq 0x53619(%rip), %rsi     # 0x321029
callq 0x179e0
testl %eax, %eax
je 0x2cda55
movq %r12, %rdi
leaq 0x67503(%rip), %rsi     # 0x334f26
callq 0x179e0
xorl %ebx, %ebx
testl %eax, %eax
je 0x2cd9cc
movq %r12, %rdi
leaq 0x69dd9(%rip), %rsi     # 0x337811
callq 0x179e0
testl %eax, %eax
je 0x2cdbda
movq %r12, %rdi
callq 0x6c2be
movq %rax, %rbx
jmp 0x2cdc01
movq %r13, %rdi
leaq 0x5510c(%rip), %rsi     # 0x322b6b
callq 0xd9628
testq %rax, %rax
je 0x2cdac7
movq %rax, %rbp
movq %r13, %rdi
callq 0xdd1f4
movq %rax, %r13
movq %rdx, %rbx
movl $0x4000, %esi           # imm = 0x4000
leaq 0x40(%rsp), %rdi
leaq 0x921e3(%rip), %rdx     # 0x35fc6e
leaq 0x4040(%rsp), %rcx
movq %rax, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x17bf0
movq 0x10(%rsp), %r15
movq 0x20(%r15), %rdi
movq %rbp, %rsi
callq 0x8f482
testq %rax, %rax
je 0x2cdace
movq 0x20(%r15), %rdi
movq %rbp, %rsi
callq 0x8f482
movq %rax, %r12
jmp 0x2cdb39
xorl %ebx, %ebx
jmp 0x2cdb67
movq 0x10(%r15), %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x7d613
movq %rax, %r12
movq %rax, %rdi
callq 0x7d744
movq %r12, %rdi
callq 0x7d7ca
movq %r12, %rdi
callq 0x7d6be
movq 0x20(%r15), %r14
movq %rbp, %rdi
callq 0x6c2be
movq %r14, %rdi
movq 0x18(%rsp), %r14
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
leaq 0xb884b(%rip), %rdi     # 0x38636b
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x92a82
movq 0x28(%r15), %rdi
movq %rbp, %rsi
callq 0xae22f
movq 0x10(%r15), %rcx
movq %r14, (%rsp)
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r13, %r8
movq %rbx, %r9
callq 0x2ce0bd
movl %eax, %ebx
xorl %edi, %edi
callq 0x8da06
movq 0x28(%rsp), %r15
leaq 0x69150(%rip), %rbp     # 0x336cbe
jmp 0x2cd9cc
movq %r13, %rdi
callq 0xdd14a
movq %rax, %r12
movq %r13, %rdi
leaq 0xaceaf(%rip), %rsi     # 0x37aa37
callq 0xd9628
xorl %ebx, %ebx
movq %rax, %rdi
leaq 0x91ecc(%rip), %rsi     # 0x35fa65
leaq 0x40(%rsp), %rdx
xorl %eax, %eax
callq 0x177b0
movq %r12, 0x20(%rsp)
movq %r12, %rdi
callq 0xad1fa
movq 0x40(%rsp), %r8
movl $0x2000, %esi           # imm = 0x2000
leaq 0x4040(%rsp), %rdi
leaq 0x91eab(%rip), %rdx     # 0x35fa76
movq %rax, %rcx
xorl %eax, %eax
callq 0x17bf0
jmp 0x2cd9cc
testb $0x1, 0xc(%rsp)
je 0x2cdbea
leaq 0x91c46(%rip), %rdi     # 0x35f82e
jmp 0x2cdbf1
leaq 0x91c42(%rip), %rdi     # 0x35f833
callq 0x6c2be
movq %rax, %rbx
movl $0x0, 0xc(%rsp)
movq 0x10(%rsp), %r12
movq %r13, %rdi
callq 0xdd1f4
movq %rdx, %rcx
subq %rax, %rcx
addq $-0x9, %rcx
cmpq $-0xa, %rcx
jae 0x2cdc78
movq %rdx, %r13
movl $0x4000, %esi           # imm = 0x4000
leaq 0x40(%rsp), %rdi
leaq 0x9203c(%rip), %rdx     # 0x35fc6e
leaq 0x4040(%rsp), %rcx
movq %rax, 0x38(%rsp)
movq %rax, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x17bf0
movq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x8f482
testq %rax, %rax
movq %rbx, 0x30(%rsp)
je 0x2cdc93
movq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x8f482
movq %r12, %r15
movq %rax, %r12
jmp 0x2cdcee
movq %rbx, %rdi
leaq 0xb8561(%rip), %rsi     # 0x3861e3
movl $0x95, %edx
callq 0x936f9
xorl %ebx, %ebx
jmp 0x2cd9cc
movq 0x10(%r12), %rdi
callq 0x754dd
movq %rax, %rdi
callq 0x7d613
movq %r12, %r15
movq %rax, %r12
movq %rax, %rdi
callq 0x7d744
movq %r12, %rdi
callq 0x7d7ca
movq %r12, %rdi
callq 0x7d6be
movq 0x20(%r15), %r14
movq %rbx, %rdi
callq 0x6c2be
movq %r14, %rdi
movq 0x18(%rsp), %r14
movq %rax, %rsi
movq %r12, %rdx
callq 0x8f4bd
movq 0x28(%r15), %rdi
movq %rbx, %rsi
callq 0xae22f
movq 0x10(%r15), %rcx
movq %r14, (%rsp)
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %r8
movq %r13, %r9
callq 0x2ce0bd
movl %eax, %ebx
movq 0x30(%rsp), %rdi
leaq 0xb84c5(%rip), %rsi     # 0x3861e3
movl $0xa7, %edx
callq 0x936f9
xorl %edi, %edi
callq 0x8da06
movq 0x28(%rsp), %r15
jmp 0x2cd9cc
pushq $-0x1
popq %rbx
jmp 0x2cdd40
xorl %ebx, %ebx
movq %r15, %rdi
callq 0xdc9f1
movl %ebx, %eax
addq $0x6048, %rsp           # imm = 0x6048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x16a205(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x172a6(%rip), %rsi     # 0x2e5013
leaq 0xb8444(%rip), %rdx     # 0x3861b8
leaq 0xb85c0(%rip), %rcx     # 0x38633b
leaq 0xb8461(%rip), %r8      # 0x3861e3
pushq $0x5c
jmp 0x2cddd8
movq 0x16a1db(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1727c(%rip), %rsi     # 0x2e5013
leaq 0x17421(%rip), %rdx     # 0x2e51bf
leaq 0xb8596(%rip), %rcx     # 0x38633b
leaq 0xb8437(%rip), %r8      # 0x3861e3
pushq $0x59
jmp 0x2cddd8
movq 0x16a1b1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17252(%rip), %rsi     # 0x2e5013
leaq 0x173f7(%rip), %rdx     # 0x2e51bf
leaq 0xb856c(%rip), %rcx     # 0x38633b
leaq 0xb840d(%rip), %r8      # 0x3861e3
pushq $0x5d
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390