// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/diagram.c
// Function: add_to_current
static int add_to_current(GtDiagram *d, GtFeatureNode *node,
                          GtFeatureNode *parent, GtError *err)
{
  GtBlock *block;
  NodeInfoElement *ni;
  GtStyleQueryStatus rval;
  GtStr *caption = NULL;
  bool status = true;
  const char *nnid_p = NULL,
             *nnid_n = NULL,
             *nodetype;
  gt_assert(d && node);
  nodetype = gt_feature_node_get_type(node);
  if (get_caption_display_status(d, nodetype, &status, err) < 0) {
    return -1;
  }
  /* Get nodeinfo element and set itself as parent */
  ni = nodeinfo_get(d, node);
  gt_log_log("adding %s to self", nodetype);
  ni->parent = node;
  /* create new GtBlock tuple and add to node info */
  block = gt_block_new_from_node(node);
  caption = gt_str_new();
  rval = gt_style_get_str(d->style,
                          nodetype, "block_caption",
                          caption, node, err);
  if (rval == GT_STYLE_QUERY_ERROR) {
    gt_str_delete(caption);
    gt_block_delete(block);
    return -1;
  } else if (rval == GT_STYLE_QUERY_NOT_SET) {
    nnid_p = get_node_name_or_id(parent);
    nnid_n = get_node_name_or_id(node);
    if ((nnid_p || nnid_n) && status)
    {
      if (parent) {
        if (nnid_p && gt_feature_node_has_children(parent))
          gt_str_append_cstr(caption, nnid_p);
        else
          gt_str_append_cstr(caption, "-");
        gt_str_append_cstr(caption, "/");
      }
      if (nnid_n)
        gt_str_append_cstr(caption, nnid_n);
    } else {
      gt_str_delete(caption);
      caption = NULL;
    }
  }
  gt_block_set_caption(block, caption);
  gt_block_insert_element(block, node);
  nodeinfo_add_block(ni, gt_feature_node_get_type(node), GT_UNDEF_REPR, block);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbp
movq %rdx, 0x18(%rsp)
movq %rsi, %rbx
movq %rdi, %r12
movq %rsi, %rdi
callq 0x3f914
testq %rax, %rax
je 0x4d4b9
movq %rax, %r13
movq 0x18(%r12), %rdi
movq %rax, %rsi
callq 0x775ed
movq %rax, %r14
testq %rax, %rax
je 0x4d2b3
movb (%r14), %al
movb %al, 0xf(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4d6d3
movq %rax, %r14
leaq 0x9d7c4(%rip), %rdi     # 0xeaa11
movq %r13, %rsi
xorl %eax, %eax
callq 0x353ae
movq %r14, 0x10(%rsp)
movq %rbx, (%r14)
movq %rbx, %rdi
callq 0x8a84d
movq %rax, %r14
callq 0x3b728
movq %rax, %r15
movq 0x28(%r12), %rdi
leaq 0x9d7a5(%rip), %rdx     # 0xeaa23
movq %r13, %rsi
movq %rax, %rcx
movq %rbx, %r8
movq %rbp, %r9
callq 0x5363b
cmpl $0x1, %eax
je 0x4d326
cmpl $0x2, %eax
jne 0x4d3ae
movq %r15, %rdi
callq 0x3c87b
movq %r14, %rdi
callq 0x8b7c2
jmp 0x4d31c
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x20(%rsp)
leaq 0x9d4c6(%rip), %rsi     # 0xea78f
movl $0x1, %edi
movl $0xb5, %edx
callq 0x35862
movq %rax, %r14
movb $0x1, (%rax)
movq 0x28(%r12), %rdi
leaq 0x93eac(%rip), %rsi     # 0xe1196
leaq 0x9d764(%rip), %rdx     # 0xeaa55
movq %rax, %rcx
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x53bf6
cmpl $0x2, %eax
jne 0x4d3f7
leaq 0x9d480(%rip), %rsi     # 0xea78f
movq %r14, %rdi
movl $0xb9, %edx
callq 0x35c27
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4d3e8
movb 0xf(%rsp), %bpl
movq 0x18(%rsp), %rdi
callq 0x4d8ac
movq %rax, %r13
movq %rbx, %rdi
callq 0x4d8ac
movq %rax, %r12
movq %r13, %rax
orq %r12, %rax
je 0x4d3a3
testb %bpl, %bpl
je 0x4d3a3
cmpq $0x0, 0x18(%rsp)
je 0x4d38c
testq %r13, %r13
je 0x4d36b
movq 0x18(%rsp), %rdi
callq 0x3f8ef
testb %al, %al
jne 0x4d372
leaq 0xa09b5(%rip), %r13     # 0xedd27
movq %r15, %rdi
movq %r13, %rsi
callq 0x3b7af
leaq 0xa249d(%rip), %rsi     # 0xef821
movq %r15, %rdi
callq 0x3b7af
testq %r12, %r12
movq 0x10(%rsp), %r13
je 0x4d3b3
movq %r15, %rdi
movq %r12, %rsi
callq 0x3b7af
jmp 0x4d3b3
movq %r15, %rdi
callq 0x3c87b
xorl %r15d, %r15d
movq 0x10(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x8aba7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8a8b1
movq %rbx, %rdi
callq 0x3f914
movq %r13, %rdi
movq %rax, %rsi
movq $-0x1, %rdx
movq %r14, %rcx
callq 0x4d785
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x1, (%r14)
jne 0x4d4a4
movq 0x28(%r12), %rdi
leaq 0x9d65c(%rip), %rdx     # 0xeaa69
leaq 0x20(%rsp), %rcx
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x5393e
cmpl $0x1, %eax
je 0x4d43e
cmpl $0x2, %eax
jne 0x4d449
leaq 0x9d35e(%rip), %rsi     # 0xea78f
movq %r14, %rdi
movl $0xc4, %edx
jmp 0x4d317
movq $-0x1, %r15
movb $0x1, %al
jmp 0x4d490
movsd 0x20(%rsp), %xmm0
ucomisd 0x94491(%rip), %xmm0    # 0xe18e8
jne 0x4d45b
jnp 0x4d4be
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x9d2f5(%rip), %xmm0    # 0xea760
cvttsd2si %xmm0, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
cmpq $-0x1, %r15
je 0x4d4c3
leaq 0x40(%r12), %rdi
callq 0x7e19f
cmpq %r15, %rax
setbe %al
movb %al, (%r14)
leaq 0x40(%r12), %rdi
callq 0x7e19f
cmpq %r15, %rax
setbe (%r14)
movq 0x18(%r12), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x77628
jmp 0x4d231
callq 0x15cb1
callq 0x15c3f
callq 0x15c78