// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/canvas_cairo.c
// Function: gt_canvas_cairo_visit_track_pre
int gt_canvas_cairo_visit_track_pre(GtCanvas *canvas, GtTrack *track,
                                    GtError *err)
{
  int had_err = 0;
  GtUword exceeded;
  bool show_track_captions = true;
  GtColor color;

  gt_assert(canvas && track);

  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;
  }

  /* debug */
  gt_log_log("processing track %s", gt_str_get(gt_track_get_title(track)));

  if (show_track_captions)
  {
    double theight      = gt_graphics_get_text_height(canvas->pvt->g),
           captionspace = CAPTION_BAR_SPACE_DEFAULT;
    GtStr *fontfam = NULL;
    if (gt_style_get_num(canvas->pvt->sty,
                          "format", "track_caption_font_size",
                          &theight, NULL, err) == GT_STYLE_QUERY_ERROR) {
      return -1;
    }
    if (gt_style_get_num(canvas->pvt->sty,
                         "format", "track_caption_space",
                         &captionspace, 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;
    }
    gt_graphics_set_font(canvas->pvt->g,
                         gt_str_get(fontfam),
                         SLANT_NORMAL,
                         WEIGHT_NORMAL,
                         theight);
    canvas->pvt->y += theight;
    /* draw track title */
    gt_graphics_draw_colored_text(canvas->pvt->g,
                                  canvas->pvt->margins,
                                  canvas->pvt->y,
                                  color,
                                  gt_str_get(gt_track_get_title(track)));
    /* draw 'line maximum exceeded' message */
    if ((exceeded = gt_track_get_number_of_discarded_blocks(track)) > 0)
    {
      char buf[BUFSIZ];
      const char *msg;
      double width;
      GtColor red;
      red.red   = LINE_EXCEEDED_MSG_R;
      red.green = LINE_EXCEEDED_MSG_G;
      red.blue  = LINE_EXCEEDED_MSG_B;
      red.alpha = 1.0;
      if (exceeded == 1) {
        msg = "(1 block not shown due to exceeded line limit)";
        strncpy(buf, msg, BUFSIZ);
      } else {
        msg = "("GT_WU" blocks not shown due to exceeded line limit)";
        /*@ignore@*/
        snprintf(buf, BUFSIZ, msg, exceeded);
        /*@end@*/
      }
      width = gt_graphics_get_text_width(canvas->pvt->g,
                                         gt_str_get(gt_track_get_title(track)));
      gt_graphics_draw_colored_text(canvas->pvt->g,
                                    canvas->pvt->margins+width+10.0,
                                    canvas->pvt->y,
                                    red,
                                    buf);
    }
    canvas->pvt->y += captionspace;
    gt_str_delete(fontfam);
  }
  return had_err;
}

