// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/canvas_cairo.c
// Function: gt_canvas_cairo_visit_block
int gt_canvas_cairo_visit_block(GtCanvas *canvas, GtBlock *block,
                                GtError *err)
{
  int had_err = 0, arrow_status = ARROW_NONE;
  GtRange block_range;
  GtDrawingRange draw_range;
  GtColor grey, fillcolor, strokecolor;
  double block_start,
         block_width,
         bar_height = BAR_HEIGHT_DEFAULT,
         min_len_block = MIN_LEN_BLOCK_DEFAULT,
         arrow_width = ARROW_WIDTH_DEFAULT,
         stroke_width = STROKE_WIDTH_DEFAULT;
  const char *caption, *btype;
  GtStrand strand;
  double maxbarheight;
  btype = gt_block_get_type(block);

  gt_assert(canvas && block);

  grey.red = grey.green = grey.blue = DEFAULT_GREY_TONE;
  grey.alpha = 0.5;
  strand = gt_block_get_strand(block);
  block_range = gt_block_get_range(block);
  if (gt_block_get_max_height(block, &maxbarheight, canvas->pvt->sty, err)) {
    return -1;
  }
  if (gt_style_get_num(canvas->pvt->sty, "format", "bar_height", &bar_height,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(canvas->pvt->sty, "format", "min_len_block",
                       &min_len_block,NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(canvas->pvt->sty, "format", "arrow_width", &arrow_width,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_num(canvas->pvt->sty, "format", "stroke_width",
                       &stroke_width, NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }
  if (gt_style_get_color_with_track(canvas->pvt->sty,
                                 btype, "stroke", &strokecolor,
                                 gt_block_get_top_level_feature(block),
                                 gt_track_get_title(canvas->pvt->current_track),
                                 err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }

  if (strand == GT_STRAND_REVERSE || strand == GT_STRAND_BOTH)
    arrow_status = ARROW_LEFT;
  if (strand == GT_STRAND_FORWARD || strand == GT_STRAND_BOTH)
    arrow_status = (arrow_status == ARROW_LEFT ? ARROW_BOTH : ARROW_RIGHT);

  /* calculate scaled drawing coordinates for this canvas */
  draw_range = gt_coords_calc_generic_range(block_range,
                                            canvas->pvt->viewrange);
  draw_range.start *= canvas->pvt->width-2*canvas->pvt->margins;
  draw_range.end *= canvas->pvt->width-2*canvas->pvt->margins;
  block_start = draw_range.start + canvas->pvt->margins;
  block_width = draw_range.end - draw_range.start;

  /* draw block caption */
  if (gt_block_caption_is_visible(block))
  {
    GtStr *fontfam = NULL;
    caption = gt_str_get(gt_block_get_caption(block));
    if (caption)
    {
      double theight = gt_graphics_get_text_height(canvas->pvt->g),
             captionspace = CAPTION_BAR_SPACE_DEFAULT;
      if (gt_style_get_num(canvas->pvt->sty,
                           "format", "block_caption_space",
                           &captionspace, NULL, err) == GT_STYLE_QUERY_ERROR) {
        return -1;
      }
      if (gt_style_get_num(canvas->pvt->sty,
                          "format", "block_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", "block_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);
      gt_str_delete(fontfam);
      gt_graphics_draw_text_clip(canvas->pvt->g,
                                 block_start,
                                 canvas->pvt->y - bar_height/2
                                                - captionspace,
                                 caption);
    }
  }

  /* do not draw further details in very small blocks */
  if (!gt_block_has_only_one_fullsize_element(block)
       && gt_double_smaller_double(block_width, min_len_block))
  {
    /* optimise drawing for very narrow blocks,
       if <= 1px/pt width, draw as simple lines */
    if (canvas->pvt->bt && draw_range.end-draw_range.start <= 1.1)
    {
      if (!gt_bittab_bit_is_set(canvas->pvt->bt,
                                (GtUword) draw_range.start)) {
        gt_graphics_draw_vertical_line(canvas->pvt->g,
                                       block_start,
                                       canvas->pvt->y - bar_height/2,
                                       strokecolor,
                                       bar_height,
                                       stroke_width);
        gt_bittab_set_bit(canvas->pvt->bt, (GtUword) draw_range.start);
      }
    } else {
      if (gt_style_get_color_with_track(canvas->pvt->sty,
                             btype, "fill",
                             &fillcolor,
                             gt_block_get_top_level_feature(block),
                             gt_track_get_title(canvas->pvt->current_track),
                             err) == GT_STYLE_QUERY_ERROR) {
        return -1;
      }

      gt_graphics_draw_box(canvas->pvt->g,
                           block_start,
                           canvas->pvt->y - bar_height/2,
                           block_width,
                           bar_height,
                           fillcolor,
                           arrow_status,
                           arrow_width,
                           stroke_width,
                           strokecolor,
                           true);

      /* draw arrowheads at clipped margins */
      if (draw_range.clip == CLIPPED_LEFT || draw_range.clip == CLIPPED_BOTH)
          gt_graphics_draw_arrowhead(canvas->pvt->g,
                                     canvas->pvt->margins - 10,
                                     canvas->pvt->y - 4,
                                     grey,
                                     ARROW_LEFT);
      if (draw_range.clip == CLIPPED_RIGHT || draw_range.clip == CLIPPED_BOTH)
          gt_graphics_draw_arrowhead(canvas->pvt->g,
                                     canvas->pvt->width-canvas->pvt->margins
                                       + 10,
                                     canvas->pvt->y - 4,
                                     grey,
                                     ARROW_RIGHT);
    }

    /* register coordinates in GtImageInfo object if available */
    if (canvas->pvt->ii)
    {
      GtRecMap *rm = gt_rec_map_new(block_start,
                                    canvas->pvt->y - bar_height/2,
                                    block_start + block_width,
                                    canvas->pvt->y + bar_height/2,
                                    (GtFeatureNode*) /* XXX */
                                      gt_block_get_top_level_feature(block));
      gt_image_info_add_rec_map(canvas->pvt->ii, rm);
      gt_rec_map_set_omitted_children(rm, true);
    }
    /* signal break */
    return 1;
  }

  /* get stroke color */
  if (gt_style_get_color(canvas->pvt->sty,
                         "format", "default_stroke_color",
                         &strokecolor, NULL, err) == GT_STYLE_QUERY_ERROR) {
    return -1;
  }

  /* draw parent block boundaries */
  gt_graphics_draw_dashes(canvas->pvt->g,
                          block_start,
                          canvas->pvt->y - bar_height/2,
                          block_width,
                          bar_height,
                          ARROW_NONE,
                          arrow_width,
                          stroke_width,
                          strokecolor);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movabsq $0x4030000000000000, %rax # imm = 0x4030000000000000
movq %rax, 0x58(%rsp)
movabsq $0x4034000000000000, %rax # imm = 0x4034000000000000
movq %rax, 0x90(%rsp)
movabsq $0x4018000000000000, %rax # imm = 0x4018000000000000
movq %rax, 0x70(%rsp)
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, 0x68(%rsp)
movq %rsi, %rdi
callq 0x8abe5
movq %rax, 0x60(%rsp)
testq %rbx, %rbx
je 0x8c6da
testq %r14, %r14
je 0x8c6da
movaps 0x6a33f(%rip), %xmm0    # 0xf62b0
movaps %xmm0, 0xe0(%rsp)
movapd 0x6a33f(%rip), %xmm0    # 0xf62c0
movapd %xmm0, 0xf0(%rsp)
movq %r14, %rdi
callq 0x8abc6
movl %eax, %ebp
movq %r14, %rdi
callq 0x8a733
movq %rax, %r13
movq %rdx, %r12
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdx
leaq 0x110(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x8abf5
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x8c0e6
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x551bd(%rip), %rsi     # 0xe1196
leaq 0x61021(%rip), %rdx     # 0xed001
leaq 0x58(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8c0e1
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x5518e(%rip), %rsi     # 0xe1196
leaq 0x6a462(%rip), %rdx     # 0xf6471
leaq 0x90(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8c0e1
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x5515c(%rip), %rsi     # 0xe1196
leaq 0x6a43e(%rip), %rdx     # 0xf647f
leaq 0x70(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8c0e1
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x5512d(%rip), %rsi     # 0xe1196
leaq 0x6a41b(%rip), %rdx     # 0xf648b
leaq 0x68(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8c0e1
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rax
movq %rax, 0x48(%rsp)
movq %r14, %rdi
callq 0x8aac1
movq %rax, 0x80(%rsp)
movq 0x8(%rbx), %rax
movq 0x40(%rax), %rdi
callq 0x555b5
movq %r15, (%rsp)
leaq 0x6a3de(%rip), %rdx     # 0xf6498
leaq 0xa0(%rsp), %rcx
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x80(%rsp), %r8
movq %rax, %r9
callq 0x52d8f
cmpl $0x2, %eax
jne 0x8c0fa
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal -0x1(%rbp), %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpl $0x2, %eax
setae %cl
adcl $0x1, %edx
leal (%rcx,%rcx,2), %eax
testl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
cmovnel %eax, %edx
movl %edx, 0x7c(%rsp)
movq 0x8(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %r8
leaq 0xc0(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x8dcd0
movsd 0x8(%rbp), %xmm0
movsd %xmm0, 0x48(%rsp)
movl 0x10(%rbp), %r13d
movq 0x8(%rbx), %rax
movsd 0x28(%rax), %xmm0
unpcklps 0x55326(%rip), %xmm0    # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x5532e(%rip), %xmm0    # 0xe1490
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movsd 0x20(%rax), %xmm1
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
subsd %xmm0, %xmm2
movsd (%rbp), %xmm0
movapd %xmm2, 0x100(%rsp)
mulsd %xmm2, %xmm0
movapd %xmm0, 0x80(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x50(%rsp)
movq %r14, %rdi
callq 0x8ab8e
testb %al, %al
je 0x8c308
movq %r14, %rdi
callq 0x8a747
movq %rax, %rdi
callq 0x3bb5d
testq %rax, %rax
je 0x8c308
movq %rax, %r12
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
callq 0x4de34
movsd %xmm0, 0xc0(%rsp)
movabsq $0x401c000000000000, %rax # imm = 0x401C000000000000
leaq 0x98(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x54f8c(%rip), %rsi     # 0xe1196
leaq 0x60bc6(%rip), %rdx     # 0xecdd7
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8c0e1
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x54f62(%rip), %rsi     # 0xe1196
leaq 0x60a39(%rip), %rdx     # 0xecc74
leaq 0xc0(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x8c0e1
movl %r13d, 0x78(%rsp)
leaq 0x60a0c(%rip), %rdi     # 0xecc6f
callq 0x3b785
movq %rax, %r13
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x54f1c(%rip), %rsi     # 0xe1196
leaq 0x60a0b(%rip), %rdx     # 0xecc8c
movq %r13, %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5363b
cmpl $0x2, %eax
jne 0x8c2a1
movq %r13, %rdi
callq 0x3c87b
jmp 0x8c0e1
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rbp
movq %r13, %rdi
callq 0x3bb5d
movsd 0xc0(%rsp), %xmm0
movq %rbp, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4df3a
movq %r13, %rdi
callq 0x3c87b
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
movsd 0x58(%rsp), %xmm1
mulsd 0x5ee49(%rip), %xmm1    # 0xeb130
addsd 0x18(%rax), %xmm1
subsd 0x98(%rsp), %xmm1
movsd 0x50(%rsp), %xmm0
movq %r12, %rsi
callq 0x4dc7d
movl 0x78(%rsp), %r13d
movsd 0x48(%rsp), %xmm0
mulsd 0x100(%rsp), %xmm0
subsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movq %r14, %rdi
callq 0x8aafd
testb %al, %al
jne 0x8c40d
movsd 0x90(%rsp), %xmm1
movsd 0x48(%rsp), %xmm0
callq 0x7a42f
testb %al, %al
je 0x8c40d
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x8c4a5
movsd 0x69ee5(%rip), %xmm0    # 0xf6250
ucomisd 0x48(%rsp), %xmm0
jb 0x8c4a5
movapd 0x80(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x5e3cc(%rip), %xmm0    # 0xea760
cvttsd2si %xmm0, %r15
andq %rcx, %r15
orq %rax, %r15
movq %r15, %rsi
callq 0x710ce
testb %al, %al
jne 0x8c636
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
movsd 0x58(%rsp), %xmm2
movsd 0x5ed6b(%rip), %xmm1    # 0xeb130
mulsd %xmm2, %xmm1
addsd 0x18(%rax), %xmm1
movsd 0x68(%rsp), %xmm3
movups 0xa0(%rsp), %xmm0
movups 0xb0(%rsp), %xmm4
movups %xmm4, 0x10(%rsp)
movups %xmm0, (%rsp)
movsd 0x50(%rsp), %xmm0
callq 0x4e24f
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
movq %r15, %rsi
callq 0x70d40
jmp 0x8c636
movq 0x8(%rbx), %rax
movq 0x38(%rax), %rdi
leaq 0x54d7a(%rip), %rsi     # 0xe1196
leaq 0x6a07c(%rip), %rdx     # 0xf649f
leaq 0xa0(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x531a5
cmpl $0x2, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
je 0x8c0e6
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
movsd 0x58(%rsp), %xmm3
movsd 0x5ecd6(%rip), %xmm1    # 0xeb130
mulsd %xmm3, %xmm1
addsd 0x18(%rax), %xmm1
movsd 0x70(%rsp), %xmm4
movsd 0x68(%rsp), %xmm5
movups 0xa0(%rsp), %xmm0
movups 0xb0(%rsp), %xmm2
movups %xmm2, 0x10(%rsp)
movups %xmm0, (%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x48(%rsp), %xmm2
movl $0x3, %esi
callq 0x4e3c0
xorl %ecx, %ecx
jmp 0x8c0e6
movl %r13d, %ebp
movq 0x38(%rax), %r12
movq %r14, %rdi
callq 0x8aac1
movq %rax, %r13
movq 0x8(%rbx), %rax
movq 0x40(%rax), %rdi
callq 0x555b5
movq %r15, (%rsp)
leaq 0x64ff0(%rip), %rdx     # 0xf14bf
leaq 0xc0(%rsp), %rcx
movq %r12, %rdi
movq 0x60(%rsp), %rsi
movq %r13, %r8
movq %rax, %r9
callq 0x52d8f
cmpl $0x2, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
je 0x8c0e6
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
movsd 0x58(%rsp), %xmm3
movsd 0x5ec22(%rip), %xmm1    # 0xeb130
mulsd %xmm3, %xmm1
addsd 0x18(%rax), %xmm1
movsd 0x70(%rsp), %xmm4
movsd 0x68(%rsp), %xmm5
movups 0xa0(%rsp), %xmm0
movups 0xb0(%rsp), %xmm2
movups %xmm2, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movups 0xc0(%rsp), %xmm0
movups 0xd0(%rsp), %xmm2
movups %xmm2, 0x10(%rsp)
movups %xmm0, (%rsp)
movsd 0x50(%rsp), %xmm0
movsd 0x48(%rsp), %xmm2
movl 0x7c(%rsp), %esi
movl $0x1, %edx
callq 0x4e2dd
testl %ebp, %ebp
je 0x8c5cd
cmpl $0x3, %ebp
je 0x8c582
cmpl $0x1, %ebp
jne 0x8c636
movq 0x8(%rbx), %rax
movq 0x58(%rax), %rdi
movsd 0x18(%rax), %xmm1
movsd 0x20(%rax), %xmm0
addsd 0x69cbc(%rip), %xmm0    # 0xf6258
addsd 0x69cbc(%rip), %xmm1    # 0xf6260
movapd 0xe0(%rsp), %xmm2
movapd 0xf0(%rsp), %xmm3
movupd %xmm3, 0x10(%rsp)
movupd %xmm2, (%rsp)
xorl %esi, %esi
callq 0x4e5f1
cmpl $0x3, %ebp
jne 0x8c636
movq 0x8(%rbx), %rax
movsd 0x28(%rax), %xmm1
unpcklps 0x54ea3(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x54eab(%rip), %xmm1    # 0xe1490
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
subsd 0x20(%rax), %xmm0
addsd 0x69c4a(%rip), %xmm0    # 0xf6248
movq 0x58(%rax), %rdi
movsd 0x18(%rax), %xmm1
addsd 0x69c51(%rip), %xmm1    # 0xf6260
movapd 0xe0(%rsp), %xmm2
movapd 0xf0(%rsp), %xmm3
movupd %xmm3, 0x10(%rsp)
movupd %xmm2, (%rsp)
movl $0x1, %esi
callq 0x4e5f1
movq 0x8(%rbx), %rax
cmpq $0x0, 0x60(%rax)
je 0x8c6d0
movsd 0x18(%rax), %xmm0
movsd 0x58(%rsp), %xmm1
mulsd 0x5dff8(%rip), %xmm1    # 0xea650
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, 0x60(%rsp)
movsd 0x48(%rsp), %xmm2
addsd 0x50(%rsp), %xmm2
movsd %xmm2, 0x48(%rsp)
addsd %xmm0, %xmm1
movsd %xmm1, 0x80(%rsp)
movq %r14, %rdi
callq 0x8aac1
movsd 0x50(%rsp), %xmm0
movsd 0x60(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
movsd 0x80(%rsp), %xmm3
movq %rax, %rdi
callq 0x52690
movq %rax, %r14
movq 0x8(%rbx), %rax
movq 0x60(%rax), %rdi
movq %r14, %rsi
callq 0x515af
movq %r14, %rdi
movl $0x1, %esi
callq 0x5278c
movl $0x1, %ecx
jmp 0x8c0e6
callq 0x214f8