// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_adev_table(ADEV_INFO*, int, int, unsigned char, int)
int show_adev_table(struct ADEV_INFO *bins, int adev_row, int adev_col, u08 color, int why)
{
int i;
int id;
char *d;
char *t;
long adev_q_count;
char c;
int count;
char adev_id[32];
int mask;
double tau;
double period;
char pstring[128];

   left_adev_col = adev_col;

   if(text_mode) {
      if(first_key) return 0;
      if(all_adevs == SINGLE_ADEVS) return 0;     // no room on screen to do this
   }
   if(zoom_screen) return 0;
   if(bins->bin_count <= 0) return 0;              // nothing to show
   if(adevs_active(1) == 0) return 0;
   if((SCREEN_WIDTH < NARROW_SCREEN) && (all_adevs == SINGLE_ADEVS)) {  // no room for ADEV tables
      return 0;
   }
   if(osc_params && (rcvr_type == TICC_RCVR)) return 0;

   mask = 0xFFFF;
   period = adev_period;
   if     (bins->adev_type == PPS_ADEV) { t = "ADEV"; adev_q_count = pps_adev_q_count+(long) pps_adev_q_overflow; mask = DISPLAY_ADEV; period = pps_adev_period; } 
   else if(bins->adev_type == OSC_ADEV) { t = "ADEV"; adev_q_count = osc_adev_q_count+(long) osc_adev_q_overflow; mask = DISPLAY_ADEV; period = osc_adev_period; } 
   else if(bins->adev_type == CHC_ADEV) { t = "ADEV"; adev_q_count = chc_adev_q_count+(long) chc_adev_q_overflow; mask = DISPLAY_ADEV; period = chc_adev_period; } 
   else if(bins->adev_type == CHD_ADEV) { t = "ADEV"; adev_q_count = chd_adev_q_count+(long) chd_adev_q_overflow; mask = DISPLAY_ADEV; period = chd_adev_period; } 

   else if(bins->adev_type == PPS_HDEV) { t = "HDEV"; adev_q_count = pps_adev_q_count+(long) pps_adev_q_overflow; mask = DISPLAY_HDEV; period = pps_adev_period; } 
   else if(bins->adev_type == OSC_HDEV) { t = "HDEV"; adev_q_count = osc_adev_q_count+(long) osc_adev_q_overflow; mask = DISPLAY_HDEV; period = osc_adev_period; } 
   else if(bins->adev_type == CHC_HDEV) { t = "HDEV"; adev_q_count = chc_adev_q_count+(long) chc_adev_q_overflow; mask = DISPLAY_HDEV; period = chc_adev_period; } 
   else if(bins->adev_type == CHD_HDEV) { t = "HDEV"; adev_q_count = chd_adev_q_count+(long) chd_adev_q_overflow; mask = DISPLAY_HDEV; period = chd_adev_period; } 

   else if(bins->adev_type == PPS_MDEV) { t = "MDEV"; adev_q_count = pps_adev_q_count+(long) pps_adev_q_overflow; mask = DISPLAY_MDEV; period = pps_adev_period; } 
   else if(bins->adev_type == OSC_MDEV) { t = "MDEV"; adev_q_count = osc_adev_q_count+(long) osc_adev_q_overflow; mask = DISPLAY_MDEV; period = osc_adev_period; } 
   else if(bins->adev_type == CHC_MDEV) { t = "MDEV"; adev_q_count = chc_adev_q_count+(long) chc_adev_q_overflow; mask = DISPLAY_MDEV; period = chc_adev_period; } 
   else if(bins->adev_type == CHD_MDEV) { t = "MDEV"; adev_q_count = chd_adev_q_count+(long) chd_adev_q_overflow; mask = DISPLAY_MDEV; period = chd_adev_period; } 

   else if(bins->adev_type == PPS_TDEV) { t = "TDEV"; adev_q_count = pps_adev_q_count+(long) pps_adev_q_overflow; mask = DISPLAY_TDEV; period = pps_adev_period; } 
   else if(bins->adev_type == OSC_TDEV) { t = "TDEV"; adev_q_count = osc_adev_q_count+(long) osc_adev_q_overflow; mask = DISPLAY_TDEV; period = osc_adev_period; } 
   else if(bins->adev_type == CHC_TDEV) { t = "TDEV"; adev_q_count = chc_adev_q_count+(long) chc_adev_q_overflow; mask = DISPLAY_TDEV; period = chc_adev_period; } 
   else if(bins->adev_type == CHD_TDEV) { t = "TDEV"; adev_q_count = chd_adev_q_count+(long) chd_adev_q_overflow; mask = DISPLAY_TDEV; period = chd_adev_period; } 

   else if(bins->adev_type == A_MTIE)   { t = "MTIE"; adev_q_count = mtie_intervals[CHA_MTIE][0]; mask = DISPLAY_MTIE; period = pps_adev_period; } 
   else if(bins->adev_type == B_MTIE)   { t = "MTIE"; adev_q_count = mtie_intervals[CHB_MTIE][0]; mask = DISPLAY_MTIE; period = osc_adev_period; } 
   else if(bins->adev_type == C_MTIE)   { t = "MTIE"; adev_q_count = mtie_intervals[CHC_MTIE][0]; mask = DISPLAY_MTIE; period = chc_adev_period; } 
   else if(bins->adev_type == D_MTIE)   { t = "MTIE"; adev_q_count = mtie_intervals[CHD_MTIE][0]; mask = DISPLAY_MTIE; period = chd_adev_period; } 
   else { t="????"; adev_q_count = 0; }
   if(period <= 0.0) return 0;      // aaaapppp other periods 
   
   if(SCREEN_WIDTH < ADEV_AZEL_THRESH) {  // no room for both a map and adev tables
      if(all_adevs == SINGLE_ADEVS) {
         if(plot_watch) {
            if(shared_plot && (shared_item & SHARE_WATCH)) ;
            else return 0;
         }
         if(plot_azel) {
            if(shared_plot && (shared_item & SHARE_MAP)) ;
            else return 0;
         }
         if(plot_signals) {
            if(shared_plot && (shared_item & SHARE_SIGNALS)) ;
            else return 0;
         }
         if(plot_lla) {
            if(shared_plot && (shared_item & SHARE_LLA)) ;
            else return 0;
         }

         if(precision_survey) return 0;
         if(check_precise_posn) return 0;
         if(precise_survey_done) return 0;
         if(show_fixes) return 0;
      }
   }

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

   calc_adev_display_size();
      
   id = bins->adev_type / NUM_ADEV_TYPES;

   if(id == CHD_ID) {
      d = "chD";
   }
   else if(id == CHC_ID) {
      d = "chC";
   }
   else if(id == PPS_ID) {
      if(jitter_adev)    d = "Msg jit"; //"PPS";
      else if(TICC_USED) d = "chA";
      else               d = plot[PPS].plot_id; //"PPS";
   }
   else {
      if(jitter_adev)    d = "Msg ofs"; //"OSC";
      else if(TICC_USED) d = "chB";
      else               d = plot[OSC].plot_id; //"OSC";
   }

if(ATYPE == A_MTIE) {
// if((mask & adev_display_mask) == 0) return 0;
}

   strcpy(adev_id, t);
   if(TICC_USED == 0) strlwr(adev_id);  // show bogo-adevs in lower case
   else if(ticc_type == LARS_TICC) strlwr(adev_id);

   blank_underscore = 1; // '_' char is used for formatting columns,  convert to blank

   if(all_adevs && (rcvr_type == TICC_RCVR)) {
      vidstr(adev_row,adev_col, WHITE, "                       ");
   }

   if(last_was_adev) c = UP_DOWN_CHAR;  // show adev scrolling is active
   else              c = ':';           // show plot scrolling is active

//sprintf(debug_text3, "%s  lwa:%d(%d)  fsb:%d  mbs:%d  atr:%d  aps:%d  abr:%d  aar:%d  bc:%d", 
//t, last_was_adev,lwa, first_show_bin, max_bins_shown, adev_table_rows, adev_page_size, adev_bottom_row, all_adev_row, bins->bin_count);

if(0) {  // try to fix mystery bug where adev display starts at the wrong bin
   for(i=0; i<bins->bin_count; i++) {
      if(bins->adev_taus[i] == 0) {  // we should never see a bin with tau=0
         first_show_bin = 0;
         break;
      }
   }
}

   count = 0;
   if(all_adevs || (SCREEN_WIDTH < MEDIUM_WIDTH)) {  // 800x600 - short version of tables
      left_adev_col = adev_col;
       sprintf(out, "%s %s%c %lu pts", d, adev_id,c, adev_q_count);
///   sprintf(out, "%s %s%c %lu pts bc:%d", d, adev_id,c, adev_q_count,bins->bin_count);
      vidstr(adev_row, left_adev_col, color, &blanks[TEXT_COLS-max_adev_width]);
      vidstr(adev_row, left_adev_col, color, out);
      adevs_shown = strlen(out);
      if(bins->bin_count > max_bins_shown) max_bins_shown = bins->bin_count;

      for(i=first_show_bin; i<bins->bin_count; i++) {
         ++adev_row;
         if(all_adevs && (left_adev_col < INFO_COL)) {
            if(adev_row > (MOUSE_ROW+0)) break;  // mmmmmm
         }
         else if(adev_row > (MOUSE_ROW+1)) break;  // mmmmmm

         if(max_adev_width > 5) {  // erase the old data
//          fill_rectangle (left_adev_col*TEXT_WIDTH+TEXT_X_MARGIN,adev_row*TEXT_HEIGHT+TEXT_Y_MARGIN, (max_adev_width)*TEXT_WIDTH,TEXT_HEIGHT, RED);
            erase_rectangle(left_adev_col*TEXT_WIDTH+TEXT_X_MARGIN,adev_row*TEXT_HEIGHT+TEXT_Y_MARGIN, (max_adev_width)*TEXT_WIDTH,TEXT_HEIGHT);
         }
         if(++count >= adev_table_rows) break;
         if(ATYPE == A_MTIE) {
            if(bins->adev_on[i] < 0.0) break;
         }
         else if(bins->adev_on[i] <= 0.0) break;

         tau = bins->adev_taus[i];
         strcpy(pstring, "??????");

         if(fperiod(period)) {  // non-integer period
            if     (tau < 100.0)    sprintf(pstring, "%6.3f", tau);
            else if(tau < 1000.0)   sprintf(pstring, "%6.2f", tau);
            else if(tau < 10000.0)  sprintf(pstring, "%6.1f", tau);
            else                    sprintf(pstring, "%6.0f", tau);
         }
         else {
            sprintf(pstring, "%6ld", (long) tau);
         }

         if(all_adevs && (SCREEN_WIDTH >= MEDIUM_WIDTH) && (text_mode == 0)) {
            if(tau >= 1000000.0) {
               sprintf(out, "%st %.4le (n=%ld)", pstring, bins->adev_bins[i], bins->adev_on[i]);
            }
            else {
               sprintf(out, "%s t %.4le (n=%ld)", pstring, bins->adev_bins[i], bins->adev_on[i]);
            }
            adevs_shown = strlen(out);
         }
         else {
            if(1 || (SCREEN_WIDTH < NARROW_SCREEN)) {
               sprintf(out, "%st %.3le", pstring, bins->adev_bins[i]);
            }
            else {
               sprintf(out, "%s t %.3le", pstring, bins->adev_bins[i]);
            }
            adevs_shown = strlen(out);
            adevs_shown += 6;  // make sure view info erases
         }
         vidstr(adev_row, left_adev_col, color, out);

         if(adevs_shown > max_adev_width) max_adev_width = adevs_shown+1;
      }
   }
   else {   // long version of tables will fit
      left_adev_col = adev_col+4;
      sprintf(out, "%s %s%c for %lu points", d, adev_id,c, adev_q_count);
///   sprintf(out, "%s %s%c %lu pts bc::%d", d, adev_id,c, adev_q_count,bins->bin_count);
      vidstr(adev_row, adev_col, color, &blanks[TEXT_COLS-max_adev_width]);
      vidstr(adev_row, adev_col+7, color, out);
      adevs_shown = 7 + 5 + strlen(out) + 2;
      adevs_shown = strlen(out);
      if(bins->bin_count > max_bins_shown) {
         max_bins_shown = bins->bin_count;
      }

      for(i=first_show_bin; i<bins->bin_count; i++) {  // draw the adev table entries
         ++adev_row;
         if(all_adevs && (left_adev_col < INFO_COL)) {
            if(adev_row > (MOUSE_ROW+0)) break;  // mmmmmm
         }
         else if(adev_row > (MOUSE_ROW+1)) break;  // mmmmmm

         if(max_adev_width > 5) {   // erase the old data
//          fill_rectangle (left_adev_col*TEXT_WIDTH+TEXT_X_MARGIN,adev_row*TEXT_HEIGHT+TEXT_Y_MARGIN, max_adev_width*TEXT_WIDTH,TEXT_HEIGHT, RED);
            erase_rectangle(left_adev_col*TEXT_WIDTH+TEXT_X_MARGIN,adev_row*TEXT_HEIGHT+TEXT_Y_MARGIN, max_adev_width*TEXT_WIDTH,TEXT_HEIGHT);
         }
         if(++count >= adev_table_rows) break;
         if(ATYPE == A_MTIE) {
            if(bins->adev_on[i] < 0.0) break;
         }
         else if(bins->adev_on[i] <= 0.0) break;

         tau = bins->adev_taus[i];
         strcpy(pstring, "????????");

         if(fperiod(period)) {
            if     (tau < 1000.0)    sprintf(pstring, "%8.4f", tau);
            else if(tau < 10000.0)   sprintf(pstring, "%8.3f", tau);
            else if(tau < 100000.0)  sprintf(pstring, "%8.2f", tau);
            else if(tau < 1000000.0) sprintf(pstring, "%8.1f", tau);
            else                     sprintf(pstring, "%8.0f", tau);
         }
         else {
            sprintf(pstring, "%8ld", (long) tau);
         }

         sprintf(out, "%s tau  %.3le (n=%ld)", pstring, bins->adev_bins[i], bins->adev_on[i]);
         vidstr(adev_row, left_adev_col, color, out);

         adevs_shown = strlen(out);
         if(adevs_shown > max_adev_width) max_adev_width = adevs_shown+1;
      }
   }

   ++adev_row;
//sprintf(debug_text, "maw:%d  left:%d  arow:%d  bot:%d  geight:%d  mouse:%d", 
//max_adev_width, left_adev_col, adev_row, adev_bottom_row, (adev_bottom_row-adev_row+1), MOUSE_ROW);
   i = (adev_bottom_row-adev_row+1);       // i=number of rows to erase
   if(all_adevs && (left_adev_col < INFO_COL)) {
      if(adev_bottom_row >= (MOUSE_ROW+0)) {  // mmmmm would eat into plot titles
         i -= (adev_bottom_row - (MOUSE_ROW+0));  // mmmmm adjust it so it won't
      }
   }
   else if(adev_bottom_row >= (MOUSE_ROW+1)) {  // mmmmm would eat into plot titles
      i -= (adev_bottom_row - (MOUSE_ROW+1));  // mmmmm adjust it so it won't
   }
   if(i > 0) {  // erase the rest of the adev table
//    fill_rectangle(left_adev_col*TEXT_WIDTH+TEXT_X_MARGIN, adev_row*TEXT_HEIGHT+TEXT_Y_MARGIN, max_adev_width*TEXT_WIDTH,i*TEXT_HEIGHT, BLUE);
      erase_rectangle(left_adev_col*TEXT_WIDTH+TEXT_X_MARGIN,adev_row*TEXT_HEIGHT+TEXT_Y_MARGIN, max_adev_width*TEXT_WIDTH,i*TEXT_HEIGHT);
   }

   blank_underscore = 0;
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %r14
leaq 0x1170ef(%rip), %rax    # 0x2187c8
movl %edx, (%rax)
leaq 0x1170f6(%rip), %rbx    # 0x2187d8
cmpl $0x0, (%rbx)
je 0x101713
leaq 0x13d86a(%rip), %rax    # 0x23ef58
xorl %r13d, %r13d
cmpl $0x0, (%rax)
jne 0x10243a
leaq 0x13b63d(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
je 0x10243a
leaq 0x20b097(%rip), %rax    # 0x30c7a8
jmp 0x10171d
leaq 0x20b08e(%rip), %rax    # 0x30c7a8
xorl %r13d, %r13d
cmpb $0x0, (%rax)
jne 0x10243a
xorl %r13d, %r13d
cmpl $0x0, 0x648(%r14)
jle 0x10243a
movq %rsi, -0x38(%rbp)
movl $0x1, %edi
callq 0xd84d7
testl %eax, %eax
je 0x10243a
leaq 0x1170ac(%rip), %rax    # 0x218800
movl (%rax), %eax
leaq 0x121de7(%rip), %rcx    # 0x223544
imull $0x31a, (%rcx), %ecx    # imm = 0x31A
movslq %ecx, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rcx
addl %edx, %ecx
cmpl %ecx, %eax
setl %dl
leaq 0x13b5b8(%rip), %rcx    # 0x23cd3e
movb (%rcx), %cl
testb %cl, %cl
sete %sil
testb %sil, %dl
jne 0x10243a
leaq 0x20b94e(%rip), %rdx    # 0x30d0ec
cmpb $0x0, (%rdx)
leaq 0x117128(%rip), %rdx    # 0x2188d0
je 0x1017b7
cmpq $0x10000, (%rdx)        # imm = 0x10000
je 0x10243a
movzbl (%r14), %edx
xorl %r13d, %r13d
cmpq $0x13, %rdx
ja 0x101969
leaq 0x29b29(%rip), %rsi     # 0x12b2f8
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
leaq 0x13b3a9(%rip), %rdx    # 0x23cb88
leaq 0x13b3aa(%rip), %rsi    # 0x23cb90
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b513(%rip), %rdx    # 0x23cd08
jmp 0x101a27
leaq 0x13b427(%rip), %rdx    # 0x23cc28
leaq 0x13b428(%rip), %rsi    # 0x23cc30
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b501(%rip), %rdx    # 0x23cd18
jmp 0x1019df
movslq 0x353905(%rip), %rsi    # 0x455128
leaq 0x13b4e6(%rip), %rdx    # 0x23cd10
jmp 0x101a64
leaq 0x13b3a2(%rip), %rdx    # 0x23cbd8
leaq 0x13b3a3(%rip), %rsi    # 0x23cbe0
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b4c4(%rip), %rdx    # 0x23cd10
jmp 0x1019df
movslq 0x35373c(%rip), %rsi    # 0x454f94
leaq 0x13b4a9(%rip), %rdx    # 0x23cd08
jmp 0x101a64
leaq 0x13b36d(%rip), %rdx    # 0x23cbd8
leaq 0x13b36e(%rip), %rsi    # 0x23cbe0
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b48f(%rip), %rdx    # 0x23cd10
jmp 0x10195d
movslq 0x353573(%rip), %rsi    # 0x454e00
leaq 0x13b46c(%rip), %rdx    # 0x23cd00
jmp 0x101a64
leaq 0x13b2e8(%rip), %rdx    # 0x23cb88
leaq 0x13b2e9(%rip), %rsi    # 0x23cb90
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b452(%rip), %rdx    # 0x23cd08
jmp 0x10195d
leaq 0x13b366(%rip), %rdx    # 0x23cc28
leaq 0x13b367(%rip), %rsi    # 0x23cc30
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b440(%rip), %rdx    # 0x23cd18
jmp 0x101a27
leaq 0x13b2a4(%rip), %rdx    # 0x23cb88
leaq 0x13b2a5(%rip), %rsi    # 0x23cb90
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b40e(%rip), %rdx    # 0x23cd08
jmp 0x101a4d
leaq 0x13b232(%rip), %rdx    # 0x23cb38
leaq 0x13b233(%rip), %rsi    # 0x23cb40
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b3e4(%rip), %rdx    # 0x23cd00
jmp 0x10195d
leaq 0x13b263(%rip), %rdx    # 0x23cb88
leaq 0x13b264(%rip), %rsi    # 0x23cb90
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b3cd(%rip), %rdx    # 0x23cd08
jmp 0x1019df
leaq 0x13b2e1(%rip), %rdx    # 0x23cc28
leaq 0x13b2e2(%rip), %rsi    # 0x23cc30
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b3bb(%rip), %rdx    # 0x23cd18
leaq 0x3406f(%rip), %r8      # 0x1359d3
jmp 0x101a6b
leaq 0x13b388(%rip), %rdx    # 0x23ccf8
leaq 0x25871(%rip), %r8      # 0x1271e8
xorl %esi, %esi
jmp 0x101a6b
leaq 0x13b1b3(%rip), %rdx    # 0x23cb38
leaq 0x13b1b4(%rip), %rsi    # 0x23cb40
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b365(%rip), %rdx    # 0x23cd00
jmp 0x101a27
leaq 0x13b231(%rip), %rdx    # 0x23cbd8
leaq 0x13b232(%rip), %rsi    # 0x23cbe0
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b353(%rip), %rdx    # 0x23cd10
jmp 0x101a4d
leaq 0x13b16f(%rip), %rdx    # 0x23cb38
leaq 0x13b170(%rip), %rsi    # 0x23cb40
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b321(%rip), %rdx    # 0x23cd00
leaq 0x33fe8(%rip), %r8      # 0x1359ce
jmp 0x101a6b
leaq 0x13b236(%rip), %rdx    # 0x23cc28
leaq 0x13b237(%rip), %rsi    # 0x23cc30
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b310(%rip), %rdx    # 0x23cd18
jmp 0x101a4d
leaq 0x13b1c7(%rip), %rdx    # 0x23cbd8
leaq 0x13b1c8(%rip), %rsi    # 0x23cbe0
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b2e9(%rip), %rdx    # 0x23cd10
leaq 0x33f9b(%rip), %r8      # 0x1359c9
jmp 0x101a6b
leaq 0x13b101(%rip), %rdx    # 0x23cb38
leaq 0x13b102(%rip), %rsi    # 0x23cb40
cvttsd2si (%rsi), %rsi
addq (%rdx), %rsi
leaq 0x13b2b3(%rip), %rdx    # 0x23cd00
leaq 0x1c434(%rip), %r8      # 0x11de88
jmp 0x101a6b
movslq 0x35385f(%rip), %rsi    # 0x4552bc
leaq 0x13b2b4(%rip), %rdx    # 0x23cd18
leaq 0x33f6d(%rip), %r8      # 0x1359d8
movsd (%rdx), %xmm1
xorpd %xmm0, %xmm0
movapd %xmm1, -0x60(%rbp)
ucomisd %xmm1, %xmm0
jae 0x10243a
testb %cl, %cl
sete %cl
cmpl $0x500, %eax            # imm = 0x500
setl %al
andb %cl, %al
cmpb $0x1, %al
jne 0x101b89
leaq 0x119968(%rip), %rax    # 0x21b408
cmpb $0x0, (%rax)
je 0x101ac5
leaq 0x23993c(%rip), %rax    # 0x33b3e8
cmpb $0x0, (%rax)
je 0x10243a
leaq 0x239930(%rip), %rax    # 0x33b3ec
testb $0x1, (%rax)
je 0x10243a
leaq 0x119947(%rip), %rax    # 0x21b413
cmpb $0x0, (%rax)
je 0x101af1
leaq 0x239910(%rip), %rax    # 0x33b3e8
cmpb $0x0, (%rax)
je 0x10243a
leaq 0x239904(%rip), %rax    # 0x33b3ec
testb $0x2, (%rax)
je 0x10243a
leaq 0x11991d(%rip), %rax    # 0x21b415
cmpb $0x0, (%rax)
je 0x101b1d
leaq 0x2398e4(%rip), %rax    # 0x33b3e8
cmpb $0x0, (%rax)
je 0x10243a
leaq 0x2398d8(%rip), %rax    # 0x33b3ec
testb $0x4, (%rax)
je 0x10243a
leaq 0x23978c(%rip), %rax    # 0x33b2b0
cmpb $0x0, (%rax)
je 0x101b49
leaq 0x2398b8(%rip), %rax    # 0x33b3e8
cmpb $0x0, (%rax)
je 0x10243a
leaq 0x2398ac(%rip), %rax    # 0x33b3ec
testb $0x8, (%rax)
je 0x10243a
leaq 0x20c348(%rip), %rax    # 0x30de98
cmpb $0x0, (%rax)
jne 0x10243a
leaq 0x239780(%rip), %rax    # 0x33b2e0
cmpb $0x0, (%rax)
jne 0x10243a
leaq 0x20c32a(%rip), %rax    # 0x30de9a
cmpb $0x0, (%rax)
jne 0x10243a
leaq 0x239754(%rip), %rax    # 0x33b2d4
cmpb $0x0, (%rax)
jne 0x10243a
movss 0x194(%r14), %xmm1
xorpd %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x101bb1
jp 0x101bb1
movss 0x198(%r14), %xmm1
ucomiss %xmm0, %xmm1
jne 0x101bb1
jnp 0x10243a
movq %r8, %r13
movq %rsi, -0x40(%rbp)
callq 0xfe169
movb (%r14), %al
leal -0xf(%rax), %ecx
cmpb $0x5, %cl
jae 0x101bdf
leaq 0x1b60d(%rip), %rax     # 0x11d1dc
movq %rax, -0x30(%rbp)
leaq 0x116cf6(%rip), %rdx    # 0x2188d0
movq %r13, %rsi
jmp 0x101c2d
leal -0xa(%rax), %ecx
cmpb $0x5, %cl
leaq 0x116ce4(%rip), %rdx    # 0x2188d0
movq %r13, %rsi
jae 0x101bfa
leaq 0xf02a(%rip), %rax      # 0x110c22
jmp 0x101c29
addb $-0x5, %al
leaq 0x13b0c1(%rip), %rcx    # 0x23ccc4
movl (%rcx), %ecx
cmpb $0x4, %al
ja 0x101c1a
testl %ecx, %ecx
je 0x10244f
leaq 0x33dc5(%rip), %rax     # 0x1359dd
jmp 0x101c29
testl %ecx, %ecx
je 0x102487
leaq 0x33dbc(%rip), %rax     # 0x1359e5
movq %rax, -0x30(%rbp)
movb 0x4(%rsi), %al
movb %al, -0xac(%rbp)
movl (%rsi), %eax
movl %eax, -0xb0(%rbp)
cmpq $0x10000, (%rdx)        # imm = 0x10000
je 0x101c50
callq 0x701f2
testl %eax, %eax
je 0x101c5c
leaq 0x116cb1(%rip), %rax    # 0x218908
cmpl $0x4c, (%rax)
jne 0x101c68
leaq -0xb0(%rbp), %rdi
callq 0x986c
leaq 0x1197ba(%rip), %rax    # 0x21b429
movb $0x1, (%rax)
leaq 0x13b0c5(%rip), %rcx    # 0x23cd3e
cmpb $0x0, (%rcx)
leaq 0x116c4d(%rip), %r13    # 0x2188d0
je 0x101cae
cmpq $0x10000, (%r13)        # imm = 0x10000
jne 0x101cae
leaq 0x31dc8(%rip), %rcx     # 0x133a5e
movq -0x38(%rbp), %rdi
movl %r12d, %esi
movl $0xf, %edx
callq 0xe7d0
leaq 0x13b090(%rip), %rcx    # 0x23cd3e
leaq 0x11964f(%rip), %rax    # 0x21b304
cmpl $0x0, (%rax)
movl $0x3a, %eax
movl $0x12, %r8d
cmovel %eax, %r8d
cmpb $0x0, (%rcx)
jne 0x102010
leaq 0x116b29(%rip), %rax    # 0x218800
cmpl $0x3e1, (%rax)          # imm = 0x3E1
jle 0x102010
leal 0x4(%r12), %eax
leaq 0x116ad9(%rip), %rcx    # 0x2187c8
movl %eax, (%rcx)
leaq 0x23a528(%rip), %r13    # 0x33c220
leaq 0x33d3e(%rip), %rsi     # 0x135a3d
leaq -0xb0(%rbp), %rcx
movq %r13, %rdi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %r9
xorl %eax, %eax
callq 0x9060
leaq 0x116ae9(%rip), %rax    # 0x218808
movslq (%rax), %rcx
leaq 0x13af63(%rip), %rax    # 0x23cc8c
movslq (%rax), %rax
subq %rax, %rcx
addq 0x4e242(%rip), %rcx     # 0x14ff78
movzbl %r15b, %r15d
movq -0x38(%rbp), %rbx
movl %ebx, %edi
movl %r12d, %esi
movl %r15d, %edx
callq 0xe7d0
addl $0x7, %r12d
movl %ebx, %edi
movl %r12d, %esi
movl %r15d, -0x40(%rbp)
movl %r15d, %edx
movq %r13, %rcx
callq 0xe7d0
movq %r13, %rdi
callq 0x9120
leaq 0x13af12(%rip), %rcx    # 0x23cc84
movl %eax, (%rcx)
movl 0x648(%r14), %eax
leaq 0x13af0e(%rip), %rcx    # 0x23cc90
cmpl (%rcx), %eax
jle 0x101d88
movl %eax, (%rcx)
leaq 0x13aef1(%rip), %rax    # 0x23cc80
movslq (%rax), %rcx
cmpl 0x648(%r14), %ecx
jge 0x1023a3
cvttpd2dq -0x60(%rbp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
leaq (%r14,%rcx,8), %r15
addq $0x328, %r15            # imm = 0x328
leaq 0x4(%r14,%rcx,4), %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rsi
movl %esi, %ebx
leaq -0x130(%rbp), %r13
xorl %eax, %eax
leaq 0x1169f2(%rip), %rdi    # 0x2187c8
leaq 0x13aeaf(%rip), %r8     # 0x23cc8c
movq %rcx, -0x50(%rbp)
movq %rbx, -0x48(%rbp)
movq %r15, -0x70(%rbp)
movq %rax, %r12
addq %rbx, %rax
leaq 0x13af48(%rip), %rcx    # 0x23cd3e
cmpb $0x0, (%rcx)
je 0x101e18
movl (%rdi), %ecx
leaq 0x116998(%rip), %rdx    # 0x21879c
cmpl (%rdx), %ecx
jge 0x101e18
leaq 0x116999(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jl 0x101e27
jmp 0x102006
leaq 0x116989(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jg 0x102006
movl (%r8), %edx
cmpl $0x6, %edx
jl 0x101e66
movl (%rdi), %edi
leaq 0x1169d8(%rip), %rax    # 0x218810
movl (%rax), %eax
addl $0x2, %edi
imull %eax, %edi
leaq 0x1169cd(%rip), %rcx    # 0x218814
movl (%rcx), %ecx
leal (%rbx,%r12), %esi
addl $0x2, %esi
imull %ecx, %esi
imull %eax, %edx
callq 0xd45c
leaq 0x116966(%rip), %rdi    # 0x2187c8
movq -0x38(%rbp), %rsi
leal 0x1(%r12), %eax
leaq 0x11694e(%rip), %rcx    # 0x2187c0
cmpl (%rcx), %eax
jge 0x102006
leaq 0x12178f(%rip), %rax    # 0x223610
cmpl $0x9, (%rax)
jne 0x101e92
cmpq $0x0, (%r15,%r12,8)
jns 0x101e9d
jmp 0x102006
cmpq $0x0, (%r15,%r12,8)
jle 0x102006
movapd -0x60(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
movq -0x30(%rbp), %rax
movss (%rax,%r12,4), %xmm1
movabsq $0x3f3f3f3f3f3f3f3f, %rax # imm = 0x3F3F3F3F3F3F3F3F
movq %rax, -0x130(%rbp)
movb $0x0, -0x128(%rbp)
jne 0x101ee5
jp 0x101ee5
cvttss2si %xmm1, %rdx
movq %r13, %rdi
leaq 0x33b7e(%rip), %rsi     # 0x135a5a
xorl %eax, %eax
callq 0x9060
jmp 0x101f5e
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movss 0x1ca8c(%rip), %xmm2    # 0x11e980
ucomiss %xmm1, %xmm2
jbe 0x101f05
movq %r13, %rdi
leaq 0x33b51(%rip), %rsi     # 0x135a54
jmp 0x101f57
movss 0x1cac7(%rip), %xmm2    # 0x11e9d4
ucomiss %xmm1, %xmm2
jbe 0x101f1e
movq %r13, %rdi
leaq 0x31900(%rip), %rsi     # 0x13381c
jmp 0x101f57
movss 0x2a8d6(%rip), %xmm2    # 0x12c7fc
ucomiss %xmm1, %xmm2
jbe 0x101f37
movq %r13, %rdi
leaq 0x251df(%rip), %rsi     # 0x127114
jmp 0x101f57
movss 0x1ca5d(%rip), %xmm2    # 0x11e99c
movq %r13, %rdi
ucomiss %xmm1, %xmm2
jbe 0x101f50
leaq 0x251bf(%rip), %rsi     # 0x12710d
jmp 0x101f57
leaq 0x251af(%rip), %rsi     # 0x127106
movb $0x1, %al
callq 0x9060
movq %r13, %rdx
leaq (%rbx,%r12), %r13
incq %r13
movq -0x30(%rbp), %rax
xorps %xmm0, %xmm0
cvtss2sd 0x190(%rax,%r12,4), %xmm0
movq (%r15,%r12,8), %rcx
leaq 0x23a29c(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
leaq 0x33ad1(%rip), %rsi     # 0x135a5f
movq %rdx, %r15
movb $0x1, %al
callq 0x9060
leaq 0x116829(%rip), %rax    # 0x2187c8
movl (%rax), %esi
movl %r13d, %edi
movl -0x40(%rbp), %edx
movq %rbx, %rcx
callq 0xe7d0
movq %rbx, %rdi
callq 0x9120
leaq 0x13acc6(%rip), %rcx    # 0x23cc84
movl %eax, (%rcx)
leaq 0x13acc5(%rip), %r8     # 0x23cc8c
cmpl %eax, (%r8)
jge 0x101fd1
incl %eax
movl %eax, (%r8)
movslq 0x648(%r14), %rcx
leaq 0x1(%r12), %rax
movq -0x50(%rbp), %rdx
addq %r12, %rdx
incq %rdx
cmpq %rcx, %rdx
movq -0x38(%rbp), %rsi
leaq 0x1167d3(%rip), %rdi    # 0x2187c8
movq %r15, %r13
movq -0x70(%rbp), %r15
movq -0x48(%rbp), %rbx
jl 0x101de9
addl %r12d, %esi
incl %esi
jmp 0x1023ae
leaq 0x1167b1(%rip), %r13    # 0x2187c8
movl %r12d, (%r13)
leaq 0x23a1fe(%rip), %rdi    # 0x33c220
leaq 0x339c4(%rip), %rsi     # 0x1359ed
leaq -0xb0(%rbp), %rcx
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %r9
xorl %eax, %eax
callq 0x9060
movl (%r13), %esi
leaq 0x1167be(%rip), %rax    # 0x218808
movslq (%rax), %rcx
leaq 0x13ac38(%rip), %rax    # 0x23cc8c
movslq (%rax), %rax
subq %rax, %rcx
addq 0x4df17(%rip), %rcx     # 0x14ff78
movzbl %r15b, %r12d
movq -0x38(%rbp), %r15
movl %r15d, %edi
movl %r12d, %edx
callq 0xe7d0
movl (%r13), %esi
movl %r15d, %edi
movl %r12d, -0x80(%rbp)
movl %r12d, %edx
leaq 0x23a197(%rip), %r15    # 0x33c220
movq %r15, %rcx
callq 0xe7d0
movq %r15, %rdi
callq 0x9120
leaq 0x13abe4(%rip), %rcx    # 0x23cc84
movl %eax, (%rcx)
movl 0x648(%r14), %eax
leaq 0x13abe0(%rip), %rcx    # 0x23cc90
cmpl (%rcx), %eax
jle 0x1020b6
movl %eax, (%rcx)
leaq 0x13abc3(%rip), %rax    # 0x23cc80
movslq (%rax), %rcx
cmpl 0x648(%r14), %ecx
jge 0x1023a3
cvttpd2dq -0x60(%rbp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
leaq (%r14,%rcx,8), %rax
addq $0x328, %rax            # imm = 0x328
movq %rax, -0x40(%rbp)
leaq 0x194(%r14,%rcx,4), %r15
movq -0x38(%rbp), %rsi
movl %esi, %eax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
leaq 0x1166c5(%rip), %rdi    # 0x2187c8
movq %rcx, -0x48(%rbp)
movq %r15, -0x88(%rbp)
movq %rax, %r13
movq -0x30(%rbp), %rax
addq %r13, %rax
leaq 0x13ac1f(%rip), %rcx    # 0x23cd3e
cmpb $0x0, (%rcx)
je 0x102141
movl (%rdi), %ecx
leaq 0x11666f(%rip), %rdx    # 0x21879c
cmpl (%rdx), %ecx
jge 0x102141
leaq 0x116670(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jl 0x102150
jmp 0x10239c
leaq 0x116660(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jg 0x10239c
leaq 0x13ab35(%rip), %rax    # 0x23cc8c
movl (%rax), %edx
cmpl $0x6, %edx
jl 0x102198
movl (%rdi), %edi
leaq 0x1166a9(%rip), %rax    # 0x218810
movl (%rax), %eax
addl $0x2, %edi
imull %eax, %edi
leaq 0x11669e(%rip), %rcx    # 0x218814
movl (%rcx), %ecx
movq -0x30(%rbp), %rsi
addl %r13d, %esi
addl $0x2, %esi
imull %ecx, %esi
imull %eax, %edx
callq 0xd45c
leaq 0x116634(%rip), %rdi    # 0x2187c8
movq -0x38(%rbp), %rsi
leal 0x1(%r13), %eax
leaq 0x11661d(%rip), %rcx    # 0x2187c0
cmpl (%rcx), %eax
jge 0x10239c
leaq 0x12145e(%rip), %rax    # 0x223610
cmpl $0x9, (%rax)
jne 0x1021c7
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax,%r13,8)
jns 0x1021d6
jmp 0x10239c
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax,%r13,8)
jle 0x10239c
movapd -0x60(%rbp), %xmm0
ucomisd -0x70(%rbp), %xmm0
movss -0x190(%r15,%r13,4), %xmm2
movl $0x3f3f3f, -0x12d(%rbp) # imm = 0x3F3F3F
movl $0x3f3f3f3f, -0x130(%rbp) # imm = 0x3F3F3F3F
movss %xmm2, -0x50(%rbp)
jne 0x102223
jp 0x102223
cvttss2si %xmm2, %rdx
leaq -0x130(%rbp), %rdi
leaq 0x337ef(%rip), %rsi     # 0x135a09
xorl %eax, %eax
callq 0x9060
jmp 0x10228f
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movss 0xada6(%rip), %xmm1     # 0x10cfd8
ucomiss %xmm2, %xmm1
jbe 0x102247
leaq -0x130(%rbp), %rdi
leaq 0x25c0e(%rip), %rsi     # 0x127e53
jmp 0x102288
movss 0x1c731(%rip), %xmm1    # 0x11e980
ucomiss %xmm2, %xmm1
jbe 0x102264
leaq -0x130(%rbp), %rdi
leaq 0x25c06(%rip), %rsi     # 0x127e68
jmp 0x102288
movss 0x1c768(%rip), %xmm1    # 0x11e9d4
leaq -0x130(%rbp), %rdi
ucomiss %xmm2, %xmm1
jbe 0x102281
leaq 0x3377e(%rip), %rsi     # 0x1359fd
jmp 0x102288
leaq 0x3377b(%rip), %rsi     # 0x135a03
movb $0x1, %al
callq 0x9060
leaq 0x13aaa8(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
leaq 0x116560(%rip), %rax    # 0x218800
leaq 0x239f79(%rip), %r12    # 0x33c220
je 0x1022fe
cmpl $0x3e2, (%rax)          # imm = 0x3E2
jl 0x1022fe
cmpl $0x0, (%rbx)
jne 0x1022fe
movss -0x50(%rbp), %xmm0
ucomiss 0x1c6da(%rip), %xmm0    # 0x11e99c
leaq 0x33757(%rip), %rsi     # 0x135a20
jb 0x1022d2
leaq 0x3373c(%rip), %rsi     # 0x135a0e
xorps %xmm0, %xmm0
cvtss2sd (%r15,%r13,4), %xmm0
movq -0x40(%rbp), %rax
movq (%rax,%r13,8), %rcx
movq %r12, %rdi
leaq -0x130(%rbp), %rdx
movb $0x1, %al
callq 0x9060
movq %r12, %rdi
callq 0x9120
jmp 0x10232a
xorps %xmm0, %xmm0
cvtss2sd (%r15,%r13,4), %xmm0
movq %r12, %rdi
leaq 0x33722(%rip), %rsi     # 0x135a33
leaq -0x130(%rbp), %rdx
movb $0x1, %al
callq 0x9060
movq %r12, %rdi
callq 0x9120
addl $0x6, %eax
movq -0x30(%rbp), %rcx
leaq (%rcx,%r13), %rdi
incq %rdi
leaq 0x13a948(%rip), %r15    # 0x23cc84
movl %eax, (%r15)
leaq 0x116482(%rip), %rax    # 0x2187c8
movl (%rax), %esi
movl -0x80(%rbp), %edx
movq %r12, %rcx
callq 0xe7d0
movl (%r15), %eax
leaq 0x13a92f(%rip), %rcx    # 0x23cc8c
cmpl (%rcx), %eax
jle 0x10236c
incl %eax
leaq 0x13a922(%rip), %rcx    # 0x23cc8c
movl %eax, (%rcx)
movslq 0x648(%r14), %rcx
leaq 0x1(%r13), %rax
movq -0x48(%rbp), %rdx
addq %r13, %rdx
incq %rdx
cmpq %rcx, %rdx
movq -0x38(%rbp), %rsi
leaq 0x116439(%rip), %rdi    # 0x2187c8
movq -0x88(%rbp), %r15
jl 0x10210e
addl %r13d, %esi
incl %esi
jmp 0x1023ae
movq -0x38(%rbp), %rsi
leaq 0x11641a(%rip), %rdi    # 0x2187c8
leaq 0x119074(%rip), %rbx    # 0x21b429
leaq 0x1163fc(%rip), %rax    # 0x2187b8
movl (%rax), %eax
leaq 0x13a979(%rip), %rcx    # 0x23cd3e
cmpb $0x0, (%rcx)
je 0x1023e7
movl (%rdi), %ecx
leaq 0x1163c9(%rip), %rdx    # 0x21879c
cmpl (%rdx), %ecx
jge 0x1023e7
leaq 0x1163ca(%rip), %rcx    # 0x2187a8
movl (%rcx), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
jmp 0x1023f8
leaq 0x1163ba(%rip), %rcx    # 0x2187a8
movl (%rcx), %edx
leal 0x1(%rdx), %ecx
cmpl %edx, %eax
cmovlel %eax, %ecx
subl %esi, %ecx
testl %ecx, %ecx
jle 0x102431
movl (%rdi), %edi
leaq 0x116409(%rip), %rax    # 0x218810
movl (%rax), %edx
addl $0x2, %edi
imull %edx, %edi
leaq 0x1163fe(%rip), %rax    # 0x218814
movl (%rax), %eax
addl $0x2, %esi
imull %eax, %esi
leaq 0x13a867(%rip), %r8     # 0x23cc8c
imull (%r8), %edx
imull %eax, %ecx
callq 0xd45c
movb $0x0, (%rbx)
movl $0x1, %r13d
movl %r13d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b9cf(%rip), %rax     # 0x11de25
movq %rax, -0x30(%rbp)
cmpq $0x10000, (%rdx)        # imm = 0x10000
je 0x101c2d
callq 0x701f2
movq %r13, %rsi
leaq 0x11645a(%rip), %rdx    # 0x2188d0
testl %eax, %eax
jne 0x101c2d
leaq 0x5b8ab(%rip), %rax     # 0x15dd30
jmp 0x1024c2
leaq 0x1b99d(%rip), %rax     # 0x11de2b
movq %rax, -0x30(%rbp)
cmpq $0x10000, (%rdx)        # imm = 0x10000
je 0x101c2d
callq 0x701f2
movq %r13, %rsi
leaq 0x116422(%rip), %rdx    # 0x2188d0
testl %eax, %eax
jne 0x101c2d
movl $0xe8, %eax
addq 0x4da4e(%rip), %rax     # 0x14ff10
movq (%rax), %rax
jmp 0x101c29