// File: /workspace/github_c_makefile_star2_O3/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 0x3e77d
movq %rsi, %rbx
testq %rsi, %rsi
je 0x3e77d
movq %rdi, %r14
callq 0x3e5ab
movq %rax, %rdi
movq %r14, %rsi
callq 0x3dcfc
movq %rax, %r12
movq %rbx, %rdi
callq 0x4130c
movq %rax, %r15
movq 0x18(%r12), %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x77628
movq %r15, %rdi
callq 0x415e5
movq %rax, %rbx
movq %rdx, %r14
movq %r15, %rdi
callq 0x415a1
movq %rax, %rdi
callq 0x3bb5d
movq %rax, %rbp
movq 0x10(%r12), %rdi
movq %rax, %rsi
callq 0x775ed
movq %rax, %r13
testq %rax, %rax
jne 0x3e734
leaq 0xa611b(%rip), %rdx     # 0xe47ec
movl $0x1, %edi
movl $0x20, %esi
movl $0x75, %ecx
callq 0x359a6
movq %rax, %r13
xorl %eax, %eax
movq %rax, 0x8(%r13)
leaq 0x3a17(%rip), %rdi      # 0x4210c
callq 0x792c3
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 0x77628
movq 0x30(%r12), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x30(%r12)
testq %rax, %rax
jne 0x3e734
movq %rbp, 0x28(%r12)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x79288
movq (%r13), %rdi
movq %rax, %rsi
callq 0x794f6
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 0xf224