// File: /workspace/github_c_makefile_star2_O2/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 0x6e5c3
movq %rsi, %r15
testq %rsi, %rsi
je 0x6e5c3
movq %rdx, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x38(%rax), %rdi
leaq 0x5be45(%rip), %rsi     # 0xca196
leaq 0x6671c(%rip), %rdx     # 0xd4a74
leaq 0x27(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x3440a
pushq $-0x1
popq %rbp
cmpl $0x2, %eax
je 0x6e5b2
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x5be13(%rip), %rsi     # 0xca196
leaq 0x7131a(%rip), %rdx     # 0xdf6a4
leaq 0x48(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x335b5
cmpl $0x2, %eax
je 0x6e5b2
cmpb $0x1, 0x27(%rsp)
jne 0x6e508
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
callq 0x2c939
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 0x5bdb4(%rip), %rsi     # 0xca196
leaq 0x6669f(%rip), %rdx     # 0xd4a88
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x6e5b2
leaq 0x6785b(%rip), %rdi     # 0xd5c5f
callq 0x13da9
movq %rax, %r12
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x5bd7b(%rip), %rsi     # 0xca196
leaq 0x712a8(%rip), %rdx     # 0xdf6ca
movq %r12, %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33b98
cmpl $0x2, %eax
jne 0x6e442
movq %r12, %rdi
callq 0x152db
jmp 0x6e5b2
movq 0x8(%rbx), %rax
movq 0x58(%rax), %r13
movq %r12, %rdi
callq 0x143d2
movsd 0x28(%rsp), %xmm0
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2cad8
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 0x6f1f8
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 0x2c884
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x5bcd0(%rip), %rsi     # 0xca196
leaq 0x665d3(%rip), %rdx     # 0xd4aa0
leaq 0x30(%rsp), %rcx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x6e5b2
movsd 0x28(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movq 0x8(%rbx), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movq %r12, %rdi
callq 0x152db
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 0x6f10e
movl %eax, %r12d
movq %r15, %rdi
callq 0x6f1b1
movq %rax, %xmm0
punpckldq 0x5bf3b(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5bf43(%rip), %xmm0    # 0xca490
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 0x5bc12(%rip), %rsi     # 0xca196
leaq 0x66529(%rip), %rdx     # 0xd4ab4
xorl %r8d, %r8d
movq %r14, %r9
callq 0x33ff8
cmpl $0x2, %eax
je 0x6e5b2
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
movq 0xbf9ee(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x5ba92(%rip), %rsi     # 0xca066
leaq 0x6500d(%rip), %rdx     # 0xd35e8
leaq 0x71301(%rip), %rcx     # 0xdf8e3
leaq 0x71097(%rip), %r8      # 0xdf680
movl $0x2bc, %r9d            # imm = 0x2BC
xorl %eax, %eax
callq 0xb8c0
callq 0xb300