// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rcx, 0x80(%rsp)
movq %r8, 0x88(%rsp)
testq %rdi, %rdi
je 0x2d2072
movq %rsi, %rbx
testq %rsi, %rsi
je 0x2d2072
movq %rcx, %r12
cmpq %r8, %rcx
ja 0x2d2072
movq %r9, %rbp
movl %edx, %r13d
movq %rdi, %r14
movq %rbx, %rdi
callq 0x1d0cb9
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1d0d39
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
callq 0x955e2
testb %al, %al
je 0x2d209c
callq 0x2d20d2
movq %rax, %rdi
movq %r14, %rsi
callq 0x2d19ef
movq %rax, %r15
leaq 0xb5007(%rip), %rsi     # 0x386add
leaq 0xb500b(%rip), %rdx     # 0x386ae8
xorl %r14d, %r14d
leaq 0xb8(%rsp), %rcx
movq %rbp, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1d718d
movaps 0xb4ed3(%rip), %xmm0    # 0x3869d0
movaps %xmm0, 0x90(%rsp)
movaps 0xb4ed4(%rip), %xmm0    # 0x3869e0
movaps %xmm0, 0xa0(%rsp)
andq $0x0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movabsq $0x3feccccccccccccd, %rax # imm = 0x3FECCCCCCCCCCCCD
movq %rax, 0x58(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2d211b
leaq 0x80(%rsp), %rbp
movq %rbp, %rdi
callq 0xa31ee
movq %rax, %xmm0
punpckldq 0x15d87(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x15d8f(%rip), %xmm0    # 0x2e78f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movq %rbx, %rdi
callq 0x1d0cb9
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1d0d39
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
movapd %xmm0, 0x30(%rsp)
movq %rbp, %rdi
callq 0xa31ee
movq %rax, %r12
movq %rbx, %rdi
callq 0x1d0cb9
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1d0d39
movapd %xmm0, %xmm2
leaq 0xb4f1c(%rip), %rdi     # 0x386aef
movq %r12, %rsi
movaps 0x30(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movb $0x3, %al
callq 0x92a82
movq %rbp, %rdi
callq 0xa31ee
movq %rax, %xmm1
punpckldq 0x15ce3(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x15ceb(%rip), %xmm1    # 0x2e78f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x30(%rsp), %xmm0
callq 0x170f0
addsd 0x14604(%rip), %xmm0    # 0x2e6228
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x160e8(%rip), %xmm0    # 0x2e7d20
cvttsd2si %xmm0, %rdi
andq %rcx, %rdi
orq %rax, %rdi
leaq 0xb4dfb(%rip), %rdx     # 0x386a45
pushq $0x8
popq %rsi
pushq $0x61
popq %rcx
callq 0x9334a
movq 0x15c83(%rip), %xmm1    # 0x2e78e0
movq %rax, %r12
movq (%rbp), %rax
incq %rax
movq %rax, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
subpd 0x15c78(%rip), %xmm2    # 0x2e78f0
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
movapd 0x15c64(%rip), %xmm3    # 0x2e78f0
movq 0x88(%rsp), %rax
subq 0x10(%r15), %rax
movq %rax, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
subpd %xmm3, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
movapd %xmm0, 0x20(%rsp)
callq 0x955e2
testb %al, %al
je 0x2d1d3b
movapd 0x20(%rsp), %xmm0
callq 0x17cc0
movsd 0x40(%r15), %xmm1
unpcklps 0x15c08(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x15c10(%rip), %xmm1    # 0x2e78f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jae 0x2d1d3b
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1601a(%rip), %xmm0    # 0x2e7d20
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x2d211b
movsd %xmm0, (%r12,%r14,8)
incq %r14
movapd 0x20(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movq 0x15baa(%rip), %xmm1    # 0x2e78e0
jmp 0x2d1c84
movq %rbx, %rdi
callq 0x1d0cb9
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1d0d39
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
leaq 0xb4dbc(%rip), %rdi     # 0x386b22
movq %r14, %rsi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x92a82
cmpb $0x0, 0x28(%r15)
je 0x2d1eff
movq %rbx, %rdi
callq 0x1d0d39
movsd 0x14499(%rip), %xmm1    # 0x2e6228
addsd %xmm1, %xmm0
movapd %xmm1, %xmm3
leal 0x1(%r13), %eax
cvtsi2sd %rax, %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x50(%rsp), %xmm4
movups %xmm4, 0x10(%rsp)
movups %xmm2, (%rsp)
movsd 0x3754d(%rip), %xmm2    # 0x309308
movq %rbx, %rdi
callq 0x1d0f8f
movq %rbx, %rdi
callq 0x1d0d39
movsd 0x14455(%rip), %xmm3    # 0x2e6228
addsd %xmm3, %xmm0
movl %r13d, %r13d
movq 0x18(%r15), %rax
addq %r13, %rax
movq %rax, %xmm2
movq 0x15af2(%rip), %xmm1    # 0x2e78e0
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movapd 0x15af6(%rip), %xmm1    # 0x2e78f0
subpd %xmm1, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x50(%rsp), %xmm4
movups %xmm4, 0x10(%rsp)
movups %xmm2, (%rsp)
movq %rbx, %rdi
movsd 0x374e0(%rip), %xmm2    # 0x309308
callq 0x1d0f8f
movq %rbx, %rdi
callq 0x1d0d39
addsd 0x15ecb(%rip), %xmm0    # 0x2e7d08
movsd %xmm0, 0x30(%rsp)
cvtsi2sd %r13, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1d0a01
movapd %xmm0, %xmm1
mulsd 0x23ff6(%rip), %xmm1    # 0x2f5e58
addsd 0x20(%rsp), %xmm1
addsd 0x39e80(%rip), %xmm1    # 0x30bcf0
leaq 0xb4cc1(%rip), %rsi     # 0x386b38
movq %rbx, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x1d06e4
movq %rbx, %rdi
callq 0x1d0d39
addsd 0x15e73(%rip), %xmm0    # 0x2e7d08
movsd %xmm0, 0x30(%rsp)
addq 0x18(%r15), %r13
movq %r13, %xmm0
punpckldq 0x15a34(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x15a3c(%rip), %xmm0    # 0x2e78f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movq %rbx, %rdi
callq 0x1d0a01
movsd 0x23f82(%rip), %xmm1    # 0x2f5e58
mulsd %xmm0, %xmm1
addsd 0x60(%rsp), %xmm1
addsd 0x39e08(%rip), %xmm1    # 0x30bcf0
leaq 0xb4c4b(%rip), %rsi     # 0x386b3a
movq %rbx, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x1d06e4
jmp 0x2d1f0d
movl %r13d, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1d0d39
movsd 0x1430b(%rip), %xmm1    # 0x2e6228
subsd 0x20(%r15), %xmm1
movsd 0x18(%r15), %xmm2
unpcklps 0x159b0(%rip), %xmm2    # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
movsd %xmm0, 0x30(%rsp)
subpd 0x159b2(%rip), %xmm2    # 0x2e78f0
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
addsd 0x20(%rsp), %xmm0
movapd %xmm0, 0x60(%rsp)
movq %rbx, %rdi
callq 0x1d0cb9
movsd %xmm0, 0x78(%rsp)
movq %rbx, %rdi
callq 0x1d0d39
addsd %xmm0, %xmm0
movsd 0x78(%rsp), %xmm2
subsd %xmm0, %xmm2
movaps 0x90(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
movsd 0x30(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movsd 0x1427b(%rip), %xmm3    # 0x2e6228
callq 0x1d0f8f
cmpb $0x1, 0x28(%r15)
jne 0x2d200b
movq %rbx, %rdi
callq 0x1d0d39
movsd 0x18(%r15), %xmm1
unpcklps 0x15912(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1591a(%rip), %xmm1    # 0x2e78f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
movaps 0x40(%rsp), %xmm1
movaps 0x50(%rsp), %xmm3
movups %xmm3, 0x10(%rsp)
movups %xmm1, (%rsp)
movsd 0x1422b(%rip), %xmm3    # 0x2e6228
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm1
callq 0x1d104d
movq %rbx, %rdi
callq 0x1d0d39
movq 0x18(%r15), %r9
movups 0xb8(%rsp), %xmm1
movups 0xc8(%rsp), %xmm2
movups %xmm2, 0x10(%rsp)
movups %xmm1, (%rsp)
pushq $0x1
popq %r8
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm1
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1d159d
leaq 0xb49f4(%rip), %rsi     # 0x386a45
movq %r12, %rdi
movl $0xa0, %edx
callq 0x936f9
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x165eef(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12f90(%rip), %rsi     # 0x2e5013
leaq 0xb4966(%rip), %rdx     # 0x3869f0
leaq 0xb4992(%rip), %rcx     # 0x386a23
leaq 0xb49ad(%rip), %r8      # 0x386a45
pushq $0x4a
jmp 0x2d20c4
movq 0x165ec5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x12f66(%rip), %rsi     # 0x2e5013
leaq 0xb49c0(%rip), %rdx     # 0x386a74
leaq 0xb4968(%rip), %rcx     # 0x386a23
leaq 0xb4983(%rip), %r8      # 0x386a45
pushq $0x4c
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390