// File: /workspace/github_cpp_makefile_star2_O1/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 0x1e3e6d(%rip), %rax    # 0x23ef1c
movl $0xd, (%rax)
leaq 0x1e3e5c(%rip), %rax    # 0x23ef18
movl (%rax), %r10d
leaq 0x115ba6(%rip), %r15    # 0x170c6c
movl $0x0, (%r15)
leaq 0x1bd704(%rip), %r13    # 0x2187d8
movl (%r13), %eax
leaq 0x1e3e79(%rip), %rcx    # 0x23ef58
testl %eax, %eax
je 0x5b0fb
cmpl $0x0, (%rcx)
je 0x5b0fb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5e501
leaq 0x1bd75e(%rip), %rcx    # 0x218860
movq $0x0, (%rcx)
leaq 0x1e1c2e(%rip), %r11    # 0x23cd3e
movb (%r11), %sil
testb %sil, %sil
setne %dl
leaq 0x2b1688(%rip), %r9     # 0x30c7a8
movb (%r9), %cl
cmpb $0x49, %cl
setne %dil
andb %dl, %dil
cmpb $0x1, %dil
jne 0x5b145
testl %eax, %eax
je 0x5b157
leaq 0x1bd6ce(%rip), %rax    # 0x21880c
movl (%rax), %ebx
addl $-0x8, %ebx
jmp 0x5b1a8
leaq 0x1e3df4(%rip), %rdx    # 0x23ef40
movl (%rdx), %ebx
testl %eax, %eax
je 0x5b181
addl $0xb, %ebx
jmp 0x5b1a8
leaq 0x1bd6a2(%rip), %rax    # 0x218800
cmpl $0x4fa, (%rax)          # imm = 0x4FA
movl $0x13, %eax
movl $0xc, %r14d
cmovgel %eax, %r14d
leaq 0x1bd622(%rip), %rax    # 0x21879c
addl (%rax), %r14d
xorl %ebx, %ebx
jmp 0x5b1ab
leaq 0x1bd68c(%rip), %rax    # 0x218814
cmpl $0xf, (%rax)
setl %al
leaq 0x1bd66f(%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 0x2b2d96(%rip), %rax    # 0x30df48
cmpb $0x0, (%rax)
je 0x5b1f8
leaq 0x2b2d22(%rip), %rdx    # 0x30dee0
movl $0xc, %eax
testb $0x1, (%rdx)
jne 0x5b1ef
leaq 0x2b26d1(%rip), %rdx    # 0x30d8a0
movl $0xb, %eax
cmpl $0x0, (%rdx)
jne 0x5b1ef
leaq 0x2b26b4(%rip), %rax    # 0x30d894
xorl %edx, %edx
cmpb $0x0, (%rax)
sete %dl
leal 0xb(,%rdx,4), %eax
leaq 0x1c83de(%rip), %rdx    # 0x2235d4
movl %eax, (%rdx)
leaq 0x1e3da9(%rip), %rax    # 0x23efa8
movl (%rax), %eax
movl %eax, 0x31748d(%rip)    # 0x372694
cmpb $0x49, %cl
jne 0x5b313
leaq 0x1c01fc(%rip), %rax    # 0x21b413
cmpb $0x0, (%rax)
je 0x5b2a0
leaq 0x2e0169(%rip), %rdx    # 0x33b390
leaq 0x2e015e(%rip), %rax    # 0x33b38c
movl (%rax), %eax
addl (%rdx), %eax
leaq 0x1bd643(%rip), %rdx    # 0x21887c
cmpl (%rdx), %eax
jl 0x5b2a0
leaq 0x1bd5d0(%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 0x1bd5a1(%rip), %rax    # 0x218804
movl (%rax), %eax
cmpl %eax, %edx
jge 0x5b2a0
movb $0x1, %dil
cmpl $0x2c7, %eax            # imm = 0x2C7
jl 0x5b2a2
leaq 0x1c018e(%rip), %rax    # 0x21b408
cmpb $0x0, (%rax)
je 0x5b297
leaq 0x1c015f(%rip), %rax    # 0x21b3e5
cmpb $0x0, (%rax)
je 0x5b297
leaq 0x1e3c92(%rip), %rax    # 0x23ef24
cmpl $0x0, (%rax)
jne 0x5b2a2
testb %sil, %sil
setne %dil
jmp 0x5b2a2
xorl %edi, %edi
movq %r10, -0x38(%rbp)
leaq 0x2b2e0e(%rip), %rax    # 0x30e0bb
movb $0x0, (%rax)
cmpb $0x49, %cl
je 0x5b4b5
leaq 0x1c0125(%rip), %rax    # 0x21b3e5
cmpb $0x0, (%rax)
je 0x5b416
testb %sil, %sil
je 0x5b41f
cmpb $0x43, %cl
je 0x5b41f
leaq 0x1bd51e(%rip), %rax    # 0x218800
leaq 0x1c825b(%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 0x5b4a7
jmp 0x5b41f
leaq 0x2b1dd2(%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 0x5b382
movq %r9, %r12
movq %r15, %r13
movl %ebx, %edi
movl %r14d, %esi
callq 0xaf600
leaq 0x1bd586(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x7ffffff, %rax        # imm = 0x7FFFFFF
jg 0x5b3e6
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5b8d0
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x5b8d0
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x5b8d0
jmp 0x5b0e8
leaq 0x1bd547(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x400000, %rax         # imm = 0x400000
setne %dil
cmpb $0x43, %cl
setne %r8b
testb %dl, %dl
je 0x5b210
orb %dil, %r8b
je 0x5b210
movq %r15, %r13
cmpq $0x7ffffff, %rax        # imm = 0x7FFFFFF
jg 0x5b645
cmpq $0x400000, %rax         # imm = 0x400000
je 0x5b664
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x5b664
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x5b664
jmp 0x5b6c8
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x5b8d0
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0x5b8d0
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
cmpq %rcx, %rax
je 0x5b8d0
jmp 0x5b0e8
cmpb $0x43, %cl
jne 0x5b4a7
movl %edi, %r13d
movl %ebx, %edi
movl %r14d, %esi
movq %r11, %r12
callq 0xefeef
movq %r12, %r11
movb (%r12), %cl
movl %eax, %edx
orb %cl, %dl
sete %dl
testb %r13b, %r13b
je 0x5b5e5
testb %dl, %dl
jne 0x5b5e5
leaq 0x2dff3b(%rip), %rax    # 0x33b390
movl (%rax), %eax
leaq 0x2dff2e(%rip), %rdx    # 0x33b38c
leaq 0x1bd3af(%rip), %rsi    # 0x218814
movl (%rsi), %esi
addl (%rdx), %eax
addl %esi, %eax
decl %eax
cltd
idivl %esi
movl %eax, %ebx
leaq 0x2dff1b(%rip), %rax    # 0x33b394
movl (%rax), %eax
leaq 0x1bd38e(%rip), %rsi    # 0x218810
cltd
idivl (%rsi)
leaq 0x1e3a98(%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, %dil
leaq 0x2b12fa(%rip), %r9     # 0x30c7a8
leaq 0x1bd323(%rip), %r13    # 0x2187d8
leaq 0x1bd414(%rip), %r12    # 0x2188d0
cmpq $0x1000, (%r12)         # imm = 0x1000
jne 0x5b4f7
leaq 0x1bfb2f(%rip), %rax    # 0x21affc
cmpl $0x0, (%rax)
je 0x5b4e2
leaq 0x1bfb1f(%rip), %rax    # 0x21aff8
cmpl $0x0, (%rax)
jne 0x5b90c
leaq 0x2b2017(%rip), %rax    # 0x30d500
movl (%rax), %eax
andl $-0x2, %eax
cmpl $0x20, %eax
je 0x5b90c
movzbl (%r9), %eax
testl %eax, %eax
je 0x5b59c
cmpl $0x49, %eax
jne 0x5b0e8
movl %edi, -0x2c(%rbp)
callq 0xed5e
callq 0x5c009
movl $0x0, (%r15)
leaq 0x2b1aa9(%rip), %rbx    # 0x30cfd0
movsd (%rbx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
leaq 0x2b1a9e(%rip), %r15    # 0x30cfd8
jne 0x5b54b
jp 0x5b54b
movsd (%r15), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5b54b
jnp 0x5b55a
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xf, %esi
callq 0xae682
movsd (%rbx), %xmm0
movsd (%r15), %xmm1
leaq 0x2b1a76(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm2
xorl %edi, %edi
movl $0x25, %esi
movl $0x1, %edx
callq 0xb24b9
movl $0xa, %ebx
leaq 0x1156e1(%rip), %r15    # 0x170c6c
leaq 0x2b1216(%rip), %r9     # 0x30c7a8
leaq 0x1e17a5(%rip), %r11    # 0x23cd3e
movl -0x2c(%rbp), %edi
leaq 0x1e399b(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0x5b90c
movq (%r12), %rax
cmpq $0x400, %rax            # imm = 0x400
je 0x5b685
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x5b708
movq %r11, %r12
movl %edi, -0x2c(%rbp)
callq 0xb0a9f
movl -0x2c(%rbp), %edi
movq %r12, %r11
leaq 0x2b11c8(%rip), %r9     # 0x30c7a8
jmp 0x5b708
testb %al, %al
leaq 0x2b11ba(%rip), %r9     # 0x30c7a8
leaq 0x1bd1e3(%rip), %r13    # 0x2187d8
je 0x5b67e
leaq 0x1bd2ce(%rip), %rax    # 0x2188d0
cmpq $0x1000, (%rax)         # imm = 0x1000
jne 0x5b0e8
leaq 0x1bf9e6(%rip), %rax    # 0x21affc
cmpl $0x0, (%rax)
je 0x5b62b
leaq 0x1bf9d6(%rip), %rax    # 0x21aff8
cmpl $0x0, (%rax)
jne 0x5b90c
leaq 0x2b1ece(%rip), %rax    # 0x30d500
movl (%rax), %eax
andl $-0x2, %eax
cmpl $0x20, %eax
jne 0x5b0e8
jmp 0x5b90c
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0x5b664
movabsq $0x1000000000, %rdx     # imm = 0x1000000000
cmpq %rdx, %rax
je 0x5b664
cmpq $0x10000000, %rax       # imm = 0x10000000
jne 0x5b6c8
movq %r9, %r12
testb %cl, %cl
jne 0x5b8d0
movl %ebx, %edi
movl %r14d, %esi
callq 0xaf600
jmp 0x5b8d0
xorl %edi, %edi
jmp 0x5b4b5
movl $0x0, (%r15)
leaq 0x2b193d(%rip), %rcx    # 0x30cfd0
movsd (%rcx), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x5b6d7
jp 0x5b6d7
leaq 0x2b192e(%rip), %rcx    # 0x30cfd8
movsd (%rcx), %xmm1
ucomisd %xmm0, %xmm1
jne 0x5b6d7
jp 0x5b6d7
cmpq $0x10000, %rax          # imm = 0x10000
je 0x5b6fa
movl %edi, -0x2c(%rbp)
callq 0xb0a9f
jmp 0x5b6e9
movl %ebx, %edi
movl %r14d, %esi
callq 0xaf600
jmp 0x5b0e8
movl %edi, -0x2c(%rbp)
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movl $0xf, %esi
callq 0xae682
movl -0x2c(%rbp), %edi
leaq 0x1e164b(%rip), %r11    # 0x23cd3e
leaq 0x2b10ae(%rip), %r9     # 0x30c7a8
cmpq $0x4000, (%r12)         # imm = 0x4000
jne 0x5b90c
movb (%r9), %cl
cmpb $0x49, %cl
setne %al
movb (%r11), %sil
testb %sil, %sil
setne %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x5b7d2
cmpl $0x0, (%r13)
jne 0x5b0e8
leaq 0x1e3821(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
je 0x5b74b
leaq 0x1bd14d(%rip), %rax    # 0x218890
cmpl (%rax), %ebx
jge 0x5b0e8
leaq 0x2b2969(%rip), %rax    # 0x30e0bb
cmpb $0x0, (%rax)
jne 0x5b76a
movq -0x38(%rbp), %rax
addl %ebx, %eax
incl %eax
leaq 0x1bd04e(%rip), %rdx    # 0x2187b4
cmpl (%rdx), %eax
jl 0x5b7d2
testb %dil, %dil
je 0x5b0e8
leaq 0x2dfb36(%rip), %rax    # 0x33b2b0
cmpb $0x0, (%rax)
jne 0x5b0e8
leaq 0x2dfc06(%rip), %rax    # 0x33b390
movl (%rax), %eax
leaq 0x2dfbf9(%rip), %rdx    # 0x33b38c
leaq 0x1bd07a(%rip), %rdi    # 0x218814
movl (%rdi), %edi
addl (%rdx), %eax
addl %edi, %eax
decl %eax
cltd
idivl %edi
movl %eax, %ebx
leaq 0x2dfbe6(%rip), %rax    # 0x33b394
movl (%rax), %eax
leaq 0x1bd059(%rip), %rdi    # 0x218810
cltd
idivl (%rdi)
leaq 0x1e3763(%rip), %rdx    # 0x23ef24
xorl %edi, %edi
cmpl $0x0, (%rdx)
setne %dil
leal (%rax,%rdi,2), %r14d
addl $0x3, %r14d
leaq 0x1e37cb(%rip), %rax    # 0x23efa4
cmpl $0x0, (%rax)
je 0x5b90c
movq %r9, %r12
movq %r15, %r13
leaq 0x1bcfb9(%rip), %rax    # 0x2187a8
movl (%rax), %eax
addl $-0xc, %eax
leaq 0x1bfbea(%rip), %rdx    # 0x21b3e5
leaq 0x1bfbe6(%rip), %rdi    # 0x21b3e8
movl (%rdi), %r15d
addl $-0xe, %r15d
cmpb $0x0, (%rdx)
cmovel %eax, %r15d
leaq 0x2b0f6d(%rip), %rax    # 0x30c784
movl (%rax), %edx
movl $0x1, %eax
testb %sil, %sil
jne 0x5b82c
leaq 0x1e377e(%rip), %rax    # 0x23efa8
movl (%rax), %eax
xorl %esi, %esi
cmpl $0x2, %edx
setge %sil
movl $0x2, %edx
cmovll %eax, %edx
subl %esi, %r15d
movl %r15d, -0x38(%rbp)
xorl %eax, %eax
cmpb $0x49, %cl
cmovel %eax, %r15d
cmovel %eax, %edx
movl %edx, 0x316e3e(%rip)    # 0x372694
movl %ebx, %edi
movl %r14d, %esi
callq 0xb0def
testl %eax, %eax
jne 0x5b8d0
movl %r15d, -0x40(%rbp)
leal 0x1e(%r14), %eax
movl %eax, -0x2c(%rbp)
leal 0x1(%rbx), %r15d
cmpb $0x49, (%r12)
movl $0x0, %eax
je 0x5b88d
movl $0x3, %eax
cmpl $0x27, 0x316e0d(%rip)   # 0x372698
jg 0x5b893
movl %eax, 0x316e01(%rip)    # 0x372694
callq 0xb0bb3
movl %r15d, -0x3c(%rbp)
movl %r15d, %edi
movl %r14d, %esi
movl -0x40(%rbp), %r15d
movl %r15d, %edx
movl -0x2c(%rbp), %ecx
movl %ebx, %r8d
movl -0x38(%rbp), %r9d
callq 0xb14de
movl -0x3c(%rbp), %edi
movl %r14d, %esi
movl %r15d, %edx
movl -0x2c(%rbp), %ecx
movl %ebx, %r8d
movl -0x38(%rbp), %r9d
callq 0xb19c8
callq 0x5e501
leaq 0x1bcf84(%rip), %rax    # 0x218860
movq $0x0, (%rax)
leaq 0x1bfb3f(%rip), %rax    # 0x21b429
movb $0x0, (%rax)
movl $0x0, (%r13)
movzbl (%r12), %eax
addl $-0x44, %eax
cmpl $0xb, %eax
ja 0x5b91b
movl $0x831, %ecx            # imm = 0x831
btl %eax, %ecx
jae 0x5b91b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x316d72(%rip)    # 0x372694
je 0x5b90c
leaq 0x2b0e59(%rip), %rax    # 0x30c784
cmpl $0x1, (%rax)
jg 0x5b90c
leaq 0x1e3609(%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 0xae682