// File: /workspace/github_c_makefile_star2_O1/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, 0x70(%rsp)
movq %r8, 0x78(%rsp)
testq %rdi, %rdi
je 0x33b041
movq %rsi, %rbx
testq %rsi, %rsi
je 0x33b041
cmpq %r8, %rcx
ja 0x33b041
movq %r9, %r12
movl %edx, %r13d
movq %rdi, %r14
movq %rbx, %rdi
callq 0x2248dd
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x22492a
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
callq 0x10ad54
testb %al, %al
je 0x33b046
callq 0x33b04b
movq %rax, %rdi
movq %r14, %rsi
callq 0x33a9b6
movq %rax, %r15
leaq 0xb5494(%rip), %rsi     # 0x3efef5
leaq 0xb5498(%rip), %rdx     # 0x3eff00
xorl %r14d, %r14d
leaq 0xb8(%rsp), %rcx
movq %r12, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x229995
movaps 0xb5358(%rip), %xmm0    # 0x3efde0
movaps %xmm0, 0x90(%rsp)
movaps 0xb5359(%rip), %xmm0    # 0x3efdf0
movaps %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movabsq $0x3feccccccccccccd, %rax # imm = 0x3FECCCCCCCCCCCCD
movq %rax, 0x58(%rsp)
leaq 0x70(%rsp), %rbp
movq (%rbp), %rsi
movq %r15, %rdi
callq 0x33b096
movq %rbp, %rdi
callq 0x117813
movq %rax, %xmm0
punpckldq 0x15dfb(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x15e03(%rip), %xmm0    # 0x3508f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movq %rbx, %rdi
callq 0x2248dd
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x22492a
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 0x117813
movq %rax, %r12
movq %rbx, %rdi
callq 0x2248dd
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x22492a
movapd %xmm0, %xmm2
leaq 0xb53a8(%rip), %rdi     # 0x3eff07
movq %r12, %rsi
movaps 0x30(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movb $0x3, %al
callq 0x108e02
movq %rbp, %rdi
callq 0x117813
movq %rax, %xmm1
punpckldq 0x15d57(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x15d5f(%rip), %xmm1    # 0x3508f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x30(%rsp), %xmm0
callq 0x17100
addsd 0x14678(%rip), %xmm0    # 0x34f228
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x1615c(%rip), %xmm0    # 0x350d20
cvttsd2si %xmm0, %rdi
andq %rcx, %rdi
orq %rax, %rdi
leaq 0xb5287(%rip), %rdx     # 0x3efe5d
movl $0x8, %esi
movl $0x61, %ecx
callq 0x1093ef
movq %rax, %r12
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
incq %rax
movq %rax, %xmm3
movq 0x15ce0(%rip), %xmm1    # 0x3508e0
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movapd 0x15ce4(%rip), %xmm2    # 0x3508f0
subpd %xmm2, %xmm3
movapd %xmm3, %xmm0
unpckhpd %xmm3, %xmm0            # xmm0 = xmm0[1],xmm3[1]
addsd %xmm3, %xmm0
subq 0x10(%r15), %rcx
movq %rcx, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm1
unpckhpd %xmm3, %xmm1            # xmm1 = xmm1[1],xmm3[1]
addsd %xmm3, %xmm1
movapd %xmm0, 0x20(%rsp)
callq 0x10ad54
testb %al, %al
je 0x33acfe
xorl %r14d, %r14d
movapd 0x20(%rsp), %xmm0
callq 0x17d40
movsd 0x40(%r15), %xmm1
movsd 0x15c78(%rip), %xmm2    # 0x3508e0
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd 0x15c7d(%rip), %xmm1    # 0x3508f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jae 0x33acfe
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x16087(%rip), %xmm0    # 0x350d20
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x33b096
movsd %xmm0, (%r12,%r14,8)
incq %r14
movapd 0x20(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movq 0x78(%rsp), %rax
subq 0x10(%r15), %rax
movq %rax, %xmm2
punpckldq 0x15c09(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x15c11(%rip), %xmm2    # 0x3508f0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
movapd %xmm0, 0x20(%rsp)
callq 0x10ad54
testb %al, %al
jne 0x33ac4f
movq %rbx, %rdi
callq 0x2248dd
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x22492a
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
leaq 0xb5211(%rip), %rdi     # 0x3eff3a
movq %r14, %rsi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x108e02
cmpb $0x1, 0x28(%r15)
movl %r13d, %ebp
jne 0x33aec8
movq %rbx, %rdi
callq 0x22492a
movsd 0x144d3(%rip), %xmm1    # 0x34f228
addsd %xmm1, %xmm0
movapd %xmm1, %xmm3
incl %r13d
xorps %xmm1, %xmm1
cvtsi2sd %r13, %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x50(%rsp), %xmm4
movups %xmm4, 0x10(%rsp)
movups %xmm2, (%rsp)
movsd 0x3787d(%rip), %xmm2    # 0x372600
movq %rbx, %rdi
callq 0x224ab4
movq %rbx, %rdi
callq 0x22492a
movsd 0x1448d(%rip), %xmm3    # 0x34f228
addsd %xmm3, %xmm0
movq 0x18(%r15), %rax
addq %rbp, %rax
movq %rax, %xmm2
movq 0x15b2d(%rip), %xmm1    # 0x3508e0
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movapd 0x15b31(%rip), %xmm1    # 0x3508f0
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 0x37813(%rip), %xmm2    # 0x372600
callq 0x224ab4
movq %rbx, %rdi
callq 0x22492a
addsd 0x15f06(%rip), %xmm0    # 0x350d08
movsd %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
movsd %xmm0, 0x30(%rsp)
movq %rbx, %rdi
callq 0x224724
mulsd 0x24052(%rip), %xmm0    # 0x35ee78
movsd 0x30(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd 0x3a180(%rip), %xmm1    # 0x374fb8
leaq 0xb5111(%rip), %rsi     # 0x3eff50
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x224506
movq %rbx, %rdi
callq 0x22492a
addsd 0x15eab(%rip), %xmm0    # 0x350d08
movsd %xmm0, 0x20(%rsp)
movq 0x18(%r15), %rax
addq %rbp, %rax
movq %rax, %xmm0
punpckldq 0x15a69(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x15a71(%rip), %xmm0    # 0x3508f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movq %rbx, %rdi
callq 0x224724
movsd 0x23fd7(%rip), %xmm1    # 0x35ee78
mulsd %xmm0, %xmm1
addsd 0x30(%rsp), %xmm1
addsd 0x3a105(%rip), %xmm1    # 0x374fb8
leaq 0xb5098(%rip), %rsi     # 0x3eff52
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x224506
movq %rbx, %rdi
callq 0x22492a
xorps %xmm3, %xmm3
cvtsi2sd %rbp, %xmm3
movsd 0x14348(%rip), %xmm1    # 0x34f228
subsd 0x20(%r15), %xmm1
movsd 0x18(%r15), %xmm2
unpcklps 0x159ed(%rip), %xmm2    # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
movsd %xmm0, 0x30(%rsp)
subpd 0x159ef(%rip), %xmm2    # 0x3508f0
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm3, 0x20(%rsp)
addsd %xmm3, %xmm0
movapd %xmm0, 0x80(%rsp)
movq %rbx, %rdi
callq 0x2248dd
movsd %xmm0, 0x68(%rsp)
movq %rbx, %rdi
callq 0x22492a
addsd %xmm0, %xmm0
movsd 0x68(%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 0x80(%rsp), %xmm1
movsd 0x142ae(%rip), %xmm3    # 0x34f228
callq 0x224ab4
cmpb $0x1, 0x28(%r15)
jne 0x33afd8
movq %rbx, %rdi
callq 0x22492a
movsd 0x18(%r15), %xmm1
unpcklps 0x15945(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1594d(%rip), %xmm1    # 0x3508f0
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 0x1425e(%rip), %xmm3    # 0x34f228
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm1
callq 0x224b3f
movq %rbx, %rdi
callq 0x22492a
movq 0x18(%r15), %r9
movups 0xb8(%rsp), %xmm1
movups 0xc8(%rsp), %xmm2
movups %xmm2, 0x10(%rsp)
movups %xmm1, (%rsp)
movl $0x1, %r8d
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm1
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x224f5d
leaq 0xb4e3d(%rip), %rsi     # 0x3efe5d
movq %r12, %rdi
movl $0xa0, %edx
callq 0x109670
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x98329
callq 0x982f2