// File: /workspace/github_cpp_makefile_star2_O2/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, 0x1ed442(%rip)    # 0x2027d8
jne 0x16097
cmpl $0x0, 0x3149c5(%rip)    # 0x329d68
jne 0x16097
cmpq $0x400, 0x1ed51c(%rip) # imm = 0x400
je 0x16097
movzbl 0x2e13e7(%rip), %eax    # 0x2f67a8
cmpl $0x50, %eax
je 0x153ce
testl %eax, %eax
jne 0x16097
cmpl $0x0, 0x213b83(%rip)    # 0x228f58
movl 0x1ed429(%rip), %esi    # 0x202804
movl 0x1ed41f(%rip), %ecx    # 0x202800
je 0x15409
imull $0x31a, 0x1f8157(%rip), %eax # imm = 0x31A
pushq $0x64
popq %rdi
cltd
idivl %edi
cmpl %eax, %ecx
setl %al
cmpl $0x258, %esi            # imm = 0x258
setl %dl
orb %al, %dl
jne 0x16097
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
cmpb $0x0, 0x1effa4(%rip)    # 0x2053c8
setne %r15b
shlb $0x2, %r15b
orb $0xb, %r15b
movl 0x1ed375(%rip), %r13d   # 0x2027ac
movb $0x1, %al
movb %al, 0x1ed41c(%rip)     # 0x20285b
movb %al, 0x1ed415(%rip)     # 0x20285a
cmpl $0x190, %esi            # imm = 0x190
setl %al
cmpl $0x1c2, %ecx            # imm = 0x1C2
setl %cl
orb %al, %cl
movl 0x1ed349(%rip), %eax    # 0x2027a8
movl 0x1ed3af(%rip), %edi    # 0x202814
movl 0x1ed3a5(%rip), %edx    # 0x202810
imull 0x1ed396(%rip), %edx    # 0x202808
movzbl %cl, %esi
pushq $0x6
popq %rcx
subl %esi, %ecx
addl %eax, %esi
addl $0x2, %esi
imull %edi, %esi
imull %edi, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
callq 0xed4b
movl 0x1ed313(%rip), %ebx    # 0x2027a8
addl $0x7, %ebx
movl 0x1ed3ed(%rip), %r14d   # 0x20288c
cmpb $0x0, 0x21189a(%rip)    # 0x226d40
je 0x154c3
cmpb $0x0, 0x211892(%rip)    # 0x226d41
je 0x154e7
movb $0x0, 0x310d6a(%rip)    # 0x326222
movw $0x2020, 0x310d5f(%rip) # imm = 0x2020
jmp 0x154ff
movslq 0x1eff06(%rip), %rax    # 0x2053d0
imulq 0x1efe66(%rip), %rax    # 0x205338
cqto
idivq 0x1efec5(%rip)          # 0x2053a0
movslq 0x1ed3a2(%rip), %rcx    # 0x202884
cmpq %rcx, %rax
jl 0x154b1
leaq 0x310d32(%rip), %rdi    # 0x326220
leaq 0xfcf8c(%rip), %rsi     # 0x112481
pushq $0x1b
popq %rdx
xorl %eax, %eax
callq 0x9060
movzbl %r15b, %edx
leaq 0x310d16(%rip), %rcx    # 0x326220
movl %ebx, %edi
movl %r14d, %esi
movl %edx, -0x68(%rbp)
callq 0xe2d2
xorl %eax, %eax
movb %al, 0x1ed33c(%rip)     # 0x20285b
movb %al, 0x1ed335(%rip)     # 0x20285a
movl 0x2e1fdc(%rip), %r12d   # 0x2f7508
movl 0x2e1fd2(%rip), %ecx    # 0x2f7504
movl %ecx, -0x60(%rbp)
movl 0x2e1fc5(%rip), %ecx    # 0x2f7500
movl %ecx, -0x5c(%rbp)
movsd 0x2e1fd2(%rip), %xmm0   # 0x2f7518
movsd %xmm0, -0x80(%rbp)
movl 0x2e1fbb(%rip), %ecx    # 0x2f750c
movl %ecx, -0x58(%rbp)
movl 0x2e1fb6(%rip), %ecx    # 0x2f7510
movl %ecx, -0x54(%rbp)
movl 0x2e1fb1(%rip), %ecx    # 0x2f7514
movl %ecx, -0x50(%rbp)
movsd 0x2e1fc2(%rip), %xmm0   # 0x2f7530
movsd %xmm0, -0x78(%rbp)
movsd 0x2e1fbd(%rip), %xmm0   # 0x2f7538
movsd %xmm0, -0x70(%rbp)
movl 0x1ed305(%rip), %r14d   # 0x20288c
cmpb %al, 0x1efccb(%rip)     # 0x205258
je 0x155fa
cmpq $0x0, 0x1efed9(%rip)    # 0x205470
je 0x15602
movq 0x1efcd8(%rip), %rsi    # 0x205278
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x11478
movzwl (%rbx), %eax
movl %eax, -0x2c(%rbp)
movl 0x2(%rbx), %eax
movl %eax, -0x4c(%rbp)
movzwl 0x6(%rbx), %eax
movw %ax, -0x48(%rbp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x138(%rbp), %rsi
leaq -0x298(%rbp), %rdi
movl $0xa0, %edx
callq 0x92a0
movsd 0x314c60(%rip), %xmm0   # 0x32a250
movzwl 0x314c60(%rip), %r15d   # 0x32a258
jmp 0x1565d
movl %eax, -0x2c(%rbp)
jmp 0x1598d
movq 0x1efc6f(%rip), %rsi    # 0x205278
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0xf9c7
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, -0x38(%rbp)
leaq -0x138(%rbp), %rsi
leaq -0x298(%rbp), %rdi
movl $0xa0, %edx
callq 0x92a0
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movl %r15d, -0x2c(%rbp)
movsd %xmm0, -0x38(%rbp)
movsd %xmm0, 0x2e1ec6(%rip)   # 0x2f7530
movl 0x2e20b8(%rip), %edx    # 0x2f7728
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xc2faf
addsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x2e1eae(%rip)   # 0x2f7538
pushq $0x1
popq %rdi
callq 0xcf298
cmpl $0x0, 0x1ed1a7(%rip)    # 0x202840
je 0x1577c
movq 0x1efcf2(%rip), %rax    # 0x205398
imulq 0x1efcf2(%rip), %rax    # 0x2053a0
movslq 0x1ed1cf(%rip), %rcx    # 0x202884
imulq %rcx, %rax
cvtsi2sd %rax, %xmm2
cvtsi2sdl 0x1efd0a(%rip), %xmm0 # 0x2053d0
divsd %xmm0, %xmm2
divsd 0xdd936(%rip), %xmm2    # 0xf3008
cvtsi2sd %ecx, %xmm0
cvtsi2sdl 0x1ed196(%rip), %xmm1 # 0x202874
divsd %xmm1, %xmm0
divsd %xmm0, %xmm2
divsd 0x1efc6a(%rip), %xmm2   # 0x205358
movsd %xmm2, -0x38(%rbp)
xorl %edi, %edi
callq 0xdab87
movl 0x2e1e08(%rip), %ecx    # 0x2f7508
movsd 0x2e1e10(%rip), %xmm0   # 0x2f7518
mulsd 0xdd928(%rip), %xmm0    # 0xf3038
addsd 0xdd950(%rip), %xmm0    # 0xf3068
cvttsd2si %xmm0, %r10d
movl 0x2e1de0(%rip), %r8d    # 0x2f7504
btl $0x9, -0x2c(%rbp)
leaq 0x1080e1(%rip), %rdx    # 0x11d811
leaq 0x109697(%rip), %rsi    # 0x11edce
cmovaeq %rdx, %rsi
cmpb $0x0, 0x2e2152(%rip)    # 0x2f7894
movl 0x2e1db7(%rip), %r9d    # 0x2f7500
leaq 0x2e21e0(%rip), %r11    # 0x2f7930
cmoveq %rsi, %r11
leaq 0x310ac5(%rip), %rdi    # 0x326220
leaq 0xdf143(%rip), %rsi     # 0xf48a5
movq %rax, %rdx
movsd -0x38(%rbp), %xmm0
movb $0x1, %al
pushq %r11
pushq %r10
callq 0x9060
popq %rcx
popq %rdx
jmp 0x158cb
movsd 0x1efbd4(%rip), %xmm0   # 0x205358
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
setp %al
setne %cl
orb %al, %cl
movl 0x1efc36(%rip), %eax    # 0x2053d0
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x158cb
cmpl $0x0, 0x1efaef(%rip)    # 0x2052a0
movl %r13d, -0x40(%rbp)
movl %r12d, -0x44(%rbp)
je 0x157e2
movslq 0x1efa7e(%rip), %rcx    # 0x205240
imulq 0x1efbd6(%rip), %rcx    # 0x2053a0
cvtsi2sd %rcx, %xmm1
divsd %xmm0, %xmm1
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, -0x38(%rbp)
jmp 0x1580b
movq 0x1efb47(%rip), %rsi    # 0x205330
movq %rbx, %rdi
callq 0xf9c7
movsd 0x2e1d37(%rip), %xmm0   # 0x2f7530
subsd 0x8(%rbx), %xmm0
mulsd 0xdd812(%rip), %xmm0    # 0xf3018
movsd %xmm0, -0x38(%rbp)
xorl %edi, %edi
callq 0xdab87
movq %rax, -0x98(%rbp)
movl 0x2e1ce9(%rip), %eax    # 0x2f7508
movl %eax, -0x64(%rbp)
movsd 0x2e1cee(%rip), %xmm0   # 0x2f7518
mulsd 0xdd806(%rip), %xmm0    # 0xf3038
addsd 0xdd82e(%rip), %xmm0    # 0xf3068
cvttsd2si %xmm0, %eax
movq %rax, -0x90(%rbp)
movl 0x2e1cb9(%rip), %ebx    # 0x2f7504
btl $0x9, -0x2c(%rbp)
leaq 0x107fba(%rip), %rax    # 0x11d811
leaq 0x109570(%rip), %rcx    # 0x11edce
cmovaeq %rax, %rcx
cmpb $0x0, 0x2e202b(%rip)    # 0x2f7894
movl 0x2e1c90(%rip), %r13d   # 0x2f7500
leaq 0x2e20b9(%rip), %r12    # 0x2f7930
cmoveq %rcx, %r12
movsd -0x38(%rbp), %xmm0
callq 0x12af0
subq $0x8, %rsp
leaq 0x314bd0(%rip), %r10    # 0x32a460
leaq 0x310989(%rip), %rdi    # 0x326220
leaq 0xdf047(%rip), %rsi     # 0xf48e5
movq -0x98(%rbp), %rdx
movl -0x64(%rbp), %ecx
movl %ebx, %r8d
movl %r13d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r12
pushq -0x90(%rbp)
callq 0x9060
addq $0x20, %rsp
movl -0x40(%rbp), %r13d
movl -0x44(%rbp), %r12d
movb $0x1, %al
movb %al, 0x1ecf88(%rip)     # 0x20285b
cmpl $0x190, 0x1ecf27(%rip)  # imm = 0x190
movb %al, 0x1ecf77(%rip)     # 0x20285a
setl %al
cmpl $0x1c2, 0x1ecf10(%rip)  # imm = 0x1C2
setl %cl
orb %al, %cl
movl 0x1ecf91(%rip), %esi    # 0x20288c
addl $0x2, %esi
xorl %ebx, %ebx
btl $0xa, %r15d
movl 0x1ece9d(%rip), %eax    # 0x2027a8
movzbl %cl, %ecx
leal 0x2(%rax,%rcx), %edi
movl $0x0, %edx
adcl $0xb, %edx
leaq 0x3108ff(%rip), %rcx    # 0x326220
callq 0xe2d2
movb %bl, 0x1ecf2f(%rip)     # 0x20285b
movb %bl, 0x1ecf28(%rip)     # 0x20285a
movl %r12d, 0x2e1bcf(%rip)   # 0x2f7508
movl -0x60(%rbp), %eax
movl %eax, 0x2e1bc2(%rip)    # 0x2f7504
movl -0x5c(%rbp), %eax
movl %eax, 0x2e1bb5(%rip)    # 0x2f7500
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x2e1bc0(%rip)   # 0x2f7518
movl -0x58(%rbp), %eax
movl %eax, 0x2e1bab(%rip)    # 0x2f750c
movl -0x54(%rbp), %eax
movl %eax, 0x2e1ba6(%rip)    # 0x2f7510
movl -0x50(%rbp), %eax
movl %eax, 0x2e1ba1(%rip)    # 0x2f7514
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x2e1bb0(%rip)   # 0x2f7530
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x2e1bab(%rip)   # 0x2f7538
cmpb $0x0, 0x2113ac(%rip)    # 0x226d40
je 0x15b60
movl %r12d, -0x44(%rbp)
movl %r13d, -0x40(%rbp)
movq 0x1ef977(%rip), %rax    # 0x205320
movq 0x1ef998(%rip), %rsi    # 0x205348
addq %rax, %rsi
addq 0x1ef976(%rip), %rsi    # 0x205330
subq %rax, %rsi
cmpq %rax, %rsi
jge 0x159ba
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0xf9c7
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x38(%rbp)
btl $0x9, (%rbx)
movsd %xmm0, 0x2e1b49(%rip)   # 0x2f7530
movl 0x2e1d3b(%rip), %edx    # 0x2f7728
leaq 0x107e1d(%rip), %rax    # 0x11d811
leaq 0x1093d3(%rip), %rbx    # 0x11edce
cmovaeq %rax, %rbx
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xc2faf
addsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x2e1b1c(%rip)   # 0x2f7538
pushq $0x2
popq %rdi
callq 0xcf298
movb 0x1ef99b(%rip), %al     # 0x2053c5
cmpb $0x2, %al
leaq 0xdeee8(%rip), %rcx     # 0xf491b
leaq 0xdeee6(%rip), %rdx     # 0xf4920
cmoveq %rcx, %rdx
movb $0x1, %r13b
cmpb %r13b, %al
leaq 0xdeecc(%rip), %r15     # 0xf4917
cmovneq %rdx, %r15
xorl %edi, %edi
callq 0xdab87
movl 0x2e1aab(%rip), %r8d    # 0x2f7508
movl 0x2e1aa0(%rip), %r9d    # 0x2f7504
movsd 0x2e1aac(%rip), %xmm0   # 0x2f7518
mulsd 0xdd5c4(%rip), %xmm0    # 0xf3038
addsd 0xdd5ec(%rip), %xmm0    # 0xf3068
cvttsd2si %xmm0, %r10d
cmpb %r12b, 0x2e1e0c(%rip)   # 0x2f7894
movl 0x2e1a71(%rip), %r11d   # 0x2f7500
leaq 0x2e1e9a(%rip), %r12    # 0x2f7930
cmoveq %rbx, %r12
subq $0x8, %rsp
leaq 0x31077b(%rip), %rbx    # 0x326220
leaq 0xdee7b(%rip), %rsi     # 0xf4927
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, 0x2e1a39(%rip)    # 0x2f7508
movl -0x60(%rbp), %eax
movl %eax, 0x2e1a2c(%rip)    # 0x2f7504
movl -0x5c(%rbp), %eax
movl %eax, 0x2e1a1f(%rip)    # 0x2f7500
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x2e1a2a(%rip)   # 0x2f7518
movl -0x58(%rbp), %eax
movl %eax, 0x2e1a15(%rip)    # 0x2f750c
movl -0x54(%rbp), %eax
movl %eax, 0x2e1a10(%rip)    # 0x2f7510
movl -0x50(%rbp), %eax
movl %eax, 0x2e1a0b(%rip)    # 0x2f7514
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x2e1a1a(%rip)   # 0x2f7530
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x2e1a15(%rip)   # 0x2f7538
movb %r13b, 0x1ecd31(%rip)   # 0x20285b
movb %r13b, 0x1ecd29(%rip)   # 0x20285a
movl 0x1ecc71(%rip), %edi    # 0x2027a8
addl $0x3, %edi
movl 0x1ecd4c(%rip), %esi    # 0x20288c
addl $0x2, %esi
pushq $0xb
popq %rdx
movq %rbx, %rcx
callq 0xe2d2
xorl %eax, %eax
movb %al, 0x1ecd05(%rip)     # 0x20285b
movb %al, 0x1eccfe(%rip)     # 0x20285a
movl -0x40(%rbp), %r13d
addl $0x28, %r13d
addl $0x2, %r14d
movl 0x1ecc3a(%rip), %edi    # 0x2027a8
addl $0x4, %edi
leaq 0x310498(%rip), %rcx    # 0x326010
pushq $0xf
popq %rdx
xorl %esi, %esi
callq 0xe2d2
leaq 0x1321bf(%rip), %r15    # 0x147d48
xorl %r12d, %r12d
cmpq $0x14, %r12
je 0x15cc0
cmpl $0x0, (%r15)
je 0x15cb1
cmpq $0xe, %r12
cmovel %r14d, %r13d
movl %r13d, -0x40(%rbp)
movl %r12d, %edi
movl %r14d, %esi
callq 0x13562
movl %eax, %ebx
movl %r12d, %edi
movl %r14d, %esi
callq 0x13c33
movl %eax, %r13d
cmpl %eax, %ebx
cmovgl %ebx, %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
movsd 0x2e13af(%rip), %xmm0   # 0x2f6f90
ucomisd 0xdd52f(%rip), %xmm0    # 0xf3118
jne 0x15bed
jnp 0x15c11
cmpb $0x0, 0x21114a(%rip)    # 0x226d3e
je 0x15bff
cmpb $0x0, 0x211140(%rip)    # 0x226d3d
je 0x15c11
movl %r12d, %edi
movl %r14d, %esi
callq 0x141fe
cmpl %r13d, %eax
cmovgl %eax, %r13d
cmpb $0x0, 0x1ef640(%rip)    # 0x205258
je 0x15c9e
cmpq $0x0, 0x1ef772(%rip)    # 0x205398
jle 0x15c9e
movl -0x2c(%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 -0x88(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movl $0xa0, %edx
leaq -0x1e8(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x92a0
subq $0xb0, %rsp
pushq $0x16
popq %rcx
movq %rsp, %rdi
leaq -0x1f8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r12d, %edi
movl %r14d, %esi
callq 0x14a81
addq $0xb0, %rsp
cmpl %r13d, %eax
cmovgl %eax, %r13d
addl %r13d, %r14d
incl %r14d
cmpl 0x1ecb5d(%rip), %r14d   # 0x202808
movl -0x40(%rbp), %r13d
jge 0x15cc0
incq %r12
addq $0xe8, %r15
jmp 0x15b8c
cmpl $0x0, 0x132d31(%rip)    # 0x1489f8
setne %al
movq 0x3140b7(%rip), %rcx    # 0x329d88
testq %rcx, %rcx
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x15f20
movb $0x0, 0x310537(%rip)    # 0x326220
cmpb $0x0, 0x1ef78d(%rip)    # 0x20547d
je 0x15d89
cmpb $0x0, 0x1ef55b(%rip)    # 0x205258
je 0x15eb3
movl 0x1ef537(%rip), %eax    # 0x205240
testl %eax, %eax
js 0x15eb3
cmpq %rax, 0x1f7778(%rip)    # 0x20d490
jle 0x15eb3
cvtsi2sd %eax, %xmm0
mulsd 0x1f777e(%rip), %xmm0   # 0x20d4a8
addsd 0x1f7766(%rip), %xmm0   # 0x20d498
movsd %xmm0, -0x40(%rbp)
movzbl 0x1ef740(%rip), %ebx    # 0x20547e
movl %ebx, %edi
callq 0x13376
testl %eax, %eax
je 0x15dee
imulq $0xe8, %rbx, %rcx
leaq 0x131fd5(%rip), %rax    # 0x147d30
cmpl $0x0, 0xd0(%rcx,%rax)
je 0x15dee
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x3104aa(%rip), %rdi    # 0x326220
leaq 0xdec05(%rip), %rsi     # 0xf4982
leaq 0xea4f4(%rip), %rcx     # 0x100278
jmp 0x15ea7
movq 0x1ef4e8(%rip), %rdx    # 0x205278
subq 0x314001(%rip), %rdx    # 0x329d98
movq %rdx, %rax
sarq $0x3f, %rax
andq 0x1ef57b(%rip), %rax    # 0x205320
addq %rdx, %rax
movslq %ecx, %rcx
cqto
idivq %rcx
movq %rax, %rcx
movq 0x313fc6(%rip), %rax    # 0x329d80
pushq $0x2
popq %rsi
cqto
idivq %rsi
cmpq %rax, %rcx
jle 0x15e25
movabsq $0x20202020202020, %rax # imm = 0x20202020202020
movq %rax, 0x31044f(%rip)    # 0x326227
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, 0x310437(%rip)    # 0x326220
jmp 0x15eb3
cmpl $0x1, %ebx
jne 0x15e82
cmpq $0x2000000, 0x1ecace(%rip) # imm = 0x2000000
jne 0x15e82
movq 0x13200d(%rip), %rdx    # 0x147e18
movq 0x13200e(%rip), %rcx    # 0x147e20
leaq 0x310407(%rip), %rdi    # 0x326220
leaq 0xdeb6c(%rip), %rsi     # 0xf498c
jmp 0x15ea7
cvtsi2sd %rcx, %xmm0
cvtss2sd 0x313f5e(%rip), %xmm1   # 0x329d90
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x15e46
jnp 0x16098
movsd 0xdd222(%rip), %xmm0    # 0xf3070
divsd %xmm1, %xmm0
movzbl 0x1ef625(%rip), %eax    # 0x20547e
imulq $0xe8, %rax, %rax
leaq 0x131ec9(%rip), %rcx    # 0x147d30
movq (%rax,%rcx), %rdx
leaq 0x3103ae(%rip), %rdi    # 0x326220
leaq 0xdeae3(%rip), %rsi     # 0xf495c
movb $0x1, %al
callq 0x9060
jmp 0x15eb3
imulq $0xe8, %rbx, %rax
leaq 0x131ea0(%rip), %rcx    # 0x147d30
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rcx
leaq 0x310380(%rip), %rdi    # 0x326220
leaq 0xdeadb(%rip), %rsi     # 0xf4982
movsd -0x40(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movb $0x1, %al
movb %al, 0x1ec9a0(%rip)     # 0x20285b
movb %al, 0x1ec999(%rip)     # 0x20285a
cmpb $0x0, 0x1ef390(%rip)    # 0x205258
je 0x15f12
movl 0x1ec8d8(%rip), %edi    # 0x2027a8
addl $0x3, %edi
movslq 0x1ec92e(%rip), %rax    # 0x202808
movslq %r13d, %rbx
subq %rbx, %rax
leaq 0x310129(%rip), %rcx    # 0x326010
addq %rax, %rcx
pushq $0xf
popq %rdx
movl %ebx, %esi
callq 0xe2d2
movl 0x1ec8ae(%rip), %edi    # 0x2027a8
addl $0x3, %edi
movzbl 0x132afc(%rip), %edx    # 0x148a00
leaq 0x310315(%rip), %rcx    # 0x326220
movl %ebx, %esi
callq 0xe2d2
xorl %eax, %eax
movb %al, 0x1ec941(%rip)     # 0x20285b
movb %al, 0x1ec93a(%rip)     # 0x20285a
movl 0x1ec882(%rip), %ebx    # 0x2027a8
callq 0x13524
cmpl $0x0, 0x313e22(%rip)    # 0x329d54
jne 0x16022
cmpl $0x3e2, 0x1ec8be(%rip)  # imm = 0x3E2
jl 0x16022
movb $0x1, %al
movb %al, 0x1ec90b(%rip)     # 0x20285b
movb %al, 0x1ec904(%rip)     # 0x20285a
cmpb $0x0, 0x210de1(%rip)    # 0x226d3e
je 0x15f6c
cmpb $0x1, 0x210dd7(%rip)    # 0x226d3d
je 0x16014
addl $0x7, %ebx
movl 0x1f769b(%rip), %eax    # 0x20d610
cmpq $0x13, %rax
ja 0x15f8b
leaq 0xdd65e(%rip), %rcx     # 0xf35e0
movslq (%rcx,%rax,4), %r15
addq %rcx, %r15
jmp 0x15f92
leaq 0xdea1f(%rip), %r15     # 0xf49b1
movq 0x131d97(%rip), %rdx    # 0x147d30
leaq 0x310280(%rip), %r14    # 0x326220
leaq 0xdea0f(%rip), %r12     # 0xf49b6
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x9060
movl 0x1ec8cf(%rip), %esi    # 0x20288c
addl $0x55, %esi
cmpb $0x1, 0x1ef412(%rip)    # 0x2053d9
pushq $0x9
popq %rdx
sbbl $0x0, %edx
movl %ebx, %edi
movq %r14, %rcx
callq 0xe2d2
movq 0x131e3a(%rip), %rdx    # 0x147e18
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x9060
xorl %eax, %eax
cmpb $0x0, 0x1ef3e2(%rip)    # 0x2053d9
sete %al
movl 0x1ec88c(%rip), %esi    # 0x20288c
addl $0x64, %esi
leal 0x6(,%rax,2), %edx
movl %ebx, %edi
movq %r14, %rcx
callq 0xe2d2
xorl %eax, %eax
movb %al, 0x1ec83f(%rip)     # 0x20285b
movb %al, 0x1ec838(%rip)     # 0x20285a
cmpl $0x0, 0x314533(%rip)    # 0x32a55c
je 0x16078
leaq 0x3101ee(%rip), %rbx    # 0x326220
leaq 0x1019ec(%rip), %rsi    # 0x117a25
pushq $0x1a
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movb $0x1, %al
movb %al, 0x1ec80d(%rip)     # 0x20285b
movb %al, 0x1ec806(%rip)     # 0x20285a
movl 0x1ec74e(%rip), %edi    # 0x2027a8
addl $0x7, %edi
movl 0x1ec79d(%rip), %eax    # 0x202800
cltd
idivl 0x1ec7a6(%rip)          # 0x202810
leal -0x2(%rax), %esi
movl -0x68(%rbp), %edx
movq %rbx, %rcx
callq 0xe2d2
xorl %eax, %eax
movb %al, 0x1ec7db(%rip)     # 0x20285b
movb %al, 0x1ec7d4(%rip)     # 0x20285a
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x1ef3df(%rip), %eax    # 0x20547e
imulq $0xe8, %rax, %rax
leaq 0x131c83(%rip), %rcx    # 0x147d30
movq (%rax,%rcx), %rdx
leaq 0x310168(%rip), %rdi    # 0x326220
leaq 0xde8b0(%rip), %rsi     # 0xf496f
xorl %eax, %eax
callq 0x9060
jmp 0x15eb3