// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/diagram.c
// Function: gt_diagram_build
static int gt_diagram_build(GtDiagram *diagram, GtError *err)
{
  GtUword i = 0;
  int had_err = 0;
  NodeTraverseInfo nti;
  gt_assert(diagram);

  nti.diagram = diagram;
  nti.err = err;
  /* clear caches */
  gt_hashmap_reset(diagram->collapsingtypes);
  gt_hashmap_reset(diagram->groupedtypes);
  gt_hashmap_reset(diagram->caption_display_status);

  if (!diagram->blocks)
  {
    gt_hashmap_reset(diagram->nodeinfo);
    /* do node traversal for each root feature */
    for (i = 0; i < gt_array_size(diagram->features); i++)
    {
      GtFeatureNode *current_root;
      current_root = *(GtFeatureNode**) gt_array_get(diagram->features,i);
      had_err = traverse_genome_nodes(current_root, &nti);
      if (had_err)
        return -1;
    }
    diagram->blocks = gt_hashmap_new(GT_HASH_STRING, gt_free_func,
                                     (GtFree) blocklist_delete);
    /* collect blocks from nodeinfo structures */
    had_err = gt_hashmap_foreach_ordered(diagram->nodeinfo,
                                         collect_blocks,
                                         diagram,
                                         (GtCompare) gt_genome_node_cmp,
                                         NULL);
    gt_assert(!had_err); /* collect_blocks() is sane */
  }

  return had_err;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x3bb9f
movq 0x17846a(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1224ee(%rip), %rsi    # 0x15e066
leaq 0x13fef6(%rip), %rdx    # 0x17ba75
leaq 0x12bf5c(%rip), %rcx    # 0x167ae2
leaq 0x12bdca(%rip), %r8     # 0x167957
movl $0x307, %r9d            # imm = 0x307
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x3bba1
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x867b0
movq 0x48(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x867b0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x867b0
movq 0x48(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x3bd0e
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x867b0
movq $0x0, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0x76490
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x3bc7e
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0x75c80
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3c1b0
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x3bc6c
movl $0xffffffff, 0x54(%rsp) # imm = 0xFFFFFFFF
jmp 0x3bd16
jmp 0x3bc6e
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x3bc05
movl $0x1, %edi
leaq -0x2e06a(%rip), %rsi    # 0xdc20
leaq 0x5ff(%rip), %rdx       # 0x3c290
callq 0x86190
movq %rax, %rcx
movq 0x48(%rsp), %rax
movq %rcx, (%rax)
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x48(%rsp), %rdx
leaq 0x65a(%rip), %rsi       # 0x3c310
leaq -0x16a0d(%rip), %rcx    # 0x252b0
xorl %eax, %eax
movl %eax, %r8d
callq 0x865b0
movl %eax, 0x34(%rsp)
cmpl $0x0, 0x34(%rsp)
je 0x3bd0a
movq 0x1782ff(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x122383(%rip), %rsi    # 0x15e066
leaq 0x12b2d4(%rip), %rdx    # 0x166fbe
leaq 0x12bdf1(%rip), %rcx    # 0x167ae2
leaq 0x12bc5f(%rip), %r8     # 0x167957
movl $0x324, %r9d            # imm = 0x324
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x3bd0c
jmp 0x3bd0e
movl 0x34(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nop