// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x8a30f(%rip), %rdi     # 0x10e0e1
callq 0x520bf
leaq 0x27391a(%rip), %rax    # 0x2f76f8
andq $0x0, (%rax)
leaq 0x18120b(%rip), %rax    # 0x204ff4
movl $0x1, (%rax)
leaq 0x29d216(%rip), %rax    # 0x32100c
andl $0x0, (%rax)
leaq 0x2731d0(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm0
leaq 0x2731cd(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm1
leaq 0x2731ca(%rip), %rax    # 0x2f6fe0
movsd (%rax), %xmm2
pushq $0x63
popq %rax
movl %eax, -0x2c(%rbp)
movl %eax, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl %eax, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x270f, -0x40(%rbp)    # imm = 0x270F
leaq 0x1811ae(%rip), %rax    # 0x204fe8
cmpl $0x4f, (%rax)
jne 0x84313
movsd %xmm2, -0x90(%rbp)
movsd %xmm1, -0x70(%rbp)
movsd %xmm0, -0x50(%rbp)
leaq 0x2a19d4(%rip), %rdi    # 0x325830
leaq 0x8a28d(%rip), %rsi     # 0x10e0f0
callq 0x9090
testq %rax, %rax
je 0x848af
movq %rax, %rbx
addq $0x4, %rbx
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x830bb
leaq 0x8a26b(%rip), %rsi     # 0x10e0f5
leaq -0x34(%rbp), %r14
leaq -0x30(%rbp), %r15
leaq -0x2c(%rbp), %r12
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x9350
movl (%r15), %r13d
movl (%r12), %r15d
movl (%r14), %eax
movl %r15d, %ecx
movl %r13d, %edx
testl %eax, %eax
jns 0x83ecd
movl %r13d, %edx
negl %edx
movl %edx, -0x30(%rbp)
movl %r15d, %ecx
negl %ecx
movl %ecx, -0x2c(%rbp)
cvtsi2sd %eax, %xmm0
cvtsi2sd %edx, %xmm1
divsd 0x6f12b(%rip), %xmm1    # 0xf3008
addsd %xmm0, %xmm1
cvtsi2sd %ecx, %xmm2
divsd 0x6f123(%rip), %xmm2    # 0xf3010
addsd %xmm1, %xmm2
movsd 0x719a7(%rip), %xmm0    # 0xf58a0
movapd %xmm2, -0x80(%rbp)
mulsd %xmm2, %xmm0
divsd 0x7199e(%rip), %xmm0    # 0xf58a8
leaq 0x2730bf(%rip), %rax    # 0x2f6fd0
movsd %xmm0, (%rax)
leaq 0x2a1914(%rip), %rdi    # 0x325830
leaq 0x8a1dc(%rip), %rsi     # 0x10e0ff
callq 0x9090
testq %rax, %rax
je 0x848af
movq %rax, %r14
pushq $0x1
popq %rax
movl %r13d, %ebx
shrl $0x1f, %ebx
cmpl $0x3c, %r13d
cmovgel %eax, %ebx
cmpl $0x3c, %r15d
movapd -0x80(%rbp), %xmm0
andpd 0x6f23b(%rip), %xmm0    # 0xf3190
cmovael %eax, %ebx
ucomisd 0x71a30(%rip), %xmm0    # 0xf5990
cmoval %eax, %ebx
addq $0x4, %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x830bb
leaq 0x8a18b(%rip), %rsi     # 0x10e104
leaq -0x34(%rbp), %r15
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r13
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x9350
movl (%r12), %eax
leal 0x2(%rbx), %ecx
cmpl $0x3c, %eax
cmovael %ecx, %ebx
movl (%r13), %r12d
testl %r12d, %r12d
cmovsl %ecx, %ebx
movl (%r15), %ecx
movl %r12d, %edx
testl %ecx, %ecx
jns 0x83fc6
negl %eax
movl %eax, -0x30(%rbp)
movl %r12d, %edx
negl %edx
movl %edx, -0x2c(%rbp)
cvtsi2sd %ecx, %xmm0
cvtsi2sd %eax, %xmm1
divsd 0x6f032(%rip), %xmm1    # 0xf3008
addsd %xmm0, %xmm1
cvtsi2sd %edx, %xmm2
divsd 0x6f02a(%rip), %xmm2    # 0xf3010
addsd %xmm1, %xmm2
movsd 0x718ae(%rip), %xmm0    # 0xf58a0
movapd %xmm2, -0x80(%rbp)
mulsd %xmm2, %xmm0
divsd 0x718a5(%rip), %xmm0    # 0xf58a8
leaq 0x272fce(%rip), %rax    # 0x2f6fd8
movsd %xmm0, (%rax)
leaq 0x2a181b(%rip), %rdi    # 0x325830
leaq 0x8a0f2(%rip), %rsi     # 0x10e10e
callq 0x9090
testq %rax, %rax
je 0x848af
movq %rax, %r14
addq $0x4, %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x830bb
movq %r14, %rdi
callq 0x9470
divsd 0x6f014(%rip), %xmm0    # 0xf3060
leaq 0x272f8d(%rip), %rax    # 0x2f6fe0
movsd %xmm0, -0x88(%rbp)
movsd %xmm0, (%rax)
leaq 0x2a17ca(%rip), %rdi    # 0x325830
leaq 0x8a0a6(%rip), %rsi     # 0x10e113
callq 0x9090
testq %rax, %rax
je 0x848af
movq %rax, %r14
addq $0x5, %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x830bb
leaq 0x8a085(%rip), %rsi     # 0x10e119
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x40(%rbp), %r8
movq %r14, %rdi
xorl %eax, %eax
callq 0x9350
leaq 0x2a177f(%rip), %rdi    # 0x325830
leaq 0x8a06b(%rip), %rsi     # 0x10e123
callq 0x9090
testq %rax, %rax
je 0x848af
movq %rax, %r14
movl %ebx, %eax
orl $0x2, %eax
cmpl $0x3c, %r12d
movapd -0x80(%rbp), %xmm0
andpd 0x6f0b1(%rip), %xmm0    # 0xf3190
cmovgel %eax, %ebx
ucomisd 0x717be(%rip), %xmm0    # 0xf58a8
cmoval %eax, %ebx
movl %ebx, %eax
orl $0x4, %eax
movsd 0x845f6(%rip), %xmm0    # 0x1086f0
movsd -0x88(%rbp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %eax, %ebx
ucomisd 0x71827(%rip), %xmm1    # 0xf5938
cmoval %eax, %ebx
movl %ebx, %eax
orl $0x8, %eax
movl -0x3c(%rbp), %ecx
addl $-0x20, %ecx
movl -0x38(%rbp), %edx
addl $-0xd, %edx
cmpl $-0x1f, %ecx
cmovbl %eax, %ebx
cmpl $-0xc, %edx
cmovbl %eax, %ebx
cmpl $0x7bc, -0x40(%rbp)     # imm = 0x7BC
cmovll %eax, %ebx
addq $0x5, %r14
pushq $0x6
popq %rsi
movq %r14, %rdi
callq 0x830bb
movq %r14, %rdi
callq 0x9120
movl %ebx, %r13d
orl $0x20, %r13d
cmpq $0x6, %rax
cmovnel %r13d, %ebx
leaq 0x88c59(%rip), %rsi     # 0x10cdc1
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r8
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %r8, %r14
xorl %eax, %eax
callq 0x9350
cmpl $0x19, (%r15)
cmovael %r13d, %ebx
cmpl $0x3d, (%r12)
cmovael %r13d, %ebx
cmpl $0x3d, (%r14)
cmovael %r13d, %ebx
testl %ebx, %ebx
je 0x844ff
leaq 0x272e25(%rip), %rax    # 0x2f6fd0
movsd -0x50(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x272e1d(%rip), %rax    # 0x2f6fd8
movsd -0x70(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x272e15(%rip), %rax    # 0x2f6fe0
movsd -0x90(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x273352(%rip), %rax    # 0x2f7530
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
leaq 0x181272(%rip), %rax    # 0x205460
xorpd %xmm0, %xmm0
subsd (%rax), %xmm0
xorl %r14d, %r14d
pushq $0x1
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0xc2faf
addsd -0x50(%rbp), %xmm0
xorl %edi, %edi
callq 0xbfac2
leaq 0x1a4178(%rip), %r15    # 0x228390
movq (%r15), %rdi
testq %rdi, %rdi
je 0x842aa
movl -0x40(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl -0x34(%rbp), %r9d
movl -0x30(%rbp), %r10d
movl -0x2c(%rbp), %r11d
leaq 0x89ee8(%rip), %rsi     # 0x10e129
xorl %r14d, %r14d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x9560
popq %rcx
popq %rdx
movq (%r15), %rdi
testq %rdi, %rdi
je 0x842aa
leaq 0x273444(%rip), %rax    # 0x2f76a4
movl (%rax), %edx
leaq 0x273433(%rip), %rax    # 0x2f769c
movl (%rax), %ecx
leaq 0x27342e(%rip), %rax    # 0x2f76a0
movl (%rax), %r8d
leaq 0x27342c(%rip), %rax    # 0x2f76a8
movl (%rax), %r9d
leaq 0x273426(%rip), %rax    # 0x2f76ac
movl (%rax), %r10d
leaq 0x273420(%rip), %rax    # 0x2f76b0
movl (%rax), %r11d
leaq 0x89eb6(%rip), %rsi     # 0x10e150
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x9560
popq %rcx
popq %rdx
movq (%r15), %r14
leaq 0x2733f3(%rip), %rax    # 0x2f76a4
movl (%rax), %eax
movl %eax, -0x40(%rbp)
leaq 0x2733df(%rip), %rax    # 0x2f769c
movl (%rax), %eax
movl %eax, -0x38(%rbp)
leaq 0x2733d7(%rip), %rax    # 0x2f76a0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0x2733d3(%rip), %rax    # 0x2f76a8
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq 0x2733cb(%rip), %rax    # 0x2f76ac
movl (%rax), %eax
movl %eax, -0x30(%rbp)
leaq 0x2733c3(%rip), %rax    # 0x2f76b0
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
testq %r14, %r14
je 0x844ff
leaq 0x89e75(%rip), %rsi     # 0x10e177
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
jmp 0x844ff
callq 0x75767
testl %eax, %eax
je 0x843bc
leaq 0x2a1719(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x988f
subq $0x8, %rsp
leaq -0x52(%rbp), %r12
leaq -0x42(%rbp), %rcx
leaq -0x58(%rbp), %r13
leaq 0x89e43(%rip), %rsi     # 0x10e189
leaq -0x3c(%rbp), %r14
leaq -0x38(%rbp), %r15
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %r8
movq %rcx, %r9
xorl %eax, %eax
pushq %r12
pushq %rcx
pushq %r13
callq 0x9350
addq $0x20, %rsp
cvtsi2sdl (%r14), %xmm1
cvtsi2sdl (%r15), %xmm2
divsd 0x6ec8c(%rip), %xmm2    # 0xf3008
cvtsi2sdl (%r13), %xmm0
divsd 0x8435e(%rip), %xmm0    # 0x1086e8
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
cmpb $0x53, (%r12)
jne 0x843a1
xorpd 0x6ee0f(%rip), %xmm0    # 0xf31b0
mulsd 0x714f7(%rip), %xmm0    # 0xf58a0
divsd 0x714f7(%rip), %xmm0    # 0xf58a8
leaq 0x272c18(%rip), %rax    # 0x2f6fd0
movsd %xmm0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x84465
leaq 0x2a1670(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x988f
subq $0x8, %rsp
leaq -0x52(%rbp), %r12
leaq -0x42(%rbp), %rcx
leaq -0x58(%rbp), %r13
leaq 0x89d9a(%rip), %rsi     # 0x10e189
leaq -0x3c(%rbp), %r14
leaq -0x38(%rbp), %r15
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %r8
movq %rcx, %r9
xorl %eax, %eax
pushq %r12
pushq %rcx
pushq %r13
callq 0x9350
addq $0x20, %rsp
cvtsi2sdl (%r14), %xmm1
cvtsi2sdl (%r15), %xmm2
divsd 0x6ebe3(%rip), %xmm2    # 0xf3008
cvtsi2sdl (%r13), %xmm0
divsd 0x842b5(%rip), %xmm0    # 0x1086e8
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
cmpb $0x57, (%r12)
jne 0x8444a
xorpd 0x6ed66(%rip), %xmm0    # 0xf31b0
mulsd 0x7144e(%rip), %xmm0    # 0xf58a0
divsd 0x7144e(%rip), %xmm0    # 0xf58a8
leaq 0x272b77(%rip), %rax    # 0x2f6fd8
movsd %xmm0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x84485
leaq 0x2a15cb(%rip), %rdi    # 0x325a40
callq 0x9470
leaq 0x272b5f(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x848af
subq $0x8, %rsp
leaq -0x40(%rbp), %r10
leaq 0x2a159f(%rip), %rdi    # 0x325a40
leaq 0x83c9f(%rip), %rsi     # 0x108147
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %r8
leaq -0x42(%rbp), %rcx
movq %rcx, %r9
xorl %eax, %eax
pushq %r10
callq 0x9350
popq %rcx
popq %rdx
callq 0x75767
testl %eax, %eax
je 0x848af
subq $0x8, %rsp
leaq -0x2c(%rbp), %r10
leaq 0x2a1562(%rip), %rdi    # 0x325a40
leaq 0x83c62(%rip), %rsi     # 0x108147
leaq -0x34(%rbp), %rdx
leaq -0x30(%rbp), %r8
leaq -0x42(%rbp), %rcx
movq %rcx, %r9
xorl %eax, %eax
pushq %r10
callq 0x9350
popq %rcx
popq %rdx
movl -0x3c(%rbp), %edx
movl %edx, %eax
xorl $0x63, %eax
movl -0x38(%rbp), %esi
movl %esi, %ecx
xorl $0x63, %ecx
orl %eax, %ecx
jne 0x84522
movl -0x40(%rbp), %eax
cmpl $0x63, %eax
je 0x84534
cmpl $0x270f, %eax           # imm = 0x270F
je 0x84534
cmpl $0x63, -0x34(%rbp)
jne 0x84591
cmpl $0x63, -0x30(%rbp)
jne 0x84591
cmpl $0x63, -0x2c(%rbp)
jne 0x84591
callq 0xa386
leaq 0x273188(%rip), %rax    # 0x2f76c8
movl (%rax), %eax
pushq $0x64
popq %rcx
cltd
idivl %ecx
movl %edx, %edi
addl $0x7d0, %edi            # imm = 0x7D0
movl %edi, -0x40(%rbp)
leaq 0x273166(%rip), %rax    # 0x2f76c0
movl (%rax), %esi
movl %esi, -0x38(%rbp)
leaq 0x27315e(%rip), %rax    # 0x2f76c4
movl (%rax), %edx
movl %edx, -0x3c(%rbp)
leaq 0x27315a(%rip), %rax    # 0x2f76cc
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq 0x273152(%rip), %rax    # 0x2f76d0
movl (%rax), %eax
movl %eax, -0x30(%rbp)
leaq 0x27314a(%rip), %rax    # 0x2f76d4
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x84594
movl -0x40(%rbp), %edi
callq 0xc2f07
movsd %xmm0, -0x50(%rbp)
movl -0x34(%rbp), %edi
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
xorpd %xmm0, %xmm0
callq 0xc2faf
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x2d78e6(%rip), %xmm0   # 0x35bea8
movsd %xmm0, -0x70(%rbp)
pushq $0x2
popq %rdx
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xc2faf
movsd -0x50(%rbp), %xmm4
addsd -0x70(%rbp), %xmm0
movapd %xmm4, %xmm2
subsd %xmm0, %xmm2
leaq 0x1a3da0(%rip), %rbx    # 0x228390
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8463d
movsd 0x2d78a8(%rip), %xmm1   # 0x35bea8
movsd 0x6ea00(%rip), %xmm0    # 0xf3008
movapd %xmm2, %xmm3
mulsd %xmm0, %xmm3
mulsd %xmm0, %xmm3
mulsd 0x6ea24(%rip), %xmm3    # 0xf3040
leaq 0x87ad3(%rip), %rsi     # 0x10c0f6
movapd %xmm4, %xmm0
movb $0x4, %al
movapd %xmm2, -0x70(%rbp)
callq 0x9560
movapd -0x70(%rbp), %xmm2
movsd -0x50(%rbp), %xmm4
movsd 0x2d7863(%rip), %xmm0   # 0x35bea8
ucomisd %xmm4, %xmm0
seta %cl
leaq 0x180995(%rip), %rax    # 0x204fe8
movl (%rax), %eax
cmpl $0x4f, %eax
sete %dl
orb %cl, %dl
movl -0x2c(%rbp), %r8d
jne 0x8473c
leaq 0x272d7e(%rip), %rax    # 0x2f73ec
cmpl $0x0, (%rax)
je 0x84733
cmpl $0x22, %r8d
je 0x84733
andpd 0x6eb07(%rip), %xmm2    # 0xf3190
movsd 0x83c3f(%rip), %xmm0    # 0x1082d0
ucomisd %xmm2, %xmm0
jb 0x84733
pushq $0x1
popq %rdx
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
callq 0xc2faf
movsd -0x50(%rbp), %xmm1
subsd %xmm0, %xmm1
incl 0x2d77f6(%rip)          # 0x35beb0
xorl %edi, %edi
movsd %xmm1, -0x50(%rbp)
movapd %xmm1, %xmm0
callq 0xbfac2
leaq 0x272fd3(%rip), %rax    # 0x2f76a4
movl (%rax), %eax
movl %eax, -0x40(%rbp)
leaq 0x272fbf(%rip), %rax    # 0x2f769c
movl (%rax), %eax
movl %eax, -0x38(%rbp)
leaq 0x272fb7(%rip), %rax    # 0x2f76a0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0x272fb3(%rip), %rax    # 0x2f76a8
movl (%rax), %edx
movl %edx, -0x34(%rbp)
leaq 0x272fab(%rip), %rax    # 0x2f76ac
movl (%rax), %ecx
movl %ecx, -0x30(%rbp)
leaq 0x272fa3(%rip), %rax    # 0x2f76b0
movl (%rax), %r8d
movl %r8d, -0x2c(%rbp)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8472e
leaq 0x89a75(%rip), %rsi     # 0x10e198
xorl %eax, %eax
callq 0x9560
movl -0x2c(%rbp), %r8d
movsd -0x50(%rbp), %xmm4
leaq 0x1808ae(%rip), %rax    # 0x204fe8
movl (%rax), %eax
movsd %xmm4, 0x2d7764(%rip)   # 0x35bea8
cmpl $0x4e, %eax
jne 0x84764
cmpl 0xcfedc(%rip), %r8d     # 0x15462c
jne 0x84764
leaq 0x180897(%rip), %rax    # 0x204ff0
movl $0x1, (%rax)
jmp 0x848af
leaq 0x272c81(%rip), %rax    # 0x2f73ec
cmpl $0x0, (%rax)
jne 0x8477d
cmpl %r8d, 0xcfeb5(%rip)     # 0x15462c
je 0x848af
movl %r8d, 0xcfea8(%rip)     # 0x15462c
movl -0x40(%rbp), %eax
leaq 0x272d86(%rip), %rcx    # 0x2f7514
movl %eax, (%rcx)
movl -0x38(%rbp), %eax
leaq 0x272d76(%rip), %rcx    # 0x2f7510
movl %eax, (%rcx)
movl -0x3c(%rbp), %eax
leaq 0x272d66(%rip), %rcx    # 0x2f750c
movl %eax, (%rcx)
movl -0x34(%rbp), %eax
leaq 0x272d56(%rip), %rcx    # 0x2f7508
movl %eax, (%rcx)
movl -0x30(%rbp), %eax
leaq 0x272d46(%rip), %rcx    # 0x2f7504
movl %eax, (%rcx)
leaq 0x272d39(%rip), %r14    # 0x2f7500
leaq 0x272d4a(%rip), %rax    # 0x2f7518
andq $0x0, (%rax)
movl %r8d, (%r14)
leaq 0x272ce1(%rip), %rax    # 0x2f74bd
cmpb $0x0, (%rax)
je 0x847ec
xorpd %xmm0, %xmm0
callq 0x55462
jmp 0x847f1
callq 0x554d3
leaq 0x272cd0(%rip), %rax    # 0x2f74c8
movl (%rax), %eax
movl %eax, %edx
xorl $0x21, %edx
movl 0xcfb6b(%rip), %ecx     # 0x154370
movl %ecx, %esi
xorl $0x22, %esi
orl %edx, %esi
jne 0x8482a
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x84833
leaq 0x899a5(%rip), %rdi     # 0x10e1c2
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x9750
jmp 0x84833
cmpl %ecx, %eax
je 0x84833
callq 0x694f6
movl (%r14), %eax
cmpl $0x20, %eax
jne 0x84898
leaq 0x1807a6(%rip), %rax    # 0x204fe8
cmpl $0x4f, (%rax)
jne 0x84866
leaq 0x89992(%rip), %rdi     # 0x10e1e0
movl $0xcd, %esi
callq 0x576d4
leaq 0x8998f(%rip), %rdi     # 0x10e1ee
movl $0xce, %esi
jmp 0x84883
leaq 0x8998b(%rip), %rdi     # 0x10e1f8
movl $0xce, %esi
callq 0x576d4
leaq 0x89962(%rip), %rdi     # 0x10e1e0
movl $0xcd, %esi
callq 0x576d4
movl (%r14), %eax
cmpl $0x20, %eax
jne 0x84898
callq 0x83b1e
movl (%r14), %eax
cmpl $0x21, %eax
jne 0x848a5
callq 0x83b1e
movl (%r14), %eax
cmpl $0x22, %eax
jne 0x848af
callq 0x83b1e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq