// File: /workspace/github_c_makefile_star2_O1/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 0x3f0d5
movq %rsi, %rbx
testq %rsi, %rsi
je 0x3f0d5
movq %rdi, %r14
callq 0x3ef03
movq %rax, %rdi
movq %r14, %rsi
callq 0x3e678
movq %rax, %r12
movq %rbx, %rdi
callq 0x41ca0
movq %rax, %r15
movq 0x18(%r12), %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x77144
movq %r15, %rdi
callq 0x41f83
movq %rax, %rbx
movq %rdx, %r14
movq %r15, %rdi
callq 0x41f3f
movq %rax, %rdi
callq 0x3c40b
movq %rax, %rbp
movq 0x10(%r12), %rdi
movq %rax, %rsi
callq 0x77109
movq %rax, %r13
testq %rax, %rax
jne 0x3f08c
leaq 0xa57e3(%rip), %rdx     # 0xe480c
movl $0x1, %edi
movl $0x20, %esi
movl $0x75, %ecx
callq 0x3601f
movq %rax, %r13
xorl %eax, %eax
movq %rax, 0x8(%r13)
leaq 0x3a91(%rip), %rdi      # 0x42ade
callq 0x78e23
movq %rax, (%r13)
movq $-0x1, 0x10(%r13)
xorl %eax, %eax
movq %rax, 0x18(%r13)
movq 0x10(%r12), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x77144
movq 0x30(%r12), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x30(%r12)
testq %rax, %rax
jne 0x3f08c
movq %rbp, 0x28(%r12)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x78de8
movq (%r13), %rdi
movq %rax, %rsi
callq 0x7904d
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
callq 0xf25d