// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/canvas_cairo.c
// Function: gt_canvas_cairo_visit_custom_track
int gt_canvas_cairo_visit_custom_track(GtCanvas *canvas,
                                       GtCustomTrack *ct,
                                       GtError *err)
{
  bool show_track_captions = true;
  double space;
  int had_err = 0;
  GtColor color;
  gt_assert(canvas && ct);

  if (gt_style_get_bool(canvas->pvt->sty,
                        "format", "show_track_captions",
                        &show_track_captions,
                        NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_color(canvas->pvt->sty, "format", "track_title_color",
                         &color, NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }

  if (show_track_captions)
  {
    GtStr *fontfam = NULL;
    double theight = gt_graphics_get_text_height(canvas->pvt->g),
           captionspace = CAPTION_BAR_SPACE_DEFAULT;
    if (gt_style_get_num(canvas->pvt->sty,
                         "format", "track_caption_font_size",
                         &theight, NULL, err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }
    fontfam = gt_str_new_cstr("Sans");
    if (gt_style_get_str(canvas->pvt->sty,
                         "format", "track_caption_font_family",
                         fontfam, NULL, err ) == GT_STYLE_QUERY_ERROR) {
      gt_str_delete(fontfam);
      return -1;
    }
    /* draw track title */
    gt_graphics_set_font(canvas->pvt->g,
                           gt_str_get(fontfam),
                           SLANT_NORMAL,
                           WEIGHT_NORMAL,
                           theight);
    gt_graphics_draw_colored_text(canvas->pvt->g,
                                  canvas->pvt->margins,
                                  canvas->pvt->y,
                                  color,
                                  gt_custom_track_get_title(ct));
    if (gt_style_get_num(canvas->pvt->sty,
                         "format", "track_caption_space",
                         &captionspace, NULL, err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }
    canvas->pvt->y += theight + captionspace;
    gt_str_delete(fontfam);
  }

  /* call rendering function */
  had_err = gt_custom_track_render(ct,
                                   canvas->pvt->g,
                                   canvas->pvt->y,
                                   canvas->pvt->viewrange,
                                   canvas->pvt->sty,
                                   err);
  canvas->pvt->y += gt_custom_track_get_height(ct);

  /* put spacers after track */
  space = TRACK_VSPACE_DEFAULT;
  if (gt_style_get_num(canvas->pvt->sty, "format", "track_vspace", &space,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  canvas->pvt->y += space;

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movb $0x1, 0x27(%rsp)
testq %rdi, %rdi
je 0x8d3fc
movq %rsi, %r15
testq %rsi, %rsi
je 0x8d3fc
movq %rdx, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x38(%rax), %rdi
leaq 0x5400e(%rip), %rsi     # 0xe1196
leaq 0x5e8f5(%rip), %rdx     # 0xeba84
leaq 0x27(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x53bf6
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
je 0x8d3eb
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x53fda(%rip), %rsi     # 0xe1196
leaq 0x69191(%rip), %rdx     # 0xf6354
leaq 0x48(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x531a5
cmpl $0x2, %eax
je 0x8d3eb
cmpb $0x1, 0x27(%rsp)
jne 0x8d341
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
callq 0x4de34
leaq 0x28(%rsp), %rcx
movsd %xmm0, (%rcx)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
movq %rax, 0x30(%rsp)
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x53f7b(%rip), %rsi     # 0xe1196
leaq 0x5e876(%rip), %rdx     # 0xeba98
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8d3eb
leaq 0x5fa32(%rip), %rdi     # 0xecc6f
callq 0x3b785
movq %rax, %r12
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x53f42(%rip), %rsi     # 0xe1196
leaq 0x6911f(%rip), %rdx     # 0xf637a
movq %r12, %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5363b
cmpl $0x2, %eax
jne 0x8d27b
movq %r12, %rdi
callq 0x3c87b
jmp 0x8d3eb
movq 0x8(%rbx), %rax
movq 0x58(%rax), %r13
movq %r12, %rdi
callq 0x3bb5d
movsd 0x28(%rsp), %xmm0
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4df3a
movq 0x8(%rbx), %rax
movq 0x58(%rax), %r13
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x8df3c
movups 0x48(%rsp), %xmm0
movups 0x58(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r13, %rdi
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movq %rax, %rsi
callq 0x4ddb2
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x53e97(%rip), %rsi     # 0xe1196
leaq 0x5e7aa(%rip), %rdx     # 0xebab0
leaq 0x30(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8d3eb
movsd 0x28(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movq 0x8(%rbx), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movq %r12, %rdi
callq 0x3c87b
movq 0x8(%rbx), %rax
cvttsd2si 0x18(%rax), %rdx
movq 0x58(%rax), %rsi
movq 0x38(%rax), %r9
movq (%rax), %rcx
movq 0x8(%rax), %r8
movq %r14, (%rsp)
movq %r15, %rdi
callq 0x8dee5
movl %eax, %r12d
movq %r15, %rdi
callq 0x8df26
movq %rax, %xmm0
punpckldq 0x54102(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5410a(%rip), %xmm0    # 0xe1490
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq 0x8(%rbx), %rax
addsd 0x18(%rax), %xmm1
movsd %xmm1, 0x18(%rax)
movabsq $0x402e000000000000, %rdx # imm = 0x402E000000000000
leaq 0x28(%rsp), %rcx
movq %rdx, (%rcx)
movq 0x38(%rax), %rdi
leaq 0x53dd9(%rip), %rsi     # 0xe1196
leaq 0x5e700(%rip), %rdx     # 0xebac4
xorl %r8d, %r8d
movq %r14, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8d3eb
movsd 0x28(%rsp), %xmm0
movq 0x8(%rbx), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movl %r12d, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x215dc