// File: /workspace/github_cpp_makefile_star2_O2/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, %r13d
movl %edx, %r12d
movq %rdi, %r15
leaq 0x116ea8(%rip), %rax    # 0x2027c8
movl %edx, (%rax)
leaq 0x116eaf(%rip), %rbx    # 0x2027d8
cmpl $0x0, (%rbx)
je 0xeb95a
leaq 0x13d623(%rip), %rax    # 0x228f58
xorl %r14d, %r14d
cmpl $0x0, (%rax)
jne 0xec6cd
leaq 0x13b3f6(%rip), %rax    # 0x226d3e
cmpb $0x0, (%rax)
je 0xec6cd
leaq 0x20ae50(%rip), %rax    # 0x2f67a8
jmp 0xeb964
leaq 0x20ae47(%rip), %rax    # 0x2f67a8
xorl %r14d, %r14d
cmpb $0x0, (%rax)
jne 0xec6cd
xorl %r14d, %r14d
cmpl $0x0, 0x648(%r15)
jle 0xec6cd
movq %rsi, -0x30(%rbp)
pushq $0x1
popq %rdi
callq 0xc71ad
testl %eax, %eax
je 0xec6cd
leaq 0x116e67(%rip), %rax    # 0x202800
movl (%rax), %esi
leaq 0x121ba2(%rip), %rax    # 0x20d544
imull $0x31a, (%rax), %eax    # imm = 0x31A
pushq $0x64
popq %rcx
cltd
idivl %ecx
cmpl %eax, %esi
setl %al
leaq 0x13b384(%rip), %rcx    # 0x226d3e
movb (%rcx), %dl
testb %dl, %dl
sete %cl
testb %cl, %al
jne 0xec6cd
leaq 0x20b71c(%rip), %rax    # 0x2f70ec
cmpb $0x0, (%rax)
setne %al
leaq 0x116ef3(%rip), %r9     # 0x2028d0
movq (%r9), %rcx
cmpq $0x10000, %rcx          # imm = 0x10000
sete %dil
testb %dil, %al
jne 0xec6cd
movzbl (%r15), %eax
xorl %r14d, %r14d
cmpq $0x13, %rax
ja 0xebbae
leaq 0x298ac(%rip), %rdi     # 0x1152b8
movslq (%rdi,%rax,4), %r8
addq %rdi, %r8
leaq 0x8f92(%rip), %r10      # 0xf49ac
jmpq *%r8
leaq 0x13b164(%rip), %rdi    # 0x226b88
leaq 0x13b165(%rip), %r8     # 0x226b90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b2ce(%rip), %rdi    # 0x226d08
jmp 0xebc6a
leaq 0x13b1e2(%rip), %rdi    # 0x226c28
leaq 0x13b1e3(%rip), %r8     # 0x226c30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b2bc(%rip), %rdi    # 0x226d18
jmp 0xebc25
movslq 0x3535e0(%rip), %r8     # 0x43f048
leaq 0x13b2a1(%rip), %rdi    # 0x226d10
jmp 0xebc97
leaq 0x13b15d(%rip), %rdi    # 0x226bd8
leaq 0x13b15e(%rip), %r8     # 0x226be0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b27f(%rip), %rdi    # 0x226d10
jmp 0xebc25
movslq 0x353417(%rip), %r8     # 0x43eeb4
leaq 0x13b264(%rip), %rdi    # 0x226d08
jmp 0xebc97
leaq 0x13b128(%rip), %rdi    # 0x226bd8
leaq 0x13b129(%rip), %r8     # 0x226be0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b24a(%rip), %rdi    # 0x226d10
jmp 0xebba2
movslq 0x35324e(%rip), %r8     # 0x43ed20
leaq 0x13b227(%rip), %rdi    # 0x226d00
jmp 0xebc97
leaq 0x13b0a3(%rip), %rdi    # 0x226b88
leaq 0x13b0a4(%rip), %r8     # 0x226b90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b20d(%rip), %rdi    # 0x226d08
jmp 0xebba2
leaq 0x13b121(%rip), %rdi    # 0x226c28
leaq 0x13b122(%rip), %r8     # 0x226c30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b1fb(%rip), %rdi    # 0x226d18
jmp 0xebc6a
leaq 0x13b05f(%rip), %rdi    # 0x226b88
leaq 0x13b060(%rip), %r8     # 0x226b90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b1c9(%rip), %rdi    # 0x226d08
jmp 0xebc90
leaq 0x13afed(%rip), %rdi    # 0x226b38
leaq 0x13afee(%rip), %r8     # 0x226b40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b19f(%rip), %rdi    # 0x226d00
jmp 0xebba2
leaq 0x13b01e(%rip), %rdi    # 0x226b88
leaq 0x13b01f(%rip), %r8     # 0x226b90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b188(%rip), %rdi    # 0x226d08
jmp 0xebc25
leaq 0x13b09c(%rip), %rdi    # 0x226c28
leaq 0x13b09d(%rip), %r8     # 0x226c30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b176(%rip), %rdi    # 0x226d18
leaq 0x8df9(%rip), %r10      # 0xf49a2
jmp 0xebc97
leaq 0x13b143(%rip), %rdi    # 0x226cf8
leaq 0x33e98(%rip), %r10     # 0x11fa54
xorl %r8d, %r8d
jmp 0xebc97
leaq 0x13af6d(%rip), %rdi    # 0x226b38
leaq 0x13af6e(%rip), %r8     # 0x226b40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b11f(%rip), %rdi    # 0x226d00
jmp 0xebc6a
leaq 0x13afeb(%rip), %rdi    # 0x226bd8
leaq 0x13afec(%rip), %r8     # 0x226be0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b10d(%rip), %rdi    # 0x226d10
jmp 0xebc90
leaq 0x13af29(%rip), %rdi    # 0x226b38
leaq 0x13af2a(%rip), %r8     # 0x226b40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b0db(%rip), %rdi    # 0x226d00
leaq 0x8d71(%rip), %r10      # 0xf499d
jmp 0xebc97
leaq 0x13aff3(%rip), %rdi    # 0x226c28
leaq 0x13aff4(%rip), %r8     # 0x226c30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b0cd(%rip), %rdi    # 0x226d18
jmp 0xebc90
leaq 0x13af84(%rip), %rdi    # 0x226bd8
leaq 0x13af85(%rip), %r8     # 0x226be0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b0a6(%rip), %rdi    # 0x226d10
leaq 0x8d27(%rip), %r10      # 0xf4998
jmp 0xebc97
leaq 0x13aebe(%rip), %rdi    # 0x226b38
leaq 0x13aebf(%rip), %r8     # 0x226b40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13b070(%rip), %rdi    # 0x226d00
leaq 0x8d10(%rip), %r10      # 0xf49a7
movsd (%rdi), %xmm1
xorpd %xmm0, %xmm0
movapd %xmm1, -0x60(%rbp)
ucomisd %xmm1, %xmm0
jae 0xec6cd
testb %dl, %dl
sete %dil
cmpl $0x500, %esi            # imm = 0x500
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0xebdbb
leaq 0x119736(%rip), %rsi    # 0x205408
cmpb $0x0, (%rsi)
je 0xebcf7
leaq 0x23970a(%rip), %rsi    # 0x3253e8
cmpb $0x0, (%rsi)
je 0xec6cd
leaq 0x2396fe(%rip), %rsi    # 0x3253ec
testb $0x1, (%rsi)
je 0xec6cd
leaq 0x119715(%rip), %rsi    # 0x205413
cmpb $0x0, (%rsi)
je 0xebd23
leaq 0x2396de(%rip), %rsi    # 0x3253e8
cmpb $0x0, (%rsi)
je 0xec6cd
leaq 0x2396d2(%rip), %rsi    # 0x3253ec
testb $0x2, (%rsi)
je 0xec6cd
leaq 0x1196eb(%rip), %rsi    # 0x205415
cmpb $0x0, (%rsi)
je 0xebd4f
leaq 0x2396b2(%rip), %rsi    # 0x3253e8
cmpb $0x0, (%rsi)
je 0xec6cd
leaq 0x2396a6(%rip), %rsi    # 0x3253ec
testb $0x4, (%rsi)
je 0xec6cd
leaq 0x23955a(%rip), %rsi    # 0x3252b0
cmpb $0x0, (%rsi)
je 0xebd7b
leaq 0x239686(%rip), %rsi    # 0x3253e8
cmpb $0x0, (%rsi)
je 0xec6cd
leaq 0x23967a(%rip), %rsi    # 0x3253ec
testb $0x8, (%rsi)
je 0xec6cd
leaq 0x20c116(%rip), %rsi    # 0x2f7e98
cmpb $0x0, (%rsi)
jne 0xec6cd
leaq 0x23954e(%rip), %rsi    # 0x3252e0
cmpb $0x0, (%rsi)
jne 0xec6cd
leaq 0x20c0f8(%rip), %rsi    # 0x2f7e9a
cmpb $0x0, (%rsi)
jne 0xec6cd
leaq 0x239522(%rip), %rsi    # 0x3252d4
cmpb $0x0, (%rsi)
jne 0xec6cd
movss 0x194(%r15), %xmm1
xorpd %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0xebde3
jp 0xebde3
movss 0x198(%r15), %xmm1
ucomiss %xmm0, %xmm1
jne 0xebde3
jnp 0xec6cd
xorl %esi, %esi
testb %dl, %dl
sete %sil
leaq 0x1169b6(%rip), %rdx    # 0x2027a8
movl (%rdx), %edx
leal 0x1(%rdx,%rsi,2), %edx
leaq 0x1169b9(%rip), %rsi    # 0x2027b8
movl %edx, (%rsi)
leal -0xf(%rax), %edx
cmpb $0x5, %dl
movq %r9, %r14
movq %r8, -0x40(%rbp)
jae 0xebe19
leaq 0x1b4d9(%rip), %rdx     # 0x1072f0
jmp 0xebe2c
leal -0xa(%rax), %edx
cmpb $0x5, %dl
jae 0xebed0
leaq 0xef0a(%rip), %rdx      # 0xfad36
movb 0x4(%r10), %al
movb %al, -0xac(%rbp)
movl (%r10), %eax
movl %eax, -0xb0(%rbp)
cmpq $0x10000, (%r9)         # imm = 0x10000
movq %rdx, -0x50(%rbp)
je 0xebe55
callq 0x66b41
testl %eax, %eax
je 0xebe61
leaq 0x116aac(%rip), %rax    # 0x202908
cmpl $0x4c, (%rax)
jne 0xebe6d
leaq -0xb0(%rbp), %rdi
callq 0x986c
leaq 0x1195b5(%rip), %rax    # 0x205429
movb $0x1, (%rax)
leaq 0x13aec0(%rip), %rax    # 0x226d3e
movb (%rax), %al
testb %al, %al
je 0xebf3d
cmpq $0x10000, (%r14)        # imm = 0x10000
movq -0x30(%rbp), %rdi
jne 0xebf41
leaq 0x31bce(%rip), %rcx     # 0x11da6e
pushq $0xf
popq %rdx
movl %r12d, %esi
callq 0xe2d2
movq -0x30(%rbp), %rdi
leaq 0x13ae88(%rip), %rax    # 0x226d3e
movb (%rax), %al
jmp 0xebf41
movslq 0x353318(%rip), %r8     # 0x43f1dc
leaq 0x13ae4d(%rip), %rdi    # 0x226d18
jmp 0xebc97
cmpq $0x10000, %rcx          # imm = 0x10000
sete %sil
addb $-0x5, %al
leaq 0x13ade0(%rip), %rcx    # 0x226cc4
movl (%rcx), %edx
testl %edx, %edx
setne %cl
orb %sil, %cl
cmpb $0x4, %al
ja 0xec6e2
testl %edx, %edx
leaq 0x33ada(%rip), %rdx     # 0x11f9d9
leaq 0x1c033(%rip), %rax     # 0x107f39
cmoveq %rax, %rdx
testb %cl, %cl
jne 0xebe2c
movq %r10, -0x48(%rbp)
callq 0x66b41
movq -0x48(%rbp), %r10
movq %r14, %r9
leaq 0x1c010(%rip), %rdx     # 0x107f39
testl %eax, %eax
jne 0xebe2c
leaq 0x5bdf8(%rip), %rax     # 0x147d30
jmp 0xec729
movq -0x30(%rbp), %rdi
leaq 0x1193bc(%rip), %rcx    # 0x205304
cmpl $0x0, (%rcx)
pushq $0x3a
popq %rcx
pushq $0x12
popq %r8
cmovel %ecx, %r8d
movzbl %r13b, %ecx
movl %ecx, -0x34(%rbp)
movl %edi, %r14d
testb %al, %al
leaq 0x116897(%rip), %rax    # 0x202800
movq %r14, -0x48(%rbp)
jne 0xec299
cmpl $0x3e1, (%rax)          # imm = 0x3E1
jle 0xec299
leal 0x4(%r12), %eax
leaq 0x11683d(%rip), %rcx    # 0x2027c8
movl %eax, (%rcx)
leaq 0x23a28c(%rip), %rdi    # 0x326220
leaq 0x33a9e(%rip), %rsi     # 0x11fa39
leaq -0xb0(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %r9
xorl %eax, %eax
callq 0x9060
leaq 0x116850(%rip), %rax    # 0x202808
movslq (%rax), %rcx
leaq 0x13acca(%rip), %rax    # 0x226c8c
movslq (%rax), %rax
subq %rax, %rcx
addq 0x4dfa9(%rip), %rcx     # 0x139f78
movq -0x30(%rbp), %rbx
movl %ebx, %edi
movl %r12d, %esi
movl -0x34(%rbp), %r13d
movl %r13d, %edx
callq 0xe2d2
addl $0x7, %r12d
movl %ebx, %edi
movl %r12d, %esi
movl %r13d, %edx
leaq 0x23a229(%rip), %rbx    # 0x326220
movq %rbx, %rcx
callq 0xe2d2
movq %rbx, %rdi
callq 0x9120
leaq 0x13ac76(%rip), %rcx    # 0x226c84
movl %eax, (%rcx)
movl 0x648(%r15), %eax
leaq 0x13ac72(%rip), %rcx    # 0x226c90
cmpl (%rcx), %eax
jle 0xec024
movl %eax, (%rcx)
leaq 0x13ac55(%rip), %rcx    # 0x226c80
movslq (%rcx), %rcx
cvttpd2dq -0x60(%rbp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
leaq 0x328(%r15,%rcx,8), %r12
movq %rcx, -0x50(%rbp)
leaq (%r15,%rcx,4), %rcx
addq $0x4, %rcx
movq %rcx, -0x40(%rbp)
leaq -0x130(%rbp), %r13
xorl %ebx, %ebx
movq -0x30(%rbp), %rsi
leaq 0x116761(%rip), %rdi    # 0x2027c8
leaq 0x13acd0(%rip), %r8     # 0x226d3e
leaq 0x13ac17(%rip), %rdx    # 0x226c8c
movq %r12, -0x70(%rbp)
movq -0x50(%rbp), %rcx
addq %rbx, %rcx
cltq
cmpq %rax, %rcx
jge 0xec633
leaq (%r14,%rbx), %rax
cmpb $0x0, (%r8)
je 0xec0b3
movl (%rdi), %ecx
leaq 0x1166fe(%rip), %r9     # 0x20279c
cmpl (%r9), %ecx
jge 0xec0b3
leaq 0x1166fe(%rip), %rcx    # 0x2027a8
cmpl (%rcx), %eax
jl 0xec0c2
jmp 0xec628
leaq 0x1166ee(%rip), %rcx    # 0x2027a8
cmpl (%rcx), %eax
jg 0xec628
movl (%rdx), %edx
cmpl $0x6, %edx
jl 0xec10e
leaq 0x1166f8(%rip), %rax    # 0x2027c8
movl (%rax), %edi
leaq 0x116737(%rip), %rax    # 0x202810
movl (%rax), %eax
addl $0x2, %edi
imull %eax, %edi
leaq 0x11672c(%rip), %rcx    # 0x202814
movl (%rcx), %ecx
leal (%r14,%rbx), %esi
addl $0x2, %esi
imull %ecx, %esi
imull %eax, %edx
callq 0xd0da
leaq 0x13ac3b(%rip), %r8     # 0x226d3e
leaq 0x1166be(%rip), %rdi    # 0x2027c8
movq -0x30(%rbp), %rsi
leal 0x1(%rbx), %eax
leaq 0x1166a8(%rip), %rcx    # 0x2027c0
cmpl (%rcx), %eax
jge 0xec628
leaq 0x1214e9(%rip), %rax    # 0x20d610
cmpl $0x9, (%rax)
movq (%r12,%rbx,8), %rax
jne 0xec13a
testq %rax, %rax
jns 0xec143
jmp 0xec628
testq %rax, %rax
jle 0xec628
movapd -0x60(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
movq -0x40(%rbp), %rax
movss (%rax,%rbx,4), %xmm1
movabsq $0x3f3f3f3f3f3f3f3f, %rax # imm = 0x3F3F3F3F3F3F3F3F
movq %rax, -0x130(%rbp)
movb $0x0, -0x128(%rbp)
jne 0xec18a
jp 0xec18a
cvttss2si %xmm1, %rdx
movq %r13, %rdi
leaq 0x338de(%rip), %rsi     # 0x11fa5f
xorl %eax, %eax
callq 0x9060
jmp 0xec200
cvtss2sd %xmm1, %xmm0
movss 0x1c812(%rip), %xmm2    # 0x1089a8
ucomiss %xmm1, %xmm2
jbe 0xec1a7
movq %r13, %rdi
leaq 0x338b4(%rip), %rsi     # 0x11fa59
jmp 0xec1f9
movss 0x1c849(%rip), %xmm2    # 0x1089f8
ucomiss %xmm1, %xmm2
jbe 0xec1c0
movq %r13, %rdi
leaq 0x3166e(%rip), %rsi     # 0x11d82c
jmp 0xec1f9
movss 0x2a63c(%rip), %xmm2    # 0x116804
ucomiss %xmm1, %xmm2
jbe 0xec1d9
movq %r13, %rdi
leaq 0x24f62(%rip), %rsi     # 0x111139
jmp 0xec1f9
movss 0x1c7e3(%rip), %xmm2    # 0x1089c4
movq %r13, %rdi
ucomiss %xmm1, %xmm2
jbe 0xec1f2
leaq 0x24f42(%rip), %rsi     # 0x111132
jmp 0xec1f9
leaq 0x24f32(%rip), %rsi     # 0x11112b
movb $0x1, %al
callq 0x9060
movq %r13, %rdx
leaq (%r14,%rbx), %r13
incq %r13
movq -0x40(%rbp), %rax
cvtss2sd 0x190(%rax,%rbx,4), %xmm0
movq (%r12,%rbx,8), %rcx
leaq 0x239ffe(%rip), %r14    # 0x326220
movq %r14, %rdi
leaq 0x33838(%rip), %rsi     # 0x11fa64
movq %rdx, %r12
movb $0x1, %al
callq 0x9060
leaq 0x11658b(%rip), %rax    # 0x2027c8
movl (%rax), %esi
movl %r13d, %edi
movl -0x34(%rbp), %edx
movq %r14, %rcx
callq 0xe2d2
movq %r14, %rdi
callq 0x9120
leaq 0x13aa28(%rip), %rcx    # 0x226c84
movl %eax, (%rcx)
leaq 0x13aa27(%rip), %rdx    # 0x226c8c
cmpl %eax, (%rdx)
jge 0xec26d
incl %eax
movl %eax, (%rdx)
movl 0x648(%r15), %eax
incq %rbx
movq -0x30(%rbp), %rsi
leaq 0x116546(%rip), %rdi    # 0x2027c8
leaq 0x13aab5(%rip), %r8     # 0x226d3e
movq %r12, %r13
movq -0x70(%rbp), %r12
movq -0x48(%rbp), %r14
jmp 0xec079
leaq 0x116528(%rip), %r13    # 0x2027c8
movl %r12d, (%r13)
leaq 0x239f75(%rip), %rdi    # 0x326220
leaq 0x33737(%rip), %rsi     # 0x11f9e9
leaq -0xb0(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %r9
xorl %eax, %eax
callq 0x9060
movl (%r13), %esi
leaq 0x116535(%rip), %rax    # 0x202808
movslq (%rax), %rcx
leaq 0x13a9af(%rip), %rax    # 0x226c8c
movslq (%rax), %rax
subq %rax, %rcx
addq 0x4dc8e(%rip), %rcx     # 0x139f78
movq -0x30(%rbp), %r12
movl %r12d, %edi
movl -0x34(%rbp), %r13d
movl %r13d, %edx
callq 0xe2d2
leaq 0x1164c4(%rip), %rax    # 0x2027c8
movl (%rax), %esi
movl %r12d, %edi
movl %r13d, %edx
leaq 0x239f0d(%rip), %r12    # 0x326220
movq %r12, %rcx
callq 0xe2d2
movq %r12, %rdi
callq 0x9120
leaq 0x13a95a(%rip), %rcx    # 0x226c84
movl %eax, (%rcx)
movl 0x648(%r15), %eax
leaq 0x13a956(%rip), %rcx    # 0x226c90
cmpl (%rcx), %eax
jle 0xec340
movl %eax, (%rcx)
leaq 0x13a939(%rip), %rcx    # 0x226c80
movslq (%rcx), %rcx
cvttpd2dq -0x60(%rbp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
leaq 0x328(%r15,%rcx,8), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, -0x80(%rbp)
leaq (%r15,%rcx,4), %r13
addq $0x194, %r13            # imm = 0x194
xorl %r12d, %r12d
movq -0x30(%rbp), %rsi
leaq 0x116448(%rip), %rdi    # 0x2027c8
leaq 0x13a9b7(%rip), %r8     # 0x226d3e
movq %r13, -0x88(%rbp)
movq -0x80(%rbp), %rcx
addq %r12, %rcx
cltq
cmpq %rax, %rcx
jge 0xec62e
leaq (%r14,%r12), %rax
cmpb $0x0, (%r8)
je 0xec3c7
movl (%rdi), %ecx
leaq 0x1163e9(%rip), %rdx    # 0x20279c
cmpl (%rdx), %ecx
jge 0xec3c7
leaq 0x1163ea(%rip), %rcx    # 0x2027a8
cmpl (%rcx), %eax
jl 0xec3d6
jmp 0xec621
leaq 0x1163da(%rip), %rcx    # 0x2027a8
cmpl (%rcx), %eax
jg 0xec621
leaq 0x13a8af(%rip), %rax    # 0x226c8c
movl (%rax), %edx
cmpl $0x6, %edx
jl 0xec429
leaq 0x1163dd(%rip), %rax    # 0x2027c8
movl (%rax), %edi
leaq 0x11641c(%rip), %rax    # 0x202810
movl (%rax), %eax
addl $0x2, %edi
imull %eax, %edi
leaq 0x116411(%rip), %rcx    # 0x202814
movl (%rcx), %ecx
leal (%r14,%r12), %esi
addl $0x2, %esi
imull %ecx, %esi
imull %eax, %edx
callq 0xd0da
leaq 0x13a920(%rip), %r8     # 0x226d3e
leaq 0x1163a3(%rip), %rdi    # 0x2027c8
movq -0x30(%rbp), %rsi
leal 0x1(%r12), %eax
leaq 0x11638b(%rip), %rcx    # 0x2027c0
cmpl (%rcx), %eax
jge 0xec621
leaq 0x1211cc(%rip), %rax    # 0x20d610
cmpl $0x9, (%rax)
movq -0x40(%rbp), %rax
movq (%rax,%r12,8), %rax
jne 0xec45b
testq %rax, %rax
jns 0xec464
jmp 0xec621
testq %rax, %rax
jle 0xec621
movapd -0x60(%rbp), %xmm0
ucomisd -0x70(%rbp), %xmm0
movss -0x190(%r13,%r12,4), %xmm2
movl $0x3f3f3f, -0x12d(%rbp) # imm = 0x3F3F3F
movl $0x3f3f3f3f, -0x130(%rbp) # imm = 0x3F3F3F3F
movss %xmm2, -0x50(%rbp)
jne 0xec4b1
jp 0xec4b1
cvttss2si %xmm2, %rdx
leaq -0x130(%rbp), %rdi
leaq 0x3355d(%rip), %rsi     # 0x11fa05
xorl %eax, %eax
callq 0x9060
jmp 0xec51a
cvtss2sd %xmm2, %xmm0
movss 0xac33(%rip), %xmm1     # 0xf70f0
ucomiss %xmm2, %xmm1
jbe 0xec4d2
leaq -0x130(%rbp), %rdi
leaq 0x25993(%rip), %rsi     # 0x111e63
jmp 0xec513
movss 0x1c4ce(%rip), %xmm1    # 0x1089a8
ucomiss %xmm2, %xmm1
jbe 0xec4ef
leaq -0x130(%rbp), %rdi
leaq 0x2598b(%rip), %rsi     # 0x111e78
jmp 0xec513
movss 0x1c501(%rip), %xmm1    # 0x1089f8
leaq -0x130(%rbp), %rdi
ucomiss %xmm2, %xmm1
jbe 0xec50c
leaq 0x334ef(%rip), %rsi     # 0x11f9f9
jmp 0xec513
leaq 0x334ec(%rip), %rsi     # 0x11f9ff
movb $0x1, %al
callq 0x9060
leaq 0x13a81d(%rip), %rax    # 0x226d3e
cmpb $0x0, (%rax)
leaq 0x1162d5(%rip), %rax    # 0x202800
leaq 0x239cee(%rip), %r14    # 0x326220
je 0xec587
cmpl $0x3e2, (%rax)          # imm = 0x3E2
jl 0xec587
cmpl $0x0, (%rbx)
jne 0xec587
movss -0x50(%rbp), %xmm0
ucomiss 0x1c477(%rip), %xmm0    # 0x1089c4
leaq 0x334c8(%rip), %rsi     # 0x11fa1c
jb 0xec55d
leaq 0x334ad(%rip), %rsi     # 0x11fa0a
cvtss2sd (%r13,%r12,4), %xmm0
movq -0x40(%rbp), %rax
movq (%rax,%r12,8), %rcx
movq %r14, %rdi
leaq -0x130(%rbp), %rdx
movb $0x1, %al
callq 0x9060
movq %r14, %rdi
callq 0x9120
jmp 0xec5b1
cvtss2sd (%r13,%r12,4), %xmm0
movq %r14, %rdi
leaq 0x33497(%rip), %rsi     # 0x11fa2f
leaq -0x130(%rbp), %rdx
movb $0x1, %al
callq 0x9060
movq %r14, %rdi
callq 0x9120
addl $0x6, %eax
movq -0x48(%rbp), %rcx
leaq (%rcx,%r12), %rdi
incq %rdi
leaq 0x13a6c1(%rip), %r13    # 0x226c84
movl %eax, (%r13)
leaq 0x1161fa(%rip), %rax    # 0x2027c8
movl (%rax), %esi
movl -0x34(%rbp), %edx
movq %r14, %rcx
callq 0xe2d2
movl (%r13), %eax
leaq 0x13a6a6(%rip), %rcx    # 0x226c8c
cmpl (%rcx), %eax
jle 0xec5f5
incl %eax
leaq 0x13a699(%rip), %rcx    # 0x226c8c
movl %eax, (%rcx)
movl 0x648(%r15), %eax
incq %r12
movq -0x30(%rbp), %rsi
leaq 0x1161be(%rip), %rdi    # 0x2027c8
leaq 0x13a72d(%rip), %r8     # 0x226d3e
movq -0x88(%rbp), %r13
movq -0x48(%rbp), %r14
jmp 0xec38e
addl %r12d, %esi
incl %esi
jmp 0xec635
addl %ebx, %esi
incl %esi
jmp 0xec635
addl %r12d, %esi
jmp 0xec635
addl %ebx, %esi
leaq 0x11617c(%rip), %rax    # 0x2027b8
movl (%rax), %eax
cmpb $0x0, (%r8)
je 0xec66a
movl (%rdi), %ecx
leaq 0x11614f(%rip), %rdi    # 0x20279c
leaq 0x116154(%rip), %rdx    # 0x2027a8
movl (%rdx), %edx
cmpl (%rdi), %ecx
jge 0xec675
cmpl %edx, %eax
cmovll %eax, %edx
movl %edx, %ecx
leaq 0x116160(%rip), %rdi    # 0x2027c8
jmp 0xec684
leaq 0x116137(%rip), %rcx    # 0x2027a8
movl (%rcx), %edx
jmp 0xec67c
leaq 0x11614c(%rip), %rdi    # 0x2027c8
leal 0x1(%rdx), %ecx
cmpl %edx, %eax
cmovlel %eax, %ecx
subl %esi, %ecx
testl %ecx, %ecx
jle 0xec6bd
movl (%rdi), %edi
leaq 0x11617d(%rip), %rax    # 0x202810
movl (%rax), %edx
addl $0x2, %edi
imull %edx, %edi
leaq 0x116172(%rip), %rax    # 0x202814
movl (%rax), %eax
addl $0x2, %esi
imull %eax, %esi
leaq 0x13a5db(%rip), %r8     # 0x226c8c
imull (%r8), %edx
imull %eax, %ecx
callq 0xd0da
leaq 0x118d65(%rip), %rax    # 0x205429
movb $0x0, (%rax)
pushq $0x1
popq %rax
movl %eax, %r14d
movl %r14d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %edx, %edx
leaq 0x332f6(%rip), %rdx     # 0x11f9e1
leaq 0x1b84d(%rip), %rax     # 0x107f3f
cmoveq %rax, %rdx
testb %cl, %cl
jne 0xebe2c
movq %r10, -0x48(%rbp)
callq 0x66b41
movq -0x48(%rbp), %r10
movq %r14, %r9
leaq 0x1b82a(%rip), %rdx     # 0x107f3f
testl %eax, %eax
jne 0xebe2c
movl $0xe8, %eax
addq 0x4d7ef(%rip), %rax     # 0x139f18
movq (%rax), %rdx
jmp 0xebe2c