// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/graphics_cairo.c
// Function: gt_graphics_cairo_draw_curve_data
void gt_graphics_cairo_draw_curve_data(GtGraphics *gg, double x, double y,
                                       GtColor color, double data[],
                                       GtUword ndata, GtRange valrange,
                                       GtUword height)
{
  GtUword i, rnglen;
  double xpos;
  GtGraphicsCairo *g;
  g = gt_graphics_cairo_cast(gg);

  xpos = (((double)g->width-2*g->margin_x)/((double)ndata-1));
  rnglen = valrange.end - valrange.start;
  cairo_save(g->cr);
  cairo_move_to(g->cr,
                x,
                y+(1-(data[0]-valrange.start)/(double) rnglen)*height);
  for (i=1;i<ndata;i++)
  {
    double val, pval;
    if (gt_double_smaller_double(data[i], valrange.start)
          || gt_double_smaller_double(valrange.end, data[i]))
      break;
    val  = (double) (data[i]-valrange.start)/(double) rnglen;
    pval = (double) (data[i-1]-valrange.start)/(double) rnglen;
    gt_assert(val <= 1 && val >= 0 && pval >= 0 && pval <= 1);
    cairo_curve_to(g->cr,
                   x + ((i-0.5) * xpos),
                   y + (1-pval)   * height,
                   x + ((i-0.5) * xpos),
                   y + (1-val)    * height,
                   x + (i       * xpos),
                   y + (1-val)    * height);
  }
  cairo_set_source_rgba(g->cr, color.red,
                               color.green,
                               color.blue,
                               color.alpha);
  cairo_stroke(g->cr);
  cairo_restore(g->cr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, %r13
movq %r8, %r12
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x10(%rsp)
movq %rdi, %rbx
callq 0x4efdf
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4dbf7
movq %rax, %rbx
movsd 0x68(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x50(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r12, 0x30(%rsp)
subq %rbp, %r12
movq 0x10(%rax), %rdi
callq 0xb3d0
movq 0x10(%rbx), %rdi
movsd (%r15), %xmm0
movq %rbp, %xmm1
movq 0x903f6(%rip), %xmm4    # 0xe1480
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
movapd 0x903fa(%rip), %xmm3    # 0xe1490
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm2, 0x50(%rsp)
subsd %xmm2, %xmm0
movq %r12, %xmm1
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movapd %xmm2, 0x40(%rsp)
divsd %xmm2, %xmm0
movsd 0x90815(%rip), %xmm1    # 0xe18f0
subsd %xmm0, %xmm1
movq %r13, %xmm0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movapd %xmm2, 0x60(%rsp)
mulsd %xmm2, %xmm1
addsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
callq 0xb240
cmpq $0x2, %r14
jb 0x512cb
movsd 0x20(%rsp), %xmm0
addsd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm2
subsd %xmm0, %xmm2
movq %r14, %xmm0
punpckldq 0x90342(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x9034a(%rip), %xmm0    # 0xe1490
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x99fb6(%rip), %xmm1    # 0xeb110
movsd 0x30(%rsp), %xmm0
unpcklps 0x90319(%rip), %xmm0    # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x90321(%rip), %xmm0    # 0xe1490
divsd %xmm1, %xmm2
movsd %xmm2, 0x8(%rsp)
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movaps 0x50(%rsp), %xmm0
movlhps %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movaps %xmm0, 0x20(%rsp)
movapd 0x40(%rsp), %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x40(%rsp)
movl $0x1, %r12d
movsd (%r15,%r12,8), %xmm0
movaps 0x50(%rsp), %xmm1
callq 0x7a42f
testb %al, %al
jne 0x512cb
movsd (%r15,%r12,8), %xmm1
movaps 0x30(%rsp), %xmm0
callq 0x7a42f
testb %al, %al
jne 0x512cb
movupd -0x8(%r15,%r12,8), %xmm2
subpd 0x20(%rsp), %xmm2
divpd 0x40(%rsp), %xmm2
movapd %xmm2, %xmm0
cmplepd 0x99442(%rip), %xmm0    # 0xea640
movmskpd %xmm0, %eax
testb $0x2, %al
xorpd %xmm0, %xmm0
je 0x5130f
movapd %xmm2, %xmm5
unpckhpd %xmm2, %xmm5            # xmm5 = xmm5[1],xmm2[1]
ucomisd %xmm0, %xmm5
jb 0x5130f
ucomisd %xmm0, %xmm2
jb 0x5130f
testb $0x1, %al
je 0x5130f
movq 0x10(%rbx), %rdi
movq %r12, %xmm0
punpckldq 0x9023d(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x90245(%rip), %xmm0    # 0xe1490
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm0, %xmm4
movapd %xmm4, %xmm0
addsd 0x99ecd(%rip), %xmm0    # 0xeb130
movsd 0x8(%rsp), %xmm7
mulsd %xmm7, %xmm0
movsd 0x10(%rsp), %xmm6
addsd %xmm6, %xmm0
movsd 0x90671(%rip), %xmm3    # 0xe18f0
movapd %xmm3, %xmm1
subsd %xmm2, %xmm1
movapd 0x60(%rsp), %xmm8
mulsd %xmm8, %xmm1
movsd 0x18(%rsp), %xmm2
addsd %xmm2, %xmm1
subsd %xmm5, %xmm3
mulsd %xmm8, %xmm3
addsd %xmm2, %xmm3
mulsd %xmm7, %xmm4
addsd %xmm6, %xmm4
movapd %xmm0, %xmm2
movapd %xmm3, %xmm5
callq 0xb960
incq %r12
cmpq %r12, %r14
jne 0x511ae
leaq 0xb0(%rsp), %rax
movq 0x10(%rbx), %rdi
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movsd 0x10(%rax), %xmm2
movsd 0x18(%rax), %xmm3
callq 0xb380
movq 0x10(%rbx), %rdi
callq 0xbbc0
movq 0x10(%rbx), %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xba50
callq 0x17004