// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: label_plots()
void label_plots()
{
COORD row, col;
COORD fft_col;
struct PLOT_Q q, q0, qq;
char *t;
char *s;
long i;
int id;
double val;
int len;
int max_len;
int month, day, year;
int hours, minutes, seconds;
double frac;
double old_utc, old_gps;
double q0_jd;
DATA_SIZE show_time;
int arrow_color;
int cursor_time_col;
int color;
u16 sat_flags;

   // label the plot with scale factors, etc
   if(text_mode) return;
   if(no_plots) return;
   if(rcvr_type == NO_RCVR) return;
   if(zoom_screen == 'P') ;
   else if(zoom_screen) return;
   if(first_key && SMALL_SCREEN) return;

   if(continuous_scroll) arrow_color = WHITE;
   else                  arrow_color = CYAN;


   fft_col = MOUSE_COL+40;
   no_x_margin = no_y_margin = 1;
   if(0) {  // erase the plot header area
      vidstr(CURSOR_TIME_ROW, 0, WHITE, &blanks[0]);  // was [TEXT_COLS-INFO_COL]);
      vidstr(CURSOR_VAL_ROW, 0,  WHITE, &blanks[0]);
      vidstr(STAT_ROW, 0,        WHITE, &blanks[0]);
      vidstr(REVIEW_ROW, 0,      WHITE, &blanks[0]);
      vidstr(REF_ROW, 0,         WHITE, &blanks[0]);
      vidstr(SCALE_ROW, 0,       WHITE, &blanks[0]);
   }
   else if((SCREEN_HEIGHT < TINY_TINY_HEIGHT) || (SCREEN_WIDTH < TINY_TINY_WIDTH)) {
      fill_rectangle(0,(MOUSE_ROW+3)*TEXT_HEIGHT, TEXT_COLS*TEXT_WIDTH,5*TEXT_HEIGHT, BLACK);
   }
   else {  // faster way to erase the plot header area
      fill_rectangle(0,(MOUSE_ROW+2)*TEXT_HEIGHT, TEXT_COLS*TEXT_WIDTH,6*TEXT_HEIGHT, BLACK);
   }

   t = "";
   row = PLOT_INFO_ROW;
   col = PLOT_TEXT_COL+0;

   if(review_mode) {
      if(review_home)  sprintf(out, "  ");
      else             sprintf(out, "%c ", LEFT_ARROW);
   }
   else {
      if(((plot_q_count*(long)plot_mag)/view_interval) >= PLOT_WIDTH) sprintf(out, "%c ", LEFT_ARROW);
      else sprintf(out, "  ");
   }
   vidstr(row, col, arrow_color, out);
   no_x_margin = no_y_margin = 0;


   hours   = pri_hours;     // save time
   minutes = pri_minutes;
   seconds = pri_seconds;
   frac    = pri_frac;
   day     = pri_day;
   month   = pri_month;
   year    = pri_year;
   old_utc = jd_utc;
   old_gps = jd_gps;



   // see if mouse is in the plot area,  if so get data point to display
   cursor_time_col = TEXT_COLS;
   col = PLOT_TEXT_COL+2;
   if(mouse_plot_valid) {
      if(filter_count) {
         q = filter_plot_q(last_mouse_q);
         jd_utc = filter_jd;
         sat_flags = filter_flags; // q.sat_flags;
      }
      else {
         q = get_plot_q(last_mouse_q);
         jd_utc = q.q_jd;
         sat_flags = q.sat_flags;
      }

      jd_gps = jd_utc + jtime(0,0,utc_offset,0.0);
      adjust_tz(1);  // tweak pri_ time for time zone

      if(top_line) {
         show_time = (DATA_SIZE) (view_interval*queue_interval*PLOT_WIDTH);  //seconds per screen
         show_time /= plot_mag;
         show_time /= (DATA_SIZE) 60.0;  // minutes/screen
         show_time /= (((DATA_SIZE) PLOT_WIDTH) / (DATA_SIZE) HORIZ_MAJOR);
         show_time /= nav_rate;
         sprintf(out, "Cursor time: %s %02d:%02d:%02d.%03d %s   View: %.1f min/div    ", fmt_date(0),
             pri_hours,pri_minutes,pri_seconds, (int) ((pri_frac*1000.0)+0.5),
             time_zone_set?tz_string:((q.sat_flags & UTC_TIME) ? "UTC":"GPS"),
             show_time
         );
      }
      else if(nav_rate && plot_mag) {
         if(cursor_time_ref) { // show cursor time interval from start of plot area
            val = ((double) (view_interval * mouse_x) / nav_rate) / (double) plot_mag;
         }
         else { // show cursor time interval from start of queue data
            q0 = get_plot_q(plot_q_out);
            q0_jd = (jd_utc - q0.q_jd) * (double) SECS_PER_DAY;
            val = q0_jd;
         }

         sprintf(out, "Cursor time: %s %02d:%02d:%02d.%03d %s  %s       ", fmt_date(0),
             pri_hours,pri_minutes,pri_seconds,  (int) ((pri_frac*1000.0)+0.5),
             time_zone_set?tz_string:((q.sat_flags & UTC_TIME) ? "UTC":"GPS"),
             fmt_secs(val)
         );
      }
      no_x_margin = no_y_margin = 1;
      color = MOUSE_COLOR;
      if(sat_flags & TIME_SKIP) color = SKIP_COLOR;
      if((SCREEN_HEIGHT < TINY_TINY_HEIGHT) || (SCREEN_WIDTH < TINY_TINY_WIDTH)) { // piss
         vidstr(CURSOR_TIME_ROW+1, PLOT_TEXT_COL+2, color, out);
      }
      else {
         vidstr(CURSOR_TIME_ROW, PLOT_TEXT_COL+2, color, out);
      }
      cursor_time_col = PLOT_TEXT_COL+2+strlen(out);
      no_x_margin = no_y_margin = 0;

      pri_hours   = hours;      // restore time
      pri_minutes = minutes;
      pri_seconds = seconds;
      pri_frac    = frac;
      pri_day     = day;
      pri_month   = month;
      pri_year    = year;
      jd_utc      = old_utc;
      jd_gps      = old_gps;
   }

   if(review_mode) {  // we are scrolling around in the plot queue data
      i = plot_q_out + plot_start;
      while(i >= plot_q_size) i -= plot_q_size;
      qq = get_plot_q(i);

      jd_utc = qq.q_jd;
      jd_gps = jd_utc + jtime(0,0,utc_offset,0.0);
      adjust_tz(2);  // tweak pri_ time for time zone

      if(view_all_data == 1) s = "All";
      else if(view_all_data == 2) s = "Auto";
      else s = "Review";

      sprintf(out, "%s (DEL to stop): %s %02d:%02d:%02d.%03d %s         ", s, fmt_date(0),
          pri_hours,pri_minutes,pri_seconds, (int) ((pri_frac*1000.0)+0.5),
          time_zone_set?tz_string:(qq.sat_flags & UTC_TIME) ? "UTC":"GPS");

      pri_hours   = hours;      // restore time
      pri_minutes = minutes;
      pri_seconds = seconds;
      pri_frac    = frac;
      pri_day     = day;
      pri_month   = month;
      pri_year    = year;
      jd_utc      = old_utc;
      jd_gps      = old_gps;

      no_x_margin = no_y_margin = 1;
      vidstr(REVIEW_ROW, PLOT_TEXT_COL+2,  CYAN, out);
      no_x_margin = no_y_margin = 0;
   }

   vidstr(CURSOR_VAL_ROW, 0, WHITE, &blanks[0]);
   for(id=0; id<NUM_PLOTS+DERIVED_PLOTS; id++) {  // show the plot values
      if(plot[id].show_plot == 0) continue;
      if(id == FFT) fft_col = col;

      max_len = 0;

      // show the plot scale factors
      len = label_plot_scale(id, col);
      if(len > max_len) max_len = len;


      // now show the plot zero reference line value
      len = label_plot_ref(id, col);
      if(len > max_len) max_len = len;


      // now we show the statistics values
      if(stat_count == 0.0) goto no_stats;
      if(all_adevs && (mixed_adevs == MIXED_NONE)) goto no_stats;
      len = label_plot_stats(id, col);
      if(len > max_len) max_len = len;


      // now display the cursor info
      no_stats:
      if(mouse_plot_valid == 0) goto no_mouse_info;
      if(queue_interval <= 0) goto no_mouse_info;
      len = label_plot_cursor_val(id, col, q);

      if(len > max_len) max_len = len;

      no_mouse_info:
      col += (max_len+1);
      if(col >= TEXT_COLS) break;
   }

   if(NO_SATS) ;
   else if(0 && mouse_plot_valid && plot_sat_count) {
      no_x_margin = no_y_margin = 1;
      sprintf(out, "Sats:%d", q.sat_flags & 0xFF);
      if(((unsigned) col) < (TEXT_COLS-strlen(out)-2)) {
         vidstr(CURSOR_VAL_ROW, col, CYAN, out);
      }
      no_x_margin = no_y_margin = 0;
   }

#ifdef FFT_STUFF
   if(plot[FFT].show_plot && fft_scale) {  // hist_plot
      out[0] = 0;
      if(fft_type == FFT_TYPE) {
         i = last_mouse_q - fft_queue_0;
         if(i < 0) i += plot_q_size;
         i /= (S32) fft_scale;
         val = (double) i * fps;
         if(i > (fft_length/2)) sprintf(out, "              ");
         else if(val) {
            val = 1.0/val;
            sprintf(out, "%s: %-.1f sec     ", plot[fft_id].plot_id, val);
         }
         else sprintf(out, "%s: DC blocked    ", plot[fft_id].plot_id);
      }
      else {  // histogram
         if(mouse_plot_valid && (mouse_x >= 0) && (mouse_x < hist_size)) {
            val = hist_minv + hist_bin_width*(DATA_SIZE) mouse_x;
//          val *= plot[fft_id].ref_scale;  // !!!!! ref_scale not always correct
            if(tie_plot(fft_id) && plot[fft_id].show_freq) {  // frequency mode
               sprintf(out, "%s: %f %s", plot[fft_id].plot_id, val, "Hz");
            }
            else if((rcvr_type == X72_RCVR) && (fft_id == OSC)) {
               sprintf(out, "%s: %.6g %s", plot[fft_id].plot_id, val, plot[fft_id].units);
            }
            else {
               sprintf(out, "%s: %f %s", plot[fft_id].plot_id, val, plot[fft_id].units);
            }
         }
      }

      no_x_margin = no_y_margin = 1;
//    if(fft_col < cursor_time_col) fft_col = cursor_time_col;
      if(mouse_plot_valid) {
         vidstr(FFT_VAL_ROW, fft_col, WHITE, &blanks[TEXT_COLS-fft_col]);  // erase the plot info area
         vidstr(FFT_VAL_ROW, fft_col, plot[FFT].plot_color, out);
      }
      no_x_margin = no_y_margin = 0;
   }
#endif



   row = PLOT_INFO_ROW;
   config_extra_plots();
   if((extra_plots == 0) && (SCREEN_WIDTH >= MEDIUM_WIDTH)) {
      no_x_margin = no_y_margin = 1;
      #ifdef ADEV_STUFF
         if((all_adevs == SINGLE_ADEVS) || (mixed_adevs != MIXED_GRAPHS)) {
            if     (ATYPE == OSC_ADEV) t = "ADEV";
            else if(ATYPE == OSC_HDEV) t = "HDEV";
            else if(ATYPE == OSC_MDEV) t = "MDEV";
            else if(ATYPE == OSC_TDEV) t = "TDEV";
            else if(ATYPE == PPS_ADEV) t = "ADEV";
            else if(ATYPE == PPS_HDEV) t = "HDEV";
            else if(ATYPE == PPS_MDEV) t = "MDEV";
            else if(ATYPE == PPS_TDEV) t = "TDEV";
            else if(ATYPE == CHC_ADEV) t = "ADEV";
            else if(ATYPE == CHC_HDEV) t = "HDEV";
            else if(ATYPE == CHC_MDEV) t = "MDEV";
            else if(ATYPE == CHC_TDEV) t = "TDEV";
            else if(ATYPE == CHD_ADEV) t = "ADEV";
            else if(ATYPE == CHD_HDEV) t = "HDEV";
            else if(ATYPE == CHD_MDEV) t = "MDEV";
            else if(ATYPE == CHD_TDEV) t = "TDEV";
            else if(ATYPE == A_MTIE)   t = "MTIE";
            else if(ATYPE == B_MTIE)   t = "MTIE";
            else if(ATYPE == C_MTIE)   t = "MTIE";
            else if(ATYPE == D_MTIE)   t = "MTIE";
            else                       t = "?DEV";

            sprintf(out, "%s %s       ", plot[PPS].plot_id, t);
            if(plot_adev_data) vidstr(row, PLOT_TEXT_COL+85,  PPS_ADEV_COLOR, out);
            else               vidstr(row, PLOT_TEXT_COL+85,  GREY,           out);

            sprintf(out, "%s %s       ", plot[OSC].plot_id, t);
            if(plot_adev_data) vidstr(row, PLOT_TEXT_COL+100, OSC_ADEV_COLOR, out);
            else               vidstr(row, PLOT_TEXT_COL+100, GREY,           out);

            // aaaahbbb - what about chC and chD? !!!!!!!
         }
      #endif
      no_x_margin = no_y_margin = 0;
   }

   if(right_arrow) {
      sprintf(out, " %c", RIGHT_ARROW);
      no_x_margin = no_y_margin = 1;
      vidstr(PLOT_INFO_ROW, (SCREEN_WIDTH/TEXT_WIDTH)-2, arrow_color, out);
      no_x_margin = no_y_margin = 0;
   }

   no_x_margin = no_y_margin = 0;
}

