// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/graphics_cairo.c
// Function: gt_graphics_cairo_draw_caret
void gt_graphics_cairo_draw_caret(GtGraphics *gg, double x, double y,
                                  double width,double height,
                                  ArrowStatus arrow_status, double arrow_width,
                                  double stroke_width, GtColor stroke_color)
{
  GtGraphicsCairo *g = gt_graphics_cairo_cast(gg);
  gt_assert(g);

  /* save cairo context */
  cairo_save(g->cr);
  cairo_rectangle(g->cr, g->margin_x, g->margin_y,
                  g->width-2*g->margin_x, g->height-2*g->margin_y);
  cairo_clip(g->cr);
  /* create caret path */
  switch (arrow_status)
  {
    case ARROW_RIGHT:
      if (gt_double_smaller_double(0, width - arrow_width))
      {
        width -= arrow_width;
        cairo_move_to(g->cr, x, y + (height/2));
        cairo_line_to(g->cr, x + (width/2), y);
        cairo_line_to(g->cr, x + width, y + (height/2));
        cairo_line_to(g->cr, x + width + arrow_width, y + (height/2));
        /* add arrowhead */
        cairo_move_to(g->cr, x + width, y);
        cairo_line_to(g->cr, x + width + arrow_width, y + height / 2);
        cairo_line_to(g->cr, x + width, y + height);
      }
      break;
    case ARROW_LEFT:
      if (gt_double_smaller_double(0, width - arrow_width))
      {
        width -= arrow_width;
        /* draw arrowhead */
        cairo_move_to(g->cr, x + arrow_width , y);
        cairo_line_to(g->cr, x, y + (height/2));
        cairo_line_to(g->cr, x + arrow_width, y + height);
        cairo_move_to(g->cr, x, y + (height/2));
        cairo_line_to(g->cr, x + arrow_width, y + (height/2));
        cairo_line_to(g->cr, x + arrow_width + (width/2), y);
        cairo_line_to(g->cr, x + arrow_width + width, y + (height/2));
      }
      break;
    case ARROW_BOTH: /* XXX */
    case ARROW_NONE:
     cairo_move_to(g->cr, x, y + (height/2));
     cairo_line_to(g->cr, x + (width/2), y);
     cairo_line_to(g->cr, x + width, y + (height/2));
   }
   /* draw caret */
   cairo_set_line_width(g->cr, stroke_width);
   cairo_set_source_rgba(g->cr, stroke_color.red,
                                stroke_color.green,
                                stroke_color.blue,
                                stroke_color.alpha);
   cairo_stroke(g->cr);
   /* restore cairo context */
   cairo_restore(g->cr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movsd %xmm5, 0x38(%rsp)
movsd %xmm4, 0x10(%rsp)
movl %esi, %r14d
movsd %xmm3, 0x30(%rsp)
movsd %xmm2, 0x8(%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rdi, %rbx
callq 0x4efdf
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4dbf7
testq %rax, %rax
je 0x50acc
movq %rax, %rbx
leaq 0x60(%rsp), %r15
movq 0x10(%rax), %rdi
callq 0xb3d0
movq 0x10(%rbx), %rdi
movsd 0x50(%rbx), %xmm0
movsd 0x58(%rbx), %xmm1
movsd 0x68(%rbx), %xmm2
movapd %xmm0, %xmm3
addsd %xmm0, %xmm3
subsd %xmm3, %xmm2
movsd 0x60(%rbx), %xmm3
movapd %xmm1, %xmm4
addsd %xmm1, %xmm4
subsd %xmm4, %xmm3
callq 0xb2e0
movq 0x10(%rbx), %rdi
callq 0xbb50
leal -0x2(%r14), %eax
cmpl $0x2, %eax
jb 0x5092f
testl %r14d, %r14d
je 0x509e0
cmpl $0x1, %r14d
jne 0x50996
movsd 0x8(%rsp), %xmm1
subsd 0x10(%rsp), %xmm1
xorpd %xmm0, %xmm0
movsd %xmm1, 0x8(%rsp)
callq 0x7a42f
testb %al, %al
je 0x50996
movq 0x10(%rbx), %rdi
movsd 0x30(%rsp), %xmm1
mulsd 0x99ddf(%rip), %xmm1    # 0xea650
addsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0xb240
movq 0x10(%rbx), %rdi
movsd 0x99dbc(%rip), %xmm0    # 0xea650
mulsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x28(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xb240
movq 0x10(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x18(%rsp), %xmm1
addsd 0x30(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
jmp 0x50991
movq 0x10(%rbx), %rdi
movsd 0x30(%rsp), %xmm1
mulsd 0x99d0f(%rip), %xmm1    # 0xea650
addsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x30(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0xb240
movq 0x10(%rbx), %rdi
movsd 0x99cec(%rip), %xmm0    # 0xea650
mulsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x38(%rsp), %xmm0
callq 0xb0a0
movq 0x10(%rbx), %rdi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movsd 0x10(%r15), %xmm2
movsd 0x18(%r15), %xmm3
callq 0xb380
movq 0x10(%rbx), %rdi
callq 0xbbc0
movq 0x10(%rbx), %rdi
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xba50
movsd 0x8(%rsp), %xmm1
subsd 0x10(%rsp), %xmm1
xorpd %xmm0, %xmm0
movsd %xmm1, 0x8(%rsp)
callq 0x7a42f
testb %al, %al
je 0x50996
movq 0x10(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm1
callq 0xb240
movq 0x10(%rbx), %rdi
movsd 0x30(%rsp), %xmm1
mulsd 0x99c1e(%rip), %xmm1    # 0xea650
addsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x30(%rsp), %xmm1
addsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
callq 0xb240
movq 0x10(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x99bb6(%rip), %xmm0    # 0xea650
mulsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0xb770
movq 0x10(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
jmp 0x50991
callq 0x16e03