// Assembly:
subq $0x20f8, %rsp           # imm = 0x20F8
movq %rdi, 0x20e8(%rsp)
movq %rsi, 0x20e0(%rsp)
movq %rdx, 0x20d8(%rsp)
movl $0x0, 0x20d4(%rsp)
movb $0x1, 0x20c7(%rsp)
cmpq $0x0, 0x20e8(%rsp)
je 0xb2418
cmpq $0x0, 0x20e0(%rsp)
jne 0xb2450
movq 0x101bb9(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xabc3d(%rip), %rsi     # 0x15e066
leaq 0xb52c9(%rip), %rdx     # 0x1676f9
leaq 0xc2061(%rip), %rcx     # 0x174498
leaq 0xc207a(%rip), %r8      # 0x1744b8
movl $0x48, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0xb2452
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x20d8(%rsp), %r9
leaq 0xabd25(%rip), %rsi     # 0x15e196
leaq 0xb6854(%rip), %rdx     # 0x168ccc
leaq 0x20c7(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x4a140
cmpl $0x2, %eax
jne 0xb249f
movl $0xffffffff, 0x20f4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb28fc
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x20d8(%rsp), %r9
leaq 0xabcd8(%rip), %rsi     # 0x15e196
leaq 0xc2017(%rip), %rdx     # 0x1744dc
leaq 0x20a0(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x48bc0
cmpl $0x2, %eax
jne 0xb24ec
movl $0xffffffff, 0x20f4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb28fc
movq 0x20e0(%rsp), %rdi
callq 0x4cf40
movq %rax, %rdi
callq 0x19940
movq %rax, %rsi
leaq 0xc1fe3(%rip), %rdi     # 0x1744ee
movb $0x0, %al
callq 0xc930
testb $0x1, 0x20c7(%rsp)
je 0xb28ee
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rdi
callq 0x3ebd0
movsd %xmm0, 0x2098(%rsp)
movsd 0xb65da(%rip), %xmm0    # 0x168b20
movsd %xmm0, 0x2090(%rsp)
movq $0x0, 0x2088(%rsp)
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x20d8(%rsp), %r9
leaq 0xabc1c(%rip), %rsi     # 0x15e196
leaq 0xb675f(%rip), %rdx     # 0x168ce0
leaq 0x2098(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0xb25a8
movl $0xffffffff, 0x20f4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb28fc
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x20d8(%rsp), %r9
leaq 0xabbcf(%rip), %rsi     # 0x15e196
leaq 0xb672a(%rip), %rdx     # 0x168cf8
leaq 0x2090(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0xb25f5
movl $0xffffffff, 0x20f4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb28fc
leaq 0xb78c8(%rip), %rdi     # 0x169ec4
callq 0x18f70
movq %rax, 0x2088(%rsp)
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x38(%rax), %rdi
movq 0x2088(%rsp), %rcx
movq 0x20d8(%rsp), %r9
leaq 0xabb66(%rip), %rsi     # 0x15e196
leaq 0xc1ecb(%rip), %rdx     # 0x174502
xorl %eax, %eax
movl %eax, %r8d
callq 0x494c0
cmpl $0x2, %eax
jne 0xb2663
movq 0x2088(%rsp), %rdi
callq 0x1afc0
movl $0xffffffff, 0x20f4(%rsp) # imm = 0xFFFFFFFF
jmp 0xb28fc
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x2088(%rsp), %rdi
callq 0x19940
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movsd 0x2098(%rsp), %xmm0
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x3edf0
movsd 0x2098(%rsp), %xmm0
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x20e0(%rsp), %rdi
callq 0x4cf40
movq %rax, %rdi
callq 0x19940
movq 0x38(%rsp), %rdi
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movq %rax, %rsi
leaq 0x20a0(%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 0x20e0(%rsp), %rdi
callq 0x4cb60
movq %rax, 0x20c8(%rsp)
cmpq $0x0, %rax
jbe 0xb28c2
movsd 0xc1cd8(%rip), %xmm0    # 0x174458
movsd %xmm0, 0x50(%rsp)
movsd 0xb68ea(%rip), %xmm0    # 0x169078
movsd %xmm0, 0x58(%rsp)
movsd 0xb68dc(%rip), %xmm0    # 0x169078
movsd %xmm0, 0x60(%rsp)
movsd 0xac05e(%rip), %xmm0    # 0x15e808
movsd %xmm0, 0x68(%rsp)
cmpq $0x1, 0x20c8(%rsp)
jne 0xb27e0
leaq 0xc1d5a(%rip), %rax     # 0x17451c
movq %rax, 0x78(%rsp)
leaq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0xb2b0
jmp 0xb280d
leaq 0xc1d64(%rip), %rax     # 0x17454b
movq %rax, 0x78(%rsp)
leaq 0x80(%rsp), %rdi
movq 0x78(%rsp), %rdx
movq 0x20c8(%rsp), %rcx
movl $0x2000, %esi           # imm = 0x2000
movb $0x0, %al
callq 0xb9d0
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x20e0(%rsp), %rdi
callq 0x4cf40
movq %rax, %rdi
callq 0x19940
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x3ec70
movsd %xmm0, 0x70(%rsp)
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rdi
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x20(%rax), %xmm0
addsd 0x70(%rsp), %xmm0
movsd 0xb4f97(%rip), %xmm1    # 0x167810
addsd %xmm1, %xmm0
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x18(%rax), %xmm1
leaq 0x80(%rsp), %rsi
leaq 0x50(%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
movsd 0x2090(%rsp), %xmm0
movq 0x20e8(%rsp), %rax
movq 0x8(%rax), %rax
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movq 0x2088(%rsp), %rdi
callq 0x1afc0
movl 0x20d4(%rsp), %eax
movl %eax, 0x20f4(%rsp)
movl 0x20f4(%rsp), %eax
addq $0x20f8, %rsp           # imm = 0x20F8
retq
nopl (%rax,%rax)