// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_pos()
void parse_star_pos()    
{
int dd,mm,yy;
int hrs,mins,secs;
int ff;
char s[2];
char dir[2];
static int last_sec = (-99);
static double last_jd = 0.0;
double xlat,xlon,xalt;
int bad_msg;
double this_jd;
double delta_jd;
static int fix_count = 0;
char *sss;

   // position and time info

   log_packet_id("Star posn/time");

   fake_msec = 0.0;
   saw_star_time = 1;
   restart_count = 0;

   bad_msg = 0;
   xlat = lat;
   xlon = lon;
   xalt = alt;

   dd = mm = hrs = mins = secs = 99;
   yy = 9999;

   if(star_type == OSA_TYPE) {
      sss = strstr(nmea_msg, "LAT:");
      if(sss) {
         sss += 4;
         zpad(sss, 7);
         sscanf(sss, "%3d%2d%2d", &hrs,&mins,&secs);
         if(mins < 0) bad_msg |= 0x01;
         if(mins >= 60) bad_msg |= 0x01;
         if(secs < 0) bad_msg |= 0x01;
         if(secs >= 60) bad_msg |= 0x01;
         if(hrs < 0) {
            mins = 0-mins;
            secs = 0-secs;
         }

         lat = (double) hrs + ((double) mins/60.0) + ((double) secs/3600.0);
         if(lat < -90.0) bad_msg |= 0x01;
         if(lat > 90.0) bad_msg |= 0x01;
         lat = lat * PI/180.0;
      }
      else return;

      sss = strstr(nmea_msg, "LON:");
      if(sss) {
         sss += 4;
         zpad(sss, 8);
         sscanf(sss, "%4d%2d%2d", &hrs,&mins,&secs);
         if(mins < 0) bad_msg |= 0x02;
         if(mins >= 60) bad_msg |= 0x02;
         if(secs < 0) bad_msg |= 0x02;
         if(secs >= 60) bad_msg |= 0x02;

         if(hrs < 0) {
            mins = 0-mins;
            secs = 0-secs;
         }

         lon = (double) hrs + ((double) mins/60.0) + ((double) secs/3600.0);
         if(lon < -180.0) bad_msg |= 0x02;
         if(lon > 180.0)  bad_msg |= 0x02;
         lon = lon * PI/180.0;
      }
      else return;

      sss = strstr(nmea_msg, "HEI:");
      if(sss) {
         sss += 4;
         zpad(sss, 8);
         alt = atof(sss) / 100.0;
         if(alt < -4000.0) bad_msg |= 0x04;  // message probaly corrupted
         if(alt > 40000.0) bad_msg |= 0x04;  // message probaly corrupted
      }
      else return;

      sss = strstr(nmea_msg, "DATE:");
      if(sss) {
         sss += 5;
         zpad(sss, 8);
         sscanf(sss, "%2d%2d%4d", &dd,&mm,&yy);
         if(dd <= 0) bad_msg |= 0x08;
         if(dd > 31) bad_msg |= 0x08;
         if(mm <= 0) bad_msg |= 0x08;
         if(mm > 12) bad_msg |= 0x08;
         if(yy < 1980) bad_msg |= 0x08;
      }
      else return;

      sss = strstr(nmea_msg, "TIME:");
      if(sss) {
         sss += 5;
         zpad(sss, 6);
         if(strlen(sss) != 6) bad_msg |= 0x20;
         sscanf(sss, "%2d%2d%2d", &hrs,&mins,&secs);
         if(hrs < 0) bad_msg |= 0x20;
         if(hrs > 24) bad_msg |= 0x20;
         if(mins < 0) bad_msg |= 0x20;
         if(mins > 60) bad_msg |= 0x20;
         if(secs < 0) bad_msg |= 0x20;
         if(secs > 60) bad_msg |= 0x20;
      }
      else return;


      if(bad_msg) {  // corrupted message, fake the correct date/time/etc
         lat = xlat; // alt value 50989 seen in corrupted message after data loss reset
         lon = xlon;   
         alt = xalt;   

         gregorian(0, jd_utc+jtime(0,0,1,0.0-rollover));
if(debug_file) fprintf(debug_file, "yymmdd:%04d/%02d/%02d  %02d:%02d:%02d\n", yy,mm,dd, hrs,mins,secs);
if(debug_file) fprintf(debug_file, "greg:  %04d/%02d/%02d  %02d:%02d:%02d\n", g_year,g_month,g_day, g_hours,g_minutes,g_seconds);
         yy = g_year;
         mm = g_month;
         dd = g_day;
         hrs = g_hours;
         mins = g_minutes;
         secs = g_seconds;
if(debug_file) fprintf(debug_file, "bad pos msg:%02X\n", bad_msg);
      }
   }
   else {
      if(get_msg_field()) {  // lat
         strupr(msg_field);
         sscanf(msg_field, "%d%c%d%c%d%c%c", &dd,&s[0],&mm,&s[0],&ff,&s[0],&dir[0]);
         lat = (double) dd;
         lat += ((double) mm)/60.0;
         lat += ((double) ff)/(60.0*10000.0);
         if(dir[0] == 'S') lat *= (-1.0);
         lat = lat * PI/180.0;
      }

      if(get_msg_field()) {  // lon
         strupr(msg_field);
         sscanf(msg_field, "%d%c%d%c%d%c%c", &dd,&s[0],&mm,&s[0],&ff,&s[0],&dir[0]);
         lon = (double) dd;
         lon += ((double) mm)/60.0;
         lon += ((double) ff)/(60.0*10000.0);
         if(dir[0] == 'W') lon *= (-1.0);
         lon = lon * PI/180.0;
      }

      if(get_msg_field()) {  // alt
         alt = atof(msg_field);
      }

      if(get_msg_field()) { // dd/mm/yyyy
         sscanf(msg_field, "%d%c%d%c%d", &dd,&s[0],&mm,&s[0],&yy);
      }
      else return;
      if(get_msg_field()) { // hrs/mins/secs
         sscanf(msg_field, "%d%c%d%c%d", &hrs,&s[0],&mins,&s[0],&secs);
      }
      else return;
   }

   if(((dd == 99) && (mm == 99) && ((yy == 99) || (yy == 9999))) || ((hrs == 99) && (mins == 99) && (secs == 99))) { // no date / time avail
      get_clock_time();     // substitute system clock

      yy = clk_year % 100;
      yy += 2000;
      mm = clk_month;
      dd = clk_day;

      hrs =  clk_hours;
      mins = clk_minutes;
      secs = clk_seconds;
   }

   // the Star 4 occasionally produces skipped time stamps, we try to fix
   // them, by backing this one up by a second
   this_jd = jdate(yy,mm,dd) + jtime(hrs,mins,secs, 0.0);
   delta_jd = this_jd - (last_jd + jtime(0,0,2, 0.0));
if(debug_file) fprintf(debug_file, "thisjd:%f  lastjd:%f  delta:%.12f (%f)\n", this_jd,last_jd, delta_jd, delta_jd*60.0*60.0*24.0);
   if(this_jd < last_jd) ; 
   else if(star_type == OSA_TYPE) ;
   else if(FIX_STAR_TIME && (secs != (SCPI_STATUS_SECOND+2)) && (fabs(delta_jd) <= 0.0000001)) {            // time stamp skip detected
      this_jd -= jtime(0,0,1, 0.0); // ... back this time up a second
      ++fix_count;

      gregorian(0, this_jd);
      yy = g_year;
      mm = g_month;
      dd = g_day;
      hrs = g_hours;
      mins = g_minutes;
      secs = g_seconds;
if(debug_file) fprintf(debug_file, "!! time stamp skip fixed! %02d:%02d:%02d\n", hrs,mins,secs);
   }

   last_jd = this_jd;

   if((star_type == NEC_TYPE) && (secs == last_sec)) {
      dup_star_time = 1;
   }
   else if(FIX_STAR_TIME || (last_sec != secs)) {
      last_sec = secs;

      pri_year = yy;
      pri_month = mm;
      pri_day = dd;
      pri_hours = hrs;
      pri_minutes = mins;
      pri_seconds = secs;
      pri_frac = 0.0;

      if(timing_mode == TMODE_GPS) {     // convert utc time to gps time
         utc_to_gps();
      }
      else {
         adjust_rcvr_time(0.0);  // incorporarte possibly negative fractional second into time variables
      }

      if((seconds == (SCPI_STATUS_SECOND+1)) && (last_misc_second == (SCPI_STATUS_SECOND+2))) {
         if(debug_file) fprintf(debug_file, "fake timestamp backsteped!!!\n");
      } 
      else if(seconds != last_misc_second) {
         update_gps_screen(1554);
      }

      if(pri_seconds == SCPI_STATUS_SECOND) {
         if(star_type == OSA_TYPE) { 
            queue_star_cmd("INFO_VIS_SAT;", STAR_VIS_MSG);     // !!! multi-line response
            queue_star_cmd("INFO_CHAN", STAR_TRACK_MSG);   // !!! multi-line response
         }
         else {
            queue_star_cmd("INFO_TRACK_SAT;", STAR_TRACK_MSG);   // !!! multi-line response
//          queue_star_cmd("INFO_GPS_POS;",   STAR_POS_MSG);
            queue_star_cmd("INFO_VIS_SAT;",   STAR_VIS_MSG);     // !!! multi-line response
//          queue_star_cmd("INFO_GPS_POS;",   STAR_POS_MSG);
         }
      }
      if(pri_seconds == (SCPI_STATUS_SECOND+0)) start_fake_seconds(6);
      if(pri_seconds == (SCPI_STATUS_SECOND+1)) start_fake_seconds(7);
      if(pri_seconds == (SCPI_STATUS_SECOND+2)) start_fake_seconds(8); 
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq 0xc11d4(%rip), %rdi     # 0x187486
callq 0x7add0
leaq 0x2a661a(%rip), %rax    # 0x36c8d8
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x1b3f08(%rip), %rax    # 0x27a1d4
movl $0x1, (%rax)
leaq 0x2cff13(%rip), %rax    # 0x3961ec
movl $0x0, (%rax)
movl $0x0, -0x3c(%rbp)
leaq 0x2a5ec3(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
leaq 0x2a5ebb(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x2a5eb3(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x63, -0x18(%rbp)
movl $0x63, -0x14(%rbp)
movl $0x63, -0x10(%rbp)
movl $0x63, -0x8(%rbp)
movl $0x63, -0x4(%rbp)
movl $0x270f, -0xc(%rbp)     # imm = 0x270F
leaq 0x1b3e81(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0xc69b7
leaq 0x2d46b9(%rip), %rdi    # 0x39aa10
leaq 0xc1137(%rip), %rsi     # 0x187495
callq 0x9090
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xc64a2
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl $0x7, %esi
callq 0xc4fb0
movq -0x58(%rbp), %rdi
leaq 0xc1103(%rip), %rsi     # 0x18749a
leaq -0x10(%rbp), %rdx
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
movb $0x0, %al
callq 0x9370
cmpl $0x0, -0x14(%rbp)
jge 0xc63b9
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3c, -0x14(%rbp)
jl 0xc63c8
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0xc63d7
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3c, -0x18(%rbp)
jl 0xc63e6
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0xc63fc
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
subl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cvtsi2sdl -0x10(%rbp), %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
movsd 0xa8c0a(%rip), %xmm2    # 0x16f018
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsi2sdl -0x18(%rbp), %xmm1
movsd 0xa8bed(%rip), %xmm2    # 0x16f010
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
leaq 0x2a5d7e(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
movsd 0xa8c42(%rip), %xmm0    # 0x16f080
leaq 0x2a5d6b(%rip), %rax    # 0x36c1b0
ucomisd (%rax), %xmm0
jbe 0xc6454
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
leaq 0x2a5d55(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
movsd 0xa8c21(%rip), %xmm1    # 0x16f088
ucomisd %xmm1, %xmm0
jbe 0xc6476
movl -0x3c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x3c(%rbp)
movsd 0xab14a(%rip), %xmm0    # 0x1715c8
leaq 0x2a5d2b(%rip), %rax    # 0x36c1b0
mulsd (%rax), %xmm0
movsd 0xa8be7(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
leaq 0x2a5d14(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
jmp 0xc64a7
jmp 0xc70b2
leaq 0x2d4562(%rip), %rdi    # 0x39aa10
leaq 0xc0fef(%rip), %rsi     # 0x1874a4
callq 0x9090
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xc65f9
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl $0x8, %esi
callq 0xc4fb0
movq -0x58(%rbp), %rdi
leaq 0xc0fbb(%rip), %rsi     # 0x1874a9
leaq -0x10(%rbp), %rdx
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
movb $0x0, %al
callq 0x9370
cmpl $0x0, -0x14(%rbp)
jge 0xc6510
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3c, -0x14(%rbp)
jl 0xc651f
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0xc652e
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3c, -0x18(%rbp)
jl 0xc653d
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0xc6553
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
subl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cvtsi2sdl -0x10(%rbp), %xmm0
cvtsi2sdl -0x14(%rbp), %xmm1
movsd 0xa8ab3(%rip), %xmm2    # 0x16f018
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
cvtsi2sdl -0x18(%rbp), %xmm1
movsd 0xa8a96(%rip), %xmm2    # 0x16f010
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
leaq 0x2a5c2f(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
movsd 0xa8adb(%rip), %xmm0    # 0x16f070
leaq 0x2a5c1c(%rip), %rax    # 0x36c1b8
ucomisd (%rax), %xmm0
jbe 0xc65ab
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
leaq 0x2a5c06(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
movsd 0xa8aba(%rip), %xmm1    # 0x16f078
ucomisd %xmm1, %xmm0
jbe 0xc65cd
movl -0x3c(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x3c(%rbp)
movsd 0xaaff3(%rip), %xmm0    # 0x1715c8
leaq 0x2a5bdc(%rip), %rax    # 0x36c1b8
mulsd (%rax), %xmm0
movsd 0xa8a90(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
leaq 0x2a5bc5(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
jmp 0xc65fe
jmp 0xc70b2
leaq 0x2d440b(%rip), %rdi    # 0x39aa10
leaq 0xc0ea7(%rip), %rsi     # 0x1874b3
callq 0x9090
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xc6698
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl $0x8, %esi
callq 0xc4fb0
movq -0x58(%rbp), %rdi
callq 0x9480
movsd 0xa8a09(%rip), %xmm1    # 0x16f050
divsd %xmm1, %xmm0
leaq 0x2a5b6e(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
movsd 0xbc9ea(%rip), %xmm0    # 0x183048
leaq 0x2a5b5b(%rip), %rax    # 0x36c1c0
ucomisd (%rax), %xmm0
jbe 0xc6674
movl -0x3c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x3c(%rbp)
leaq 0x2a5b45(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
movsd 0xaafb1(%rip), %xmm1    # 0x171638
ucomisd %xmm1, %xmm0
jbe 0xc6696
movl -0x3c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc669d
jmp 0xc70b2
leaq 0x2d436c(%rip), %rdi    # 0x39aa10
leaq 0xc0e0d(%rip), %rsi     # 0x1874b8
callq 0x9090
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xc6747
movq -0x58(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl $0x8, %esi
callq 0xc4fb0
movq -0x58(%rbp), %rdi
leaq 0xc0dda(%rip), %rsi     # 0x1874be
leaq -0x4(%rbp), %rdx
leaq -0x8(%rbp), %rcx
leaq -0xc(%rbp), %r8
movb $0x0, %al
callq 0x9370
cmpl $0x0, -0x4(%rbp)
jg 0xc6706
movl -0x3c(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x1f, -0x4(%rbp)
jle 0xc6715
movl -0x3c(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x8(%rbp)
jg 0xc6724
movl -0x3c(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc, -0x8(%rbp)
jle 0xc6733
movl -0x3c(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x7bc, -0xc(%rbp)      # imm = 0x7BC
jge 0xc6745
movl -0x3c(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc674c
jmp 0xc70b2
leaq 0x2d42bd(%rip), %rdi    # 0x39aa10
leaq 0xc0d6e(%rip), %rsi     # 0x1874c8
callq 0x9090
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xc681a
movq -0x58(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl $0x6, %esi
callq 0xc4fb0
movq -0x58(%rbp), %rdi
callq 0x9120
cmpq $0x6, %rax
je 0xc67a0
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
movq -0x58(%rbp), %rdi
leaq 0xbf95e(%rip), %rsi     # 0x186109
leaq -0x10(%rbp), %rdx
leaq -0x14(%rbp), %rcx
leaq -0x18(%rbp), %r8
movb $0x0, %al
callq 0x9370
cmpl $0x0, -0x10(%rbp)
jge 0xc67cd
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x18, -0x10(%rbp)
jle 0xc67dc
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xc67eb
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3c, -0x14(%rbp)
jle 0xc67fa
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0xc6809
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x3c, -0x18(%rbp)
jle 0xc6818
movl -0x3c(%rbp), %eax
orl $0x20, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc681f
jmp 0xc70b2
cmpl $0x0, -0x3c(%rbp)
je 0xc69b2
movsd -0x28(%rbp), %xmm0
leaq 0x2a597b(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
movsd -0x30(%rbp), %xmm0
leaq 0x2a5973(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
movsd -0x38(%rbp), %xmm0
leaq 0x2a596b(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
leaq 0x2a5eb0(%rip), %rax    # 0x36c710
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
leaq 0x1b3dcd(%rip), %rax    # 0x27a640
subsd (%rax), %xmm0
xorl %esi, %esi
movl $0x1, %edx
movl %esi, %edi
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
addsd %xmm1, %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x1d6cd1(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc68da
leaq 0x1d6cc4(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl -0xc(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x4(%rbp), %r8d
movl -0x10(%rbp), %r9d
movl -0x14(%rbp), %r10d
movl -0x18(%rbp), %eax
leaq 0xc0c03(%rip), %rsi     # 0x1874ce
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x9550
leaq 0x1d6c8f(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc6940
leaq 0x1d6c82(%rip), %rax    # 0x29d570
movq (%rax), %rdi
leaq 0x2a5f8c(%rip), %rax    # 0x36c884
movl (%rax), %edx
leaq 0x2a5f7b(%rip), %rax    # 0x36c87c
movl (%rax), %ecx
leaq 0x2a5f76(%rip), %rax    # 0x36c880
movl (%rax), %r8d
leaq 0x2a5f74(%rip), %rax    # 0x36c888
movl (%rax), %r9d
leaq 0x2a5f6e(%rip), %rax    # 0x36c88c
movl (%rax), %r10d
leaq 0x2a5f68(%rip), %rax    # 0x36c890
movl (%rax), %eax
leaq 0xc0bc4(%rip), %rsi     # 0x1874f5
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x9550
leaq 0x2a5f3d(%rip), %rax    # 0x36c884
movl (%rax), %eax
movl %eax, -0xc(%rbp)
leaq 0x2a5f29(%rip), %rax    # 0x36c87c
movl (%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0x2a5f21(%rip), %rax    # 0x36c880
movl (%rax), %eax
movl %eax, -0x4(%rbp)
leaq 0x2a5f1d(%rip), %rax    # 0x36c888
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x2a5f15(%rip), %rax    # 0x36c88c
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x2a5f0d(%rip), %rax    # 0x36c890
movl (%rax), %eax
movl %eax, -0x18(%rbp)
leaq 0x1d6be1(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc69b0
leaq 0x1d6bd4(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl -0x3c(%rbp), %edx
leaq 0xc0b73(%rip), %rsi     # 0x18751c
movb $0x0, %al
callq 0x9550
jmp 0xc69b2
jmp 0xc6c66
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc6abf
leaq 0x2d4254(%rip), %rdi    # 0x39ac20
callq 0x9890
leaq -0x1e(%rbp), %rcx
leaq -0x1e(%rbp), %r9
leaq -0x1e(%rbp), %r10
leaq -0x20(%rbp), %rax
leaq 0x2d4238(%rip), %rdi    # 0x39ac20
leaq 0xc0b3f(%rip), %rsi     # 0x18752e
leaq -0x4(%rbp), %rdx
leaq -0x8(%rbp), %r8
leaq -0x1c(%rbp), %r11
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x9370
cvtsi2sdl -0x4(%rbp), %xmm0
leaq 0x2a5794(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
cvtsi2sdl -0x8(%rbp), %xmm0
movsd 0xa85eb(%rip), %xmm1    # 0x16f018
divsd %xmm1, %xmm0
leaq 0x2a5778(%rip), %rax    # 0x36c1b0
addsd (%rax), %xmm0
leaq 0x2a576d(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd 0xbc5ec(%rip), %xmm1    # 0x183040
divsd %xmm1, %xmm0
leaq 0x2a5751(%rip), %rax    # 0x36c1b0
addsd (%rax), %xmm0
leaq 0x2a5746(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
movsbl -0x20(%rbp), %eax
cmpl $0x53, %eax
jne 0xc6a95
movsd 0xa8699(%rip), %xmm0    # 0x16f118
leaq 0x2a572a(%rip), %rax    # 0x36c1b0
mulsd (%rax), %xmm0
leaq 0x2a571f(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
movsd 0xaab2b(%rip), %xmm0    # 0x1715c8
leaq 0x2a570c(%rip), %rax    # 0x36c1b0
mulsd (%rax), %xmm0
movsd 0xa85c8(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
leaq 0x2a56f5(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc6bc7
leaq 0x2d414c(%rip), %rdi    # 0x39ac20
callq 0x9890
leaq -0x1e(%rbp), %rcx
leaq -0x1e(%rbp), %r9
leaq -0x1e(%rbp), %r10
leaq -0x20(%rbp), %rax
leaq 0x2d4130(%rip), %rdi    # 0x39ac20
leaq 0xc0a37(%rip), %rsi     # 0x18752e
leaq -0x4(%rbp), %rdx
leaq -0x8(%rbp), %r8
leaq -0x1c(%rbp), %r11
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x9370
cvtsi2sdl -0x4(%rbp), %xmm0
leaq 0x2a5694(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
cvtsi2sdl -0x8(%rbp), %xmm0
movsd 0xa84e3(%rip), %xmm1    # 0x16f018
divsd %xmm1, %xmm0
leaq 0x2a5678(%rip), %rax    # 0x36c1b8
addsd (%rax), %xmm0
leaq 0x2a566d(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
cvtsi2sdl -0x1c(%rbp), %xmm0
movsd 0xbc4e4(%rip), %xmm1    # 0x183040
divsd %xmm1, %xmm0
leaq 0x2a5651(%rip), %rax    # 0x36c1b8
addsd (%rax), %xmm0
leaq 0x2a5646(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
movsbl -0x20(%rbp), %eax
cmpl $0x57, %eax
jne 0xc6b9d
movsd 0xa8591(%rip), %xmm0    # 0x16f118
leaq 0x2a562a(%rip), %rax    # 0x36c1b8
mulsd (%rax), %xmm0
leaq 0x2a561f(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
movsd 0xaaa23(%rip), %xmm0    # 0x1715c8
leaq 0x2a560c(%rip), %rax    # 0x36c1b8
mulsd (%rax), %xmm0
movsd 0xa84c0(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
leaq 0x2a55f5(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc6be8
leaq 0x2d4048(%rip), %rdi    # 0x39ac20
callq 0x9480
leaq 0x2a55dc(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc6c21
leaq -0x1e(%rbp), %rcx
leaq -0x1e(%rbp), %r9
leaq 0x2d401f(%rip), %rdi    # 0x39ac20
leaq 0xbbedf(%rip), %rsi     # 0x182ae7
leaq -0x4(%rbp), %rdx
leaq -0x8(%rbp), %r8
leaq -0xc(%rbp), %rax
movq %rax, (%rsp)
movb $0x0, %al
callq 0x9370
jmp 0xc6c26
jmp 0xc70b2
callq 0xb0bd0
cmpl $0x0, %eax
je 0xc6c5f
leaq -0x1e(%rbp), %rcx
leaq -0x1e(%rbp), %r9
leaq 0x2d3fe1(%rip), %rdi    # 0x39ac20
leaq 0xbbea1(%rip), %rsi     # 0x182ae7
leaq -0x10(%rbp), %rdx
leaq -0x14(%rbp), %r8
leaq -0x18(%rbp), %rax
movq %rax, (%rsp)
movb $0x0, %al
callq 0x9370
jmp 0xc6c64
jmp 0xc70b2
jmp 0xc6c66
cmpl $0x63, -0x4(%rbp)
jne 0xc6c81
cmpl $0x63, -0x8(%rbp)
jne 0xc6c81
cmpl $0x63, -0xc(%rbp)
je 0xc6c93
cmpl $0x270f, -0xc(%rbp)     # imm = 0x270F
je 0xc6c93
cmpl $0x63, -0x10(%rbp)
jne 0xc6cf3
cmpl $0x63, -0x14(%rbp)
jne 0xc6cf3
cmpl $0x63, -0x18(%rbp)
jne 0xc6cf3
callq 0xa750
leaq 0x2a5c09(%rip), %rax    # 0x36c8a8
movl (%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
movl -0xc(%rbp), %eax
addl $0x7d0, %eax            # imm = 0x7D0
movl %eax, -0xc(%rbp)
leaq 0x2a5be2(%rip), %rax    # 0x36c8a0
movl (%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0x2a5bda(%rip), %rax    # 0x36c8a4
movl (%rax), %eax
movl %eax, -0x4(%rbp)
leaq 0x2a5bd6(%rip), %rax    # 0x36c8ac
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x2a5bce(%rip), %rax    # 0x36c8b0
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x2a5bc6(%rip), %rax    # 0x36c8b4
movl (%rax), %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
callq 0x122140
movsd %xmm0, -0x78(%rbp)
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
xorps %xmm0, %xmm0
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x30a35e(%rip), %xmm0   # 0x3d1098
movsd %xmm0, -0x70(%rbp)
xorl %esi, %esi
movl $0x2, %edx
xorps %xmm0, %xmm0
movl %esi, %edi
callq 0x122210
movsd -0x70(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x68(%rbp), %xmm0
addsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
leaq 0x1d67ff(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc6dc6
leaq 0x1d67f2(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movsd -0x48(%rbp), %xmm0
movsd 0x30a30a(%rip), %xmm1   # 0x3d1098
movsd -0x50(%rbp), %xmm2
movsd 0xa827d(%rip), %xmm3    # 0x16f018
mulsd -0x50(%rbp), %xmm3
movsd 0xa8270(%rip), %xmm4    # 0x16f018
mulsd %xmm4, %xmm3
movsd 0xa8284(%rip), %xmm4    # 0x16f038
mulsd %xmm4, %xmm3
leaq 0xbe67f(%rip), %rsi     # 0x18543e
movb $0x4, %al
callq 0x9550
movsd -0x48(%rbp), %xmm1
movsd 0x30a2c5(%rip), %xmm0   # 0x3d1098
ucomisd %xmm1, %xmm0
jbe 0xc6dde
jmp 0xc6ee5
leaq 0x1b33e3(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0xc6def
jmp 0xc6ee3
leaq 0x2a57d6(%rip), %rax    # 0x36c5cc
cmpl $0x0, (%rax)
je 0xc6ee1
cmpl $0x22, -0x18(%rbp)
je 0xc6ee1
movsd -0x50(%rbp), %xmm1
movaps 0xa847b(%rip), %xmm0    # 0x16f290
pand %xmm0, %xmm1
movsd 0xa8387(%rip), %xmm0    # 0x16f1a8
ucomisd %xmm1, %xmm0
jb 0xc6ee1
xorl %esi, %esi
movl $0x1, %edx
xorps %xmm0, %xmm0
movl %esi, %edi
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movl 0x30a24d(%rip), %eax    # 0x3d10a0
addl $0x1, %eax
movl %eax, 0x30a244(%rip)    # 0x3d10a0
movsd -0x48(%rbp), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x2a5a15(%rip), %rax    # 0x36c884
movl (%rax), %eax
movl %eax, -0xc(%rbp)
leaq 0x2a5a01(%rip), %rax    # 0x36c87c
movl (%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0x2a59f9(%rip), %rax    # 0x36c880
movl (%rax), %eax
movl %eax, -0x4(%rbp)
leaq 0x2a59f5(%rip), %rax    # 0x36c888
movl (%rax), %eax
movl %eax, -0x10(%rbp)
leaq 0x2a59ed(%rip), %rax    # 0x36c88c
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq 0x2a59e5(%rip), %rax    # 0x36c890
movl (%rax), %eax
movl %eax, -0x18(%rbp)
leaq 0x1d66b9(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc6edf
leaq 0x1d66ac(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq 0xc0665(%rip), %rsi     # 0x18753d
movb $0x0, %al
callq 0x9550
jmp 0xc6ee1
jmp 0xc6ee3
jmp 0xc6ee5
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x30a1a6(%rip)   # 0x3d1098
leaq 0x1b32cf(%rip), %rax    # 0x27a1c8
cmpl $0x4e, (%rax)
jne 0xc6f1b
movl -0x18(%rbp), %eax
cmpl 0x102715(%rip), %eax    # 0x1c961c
jne 0xc6f1b
leaq 0x1b32c0(%rip), %rax    # 0x27a1d0
movl $0x1, (%rax)
jmp 0xc70b2
leaq 0x2a56aa(%rip), %rax    # 0x36c5cc
cmpl $0x0, (%rax)
jne 0xc6f36
movl 0x1026ef(%rip), %eax    # 0x1c961c
cmpl -0x18(%rbp), %eax
je 0xc70b0
movl -0x18(%rbp), %eax
movl %eax, 0x1026dd(%rip)    # 0x1c961c
movl -0xc(%rbp), %ecx
leaq 0x2a57ab(%rip), %rax    # 0x36c6f4
movl %ecx, (%rax)
movl -0x8(%rbp), %ecx
leaq 0x2a579b(%rip), %rax    # 0x36c6f0
movl %ecx, (%rax)
movl -0x4(%rbp), %ecx
leaq 0x2a578b(%rip), %rax    # 0x36c6ec
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
leaq 0x2a577b(%rip), %rax    # 0x36c6e8
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
leaq 0x2a576b(%rip), %rax    # 0x36c6e4
movl %ecx, (%rax)
movl -0x18(%rbp), %ecx
leaq 0x2a575b(%rip), %rax    # 0x36c6e0
movl %ecx, (%rax)
leaq 0x2a576a(%rip), %rax    # 0x36c6f8
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x2a5701(%rip), %rax    # 0x36c69d
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xc6fab
callq 0x7fc70
jmp 0xc6fb3
xorps %xmm0, %xmm0
callq 0x7fbf0
leaq 0x2a56ee(%rip), %rax    # 0x36c6a8
cmpl $0x21, (%rax)
jne 0xc6fef
cmpl $0x22, 0x10239a(%rip)   # 0x1c9360
jne 0xc6fef
leaq 0x1d65a1(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xc6fed
leaq 0x1d6594(%rip), %rax    # 0x29d570
movq (%rax), %rdi
leaq 0xc0581(%rip), %rsi     # 0x187567
movb $0x0, %al
callq 0x9550
jmp 0xc700c
leaq 0x2a56b2(%rip), %rax    # 0x36c6a8
movl (%rax), %eax
cmpl 0x102362(%rip), %eax    # 0x1c9360
je 0xc700a
movl $0x612, %edi            # imm = 0x612
callq 0x9d790
jmp 0xc700c
leaq 0x2a56cd(%rip), %rax    # 0x36c6e0
cmpl $0x20, (%rax)
jne 0xc706c
leaq 0x1b31a9(%rip), %rax    # 0x27a1c8
cmpl $0x4f, (%rax)
jne 0xc7048
leaq 0xc055a(%rip), %rdi     # 0x187585
movl $0xcd, %esi
callq 0x82fd0
leaq 0xc0557(%rip), %rdi     # 0x187593
movl $0xce, %esi
callq 0x82fd0
jmp 0xc706a
leaq 0xc054e(%rip), %rdi     # 0x18759d
movl $0xce, %esi
callq 0x82fd0
leaq 0xc0525(%rip), %rdi     # 0x187585
movl $0xcd, %esi
callq 0x82fd0
jmp 0xc706c
leaq 0x2a566d(%rip), %rax    # 0x36c6e0
cmpl $0x20, (%rax)
jne 0xc7082
movl $0x6, %edi
callq 0xc5ec0
leaq 0x2a5657(%rip), %rax    # 0x36c6e0
cmpl $0x21, (%rax)
jne 0xc7098
movl $0x7, %edi
callq 0xc5ec0
leaq 0x2a5641(%rip), %rax    # 0x36c6e0
cmpl $0x22, (%rax)
jne 0xc70ae
movl $0x8, %edi
callq 0xc5ec0
jmp 0xc70b0
jmp 0xc70b2
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)