// File: /workspace/github_c_makefile_star2_O1/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 $0x6038, %rsp           # imm = 0x6038
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x10(%rsp)
testq %rdx, %rdx
je 0x336b6c
movq 0x10(%rsp), %rdi
callq 0x101a9a
testb %al, %al
jne 0x336f57
callq 0x336aec
movq %rax, %rdi
movq %r14, %rsi
callq 0x16af21
testq %rax, %rax
je 0x336f52
movq %rax, %r15
cmpq $0x0, 0x10(%rsp)
je 0x336ba2
movq 0x10(%rsp), %rdi
callq 0x101a9a
testb %al, %al
jne 0x336f5c
movq %rbx, %rdi
callq 0x14b1a8
movq %rax, %r14
movq %rax, %rdi
callq 0x14b33e
testq %rax, %rax
je 0x336f34
movq %rax, %r13
movb $0x1, %al
movl %eax, 0x1c(%rsp)
leaq 0x69247(%rip), %r12     # 0x39fe15
movq $0x0, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movq %r13, %rdi
callq 0x149bb2
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x17a40
testl %eax, %eax
je 0x336c43
movq %rbx, %rdi
leaq 0x533d7(%rip), %rsi     # 0x389fd7
callq 0x17a40
testl %eax, %eax
je 0x336caa
movq %rbx, %rdi
leaq 0x67447(%rip), %rsi     # 0x39e05e
callq 0x17a40
testl %eax, %eax
je 0x336d1e
movq %rbx, %rdi
leaq 0x69d50(%rip), %rsi     # 0x3a097e
callq 0x17a40
testl %eax, %eax
je 0x336d25
movq %rbx, %rdi
jmp 0x336df1
movq %r13, %rdi
callq 0x14b89b
movq %rax, %rbp
movq %r13, %rdi
leaq 0xad114(%rip), %rsi     # 0x3e3d6c
callq 0x14918c
xorl %ebx, %ebx
movq %rax, %rdi
leaq 0x9202c(%rip), %rsi     # 0x3c8c95
leaq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
movq %rbp, 0x28(%rsp)
movq %rbp, %rdi
callq 0x120d23
movq 0x30(%rsp), %r8
movl $0x2000, %esi           # imm = 0x2000
leaq 0x4030(%rsp), %rdi
leaq 0x9200b(%rip), %rdx     # 0x3c8ca6
movq %rax, %rcx
xorl %eax, %eax
callq 0x17c60
jmp 0x336f1a
movq %r13, %rdi
leaq 0x54e6e(%rip), %rsi     # 0x38bb22
callq 0x14918c
testq %rax, %rax
je 0x336d4c
movq %rax, %r14
movq %r13, %rdi
callq 0x14b8df
movq %rax, %rbx
movq %rdx, %r12
movl $0x4000, %esi           # imm = 0x4000
leaq 0x30(%rsp), %rdi
leaq 0x921ba(%rip), %rdx     # 0x3c8e9e
leaq 0x4030(%rsp), %rcx
movq %rax, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x17c60
movq 0x20(%r15), %rdi
movq %r14, %rsi
callq 0x105a11
testq %rax, %rax
je 0x336d58
movq 0x20(%r15), %rdi
movq %r14, %rsi
callq 0x105a11
movq %rax, %r13
jmp 0x336dbe
xorl %ebx, %ebx
jmp 0x336f1a
testb $0x1, 0x1c(%rsp)
je 0x336dea
leaq 0x91d27(%rip), %rdi     # 0x3c8a5e
callq 0xe8760
movq %rax, %r12
movl $0x0, 0x1c(%rsp)
jmp 0x336df9
xorl %ebx, %ebx
movq 0x20(%rsp), %r14
jmp 0x336f1a
movq 0x10(%r15), %rdi
callq 0xf02da
movq %rax, %rdi
callq 0xf6be5
movq %rax, %r13
movq %rax, %rdi
callq 0xf6c7f
movq %r13, %rdi
callq 0xf6c9f
movq %r13, %rdi
callq 0xf6c5f
movq 0x20(%r15), %rbp
movq %r14, %rdi
callq 0xe8760
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x105a4c
leaq 0xb89d9(%rip), %rdi     # 0x3ef77e
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x108e02
movq 0x28(%r15), %rdi
movq %r14, %rsi
callq 0x121c30
movq 0x10(%r15), %rcx
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %r8
movq %r12, %r9
callq 0x33711a
movl %eax, %ebx
jmp 0x336f07
leaq 0x91c72(%rip), %rdi     # 0x3c8a63
callq 0xe8760
movq %rax, %r12
movq %r13, %rdi
callq 0x14b8df
movq %rax, %rbx
movq %rdx, %rax
subq %rbx, %rax
addq $-0x9, %rax
cmpq $-0xa, %rax
jae 0x336e5f
movq %rdx, %r13
movl $0x4000, %esi           # imm = 0x4000
leaq 0x30(%rsp), %rdi
leaq 0x92076(%rip), %rdx     # 0x3c8e9e
leaq 0x4030(%rsp), %rcx
movq %rbx, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x17c60
movq 0x20(%r15), %rdi
movq %r12, %rsi
callq 0x105a11
testq %rax, %rax
je 0x336e7a
movq 0x20(%r15), %rdi
movq %r12, %rsi
callq 0x105a11
movq %rax, %r14
jmp 0x336ecc
movq %r12, %rdi
leaq 0xb878d(%rip), %rsi     # 0x3ef5f6
movl $0x95, %edx
callq 0x109670
xorl %ebx, %ebx
jmp 0x336f13
movq 0x10(%r15), %rdi
callq 0xf02da
movq %rax, %rdi
callq 0xf6be5
movq %rax, %r14
movq %rax, %rdi
callq 0xf6c7f
movq %r14, %rdi
callq 0xf6c9f
movq %r14, %rdi
callq 0xf6c5f
movq 0x20(%r15), %rbp
movq %r12, %rdi
callq 0xe8760
movq %rbp, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x105a4c
movq 0x28(%r15), %rdi
movq %r12, %rsi
callq 0x121c30
movq 0x10(%r15), %rcx
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbx, %r8
movq %r13, %r9
callq 0x33711a
movl %eax, %ebx
movq %r12, %rdi
leaq 0xb86f9(%rip), %rsi     # 0x3ef5f6
movl $0xa7, %edx
callq 0x109670
xorl %edi, %edi
callq 0x1040fc
movq 0x20(%rsp), %r14
leaq 0x68efb(%rip), %r12     # 0x39fe15
testl %ebx, %ebx
jne 0x336f36
movq %r14, %rdi
callq 0x14b33e
movq %rax, %r13
testq %rax, %rax
jne 0x336bdc
jmp 0x336f36
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x14b3d0
movl %ebx, %eax
addq $0x6038, %rsp           # imm = 0x6038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x97bfa
callq 0x97b8c
callq 0x97bc3