// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq $-0x1, %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x3d4db
cmpq $0x0, 0x40(%rsp)
je 0x3d4db
movq 0x40(%rsp), %rdi
callq 0x217b0
testb $0x1, %al
jne 0x3d513
movq 0x176af6(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x120b7a(%rip), %rsi    # 0x15e066
leaq 0x12a7e0(%rip), %rdx    # 0x167cd3
leaq 0x12a805(%rip), %rcx    # 0x167cff
leaq 0x12a456(%rip), %r8     # 0x167957
movl $0x15f, %r9d            # imm = 0x15F
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x3d515
movq 0x40(%rsp), %rdi
callq 0x21c40
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
callq 0x211d0
movq %rax, %rsi
movq 0x20(%rsp), %rdx
leaq 0x12a7cd(%rip), %rdi    # 0x167d0a
movb $0x0, %al
callq 0xc930
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x3d8f0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rdi
callq 0x211d0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq 0x20(%rsp), %rdx
callq 0x3d9e0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x3d66f
movq 0x38(%rsp), %rdi
callq 0xb0640
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x211d0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xb1080
movq 0x38(%rsp), %rdi
callq 0x21880
testb $0x1, %al
jne 0x3d5cf
jmp 0x3d60a
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x3e0b0
cmpl $0x0, %eax
jge 0x3d608
movq 0x28(%rsp), %rdi
callq 0xb21b0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x3d6ca
jmp 0x3d646
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
callq 0x3e0b0
cmpl $0x0, %eax
jge 0x3d644
movq 0x28(%rsp), %rdi
callq 0xb21b0
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x3d6ca
jmp 0x3d646
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rdi
callq 0x211d0
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x3db00
jmp 0x3d671
cmpq $0x0, 0x28(%rsp)
jne 0x3d6b1
movq 0x176958(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1209dc(%rip), %rsi    # 0x15e066
leaq 0x1377fe(%rip), %rdx    # 0x174e8f
leaq 0x12a667(%rip), %rcx    # 0x167cff
leaq 0x12a2b8(%rip), %r8     # 0x167957
movl $0x17c, %r9d            # imm = 0x17C
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x3d6b3
movq 0x28(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xb0730
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)