// Assembly:
cmpl $0x0, 0x202a87(%rip)    # 0x2187d8
jne 0x169be
cmpl $0x0, 0x32a00a(%rip)    # 0x33fd68
jne 0x169be
cmpq $0x400, 0x202b61(%rip) # imm = 0x400
je 0x169be
movzbl 0x2f6a2c(%rip), %eax    # 0x30c7a8
cmpl $0x50, %eax
je 0x15d89
testl %eax, %eax
jne 0x169be
cmpl $0x0, 0x2291c8(%rip)    # 0x23ef58
je 0x15dce
imull $0x31a, 0x20d7a8(%rip), %eax # imm = 0x31A
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
cmpl %eax, 0x202a48(%rip)    # 0x218800
jl 0x169be
cmpl $0x258, 0x202a3c(%rip)  # imm = 0x258
jl 0x169be
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
cmpb $0x0, 0x2055df(%rip)    # 0x21b3c8
setne %r15b
shlb $0x2, %r15b
orb $0xb, %r15b
movl 0x2029b0(%rip), %r13d   # 0x2187ac
movb $0x1, %al
movb %al, 0x202a57(%rip)     # 0x21885b
movb %al, 0x202a50(%rip)     # 0x21885a
cmpl $0x190, 0x2029f0(%rip)  # imm = 0x190
setl %al
cmpl $0x1c2, 0x2029df(%rip)  # imm = 0x1C2
setl %cl
orb %al, %cl
movl 0x20297c(%rip), %eax    # 0x2187a8
movl 0x2029e2(%rip), %edi    # 0x218814
movl 0x2029d8(%rip), %edx    # 0x218810
imull 0x2029c9(%rip), %edx    # 0x218808
movzbl %cl, %esi
movl $0x6, %ecx
subl %esi, %ecx
addl %eax, %esi
addl $0x2, %esi
imull %edi, %esi
imull %edi, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
callq 0xf30c
movl 0x202944(%rip), %ebx    # 0x2187a8
addl $0x7, %ebx
movl 0x202a1e(%rip), %r14d   # 0x21888c
cmpb $0x0, 0x226ecb(%rip)    # 0x23cd40
je 0x15e92
cmpb $0x0, 0x226ec3(%rip)    # 0x23cd41
je 0x15eb6
movb $0x0, 0x32639b(%rip)    # 0x33c222
movw $0x2020, 0x326390(%rip) # imm = 0x2020
jmp 0x15ed0
movslq 0x205537(%rip), %rax    # 0x21b3d0
imulq 0x205497(%rip), %rax    # 0x21b338
cqto
idivq 0x2054f6(%rip)          # 0x21b3a0
movslq 0x2029d3(%rip), %rcx    # 0x218884
cmpq %rcx, %rax
jl 0x15e80
leaq 0x326363(%rip), %rdi    # 0x33c220
leaq 0x1125ad(%rip), %rsi    # 0x128471
movl $0x1b, %edx
xorl %eax, %eax
callq 0x9060
movzbl %r15b, %edx
leaq 0x326345(%rip), %rcx    # 0x33c220
movl %ebx, %edi
movl %r14d, %esi
movl %edx, -0x70(%rbp)
callq 0xe7d0
xorl %eax, %eax
movb %al, 0x20296b(%rip)     # 0x21885b
movb %al, 0x202964(%rip)     # 0x21885a
movl 0x2f760b(%rip), %r12d   # 0x30d508
movl 0x2f7601(%rip), %ecx    # 0x30d504
movl %ecx, -0x60(%rbp)
movl 0x2f75f4(%rip), %ecx    # 0x30d500
movl %ecx, -0x5c(%rbp)
movsd 0x2f7601(%rip), %xmm0   # 0x30d518
movsd %xmm0, -0x88(%rbp)
movl 0x2f75e7(%rip), %ecx    # 0x30d50c
movl %ecx, -0x58(%rbp)
movl 0x2f75e2(%rip), %ecx    # 0x30d510
movl %ecx, -0x54(%rbp)
movl 0x2f75dd(%rip), %ecx    # 0x30d514
movl %ecx, -0x50(%rbp)
movsd 0x2f75ee(%rip), %xmm0   # 0x30d530
movsd %xmm0, -0x80(%rbp)
movsd 0x2f75e9(%rip), %xmm0   # 0x30d538
movsd %xmm0, -0x78(%rbp)
movl 0x202931(%rip), %r14d   # 0x21888c
cmpb %al, 0x2052f7(%rip)     # 0x21b258
je 0x15fd3
cmpq $0x0, 0x205505(%rip)    # 0x21b470
je 0x15fdb
movq 0x205304(%rip), %rsi    # 0x21b278
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x11c44
movzwl (%rbx), %eax
movl %eax, -0x34(%rbp)
movl 0x2(%rbx), %eax
movl %eax, -0x4c(%rbp)
movzwl 0x6(%rbx), %eax
movw %ax, -0x48(%rbp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
leaq -0x138(%rbp), %rsi
leaq -0x298(%rbp), %rdi
movl $0xa0, %edx
callq 0x92b0
movsd 0x32a28f(%rip), %xmm0   # 0x340250
movsd %xmm0, 0x2f7567(%rip)   # 0x30d530
movzwl 0x32a287(%rip), %r15d   # 0x340258
jmp 0x16036
movl %eax, -0x34(%rbp)
jmp 0x16379
movq 0x205296(%rip), %rsi    # 0x21b278
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x10141
movzwl (%rbx), %r15d
movl 0x2(%rbx), %eax
movl %eax, -0x4c(%rbp)
movzwl 0x6(%rbx), %eax
movw %ax, -0x48(%rbp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
leaq -0x138(%rbp), %rsi
leaq -0x298(%rbp), %rdi
movl $0xa0, %edx
callq 0x92b0
movsd -0x68(%rbp), %xmm0
movsd %xmm0, 0x2f74fe(%rip)   # 0x30d530
movl %r15d, -0x34(%rbp)
movsd 0x2f74f2(%rip), %xmm0   # 0x30d530
movsd %xmm0, -0x40(%rbp)
movl 0x2f76df(%rip), %edx    # 0x30d728
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xd41e0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x2f74d5(%rip)   # 0x30d538
movl $0x1, %edi
callq 0xe1b3f
cmpl $0x0, 0x2027cc(%rip)    # 0x218840
je 0x1615f
movq 0x205317(%rip), %rax    # 0x21b398
imulq 0x205317(%rip), %rax    # 0x21b3a0
movslq 0x2027f4(%rip), %rcx    # 0x218884
imulq %rcx, %rax
cvtsi2sd %rax, %xmm2
xorps %xmm0, %xmm0
cvtsi2sdl 0x20532c(%rip), %xmm0 # 0x21b3d0
divsd %xmm0, %xmm2
divsd 0xf2f58(%rip), %xmm2    # 0x109008
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
cvtsi2sdl 0x2027b5(%rip), %xmm1 # 0x218874
divsd %xmm1, %xmm0
divsd %xmm0, %xmm2
divsd 0x205289(%rip), %xmm2   # 0x21b358
movsd %xmm2, -0x40(%rbp)
xorl %edi, %edi
callq 0xef1b0
movl 0x2f7427(%rip), %ecx    # 0x30d508
movsd 0x2f742f(%rip), %xmm0   # 0x30d518
mulsd 0xf2f47(%rip), %xmm0    # 0x109038
addsd 0xf2f6f(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %r10d
movl 0x2f73ff(%rip), %r8d    # 0x30d504
btl $0x9, -0x34(%rbp)
leaq 0x11d6f0(%rip), %rdx    # 0x133801
leaq 0x11eca6(%rip), %rsi    # 0x134dbe
cmovaeq %rdx, %rsi
cmpb $0x0, 0x2f7771(%rip)    # 0x30d894
movl 0x2f73d6(%rip), %r9d    # 0x30d500
leaq 0x2f77ff(%rip), %r11    # 0x30d930
cmoveq %rsi, %r11
leaq 0x3260e4(%rip), %rdi    # 0x33c220
leaq 0xf4702(%rip), %rsi     # 0x10a845
movq %rax, %rdx
movsd -0x40(%rbp), %xmm0
movb $0x1, %al
pushq %r11
pushq %r10
callq 0x9060
addq $0x10, %rsp
jmp 0x162b4
movsd 0x2051f1(%rip), %xmm0   # 0x21b358
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
setp %al
setne %cl
orb %al, %cl
movl 0x205253(%rip), %eax    # 0x21b3d0
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x162b4
cmpl $0x0, 0x20510c(%rip)    # 0x21b2a0
movl %r13d, -0x30(%rbp)
movl %r12d, -0x44(%rbp)
je 0x161cb
movslq 0x20509b(%rip), %rcx    # 0x21b240
imulq 0x2051f3(%rip), %rcx    # 0x21b3a0
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
divsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, -0x40(%rbp)
jmp 0x161f4
movq 0x20515e(%rip), %rsi    # 0x21b330
movq %rbx, %rdi
callq 0x10141
movsd 0x2f734e(%rip), %xmm0   # 0x30d530
subsd 0x8(%rbx), %xmm0
mulsd 0xf2e29(%rip), %xmm0    # 0x109018
movsd %xmm0, -0x40(%rbp)
xorl %edi, %edi
callq 0xef1b0
movq %rax, -0x98(%rbp)
movl 0x2f7300(%rip), %eax    # 0x30d508
movl %eax, -0x6c(%rbp)
movsd 0x2f7305(%rip), %xmm0   # 0x30d518
mulsd 0xf2e1d(%rip), %xmm0    # 0x109038
addsd 0xf2e45(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %eax
movq %rax, -0x90(%rbp)
movl 0x2f72d0(%rip), %ebx    # 0x30d504
btl $0x9, -0x34(%rbp)
leaq 0x11d5c1(%rip), %rax    # 0x133801
leaq 0x11eb77(%rip), %rcx    # 0x134dbe
cmovaeq %rax, %rcx
cmpb $0x0, 0x2f7642(%rip)    # 0x30d894
movl 0x2f72a7(%rip), %r13d   # 0x30d500
leaq 0x2f76d0(%rip), %r12    # 0x30d930
cmoveq %rcx, %r12
movsd -0x40(%rbp), %xmm0
callq 0x133f8
subq $0x8, %rsp
leaq 0x32a1e7(%rip), %r10    # 0x340460
leaq 0x325fa0(%rip), %rdi    # 0x33c220
leaq 0xf45fe(%rip), %rsi     # 0x10a885
movq -0x98(%rbp), %rdx
movl -0x6c(%rbp), %ecx
movl %ebx, %r8d
movl %r13d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r12
pushq -0x90(%rbp)
callq 0x9060
addq $0x20, %rsp
movl -0x30(%rbp), %r13d
movl -0x44(%rbp), %r12d
movb $0x1, %al
movb %al, 0x20259f(%rip)     # 0x21885b
cmpl $0x190, 0x20253e(%rip)  # imm = 0x190
movb %al, 0x20258e(%rip)     # 0x21885a
setl %al
cmpl $0x1c2, 0x202527(%rip)  # imm = 0x1C2
setl %cl
orb %al, %cl
movl 0x2025a8(%rip), %esi    # 0x21888c
addl $0x2, %esi
xorl %ebx, %ebx
btl $0xa, %r15d
movl 0x2024b4(%rip), %eax    # 0x2187a8
movzbl %cl, %ecx
leal 0x2(%rax,%rcx), %edi
movl $0x0, %edx
adcl $0xb, %edx
leaq 0x325f16(%rip), %rcx    # 0x33c220
callq 0xe7d0
movb %bl, 0x202546(%rip)     # 0x21885b
movb %bl, 0x20253f(%rip)     # 0x21885a
movl %r12d, 0x2f71e6(%rip)   # 0x30d508
movl -0x60(%rbp), %eax
movl %eax, 0x2f71d9(%rip)    # 0x30d504
movl -0x5c(%rbp), %eax
movl %eax, 0x2f71cc(%rip)    # 0x30d500
movsd -0x88(%rbp), %xmm0
movsd %xmm0, 0x2f71d4(%rip)   # 0x30d518
movl -0x58(%rbp), %eax
movl %eax, 0x2f71bf(%rip)    # 0x30d50c
movl -0x54(%rbp), %eax
movl %eax, 0x2f71ba(%rip)    # 0x30d510
movl -0x50(%rbp), %eax
movl %eax, 0x2f71b5(%rip)    # 0x30d514
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x2f71c4(%rip)   # 0x30d530
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x2f71bf(%rip)   # 0x30d538
cmpb $0x0, 0x2269c0(%rip)    # 0x23cd40
je 0x16553
movl %r12d, -0x44(%rbp)
movl %r13d, -0x30(%rbp)
movq 0x204f8b(%rip), %rax    # 0x21b320
movq 0x204fac(%rip), %rsi    # 0x21b348
addq %rax, %rsi
addq 0x204f8a(%rip), %rsi    # 0x21b330
subq %rax, %rsi
cmpq %rax, %rsi
jge 0x163a6
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x10141
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x40(%rbp)
btl $0x9, (%rbx)
movsd %xmm0, 0x2f715d(%rip)   # 0x30d530
movl 0x2f734f(%rip), %edx    # 0x30d728
leaq 0x11d421(%rip), %rax    # 0x133801
leaq 0x11e9d7(%rip), %rbx    # 0x134dbe
cmovaeq %rax, %rbx
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xd41e0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x2f7130(%rip)   # 0x30d538
movl $0x2, %edi
callq 0xe1b3f
movb 0x204fad(%rip), %al     # 0x21b3c5
cmpb $0x2, %al
leaq 0xf449a(%rip), %rcx     # 0x10a8bb
leaq 0xf4498(%rip), %rdx     # 0x10a8c0
cmoveq %rcx, %rdx
movb $0x1, %r13b
cmpb %r13b, %al
leaq 0xf447e(%rip), %r15     # 0x10a8b7
cmovneq %rdx, %r15
xorl %edi, %edi
callq 0xef1b0
movl 0x2f70bd(%rip), %r8d    # 0x30d508
movl 0x2f70b2(%rip), %r9d    # 0x30d504
movsd 0x2f70be(%rip), %xmm0   # 0x30d518
mulsd 0xf2bd6(%rip), %xmm0    # 0x109038
addsd 0xf2bfe(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %r10d
cmpb %r12b, 0x2f741e(%rip)   # 0x30d894
movl 0x2f7083(%rip), %r11d   # 0x30d500
leaq 0x2f74ac(%rip), %r12    # 0x30d930
cmoveq %rbx, %r12
subq $0x8, %rsp
leaq 0x325d8d(%rip), %rbx    # 0x33c220
leaq 0xf442d(%rip), %rsi     # 0x10a8c7
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
pushq %r12
pushq %r10
pushq %r11
callq 0x9060
addq $0x20, %rsp
movl -0x44(%rbp), %eax
movl %eax, 0x2f704b(%rip)    # 0x30d508
movl -0x60(%rbp), %eax
movl %eax, 0x2f703e(%rip)    # 0x30d504
movl -0x5c(%rbp), %eax
movl %eax, 0x2f7031(%rip)    # 0x30d500
movsd -0x88(%rbp), %xmm0
movsd %xmm0, 0x2f7039(%rip)   # 0x30d518
movl -0x58(%rbp), %eax
movl %eax, 0x2f7024(%rip)    # 0x30d50c
movl -0x54(%rbp), %eax
movl %eax, 0x2f701f(%rip)    # 0x30d510
movl -0x50(%rbp), %eax
movl %eax, 0x2f701a(%rip)    # 0x30d514
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x2f7029(%rip)   # 0x30d530
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x2f7024(%rip)   # 0x30d538
movb %r13b, 0x202340(%rip)   # 0x21885b
movb %r13b, 0x202338(%rip)   # 0x21885a
movl 0x202280(%rip), %edi    # 0x2187a8
addl $0x3, %edi
movl 0x20235b(%rip), %esi    # 0x21888c
addl $0x2, %esi
movl $0xb, %edx
movq %rbx, %rcx
callq 0xe7d0
xorl %eax, %eax
movb %al, 0x202312(%rip)     # 0x21885b
movb %al, 0x20230b(%rip)     # 0x21885a
movl -0x30(%rbp), %r13d
addl $0x28, %r13d
addl $0x2, %r14d
movl 0x202247(%rip), %edi    # 0x2187a8
addl $0x4, %edi
leaq 0x325aa5(%rip), %rcx    # 0x33c010
xorl %esi, %esi
movl $0xf, %edx
callq 0xe7d0
leaq 0x1477ca(%rip), %rbx    # 0x15dd48
xorl %r15d, %r15d
cmpl $0x0, (%rbx)
je 0x1669b
cmpq $0xe, %r15
cmovel %r14d, %r13d
movl %r13d, -0x30(%rbp)
movq %r14, %r12
movl %r15d, %edi
movl %r12d, %esi
callq 0x13ed1
movl %eax, %r13d
movl %r15d, %edi
movl %r12d, %esi
callq 0x145b0
movl %eax, %r12d
cmpl %eax, %r13d
cmovgl %r13d, %r12d
testl %r12d, %r12d
movl $0x0, %eax
cmovlel %eax, %r12d
movsd 0x2f69c0(%rip), %xmm0   # 0x30cf90
ucomisd 0xf2b40(%rip), %xmm0    # 0x109118
jne 0x165dc
jnp 0x16600
cmpb $0x0, 0x22675b(%rip)    # 0x23cd3e
je 0x165ee
cmpb $0x0, 0x226751(%rip)    # 0x23cd3d
je 0x16600
movl %r15d, %edi
movl %r14d, %esi
callq 0x14ba5
cmpl %r12d, %eax
cmovgl %eax, %r12d
movl -0x30(%rbp), %r13d
cmpb $0x0, 0x204c4d(%rip)    # 0x21b258
je 0x1668c
cmpq $0x0, 0x204d83(%rip)    # 0x21b398
jle 0x1668c
movl -0x34(%rbp), %eax
movw %ax, -0x1f8(%rbp)
movzwl -0x48(%rbp), %eax
leaq -0x1f6(%rbp), %rcx
movw %ax, 0x4(%rcx)
movl -0x4c(%rbp), %eax
movl %eax, (%rcx)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movl $0xa0, %edx
leaq -0x1e8(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x92b0
subq $0xb0, %rsp
movl $0x16, %ecx
movq %rsp, %rdi
leaq -0x1f8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r15d, %edi
movl %r14d, %esi
callq 0x15436
addq $0xb0, %rsp
cmpl %r12d, %eax
cmovgl %eax, %r12d
addl %r12d, %r14d
incl %r14d
cmpl 0x20216f(%rip), %r14d   # 0x218808
jge 0x166af
incq %r15
addq $0xe8, %rbx
cmpq $0x14, %r15
jne 0x16581
cmpl $0x0, 0x148342(%rip)    # 0x15e9f8
setne %al
movq 0x3296c8(%rip), %rcx    # 0x33fd88
testq %rcx, %rcx
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x16905
movb $0x0, 0x325b48(%rip)    # 0x33c220
cmpb $0x0, 0x204d9e(%rip)    # 0x21b47d
je 0x1677b
cmpb $0x0, 0x204b6c(%rip)    # 0x21b258
je 0x16896
movl 0x204b48(%rip), %eax    # 0x21b240
testl %eax, %eax
js 0x16896
cmpq %rax, 0x20cd89(%rip)    # 0x223490
jle 0x16896
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x20cd8c(%rip), %xmm0   # 0x2234a8
addsd 0x20cd74(%rip), %xmm0   # 0x223498
movsd %xmm0, -0x30(%rbp)
movzbl 0x204d4e(%rip), %ebx    # 0x21b47e
movl %ebx, %edi
callq 0x13ccd
testl %eax, %eax
je 0x167e2
imulq $0xe8, %rbx, %rcx
leaq 0x1475e3(%rip), %rax    # 0x15dd30
cmpl $0x0, 0xd0(%rcx,%rax)
je 0x167e2
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x325ab8(%rip), %rdi    # 0x33c220
leaq 0xf41b3(%rip), %rsi     # 0x10a922
leaq 0xff9ee(%rip), %rcx     # 0x116164
jmp 0x1688a
movq 0x204af6(%rip), %rdx    # 0x21b278
subq 0x32960f(%rip), %rdx    # 0x33fd98
movq %rdx, %rax
sarq $0x3f, %rax
andq 0x204b89(%rip), %rax    # 0x21b320
addq %rdx, %rax
movslq %ecx, %rcx
cqto
idivq %rcx
movq 0x3295d7(%rip), %rcx    # 0x33fd80
movq %rcx, %rdx
shrq $0x3f, %rdx
addq %rcx, %rdx
sarq %rdx
cmpq %rdx, %rax
jle 0x1681c
movabsq $0x20202020202020, %rax # imm = 0x20202020202020
movq %rax, 0x325a5b(%rip)    # 0x33c227
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, 0x325a43(%rip)    # 0x33c220
jmp 0x16896
imulq $0xe8, %rbx, %rax
leaq 0x147540(%rip), %rcx    # 0x15dd30
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rcx
cmpq $0x1, %rbx
jne 0x1687c
cmpq $0x2000000, 0x2020c6(%rip) # imm = 0x2000000
jne 0x1687c
leaq 0x325a0d(%rip), %rdi    # 0x33c220
leaq 0xf4112(%rip), %rsi     # 0x10a92c
jmp 0x1688a
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
cvtss2sd 0x329564(%rip), %xmm1   # 0x33fd90
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x16840
jnp 0x169bf
movsd 0xf2828(%rip), %xmm0    # 0x109070
divsd %xmm1, %xmm0
movzbl 0x204c2b(%rip), %eax    # 0x21b47e
imulq $0xe8, %rax, %rax
leaq 0x1474cf(%rip), %rcx    # 0x15dd30
movq (%rax,%rcx), %rdx
leaq 0x3259b4(%rip), %rdi    # 0x33c220
leaq 0xf4089(%rip), %rsi     # 0x10a8fc
movb $0x1, %al
callq 0x9060
jmp 0x16896
leaq 0x32599d(%rip), %rdi    # 0x33c220
leaq 0xf4098(%rip), %rsi     # 0x10a922
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movb $0x1, %al
movb %al, 0x201fbd(%rip)     # 0x21885b
movb %al, 0x201fb6(%rip)     # 0x21885a
cmpb $0x0, 0x2049ad(%rip)    # 0x21b258
je 0x168f7
movl 0x201ef5(%rip), %edi    # 0x2187a8
addl $0x3, %edi
movslq 0x201f4b(%rip), %rax    # 0x218808
movslq %r13d, %rbx
subq %rbx, %rax
leaq 0x325746(%rip), %rcx    # 0x33c010
addq %rax, %rcx
movl %ebx, %esi
movl $0xf, %edx
callq 0xe7d0
movl 0x201ec9(%rip), %edi    # 0x2187a8
addl $0x3, %edi
movzbl 0x148117(%rip), %edx    # 0x15ea00
leaq 0x325930(%rip), %rcx    # 0x33c220
movl %ebx, %esi
callq 0xe7d0
xorl %eax, %eax
movb %al, 0x201f5c(%rip)     # 0x21885b
movb %al, 0x201f55(%rip)     # 0x21885a
movl 0x329449(%rip), %eax    # 0x33fd54
movl $0x1, 0x32943f(%rip)    # 0x33fd54
cmpl $0x1, %eax
je 0x16936
cmpq $0x10000, 0x201fab(%rip) # imm = 0x10000
movl $0x1, 0x201f15(%rip)    # 0x218844
sete 0x204aa3(%rip)          # 0x21b3d9
cmpl $0x0, 0x329c1f(%rip)    # 0x34055c
je 0x1699f
leaq 0x3258da(%rip), %rbx    # 0x33c220
leaq 0x1170c8(%rip), %rsi    # 0x12da15
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x1a, %edx
xorl %eax, %eax
callq 0x9060
movb $0x1, %al
movb %al, 0x201ef4(%rip)     # 0x21885b
movb %al, 0x201eed(%rip)     # 0x21885a
movl 0x201e35(%rip), %edi    # 0x2187a8
addl $0x7, %edi
movl 0x201e84(%rip), %eax    # 0x218800
cltd
idivl 0x201e8d(%rip)          # 0x218810
leal -0x2(%rax), %esi
movl -0x70(%rbp), %edx
movq %rbx, %rcx
callq 0xe7d0
movb %r14b, 0x201ec3(%rip)   # 0x21885b
movb %r14b, 0x201ebb(%rip)   # 0x21885a
xorl %eax, %eax
movb %al, 0x201eb4(%rip)     # 0x21885b
movb %al, 0x201ead(%rip)     # 0x21885a
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x204ab8(%rip), %eax    # 0x21b47e
imulq $0xe8, %rax, %rax
leaq 0x14735c(%rip), %rcx    # 0x15dd30
movq (%rax,%rcx), %rdx
leaq 0x325841(%rip), %rdi    # 0x33c220
leaq 0xf3f29(%rip), %rsi     # 0x10a90f
xorl %eax, %eax
callq 0x9060
jmp 0x16896