// File: /workspace/github_c_makefile_star2_O1/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 0x40276
testq %rax, %rax
je 0x4e174
movq %rax, %r13
movq 0x18(%r12), %rdi
movq %rax, %rsi
callq 0x77109
movq %rax, %r14
testq %rax, %rax
movq %rbp, 0x8(%rsp)
je 0x4dec7
movb (%r14), %r14b
xorb $0x1, %r14b
xorl %eax, %eax
jmp 0x4df35
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
movq %rax, 0x20(%rsp)
leaq 0x9c902(%rip), %rsi     # 0xea7df
movl $0x1, %edi
movl $0xb5, %edx
callq 0x35ee2
movq %rax, %r14
movb $0x1, (%rax)
movq 0x28(%r12), %rdi
leaq 0x93298(%rip), %rsi     # 0xe1196
leaq 0x9cba0(%rip), %rdx     # 0xeaaa5
movq %rax, %rcx
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x5488a
movl $0xb9, %edx
cmpl $0x2, %eax
jne 0x4dfcb
leaq 0x9c8b7(%rip), %rsi     # 0xea7df
movq %r14, %rdi
callq 0x362a0
movb $0x1, %al
xorl %r14d, %r14d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testb %al, %al
jne 0x4e130
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4e38a
movq %r12, %rbp
movq %rbx, %r12
movq %rax, %rbx
leaq 0x9cb03(%rip), %rdi     # 0xeaa61
movq %r13, %rsi
xorl %eax, %eax
callq 0x35a32
movq %rbx, 0x10(%rsp)
movq %r12, (%rbx)
movq %r12, %rbx
movq %r12, %rdi
callq 0x8ad69
movq %rax, %r12
callq 0x3bfe0
movq 0x28(%rbp), %rdi
leaq 0x9cae5(%rip), %rdx     # 0xeaa73
movq %r13, %rsi
movq %rax, %rbp
movq %rax, %rcx
movq %rbx, %r8
movq 0x8(%rsp), %r9
callq 0x542cf
cmpl $0x1, %eax
je 0x4e05f
cmpl $0x2, %eax
jne 0x4e0a0
movq %rbp, %rdi
callq 0x3d1eb
movq %r12, %rdi
callq 0x8bcd2
jmp 0x4e130
cmpb $0x1, (%r14)
jne 0x4e15f
movq 0x28(%r12), %rdi
leaq 0x9cad8(%rip), %rdx     # 0xeaab9
leaq 0x20(%rsp), %rcx
movq %r13, %rsi
xorl %r8d, %r8d
movq %rbp, %r9
callq 0x545d2
cmpl $0x1, %eax
je 0x4e142
movl $0xc4, %edx
cmpl $0x2, %eax
je 0x4df21
movsd 0x20(%rsp), %xmm0
ucomisd 0x938cf(%rip), %xmm0    # 0xe18e8
jne 0x4e021
jnp 0x4e179
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x9c77f(%rip), %xmm0    # 0xea7b0
cvttsd2si %xmm0, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
cmpq $-0x1, %r15
je 0x4e17e
leaq 0x40(%r12), %rdi
callq 0x7e05b
cmpq %r15, %rax
setbe %al
jmp 0x4e14b
movq %r12, 0x8(%rsp)
movq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x4e559
movq %rax, %r12
movq %rbx, %rdi
callq 0x4e559
movq %rax, %r15
movq %r12, %rax
orq %r15, %rax
sete %al
orb %r14b, %al
testb $0x1, %al
je 0x4e0a7
movq %rbp, %rdi
callq 0x3d1eb
xorl %ebp, %ebp
movq 0x10(%rsp), %r14
jmp 0x4e0f5
movq 0x10(%rsp), %r14
jmp 0x4e0fa
testq %r13, %r13
movq 0x10(%rsp), %r14
je 0x4e0e5
testq %r12, %r12
je 0x4e0c4
movq 0x18(%rsp), %rdi
callq 0x40251
testb %al, %al
jne 0x4e0cb
leaq 0x9fca4(%rip), %r12     # 0xedd6f
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3c067
leaq 0xa178f(%rip), %rsi     # 0xef86c
movq %rbp, %rdi
callq 0x3c067
testq %r15, %r15
je 0x4e0f5
movq %rbp, %rdi
movq %r15, %rsi
callq 0x3c067
movq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x8b0c3
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8adcd
movq %rbx, %rdi
callq 0x40276
movq %r14, %rdi
movq %rax, %rsi
movq $-0x1, %rdx
movq %r12, %rcx
callq 0x4e43c
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $-0x1, %r15
movb $0x1, %al
movb %al, (%r14)
leaq 0x40(%r12), %rdi
callq 0x7e05b
cmpq %r15, %rax
setbe (%r14)
movq 0x18(%r12), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x77144
jmp 0x4debc
callq 0x15e03
callq 0x15d91
callq 0x15dca