// File: /workspace/github_c_makefile_star2_O3/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 0x559b2
movq %rdx, %r15
testq %rdx, %rdx
je 0x559b2
movq %rcx, %r14
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x8bac1(%rip), %rsi     # 0xe1196
leaq 0x97598(%rip), %rdx     # 0xecc74
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
je 0x559a1
leaq 0x8ba92(%rip), %rsi     # 0xe1196
leaq 0x9638d(%rip), %rdx     # 0xeba98
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
leaq 0x8ba68(%rip), %rsi     # 0xe1196
leaq 0x9637b(%rip), %rdx     # 0xebab0
leaq 0x50(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
leaq 0x8ba3e(%rip), %rsi     # 0xe1196
leaq 0x97678(%rip), %rdx     # 0xecdd7
leaq 0x48(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
leaq 0x8ba14(%rip), %rsi     # 0xe1196
leaq 0x974eb(%rip), %rdx     # 0xecc74
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
leaq 0x8b9ea(%rip), %rsi     # 0xe1196
leaq 0x962e5(%rip), %rdx     # 0xeba98
leaq 0x18(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
movq %rbx, 0x28(%rsp)
movq 0x30(%r12), %rdi
callq 0x6f310
xorpd %xmm0, %xmm0
testq %rax, %rax
je 0x558fb
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 0x6f037
movq (%rax), %rbx
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x8e6cf
testl %eax, %eax
js 0x559a1
movsd 0x10(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movb $0x1, 0xe(%rsp)
movq %r15, %rdi
leaq 0x8b93e(%rip), %rsi     # 0xe1196
leaq 0x951f6(%rip), %rdx     # 0xeaa55
leaq 0xe(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x53bf6
cmpl $0x2, %eax
je 0x559a1
movq %rbx, %rdi
callq 0x8e62b
testb %al, %al
je 0x558a7
cmpb $0x1, 0xe(%rsp)
jne 0x558a7
movsd 0x20(%rsp), %xmm0
addsd 0x48(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq %r15, %rdi
leaq 0x8b8e5(%rip), %rsi     # 0xe1196
leaq 0x97533(%rip), %rdx     # 0xecdeb
leaq 0x38(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
movsd 0x10(%rsp), %xmm0
addsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
incq %r13
movq 0x30(%r12), %rdi
callq 0x6f310
cmpq %rax, %r13
jb 0x557f4
jmp 0x55901
movsd %xmm0, 0x10(%rsp)
leaq 0x8b88e(%rip), %rsi     # 0xe1196
leaq 0x96175(%rip), %rdx     # 0xeba84
leaq 0xf(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x53bf6
cmpl $0x2, %eax
je 0x559a1
movb 0xf(%rsp), %bl
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
leaq 0x8b84c(%rip), %rsi     # 0xe1196
leaq 0x96173(%rip), %rdx     # 0xebac4
leaq 0x40(%rsp), %rcx
movq %r15, %rdi
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x559a1
testb %bl, %bl
jne 0x5597a
movq 0x28(%rsp), %rax
movsd 0x10(%rsp), %xmm0
jmp 0x55995
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 0x18ae0