// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/track.c
// Function: gt_track_get_height
int gt_track_get_height(const GtTrack *track, double *height,
                        const GtStyle *sty, GtError *err)
{
  GtUword i;
  double track_height = 0,
         bheight = TEXT_SIZE_DEFAULT,
         theight = TEXT_SIZE_DEFAULT,
         tcaptionspace = CAPTION_BAR_SPACE_DEFAULT,
         bcaptionspace = CAPTION_BAR_SPACE_DEFAULT,
         tmp = TRACK_VSPACE_DEFAULT;
  bool show_track_captions = true,
       show_block_captions = true;
  gt_assert(track && sty);
  if (gt_style_get_num(sty, "format", "block_caption_font_size", &bheight,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(sty, "format", "track_caption_font_size", &theight,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(sty, "format", "track_caption_space", &tcaptionspace,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(sty, "format", "block_caption_space", &bcaptionspace,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(sty, "format", "block_caption_font_size", &bheight,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(sty, "format", "track_caption_font_size", &theight,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  for (i = 0; i < gt_array_size(track->lines); i++)
  {
    double itmp = BAR_VSPACE_DEFAULT,
           tmp = 0.0;
    int rval;
    GtLine *line;

    line = *(GtLine**) gt_array_get(track->lines, i);
    rval = gt_line_get_height(line, &tmp, sty, err);
    if (rval < 0)
      return -1;
    track_height += tmp;
    show_block_captions = true;

    if (gt_style_get_bool(sty,
                          "format","show_block_captions",
                          &show_block_captions,
                          NULL, err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }

    /* add caption space if necessary */
    if (gt_line_has_captions(line) && show_block_captions)
    {
      track_height += bheight + bcaptionspace;
    }
    /* add vertical spacer */
    if (gt_style_get_num(sty,
                         "format", "bar_vspace",
                         &itmp, NULL, err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }
    track_height += itmp;
  }

  /* determine display of track captions */
  if (gt_style_get_bool(sty,
                        "format","show_track_captions",
                        &show_track_captions,
                        NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }

  /* add track caption height and spacer */
  if (show_track_captions)
    track_height += theight + tcaptionspace;
  if (gt_style_get_num(sty,
                       "format", "track_vspace",
                       &tmp, NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  track_height += tmp;

  *height = track_height;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movabsq $0x4020000000000000, %rax # imm = 0x4020000000000000
movq %rax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
movq %rax, 0x50(%rsp)
movq %rax, 0x48(%rsp)
movabsq $0x402e000000000000, %rax # imm = 0x402E000000000000
movq %rax, 0x40(%rsp)
movb $0x1, %al
movb %al, 0xf(%rsp)
movb %al, 0xe(%rsp)
testq %rdi, %rdi
je 0x567b1
movq %rdx, %r15
testq %rdx, %rdx
je 0x567b1
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x8acd8(%rip), %rsi     # 0xe1196
leaq 0x967ff(%rip), %rdx     # 0xeccc4
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
je 0x567a0
leaq 0x8aca9(%rip), %rsi     # 0xe1196
leaq 0x955f4(%rip), %rdx     # 0xebae8
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x567a0
leaq 0x8ac7f(%rip), %rsi     # 0xe1196
leaq 0x955e2(%rip), %rdx     # 0xebb00
leaq 0x50(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x567a0
leaq 0x8ac55(%rip), %rsi     # 0xe1196
leaq 0x968d7(%rip), %rdx     # 0xece1f
leaq 0x48(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x567a0
leaq 0x8ac2b(%rip), %rsi     # 0xe1196
leaq 0x96752(%rip), %rdx     # 0xeccc4
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x567a0
leaq 0x8ac01(%rip), %rsi     # 0xe1196
leaq 0x9554c(%rip), %rdx     # 0xebae8
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x567a0
movq %rbx, 0x28(%rsp)
movq 0x30(%r12), %rdi
callq 0x6ecda
xorpd %xmm0, %xmm0
testq %rax, %rax
je 0x566fa
movsd %xmm0, 0x10(%rsp)
xorl %r13d, %r13d
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x30(%r12), %rdi
movq %r13, %rsi
callq 0x6e9fa
movq (%rax), %rbx
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x8ebfa
testl %eax, %eax
js 0x56663
movsd 0x10(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movb $0x1, 0xe(%rsp)
movq %r15, %rdi
leaq 0x8ab59(%rip), %rsi     # 0xe1196
leaq 0x94461(%rip), %rdx     # 0xeaaa5
leaq 0xe(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5488a
cmpl $0x2, %eax
jne 0x56667
movsd 0x10(%rsp), %xmm0
xorl %ebx, %ebx
jmp 0x566d4
xorl %ebx, %ebx
jmp 0x566be
movq %rbx, %rdi
callq 0x8eb4b
testb %al, %al
je 0x56696
cmpb $0x1, 0xe(%rsp)
jne 0x56696
movsd 0x20(%rsp), %xmm0
addsd 0x48(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
xorl %ebx, %ebx
movq %r15, %rdi
leaq 0x8aaf4(%rip), %rsi     # 0xe1196
leaq 0x9678a(%rip), %rdx     # 0xece33
leaq 0x38(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
jne 0x566c6
movsd 0x10(%rsp), %xmm0
jmp 0x566d4
movsd 0x10(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
movb $0x1, %bl
testb %bl, %bl
je 0x567a0
movsd %xmm0, 0x10(%rsp)
incq %r13
movq 0x30(%r12), %rdi
callq 0x6ecda
cmpq %rax, %r13
jb 0x565dd
jmp 0x56700
movsd %xmm0, 0x10(%rsp)
leaq 0x8aa8f(%rip), %rsi     # 0xe1196
leaq 0x953c6(%rip), %rdx     # 0xebad4
leaq 0xf(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5488a
cmpl $0x2, %eax
je 0x567a0
movb 0xf(%rsp), %bl
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
leaq 0x8aa4d(%rip), %rsi     # 0xe1196
leaq 0x953c4(%rip), %rdx     # 0xebb14
leaq 0x40(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x567a0
testb %bl, %bl
jne 0x56779
movq 0x28(%rsp), %rax
movsd 0x10(%rsp), %xmm0
jmp 0x56794
movsd 0x60(%rsp), %xmm1
addsd 0x58(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
addsd %xmm1, %xmm0
movq 0x28(%rsp), %rax
addsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x18c32