// File: /workspace/github_c_makefile_star2_O3/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 0x3302ce
movq %rsi, %rbx
testq %rsi, %rsi
je 0x3302ce
movq %rcx, %r12
cmpq %r8, %rcx
ja 0x3302ce
movq %r9, %rbp
movl %edx, %r13d
movq %rdi, %r14
movq %rbx, %rdi
callq 0x21ab85
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21abd2
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
callq 0x105c97
testb %al, %al
je 0x3302d3
callq 0x3302d8
movq %rax, %rdi
movq %r14, %rsi
callq 0x32fc36
movq %rax, %r15
leaq 0xb69fb(%rip), %rsi     # 0x3e66e5
leaq 0xb69ff(%rip), %rdx     # 0x3e66f0
xorl %r14d, %r14d
leaq 0xb8(%rsp), %rcx
movq %rbp, %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x21fc55
movaps 0xb68bf(%rip), %xmm0    # 0x3e65d0
movaps %xmm0, 0x90(%rsp)
movaps 0xb68c0(%rip), %xmm0    # 0x3e65e0
movaps %xmm0, 0xa0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movabsq $0x3feccccccccccccd, %rax # imm = 0x3FECCCCCCCCCCCCD
movq %rax, 0x58(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x330323
leaq 0x80(%rsp), %rbp
movq %rbp, %rdi
callq 0x112233
movq %rax, %xmm0
punpckldq 0x17b70(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x17b78(%rip), %xmm0    # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movq %rbx, %rdi
callq 0x21ab85
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21abd2
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 0x112233
movq %rax, %r12
movq %rbx, %rdi
callq 0x21ab85
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21abd2
movapd %xmm0, %xmm2
leaq 0xb690d(%rip), %rdi     # 0x3e66f7
movq %r12, %rsi
movaps 0x30(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movb $0x3, %al
callq 0x103d72
movq %rbp, %rdi
callq 0x112233
movq %rax, %xmm1
punpckldq 0x17acc(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x17ad4(%rip), %xmm1    # 0x3478f0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0x30(%rsp), %xmm0
callq 0x17100
addsd 0x163ed(%rip), %xmm0    # 0x346228
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x17ed1(%rip), %xmm0    # 0x347d20
cvttsd2si %xmm0, %rdi
andq %rcx, %rdi
orq %rax, %rdi
leaq 0xb67ec(%rip), %rdx     # 0x3e664d
movl $0x8, %esi
movl $0x61, %ecx
callq 0x10436a
movq %rax, %r12
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
incq %rax
movq %rax, %xmm3
movq 0x17a55(%rip), %xmm1    # 0x3478e0
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movapd 0x17a59(%rip), %xmm2    # 0x3478f0
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 0x105c97
testb %al, %al
je 0x32ff8c
xorl %r14d, %r14d
movapd 0x20(%rsp), %xmm0
callq 0x17d40
movsd 0x40(%r15), %xmm1
movsd 0x179ed(%rip), %xmm2    # 0x3478e0
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd 0x179f2(%rip), %xmm1    # 0x3478f0
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
jae 0x32ff8c
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x17dfc(%rip), %xmm0    # 0x347d20
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r15, %rdi
callq 0x330323
movsd %xmm0, (%r12,%r14,8)
incq %r14
movapd 0x20(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movq 0x88(%rsp), %rax
subq 0x10(%r15), %rax
movq %rax, %xmm2
punpckldq 0x1797b(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x17983(%rip), %xmm2    # 0x3478f0
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addsd %xmm2, %xmm1
movapd %xmm0, 0x20(%rsp)
callq 0x105c97
testb %al, %al
jne 0x32feda
movq %rbx, %rdi
callq 0x21ab85
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21abd2
addsd %xmm0, %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
leaq 0xb6773(%rip), %rdi     # 0x3e672a
movq %r14, %rsi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x103d72
cmpb $0x0, 0x28(%r15)
je 0x330156
movq %rbx, %rdi
callq 0x21abd2
movsd 0x16248(%rip), %xmm1    # 0x346228
addsd %xmm1, %xmm0
movapd %xmm1, %xmm3
leal 0x1(%r13), %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x50(%rsp), %xmm4
movups %xmm4, 0x10(%rsp)
movups %xmm2, (%rsp)
movsd 0x39399(%rip), %xmm2    # 0x3693a8
movq %rbx, %rdi
callq 0x21ad5c
movq %rbx, %rdi
callq 0x21abd2
movsd 0x16201(%rip), %xmm3    # 0x346228
addsd %xmm3, %xmm0
movl %r13d, %r13d
movq 0x18(%r15), %rax
addq %r13, %rax
movq %rax, %xmm2
movq 0x1789e(%rip), %xmm1    # 0x3478e0
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movapd 0x178a2(%rip), %xmm1    # 0x3478f0
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 0x3932c(%rip), %xmm2    # 0x3693a8
callq 0x21ad5c
movq %rbx, %rdi
callq 0x21abd2
addsd 0x17c77(%rip), %xmm0    # 0x347d08
movsd %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21a9cc
movapd %xmm0, %xmm1
mulsd 0x25d8f(%rip), %xmm1    # 0x355e48
addsd 0x20(%rsp), %xmm1
addsd 0x3bca1(%rip), %xmm1    # 0x36bd68
leaq 0xb6672(%rip), %rsi     # 0x3e6740
movq %rbx, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x21a7ae
movq %rbx, %rdi
callq 0x21abd2
addsd 0x17c1c(%rip), %xmm0    # 0x347d08
movsd %xmm0, 0x30(%rsp)
addq 0x18(%r15), %r13
movq %r13, %xmm0
punpckldq 0x177dd(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x177e5(%rip), %xmm0    # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x60(%rsp)
movq %rbx, %rdi
callq 0x21a9cc
movsd 0x25d1b(%rip), %xmm1    # 0x355e48
mulsd %xmm0, %xmm1
addsd 0x60(%rsp), %xmm1
addsd 0x3bc29(%rip), %xmm1    # 0x36bd68
leaq 0xb65fc(%rip), %rsi     # 0x3e6742
movq %rbx, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x21a7ae
jmp 0x330167
movl %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x21abd2
movsd 0x160b1(%rip), %xmm1    # 0x346228
subsd 0x20(%r15), %xmm1
movsd 0x18(%r15), %xmm2
unpcklps 0x17756(%rip), %xmm2    # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
movsd %xmm0, 0x30(%rsp)
subpd 0x17758(%rip), %xmm2    # 0x3478f0
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 0x21ab85
movsd %xmm0, 0x78(%rsp)
movq %rbx, %rdi
callq 0x21abd2
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 0x16021(%rip), %xmm3    # 0x346228
callq 0x21ad5c
cmpb $0x1, 0x28(%r15)
jne 0x330265
movq %rbx, %rdi
callq 0x21abd2
movsd 0x18(%r15), %xmm1
unpcklps 0x176b8(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x176c0(%rip), %xmm1    # 0x3478f0
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 0x15fd1(%rip), %xmm3    # 0x346228
movq %rbx, %rdi
movsd 0x20(%rsp), %xmm1
callq 0x21ade7
movq %rbx, %rdi
callq 0x21abd2
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 0x21b205
leaq 0xb63a0(%rip), %rsi     # 0x3e664d
movq %r12, %rdi
movl $0xa0, %edx
callq 0x1045eb
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x96254
callq 0x9621d