// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/custom_track_gc_content.c
// Function: gt_custom_track_gc_content_sketch
int gt_custom_track_gc_content_sketch(GtCustomTrack *ct, GtGraphics *graphics,
                                      unsigned int start_ypos,
                                      GtRange viewrange,
                                      GtStyle *style, GT_UNUSED GtError *err)
{
  int had_err = 0;
  GtCustomTrackGcContent *ctgc;
  double iter, iter_step, GT_UNUSED value, *data;
  GtUword n;
  GtRange value_range = {0, 1};
  GtColor color, grey, black;
  gt_assert(ct && graphics && viewrange.start <= viewrange.end);
  gt_assert(gt_double_smaller_double(0, gt_graphics_get_image_width(graphics)
                                        -2*gt_graphics_get_xmargins(graphics)));

  ctgc = gt_custom_track_gc_content_cast(ct);

  (void) gt_style_get_color(style, "GC_content", "stroke", &color, NULL, NULL);
  grey.red = grey.blue = grey.green = 0.8;
  grey.alpha = 0.9;
  black.red = black.blue = black.green = 0.0;
  black.alpha = 0.9;
  value = get_val_for_pos(ctgc, viewrange.start);

  iter_step = (double) gt_range_length(&viewrange)
                / ((double) gt_graphics_get_image_width(graphics)
                   - 2*gt_graphics_get_xmargins(graphics));

  gt_log_log("len="GT_WU", iter_step = %f, width = %f, margins = %f\n",
                      gt_range_length(&viewrange),
                      iter_step, gt_graphics_get_image_width(graphics),
                      gt_graphics_get_xmargins(graphics));

  data = gt_calloc(ceil(gt_range_length(&viewrange)/iter_step)+1,
                   sizeof (double));
  n = 0;
  for (iter=viewrange.start+1;
       gt_double_smaller_double(iter, viewrange.end-ctgc->windowsize);
       iter+=iter_step)
  {
    if (floor(iter) >= ctgc->seqlen) break;
    data[n++] = get_val_for_pos(ctgc, floor(iter));
  }

  gt_log_log("i="GT_WU", widthval = %f\n", n,
                 (gt_graphics_get_image_width(graphics)
                    - 2*gt_graphics_get_xmargins(graphics)));
  if (ctgc->show_scale)
  {
    gt_graphics_draw_horizontal_line(graphics,
                                     gt_graphics_get_xmargins(graphics) + 1,
                                     start_ypos+1,
                                     black,
                                     2,
                                     1.0);
    gt_graphics_draw_horizontal_line(graphics,
                                     gt_graphics_get_xmargins(graphics) + 1,
                                     start_ypos + ctgc->height,
                                     black,
                                     2,
                                     1.0);
    gt_graphics_draw_text(graphics,
                          gt_graphics_get_xmargins(graphics)+ 5,
                          start_ypos
                            + gt_graphics_get_text_height(graphics)/2 - 1,
                          "100%%");
    gt_graphics_draw_text(graphics,
                          gt_graphics_get_xmargins(graphics)+ 5,
                          start_ypos
                            + ctgc->height
                            + gt_graphics_get_text_height(graphics)/2 - 1,
                          "0%%");
  }
  gt_graphics_draw_horizontal_line(graphics,
                                   gt_graphics_get_xmargins(graphics),
                                   start_ypos + (1.0-ctgc->avg) * ctgc->height,
                                   grey,
                                   (gt_graphics_get_image_width(graphics)
                                     - 2*gt_graphics_get_xmargins(graphics)),
                                   1.0);
  if (ctgc->show_scale)
  {
    gt_graphics_draw_vertical_line(graphics,
                                   gt_graphics_get_xmargins(graphics),
                                   start_ypos,
                                   black,
                                   ctgc->height,
                                   1.0);
  }
  gt_graphics_draw_curve_data(graphics,
                              gt_graphics_get_xmargins(graphics),
                              start_ypos,
                              color,
                              data,
                              n,
                              value_range,
                              ctgc->height);
  gt_free(data);
  return had_err;
}

