// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: show_satinfo()
void show_satinfo()
{
COORD row, col;
u08 time_exit;
u08 info_under_azel;
int prn;
int col2;
int top_row;
int track_count;
int rows_avail;
int msd;
int max_sat_show;
int col_switch;

   // This routine draws the satellite info table.  It also calls the
   // digital clock display routine (since on small screens the digital clock
   // takes the place of the sat info display).  It also controls the alarm
   // clock operation.

   last_sat_row = SAT_ROW+3;
   msd = max_sat_display;
   max_sat_show = max_sats;
   sun_moon_shown = 0;


   track_count = 0;
   for(prn=1; prn<=MAX_PRN; prn++) {  // count actively tracked satellites
      if(sat[prn].level_msg) ++track_count;
   }

   if(text_mode && first_key) {
      find_sat_changes();
      return;
   }
   
   time_exit = 0;
   print_using = 0;

   if(all_adevs && (zoom_screen != 'I')) {   // screen is showing all the adev tables
      if(text_mode) {
         col = 0;
         row = TEXT_ROWS - 8;
      }
      else {
         if(SCREEN_WIDTH >= WIDE_WIDTH) col = CRIT_COL + 19;
         else                           col = CRIT_COL + 12;
         row = 0;
      }
   }
   else {    // normal screen mode
      col = SAT_COL;
      row = SAT_ROW+eofs;
      if(text_mode) ++row;
      else if((TEXT_HEIGHT <= 14) || (SCREEN_HEIGHT >= MEDIUM_HEIGHT)) ++row;
   }

   if(sound_alarm) {
      if(ticker & 0x01)      time_color = ALARM_COLOR;
      else if(dst_ofs)       time_color = DST_TIME_COLOR;
      else if(time_zone_set) time_color = DST_TIME_COLOR;  // !!! std_time_color is rather dim for the big clock
      else                   time_color = WHITE;
   }

   // if sats are not in use show the osc control info
// if(osc_params || (osc_discipline == 0)) {  
   show_short_info = user_set_short;
   if(zoom_screen == 'I') ;
   else if(osc_params && (all_adevs == SINGLE_ADEVS) && (zoom_screen == 0)) {
      show_osc_params(row, col);
      if(rcvr_type == LPFRS_RCVR) goto no_sat_tables;
      if(rcvr_type == PRS_RCVR) goto no_sat_tables;
      if(rcvr_type == SA35_RCVR) goto no_sat_tables;
      if(rcvr_type == SRO_RCVR) goto no_sat_tables;
      if(rcvr_type == RFTG_RCVR) goto no_sat_tables;
      if(rcvr_type == X72_RCVR) goto no_sat_tables;
      find_sat_changes();
      return;
   }
   else if((rcvr_type == RFTG_RCVR) && (zoom_screen == 'C') && osc_params) ; 
//   else if((rcvr_type == RFTG_RCVR) && (zoom_screen == 'I') && osc_params) ; 
   else if(osc_params) {
     if((rcvr_type == LPFRS_RCVR) || (rcvr_type == PRS_RCVR) || (rcvr_type == SA35_RCVR) || (rcvr_type == SRO_RCVR) || (rcvr_type == RFTG_RCVR) || (rcvr_type == X72_RCVR)) {
        if(zoom_screen == 0) show_osc_params(row,col);
        goto no_sat_tables;
     }
     else show_osc_params(row, col);
     find_sat_changes();
     return;
   }

   info_under_azel = 0;
   if(SHARED_AZEL && (AZEL_BOTTOM+(TEXT_HEIGHT*(8+1)) < SCREEN_HEIGHT)) {  
      if(SCREEN_HEIGHT <= MEDIUM_HEIGHT) {
         info_under_azel = 1;
      }
      else if(plot_watch && plot_digital_clock && ebolt) info_under_azel = 1;
      else if(all_adevs) info_under_azel = 1;
   }

   digital_clock_shown = 0;
   #ifdef DIGITAL_CLOCK
      if(zoom_screen == 'I') ;
//    else if(((plot_digital_clock || all_adevs) && ((all_adevs == SINGLE_ADEVS) || (SCREEN_WIDTH > NARROW_SCREEN))) || (zoom_screen == 'C')) {
      else if((plot_digital_clock && ((all_adevs == SINGLE_ADEVS) || (SCREEN_WIDTH > NARROW_SCREEN))) || (zoom_screen == 'C')) {
         time_exit = show_digital_clock(row, col);
         if((time_exit == 0) && (all_adevs == SINGLE_ADEVS)) info_under_azel = 0;

         // there is room to sneak in the sat info table below the az/el map
         if(info_under_azel) {  
            row = AZEL_BOTTOM/TEXT_HEIGHT;
            col = (AZEL_COL/TEXT_WIDTH) + 5; 
            if(ebolt) ;        
            else if(all_adevs) col -= 2;
         }
         else if(time_exit) { // no room on screen for sat info and digital clock
            if(star_sat_sec()) return;
            find_sat_changes();
            return;
         }
      }
   #endif  // DIGITAL_CLOCK

   if(star_sat_sec()) return;

   if(zoom_screen == 'I') {
      erase_screen();
      show_time_info();
      sun_moon_shown = 0;
      if((lat != 0.0) || (lon != 0.0)) {
         show_sun_moon(VAL_ROW-1,VAL_COL);
      }
      format_lla(lat,lon,alt, VAL_ROW,VAL_COL+22, 1);
      row = 10;
   }
   else if(zoom_screen) {
      find_sat_changes();
      return;
   }

   if(luxor) return;
   if(rcvr_type == ACRON_RCVR) {
      warn_info_needed();
   }
   else if(rcvr_type == NO_RCVR) {
      sun_moon_shown = 0;
      if((lat != 0.0) || (lon != 0.0)) {
         show_sun_moon(VAL_ROW-2,VAL_COL);
      }
      else if(rcvr_type != TICC_RCVR) {
         warn_info_needed();
      }
      if(rcvr_type == ACRON_RCVR) ;
      else return;
   }

   if(zoom_screen == 'I') ;
   else if(all_adevs) {  // if no room to show info,  just check for sat changes
      if(text_mode) {
         find_sat_changes();
         return;
      }

      if(first_key && (row >= PLOT_TEXT_ROW)) {
         find_sat_changes();
         return;
      }

      if((digital_clock_shown || ((row+max_sat_show+1) >= all_adev_row))) {
         if(info_under_azel && ((plot_lla == 0) || (all_adevs == SINGLE_ADEVS))) {  
            row = AZEL_BOTTOM/TEXT_HEIGHT;
            col = (AZEL_COL/TEXT_WIDTH) + 5; 
            if(ebolt) ;        
            else if(all_adevs) col -= 2;
         }
         else {
            find_sat_changes();
            return;
         }
      }
   }

   // draw the sat info table header
   if(max_sat_display == 0) return;

   msd = MOUSE_ROW - (SAT_ROW+1) - 1;
   if(plot_digital_clock) msd = clock_show_row - (SAT_ROW+1) - 3;
   if(sat_cols > 1) --msd;
   max_sat_show = msd;

   top_row = SAT_ROW+1;  //row;
   rows_avail = msd;

   if(zoom_screen == 'I') {  // see where to switch display columns
      col_switch = 0;
   }
   else {
      col_switch = rows_avail;
   }

   col2 = col+COL2;

//sprintf(plot_title, "sat cols:%d  rows:%d  max_sats:%d  msd:%d  tracked:%d  sw:%d  avail:%d top:%d mouse:%d", 
//sat_cols, sat_rows,max_sats,max_sat_display, track_count, col_switch,rows_avail,top_row,MOUSE_ROW);

   // build and show the sat info title string
   show_short_info = user_set_short;
   if(all_adevs) show_short_info = 1;
   if(sat_cols > 1) show_short_info = 2;
// else if(rcvr_type == FURUNO_RCVR) show_short_info = 0;
   if(zoom_screen == 'I') show_short_info = 0;

   if(show_info_header(row,col)) {
      goto no_sat_tables;
   }

   top_row = row;
   ++row;

   if(zoom_screen == 'I') {
      show_short_info = 0;
   }
   else if(info_header_col < 40) {   // we don't have much info to display
      show_short_info = 3;  // ... so allow max sig levels to show
   }

   // erase and draw the sat info display
   sort_sat_table();
   erase_sat_table(row,col, col_switch, col2, top_row, rows_avail);
   show_sat_table(row,col,  col_switch, col2, top_row, rows_avail);


   no_sat_tables:
   // all 0 az el values on tracked sats is what a STARLOC_TYPE does... BASTARDS!
   // more than 3 sats with all sats having az/el = 0,0

   find_sat_changes();

   print_using = 0;
   blank_underscore = 0;

#ifdef SIG_LEVELS
   sun_moon_shown = 0;
   if(zoom_screen == 'I') ;
   else if(zoom_screen == 'D') ;
   else if(zoom_screen == 'O') return;
   else if(zoom_screen == 'H') return;
   else if(show_short_info && (sat_cols <= 1)) {
      if(1 || digital_clock_shown) {
         show_sun_moon(DIS_ROW+0+eofs+4, DIS_COL);
      }
      else {
         show_max_signals();
      }
   }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x1e3f33(%rip), %rax    # 0x23ef1c
movl $0xd, (%rax)
leaq 0x1e3f22(%rip), %rax    # 0x23ef18
movl (%rax), %r10d
leaq 0x115c6c(%rip), %rax    # 0x170c6c
movl $0x0, (%rax)
leaq 0x1bd7cb(%rip), %r13    # 0x2187d8
movl (%r13), %eax
leaq 0x1e3f40(%rip), %rcx    # 0x23ef58
testl %eax, %eax
je 0x5b034
cmpl $0x0, (%rcx)
je 0x5b034
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5e480
leaq 0x1bd825(%rip), %rcx    # 0x218860
movq $0x0, (%rcx)
leaq 0x1e1cf5(%rip), %r11    # 0x23cd3e
movb (%r11), %sil
testb %sil, %sil
setne %dl
leaq 0x2b174f(%rip), %r9     # 0x30c7a8
movb (%r9), %cl
cmpb $0x49, %cl
setne %dil
andb %dl, %dil
cmpb $0x1, %dil
jne 0x5b07e
testl %eax, %eax
je 0x5b090
leaq 0x1bd795(%rip), %rax    # 0x21880c
movl (%rax), %ebx
addl $-0x8, %ebx
jmp 0x5b0e1
leaq 0x1e3ebb(%rip), %rdx    # 0x23ef40
movl (%rdx), %ebx
testl %eax, %eax
je 0x5b0ba
addl $0xb, %ebx
jmp 0x5b0e1
leaq 0x1bd769(%rip), %rax    # 0x218800
cmpl $0x4fa, (%rax)          # imm = 0x4FA
movl $0x13, %eax
movl $0xc, %r14d
cmovgel %eax, %r14d
leaq 0x1bd6e9(%rip), %rax    # 0x21879c
addl (%rax), %r14d
xorl %ebx, %ebx
jmp 0x5b0e4
leaq 0x1bd753(%rip), %rax    # 0x218814
cmpl $0xf, (%rax)
setl %al
leaq 0x1bd736(%rip), %rdx    # 0x218804
cmpl $0x2c6, (%rdx)          # imm = 0x2C6
setge %dl
orb %al, %dl
movzbl %dl, %eax
addl %eax, %ebx
addl $0xa, %ebx
xorl %r14d, %r14d
leaq 0x2b2e5d(%rip), %rax    # 0x30df48
cmpb $0x0, (%rax)
je 0x5b131
leaq 0x2b2de9(%rip), %rdx    # 0x30dee0
movl $0xc, %eax
testb $0x1, (%rdx)
jne 0x5b128
leaq 0x2b2798(%rip), %rdx    # 0x30d8a0
movl $0xb, %eax
cmpl $0x0, (%rdx)
jne 0x5b128
leaq 0x2b277b(%rip), %rax    # 0x30d894
xorl %edx, %edx
cmpb $0x0, (%rax)
sete %dl
leal 0xb(,%rdx,4), %eax
leaq 0x1c84a5(%rip), %rdx    # 0x2235d4
movl %eax, (%rdx)
leaq 0x1e3e70(%rip), %rax    # 0x23efa8
movl (%rax), %eax
movl %eax, 0x317554(%rip)    # 0x372694
cmpb $0x49, %cl
jne 0x5b25a
leaq 0x1c02c3(%rip), %rax    # 0x21b413
cmpb $0x0, (%rax)
je 0x5b1e6
leaq 0x2e0230(%rip), %rdx    # 0x33b390
leaq 0x2e0225(%rip), %rax    # 0x33b38c
movl (%rax), %eax
addl (%rdx), %eax
leaq 0x1bd70a(%rip), %rdx    # 0x21887c
cmpl (%rdx), %eax
jl 0x5b1e6
leaq 0x1bd697(%rip), %rdx    # 0x218814
movl (%rdx), %edi
leal (%rdi,%rax), %r8d
addl %edi, %eax
decl %eax
cltd
idivl %edi
leal (%rdi,%rdi,8), %eax
subl %edx, %eax
leal (%rax,%r8), %edx
decl %edx
leaq 0x1bd668(%rip), %rax    # 0x218804
movl (%rax), %eax
cmpl %eax, %edx
jge 0x5b1e6
movb $0x1, %r12b
cmpl $0x2c7, %eax            # imm = 0x2C7
jl 0x5b1e9
testb %sil, %sil
setne %al
leaq 0x1c024f(%rip), %rdx    # 0x21b408
cmpb $0x0, (%rdx)
setne %dl
leaq 0x1c021f(%rip), %rdi    # 0x21b3e5
cmpb $0x0, (%rdi)
setne %dil
andb %dl, %dil
leaq 0x1e3d4d(%rip), %rdx    # 0x23ef24
cmpl $0x0, (%rdx)
setne %r12b
andb %dil, %r12b
orb %al, %r12b
jmp 0x5b1e9
xorl %r12d, %r12d
movq %r10, -0x30(%rbp)
leaq 0x2b2ec7(%rip), %rax    # 0x30e0bb
movb $0x0, (%rax)
cmpb $0x49, %cl
je 0x5b3eb
leaq 0x1c01de(%rip), %rax    # 0x21b3e5
cmpb $0x0, (%rax)
je 0x5b357
testb %sil, %sil
je 0x5b360
cmpb $0x43, %cl
je 0x5b360
leaq 0x1bd5d7(%rip), %rax    # 0x218800
leaq 0x1c8314(%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, (%rax)
jle 0x5b3e4
jmp 0x5b360
leaq 0x2b1e8b(%rip), %rax    # 0x30d0ec
movb (%rax), %dl
testb %dl, %dl
setne %al
movl %ecx, %edi
orb %sil, %dil
sete %dil
andb %al, %dil
cmpb $0x1, %dil
jne 0x5b2c6
movq %r9, %r13
movl %ebx, %edi
movl %r14d, %esi
callq 0xaf8f3
leaq 0x1bd642(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x7ffffff, %rax        # imm = 0x7FFFFFF
jg 0x5b327
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5b7e4
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x5b7e4
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x5b7e4
jmp 0x5b021
leaq 0x1bd603(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x400000, %rax         # imm = 0x400000
setne %dil
cmpb $0x43, %cl
setne %r8b
testb %dl, %dl
je 0x5b149
orb %dil, %r8b
je 0x5b149
cmpq $0x7ffffff, %rax        # imm = 0x7FFFFFF
jg 0x5b56a
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5b589
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x5b589
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x5b589
jmp 0x5b5e9
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x5b7e4
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0x5b7e4
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
cmpq %rcx, %rax
je 0x5b7e4
jmp 0x5b021
cmpb $0x43, %cl
jne 0x5b3e4
movl %ebx, %edi
movl %r14d, %esi
movq %r11, %r15
callq 0xf05ba
movq %r15, %r11
movb (%r15), %cl
movl %eax, %edx
orb %cl, %dl
sete %dl
testb %r12b, %r12b
je 0x5b511
testb %dl, %dl
jne 0x5b511
leaq 0x2dfffe(%rip), %rax    # 0x33b390
movl (%rax), %eax
leaq 0x2dfff1(%rip), %rdx    # 0x33b38c
leaq 0x1bd472(%rip), %rsi    # 0x218814
movl (%rsi), %esi
addl (%rdx), %eax
addl %esi, %eax
decl %eax
cltd
idivl %esi
movl %eax, %ebx
leaq 0x2dffde(%rip), %rax    # 0x33b394
movl (%rax), %eax
leaq 0x1bd451(%rip), %rsi    # 0x218810
cltd
idivl (%rsi)
leaq 0x1e3b5b(%rip), %rdx    # 0x23ef24
cmpl $0x0, (%rdx)
setne %dl
testb %cl, %cl
sete %cl
orb %dl, %cl
movzbl %cl, %ecx
leal (%rax,%rcx,2), %r14d
addl $0x3, %r14d
movb $0x1, %r12b
leaq 0x2b13bd(%rip), %r9     # 0x30c7a8
leaq 0x1bd4de(%rip), %r15    # 0x2188d0
cmpq $0x1000, (%r15)         # imm = 0x1000
jne 0x5b42c
leaq 0x1bfbfa(%rip), %rax    # 0x21affc
cmpl $0x0, (%rax)
je 0x5b417
leaq 0x1bfbea(%rip), %rax    # 0x21aff8
cmpl $0x0, (%rax)
jne 0x5b825
leaq 0x2b20e2(%rip), %rax    # 0x30d500
movl (%rax), %eax
andl $-0x2, %eax
cmpl $0x20, %eax
je 0x5b825
movzbl (%r9), %eax
testl %eax, %eax
je 0x5b4cf
cmpl $0x49, %eax
jne 0x5b021
callq 0xeceb
callq 0x5bef0
leaq 0x11581a(%rip), %rax    # 0x170c6c
movl $0x0, (%rax)
leaq 0x2b1b71(%rip), %rbx    # 0x30cfd0
movsd (%rbx), %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
leaq 0x2b1b66(%rip), %rax    # 0x30cfd8
jne 0x5b482
jp 0x5b482
movsd (%rax), %xmm1
ucomisd %xmm2, %xmm1
jne 0x5b482
jnp 0x5b4a0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xf, %esi
callq 0xae936
movsd (%rbx), %xmm0
leaq 0x2b1b3c(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
leaq 0x2b1b39(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm2
xorl %edi, %edi
movl $0x25, %esi
movl $0x1, %edx
callq 0xb27ba
movl $0xa, %ebx
leaq 0x2b12e0(%rip), %r9     # 0x30c7a8
leaq 0x1e186f(%rip), %r11    # 0x23cd3e
leaq 0x1e3a68(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x5b825
movq (%r15), %rax
cmpq $0x400, %rax            # imm = 0x400
je 0x5b5ab
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x5b622
movq %r11, %r15
callq 0xb0da5
movq %r15, %r11
leaq 0x2b129c(%rip), %r9     # 0x30c7a8
jmp 0x5b622
testb %al, %al
leaq 0x2b128e(%rip), %r9     # 0x30c7a8
je 0x5b5a3
leaq 0x1bd3a9(%rip), %rax    # 0x2188d0
cmpq $0x1000, (%rax)         # imm = 0x1000
jne 0x5b021
leaq 0x1bfac1(%rip), %rax    # 0x21affc
cmpl $0x0, (%rax)
je 0x5b550
leaq 0x1bfab1(%rip), %rax    # 0x21aff8
cmpl $0x0, (%rax)
jne 0x5b825
leaq 0x2b1fa9(%rip), %rax    # 0x30d500
movl (%rax), %eax
andl $-0x2, %eax
cmpl $0x20, %eax
jne 0x5b021
jmp 0x5b825
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x5b589
movabsq $0x1000000000, %rdx     # imm = 0x1000000000
cmpq %rdx, %rax
je 0x5b589
cmpq $0x10000000, %rax       # imm = 0x10000000
jne 0x5b5e9
movq %r9, %r13
testb %cl, %cl
jne 0x5b7e4
movl %ebx, %edi
movl %r14d, %esi
callq 0xaf8f3
jmp 0x5b7e4
xorl %r12d, %r12d
jmp 0x5b3eb
leaq 0x1156ba(%rip), %rax    # 0x170c6c
movl $0x0, (%rax)
leaq 0x2b1a11(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x5b5f8
jp 0x5b5f8
leaq 0x2b1a02(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5b5f8
jp 0x5b5f8
callq 0xb0da5
jmp 0x5b607
movl %ebx, %edi
movl %r14d, %esi
callq 0xaf8f3
jmp 0x5b021
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movl $0xf, %esi
callq 0xae936
cmpq $0x4000, (%r15)         # imm = 0x4000
leaq 0x2b1193(%rip), %r9     # 0x30c7a8
leaq 0x1e1722(%rip), %r11    # 0x23cd3e
jne 0x5b825
movb (%r9), %cl
cmpb $0x49, %cl
setne %al
movb (%r11), %sil
testb %sil, %sil
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x5b6ec
cmpl $0x0, (%r13)
jne 0x5b021
leaq 0x1e3907(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
je 0x5b665
leaq 0x1bd233(%rip), %rax    # 0x218890
cmpl (%rax), %ebx
jge 0x5b021
leaq 0x2b2a4f(%rip), %rax    # 0x30e0bb
cmpb $0x0, (%rax)
jne 0x5b684
movq -0x30(%rbp), %rax
addl %ebx, %eax
incl %eax
leaq 0x1bd134(%rip), %rdx    # 0x2187b4
cmpl (%rdx), %eax
jl 0x5b6ec
testb %r12b, %r12b
je 0x5b021
leaq 0x2dfc1c(%rip), %rax    # 0x33b2b0
cmpb $0x0, (%rax)
jne 0x5b021
leaq 0x2dfcec(%rip), %rax    # 0x33b390
movl (%rax), %eax
leaq 0x2dfcdf(%rip), %rdx    # 0x33b38c
leaq 0x1bd160(%rip), %rdi    # 0x218814
movl (%rdi), %edi
addl (%rdx), %eax
addl %edi, %eax
decl %eax
cltd
idivl %edi
movl %eax, %ebx
leaq 0x2dfccc(%rip), %rax    # 0x33b394
movl (%rax), %eax
leaq 0x1bd13f(%rip), %rdi    # 0x218810
cltd
idivl (%rdi)
leaq 0x1e3849(%rip), %rdx    # 0x23ef24
xorl %edi, %edi
cmpl $0x0, (%rdx)
setne %dil
leal (%rax,%rdi,2), %r14d
addl $0x3, %r14d
leaq 0x1e38b1(%rip), %rax    # 0x23efa4
cmpl $0x0, (%rax)
je 0x5b825
movq %r9, %r13
leaq 0x1bd0a2(%rip), %rax    # 0x2187a8
movl (%rax), %eax
addl $-0xc, %eax
leaq 0x1bfcd3(%rip), %rdx    # 0x21b3e5
leaq 0x1bfccf(%rip), %rdi    # 0x21b3e8
movl (%rdi), %r12d
addl $-0xe, %r12d
cmpb $0x0, (%rdx)
cmovel %eax, %r12d
leaq 0x2b1056(%rip), %rax    # 0x30c784
movl (%rax), %edx
movl $0x1, %eax
testb %sil, %sil
jne 0x5b743
leaq 0x1e3867(%rip), %rax    # 0x23efa8
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %edx
setge %sil
movl $0x2, %edx
cmovll %eax, %edx
subl %esi, %r12d
xorl %eax, %eax
cmpb $0x49, %cl
movl %r12d, %r15d
cmovel %eax, %r15d
cmovel %eax, %edx
movl %edx, 0x316f28(%rip)    # 0x372694
movl %ebx, %edi
movl %r14d, %esi
callq 0xb10e4
testl %eax, %eax
jne 0x5b7e4
movl %r15d, -0x38(%rbp)
leal 0x1e(%r14), %eax
movl %eax, -0x30(%rbp)
leal 0x1(%rbx), %r15d
cmpb $0x49, (%r13)
movl $0x0, %eax
je 0x5b7a3
movl $0x3, %eax
cmpl $0x27, 0x316ef7(%rip)   # 0x372698
jg 0x5b7a9
movl %eax, 0x316eeb(%rip)    # 0x372694
callq 0xb0eb9
movl %r15d, -0x34(%rbp)
movl %r15d, %edi
movl %r14d, %esi
movl -0x38(%rbp), %r15d
movl %r15d, %edx
movl -0x30(%rbp), %ecx
movl %ebx, %r8d
movl %r12d, %r9d
callq 0xb17d6
movl -0x34(%rbp), %edi
movl %r14d, %esi
movl %r15d, %edx
movl -0x30(%rbp), %ecx
movl %ebx, %r8d
movl %r12d, %r9d
callq 0xb1cc0
callq 0x5e480
leaq 0x1bd070(%rip), %rax    # 0x218860
movq $0x0, (%rax)
leaq 0x1bfc2b(%rip), %rax    # 0x21b429
movb $0x0, (%rax)
leaq 0x115464(%rip), %rax    # 0x170c6c
movl $0x0, (%rax)
movzbl (%r13), %eax
addl $-0x44, %eax
cmpl $0xb, %eax
ja 0x5b834
movl $0x831, %ecx            # imm = 0x831
btl %eax, %ecx
jae 0x5b834
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x316e59(%rip)    # 0x372694
je 0x5b825
leaq 0x2b0f40(%rip), %rax    # 0x30c784
cmpl $0x1, (%rax)
jg 0x5b825
leaq 0x1e36f0(%rip), %rax    # 0x23ef40
movl (%rax), %edi
addl $0xa, %edi
movl $0x28, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xae936