// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x1, 0x2f(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x3d258
cmpq $0x0, 0x60(%rsp)
jne 0x3d290
movq 0x176d79(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x120dfd(%rip), %rsi    # 0x15e066
leaq 0x12a89d(%rip), %rdx    # 0x167b0d
leaq 0x12a9a8(%rip), %rcx    # 0x167c1f
leaq 0x12a6d9(%rip), %r8     # 0x167957
movl $0x10d, %r9d            # imm = 0x10D
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x3d292
movq 0x60(%rsp), %rdi
callq 0x211d0
movq %rax, 0x10(%rsp)
movq 0x68(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x50(%rsp), %rcx
leaq 0x2f(%rsp), %rdx
callq 0x3dd40
cmpl $0x0, %eax
jge 0x3d2cc
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x3d484
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x3d8f0
movq %rax, 0x40(%rsp)
movq 0x10(%rsp), %rsi
leaq 0x12a942(%rip), %rdi    # 0x167c2e
movb $0x0, %al
callq 0xc930
movq 0x60(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x60(%rsp), %rdi
callq 0xb0640
movq %rax, 0x48(%rsp)
callq 0x18f00
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x10(%rsp), %rsi
movq 0x30(%rsp), %rcx
movq 0x60(%rsp), %r8
movq 0x50(%rsp), %r9
leaq 0x12a903(%rip), %rdx    # 0x167c40
callq 0x494c0
movl %eax, 0x3c(%rsp)
cmpl $0x2, 0x3c(%rsp)
jne 0x3d36e
movq 0x30(%rsp), %rdi
callq 0x1afc0
movq 0x48(%rsp), %rdi
callq 0xb21b0
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x3d484
cmpl $0x1, 0x3c(%rsp)
jne 0x3d42f
movq 0x58(%rsp), %rdi
callq 0x3e040
movq %rax, 0x20(%rsp)
movq 0x60(%rsp), %rdi
callq 0x3e040
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x3d3a7
cmpq $0x0, 0x18(%rsp)
je 0x3d41a
testb $0x1, 0x2f(%rsp)
je 0x3d41a
cmpq $0x0, 0x58(%rsp)
je 0x3d401
cmpq $0x0, 0x20(%rsp)
je 0x3d3df
movq 0x58(%rsp), %rdi
callq 0x21140
testb $0x1, %al
jne 0x3d3ce
jmp 0x3d3df
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x18fb0
jmp 0x3d3f0
movq 0x30(%rsp), %rdi
leaq 0x12dcf1(%rip), %rsi    # 0x16b0dc
callq 0x18fb0
movq 0x30(%rsp), %rdi
leaq 0x12f7d4(%rip), %rsi    # 0x16cbd0
callq 0x18fb0
cmpq $0x0, 0x18(%rsp)
je 0x3d418
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x18fb0
jmp 0x3d42d
movq 0x30(%rsp), %rdi
callq 0x1afc0
movq $0x0, 0x30(%rsp)
jmp 0x3d42f
jmp 0x3d431
movq 0x48(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xb0f60
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0xb0730
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x211d0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x48(%rsp), %rcx
movq $-0x1, %rdx
callq 0x3db00
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)