// File: /workspace/github_c_makefile_star2_O3/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 %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x32bf14
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x32c2f4
callq 0x32be98
movq %rax, %rdi
movq %r14, %rsi
callq 0x1630b1
testq %rax, %rax
je 0x32c2ef
movq %rax, %r12
testq %r15, %r15
je 0x32bf45
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x32c2f9
movq %rbx, %rdi
callq 0x143f54
movq %rax, %r14
movb $0x1, %al
movl %eax, 0x14(%rsp)
leaq 0x6aa08(%rip), %r13     # 0x396965
movq $0x0, 0x18(%rsp)
movq %r14, 0x28(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, %rdi
callq 0x1440ea
testq %rax, %rax
je 0x32c2d1
movq %rax, %rbp
movq %rax, %rdi
callq 0x142988
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
callq 0x17a40
testl %eax, %eax
je 0x32bff3
movq %rbx, %rdi
leaq 0x54c71(%rip), %rsi     # 0x380c19
callq 0x17a40
testl %eax, %eax
je 0x32c05a
movq %rbx, %rdi
leaq 0x68bf8(%rip), %rsi     # 0x394bb7
callq 0x17a40
testl %eax, %eax
je 0x32c0d0
movq %rbx, %rdi
leaq 0x6b4e2(%rip), %rsi     # 0x3974b8
callq 0x17a40
testl %eax, %eax
je 0x32c0d7
movq %rbx, %rdi
callq 0xe4290
movq %rax, %rbx
jmp 0x32c19b
movq %rbp, %rdi
callq 0x144635
movq %rax, %rbx
movq %rbp, %rdi
leaq 0xae60f(%rip), %rsi     # 0x3da617
callq 0x141f50
xorl %ebp, %ebp
movq %rax, %rdi
leaq 0x935fc(%rip), %rsi     # 0x3bf615
leaq 0x30(%rsp), %rdx
xorl %eax, %eax
callq 0x177f0
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x11b0a1
movq 0x30(%rsp), %r8
movl $0x2000, %esi           # imm = 0x2000
leaq 0x4030(%rsp), %rdi
leaq 0x935db(%rip), %rdx     # 0x3bf626
movq %rax, %rcx
xorl %eax, %eax
callq 0x17c60
jmp 0x32c2c2
movq %rbp, %rdi
leaq 0x566fb(%rip), %rsi     # 0x38275f
callq 0x141f50
testq %rax, %rax
je 0x32c217
movq %rax, %r13
movq %rbp, %rdi
callq 0x144679
movq %rax, %rbx
movq %rdx, %rbp
movl $0x4000, %esi           # imm = 0x4000
leaq 0x30(%rsp), %rdi
leaq 0x9378a(%rip), %rdx     # 0x3bf81e
leaq 0x4030(%rsp), %rcx
movq %rax, %r8
movq %rbp, %r9
xorl %eax, %eax
callq 0x17c60
movq 0x20(%r12), %rdi
movq %r13, %rsi
callq 0x100add
testq %rax, %rax
je 0x32c0ee
movq 0x20(%r12), %rdi
movq %r13, %rsi
callq 0x100add
movq %rax, %r14
jmp 0x32c15c
xorl %ebp, %ebp
jmp 0x32c2c2
testb $0x1, 0x14(%rsp)
je 0x32c184
leaq 0x932f5(%rip), %rdi     # 0x3bf3de
jmp 0x32c18b
movq 0x10(%r12), %rdi
callq 0xebcd9
movq %rax, %rdi
callq 0xf259c
movq %rax, %r14
movq %rax, %rdi
callq 0xf2636
movq %r14, %rdi
callq 0xf2656
movq %r14, %rdi
callq 0xf2616
movq 0x20(%r12), %r15
movq %r13, %rdi
callq 0xe4290
movq %r15, %rdi
movq 0x20(%rsp), %r15
movq %rax, %rsi
movq %r14, %rdx
callq 0x100b18
leaq 0xb9e29(%rip), %rdi     # 0x3e5f6b
movq %r14, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x103d72
movq 0x28(%r12), %rdi
movq %r13, %rsi
callq 0x11bee9
movq 0x10(%r12), %rcx
movq %r15, (%rsp)
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbx, %r8
movq %rbp, %r9
callq 0x32c4ba
movl %eax, %ebp
jmp 0x32c2af
leaq 0x93258(%rip), %rdi     # 0x3bf3e3
callq 0xe4290
movq %rax, %rbx
movl $0x0, 0x14(%rsp)
movq %rbp, %rdi
callq 0x144679
movq %rax, %rbp
movq %rdx, %rax
subq %rbp, %rax
addq $-0x9, %rax
cmpq $-0xa, %rax
jae 0x32c203
movq %rdx, %r13
movl $0x4000, %esi           # imm = 0x4000
leaq 0x30(%rsp), %rdi
leaq 0x93654(%rip), %rdx     # 0x3bf81e
leaq 0x4030(%rsp), %rcx
movq %rbp, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x17c60
movq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x100add
testq %rax, %rax
je 0x32c21e
movq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x100add
movq %rax, %r14
jmp 0x32c278
movq %rbx, %rdi
leaq 0xb9bd6(%rip), %rsi     # 0x3e5de3
movl $0x95, %edx
callq 0x1045eb
xorl %ebp, %ebp
jmp 0x32c2bb
movq 0x10(%r12), %rdi
callq 0xebcd9
movq %rax, %rdi
callq 0xf259c
movq %rax, %r14
movq %rax, %rdi
callq 0xf2636
movq %r14, %rdi
callq 0xf2656
movq %r14, %rdi
callq 0xf2616
movq 0x20(%r12), %r15
movq %rbx, %rdi
callq 0xe4290
movq %r15, %rdi
movq 0x20(%rsp), %r15
movq %rax, %rsi
movq %r14, %rdx
callq 0x100b18
movq 0x28(%r12), %rdi
movq %rbx, %rsi
callq 0x11bee9
movq 0x10(%r12), %rcx
movq %r15, (%rsp)
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbp, %r8
movq %r13, %r9
callq 0x32c4ba
movl %eax, %ebp
movq %rbx, %rdi
leaq 0xb9b3e(%rip), %rsi     # 0x3e5de3
movl $0xa7, %edx
callq 0x1045eb
xorl %edi, %edi
callq 0xff22c
movq 0x28(%rsp), %r14
leaq 0x6a6a3(%rip), %r13     # 0x396965
testl %ebp, %ebp
je 0x32bf70
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x32c2d3
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x14417c
movl %ebx, %eax
addq $0x6038, %rsp           # imm = 0x6038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x95b25
callq 0x95ab7
callq 0x95aee