// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/layout.c
// Function: gt_layout_get_height
int gt_layout_get_height(GtLayout *layout, GtUword *result,
                         GtError *err)
{
  int had_err = 0;
  GtTracklineInfo lines;
  double tmp, head_track_space = HEAD_TRACK_SPACE_DEFAULT;
  bool show_track_captions = true;
  GtUword height, i;
  gt_assert(layout);

  had_err = layout_all_tracks(layout, err);
  if (!had_err) {
    /* get dynamic heights from tracks */
    lines.style = layout->style;
    lines.height = 0;
    if (gt_hashmap_foreach(layout->tracks, add_tracklines, &lines, err) < 0) {
      return -1;
    }
    height = lines.height;

    if (gt_style_get_bool(layout->style,
                          "format","show_track_captions",
                          &show_track_captions,
                          NULL, err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }

    /* add custom track space allotment */
    if (show_track_captions)
    {
      double theight = TEXT_SIZE_DEFAULT,
             captionspace = CAPTION_BAR_SPACE_DEFAULT;
      if (gt_style_get_num(layout->style,
                           "format", "track_caption_font_size",
                           &theight, NULL, err) == GT_STYLE_QUERY_ERROR) {
        return -1;
      }
      if (gt_style_get_num(layout->style,
                           "format", "track_caption_space",
                           &captionspace, NULL, err) == GT_STYLE_QUERY_ERROR) {
        return -1;
      }
      height += gt_array_size(layout->custom_tracks)
                    * (theight + captionspace);
    }

    for (i=0;i<gt_array_size(layout->custom_tracks);i++)
    {
      GtCustomTrack *ct = *(GtCustomTrack**) gt_array_get(layout->custom_tracks,
                                                          i);
      height += gt_custom_track_get_height(ct);
      if (gt_style_get_num(layout->style, "format", "track_vspace", &tmp,
                           NULL, err) == GT_STYLE_QUERY_ERROR) {
        return -1;
      }
      height += tmp;
    }

    /* add header space and footer */
    if (gt_style_get_num(layout->style, "format", "ruler_space",
                         &head_track_space, NULL,
                         err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }
    height += HEADER_SPACE + head_track_space + FOOTER_SPACE;

    *result = height;
    return 0;
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movabsq $0x402e000000000000, %rax # imm = 0x402E000000000000
movq %rax, 0x20(%rsp)
movb $0x1, 0x7(%rsp)
testq %rdi, %rdi
je 0x52002
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rsi
callq 0x51bd8
movl %eax, %ebp
testl %eax, %eax
je 0x51d5c
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rax
leaq 0x28(%rsp), %rdx
movq %rax, 0x8(%rdx)
movq $0x0, (%rdx)
movq 0x20(%r15), %rdi
leaq 0x28d(%rip), %rsi       # 0x52007
movq %r14, %rcx
callq 0x776d9
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x51d4b
movq 0x28(%rsp), %r13
movq (%r15), %rdi
leaq 0x8f3fc(%rip), %rsi     # 0xe1196
leaq 0x99ce3(%rip), %rdx     # 0xeba84
leaq 0x7(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x53bf6
cmpl $0x2, %eax
je 0x51d4b
cmpb $0x1, 0x7(%rsp)
jne 0x51eb6
movabsq $0x4020000000000000, %rax # imm = 0x4020000000000000
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
movq %rax, 0x18(%rsp)
movq (%r15), %rdi
leaq 0x8f3aa(%rip), %rsi     # 0xe1196
leaq 0x99ca5(%rip), %rdx     # 0xeba98
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x51d4b
movq (%r15), %rdi
leaq 0x8f385(%rip), %rsi     # 0xe1196
leaq 0x99c98(%rip), %rdx     # 0xebab0
leaq 0x18(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x51d4b
movq %rbx, 0x10(%rsp)
movq 0x18(%r15), %rdi
callq 0x6f310
movq %rax, %xmm0
movq 0x8f634(%rip), %xmm1    # 0xe1480
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x8f638(%rip), %xmm2    # 0xe1490
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movsd 0x8(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
mulsd %xmm3, %xmm0
movq %r13, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm1
unpckhpd %xmm3, %xmm1            # xmm1 = xmm1[1],xmm3[1]
addsd %xmm3, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x988b7(%rip), %xmm1    # 0xea760
cvttsd2si %xmm1, %r13
andq %rcx, %r13
orq %rax, %r13
jmp 0x51ebb
movq %rbx, 0x10(%rsp)
movq 0x18(%r15), %rdi
callq 0x6f310
testq %rax, %rax
je 0x51f6f
xorl %r12d, %r12d
movq 0x18(%r15), %rdi
movq %r12, %rsi
callq 0x6f037
movq (%rax), %rdi
callq 0x8df26
movq %rax, %rbx
movq (%r15), %rdi
leaq 0x8f2a5(%rip), %rsi     # 0xe1196
leaq 0x99bcc(%rip), %rdx     # 0xebac4
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x51d4b
addq %r13, %rbx
movq %rbx, %xmm0
punpckldq 0x8f55f(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x8f567(%rip), %xmm0    # 0xe1490
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x98811(%rip), %xmm1    # 0xea760
cvttsd2si %xmm1, %r13
andq %rcx, %r13
orq %rax, %r13
incq %r12
movq 0x18(%r15), %rdi
callq 0x6f310
cmpq %rax, %r12
jb 0x51ed0
movq (%r15), %rdi
leaq 0x8f21d(%rip), %rsi     # 0xe1196
leaq 0x99b51(%rip), %rdx     # 0xebad1
leaq 0x20(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
movq 0x10(%rsp), %rsi
je 0x51d4b
movsd 0x20(%rsp), %xmm0
addsd 0x99934(%rip), %xmm0    # 0xeb8e0
addsd 0x99934(%rip), %xmm0    # 0xeb8e8
movq %r13, %xmm1
punpckldq 0x8f4bf(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x8f4c7(%rip), %xmm1    # 0xe1490
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
addsd %xmm0, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x98773(%rip), %xmm2    # 0xea760
cvttsd2si %xmm2, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %rdx, (%rsi)
xorl %ebp, %ebp
jmp 0x51d4b
callq 0x17667