// File: /workspace/github_cpp_makefile_star2_O3/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, 0x202a75(%rip)    # 0x2187d8
jne 0x169d0
cmpl $0x0, 0x329ff8(%rip)    # 0x33fd68
jne 0x169d0
cmpq $0x400, 0x202b4f(%rip) # imm = 0x400
je 0x169d0
movzbl 0x2f6a1a(%rip), %eax    # 0x30c7a8
cmpl $0x50, %eax
je 0x15d9b
testl %eax, %eax
jne 0x169d0
cmpl $0x0, 0x2291b6(%rip)    # 0x23ef58
movl 0x202a5c(%rip), %ecx    # 0x218804
movl 0x202a52(%rip), %eax    # 0x218800
je 0x15de9
imull $0x31a, 0x20d78a(%rip), %edx # imm = 0x31A
movslq %edx, %rdx
imulq $0x51eb851f, %rdx, %rdx # imm = 0x51EB851F
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x25, %rdx
addl %esi, %edx
cmpl %edx, %eax
setl %dl
cmpl $0x258, %ecx            # imm = 0x258
setl %sil
orb %dl, %sil
jne 0x169d0
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
cmpb $0x0, 0x2055c4(%rip)    # 0x21b3c8
setne %r15b
shlb $0x2, %r15b
orb $0xb, %r15b
movl 0x202995(%rip), %r13d   # 0x2187ac
movb $0x1, %dl
movb %dl, 0x202a3c(%rip)     # 0x21885b
movb %dl, 0x202a35(%rip)     # 0x21885a
cmpl $0x190, %ecx            # imm = 0x190
setl %cl
cmpl $0x1c2, %eax            # imm = 0x1C2
setl %al
orb %cl, %al
movl 0x20296a(%rip), %esi    # 0x2187a8
movl 0x2029d0(%rip), %edi    # 0x218814
movl 0x2029c6(%rip), %edx    # 0x218810
imull 0x2029b7(%rip), %edx    # 0x218808
movzbl %al, %eax
movl $0x6, %ecx
subl %eax, %ecx
addl %eax, %esi
addl $0x2, %esi
imull %edi, %esi
imull %edi, %ecx
xorl %edi, %edi
xorl %r8d, %r8d
callq 0xf298
movl 0x202932(%rip), %ebx    # 0x2187a8
addl $0x7, %ebx
movl 0x202a0c(%rip), %r14d   # 0x21888c
cmpb $0x0, 0x226eb9(%rip)    # 0x23cd40
je 0x15ea4
cmpb $0x0, 0x226eb1(%rip)    # 0x23cd41
je 0x15ec8
movb $0x0, 0x326389(%rip)    # 0x33c222
movw $0x2020, 0x32637e(%rip) # imm = 0x2020
jmp 0x15ee2
movslq 0x205525(%rip), %rax    # 0x21b3d0
imulq 0x205485(%rip), %rax    # 0x21b338
cqto
idivq 0x2054e4(%rip)          # 0x21b3a0
movslq 0x2029c1(%rip), %rcx    # 0x218884
cmpq %rcx, %rax
jl 0x15e92
leaq 0x326351(%rip), %rdi    # 0x33c220
leaq 0x112666(%rip), %rsi    # 0x12853c
movl $0x1b, %edx
xorl %eax, %eax
callq 0x9060
movzbl %r15b, %edx
leaq 0x326333(%rip), %rcx    # 0x33c220
movl %ebx, %edi
movl %r14d, %esi
movl %edx, -0x68(%rbp)
callq 0xe787
xorl %eax, %eax
movb %al, 0x202959(%rip)     # 0x21885b
movb %al, 0x202952(%rip)     # 0x21885a
movl 0x2f75f9(%rip), %r12d   # 0x30d508
movl 0x2f75ef(%rip), %ecx    # 0x30d504
movl %ecx, -0x60(%rbp)
movl 0x2f75e2(%rip), %ecx    # 0x30d500
movl %ecx, -0x5c(%rbp)
movsd 0x2f75ef(%rip), %xmm0   # 0x30d518
movsd %xmm0, -0x80(%rbp)
movl 0x2f75d8(%rip), %ecx    # 0x30d50c
movl %ecx, -0x58(%rbp)
movl 0x2f75d3(%rip), %ecx    # 0x30d510
movl %ecx, -0x54(%rbp)
movl 0x2f75ce(%rip), %ecx    # 0x30d514
movl %ecx, -0x50(%rbp)
movsd 0x2f75df(%rip), %xmm0   # 0x30d530
movsd %xmm0, -0x78(%rbp)
movsd 0x2f75da(%rip), %xmm0   # 0x30d538
movsd %xmm0, -0x70(%rbp)
movl 0x202922(%rip), %r14d   # 0x21888c
cmpb %al, 0x2052e8(%rip)     # 0x21b258
je 0x15fdd
cmpq $0x0, 0x2054f6(%rip)    # 0x21b470
je 0x15fe5
movq 0x2052f5(%rip), %rsi    # 0x21b278
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x11bc7
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, -0x88(%rbp)
leaq -0x138(%rbp), %rsi
leaq -0x298(%rbp), %rdi
movl $0xa0, %edx
callq 0x92b0
movsd 0x32a27d(%rip), %xmm0   # 0x340250
movzwl 0x32a27d(%rip), %r15d   # 0x340258
jmp 0x16040
movl %eax, -0x34(%rbp)
jmp 0x16380
movq 0x20528c(%rip), %rsi    # 0x21b278
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x100be
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, -0x40(%rbp)
leaq -0x138(%rbp), %rsi
leaq -0x298(%rbp), %rdi
movl $0xa0, %edx
callq 0x92b0
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movl %r15d, -0x34(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd %xmm0, 0x2f74e3(%rip)   # 0x30d530
movl 0x2f76d5(%rip), %edx    # 0x30d728
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xd492e
addsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x2f74cb(%rip)   # 0x30d538
movl $0x1, %edi
callq 0xe2692
cmpl $0x0, 0x2027c2(%rip)    # 0x218840
je 0x16169
movq 0x20530d(%rip), %rax    # 0x21b398
imulq 0x20530d(%rip), %rax    # 0x21b3a0
movslq 0x2027ea(%rip), %rcx    # 0x218884
imulq %rcx, %rax
cvtsi2sd %rax, %xmm2
xorps %xmm0, %xmm0
cvtsi2sdl 0x205322(%rip), %xmm0 # 0x21b3d0
divsd %xmm0, %xmm2
divsd 0xf2f4e(%rip), %xmm2    # 0x109008
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
cvtsi2sdl 0x2027ab(%rip), %xmm1 # 0x218874
divsd %xmm1, %xmm0
divsd %xmm0, %xmm2
divsd 0x20527f(%rip), %xmm2   # 0x21b358
movsd %xmm2, -0x40(%rbp)
xorl %edi, %edi
callq 0xef8e6
movl 0x2f741d(%rip), %ecx    # 0x30d508
movsd 0x2f7425(%rip), %xmm0   # 0x30d518
mulsd 0xf2f3d(%rip), %xmm0    # 0x109038
addsd 0xf2f65(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %r10d
movl 0x2f73f5(%rip), %r8d    # 0x30d504
btl $0x9, -0x34(%rbp)
leaq 0x11d7d6(%rip), %rdx    # 0x1338f1
leaq 0x11ed8c(%rip), %rsi    # 0x134eae
cmovaeq %rdx, %rsi
cmpb $0x0, 0x2f7767(%rip)    # 0x30d894
movl 0x2f73cc(%rip), %r9d    # 0x30d500
leaq 0x2f77f5(%rip), %r11    # 0x30d930
cmoveq %rsi, %r11
leaq 0x3260da(%rip), %rdi    # 0x33c220
leaq 0xf4708(%rip), %rsi     # 0x10a855
movq %rax, %rdx
movsd -0x40(%rbp), %xmm0
movb $0x1, %al
pushq %r11
pushq %r10
callq 0x9060
addq $0x10, %rsp
jmp 0x162be
movsd 0x2051e7(%rip), %xmm0   # 0x21b358
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
setp %al
setne %cl
orb %al, %cl
movl 0x205249(%rip), %eax    # 0x21b3d0
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x162be
cmpl $0x0, 0x205102(%rip)    # 0x21b2a0
movl %r13d, -0x30(%rbp)
movl %r12d, -0x44(%rbp)
je 0x161d5
movslq 0x205091(%rip), %rcx    # 0x21b240
imulq 0x2051e9(%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 0x161fe
movq 0x205154(%rip), %rsi    # 0x21b330
movq %rbx, %rdi
callq 0x100be
movsd 0x2f7344(%rip), %xmm0   # 0x30d530
subsd 0x8(%rbx), %xmm0
mulsd 0xf2e1f(%rip), %xmm0    # 0x109018
movsd %xmm0, -0x40(%rbp)
xorl %edi, %edi
callq 0xef8e6
movq %rax, -0x98(%rbp)
movl 0x2f72f6(%rip), %eax    # 0x30d508
movl %eax, -0x64(%rbp)
movsd 0x2f72fb(%rip), %xmm0   # 0x30d518
mulsd 0xf2e13(%rip), %xmm0    # 0x109038
addsd 0xf2e3b(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %eax
movq %rax, -0x90(%rbp)
movl 0x2f72c6(%rip), %ebx    # 0x30d504
btl $0x9, -0x34(%rbp)
leaq 0x11d6a7(%rip), %rax    # 0x1338f1
leaq 0x11ec5d(%rip), %rcx    # 0x134eae
cmovaeq %rax, %rcx
cmpb $0x0, 0x2f7638(%rip)    # 0x30d894
movl 0x2f729d(%rip), %r13d   # 0x30d500
leaq 0x2f76c6(%rip), %r12    # 0x30d930
cmoveq %rcx, %r12
movsd -0x40(%rbp), %xmm0
callq 0x13369
subq $0x8, %rsp
leaq 0x32a1dd(%rip), %r10    # 0x340460
leaq 0x325f96(%rip), %rdi    # 0x33c220
leaq 0xf4604(%rip), %rsi     # 0x10a895
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 -0x30(%rbp), %r13d
movl -0x44(%rbp), %r12d
movb $0x1, %al
movb %al, 0x202595(%rip)     # 0x21885b
cmpl $0x190, 0x202534(%rip)  # imm = 0x190
movb %al, 0x202584(%rip)     # 0x21885a
setl %al
cmpl $0x1c2, 0x20251d(%rip)  # imm = 0x1C2
setl %cl
orb %al, %cl
movl 0x20259e(%rip), %esi    # 0x21888c
addl $0x2, %esi
xorl %ebx, %ebx
btl $0xa, %r15d
movl 0x2024aa(%rip), %eax    # 0x2187a8
movzbl %cl, %ecx
leal 0x2(%rax,%rcx), %edi
movl $0x0, %edx
adcl $0xb, %edx
leaq 0x325f0c(%rip), %rcx    # 0x33c220
callq 0xe787
movb %bl, 0x20253c(%rip)     # 0x21885b
movb %bl, 0x202535(%rip)     # 0x21885a
movl %r12d, 0x2f71dc(%rip)   # 0x30d508
movl -0x60(%rbp), %eax
movl %eax, 0x2f71cf(%rip)    # 0x30d504
movl -0x5c(%rbp), %eax
movl %eax, 0x2f71c2(%rip)    # 0x30d500
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x2f71cd(%rip)   # 0x30d518
movl -0x58(%rbp), %eax
movl %eax, 0x2f71b8(%rip)    # 0x30d50c
movl -0x54(%rbp), %eax
movl %eax, 0x2f71b3(%rip)    # 0x30d510
movl -0x50(%rbp), %eax
movl %eax, 0x2f71ae(%rip)    # 0x30d514
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x2f71bd(%rip)   # 0x30d530
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x2f71b8(%rip)   # 0x30d538
cmpb $0x0, 0x2269b9(%rip)    # 0x23cd40
je 0x16557
movl %r12d, -0x44(%rbp)
movl %r13d, -0x30(%rbp)
movq 0x204f84(%rip), %rax    # 0x21b320
movq 0x204fa5(%rip), %rsi    # 0x21b348
addq %rax, %rsi
addq 0x204f83(%rip), %rsi    # 0x21b330
subq %rax, %rsi
cmpq %rax, %rsi
jge 0x163ad
leaq -0x148(%rbp), %rbx
movq %rbx, %rdi
callq 0x100be
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x40(%rbp)
btl $0x9, (%rbx)
movsd %xmm0, 0x2f7156(%rip)   # 0x30d530
movl 0x2f7348(%rip), %edx    # 0x30d728
leaq 0x11d50a(%rip), %rax    # 0x1338f1
leaq 0x11eac0(%rip), %rbx    # 0x134eae
cmovaeq %rax, %rbx
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xd492e
addsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x2f7129(%rip)   # 0x30d538
movl $0x2, %edi
callq 0xe2692
movb 0x204fa6(%rip), %al     # 0x21b3c5
cmpb $0x2, %al
leaq 0xf44a3(%rip), %rcx     # 0x10a8cb
leaq 0xf44a1(%rip), %rdx     # 0x10a8d0
cmoveq %rcx, %rdx
movb $0x1, %r13b
cmpb %r13b, %al
leaq 0xf4487(%rip), %r15     # 0x10a8c7
cmovneq %rdx, %r15
xorl %edi, %edi
callq 0xef8e6
movl 0x2f70b6(%rip), %r8d    # 0x30d508
movl 0x2f70ab(%rip), %r9d    # 0x30d504
movsd 0x2f70b7(%rip), %xmm0   # 0x30d518
mulsd 0xf2bcf(%rip), %xmm0    # 0x109038
addsd 0xf2bf7(%rip), %xmm0    # 0x109068
cvttsd2si %xmm0, %r10d
cmpb %r12b, 0x2f7417(%rip)   # 0x30d894
movl 0x2f707c(%rip), %r11d   # 0x30d500
leaq 0x2f74a5(%rip), %r12    # 0x30d930
cmoveq %rbx, %r12
subq $0x8, %rsp
leaq 0x325d86(%rip), %rbx    # 0x33c220
leaq 0xf4436(%rip), %rsi     # 0x10a8d7
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, 0x2f7044(%rip)    # 0x30d508
movl -0x60(%rbp), %eax
movl %eax, 0x2f7037(%rip)    # 0x30d504
movl -0x5c(%rbp), %eax
movl %eax, 0x2f702a(%rip)    # 0x30d500
movsd -0x80(%rbp), %xmm0
movsd %xmm0, 0x2f7035(%rip)   # 0x30d518
movl -0x58(%rbp), %eax
movl %eax, 0x2f7020(%rip)    # 0x30d50c
movl -0x54(%rbp), %eax
movl %eax, 0x2f701b(%rip)    # 0x30d510
movl -0x50(%rbp), %eax
movl %eax, 0x2f7016(%rip)    # 0x30d514
movsd -0x78(%rbp), %xmm0
movsd %xmm0, 0x2f7025(%rip)   # 0x30d530
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x2f7020(%rip)   # 0x30d538
movb %r13b, 0x20233c(%rip)   # 0x21885b
movb %r13b, 0x202334(%rip)   # 0x21885a
movl 0x20227c(%rip), %edi    # 0x2187a8
addl $0x3, %edi
movl 0x202357(%rip), %esi    # 0x21888c
addl $0x2, %esi
movl $0xb, %edx
movq %rbx, %rcx
callq 0xe787
xorl %eax, %eax
movb %al, 0x20230e(%rip)     # 0x21885b
movb %al, 0x202307(%rip)     # 0x21885a
movl -0x30(%rbp), %r13d
addl $0x28, %r13d
addl $0x2, %r14d
movl 0x202243(%rip), %edi    # 0x2187a8
addl $0x4, %edi
leaq 0x325aa1(%rip), %rcx    # 0x33c010
xorl %esi, %esi
movl $0xf, %edx
callq 0xe787
leaq 0x1477c6(%rip), %rbx    # 0x15dd48
xorl %r15d, %r15d
cmpl $0x0, (%rbx)
je 0x166a6
cmpq $0xe, %r15
cmovel %r14d, %r13d
movl %r13d, -0x30(%rbp)
movq %r14, %r12
movl %r15d, %edi
movl %r12d, %esi
callq 0x13e3c
movl %eax, %r13d
movl %r15d, %edi
movl %r12d, %esi
callq 0x145f8
movl %eax, %r12d
cmpl %eax, %r13d
cmovgl %r13d, %r12d
testl %r12d, %r12d
movl $0x0, %eax
cmovlel %eax, %r12d
movsd 0x2f69bc(%rip), %xmm0   # 0x30cf90
ucomisd 0xf2b3c(%rip), %xmm0    # 0x109118
jne 0x165e0
jnp 0x16604
cmpb $0x0, 0x226757(%rip)    # 0x23cd3e
je 0x165f2
cmpb $0x0, 0x22674d(%rip)    # 0x23cd3d
je 0x16604
movl %r15d, %edi
movl %r14d, %esi
callq 0x14bd2
cmpl %r12d, %eax
cmovgl %eax, %r12d
movl -0x30(%rbp), %r13d
cmpb $0x0, 0x204c49(%rip)    # 0x21b258
je 0x16697
cmpq $0x0, 0x204d7b(%rip)    # 0x21b398
jle 0x16697
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 -0x88(%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 0x1547b
addq $0xb0, %rsp
cmpl %r12d, %eax
cmovgl %eax, %r12d
addl %r12d, %r14d
incl %r14d
cmpl 0x202164(%rip), %r14d   # 0x218808
jge 0x166ba
incq %r15
addq $0xe8, %rbx
cmpq $0x14, %r15
jne 0x16585
cmpl $0x0, 0x148337(%rip)    # 0x15e9f8
setne %al
movq 0x3296bd(%rip), %rcx    # 0x33fd88
testq %rcx, %rcx
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x16928
movb $0x0, 0x325b3d(%rip)    # 0x33c220
cmpb $0x0, 0x204d93(%rip)    # 0x21b47d
je 0x16786
cmpb $0x0, 0x204b61(%rip)    # 0x21b258
je 0x168b9
movl 0x204b3d(%rip), %eax    # 0x21b240
testl %eax, %eax
js 0x168b9
cmpq %rax, 0x20cd7e(%rip)    # 0x223490
jle 0x168b9
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x20cd81(%rip), %xmm0   # 0x2234a8
addsd 0x20cd69(%rip), %xmm0   # 0x223498
movsd %xmm0, -0x30(%rbp)
movzbl 0x204d43(%rip), %ebx    # 0x21b47e
movl %ebx, %edi
callq 0x13c3e
testl %eax, %eax
je 0x167ed
imulq $0xe8, %rbx, %rcx
leaq 0x1475d8(%rip), %rax    # 0x15dd30
cmpl $0x0, 0xd0(%rcx,%rax)
je 0x167ed
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x325aad(%rip), %rdi    # 0x33c220
leaq 0xf41b8(%rip), %rsi     # 0x10a932
leaq 0xffa77(%rip), %rcx     # 0x1161f8
jmp 0x168ad
movq 0x204aeb(%rip), %rdx    # 0x21b278
subq 0x329604(%rip), %rdx    # 0x33fd98
movq %rdx, %rax
sarq $0x3f, %rax
andq 0x204b7e(%rip), %rax    # 0x21b320
addq %rdx, %rax
movslq %ecx, %rcx
cqto
idivq %rcx
movq 0x3295cc(%rip), %rcx    # 0x33fd80
movq %rcx, %rdx
shrq $0x3f, %rdx
addq %rcx, %rdx
sarq %rdx
cmpq %rdx, %rax
jle 0x16828
movabsq $0x20202020202020, %rax # imm = 0x20202020202020
movq %rax, 0x325a50(%rip)    # 0x33c227
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, 0x325a38(%rip)    # 0x33c220
jmp 0x168b9
cmpl $0x1, %ebx
jne 0x16888
cmpq $0x2000000, 0x2020cf(%rip) # imm = 0x2000000
jne 0x16888
movq 0x14760a(%rip), %rdx    # 0x15de18
movq 0x14760b(%rip), %rcx    # 0x15de20
leaq 0x325a04(%rip), %rdi    # 0x33c220
leaq 0xf4119(%rip), %rsi     # 0x10a93c
jmp 0x168ad
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
cvtss2sd 0x329558(%rip), %xmm1   # 0x33fd90
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x1684c
jnp 0x169d1
movsd 0xf281c(%rip), %xmm0    # 0x109070
divsd %xmm1, %xmm0
movzbl 0x204c1f(%rip), %eax    # 0x21b47e
imulq $0xe8, %rax, %rax
leaq 0x1474c3(%rip), %rcx    # 0x15dd30
movq (%rax,%rcx), %rdx
leaq 0x3259a8(%rip), %rdi    # 0x33c220
leaq 0xf408d(%rip), %rsi     # 0x10a90c
movb $0x1, %al
callq 0x9060
jmp 0x168b9
imulq $0xe8, %rbx, %rax
leaq 0x14749a(%rip), %rcx    # 0x15dd30
movq (%rax,%rcx), %rdx
movq 0x8(%rax,%rcx), %rcx
leaq 0x32597a(%rip), %rdi    # 0x33c220
leaq 0xf4085(%rip), %rsi     # 0x10a932
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movb $0x1, %al
movb %al, 0x201f9a(%rip)     # 0x21885b
movb %al, 0x201f93(%rip)     # 0x21885a
cmpb $0x0, 0x20498a(%rip)    # 0x21b258
je 0x1691a
movl 0x201ed2(%rip), %edi    # 0x2187a8
addl $0x3, %edi
movslq 0x201f28(%rip), %rax    # 0x218808
movslq %r13d, %rbx
subq %rbx, %rax
leaq 0x325723(%rip), %rcx    # 0x33c010
addq %rax, %rcx
movl %ebx, %esi
movl $0xf, %edx
callq 0xe787
movl 0x201ea6(%rip), %edi    # 0x2187a8
addl $0x3, %edi
movzbl 0x1480f4(%rip), %edx    # 0x15ea00
leaq 0x32590d(%rip), %rcx    # 0x33c220
movl %ebx, %esi
callq 0xe787
xorl %eax, %eax
movb %al, 0x201f39(%rip)     # 0x21885b
movb %al, 0x201f32(%rip)     # 0x21885a
movl 0x329426(%rip), %eax    # 0x33fd54
movl $0x1, 0x32941c(%rip)    # 0x33fd54
cmpl $0x1, %eax
je 0x16959
cmpq $0x10000, 0x201f88(%rip) # imm = 0x10000
movl $0x1, 0x201ef2(%rip)    # 0x218844
sete 0x204a80(%rip)          # 0x21b3d9
cmpl $0x0, 0x329bfc(%rip)    # 0x34055c
je 0x169b1
leaq 0x3258b7(%rip), %rbx    # 0x33c220
leaq 0x117195(%rip), %rsi    # 0x12db05
movq %rbx, %rdi
movl $0x1a, %edx
xorl %eax, %eax
callq 0x9060
movb $0x1, %al
movb %al, 0x201ed4(%rip)     # 0x21885b
movb %al, 0x201ecd(%rip)     # 0x21885a
movl 0x201e15(%rip), %edi    # 0x2187a8
addl $0x7, %edi
movl 0x201e64(%rip), %eax    # 0x218800
cltd
idivl 0x201e6d(%rip)          # 0x218810
leal -0x2(%rax), %esi
movl -0x68(%rbp), %edx
movq %rbx, %rcx
callq 0xe787
xorl %eax, %eax
movb %al, 0x201ea2(%rip)     # 0x21885b
movb %al, 0x201e9b(%rip)     # 0x21885a
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x204aa6(%rip), %eax    # 0x21b47e
imulq $0xe8, %rax, %rax
leaq 0x14734a(%rip), %rcx    # 0x15dd30
movq (%rax,%rcx), %rdx
leaq 0x32582f(%rip), %rdi    # 0x33c220
leaq 0xf3f27(%rip), %rsi     # 0x10a91f
xorl %eax, %eax
callq 0x9060
jmp 0x168b9