// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/annotationsketch/diagram.c
// Function: add_to_rep
static int add_to_rep(GtDiagram *d, GtFeatureNode *node, GtFeatureNode* parent,
                      GtError *err)
{
  GtBlock *block = NULL;
  GtFeatureNode *rep = GT_UNDEF_REPR;
  NodeInfoElement *ni;
  gt_assert(d && node && gt_feature_node_is_multi(node));

  rep = gt_feature_node_get_multi_representative(node);
  gt_log_log("adding %s to representative %p", gt_feature_node_get_type(node),
                                               rep);
  ni = nodeinfo_get(d, rep);

  block = nodeinfo_find_block(ni,
                              gt_feature_node_get_type(node),
                              rep);
  if (!block) {
    block = gt_block_new_from_node(parent);
    gt_block_set_type(block, gt_feature_node_get_type(node));
    /* if parent is a pseudonode, then we have a multiline feature without
       a parent. we must not access the parent in this case! */
    if (gt_feature_node_is_pseudo(parent)) {
      if (assign_block_caption(d, node, NULL, block, err) < 0) {
        gt_block_delete(block);
        return -1;
      }
    } else {
      if (assign_block_caption(d, node, parent, block, err) < 0) {
        gt_block_delete(block);
        return -1;
      }
    }
    nodeinfo_add_block(ni, gt_feature_node_get_type(node),
                       rep, block);
  }
  gt_assert(block);
  gt_block_insert_element(block, node);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq %rsi, %rdi
callq 0x198d7
testb %al, %al
je 0x2bed8
movq %rbx, %rdi
callq 0x19b8f
movq %rax, %r14
movq %rbx, %rdi
callq 0x19528
leaq 0xa7ccc(%rip), %rdi     # 0xd3add
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xc5d2
movq %r12, %rdi
movq %r14, %rsi
callq 0x2bf3e
movq %rax, %rbp
movq %rbx, %rdi
callq 0x19528
movq %rbp, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x2bfe3
movq %rax, %r15
testq %rax, %rax
jne 0x2beaf
movq %r13, %rdi
callq 0x6b44e
movq %rax, %r15
movq %rbx, %rdi
callq 0x19528
movq %r15, %rdi
movq %rax, %rsi
callq 0x6bb53
movq %r13, %rdi
callq 0x19959
movq %r12, %rdi
movq %rbx, %rsi
testb %al, %al
je 0x2be7e
xorl %edx, %edx
jmp 0x2be81
movq %r13, %rdx
movq %r15, %rcx
movq (%rsp), %r8
callq 0x2c1e9
testl %eax, %eax
js 0x2becb
movq %rbx, %rdi
callq 0x19528
movq %rbp, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x2c04a
testq %r15, %r15
je 0x2bf10
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b4e5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x6c7e1
pushq $-0x1
popq %rax
jmp 0x2bebc
movq 0x1020d9(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e17d(%rip), %rsi     # 0xca066
leaq 0xa7bb6(%rip), %rdx     # 0xd3aa6
leaq 0xa7bdb(%rip), %rcx     # 0xd3ad2
leaq 0xa7881(%rip), %r8      # 0xd377f
movl $0x15f, %r9d            # imm = 0x15F
xorl %eax, %eax
callq 0xb8c0
callq 0xb300
movq 0x1020a1(%rip), %rax    # 0x12dfb8
movq (%rax), %rdi
leaq 0x9e145(%rip), %rsi     # 0xca066
leaq 0xb4114(%rip), %rdx     # 0xe003c
leaq 0xa7ba3(%rip), %rcx     # 0xd3ad2
leaq 0xa7849(%rip), %r8      # 0xd377f
movl $0x17c, %r9d            # imm = 0x17C
jmp 0x2bf04