// Assembly:
subq $0x218, %rsp            # imm = 0x218
movq 0x220(%rsp), %rax
movq %rcx, 0x208(%rsp)
movq %r8, 0x210(%rsp)
movq %rdi, 0x200(%rsp)
movq %rsi, 0x1f8(%rsp)
movl %edx, 0x1f4(%rsp)
movq %r9, 0x1e8(%rsp)
movl $0x0, 0x1e4(%rsp)
movq 0xcc580(%rip), %rax     # 0x5bc250
movq %rax, 0x1a0(%rsp)
movq 0xcc579(%rip), %rax     # 0x5bc258
movq %rax, 0x1a8(%rsp)
cmpq $0x0, 0x200(%rsp)
je 0x4efd0f
cmpq $0x0, 0x1f8(%rsp)
je 0x4efd0f
movq 0x208(%rsp), %rax
cmpq 0x210(%rsp), %rax
jbe 0x4efd47
movq 0x14c28a(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x262f3(%rip), %rsi     # 0x516013
leaq 0xcc539(%rip), %rdx     # 0x5bc260
leaq 0xcc565(%rip), %rcx     # 0x5bc293
leaq 0xcc580(%rip), %r8      # 0x5bc2b5
movl $0x4a, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4efd49
jmp 0x4efd4b
movq 0x1f8(%rsp), %rdi
callq 0x324470
movsd %xmm0, 0x138(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324510
movsd 0x138(%rsp), %xmm1
addsd %xmm0, %xmm0
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
callq 0xec2f0
testb $0x1, %al
jne 0x4efdc3
movq 0x14c20e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x26277(%rip), %rsi     # 0x516013
leaq 0xcc541(%rip), %rdx     # 0x5bc2e4
leaq 0xcc4e9(%rip), %rcx     # 0x5bc293
leaq 0xcc504(%rip), %r8      # 0x5bc2b5
movl $0x4c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4efdc5
callq 0x4f06a0
movq %rax, %rdi
movq 0x200(%rsp), %rsi
callq 0x4efc00
movq %rax, 0x1d8(%rsp)
movq 0x1e8(%rsp), %rdi
leaq 0xcc55c(%rip), %rsi     # 0x5bc34d
leaq 0xcc560(%rip), %rdx     # 0x5bc358
xorl %eax, %eax
movl %eax, %r9d
leaq 0x180(%rsp), %rcx
movq %r9, %r8
callq 0x32d990
movabsq $0x3fe999999999999a, %rax # imm = 0x3FE999999999999A
movq %rax, 0x168(%rsp)
movq %rax, 0x170(%rsp)
movq %rax, 0x160(%rsp)
movabsq $0x3feccccccccccccd, %rax # imm = 0x3FECCCCCCCCCCCCD
movq %rax, 0x178(%rsp)
movq $0x0, 0x148(%rsp)
movq $0x0, 0x150(%rsp)
movq $0x0, 0x140(%rsp)
movq %rax, 0x158(%rsp)
movq 0x1d8(%rsp), %rdi
movq 0x208(%rsp), %rsi
callq 0x4f06f0
movsd %xmm0, 0x1c0(%rsp)
leaq 0x208(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0x107320
movq %rax, %xmm0
movaps 0x28a84(%rip), %xmm1    # 0x518930
movaps %xmm1, 0x110(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x28a80(%rip), %xmm1    # 0x518940
movaps %xmm1, 0x120(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324470
movsd %xmm0, 0xe0(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324510
movsd 0xe0(%rsp), %xmm1
movq 0x108(%rsp), %rdi
movaps %xmm0, %xmm2
movsd 0xe8(%rsp), %xmm0
addsd %xmm2, %xmm2
subsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x1c8(%rsp)
callq 0x107320
movq %rax, 0xf0(%rsp)
movsd 0x1c8(%rsp), %xmm0
movsd %xmm0, 0x100(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324470
movsd %xmm0, 0xf8(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324510
movq 0xf0(%rsp), %rsi
movsd 0xf8(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x100(%rsp), %xmm0
leaq 0xcc3c4(%rip), %rdi     # 0x5bc35f
movb $0x3, %al
callq 0xe7740
movq 0x108(%rsp), %rdi
callq 0x107320
movaps 0x110(%rsp), %xmm2
movaps 0x120(%rsp), %xmm1
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x1c8(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x190e0
movsd 0x2724f(%rip), %xmm1    # 0x517240
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdi
movq %rdi, %rcx
sarq $0x3f, %rcx
movsd 0x28d64(%rip), %xmm1    # 0x518d70
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdi
leaq 0xcc293(%rip), %rdx     # 0x5bc2b5
movl $0x8, %esi
movl $0x61, %ecx
callq 0xe83c0
movaps 0x110(%rsp), %xmm2
movaps 0x120(%rsp), %xmm1
movq %rax, 0x1b8(%rsp)
movq $0x0, 0x1b0(%rsp)
movq 0x208(%rsp), %rax
incq %rax
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x1d0(%rsp)
movsd 0x1d0(%rsp), %xmm0
movq 0x210(%rsp), %rax
movq 0x1d8(%rsp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movq %rax, %xmm1
movaps 0x28883(%rip), %xmm2    # 0x518930
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x28887(%rip), %xmm2    # 0x518940
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
callq 0xec2f0
testb $0x1, %al
jne 0x4f00d6
jmp 0x4f01b3
movsd 0x1d0(%rsp), %xmm0
callq 0x19c60
movq 0x1d8(%rsp), %rax
movq 0x40(%rax), %xmm1
movaps 0x28838(%rip), %xmm2    # 0x518930
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x2883c(%rip), %xmm2    # 0x518940
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4f011e
jmp 0x4f01b3
movq 0x1d8(%rsp), %rax
movq %rax, 0xd8(%rsp)
movsd 0x1d0(%rsp), %xmm0
callq 0x19c60
movq 0xd8(%rsp), %rdi
movsd 0x28c24(%rip), %xmm2    # 0x518d70
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
cvttsd2si %xmm0, %rsi
movq %rsi, %rcx
sarq $0x3f, %rcx
andq %rcx, %rax
orq %rax, %rsi
callq 0x4f06f0
movq 0x1b8(%rsp), %rax
movq 0x1b0(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x1b0(%rsp)
movsd %xmm0, (%rax,%rcx,8)
movsd 0x1c8(%rsp), %xmm0
addsd 0x1d0(%rsp), %xmm0
movsd %xmm0, 0x1d0(%rsp)
jmp 0x4f0081
movq 0x1b0(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324470
movsd %xmm0, 0xd0(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324510
movq 0xc8(%rsp), %rsi
movaps %xmm0, %xmm1
movsd 0xd0(%rsp), %xmm0
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
leaq 0xcc189(%rip), %rdi     # 0x5bc392
movb $0x1, %al
callq 0xe7740
movq 0x1d8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x4f0469
movq 0x1f8(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x324510
movq 0x50(%rsp), %rdi
movsd 0x26fff(%rip), %xmm3    # 0x517240
movsd %xmm3, 0x70(%rsp)
addsd %xmm3, %xmm0
movl 0x1f4(%rsp), %eax
incl %eax
cvtsi2sd %rax, %xmm1
movups 0x140(%rsp), %xmm2
movups 0x150(%rsp), %xmm4
movq %rsp, %rax
movups %xmm4, 0x10(%rax)
movups %xmm2, (%rax)
movsd 0x28ae5(%rip), %xmm2    # 0x518d60
movsd %xmm2, 0x60(%rsp)
callq 0x324810
movq 0x1f8(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x324510
movq 0x58(%rsp), %rdi
movsd 0x60(%rsp), %xmm2
movsd 0x70(%rsp), %xmm3
addsd %xmm3, %xmm0
movl 0x1f4(%rsp), %eax
movq 0x1d8(%rsp), %rcx
movq 0x18(%rcx), %rcx
addq %rcx, %rax
movq %rax, %xmm1
movaps 0x28661(%rip), %xmm4    # 0x518930
movaps %xmm4, 0x90(%rsp)
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
movapd 0x2865d(%rip), %xmm4    # 0x518940
movaps %xmm4, 0xa0(%rsp)
subpd %xmm4, %xmm1
movaps %xmm1, %xmm4
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm4, %xmm1
movups 0x140(%rsp), %xmm4
movups 0x150(%rsp), %xmm5
movq %rsp, %rax
movups %xmm5, 0x10(%rax)
movups %xmm4, (%rax)
callq 0x324810
movq 0x1f8(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x324510
movsd 0x28a25(%rip), %xmm1    # 0x518d58
movsd %xmm1, 0x88(%rsp)
addsd %xmm1, %xmm0
movsd %xmm0, 0x80(%rsp)
movl 0x1f4(%rsp), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x3240f0
movsd 0x68(%rsp), %xmm1
movsd 0x70(%rsp), %xmm2
movq 0x78(%rsp), %rdi
movaps %xmm0, %xmm3
movsd 0x80(%rsp), %xmm0
movsd 0x36b7b(%rip), %xmm4    # 0x526f08
mulsd %xmm4, %xmm3
addsd %xmm3, %xmm1
subsd %xmm2, %xmm1
leaq 0xcc008(%rip), %rsi     # 0x5bc3a8
callq 0x323d00
movq 0x1f8(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x324510
movsd 0x88(%rsp), %xmm3
movaps 0x90(%rsp), %xmm2
movaps 0xa0(%rsp), %xmm1
addsd %xmm3, %xmm0
movsd %xmm0, 0xc0(%rsp)
movl 0x1f4(%rsp), %eax
movq 0x1d8(%rsp), %rcx
movq 0x18(%rcx), %rcx
addq %rcx, %rax
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x3240f0
movsd 0xb0(%rsp), %xmm1
movq 0xb8(%rsp), %rdi
movaps %xmm0, %xmm2
movsd 0xc0(%rsp), %xmm0
movsd 0x28917(%rip), %xmm3    # 0x518d60
divsd %xmm3, %xmm2
addsd %xmm2, %xmm1
movsd 0x26de7(%rip), %xmm2    # 0x517240
subsd %xmm2, %xmm1
leaq 0xcbf46(%rip), %rsi     # 0x5bc3aa
callq 0x323d00
movq 0x1f8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x324510
movsd %xmm0, 0x48(%rsp)
movl 0x1f4(%rsp), %eax
cvtsi2sd %rax, %xmm1
movq 0x1d8(%rsp), %rax
movsd 0x20(%rax), %xmm2
movsd 0x26d9e(%rip), %xmm0    # 0x517240
subsd %xmm2, %xmm0
movq 0x18(%rax), %xmm2
movaps 0x2847e(%rip), %xmm3    # 0x518930
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x28482(%rip), %xmm3    # 0x518940
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324470
movsd %xmm0, 0x30(%rsp)
movq 0x1f8(%rsp), %rdi
callq 0x324510
movsd 0x30(%rsp), %xmm2
movq 0x38(%rsp), %rdi
movsd 0x40(%rsp), %xmm1
movaps %xmm0, %xmm3
movsd 0x48(%rsp), %xmm0
addsd %xmm3, %xmm3
subsd %xmm3, %xmm2
leaq 0x160(%rsp), %rax
movsd 0x26d13(%rip), %xmm3    # 0x517240
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 0x324810
movq 0x1d8(%rsp), %rax
testb $0x1, 0x28(%rax)
je 0x4f05ef
movq 0x1f8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x324510
movq 0x28(%rsp), %rdi
movl 0x1f4(%rsp), %eax
cvtsi2sd %rax, %xmm1
movq 0x1d8(%rsp), %rax
movq 0x18(%rax), %xmm2
movaps 0x28393(%rip), %xmm3    # 0x518930
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x28397(%rip), %xmm3    # 0x518940
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
leaq 0x140(%rsp), %rax
movsd 0x26c78(%rip), %xmm3    # 0x517240
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 0x324910
movq 0x1f8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x324510
movq 0x20(%rsp), %rdi
movl 0x1f4(%rsp), %eax
cvtsi2sd %rax, %xmm1
movq 0x1b8(%rsp), %rsi
movq 0x1b0(%rsp), %rdx
movq 0x1d8(%rsp), %rax
movq 0x18(%rax), %r9
movq 0x1a0(%rsp), %rcx
movq 0x1a8(%rsp), %r8
leaq 0x180(%rsp), %rax
movq (%rax), %r10
movq %r10, (%rsp)
movq 0x8(%rax), %r10
movq %r10, 0x8(%rsp)
movq 0x10(%rax), %r10
movq %r10, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x325050
movq 0x1b8(%rsp), %rdi
leaq 0xcbc39(%rip), %rsi     # 0x5bc2b5
movl $0xa0, %edx
callq 0xe88c0
movl 0x1e4(%rsp), %eax
addq $0x218, %rsp            # imm = 0x218
retq
nopw %cs:(%rax,%rax)