// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/annotationsketch/diagram.c
// Function: process_node
static int process_node(GtDiagram *d, GtFeatureNode *node,
                        GtFeatureNode *parent, GtError *err)
{
  GtRange elem_range;
  bool *collapse;
  GtShouldGroupByParent *group;
  const char *feature_type = NULL,
             *parent_gft = NULL;
  double tmp;
  GtStyleQueryStatus rval;
  GtUword max_show_width = GT_UNDEF_UWORD,
                par_max_show_width = GT_UNDEF_UWORD;

  gt_assert(d && node);

  gt_log_log(">> getting '%s'", gt_feature_node_get_type(node));

  /* skip pseudonodes */
  if (gt_feature_node_is_pseudo(node))
    return 0;

  feature_type = gt_feature_node_get_type(node);
  gt_assert(feature_type);

  /* discard elements that do not overlap with visible range */
  elem_range = gt_genome_node_get_range((GtGenomeNode*) node);
  if (!gt_range_overlap(&d->range, &elem_range))
    return 0;

  /* get maximal view widths in nucleotides to show this type */
  rval = gt_style_get_num(d->style, feature_type, "max_show_width", &tmp, NULL,
                          err);
  switch (rval) {
    case GT_STYLE_QUERY_OK:
      max_show_width = tmp;
      break;
    case GT_STYLE_QUERY_ERROR:
      return -1;
      break; /* should never be reached */
    default:
      /* do not change default value */
      break;
  }

  /* for non-root nodes, get maximal view with to show parent */
  if (parent)
  {
    if (!gt_feature_node_is_pseudo(parent))
    {
      parent_gft = gt_feature_node_get_type(parent);
      rval = gt_style_get_num(d->style,
                              parent_gft, "max_show_width",
                              &tmp, NULL, err);
      switch (rval) {
        case GT_STYLE_QUERY_OK:
          par_max_show_width = tmp;
          break;
        case GT_STYLE_QUERY_ERROR:
          return -1;
          break; /* should never be reached */
        default:
          /* do not change default value */
          break;
      }
    } else
      par_max_show_width = GT_UNDEF_UWORD;
  }

  /* check if this type is to be displayed at all */
  if (max_show_width != GT_UNDEF_UWORD &&
      gt_range_length(&d->range) > max_show_width)
  {
    return 0;
  }

  /* disregard parent node if it is configured not to be shown */
  if (parent
        && par_max_show_width != GT_UNDEF_UWORD
        && gt_range_length(&d->range) > par_max_show_width)
  {
    parent = NULL;
  }

  /* check if this is a collapsing type, cache result */
  if ((collapse = (bool*) gt_hashmap_get(d->collapsingtypes,
                                         feature_type)) == NULL)
  {
    collapse = gt_malloc(sizeof (bool));
    *collapse = false;
    if (gt_style_get_bool(d->style, feature_type, "collapse_to_parent",
                           collapse, NULL, err) == GT_STYLE_QUERY_ERROR) {
      gt_free(collapse);
      return -1;
    }
    gt_hashmap_add(d->collapsingtypes, (void*) feature_type, collapse);
  }

  /* check if type should be grouped by parent, cache result */
  if ((group = (GtShouldGroupByParent*) gt_hashmap_get(d->groupedtypes,
                                                       feature_type)) == NULL)
  {
    bool tmp;
    group = gt_malloc(sizeof (GtShouldGroupByParent));
    rval = gt_style_get_bool(d->style, feature_type, "group_by_parent",
                             &tmp, NULL, err);
    switch (rval) {
      case GT_STYLE_QUERY_OK:
        if (tmp)
          *group = GT_GROUP_BY_PARENT;
        else
          *group = GT_DO_NOT_GROUP_BY_PARENT;
        break;
      case GT_STYLE_QUERY_NOT_SET:
        *group = GT_UNDEFINED_GROUPING;
        break;
      case GT_STYLE_QUERY_ERROR:
        gt_free(group);
        return -1;
        break; /* should never be reached */
    }
    gt_hashmap_add(d->groupedtypes, (void*) feature_type, group);
  }

  /* decide where to place this feature: */
  if (*collapse)
  {
    /* user has specified collapsing to parent for this type */
    if (parent && !gt_feature_node_is_pseudo(parent)) {
      /* collapsing child nodes are added to upwards blocks,
         but never collapse into pseudo nodes */
      add_recursive(d, node, parent, node);
    } else {
      /* if no parent or only pseudo-parent, do not collapse */
      if (add_to_current(d, node, parent, err) < 0) {
        return -1;
      }
    }
  }
  else  /* (!*collapse) */
  {
    if (parent) {
      bool do_not_overlap = false;
      do_not_overlap = gt_feature_node_direct_children_do_not_overlap_st(parent,
                                                                         node);
      if (*group == GT_GROUP_BY_PARENT
          || (do_not_overlap && *group == GT_UNDEFINED_GROUPING))
      {
        if (gt_feature_node_is_pseudo(parent)
              && gt_feature_node_is_multi(node))
        {
          if (add_to_rep(d, node, parent, err) < 0) {
            return -1;
          }
        } else if
            (gt_feature_node_number_of_children(parent) > 1)
        {
          if (add_to_parent(d, node, parent, err) < 0) {
            return -1;
          }
        } else {
          if (add_to_current(d, node, parent, err) < 0) {
            return -1;
          }
        }
      } else {
        if (gt_feature_node_is_pseudo(parent)
              && gt_feature_node_is_multi(node))
        {
          if (add_to_rep(d, node, parent, err) < 0) {
            return -1;
          }
        } else {
          if (add_to_current(d, node, parent, err) < 0) {
            return -1;
          }
        }
      }
    } else {
      /* root nodes always get their own block */
      if (add_to_current(d, node, parent, err) < 0) {
        return -1;
      }
    }
  }

  /* we can now assume that this node has been processed into the reverse
     lookup structure */
#ifndef NDEBUG
  if (!gt_feature_node_is_multi(node))
    gt_assert(gt_hashmap_get(d->nodeinfo, node));
#endif

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
je 0x2b90b
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2b90b
movq %rcx, %r13
movq %rdx, %r15
movq %rdi, %r14
movq %rbx, %rdi
callq 0x19528
leaq 0xa8607(%rip), %rdi     # 0xd3932
xorl %r12d, %r12d
movq %rax, %rsi
xorl %eax, %eax
callq 0xc5d2
movq %rbx, %rdi
callq 0x19959
testb %al, %al
jne 0x2b862
movq %r13, 0x8(%rsp)
movq %r15, 0x20(%rsp)
movq %rbx, %rdi
callq 0x19528
testq %rax, %rax
je 0x2b939
movq %rax, %r13
movq %rbx, %rdi
callq 0x1c3c4
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
movq %rdx, 0x8(%rsi)
movq %r14, 0x10(%rsp)
leaq 0x40(%r14), %rbp
movq %rbp, %rdi
callq 0x5d0a4
testb %al, %al
je 0x2b862
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rdi
leaq 0xa859f(%rip), %rdx     # 0xd3942
leaq 0x18(%rsp), %rcx
movq %r13, %rsi
xorl %r8d, %r8d
movq 0x8(%rsp), %r9
callq 0x33ff8
pushq $-0x1
popq %r12
cmpl $0x2, %eax
je 0x2b862
pushq $-0x1
popq %r14
movq %r14, %r15
testl %eax, %eax
jne 0x2b3f5
movsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0xa8366(%rip), %xmm0    # 0xd3750
cvttsd2si %xmm0, %r15
andq %rcx, %r15
orq %rax, %r15
movq 0x20(%rsp), %r12
testq %r12, %r12
je 0x2b46a
movq %r12, %rdi
callq 0x19959
testb %al, %al
jne 0x2b46a
movq %r12, %rdi
callq 0x19528
movq 0x10(%rsp), %rcx
movq 0x28(%rcx), %rdi
leaq 0xa851f(%rip), %rdx     # 0xd3942
leaq 0x18(%rsp), %rcx
movq %rax, %rsi
xorl %r8d, %r8d
movq 0x8(%rsp), %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x2b85e
testl %eax, %eax
jne 0x2b46a
movsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0xa82f1(%rip), %xmm0    # 0xd3750
cvttsd2si %xmm0, %r14
andq %rcx, %r14
orq %rax, %r14
cmpq $-0x1, %r15
je 0x2b484
movq %rbp, %rdi
callq 0x5d05e
xorl %r12d, %r12d
cmpq %r15, %rax
ja 0x2b862
movq 0x20(%rsp), %r15
testq %r15, %r15
setne %al
cmpq $-0x1, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2b4ae
movq %rbp, %rdi
callq 0x5d05e
xorl %ecx, %ecx
cmpq %r14, %rax
cmovaq %rcx, %r15
movq 0x10(%rsp), %r14
movq 0x10(%r14), %rdi
movq %r13, %rsi
callq 0x55ef6
movq %rax, %rbp
testq %rax, %rax
jne 0x2b527
leaq 0xa82b1(%rip), %rsi     # 0xd377f
pushq $0x1
popq %rdi
movl $0x204, %edx            # imm = 0x204
callq 0xccb0
movq %rax, %rbp
movb $0x0, (%rax)
movq 0x28(%r14), %rdi
leaq 0xa8465(%rip), %rdx     # 0xd3951
movq %r13, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
movq 0x8(%rsp), %r9
callq 0x3440a
cmpl $0x2, %eax
jne 0x2b518
leaq 0xa8274(%rip), %rsi     # 0xd377f
movq %rbp, %rdi
movl $0x208, %edx            # imm = 0x208
jmp 0x2b859
movq 0x10(%r14), %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x55f31
movq 0x20(%r14), %rdi
movq %r13, %rsi
callq 0x55ef6
movq %rax, %r12
testq %rax, %rax
jne 0x2b5a1
leaq 0xa823d(%rip), %rsi     # 0xd377f
pushq $0x4
popq %rdi
movl $0x213, %edx            # imm = 0x213
callq 0xccb0
movq %rax, %r12
movq 0x28(%r14), %rdi
leaq 0xa8407(%rip), %rdx     # 0xd3964
leaq 0x7(%rsp), %rcx
movq %r13, %rsi
xorl %r8d, %r8d
movq 0x8(%rsp), %r9
callq 0x3440a
cmpl $0x2, %eax
je 0x2b84a
cmpl $0x1, %eax
je 0x2b58b
testl %eax, %eax
jne 0x2b592
movzbl 0x7(%rsp), %eax
jmp 0x2b58e
pushq $0x2
popq %rax
movl %eax, (%r12)
movq 0x20(%r14), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x55f31
cmpb $0x1, (%rbp)
jne 0x2b5c7
testq %r15, %r15
je 0x2b5bc
movq %r15, %rdi
callq 0x19959
testb %al, %al
je 0x2b6d8
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
jmp 0x2b62f
testq %r15, %r15
je 0x2b627
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1b4fc
movl %eax, %ebp
movq %r15, %rdi
movl (%r12), %r15d
cmpl $0x2, %r15d
sete %r14b
movq %rdi, %r12
callq 0x19959
cmpl $0x1, %r15d
je 0x2b6a3
andb %r14b, %bpl
jne 0x2b6a3
testb %al, %al
movq 0x10(%rsp), %r14
je 0x2b61c
movq %rbx, %rdi
callq 0x198d7
testb %al, %al
jne 0x2b6c0
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
jmp 0x2b62f
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq 0x8(%rsp), %rcx
callq 0x2ba6d
pushq $-0x1
popq %r12
testl %eax, %eax
js 0x2b862
movq %rbx, %rdi
callq 0x198d7
xorl %r12d, %r12d
testb %al, %al
jne 0x2b862
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rdi
movq %rbx, %rsi
callq 0x55ef6
testq %rax, %rax
jne 0x2b862
movq 0x10293f(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e9e3(%rip), %rsi     # 0xca066
leaq 0xa82ea(%rip), %rdx     # 0xd3974
leaq 0xa8294(%rip), %rcx     # 0xd3925
leaq 0xa80e7(%rip), %r8      # 0xd377f
movl $0x26a, %r9d            # imm = 0x26A
jmp 0x2b965
testb %al, %al
movq 0x10(%rsp), %r14
je 0x2b76a
movq %rbx, %rdi
callq 0x198d7
testb %al, %al
je 0x2b76a
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq 0x8(%rsp), %rcx
callq 0x2bdcf
jmp 0x2b639
movq %rbx, %r12
movq 0x10(%rsp), %r14
testq %r15, %r15
je 0x2b645
movq %r14, %rdi
movq %r12, %rsi
callq 0x2bf3e
movq %rax, %rbp
movq %rbx, %rdi
callq 0x198d7
pushq $-0x1
popq %r13
testb %al, %al
je 0x2b712
movq %rbx, %rdi
callq 0x19b8f
movq %rax, %r13
cmpq %r12, %r15
je 0x2b885
movq %r15, %rsi
movq %r15, (%rbp)
movq 0x8(%r14), %rdi
callq 0x55ef6
testq %rax, %rax
je 0x2b645
movq %rax, %r13
movq %r12, %rdi
callq 0x19528
movq %rax, %r12
movq %r15, %rdi
callq 0x19528
leaq 0xa8259(%rip), %rdi     # 0xd39aa
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc5d2
movq %r15, %r12
movq (%r13), %r15
jmp 0x2b6e0
movq %r12, %r15
movq %r12, %rdi
callq 0x1aeb5
cmpq $0x2, %rax
movq 0x8(%rsp), %rbp
jb 0x2b874
movq %r14, %rdi
movq %r15, %rsi
callq 0x2bf3e
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2bf3e
movq %rax, %r13
movq %rbx, %rdi
callq 0x19528
leaq 0xa835b(%rip), %rdi     # 0xd3b0a
movq %rax, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0xc5d2
movq %r15, (%r13)
movq %rbx, %rdi
callq 0x19528
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2bfe3
movq %rax, %r13
testq %rax, %rax
jne 0x2b83a
movq %r15, %rdi
callq 0x6b44e
movq %rax, %r13
movq %rbx, %rdi
callq 0x19528
movq %r13, %rdi
movq %rax, %rsi
callq 0x6bb53
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
movq %rbp, %r8
callq 0x2c1e9
testl %eax, %eax
js 0x2b8fe
movq %rbx, %rdi
callq 0x19528
movq %r12, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x2c04a
testq %r13, %r13
je 0x2b971
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6b4e5
jmp 0x2b645
leaq 0xa7f2e(%rip), %rsi     # 0xd377f
movq %r12, %rdi
movl $0x221, %edx            # imm = 0x221
callq 0xd249
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rbp, %rcx
jmp 0x2b634
movq %r12, %rdi
callq 0x19528
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x2bfe3
movq %rax, %r15
testq %rax, %rax
jne 0x2b8c7
movq %r12, %rdi
callq 0x6b44e
movq %rax, %r15
movq %r12, %rdi
callq 0x19528
movq %rbp, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x2c04a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b4e5
movq %rbx, %rdi
callq 0x19528
movq %rax, %r12
movq %r15, %rdi
callq 0x6bb96
leaq 0xa80aa(%rip), %rdi     # 0xd3996
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xc5d2
jmp 0x2b645
movq %r13, %rdi
callq 0x6c7e1
jmp 0x2b85e
movq 0x1026a6(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e74a(%rip), %rsi     # 0xca066
leaq 0xa7ff8(%rip), %rdx     # 0xd391b
leaq 0xa7ffb(%rip), %rcx     # 0xd3925
leaq 0xa7e4e(%rip), %r8      # 0xd377f
movl $0x1ba, %r9d            # imm = 0x1BA
jmp 0x2b965
movq 0x102678(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e71c(%rip), %rsi     # 0xca066
leaq 0xba269(%rip), %rdx     # 0xe5bba
leaq 0xa7fcd(%rip), %rcx     # 0xd3925
leaq 0xa7e20(%rip), %r8      # 0xd377f
movl $0x1c3, %r9d            # imm = 0x1C3
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x102640(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e6e4(%rip), %rsi     # 0xca066
leaq 0xb46b3(%rip), %rdx     # 0xe003c
leaq 0xa816c(%rip), %rcx     # 0xd3afc
leaq 0xa7de8(%rip), %r8      # 0xd377f
movl $0x154, %r9d            # imm = 0x154
jmp 0x2b965