// File: /workspace/github_c_makefile_star2_O2/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 0x366ce
movq %rdx, %r15
testq %rdx, %rdx
je 0x366ce
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x93d83(%rip), %rsi     # 0xca196
leaq 0x9f84a(%rip), %rdx     # 0xd5c64
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
pushq $-0x1
popq %rbp
cmpl $0x2, %eax
je 0x364fb
leaq 0x93d56(%rip), %rsi     # 0xca196
leaq 0x9e641(%rip), %rdx     # 0xd4a88
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x364fb
leaq 0x93d2c(%rip), %rsi     # 0xca196
leaq 0x9e62f(%rip), %rdx     # 0xd4aa0
leaq 0x50(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x364fb
leaq 0x93d06(%rip), %rsi     # 0xca196
leaq 0x9f930(%rip), %rdx     # 0xd5dc7
leaq 0x48(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x364fb
leaq 0x93ce0(%rip), %rsi     # 0xca196
leaq 0x9f7a7(%rip), %rdx     # 0xd5c64
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x364fb
leaq 0x93cba(%rip), %rsi     # 0xca196
leaq 0x9e5a5(%rip), %rdx     # 0xd4a88
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
jne 0x3650c
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, 0x28(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r13d, %r13d
movq 0x30(%r12), %rdi
callq 0x4b988
cmpq %rax, %r13
jae 0x36621
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0x38(%rsp)
andq $0x0, 0x30(%rsp)
movq 0x30(%r12), %rdi
movq %r13, %rsi
callq 0x4b48e
movq (%rax), %rbx
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x6fcf5
testl %eax, %eax
js 0x364fb
movsd 0x10(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movb $0x1, 0xe(%rsp)
movq %r15, %rdi
leaq 0x93c08(%rip), %rsi     # 0xca196
leaq 0x9d4b0(%rip), %rdx     # 0xd3a45
leaq 0xe(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x3440a
cmpl $0x2, %eax
je 0x364fb
movq %rbx, %rdi
callq 0x6fbba
testb %al, %al
je 0x365dd
cmpb $0x1, 0xe(%rsp)
jne 0x365dd
movsd 0x20(%rsp), %xmm0
addsd 0x48(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq %r15, %rdi
leaq 0x93baf(%rip), %rsi     # 0xca196
leaq 0x9f7ed(%rip), %rdx     # 0xd5ddb
leaq 0x38(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x364fb
movsd 0x10(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
incq %r13
jmp 0x3651e
leaq 0x93b6e(%rip), %rsi     # 0xca196
leaq 0x9e445(%rip), %rdx     # 0xd4a74
leaq 0xf(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x3440a
cmpl $0x2, %eax
je 0x364fb
movb 0xf(%rsp), %bl
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
leaq 0x93b28(%rip), %rsi     # 0xca196
leaq 0x9e43f(%rip), %rdx     # 0xd4ab4
leaq 0x40(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x364fb
testb %bl, %bl
jne 0x366a2
movq 0x28(%rsp), %rax
movsd 0x10(%rsp), %xmm0
jmp 0x366bd
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
jmp 0x364fb
movq 0xf78e3(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x93987(%rip), %rsi     # 0xca066
leaq 0x9f6c0(%rip), %rdx     # 0xd5da6
leaq 0x9f6c6(%rip), %rcx     # 0xd5db3
leaq 0x9f5e5(%rip), %r8      # 0xd5cd9
movl $0xbc, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300