// File: /workspace/github_cpp_makefile_star2_O3/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 0x116aa3(%rip), %rax    # 0x2187c8
movl %edx, (%rax)
leaq 0x116aaa(%rip), %rbx    # 0x2187d8
cmpl $0x0, (%rbx)
je 0x101d5f
leaq 0x13d21e(%rip), %rax    # 0x23ef58
xorl %r13d, %r13d
cmpl $0x0, (%rax)
jne 0x102a90
leaq 0x13aff1(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
je 0x102a90
leaq 0x20aa4b(%rip), %rax    # 0x30c7a8
jmp 0x101d69
leaq 0x20aa42(%rip), %rax    # 0x30c7a8
xorl %r13d, %r13d
cmpb $0x0, (%rax)
jne 0x102a90
xorl %r13d, %r13d
cmpl $0x0, 0x648(%r14)
jle 0x102a90
movq %rsi, -0x30(%rbp)
movl $0x1, %edi
callq 0xd8c0d
testl %eax, %eax
je 0x102a90
leaq 0x116a60(%rip), %rax    # 0x218800
movl (%rax), %esi
leaq 0x12179b(%rip), %rax    # 0x223544
imull $0x31a, (%rax), %eax    # imm = 0x31A
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
cmpl %eax, %esi
setl %al
leaq 0x13af6d(%rip), %rcx    # 0x23cd3e
movb (%rcx), %dl
testb %dl, %dl
sete %cl
testb %cl, %al
jne 0x102a90
leaq 0x20b305(%rip), %rax    # 0x30d0ec
cmpb $0x0, (%rax)
setne %al
leaq 0x116adc(%rip), %r9     # 0x2188d0
movq (%r9), %rcx
cmpq $0x10000, %rcx          # imm = 0x10000
sete %dil
testb %dil, %al
jne 0x102a90
movzbl (%r14), %eax
xorl %r13d, %r13d
cmpq $0x13, %rax
ja 0x101fbe
leaq 0x295a5(%rip), %rdi     # 0x12b3c8
movslq (%rdi,%rax,4), %r8
addq %rdi, %r8
jmpq *%r8
leaq 0x13ad54(%rip), %rdi    # 0x23cb88
leaq 0x13ad55(%rip), %r8     # 0x23cb90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13aebe(%rip), %rdi    # 0x23cd08
jmp 0x10207d
leaq 0x13add2(%rip), %rdi    # 0x23cc28
leaq 0x13add3(%rip), %r8     # 0x23cc30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13aeac(%rip), %rdi    # 0x23cd18
jmp 0x102035
movslq 0x3531d0(%rip), %r8     # 0x455048
leaq 0x13ae91(%rip), %rdi    # 0x23cd10
jmp 0x1020ba
leaq 0x13ad4d(%rip), %rdi    # 0x23cbd8
leaq 0x13ad4e(%rip), %r8     # 0x23cbe0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ae6f(%rip), %rdi    # 0x23cd10
jmp 0x102035
movslq 0x353007(%rip), %r8     # 0x454eb4
leaq 0x13ae54(%rip), %rdi    # 0x23cd08
jmp 0x1020ba
leaq 0x13ad18(%rip), %rdi    # 0x23cbd8
leaq 0x13ad19(%rip), %r8     # 0x23cbe0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ae3a(%rip), %rdi    # 0x23cd10
jmp 0x101fb2
movslq 0x352e3e(%rip), %r8     # 0x454d20
leaq 0x13ae17(%rip), %rdi    # 0x23cd00
jmp 0x1020ba
leaq 0x13ac93(%rip), %rdi    # 0x23cb88
leaq 0x13ac94(%rip), %r8     # 0x23cb90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13adfd(%rip), %rdi    # 0x23cd08
jmp 0x101fb2
leaq 0x13ad11(%rip), %rdi    # 0x23cc28
leaq 0x13ad12(%rip), %r8     # 0x23cc30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13adeb(%rip), %rdi    # 0x23cd18
jmp 0x10207d
leaq 0x13ac4f(%rip), %rdi    # 0x23cb88
leaq 0x13ac50(%rip), %r8     # 0x23cb90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13adb9(%rip), %rdi    # 0x23cd08
jmp 0x1020a3
leaq 0x13abdd(%rip), %rdi    # 0x23cb38
leaq 0x13abde(%rip), %r8     # 0x23cb40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ad8f(%rip), %rdi    # 0x23cd00
jmp 0x101fb2
leaq 0x13ac0e(%rip), %rdi    # 0x23cb88
leaq 0x13ac0f(%rip), %r8     # 0x23cb90
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ad78(%rip), %rdi    # 0x23cd08
jmp 0x102035
leaq 0x13ac8c(%rip), %rdi    # 0x23cc28
leaq 0x13ac8d(%rip), %r8     # 0x23cc30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ad66(%rip), %rdi    # 0x23cd18
leaq 0x33b0a(%rip), %r10     # 0x135ac3
jmp 0x1020c1
leaq 0x13ad33(%rip), %rdi    # 0x23ccf8
leaq 0x33b7c(%rip), %r10     # 0x135b48
xorl %r8d, %r8d
jmp 0x1020c1
leaq 0x13ab5d(%rip), %rdi    # 0x23cb38
leaq 0x13ab5e(%rip), %r8     # 0x23cb40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ad0f(%rip), %rdi    # 0x23cd00
jmp 0x10207d
leaq 0x13abdb(%rip), %rdi    # 0x23cbd8
leaq 0x13abdc(%rip), %r8     # 0x23cbe0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13acfd(%rip), %rdi    # 0x23cd10
jmp 0x1020a3
leaq 0x13ab19(%rip), %rdi    # 0x23cb38
leaq 0x13ab1a(%rip), %r8     # 0x23cb40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13accb(%rip), %rdi    # 0x23cd00
leaq 0x33a82(%rip), %r10     # 0x135abe
jmp 0x1020c1
leaq 0x13abe0(%rip), %rdi    # 0x23cc28
leaq 0x13abe1(%rip), %r8     # 0x23cc30
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13acba(%rip), %rdi    # 0x23cd18
jmp 0x1020a3
leaq 0x13ab71(%rip), %rdi    # 0x23cbd8
leaq 0x13ab72(%rip), %r8     # 0x23cbe0
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ac93(%rip), %rdi    # 0x23cd10
leaq 0x33a35(%rip), %r10     # 0x135ab9
jmp 0x1020c1
leaq 0x13aaab(%rip), %rdi    # 0x23cb38
leaq 0x13aaac(%rip), %r8     # 0x23cb40
cvttsd2si (%r8), %r8
addq (%rdi), %r8
leaq 0x13ac5d(%rip), %rdi    # 0x23cd00
leaq 0x1be72(%rip), %r10     # 0x11df1c
jmp 0x1020c1
movslq 0x353129(%rip), %r8     # 0x4551dc
leaq 0x13ac5e(%rip), %rdi    # 0x23cd18
leaq 0x33a07(%rip), %r10     # 0x135ac8
movsd (%rdi), %xmm1
xorpd %xmm0, %xmm0
movapd %xmm1, -0x60(%rbp)
ucomisd %xmm1, %xmm0
jae 0x102a90
testb %dl, %dl
sete %dil
cmpl $0x500, %esi            # imm = 0x500
setl %sil
andb %dil, %sil
cmpb $0x1, %sil
jne 0x1021e5
leaq 0x11930c(%rip), %rsi    # 0x21b408
cmpb $0x0, (%rsi)
je 0x102121
leaq 0x2392e0(%rip), %rsi    # 0x33b3e8
cmpb $0x0, (%rsi)
je 0x102a90
leaq 0x2392d4(%rip), %rsi    # 0x33b3ec
testb $0x1, (%rsi)
je 0x102a90
leaq 0x1192eb(%rip), %rsi    # 0x21b413
cmpb $0x0, (%rsi)
je 0x10214d
leaq 0x2392b4(%rip), %rsi    # 0x33b3e8
cmpb $0x0, (%rsi)
je 0x102a90
leaq 0x2392a8(%rip), %rsi    # 0x33b3ec
testb $0x2, (%rsi)
je 0x102a90
leaq 0x1192c1(%rip), %rsi    # 0x21b415
cmpb $0x0, (%rsi)
je 0x102179
leaq 0x239288(%rip), %rsi    # 0x33b3e8
cmpb $0x0, (%rsi)
je 0x102a90
leaq 0x23927c(%rip), %rsi    # 0x33b3ec
testb $0x4, (%rsi)
je 0x102a90
leaq 0x239130(%rip), %rsi    # 0x33b2b0
cmpb $0x0, (%rsi)
je 0x1021a5
leaq 0x23925c(%rip), %rsi    # 0x33b3e8
cmpb $0x0, (%rsi)
je 0x102a90
leaq 0x239250(%rip), %rsi    # 0x33b3ec
testb $0x8, (%rsi)
je 0x102a90
leaq 0x20bcec(%rip), %rsi    # 0x30de98
cmpb $0x0, (%rsi)
jne 0x102a90
leaq 0x239124(%rip), %rsi    # 0x33b2e0
cmpb $0x0, (%rsi)
jne 0x102a90
leaq 0x20bcce(%rip), %rsi    # 0x30de9a
cmpb $0x0, (%rsi)
jne 0x102a90
leaq 0x2390f8(%rip), %rsi    # 0x33b2d4
cmpb $0x0, (%rsi)
jne 0x102a90
movss 0x194(%r14), %xmm1
xorpd %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x10220d
jp 0x10220d
movss 0x198(%r14), %xmm1
ucomiss %xmm0, %xmm1
jne 0x10220d
jnp 0x102a90
xorl %esi, %esi
testb %dl, %dl
sete %sil
leaq 0x11658c(%rip), %rdx    # 0x2187a8
movl (%rdx), %edx
leal 0x1(%rdx,%rsi,2), %edx
leaq 0x11658f(%rip), %rsi    # 0x2187b8
movl %edx, (%rsi)
leal -0xf(%rax), %edx
cmpb $0x5, %dl
movq %r8, -0x38(%rbp)
jae 0x102240
leaq 0x1b032(%rip), %r13     # 0x11d270
jmp 0x102253
leal -0xa(%rax), %edx
cmpb $0x5, %dl
jae 0x102aa5
leaq 0xea63(%rip), %r13      # 0x110cb6
movb 0x4(%r10), %al
movb %al, -0xac(%rbp)
movl (%r10), %eax
movl %eax, -0xb0(%rbp)
cmpq $0x10000, (%r9)         # imm = 0x10000
je 0x102278
callq 0x702e7
testl %eax, %eax
je 0x102284
leaq 0x116689(%rip), %rax    # 0x218908
cmpl $0x4c, (%rax)
jne 0x102290
leaq -0xb0(%rbp), %rdi
callq 0x986c
leaq 0x119192(%rip), %rax    # 0x21b429
movb $0x1, (%rax)
leaq 0x13aa9d(%rip), %rax    # 0x23cd3e
movb (%rax), %al
testb %al, %al
leaq 0x116624(%rip), %rcx    # 0x2188d0
je 0x1022d8
cmpq $0x10000, (%rcx)        # imm = 0x10000
jne 0x1022d8
leaq 0x31890(%rip), %rcx     # 0x133b4e
movq -0x30(%rbp), %rdi
movl %r12d, %esi
movl $0xf, %edx
callq 0xe787
leaq 0x13aa68(%rip), %rax    # 0x23cd3e
movb (%rax), %al
leaq 0x119025(%rip), %rcx    # 0x21b304
cmpl $0x0, (%rcx)
movl $0x3a, %ecx
movl $0x12, %r8d
cmovel %ecx, %r8d
testb %al, %al
leaq 0x1164ce(%rip), %rdx    # 0x2187c8
leaq 0x1164ff(%rip), %rax    # 0x218800
jne 0x102652
cmpl $0x3e1, (%rax)          # imm = 0x3E1
jle 0x102652
leal 0x4(%r12), %eax
movl %eax, (%rdx)
leaq 0x239eff(%rip), %rdi    # 0x33c220
leaq 0x33805(%rip), %rsi     # 0x135b2d
leaq -0xb0(%rbp), %rcx
movq %r13, %rdx
movq -0x38(%rbp), %r9
xorl %eax, %eax
callq 0x9060
leaq 0x1164c4(%rip), %rax    # 0x218808
movslq (%rax), %rcx
leaq 0x13a93e(%rip), %r13    # 0x23cc8c
movslq (%r13), %rax
subq %rax, %rcx
addq 0x4dc1c(%rip), %rcx     # 0x14ff78
movzbl %r15b, %r15d
movq -0x30(%rbp), %rbx
movl %ebx, %edi
movl %r12d, %esi
movl %r15d, %edx
callq 0xe787
addl $0x7, %r12d
movl %ebx, %edi
movl %r12d, %esi
movl %r15d, -0x3c(%rbp)
movl %r15d, %edx
leaq 0x239e98(%rip), %rbx    # 0x33c220
movq %rbx, %rcx
callq 0xe787
movq %rbx, %rdi
callq 0x9120
leaq 0x13a8e5(%rip), %rcx    # 0x23cc84
movl %eax, (%rcx)
movl 0x648(%r14), %eax
leaq 0x13a8e1(%rip), %rcx    # 0x23cc90
cmpl (%rcx), %eax
jle 0x1023b5
movl %eax, (%rcx)
leaq 0x13a8c4(%rip), %rcx    # 0x23cc80
movslq (%rcx), %rcx
cmpl %eax, %ecx
leaq 0x13a976(%rip), %r8     # 0x23cd3e
jge 0x1029ed
cvttpd2dq -0x60(%rbp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
leaq (%r14,%rcx,4), %rax
addq $0x194, %rax            # imm = 0x194
movq %rax, -0x48(%rbp)
movq %rcx, -0x50(%rbp)
leaq 0x328(%r14,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rsi
movl %esi, %ebx
xorl %eax, %eax
leaq 0x1163c0(%rip), %rdi    # 0x2187c8
movq %rbx, -0x70(%rbp)
movq %rax, %r15
addq %rbx, %rax
cmpb $0x0, (%r8)
je 0x102435
movl (%rdi), %ecx
leaq 0x11637b(%rip), %rdx    # 0x21879c
cmpl (%rdx), %ecx
jge 0x102435
leaq 0x11637c(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jl 0x102444
jmp 0x102648
leaq 0x11636c(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jg 0x102648
movl (%r13), %edx
cmpl $0x6, %edx
jl 0x102492
leaq 0x116374(%rip), %rax    # 0x2187c8
movl (%rax), %edi
leaq 0x1163b3(%rip), %rax    # 0x218810
movl (%rax), %eax
addl $0x2, %edi
imull %eax, %edi
leaq 0x1163a8(%rip), %rcx    # 0x218814
movl (%rcx), %ecx
leal (%rbx,%r15), %esi
addl $0x2, %esi
imull %ecx, %esi
imull %eax, %edx
callq 0xd43d
leaq 0x13a8b7(%rip), %r8     # 0x23cd3e
leaq 0x11633a(%rip), %rdi    # 0x2187c8
movq -0x30(%rbp), %rsi
leal 0x1(%r15), %eax
leaq 0x116323(%rip), %rcx    # 0x2187c0
cmpl (%rcx), %eax
jge 0x102648
leaq 0x121164(%rip), %rax    # 0x223610
cmpl $0x9, (%rax)
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rax
jne 0x1024c3
testq %rax, %rax
jns 0x1024cc
jmp 0x102648
testq %rax, %rax
jle 0x102648
movapd -0x60(%rbp), %xmm0
ucomisd -0x80(%rbp), %xmm0
movq -0x48(%rbp), %rax
movss -0x190(%rax,%r15,4), %xmm1
movabsq $0x3f3f3f3f3f3f3f3f, %rax # imm = 0x3F3F3F3F3F3F3F3F
movq %rax, -0x130(%rbp)
movb $0x0, -0x128(%rbp)
jne 0x102522
jp 0x102522
cvttss2si %xmm1, %rdx
leaq -0x130(%rbp), %r12
movq %r12, %rdi
leaq 0x3363d(%rip), %rsi     # 0x135b53
xorl %eax, %eax
callq 0x9060
jmp 0x1025a2
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movss 0x1c4ff(%rip), %xmm2    # 0x11ea30
ucomiss %xmm1, %xmm2
leaq -0x130(%rbp), %r12
jbe 0x102549
movq %r12, %rdi
leaq 0x33606(%rip), %rsi     # 0x135b4d
jmp 0x10259b
movss 0x1c52f(%rip), %xmm2    # 0x11ea80
ucomiss %xmm1, %xmm2
jbe 0x102562
movq %r12, %rdi
leaq 0x313ac(%rip), %rsi     # 0x13390c
jmp 0x10259b
movss 0x2a37a(%rip), %xmm2    # 0x12c8e4
ucomiss %xmm1, %xmm2
jbe 0x10257b
movq %r12, %rdi
leaq 0x24c7b(%rip), %rsi     # 0x1271f4
jmp 0x10259b
movss 0x1c4c9(%rip), %xmm2    # 0x11ea4c
movq %r12, %rdi
ucomiss %xmm1, %xmm2
jbe 0x102594
leaq 0x24c5b(%rip), %rsi     # 0x1271ed
jmp 0x10259b
leaq 0x24c4b(%rip), %rsi     # 0x1271e6
movb $0x1, %al
callq 0x9060
leaq (%rbx,%r15), %r13
incq %r13
movq -0x48(%rbp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r15,4), %xmm0
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rcx
leaq 0x239c5b(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
leaq 0x33589(%rip), %rsi     # 0x135b58
movq %r12, %rdx
movb $0x1, %al
callq 0x9060
leaq 0x1161e8(%rip), %rax    # 0x2187c8
movl (%rax), %esi
movl %r13d, %edi
movl -0x3c(%rbp), %edx
movq %rbx, %rcx
callq 0xe787
movq %rbx, %rdi
callq 0x9120
leaq 0x13a685(%rip), %rcx    # 0x23cc84
movl %eax, (%rcx)
leaq 0x13a684(%rip), %r13    # 0x23cc8c
cmpl %eax, (%r13)
jge 0x102614
incl %eax
movl %eax, (%r13)
movslq 0x648(%r14), %rcx
leaq 0x1(%r15), %rax
movq -0x50(%rbp), %rdx
addq %r15, %rdx
incq %rdx
cmpq %rcx, %rdx
movq -0x30(%rbp), %rsi
leaq 0x116191(%rip), %rdi    # 0x2187c8
leaq 0x13a700(%rip), %r8     # 0x23cd3e
movq -0x70(%rbp), %rbx
jl 0x10240c
addl %r15d, %esi
incl %esi
jmp 0x1029f8
movl %r12d, (%rdx)
leaq 0x239bc4(%rip), %rdi    # 0x33c220
leaq 0x3347a(%rip), %rsi     # 0x135add
leaq -0xb0(%rbp), %rcx
movq %rdx, %r12
movq %r13, %rdx
movq -0x38(%rbp), %r9
xorl %eax, %eax
callq 0x9060
movl (%r12), %esi
leaq 0x116182(%rip), %rax    # 0x218808
movslq (%rax), %rcx
leaq 0x13a5fc(%rip), %rax    # 0x23cc8c
movslq (%rax), %rax
subq %rax, %rcx
addq 0x4d8db(%rip), %rcx     # 0x14ff78
movzbl %r15b, %r13d
movq -0x30(%rbp), %r15
movl %r15d, %edi
movl %r13d, %edx
callq 0xe787
movl (%r12), %esi
movl %r15d, %edi
movl %r13d, -0x50(%rbp)
movl %r13d, %edx
leaq 0x239b5b(%rip), %r15    # 0x33c220
movq %r15, %rcx
callq 0xe787
movq %r15, %rdi
callq 0x9120
leaq 0x13a5a8(%rip), %rcx    # 0x23cc84
movl %eax, (%rcx)
movl 0x648(%r14), %eax
leaq 0x13a5a4(%rip), %rcx    # 0x23cc90
cmpl (%rcx), %eax
jle 0x1026f2
movl %eax, (%rcx)
leaq 0x13a587(%rip), %rcx    # 0x23cc80
movslq (%rcx), %rcx
cmpl %eax, %ecx
leaq 0x13a639(%rip), %r8     # 0x23cd3e
jge 0x1029ed
cvttpd2dq -0x60(%rbp), %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
leaq (%r14,%rcx,4), %r15
addq $0x194, %r15            # imm = 0x194
leaq 0x328(%r14,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rsi
movl %esi, %eax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
leaq 0x116086(%rip), %rdi    # 0x2187c8
movq %rcx, -0x80(%rbp)
movq %r15, -0x88(%rbp)
movq %rax, %r13
movq -0x38(%rbp), %rax
addq %r13, %rax
cmpb $0x0, (%r8)
je 0x10277a
movl (%rdi), %ecx
leaq 0x116036(%rip), %rdx    # 0x21879c
cmpl (%rdx), %ecx
jge 0x10277a
leaq 0x116037(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jl 0x102789
jmp 0x1029e6
leaq 0x116027(%rip), %rcx    # 0x2187a8
cmpl (%rcx), %eax
jg 0x1029e6
leaq 0x13a4fc(%rip), %rax    # 0x23cc8c
movl (%rax), %edx
cmpl $0x6, %edx
jl 0x1027df
leaq 0x11602a(%rip), %rax    # 0x2187c8
movl (%rax), %edi
leaq 0x116069(%rip), %rax    # 0x218810
movl (%rax), %eax
addl $0x2, %edi
imull %eax, %edi
leaq 0x11605e(%rip), %rcx    # 0x218814
movl (%rcx), %ecx
movq -0x38(%rbp), %rsi
addl %r13d, %esi
addl $0x2, %esi
imull %ecx, %esi
imull %eax, %edx
callq 0xd43d
leaq 0x13a56a(%rip), %r8     # 0x23cd3e
leaq 0x115fed(%rip), %rdi    # 0x2187c8
movq -0x30(%rbp), %rsi
leal 0x1(%r13), %eax
leaq 0x115fd6(%rip), %rcx    # 0x2187c0
cmpl (%rcx), %eax
jge 0x1029e6
leaq 0x120e17(%rip), %rax    # 0x223610
cmpl $0x9, (%rax)
movq -0x48(%rbp), %rax
movq (%rax,%r13,8), %rax
jne 0x102810
testq %rax, %rax
jns 0x102819
jmp 0x1029e6
testq %rax, %rax
jle 0x1029e6
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, -0x3c(%rbp)
jne 0x102866
jp 0x102866
cvttss2si %xmm2, %rdx
leaq -0x130(%rbp), %rdi
leaq 0x3329c(%rip), %rsi     # 0x135af9
xorl %eax, %eax
callq 0x9060
jmp 0x1028d2
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
movss 0xa7fb(%rip), %xmm1     # 0x10d070
ucomiss %xmm2, %xmm1
jbe 0x10288a
leaq -0x130(%rbp), %rdi
leaq 0x25696(%rip), %rsi     # 0x127f1e
jmp 0x1028cb
movss 0x1c19e(%rip), %xmm1    # 0x11ea30
ucomiss %xmm2, %xmm1
jbe 0x1028a7
leaq -0x130(%rbp), %rdi
leaq 0x2568e(%rip), %rsi     # 0x127f33
jmp 0x1028cb
movss 0x1c1d1(%rip), %xmm1    # 0x11ea80
leaq -0x130(%rbp), %rdi
ucomiss %xmm2, %xmm1
jbe 0x1028c4
leaq 0x3322b(%rip), %rsi     # 0x135aed
jmp 0x1028cb
leaq 0x33228(%rip), %rsi     # 0x135af3
movb $0x1, %al
callq 0x9060
leaq 0x13a465(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
leaq 0x115f1d(%rip), %rax    # 0x218800
leaq 0x239936(%rip), %r12    # 0x33c220
je 0x102941
cmpl $0x3e2, (%rax)          # imm = 0x3E2
jl 0x102941
cmpl $0x0, (%rbx)
jne 0x102941
movss -0x3c(%rbp), %xmm0
ucomiss 0x1c147(%rip), %xmm0    # 0x11ea4c
leaq 0x33204(%rip), %rsi     # 0x135b10
jb 0x102915
leaq 0x331e9(%rip), %rsi     # 0x135afe
xorps %xmm0, %xmm0
cvtss2sd (%r15,%r13,4), %xmm0
movq -0x48(%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 0x10296d
xorps %xmm0, %xmm0
cvtss2sd (%r15,%r13,4), %xmm0
movq %r12, %rdi
leaq 0x331cf(%rip), %rsi     # 0x135b23
leaq -0x130(%rbp), %rdx
movb $0x1, %al
callq 0x9060
movq %r12, %rdi
callq 0x9120
addl $0x6, %eax
movq -0x38(%rbp), %rcx
leaq (%rcx,%r13), %rdi
incq %rdi
leaq 0x13a305(%rip), %r15    # 0x23cc84
movl %eax, (%r15)
leaq 0x115e3f(%rip), %rax    # 0x2187c8
movl (%rax), %esi
movl -0x50(%rbp), %edx
movq %r12, %rcx
callq 0xe787
movl (%r15), %eax
leaq 0x13a2ec(%rip), %rcx    # 0x23cc8c
cmpl (%rcx), %eax
jle 0x1029af
incl %eax
leaq 0x13a2df(%rip), %rcx    # 0x23cc8c
movl %eax, (%rcx)
movslq 0x648(%r14), %rcx
leaq 0x1(%r13), %rax
movq -0x80(%rbp), %rdx
addq %r13, %rdx
incq %rdx
cmpq %rcx, %rdx
movq -0x30(%rbp), %rsi
leaq 0x115df6(%rip), %rdi    # 0x2187c8
leaq 0x13a365(%rip), %r8     # 0x23cd3e
movq -0x88(%rbp), %r15
jl 0x10274d
addl %r13d, %esi
incl %esi
jmp 0x1029f8
movq -0x30(%rbp), %rsi
leaq 0x115dd0(%rip), %rdi    # 0x2187c8
leaq 0x115db9(%rip), %rax    # 0x2187b8
leaq 0x118a23(%rip), %rbx    # 0x21b429
movl (%rax), %eax
cmpb $0x0, (%r8)
je 0x102a34
movl (%rdi), %ecx
leaq 0x115d85(%rip), %rdi    # 0x21879c
leaq 0x115d8a(%rip), %rdx    # 0x2187a8
movl (%rdx), %edx
cmpl (%rdi), %ecx
jge 0x102a3f
cmpl %edx, %eax
cmovll %eax, %edx
movl %edx, %ecx
leaq 0x115d96(%rip), %rdi    # 0x2187c8
jmp 0x102a4e
leaq 0x115d6d(%rip), %rcx    # 0x2187a8
movl (%rcx), %edx
jmp 0x102a46
leaq 0x115d82(%rip), %rdi    # 0x2187c8
leal 0x1(%rdx), %ecx
cmpl %edx, %eax
cmovlel %eax, %ecx
subl %esi, %ecx
testl %ecx, %ecx
jle 0x102a87
movl (%rdi), %edi
leaq 0x115db3(%rip), %rax    # 0x218810
movl (%rax), %edx
addl $0x2, %edi
imull %edx, %edi
leaq 0x115da8(%rip), %rax    # 0x218814
movl (%rax), %eax
addl $0x2, %esi
imull %eax, %esi
leaq 0x13a211(%rip), %r8     # 0x23cc8c
imull (%r8), %edx
imull %eax, %ecx
callq 0xd43d
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
cmpq $0x10000, %rcx          # imm = 0x10000
sete %sil
addb $-0x5, %al
leaq 0x13a20b(%rip), %rcx    # 0x23ccc4
movl (%rcx), %edx
testl %edx, %edx
setne %cl
orb %sil, %cl
cmpb $0x4, %al
ja 0x102b0d
testl %edx, %edx
leaq 0x32ffd(%rip), %r13     # 0x135acd
leaq 0x1b3e2(%rip), %rax     # 0x11deb9
cmoveq %rax, %r13
testb %cl, %cl
jne 0x102253
movq %r10, %r13
callq 0x702e7
movq %r13, %r10
leaq 0x115ddb(%rip), %r9     # 0x2188d0
leaq 0x1b3bd(%rip), %r13     # 0x11deb9
testl %eax, %eax
jne 0x102253
leaq 0x5b225(%rip), %rax     # 0x15dd30
jmp 0x102b56
testl %edx, %edx
leaq 0x32fbf(%rip), %r13     # 0x135ad5
leaq 0x1b3a2(%rip), %rax     # 0x11debf
cmoveq %rax, %r13
testb %cl, %cl
jne 0x102253
movq %r10, %r13
callq 0x702e7
movq %r13, %r10
leaq 0x115d95(%rip), %r9     # 0x2188d0
leaq 0x1b37d(%rip), %r13     # 0x11debf
testl %eax, %eax
jne 0x102253
movl $0xe8, %eax
addq 0x4d3ba(%rip), %rax     # 0x14ff10
movq (%rax), %r13
jmp 0x102253