// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xb8, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movq %rdx, 0x98(%rsp)
movb $0x1, 0x97(%rsp)
movl $0x0, 0x84(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0xb4f78
cmpq $0x0, 0xa0(%rsp)
jne 0xb4fb0
movq 0xff059(%rip), %rax     # 0x1b3fd8
movq (%rax), %rdi
leaq 0xa90dd(%rip), %rsi     # 0x15e066
leaq 0xb2840(%rip), %rdx     # 0x1677d0
leaq 0xbf784(%rip), %rcx     # 0x17471b
leaq 0xbf51a(%rip), %r8      # 0x1744b8
movl $0x2bc, %r9d            # imm = 0x2BC
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xb4fb2
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x98(%rsp), %r9
leaq 0xa91c5(%rip), %rsi     # 0x15e196
leaq 0xb3cf4(%rip), %rdx     # 0x168ccc
leaq 0x97(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x4a140
cmpl $0x2, %eax
jne 0xb4fff
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb538b
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x98(%rsp), %r9
leaq 0xa9178(%rip), %rsi     # 0x15e196
leaq 0xbf4b7(%rip), %rdx     # 0x1744dc
leaq 0x60(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x48bc0
cmpl $0x2, %eax
jne 0xb5049
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb538b
testb $0x1, 0x97(%rsp)
je 0xb5274
movq $0x0, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rdi
callq 0x3ebd0
movsd %xmm0, 0x50(%rsp)
movsd 0xb3a9d(%rip), %xmm0    # 0x168b20
movsd %xmm0, 0x48(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x98(%rsp), %r9
leaq 0xa90ee(%rip), %rsi     # 0x15e196
leaq 0xb3c31(%rip), %rdx     # 0x168ce0
leaq 0x50(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0xb50d3
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb538b
leaq 0xb4dea(%rip), %rdi     # 0x169ec4
callq 0x18f70
movq %rax, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x58(%rsp), %rcx
movq 0x98(%rsp), %r9
leaq 0xa908e(%rip), %rsi     # 0x15e196
leaq 0xbf3f3(%rip), %rdx     # 0x174502
xorl %eax, %eax
movl %eax, %r8d
callq 0x494c0
cmpl $0x2, %eax
jne 0xb5138
movq 0x58(%rsp), %rdi
callq 0x1afc0
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb538b
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rdi
callq 0x19940
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movsd 0x50(%rsp), %xmm0
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x3edf0
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xb67f0
movq 0x30(%rsp), %rdi
movsd 0x38(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
movq %rax, %rsi
leaq 0x60(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x3eae0
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x98(%rsp), %r9
leaq 0xa8f79(%rip), %rsi     # 0x15e196
leaq 0xb3ad4(%rip), %rdx     # 0x168cf8
leaq 0x48(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0xb5248
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb538b
movsd 0x50(%rsp), %xmm0
addsd 0x48(%rsp), %xmm0
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movq 0x58(%rsp), %rdi
callq 0x1afc0
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rsi
cvttsd2si 0x18(%rax), %rcx
movl %ecx, %edx
movq 0x38(%rax), %r9
movq 0x98(%rsp), %r10
movq (%rax), %rcx
movq 0x8(%rax), %r8
movq %rsp, %rax
movq %r10, (%rax)
callq 0xb6640
movl %eax, 0x84(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xb6780
movq %rax, %xmm0
movaps 0xa91ae(%rip), %xmm1    # 0x15e480
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xa91b2(%rip), %xmm1    # 0x15e490
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movsd 0xb380d(%rip), %xmm0    # 0x168b18
movsd %xmm0, 0x88(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x98(%rsp), %r9
leaq 0xa8e63(%rip), %rsi     # 0x15e196
leaq 0xb39d2(%rip), %rdx     # 0x168d0c
leaq 0x88(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0xb535e
movl $0xffffffff, 0xb4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb538b
movsd 0x88(%rsp), %xmm0
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movl 0x84(%rsp), %eax
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
addq $0xb8, %rsp
retq
nopw (%rax,%rax)