// File: /workspace/github_cpp_makefile_star2_O3/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 0x935bd(%rip), %rdi     # 0x124199
callq 0x58dc2
leaq 0x27cb10(%rip), %rax    # 0x30d6f8
movq $0x0, (%rax)
leaq 0x18a3fe(%rip), %rax    # 0x21aff4
movl $0x1, (%rax)
leaq 0x2a6409(%rip), %rax    # 0x33700c
movl $0x0, (%rax)
leaq 0x27c3c0(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm0
leaq 0x27c3bd(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
leaq 0x27c3ba(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm2
movl $0x63, %eax
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 0x18a39c(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x91149
movsd %xmm2, -0x90(%rbp)
movsd %xmm1, -0x70(%rbp)
movsd %xmm0, -0x50(%rbp)
leaq 0x2aabc2(%rip), %rdi    # 0x33b830
leaq 0x93533(%rip), %rsi     # 0x1241a8
callq 0x9090
testq %rax, %rax
je 0x91794
movq %rax, %rbx
addq $0x4, %rbx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x8fdd2
leaq 0x9350f(%rip), %rsi     # 0x1241ad
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 0x9360
movl (%r15), %r13d
movl (%r12), %r15d
movl (%r14), %eax
movl %r15d, %ecx
movl %r13d, %edx
testl %eax, %eax
jns 0x90ce1
movl %r13d, %edx
negl %edx
movl %edx, -0x30(%rbp)
movl %r15d, %ecx
negl %ecx
movl %ecx, -0x2c(%rbp)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd 0x78311(%rip), %xmm1    # 0x109008
addsd %xmm0, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd 0x78306(%rip), %xmm2    # 0x109010
addsd %xmm1, %xmm2
movsd 0x7ab12(%rip), %xmm0    # 0x10b828
movapd %xmm2, -0x80(%rbp)
mulsd %xmm2, %xmm0
divsd 0x7ab09(%rip), %xmm0    # 0x10b830
leaq 0x27c2a2(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
leaq 0x2aaaf7(%rip), %rdi    # 0x33b830
leaq 0x93477(%rip), %rsi     # 0x1241b7
callq 0x9090
testq %rax, %rax
je 0x91794
movq %rax, %r14
movl %r13d, %ebx
shrl $0x1f, %ebx
cmpl $0x3c, %r13d
movl $0x1, %eax
cmovgel %eax, %ebx
cmpl $0x3c, %r15d
movapd -0x80(%rbp), %xmm0
andpd 0x7841c(%rip), %xmm0    # 0x109190
cmovael %eax, %ebx
ucomisd 0x7ab99(%rip), %xmm0    # 0x10b918
cmoval %eax, %ebx
addq $0x4, %r14
movq %r14, %rdi
movl $0x8, %esi
callq 0x8fdd2
leaq 0x93422(%rip), %rsi     # 0x1241bc
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 0x9360
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 0x90de7
negl %eax
movl %eax, -0x30(%rbp)
movl %r12d, %edx
negl %edx
movl %edx, -0x2c(%rbp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd 0x7820b(%rip), %xmm1    # 0x109008
addsd %xmm0, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
divsd 0x78200(%rip), %xmm2    # 0x109010
addsd %xmm1, %xmm2
movsd 0x7aa0c(%rip), %xmm0    # 0x10b828
movapd %xmm2, -0x80(%rbp)
mulsd %xmm2, %xmm0
divsd 0x7aa03(%rip), %xmm0    # 0x10b830
leaq 0x27c1a4(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
leaq 0x2aa9f1(%rip), %rdi    # 0x33b830
leaq 0x93380(%rip), %rsi     # 0x1241c6
callq 0x9090
testq %rax, %rax
je 0x91794
movq %rax, %r14
addq $0x4, %r14
movq %r14, %rdi
movl $0x8, %esi
callq 0x8fdd2
movq %r14, %rdi
callq 0x9470
divsd 0x781e8(%rip), %xmm0    # 0x109060
leaq 0x27c161(%rip), %rax    # 0x30cfe0
movsd %xmm0, -0x88(%rbp)
movsd %xmm0, (%rax)
leaq 0x2aa99e(%rip), %rdi    # 0x33b830
leaq 0x93332(%rip), %rsi     # 0x1241cb
callq 0x9090
testq %rax, %rax
je 0x91794
movq %rax, %r14
addq $0x5, %r14
movq %r14, %rdi
movl $0x8, %esi
callq 0x8fdd2
leaq 0x9330f(%rip), %rsi     # 0x1241d1
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %rcx
leaq -0x40(%rbp), %r8
movq %r14, %rdi
xorl %eax, %eax
callq 0x9360
leaq 0x2aa951(%rip), %rdi    # 0x33b830
leaq 0x932f5(%rip), %rsi     # 0x1241db
callq 0x9090
testq %rax, %rax
je 0x91794
movq %rax, %r14
movl %ebx, %eax
orl $0x2, %eax
cmpl $0x3c, %r12d
movapd -0x80(%rbp), %xmm0
andpd 0x78283(%rip), %xmm0    # 0x109190
cmovgel %eax, %ebx
ucomisd 0x7a918(%rip), %xmm0    # 0x10b830
cmoval %eax, %ebx
movl %ebx, %eax
orl $0x4, %eax
movsd 0x8d850(%rip), %xmm0    # 0x11e778
movsd -0x88(%rbp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %eax, %ebx
ucomisd 0x7a981(%rip), %xmm1    # 0x10b8c0
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
movq %r14, %rdi
movl $0x6, %esi
callq 0x8fdd2
movq %r14, %rdi
callq 0x9120
movl %ebx, %r13d
orl $0x20, %r13d
cmpq $0x6, %rax
cmovnel %r13d, %ebx
leaq 0x91ee1(%rip), %rsi     # 0x122e79
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r8
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
movq %r8, %r14
xorl %eax, %eax
callq 0x9360
cmpl $0x19, (%r15)
cmovael %r13d, %ebx
cmpl $0x3d, (%r12)
cmovael %r13d, %ebx
cmpl $0x3d, (%r14)
cmovael %r13d, %ebx
testl %ebx, %ebx
je 0x9134b
leaq 0x27bff5(%rip), %rax    # 0x30cfd0
movsd -0x50(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x27bfed(%rip), %rax    # 0x30cfd8
movsd -0x70(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x27bfe5(%rip), %rax    # 0x30cfe0
movsd -0x90(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x27c522(%rip), %rax    # 0x30d530
movsd (%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
leaq 0x18a442(%rip), %rax    # 0x21b460
xorpd %xmm0, %xmm0
subsd (%rax), %xmm0
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0xd492e
addsd -0x50(%rbp), %xmm0
xorl %edi, %edi
callq 0xd12da
leaq 0x1ad346(%rip), %r15    # 0x23e390
movq (%r15), %rdi
testq %rdi, %rdi
je 0x910e0
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 0x9316e(%rip), %rsi     # 0x1241e1
xorl %r14d, %r14d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x9560
addq $0x10, %rsp
movq (%r15), %rdi
testq %rdi, %rdi
je 0x910e0
leaq 0x27c610(%rip), %rax    # 0x30d6a4
movl (%rax), %edx
leaq 0x27c5ff(%rip), %rax    # 0x30d69c
movl (%rax), %ecx
leaq 0x27c5fa(%rip), %rax    # 0x30d6a0
movl (%rax), %r8d
leaq 0x27c5f8(%rip), %rax    # 0x30d6a8
movl (%rax), %r9d
leaq 0x27c5f2(%rip), %rax    # 0x30d6ac
movl (%rax), %r10d
leaq 0x27c5ec(%rip), %rax    # 0x30d6b0
movl (%rax), %r11d
leaq 0x9313a(%rip), %rsi     # 0x124208
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x9560
addq $0x10, %rsp
movq (%r15), %r14
leaq 0x27c5bd(%rip), %rax    # 0x30d6a4
movl (%rax), %eax
movl %eax, -0x40(%rbp)
leaq 0x27c5a9(%rip), %rax    # 0x30d69c
movl (%rax), %eax
movl %eax, -0x38(%rbp)
leaq 0x27c5a1(%rip), %rax    # 0x30d6a0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0x27c59d(%rip), %rax    # 0x30d6a8
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq 0x27c595(%rip), %rax    # 0x30d6ac
movl (%rax), %eax
movl %eax, -0x30(%rbp)
leaq 0x27c58d(%rip), %rax    # 0x30d6b0
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
testq %r14, %r14
je 0x9134b
leaq 0x930f7(%rip), %rsi     # 0x12422f
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
jmp 0x9134b
callq 0x810b1
testl %eax, %eax
je 0x911fb
leaq 0x2aa8e3(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x9899
subq $0x8, %rsp
leaq -0x52(%rbp), %r12
leaq -0x42(%rbp), %rcx
leaq -0x58(%rbp), %r13
leaq 0x930c5(%rip), %rsi     # 0x124241
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 0x9360
addq $0x20, %rsp
xorps %xmm1, %xmm1
cvtsi2sdl (%r14), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl (%r15), %xmm2
divsd 0x77e50(%rip), %xmm2    # 0x109008
xorps %xmm0, %xmm0
cvtsi2sdl (%r13), %xmm0
divsd 0x8d5a7(%rip), %xmm0    # 0x11e770
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
cmpb $0x53, (%r12)
jne 0x911e0
xorpd 0x77fd0(%rip), %xmm0    # 0x1091b0
mulsd 0x7a640(%rip), %xmm0    # 0x10b828
divsd 0x7a640(%rip), %xmm0    # 0x10b830
leaq 0x27bdd9(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x912ad
leaq 0x2aa831(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x9899
subq $0x8, %rsp
leaq -0x52(%rbp), %r12
leaq -0x42(%rbp), %rcx
leaq -0x58(%rbp), %r13
leaq 0x93013(%rip), %rsi     # 0x124241
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 0x9360
addq $0x20, %rsp
xorps %xmm1, %xmm1
cvtsi2sdl (%r14), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl (%r15), %xmm2
divsd 0x77d9e(%rip), %xmm2    # 0x109008
xorps %xmm0, %xmm0
cvtsi2sdl (%r13), %xmm0
divsd 0x8d4f5(%rip), %xmm0    # 0x11e770
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
cmpb $0x57, (%r12)
jne 0x91292
xorpd 0x77f1e(%rip), %xmm0    # 0x1091b0
mulsd 0x7a58e(%rip), %xmm0    # 0x10b828
divsd 0x7a58e(%rip), %xmm0    # 0x10b830
leaq 0x27bd2f(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x912cd
leaq 0x2aa783(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x27bd17(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x91794
subq $0x8, %rsp
leaq -0x40(%rbp), %r10
leaq 0x2aa757(%rip), %rdi    # 0x33ba40
leaq 0x8cddc(%rip), %rsi     # 0x11e0cc
leaq -0x3c(%rbp), %rdx
leaq -0x38(%rbp), %r8
leaq -0x42(%rbp), %rcx
movq %rcx, %r9
xorl %eax, %eax
pushq %r10
callq 0x9360
addq $0x10, %rsp
callq 0x810b1
testl %eax, %eax
je 0x91794
subq $0x8, %rsp
leaq -0x2c(%rbp), %r10
leaq 0x2aa718(%rip), %rdi    # 0x33ba40
leaq 0x8cd9d(%rip), %rsi     # 0x11e0cc
leaq -0x34(%rbp), %rdx
leaq -0x30(%rbp), %r8
leaq -0x42(%rbp), %rcx
movq %rcx, %r9
xorl %eax, %eax
pushq %r10
callq 0x9360
addq $0x10, %rsp
movl -0x3c(%rbp), %edx
movl %edx, %eax
xorl $0x63, %eax
movl -0x38(%rbp), %esi
movl %esi, %ecx
xorl $0x63, %ecx
orl %eax, %ecx
jne 0x9136e
movl -0x40(%rbp), %eax
cmpl $0x63, %eax
je 0x91380
cmpl $0x270f, %eax           # imm = 0x270F
je 0x91380
cmpl $0x63, -0x34(%rbp)
jne 0x913ef
cmpl $0x63, -0x30(%rbp)
jne 0x913ef
cmpl $0x63, -0x2c(%rbp)
jne 0x913ef
callq 0xa477
leaq 0x27c33c(%rip), %rax    # 0x30d6c8
movslq (%rax), %rdi
imulq $0x51eb851f, %rdi, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %edi
addl $0x7d0, %edi            # imm = 0x7D0
movl %edi, -0x40(%rbp)
leaq 0x27c308(%rip), %rax    # 0x30d6c0
movl (%rax), %esi
movl %esi, -0x38(%rbp)
leaq 0x27c300(%rip), %rax    # 0x30d6c4
movl (%rax), %edx
movl %edx, -0x3c(%rbp)
leaq 0x27c2fc(%rip), %rax    # 0x30d6cc
movl (%rax), %eax
movl %eax, -0x34(%rbp)
leaq 0x27c2f4(%rip), %rax    # 0x30d6d0
movl (%rax), %eax
movl %eax, -0x30(%rbp)
leaq 0x27c2ec(%rip), %rax    # 0x30d6d4
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x913f2
movl -0x40(%rbp), %edi
callq 0xd485e
movsd %xmm0, -0x50(%rbp)
movl -0x34(%rbp), %edi
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
xorpd %xmm0, %xmm0
callq 0xd492e
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x2e0a88(%rip), %xmm0   # 0x371ea8
movsd %xmm0, -0x70(%rbp)
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
movl $0x2, %edx
callq 0xd492e
movsd -0x50(%rbp), %xmm4
addsd -0x70(%rbp), %xmm0
movapd %xmm4, %xmm2
subsd %xmm0, %xmm2
leaq 0x1acf40(%rip), %rbx    # 0x23e390
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x9149d
movsd 0x2e0a48(%rip), %xmm1   # 0x371ea8
movsd 0x77ba0(%rip), %xmm0    # 0x109008
movapd %xmm2, %xmm3
mulsd %xmm0, %xmm3
mulsd %xmm0, %xmm3
mulsd 0x77bc4(%rip), %xmm3    # 0x109040
leaq 0x90d2b(%rip), %rsi     # 0x1221ae
movapd %xmm4, %xmm0
movb $0x4, %al
movapd %xmm2, -0x70(%rbp)
callq 0x9560
movapd -0x70(%rbp), %xmm2
movsd -0x50(%rbp), %xmm4
movsd 0x2e0a03(%rip), %xmm0   # 0x371ea8
ucomisd %xmm4, %xmm0
seta %cl
leaq 0x189b35(%rip), %rax    # 0x21afe8
movl (%rax), %eax
cmpl $0x4f, %eax
sete %dl
orb %cl, %dl
movl -0x2c(%rbp), %r8d
jne 0x9159e
leaq 0x27bf1e(%rip), %rax    # 0x30d3ec
cmpl $0x0, (%rax)
je 0x91595
cmpl $0x22, %r8d
je 0x91595
andpd 0x77ca7(%rip), %xmm2    # 0x109190
movsd 0x8cd67(%rip), %xmm0    # 0x11e258
ucomisd %xmm2, %xmm0
jb 0x91595
xorpd %xmm0, %xmm0
xorl %edi, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0xd492e
movsd -0x50(%rbp), %xmm1
subsd %xmm0, %xmm1
incl 0x2e0994(%rip)          # 0x371eb0
xorl %edi, %edi
movsd %xmm1, -0x50(%rbp)
movapd %xmm1, %xmm0
callq 0xd12da
leaq 0x27c171(%rip), %rax    # 0x30d6a4
movl (%rax), %eax
movl %eax, -0x40(%rbp)
leaq 0x27c15d(%rip), %rax    # 0x30d69c
movl (%rax), %eax
movl %eax, -0x38(%rbp)
leaq 0x27c155(%rip), %rax    # 0x30d6a0
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0x27c151(%rip), %rax    # 0x30d6a8
movl (%rax), %edx
movl %edx, -0x34(%rbp)
leaq 0x27c149(%rip), %rax    # 0x30d6ac
movl (%rax), %ecx
movl %ecx, -0x30(%rbp)
leaq 0x27c141(%rip), %rax    # 0x30d6b0
movl (%rax), %r8d
movl %r8d, -0x2c(%rbp)
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x91590
leaq 0x92ccb(%rip), %rsi     # 0x124250
xorl %eax, %eax
callq 0x9560
movl -0x2c(%rbp), %r8d
movsd -0x50(%rbp), %xmm4
leaq 0x189a4c(%rip), %rax    # 0x21afe8
movl (%rax), %eax
movsd %xmm4, 0x2e0902(%rip)   # 0x371ea8
cmpl $0x4e, %eax
jne 0x915c6
cmpl 0xd907a(%rip), %r8d     # 0x16a62c
jne 0x915c6
leaq 0x189a35(%rip), %rax    # 0x21aff0
movl $0x1, (%rax)
jmp 0x91794
leaq 0x27be1f(%rip), %rax    # 0x30d3ec
cmpl $0x0, (%rax)
jne 0x915df
cmpl %r8d, 0xd9053(%rip)     # 0x16a62c
je 0x91794
movl %r8d, 0xd9046(%rip)     # 0x16a62c
movl -0x40(%rbp), %eax
leaq 0x27bf24(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
movl -0x38(%rbp), %eax
leaq 0x27bf14(%rip), %rcx    # 0x30d510
movl %eax, (%rcx)
movl -0x3c(%rbp), %eax
leaq 0x27bf04(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
movl -0x34(%rbp), %eax
leaq 0x27bef4(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
movl -0x30(%rbp), %eax
leaq 0x27bee4(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
leaq 0x27bed7(%rip), %r14    # 0x30d500
movl %r8d, (%r14)
leaq 0x27bee5(%rip), %rax    # 0x30d518
movq $0x0, (%rax)
leaq 0x27be7c(%rip), %rax    # 0x30d4bd
cmpb $0x0, (%rax)
je 0x91651
xorpd %xmm0, %xmm0
callq 0x5c7ed
jmp 0x9167b
leaq 0x27c0d0(%rip), %rax    # 0x30d728
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
callq 0x5c7ed
leaq 0x27be39(%rip), %rax    # 0x30d4a4
andb $-0x2, (%rax)
leaq 0x27bd57(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
leaq 0x27be46(%rip), %rax    # 0x30d4c8
movl (%rax), %eax
movl %eax, %edx
xorl $0x21, %edx
movl 0xd8ce1(%rip), %ecx     # 0x16a370
movl %ecx, %esi
xorl $0x22, %esi
orl %edx, %esi
jne 0x916b8
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x916c1
leaq 0x92bd3(%rip), %rdi     # 0x12427a
movl $0x1d, %esi
movl $0x1, %edx
callq 0x9750
jmp 0x916c1
cmpl %ecx, %eax
je 0x916c1
callq 0x730e8
movl (%r14), %eax
cmpl $0x20, %eax
jne 0x91743
leaq 0x189918(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x916f4
leaq 0x92bbc(%rip), %rdi     # 0x124298
movl $0xcd, %esi
callq 0x5edda
leaq 0x92bb9(%rip), %rdi     # 0x1242a6
movl $0xce, %esi
jmp 0x91711
leaq 0x92bb5(%rip), %rdi     # 0x1242b0
movl $0xce, %esi
callq 0x5edda
leaq 0x92b8c(%rip), %rdi     # 0x124298
movl $0xcd, %esi
callq 0x5edda
movl (%r14), %eax
cmpl $0x20, %eax
jne 0x91743
callq 0xae92
addsd 0x7790d(%rip), %xmm0    # 0x109038
leaq 0x27bfc6(%rip), %rax    # 0x30d6f8
movsd %xmm0, (%rax)
movl $0x0, 0x2e0718(%rip)    # 0x371e58
movl (%r14), %eax
cmpl $0x21, %eax
jne 0x9176d
callq 0xae92
addsd 0x778e3(%rip), %xmm0    # 0x109038
leaq 0x27bf9c(%rip), %rax    # 0x30d6f8
movsd %xmm0, (%rax)
movl $0x0, 0x2e06ee(%rip)    # 0x371e58
movl (%r14), %eax
cmpl $0x22, %eax
jne 0x91794
callq 0xae92
addsd 0x778b9(%rip), %xmm0    # 0x109038
leaq 0x27bf72(%rip), %rax    # 0x30d6f8
movsd %xmm0, (%rax)
movl $0x0, 0x2e06c4(%rip)    # 0x371e58
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq