// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: plot_adev_curve(ADEV_INFO*, unsigned char, int)
void plot_adev_curve(struct ADEV_INFO *bins, u08 color, int mask)
{
int i;
int x1, x2;
float y1, y2;
float max_scale;
float min_scale;
float adev_range;
int vert_scale;
int vert_ofs;

double n;
float m;
float eb1,eb2;


   if(text_mode) return;  // no room on screen to do this
   if(rcvr_type == NO_RCVR) return;  // no room on screen to do this
   if(rcvr_type == TIDE_RCVR) return;  // ckckck has no adevs to show

   if(first_key) return;
   if(plot_adev_data == 0) return;
   if(bins == 0) return;

   if(zoom_screen == 'P') ;
   else if(zoom_screen) return;

   if(bins->adev_bins[0] == 0.0) return;

if((mask & adev_display_mask) == 0) return;

   max_scale = scale_adev(bins->adev_max);
   if(bottom_adev_decade) min_scale = scale_adev(bottom_adev_decade);
   else                   min_scale = scale_adev(bins->adev_min);
if(ATYPE == A_MTIE) {  // offset plots a little from the top and bottom of the plot area
   min_scale = scale_adev(bins->adev_min);
max_scale = (float) (global_adev_max*MTIE_SCALE);
min_scale = (float) (global_adev_min/MTIE_SCALE);
}

   adev_range = max_scale - min_scale;
   adev_range = (float) ABS(adev_range);
//sprintf(debug_text2, "ascale min:%g  max:%g  range:%g", min_scale, max_scale, adev_range);
   if(adev_range == 0.0) return;


   // adev plots are scaled to major vertical divisions
   vert_scale = (PLOT_HEIGHT / (VERT_MAJOR*2)) * (VERT_MAJOR*2);  // two major divisions per decade
   vert_ofs = (PLOT_HEIGHT - vert_scale) / 2;
   if(((PLOT_HEIGHT / (VERT_MAJOR*2)) & 0x01) == 0x00) {  // align adevs to cyan dotted lines
      vert_ofs += VERT_MAJOR;
   }
//sprintf(plot_title, "bot:%g  max(%g):%g min(%g):%g range:%g", bottom_adev_decade, bins->adev_max,max_scale, bins->adev_min,min_scale, adev_range);

   for(i=first_show_bin; i<bins->bin_count; i++) {
      x1 = (i-first_show_bin-1) * HORIZ_MAJOR;   // make sure line fits in the plot
      x2 = (i-first_show_bin) * HORIZ_MAJOR;
if(x1 > PLOT_WIDTH) continue; // aaaahhhh 
if(x2 > PLOT_WIDTH) continue;
if(x1 < 0) continue;
if(x2 < 0) continue;
      if(x1 < 0) x1 = 0;
      if(x2 > PLOT_WIDTH) x2 = PLOT_WIDTH;

      y1 = (0.0F - scale_adev(bins->adev_bins[i-1]));
      y1 += max_scale;
      y1 /= adev_range;
      y1 *= (float) vert_scale;
      y1 += (float) (PLOT_ROW + vert_ofs);
      if(y1 <= PLOT_ROW) y1 = (float) (PLOT_ROW+2);
      if(y1 >= (PLOT_ROW+PLOT_HEIGHT-1)) y1 = (float) (PLOT_ROW+PLOT_HEIGHT-2);

      y2 = eb1 = eb2 = bins->adev_bins[i];
      y2 = (0.0F - scale_adev(y2));
      y2 += max_scale;
      y2 /= adev_range;
      y2 *= (float) vert_scale;
      y2 += (float) (PLOT_ROW+vert_ofs);
      if(y2 <= PLOT_ROW) y2 = (float) (PLOT_ROW+2);
      if(y2 >= (PLOT_ROW+PLOT_HEIGHT-1)) y2 = (float) (PLOT_ROW+PLOT_HEIGHT-2);

      if(x1 < PLOT_WIDTH) {
         line(PLOT_COL+x1, (int) y1, PLOT_COL+x2, (int) y2, color);
      }
   }

   // draw error bars from last bin to first bin
   if(show_error_bars == 0) return;  // bars disabled
if(ATYPE == A_MTIE) return;

   for(i=bins->bin_count-1; i>=first_show_bin; i--) {
      eb1 = eb2 = bins->adev_bins[i];

      x1 = (i-first_show_bin-1) * HORIZ_MAJOR;   // make sure line fits in the plot
      x2 = (i-first_show_bin) * HORIZ_MAJOR;
if(x1 > PLOT_WIDTH) continue;
if(x2 > PLOT_WIDTH) continue;
if(x1 < 0) continue;
if(x2 < 0) continue;
      if(x1 < 0) x1 = 0;
      if(x2 > PLOT_WIDTH) x2 = PLOT_WIDTH;

      if(1 || (x1 < PLOT_WIDTH)) {
         m = (float) bins->adev_taus[i];
         if(m == 0) continue;

         n = (double) bins->adev_on[i];
         n = sqrt(n/(double) m);
         if(n == 0) continue;

         eb1 -= (eb1 / (float) n);
         eb1 = (0.0F - scale_adev(eb1));
         eb1 += max_scale;
         eb1 /= adev_range;
         eb1 *= vert_scale;
         eb1 += (PLOT_ROW+vert_ofs);
         if(eb1< PLOT_ROW) eb1 = (float) PLOT_ROW;
         if(eb1 >= (PLOT_ROW+PLOT_HEIGHT)) eb1 = (float) (PLOT_ROW+PLOT_HEIGHT);

         eb2 += (eb2 / (float) n);
         eb2 = (0.0F - scale_adev(eb2));
         eb2 += max_scale;
         eb2 /= adev_range;
         eb2 *= vert_scale;
         eb2 += (PLOT_ROW+vert_ofs);
         if(eb2< PLOT_ROW) eb2 = (float) PLOT_ROW;
         if(eb2 >= (PLOT_ROW+PLOT_HEIGHT)) eb2 = (float) (PLOT_ROW+PLOT_HEIGHT);


         if(n < 1.0) {  // error bars are too large to be meaningful - limit size and use arrow endcaps
            eb1 = y2 - (float) (adev_decade_height / 2.0);
            eb2 = y2 + (float) ( adev_decade_height / 2.0);

            if(eb1< PLOT_ROW) eb1 = (float) PLOT_ROW;
            if(eb1 >= (PLOT_ROW+PLOT_HEIGHT)) eb1 = (float) (PLOT_ROW+PLOT_HEIGHT);

            if(eb2< PLOT_ROW) eb2 = (float) PLOT_ROW;
            if(eb2 >= (PLOT_ROW+PLOT_HEIGHT)) eb2 = (float) (PLOT_ROW+PLOT_HEIGHT);

            line(PLOT_COL+x2,(int) eb1, PLOT_COL+x2,(int)eb2, color);

            line(PLOT_COL+x2-HORIZ_MINOR/3,(int) eb1+VERT_MINOR, PLOT_COL+x2,(int)eb1, color);
            line(PLOT_COL+x2+HORIZ_MINOR/3,(int) eb1+VERT_MINOR, PLOT_COL+x2,(int)eb1, color);

            line(PLOT_COL+x2-HORIZ_MINOR/3,(int) eb2-VERT_MINOR, PLOT_COL+x2,(int)eb2, color);
            line(PLOT_COL+x2+HORIZ_MINOR/3,(int) eb2-VERT_MINOR, PLOT_COL+x2,(int)eb2, color);
         }
         else if(0 || (fabs(eb2-eb1) >= (double) (VERT_MINOR*1))) { // good bars, use flat end caps
            if(0) {  // center error bars on the adev line
               y2 = bins->adev_bins[i];
               y2 = (0.0F - scale_adev(y2));
               y2 += max_scale;
               y2 /= adev_range;
               y2 *= (float) vert_scale;
               y2 += (float) (PLOT_ROW+vert_ofs);
               if(y2 < PLOT_ROW) y2 = (float) PLOT_ROW;
               if(y2 >= (PLOT_ROW+PLOT_HEIGHT)) y2 = (float) (PLOT_ROW+PLOT_HEIGHT);

               m = (float) (fabs(eb1-eb2) / 2.0);
               eb1 = y2 - m;
               eb2 = y2 + m;
            }

            line(PLOT_COL+x2,(int) eb1, PLOT_COL+x2,(int)eb2, color);

            line(PLOT_COL+x2-HORIZ_MINOR/3,(int) eb1, PLOT_COL+x2+HORIZ_MINOR/3,(int)eb1, color);
            line(PLOT_COL+x2-HORIZ_MINOR/3,(int) eb2, PLOT_COL+x2+HORIZ_MINOR/3,(int)eb2, color);
         }
         else {  // stop on last non-short error bar
            break;
         }
      }
   }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movl %edx, -0x10(%rbp)
leaq 0x11291c(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
je 0x1650a6
jmp 0x165c5d
leaq 0x112a03(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0x1650bb
jmp 0x165c5d
leaq 0x1129ee(%rip), %rax    # 0x277ab0
cmpq $0x800000, (%rax)       # imm = 0x800000
jne 0x1650d0
jmp 0x165c5d
leaq 0x139061(%rip), %rax    # 0x29e138
cmpl $0x0, (%rax)
je 0x1650e1
jmp 0x165c5d
leaq 0x1154d1(%rip), %rax    # 0x27a5b9
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1650f5
jmp 0x165c5d
cmpq $0x0, -0x8(%rbp)
jne 0x165101
jmp 0x165c5d
leaq 0x206880(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x50, %eax
jne 0x165112
jmp 0x165125
leaq 0x20686f(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
je 0x165123
jmp 0x165c5d
jmp 0x165125
movq -0x8(%rbp), %rax
movss 0x194(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x165145
jp 0x165145
jmp 0x165c5d
movl -0x10(%rbp), %eax
leaq 0x11d6a9(%rip), %rcx    # 0x2827f8
andl (%rcx), %eax
cmpl $0x0, %eax
jne 0x16515b
jmp 0x165c5d
movq -0x8(%rbp), %rax
movss 0x650(%rax), %xmm0
callq 0x15f1b0
movss %xmm0, -0x28(%rbp)
movss 0x27467f(%rip), %xmm0   # 0x3d97f8
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x165185
jp 0x165185
jmp 0x165199
movss 0x27466b(%rip), %xmm0   # 0x3d97f8
callq 0x15f1b0
movss %xmm0, -0x2c(%rbp)
jmp 0x1651af
movq -0x8(%rbp), %rax
movss 0x64c(%rax), %xmm0
callq 0x15f1b0
movss %xmm0, -0x2c(%rbp)
leaq 0x11d63a(%rip), %rax    # 0x2827f0
cmpl $0x9, (%rax)
jne 0x16520d
movq -0x8(%rbp), %rax
movss 0x64c(%rax), %xmm0
callq 0x15f1b0
movss %xmm0, -0x2c(%rbp)
movsd 0x29f77(%rip), %xmm0    # 0x18f150
leaq 0x136ae8(%rip), %rax    # 0x29bcc8
mulsd (%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x28(%rbp)
leaq 0x136adc(%rip), %rax    # 0x29bcd0
movsd (%rax), %xmm0
movsd 0x29f50(%rip), %xmm1    # 0x18f150
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x28(%rbp), %xmm0
subss -0x2c(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x30(%rbp), %xmm0
jbe 0x165234
xorps %xmm0, %xmm0
subss -0x30(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
jmp 0x16523e
movss -0x30(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movss -0x50(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x165261
jp 0x165261
jmp 0x165c5d
leaq 0x112800(%rip), %rax    # 0x277a68
movl (%rax), %eax
leaq 0x1127db(%rip), %rcx    # 0x277a4c
movl (%rcx), %ecx
shll %ecx
cltd
idivl %ecx
leaq 0x1127cd(%rip), %rcx    # 0x277a4c
movl (%rcx), %ecx
shll %ecx
imull %ecx, %eax
movl %eax, -0x34(%rbp)
leaq 0x1127d8(%rip), %rax    # 0x277a68
movl (%rax), %eax
subl -0x34(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x38(%rbp)
leaq 0x1127c1(%rip), %rax    # 0x277a68
movl (%rax), %eax
leaq 0x11279c(%rip), %rcx    # 0x277a4c
movl (%rcx), %ecx
shll %ecx
cltd
idivl %ecx
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1652ce
leaq 0x112786(%rip), %rax    # 0x277a4c
movl (%rax), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
leaq 0x136b8b(%rip), %rax    # 0x29be60
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x648(%rcx), %eax
jge 0x16559e
movl -0x14(%rbp), %eax
leaq 0x136b69(%rip), %rcx    # 0x29be60
subl (%rcx), %eax
subl $0x1, %eax
leaq 0x112751(%rip), %rcx    # 0x277a54
imull (%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
leaq 0x136b4d(%rip), %rcx    # 0x29be60
subl (%rcx), %eax
leaq 0x112738(%rip), %rcx    # 0x277a54
imull (%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
leaq 0x112738(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jle 0x165335
jmp 0x165590
movl -0x1c(%rbp), %eax
leaq 0x112725(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jle 0x165348
jmp 0x165590
cmpl $0x0, -0x18(%rbp)
jge 0x165353
jmp 0x165590
cmpl $0x0, -0x1c(%rbp)
jge 0x16535e
jmp 0x165590
cmpl $0x0, -0x18(%rbp)
jge 0x16536b
movl $0x0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
leaq 0x1126ef(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jle 0x165385
leaq 0x1126e4(%rip), %rax    # 0x277a64
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movss 0x194(%rax,%rcx,4), %xmm0
callq 0x15f1b0
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x28(%rbp), %xmm0
addss -0x20(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x30(%rbp), %xmm1
movss -0x20(%rbp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x20(%rbp)
cvtsi2ssl -0x34(%rbp), %xmm0
mulss -0x20(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
leaq 0x112675(%rip), %rax    # 0x277a5c
movl (%rax), %eax
addl -0x38(%rbp), %eax
cvtsi2ss %eax, %xmm0
addss -0x20(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x20(%rbp), %xmm1
leaq 0x112656(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x165424
leaq 0x112646(%rip), %rax    # 0x277a5c
movl (%rax), %eax
addl $0x2, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x20(%rbp), %xmm0
leaq 0x11262c(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x11262f(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
jb 0x165465
leaq 0x11260e(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x112611(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
subl $0x2, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss 0x194(%rax,%rcx,4), %xmm0
movss %xmm0, -0x4c(%rbp)
movss %xmm0, -0x48(%rbp)
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm0
callq 0x15f1b0
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x28(%rbp), %xmm0
addss -0x24(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x30(%rbp), %xmm1
movss -0x24(%rbp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
cvtsi2ssl -0x34(%rbp), %xmm0
mulss -0x24(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
leaq 0x112586(%rip), %rax    # 0x277a5c
movl (%rax), %eax
addl -0x38(%rbp), %eax
cvtsi2ss %eax, %xmm0
addss -0x24(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm1
leaq 0x112567(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x165513
leaq 0x112557(%rip), %rax    # 0x277a5c
movl (%rax), %eax
addl $0x2, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm0
leaq 0x11253d(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x112540(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
subl $0x1, %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
jb 0x165554
leaq 0x11251f(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x112522(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
subl $0x2, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x24(%rbp)
movl -0x18(%rbp), %eax
leaq 0x112506(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jge 0x16558e
leaq 0x1124f7(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x18(%rbp), %edi
cvttss2si -0x20(%rbp), %esi
leaq 0x1124e6(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x24(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
jmp 0x165590
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1652da
leaq 0x136927(%rip), %rax    # 0x29becc
cmpl $0x0, (%rax)
jne 0x1655af
jmp 0x165c5d
leaq 0x11d23a(%rip), %rax    # 0x2827f0
cmpl $0x9, (%rax)
jne 0x1655c0
jmp 0x165c5d
movq -0x8(%rbp), %rax
movl 0x648(%rax), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
leaq 0x136886(%rip), %rcx    # 0x29be60
cmpl (%rcx), %eax
jl 0x165c5d
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss 0x194(%rax,%rcx,4), %xmm0
movss %xmm0, -0x4c(%rbp)
movss %xmm0, -0x48(%rbp)
movl -0x14(%rbp), %eax
leaq 0x136859(%rip), %rcx    # 0x29be60
subl (%rcx), %eax
subl $0x1, %eax
leaq 0x112441(%rip), %rcx    # 0x277a54
imull (%rcx), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
leaq 0x13683d(%rip), %rcx    # 0x29be60
subl (%rcx), %eax
leaq 0x112428(%rip), %rcx    # 0x277a54
imull (%rcx), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
leaq 0x112428(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jle 0x165645
jmp 0x165c4f
movl -0x1c(%rbp), %eax
leaq 0x112415(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jle 0x165658
jmp 0x165c4f
cmpl $0x0, -0x18(%rbp)
jge 0x165663
jmp 0x165c4f
cmpl $0x0, -0x1c(%rbp)
jge 0x16566e
jmp 0x165c4f
cmpl $0x0, -0x18(%rbp)
jge 0x16567b
movl $0x0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
leaq 0x1123df(%rip), %rcx    # 0x277a64
cmpl (%rcx), %eax
jle 0x165695
leaq 0x1123d4(%rip), %rax    # 0x277a64
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movss 0x4(%rax,%rcx,4), %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x44(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1656bc
jp 0x1656bc
jmp 0x165c4f
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
cvtsi2sdq 0x328(%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movss -0x44(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
callq 0x9280
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x165704
jp 0x165704
jmp 0x165c4f
movss -0x48(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
divss %xmm0, %xmm1
movss -0x48(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x48(%rbp), %xmm0
callq 0x15f1b0
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x28(%rbp), %xmm0
addss -0x48(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x30(%rbp), %xmm1
movss -0x48(%rbp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
cvtsi2ssl -0x34(%rbp), %xmm0
mulss -0x48(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
leaq 0x1122e7(%rip), %rax    # 0x277a5c
movl (%rax), %eax
addl -0x38(%rbp), %eax
cvtsi2ss %eax, %xmm0
addss -0x48(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x48(%rbp), %xmm1
leaq 0x1122c8(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1657ad
leaq 0x1122b8(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x48(%rbp), %xmm0
leaq 0x1122a3(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x1122a6(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
jb 0x1657e8
leaq 0x112288(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x11228b(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x4c(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
cvtsd2ss %xmm1, %xmm1
divss %xmm1, %xmm0
addss -0x4c(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x4c(%rbp), %xmm0
callq 0x15f1b0
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x28(%rbp), %xmm0
addss -0x4c(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x30(%rbp), %xmm1
movss -0x4c(%rbp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
cvtsi2ssl -0x34(%rbp), %xmm0
mulss -0x4c(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
leaq 0x112207(%rip), %rax    # 0x277a5c
movl (%rax), %eax
addl -0x38(%rbp), %eax
cvtsi2ss %eax, %xmm0
addss -0x4c(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x4c(%rbp), %xmm1
leaq 0x1121e8(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x16588d
leaq 0x1121d8(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x4c(%rbp), %xmm0
leaq 0x1121c3(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x1121c6(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
jb 0x1658c8
leaq 0x1121a8(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x1121ab(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x4c(%rbp)
movsd 0x9798(%rip), %xmm0     # 0x16f068
ucomisd -0x40(%rbp), %xmm0
jbe 0x165b3e
movss -0x24(%rbp), %xmm0
leaq 0x1365e9(%rip), %rax    # 0x29bed0
movsd (%rax), %xmm1
movsd 0x985d(%rip), %xmm2     # 0x16f150
divsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x24(%rbp), %xmm0
leaq 0x1365c0(%rip), %rax    # 0x29bed0
movsd (%rax), %xmm1
movsd 0x9834(%rip), %xmm2     # 0x16f150
divsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x48(%rbp), %xmm1
leaq 0x112123(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x165952
leaq 0x112113(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x48(%rbp), %xmm0
leaq 0x1120fe(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x112101(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
jb 0x16598d
leaq 0x1120e3(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x1120e6(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x4c(%rbp), %xmm1
leaq 0x1120c3(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1659b2
leaq 0x1120b3(%rip), %rax    # 0x277a5c
cvtsi2ssl (%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x4c(%rbp), %xmm0
leaq 0x11209e(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x1120a1(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm1
ucomiss %xmm1, %xmm0
jb 0x1659ed
leaq 0x112083(%rip), %rax    # 0x277a5c
movl (%rax), %eax
leaq 0x112086(%rip), %rcx    # 0x277a68
addl (%rcx), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x4c(%rbp)
leaq 0x11206c(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
cvttss2si -0x48(%rbp), %esi
leaq 0x11205b(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x4c(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
leaq 0x112040(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
leaq 0x11202c(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
subl %eax, %edi
cvttss2si -0x48(%rbp), %esi
leaq 0x11200c(%rip), %rax    # 0x277a50
addl (%rax), %esi
leaq 0x112013(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x48(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
leaq 0x111ff8(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
leaq 0x111fe4(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
addl %eax, %edi
cvttss2si -0x48(%rbp), %esi
leaq 0x111fc4(%rip), %rax    # 0x277a50
addl (%rax), %esi
leaq 0x111fcb(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x48(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
leaq 0x111fb0(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
leaq 0x111f9c(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
subl %eax, %edi
cvttss2si -0x4c(%rbp), %esi
leaq 0x111f7c(%rip), %rax    # 0x277a50
subl (%rax), %esi
leaq 0x111f83(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x4c(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
leaq 0x111f68(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
leaq 0x111f54(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
addl %eax, %edi
cvttss2si -0x4c(%rbp), %esi
leaq 0x111f34(%rip), %rax    # 0x277a50
subl (%rax), %esi
leaq 0x111f3b(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x4c(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
jmp 0x165c4d
movss -0x4c(%rbp), %xmm0
subss -0x48(%rbp), %xmm0
callq 0x16e5e0
cvtss2sd %xmm0, %xmm0
leaq 0x111ef8(%rip), %rax    # 0x277a50
movl (%rax), %eax
shll $0x0, %eax
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
jb 0x165c49
leaq 0x111eee(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
cvttss2si -0x48(%rbp), %esi
leaq 0x111edd(%rip), %rax    # 0x277a60
movl (%rax), %edx
addl -0x1c(%rbp), %edx
cvttss2si -0x4c(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
leaq 0x111ec2(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
leaq 0x111eae(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
subl %eax, %edi
cvttss2si -0x48(%rbp), %esi
leaq 0x111e9e(%rip), %rax    # 0x277a60
movl (%rax), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x58(%rbp)
leaq 0x111e87(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0x58(%rbp), %edx
addl %eax, %edx
cvttss2si -0x48(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
leaq 0x111e6a(%rip), %rax    # 0x277a60
movl (%rax), %edi
addl -0x1c(%rbp), %edi
leaq 0x111e56(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
subl %eax, %edi
cvttss2si -0x4c(%rbp), %esi
leaq 0x111e46(%rip), %rax    # 0x277a60
movl (%rax), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x111e2f(%rip), %rax    # 0x277a58
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl -0x54(%rbp), %edx
addl %eax, %edx
cvttss2si -0x4c(%rbp), %ecx
movzbl -0x9(%rbp), %r8d
callq 0x109c0
jmp 0x165c4b
jmp 0x165c5d
jmp 0x165c4d
jmp 0x165c4f
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1655d0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)