// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/feature_index_memory.c
// Function: gt_feature_index_memory_add_feature_node
int gt_feature_index_memory_add_feature_node(GtFeatureIndex *gfi,
                                             GtFeatureNode *fn,
                                             GT_UNUSED GtError *err)
{
  GtGenomeNode *gn;
  char* seqid;
  GtFeatureIndexMemory *fi;
  GtRange node_range;
  RegionInfo *info;
  GtIntervalTreeNode *new_node;
  gt_assert(gfi && fn);

  fi = gt_feature_index_memory_cast(gfi);
  gn = gt_genome_node_ref((GtGenomeNode*) fn);
  /* assign id number as 'primary key' */
  gt_hashmap_add(fi->nodes_in_index, gn, gn);
  /* get information about seqid and range */
  node_range = gt_genome_node_get_range(gn);
  seqid = gt_str_get(gt_genome_node_get_seqid(gn));
  info = (RegionInfo*) gt_hashmap_get(fi->regions, seqid);

  /* If the seqid was encountered for the first time, no sequence
     region nodes have been visited before. We therefore must create a new
     index entry and maintain our own GtRange. */
  if (!info)
  {
    info = gt_calloc(1, sizeof (RegionInfo));
    info->region = NULL;
    info->features = gt_interval_tree_new((GtFree)
                                          gt_genome_node_delete);
    info->dyn_range.start = ~0UL;
    info->dyn_range.end   = 0;
    gt_hashmap_add(fi->regions, seqid, info);
    if (fi->nof_region_nodes++ == 0)
      fi->firstseqid = seqid;
  }

  /* add node to the appropriate array in the hashtable */
  new_node = gt_interval_tree_node_new(gn, node_range.start, node_range.end);
  gt_interval_tree_insert(info->features, new_node);
  /* update dynamic range */
  info->dyn_range.start = GT_MIN(info->dyn_range.start, node_range.start);
  info->dyn_range.end = GT_MAX(info->dyn_range.end, node_range.end);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x17d8d
movq %rsi, %rbx
testq %rsi, %rsi
je 0x17d8d
movq %rdi, %r14
callq 0x17bc8
movq %rax, %rdi
movq %r14, %rsi
callq 0x172d5
movq %rax, %r12
movq %rbx, %rdi
callq 0x1bec8
movq %rax, %r15
movq 0x18(%r12), %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x55f31
movq %r15, %rdi
callq 0x1c3c4
movq %rax, %rbx
movq %rdx, %r14
movq %r15, %rdi
callq 0x1c31a
movq %rax, %rdi
callq 0x143d2
movq %rax, %rbp
movq 0x10(%r12), %rdi
movq %rax, %rsi
callq 0x55ef6
movq %rax, %r13
testq %rax, %rax
jne 0x17d44
leaq 0xb5b00(%rip), %rdx     # 0xcd7ec
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
pushq $0x75
popq %rcx
callq 0xce9a
movq %rax, %r13
andq $0x0, 0x8(%rax)
leaq 0x54da(%rip), %rdi      # 0x1d1e3
callq 0x57bf5
movq %rax, (%r13)
orq $-0x1, 0x10(%r13)
andq $0x0, 0x18(%r13)
movq 0x10(%r12), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x55f31
movq 0x30(%r12), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x30(%r12)
testq %rax, %rax
jne 0x17d44
movq %rbp, 0x28(%r12)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x57bc0
movq (%r13), %rdi
movq %rax, %rsi
callq 0x57f19
movq 0x10(%r13), %rax
movq 0x18(%r13), %rcx
cmpq %rbx, %rax
cmovbq %rax, %rbx
cmpq %r14, %rcx
cmovaq %rcx, %r14
movq %rbx, 0x10(%r13)
movq %r14, 0x18(%r13)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x116224(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0xb22c8(%rip), %rsi     # 0xca066
leaq 0xb5a6b(%rip), %rdx     # 0xcd810
leaq 0xb5a6e(%rip), %rcx     # 0xcd81a
leaq 0xb5a39(%rip), %r8      # 0xcd7ec
pushq $0x65
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300