// File: /workspace/github_c_makefile_star2_O2/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 0x19528
testq %rax, %rax
je 0x2bd3b
movq %rax, %r13
movq 0x18(%r12), %rdi
movq %rax, %rsi
callq 0x55ef6
movq %rax, %r14
testq %rax, %rax
je 0x2bb38
movb (%r14), %al
movb %al, 0xf(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2bf3e
movq %rax, %r14
leaq 0xa7f2f(%rip), %rdi     # 0xd3a01
movq %r13, %rsi
xorl %eax, %eax
callq 0xc5d2
movq %r14, 0x10(%rsp)
movq %rbx, (%r14)
movq %rbx, %rdi
callq 0x6b44e
movq %rax, %r14
callq 0x13d5c
movq %rax, %r15
movq 0x28(%r12), %rdi
leaq 0xa7f10(%rip), %rdx     # 0xd3a13
movq %r13, %rsi
movq %rax, %rcx
movq %rbx, %r8
movq %rbp, %r9
callq 0x33b98
cmpl $0x1, %eax
je 0x2bba7
cmpl $0x2, %eax
jne 0x2bc2f
movq %r15, %rdi
callq 0x152db
movq %r14, %rdi
callq 0x6c7e1
jmp 0x2bb9f
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x20(%rsp)
leaq 0xa7c31(%rip), %rsi     # 0xd377f
pushq $0x1
popq %rdi
movl $0xb5, %edx
callq 0xccb0
movq %rax, %r14
movb $0x1, (%rax)
movq 0x28(%r12), %rdi
leaq 0x9e629(%rip), %rsi     # 0xca196
leaq 0xa7ed1(%rip), %rdx     # 0xd3a45
movq %rax, %rcx
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x3440a
cmpl $0x2, %eax
jne 0x2bc74
leaq 0xa7bed(%rip), %rsi     # 0xd377f
movq %r14, %rdi
movl $0xb9, %edx
callq 0xd249
pushq $-0x1
popq %rax
jmp 0x2bc65
movb 0xf(%rsp), %bpl
movq 0x18(%rsp), %rdi
callq 0x2c1bb
movq %rax, %r13
movq %rbx, %rdi
callq 0x2c1bb
movq %rax, %r12
movq %r13, %rax
orq %r12, %rax
je 0x2bc24
testb %bpl, %bpl
je 0x2bc24
cmpq $0x0, 0x18(%rsp)
je 0x2bc0d
testq %r13, %r13
je 0x2bbec
movq 0x18(%rsp), %rdi
callq 0x194d0
testb %al, %al
jne 0x2bbf3
leaq 0xab0dc(%rip), %r13     # 0xd6ccf
movq %r15, %rdi
movq %r13, %rsi
callq 0x13dd3
leaq 0xacbc4(%rip), %rsi     # 0xd87c9
movq %r15, %rdi
callq 0x13dd3
testq %r12, %r12
movq 0x10(%rsp), %r13
je 0x2bc34
movq %r15, %rdi
movq %r12, %rsi
callq 0x13dd3
jmp 0x2bc34
movq %r15, %rdi
callq 0x152db
xorl %r15d, %r15d
movq 0x10(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x6ba8c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6b4e5
movq %rbx, %rdi
callq 0x19528
pushq $-0x1
popq %rdx
movq %r13, %rdi
movq %rax, %rsi
movq %r14, %rcx
callq 0x2c04a
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x1, (%r14)
jne 0x2bd26
movq 0x28(%r12), %rdi
leaq 0xa7dcf(%rip), %rdx     # 0xd3a59
leaq 0x20(%rsp), %rcx
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x33ff8
cmpl $0x1, %eax
je 0x2bcbb
cmpl $0x2, %eax
jne 0x2bcc3
leaq 0xa7ad1(%rip), %rsi     # 0xd377f
movq %r14, %rdi
movl $0xc4, %edx
jmp 0x2bb9a
pushq $-0x1
popq %r15
movb $0x1, %al
jmp 0x2bd12
movsd 0x20(%rsp), %xmm0
ucomisd 0x9ec17(%rip), %xmm0    # 0xca8e8
jne 0x2bcd9
jnp 0x2bd73
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0xa7a67(%rip), %xmm0    # 0xd3750
cvttsd2si %xmm0, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
cmpq $-0x1, %r15
je 0x2bda1
leaq 0x40(%r12), %rdi
callq 0x5d05e
cmpq %r15, %rax
setbe %al
movb %al, (%r14)
leaq 0x40(%r12), %rdi
callq 0x5d05e
cmpq %r15, %rax
setbe (%r14)
movq 0x18(%r12), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x55f31
jmp 0x2bab6
movq 0x102276(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e31a(%rip), %rsi     # 0xca066
leaq 0xa7cce(%rip), %rdx     # 0xd3a21
leaq 0xa7cd0(%rip), %rcx     # 0xd3a2a
leaq 0xa7a1e(%rip), %r8      # 0xd377f
movl $0xaf, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x10223e(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e2e2(%rip), %rsi     # 0xca066
leaq 0xa7ce2(%rip), %rdx     # 0xd3a6d
leaq 0xa7c98(%rip), %rcx     # 0xd3a2a
leaq 0xa79e6(%rip), %r8      # 0xd377f
movl $0xcb, %r9d
jmp 0x2bd67
movq 0x102210(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e2b4(%rip), %rsi     # 0xca066
leaq 0xa7ccb(%rip), %rdx     # 0xd3a84
leaq 0xa7c6a(%rip), %rcx     # 0xd3a2a
leaq 0xa79b8(%rip), %r8      # 0xd377f
movl $0xcd, %r9d
jmp 0x2bd67