// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: moon_posn(double)
void moon_posn(double jd_tt)
{
//************************************************************************************
//   Moon positions to a few minutes of arc
//   Derived from code by Paul Schlyter at
//       http://hotel04.ausys.se/pausch/comp/ppcomp.html
//
double Nm;
double im;
double wm;
double am;
double ecm;
double Mm;

double Ns;
double isun;
double ws;
double asun;
double ecs;
double Ms;

double Em;
double xv;
double yv;
double vm;
double rm;
double xh;
double yh;
double zh;

double mlon;
double mlat;

double dlon;
double dlat;

double Ls;
double Lm;
double dm;
double F;

double xg;
double yg;
double zg;

double ecl;
double xe;
double ye;
double ze;

double geora, geodec;        // geocentric ra and dec
double ra, dec;              // topocentric ra and dec
double xtop,ytop,ztop, rtop;

double cosha;     // for converting RA/DEC to az/el
double sinha;
double cosd;
double sind;
double cosl;
double sinl;


//
//   the time should be TT/TDT, but UT will do
//

double d;
double h;

double lst;
double ha;
double jd;

   // NOTE: Epoch used here is NOT J2000
   if(0) {
      h = jtime(hours,minutes,seconds,raw_frac);
      h += utc_delta_t();
      d = jd = jdate(year,month,day) + h;
   }
   else {
      d = jd = jd_tt;
      h = (d-0.50) - (int) (d-0.50);
   }

   d = jd - jdate(1999,12,31);
   h *= 24.0;  // convert fractional days to hours


//   moon elements

   Nm = FNrange((125.1228 - .0529538083 * d) * DEG_TO_RAD);
   im = 5.1454 * DEG_TO_RAD;
   wm = FNrange((318.0634 + .1643573223 * d) * DEG_TO_RAD);
   am = 60.2666;  // (Earth radii)
   ecm = .0549;
   Mm = FNrange((115.3654 + 13.0649929509 * d) * DEG_TO_RAD);

//   sun elements
   Ns = 0.0;
   isun = 0.0;
   ws = FNrange((282.9404 + 4.70935E-05 * d) * DEG_TO_RAD);
   asun = 1.0;        //(AU)
   ecs = .016709 - 1.151E-09 * d;
   Ms = FNrange((356.047 + .9856002585 * d) * DEG_TO_RAD);

//   position of Moon
   Em = Mm + ecm * sin(Mm) * (1.0 + ecm * cos(Mm));
   xv = am * (cos(Em) - ecm);
   yv = am * (sqrt(1.0 - ecm * ecm) * sin(Em));
   vm = FNatn2(yv, xv);
   rm = sqrt(xv * xv + yv * yv);
   xh = rm * (cos(Nm) * cos(vm + wm) - sin(Nm) * sin(vm + wm) * cos(im));
   yh = rm * (sin(Nm) * cos(vm + wm) + cos(Nm) * sin(vm + wm) * cos(im));
   zh = rm * (sin(vm + wm) * sin(im));

//   moons geocentric lon and lat
   mlon = FNatn2(yh, xh);
   mlat = FNatn2(zh, sqrt(xh*xh + yh*yh));

//   perturbations:
//   first calculate arguments below, which should be in radians
//   Ms, Mm   Mean Anomaly of the Sun and the Moon
//   Nm       Longitude of the Moon's node
//   ws, wm   Argument of perihelion for the Sun and the Moon
   Ls = Ms + ws;       //Mean Longitude of the Sun  (Ns=0)
   Lm = Mm + wm + Nm;  //Mean longitude of the Moon
   dm = Lm - Ls;       //Mean elongation of the Moon
   F = Lm - Nm;        //Argument of latitude for the Moon

// then add the following terms to the longitude
// note amplitudes are in degrees, convert at end
   dlon = -1.274 * sin(Mm - 2.0 * dm);        //(the Evection)
   dlon = dlon + .658 * sin(2.0 * dm);        //(the Variation)
   dlon = dlon - .186 * sin(Ms);            //(the Yearly Equation)
   dlon = dlon - .059 * sin(2.0 * Mm - 2.0 * dm);
   dlon = dlon - .057 * sin(Mm - 2.0 * dm + Ms);
   dlon = dlon + .053 * sin(Mm + 2.0 * dm);
   dlon = dlon + .046 * sin(2.0 * dm - Ms);
   dlon = dlon + .041 * sin(Mm - Ms);
   dlon = dlon - .035 * sin(dm);            //(the Parallactic Equation)
   dlon = dlon - .031 * sin(Mm + Ms);
   dlon = dlon - .015 * sin(2.0 * F - 2.0 * dm);
   dlon = dlon + .011 * sin(Mm - 4.0 * dm);
   mlon = dlon * DEG_TO_RAD + mlon;

//   latitude terms
   dlat = -.173 * sin(F - 2.0 * dm);
   dlat = dlat - .055 * sin(Mm - F - 2.0 * dm);
   dlat = dlat - .046 * sin(Mm + F - 2.0 * dm);
   dlat = dlat + .033 * sin(F + 2.0 * dm);
   dlat = dlat + .017 * sin(2.0 * Mm + F);
   mlat = dlat * DEG_TO_RAD + mlat;

   moon_phase_acc = (1.0 - cos((mlon*180.0/PI-sun_hlon)*DEG_TO_RAD))/2.0;

//   distance terms earth radii
   rm = rm - .58 * cos(Mm - 2.0 * dm);
   rm = rm - .46 * cos(2.0 * dm);

   moon_lat = fmod(mlat*180.0/PI, 360.0);
   if(moon_lat < 0.0) moon_lat += 360.0;
   moon_lon = fmod(mlon*180.0/PI, 360.0);
   if(moon_lon < 0.0) moon_lon += 360.0;
   moon_dist = rm * earth_radius(lat, alt)*1000.0;
//sprintf(debug_text, "moon lla: %.9f %.9f %.9f", moon_lat, moon_lon, moon_dist);

//   next find the cartesian coordinates
//   of the geocentric lunar position
   xg = rm * cos(mlon) * cos(mlat);
   yg = rm * sin(mlon) * cos(mlat);
   zg = rm * sin(mlat);
//sprintf(debug_text2, "xyzg: %.9f %.9f %.9f", xg*EQU_RADIUS,yg*EQU_RADIUS,zg*EQU_RADIUS);

//   rotate to equatorial coords
//   obliquity of ecliptic of date
// ecl = (23.4393 - 3.563E-07 * d) * DEG_TO_RAD;
   ecl = obliquity(jd, 1);
   xe = xg;
   ye = yg * cos(ecl) - zg * sin(ecl);
   ze = yg * sin(ecl) + zg * cos(ecl);
//sprintf(plot_title, "xyze: %.9f %.9f %.9f", xe*EQU_RADIUS,ye*EQU_RADIUS,ze*EQU_RADIUS);

//   geocentric RA and Dec
   geora = FNatn2(ye,xe) * RAD_TO_DEG / 15.0;
   if(xe || ye) geodec = atan(ze / sqrt(xe*xe + ye*ye)) * RAD_TO_DEG;
   else geodec = 1.0;


   // Calculate local sidereal time.
   // We adjust d by -1.5 days since d's epoch is NOT J2000 and this equation
   // assumes J2000
   lst = 100.46 + (.985647352 * (d-1.50)) + (h * 15.0) + lon*RAD_TO_DEG;
   lst = FNrange(lst*DEG_TO_RAD)*RAD_TO_DEG;
//lst =  lmst(jd_tt, 0)*15.0;
//// while(lst < 0.0) lst += 360.0;
//// while(lst > 360.0) lst -= 360.0;

   
   // calculate the moon's topocentric coords
   xtop = xe - cos(lat) * cos(lst*DEG_TO_RAD);
   ytop = ye - cos(lat) * sin(lst*DEG_TO_RAD);
   ztop = ze - sin(lat);
//sprintf(debug_text, "xyztop: %.9f %.9f %.9f", xtop,ytop,ztop);
   rtop = sqrt(xtop * xtop + ytop * ytop + ztop * ztop);
   ra = FNatn2(ytop, xtop) * RAD_TO_DEG;
   if(xtop || ytop) dec = atan(ztop / sqrt(xtop * xtop + ytop * ytop));
   else dec = 1.0;

   // convert ra and dec to az and el 
   ha = (lst - ra) * DEG_TO_RAD;
   cosha = cos(ha);
   sinha = sin(ha);
   cosd = cos(dec);
   sind = sin(dec);
   cosl = cos(lat);
   sinl = sin(lat);

   moon_az = atan2(-cosd*sinha, cosl*sind - sinl*cosd*cosha) * RAD_TO_DEG;
   if(moon_az < 0.0) moon_az = 360.0 + moon_az;

   moon_el = asin(sinl*sind + cosl*cosd*cosha);
   moon_el *= RAD_TO_DEG;

   set_sat_azel(MOON_PRN, (float) moon_az, (float) moon_el);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xe8, %rsp
movsd %xmm0, -0xc8(%rbp)
movsd 0x246fa(%rip), %xmm1    # 0x10b988
addsd %xmm0, %xmm1
cvttpd2dq %xmm1, %xmm2
cvtdq2pd %xmm2, %xmm2
subsd %xmm2, %xmm1
movsd 0x44ac2(%rip), %xmm7    # 0x12bd68
addsd %xmm0, %xmm7
mulsd 0x21d8e(%rip), %xmm1    # 0x109040
movapd %xmm1, -0xf0(%rbp)
movsd 0x44aae(%rip), %xmm2    # 0x12bd70
mulsd %xmm7, %xmm2
addsd 0x44aaa(%rip), %xmm2    # 0x12bd78
movsd 0x2463a(%rip), %xmm0    # 0x10b910
mulsd %xmm0, %xmm2
movapd %xmm0, %xmm9
movsd 0x36e99(%rip), %xmm6    # 0x11e180
divsd %xmm6, %xmm2
movapd 0x21e9d(%rip), %xmm1    # 0x109190
movapd %xmm2, %xmm0
andpd %xmm1, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm3
xorpd %xmm11, %xmm11
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movsd 0x21dde(%rip), %xmm10   # 0x1090f8
movapd %xmm4, %xmm5
andpd %xmm10, %xmm5
movsd 0x21d44(%rip), %xmm8    # 0x109070
andnpd %xmm8, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm4, %xmm2
addsd %xmm6, %xmm2
movapd %xmm4, %xmm3
cmpltsd %xmm11, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm4, %xmm3
orpd %xmm2, %xmm3
movapd %xmm3, -0x20(%rbp)
movsd 0x44a14(%rip), %xmm2    # 0x12bd80
mulsd %xmm7, %xmm2
addsd 0x44a10(%rip), %xmm2    # 0x12bd88
mulsd %xmm9, %xmm2
divsd %xmm6, %xmm2
movapd %xmm2, %xmm3
andpd %xmm1, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movapd %xmm4, %xmm5
andpd %xmm10, %xmm5
andnpd %xmm8, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm4, %xmm2
addsd %xmm6, %xmm2
movapd %xmm4, %xmm3
cmpltsd %xmm11, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm4, %xmm3
orpd %xmm2, %xmm3
movapd %xmm3, -0x70(%rbp)
movsd 0x449ad(%rip), %xmm2    # 0x12bd90
mulsd %xmm7, %xmm2
addsd 0x449a9(%rip), %xmm2    # 0x12bd98
mulsd %xmm9, %xmm2
divsd %xmm6, %xmm2
movapd %xmm2, %xmm3
andpd %xmm1, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movapd %xmm4, %xmm5
andpd %xmm10, %xmm5
andnpd %xmm8, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm4, %xmm2
addsd %xmm6, %xmm2
movapd %xmm4, %xmm3
cmpltsd %xmm11, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm4, %xmm3
orpd %xmm2, %xmm3
movapd %xmm3, %xmm0
movapd %xmm3, -0x30(%rbp)
movsd 0x44942(%rip), %xmm2    # 0x12bda0
mulsd %xmm7, %xmm2
addsd 0x4493e(%rip), %xmm2    # 0x12bda8
mulsd %xmm9, %xmm2
divsd %xmm6, %xmm2
movapd %xmm2, %xmm3
andpd %xmm1, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movapd %xmm4, %xmm5
andpd %xmm10, %xmm5
andnpd %xmm8, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm4, %xmm2
addsd %xmm6, %xmm2
movapd %xmm4, %xmm3
cmpltsd %xmm11, %xmm3
andpd %xmm3, %xmm2
movapd %xmm3, %xmm5
movsd 0x448e4(%rip), %xmm3    # 0x12bdb0
movsd %xmm7, -0xd0(%rbp)
mulsd %xmm7, %xmm3
addsd 0x448d8(%rip), %xmm3    # 0x12bdb8
andnpd %xmm4, %xmm5
mulsd %xmm9, %xmm3
divsd %xmm6, %xmm3
andpd %xmm3, %xmm1
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
orpd %xmm2, %xmm5
movapd %xmm5, -0xb0(%rbp)
xorpd %xmm2, %xmm2
cmplesd %xmm3, %xmm2
andpd %xmm2, %xmm10
andnpd %xmm8, %xmm2
orpd %xmm10, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm6, %xmm2
movapd %xmm2, %xmm3
addsd %xmm6, %xmm3
movapd %xmm2, %xmm1
cmpltsd %xmm11, %xmm1
andpd %xmm1, %xmm3
andnpd %xmm2, %xmm1
orpd %xmm3, %xmm1
movapd %xmm1, -0x40(%rbp)
callq 0x9080
mulsd 0x447e7(%rip), %xmm0    # 0x12bd40
movsd %xmm0, -0x60(%rbp)
movapd -0x30(%rbp), %xmm0
callq 0x9710
movapd %xmm0, %xmm1
mulsd 0x447cc(%rip), %xmm1    # 0x12bd40
movsd 0x21af4(%rip), %xmm0    # 0x109070
addsd %xmm0, %xmm1
mulsd -0x60(%rbp), %xmm1
addsd -0x30(%rbp), %xmm1
movsd %xmm1, -0x60(%rbp)
movapd %xmm1, %xmm0
callq 0x9710
addsd 0x44820(%rip), %xmm0    # 0x12bdc0
mulsd 0x44820(%rip), %xmm0    # 0x12bdc8
movsd %xmm0, -0x48(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x44811(%rip), %xmm0    # 0x12bdd0
mulsd 0x44801(%rip), %xmm0    # 0x12bdc8
movsd %xmm0, -0x90(%rbp)
divsd -0x48(%rbp), %xmm0
callq 0x92d0
movsd 0x24247(%rip), %xmm4    # 0x10b828
movsd -0x48(%rbp), %xmm5
movapd %xmm5, %xmm1
xorpd %xmm3, %xmm3
cmpltsd %xmm3, %xmm1
movapd %xmm1, %xmm2
andnpd %xmm0, %xmm2
addsd %xmm4, %xmm0
andpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movapd %xmm0, %xmm2
addsd %xmm4, %xmm2
addsd %xmm4, %xmm2
movsd -0x90(%rbp), %xmm4
movapd %xmm4, %xmm1
cmpltsd %xmm3, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm5, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
movapd %xmm2, -0x60(%rbp)
movapd %xmm4, %xmm1
mulsd %xmm4, %xmm1
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0x90(%rbp)
movapd -0x60(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
movapd %xmm0, -0x60(%rbp)
callq 0x9710
movsd %xmm0, -0x78(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0xa0(%rbp)
movapd -0x60(%rbp), %xmm0
callq 0x9080
mulsd -0xa0(%rbp), %xmm0
mulsd 0x4471c(%rip), %xmm0    # 0x12bdd8
movsd -0x78(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm1
addsd %xmm0, %xmm1
mulsd -0x48(%rbp), %xmm1
movsd %xmm1, -0x78(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x90(%rbp)
movaps -0x60(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0xa0(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0xc0(%rbp)
movapd -0x60(%rbp), %xmm0
callq 0x9080
mulsd -0xc0(%rbp), %xmm0
mulsd 0x446bc(%rip), %xmm0    # 0x12bde0
movsd -0xa0(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm1
addsd %xmm0, %xmm1
mulsd -0x48(%rbp), %xmm1
movsd %xmm1, -0xa0(%rbp)
movapd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x44691(%rip), %xmm0    # 0x12bde8
mulsd -0x48(%rbp), %xmm0
movapd %xmm0, -0x90(%rbp)
movsd -0xa0(%rbp), %xmm0
divsd -0x78(%rbp), %xmm0
callq 0x92d0
movsd -0x78(%rbp), %xmm5
movapd %xmm5, %xmm1
xorpd %xmm3, %xmm3
cmpltsd %xmm3, %xmm1
movapd %xmm1, %xmm2
andnpd %xmm0, %xmm2
movsd 0x24090(%rip), %xmm4    # 0x10b828
addsd %xmm4, %xmm0
andpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movapd %xmm0, %xmm2
addsd %xmm4, %xmm2
addsd %xmm4, %xmm2
movsd -0xa0(%rbp), %xmm4
movapd %xmm4, %xmm1
cmpltsd %xmm3, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm5, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
movapd %xmm2, -0xc0(%rbp)
movapd %xmm4, %xmm1
mulsd %xmm4, %xmm1
movapd %xmm5, %xmm0
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
movapd -0x90(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x92d0
movapd %xmm0, %xmm1
movsd 0x24001(%rip), %xmm2    # 0x10b828
addsd %xmm2, %xmm1
addsd %xmm2, %xmm1
xorpd %xmm2, %xmm2
cmpltsd -0x60(%rbp), %xmm2
movapd %xmm2, %xmm3
andnpd %xmm0, %xmm3
andpd %xmm1, %xmm2
orpd %xmm3, %xmm2
movapd -0x90(%rbp), %xmm1
cmpltsd 0x218be(%rip), %xmm1    # 0x109118
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movapd %xmm1, -0x90(%rbp)
movapd -0xb0(%rbp), %xmm3
addsd -0x40(%rbp), %xmm3
movapd -0x70(%rbp), %xmm0
movapd -0x30(%rbp), %xmm1
addsd %xmm1, %xmm0
movapd -0x20(%rbp), %xmm2
addsd %xmm2, %xmm0
movapd %xmm0, %xmm4
subsd %xmm3, %xmm4
movapd %xmm4, -0xa0(%rbp)
subsd %xmm2, %xmm0
movapd %xmm0, -0x70(%rbp)
movsd 0x2416d(%rip), %xmm0    # 0x10ba20
mulsd %xmm4, %xmm0
movsd %xmm0, -0x78(%rbp)
addsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0x9080
mulsd 0x4451b(%rip), %xmm0    # 0x12bdf0
movsd %xmm0, -0x20(%rbp)
movapd -0xa0(%rbp), %xmm0
addsd %xmm0, %xmm0
movapd %xmm0, -0x60(%rbp)
callq 0x9080
mulsd 0x44500(%rip), %xmm0    # 0x12bdf8
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x40(%rbp), %xmm0
callq 0x9080
mulsd 0x444ec(%rip), %xmm0    # 0x12be00
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x30(%rbp), %xmm0
addsd %xmm0, %xmm0
movapd %xmm0, -0xe0(%rbp)
subsd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x444c7(%rip), %xmm0    # 0x12be08
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x40(%rbp), %xmm0
addsd -0xb0(%rbp), %xmm0
callq 0x9080
mulsd 0x444ab(%rip), %xmm0    # 0x12be10
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x60(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x44492(%rip), %xmm0    # 0x12be18
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x60(%rbp), %xmm0
subsd -0x40(%rbp), %xmm0
callq 0x9080
mulsd 0x44479(%rip), %xmm0    # 0x12be20
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x30(%rbp), %xmm0
subsd -0x40(%rbp), %xmm0
callq 0x9080
mulsd 0x44460(%rip), %xmm0    # 0x12be28
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0xa0(%rbp), %xmm0
callq 0x9080
mulsd 0x44449(%rip), %xmm0    # 0x12be30
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x40(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x44430(%rip), %xmm0    # 0x12be38
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movapd -0x70(%rbp), %xmm0
addsd %xmm0, %xmm0
subsd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x44413(%rip), %xmm0    # 0x12be40
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movapd -0xa0(%rbp), %xmm0
mulsd 0x44401(%rip), %xmm0    # 0x12be48
addsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x443f7(%rip), %xmm0    # 0x12be50
addsd -0x40(%rbp), %xmm0
mulsd 0x23eaa(%rip), %xmm0    # 0x10b910
addsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x78(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
callq 0x9080
mulsd 0x443ce(%rip), %xmm0    # 0x12be58
movsd %xmm0, -0x40(%rbp)
movapd -0x30(%rbp), %xmm0
subsd -0x70(%rbp), %xmm0
addsd -0x78(%rbp), %xmm0
callq 0x9080
mulsd 0x443b5(%rip), %xmm0    # 0x12be60
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movapd -0x30(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
addsd -0x78(%rbp), %xmm0
callq 0x9080
mulsd 0x44397(%rip), %xmm0    # 0x12be68
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movapd -0x60(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
callq 0x9080
mulsd 0x4437e(%rip), %xmm0    # 0x12be70
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movapd -0xe0(%rbp), %xmm0
addsd -0x70(%rbp), %xmm0
callq 0x9080
mulsd 0x44362(%rip), %xmm0    # 0x12be78
addsd -0x30(%rbp), %xmm0
movsd 0x23ded(%rip), %xmm1    # 0x10b910
mulsd %xmm1, %xmm0
addsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
mulsd 0x23cef(%rip), %xmm0    # 0x10b830
divsd 0x23cdf(%rip), %xmm0    # 0x10b828
movsd %xmm0, -0x70(%rbp)
subsd 0x292212(%rip), %xmm0   # 0x379d68
mulsd %xmm1, %xmm0
callq 0x9710
movsd 0x21509(%rip), %xmm1    # 0x109070
movaps %xmm1, -0x90(%rbp)
movsd 0x214fa(%rip), %xmm1    # 0x109070
subsd %xmm0, %xmm1
mulsd 0x214e6(%rip), %xmm1    # 0x109068
movsd %xmm1, 0x2921d6(%rip)   # 0x379d60
movsd -0xb0(%rbp), %xmm0
callq 0x9710
mulsd 0x442e1(%rip), %xmm0    # 0x12be80
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movapd -0x60(%rbp), %xmm0
callq 0x9710
mulsd 0x442cd(%rip), %xmm0    # 0x12be88
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x23c63(%rip), %xmm0    # 0x10b830
mulsd -0x30(%rbp), %xmm0
divsd 0x23c4e(%rip), %xmm0    # 0x10b828
movsd 0x36556(%rip), %xmm1    # 0x11e138
callq 0x94d0
movapd %xmm0, %xmm3
movsd 0x36545(%rip), %xmm1    # 0x11e138
addsd %xmm1, %xmm3
movapd %xmm0, %xmm2
cmpltsd 0x21514(%rip), %xmm2    # 0x109118
andpd %xmm2, %xmm3
andnpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, 0x293840(%rip)   # 0x37b458
movsd -0x70(%rbp), %xmm0
callq 0x94d0
movsd 0x3650e(%rip), %xmm2    # 0x11e138
addsd %xmm0, %xmm2
movapd %xmm0, %xmm1
cmpltsd 0x214dd(%rip), %xmm1    # 0x109118
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movlpd %xmm1, 0x293811(%rip)   # 0x37b460
leaq 0x22537a(%rip), %rbx    # 0x30cfd0
movsd (%rbx), %xmm0
leaq 0x22537f(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm1
callq 0xe80f9
mulsd -0x40(%rbp), %xmm0
mulsd 0x213c1(%rip), %xmm0    # 0x109038
movsd %xmm0, 0x2937e9(%rip)   # 0x37b468
movsd -0x20(%rbp), %xmm0
callq 0x9710
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9710
mulsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x9080
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9710
mulsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0xc8(%rbp), %xmm0
movl $0x1, %edi
callq 0xe1215
movsd %xmm0, -0x40(%rbp)
callq 0x9710
movaps %xmm0, -0x30(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x9080
mulsd -0x48(%rbp), %xmm0
movapd -0x30(%rbp), %xmm1
mulsd -0x20(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x60(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x9710
mulsd -0x48(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
mulsd -0x20(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
movapd -0x30(%rbp), %xmm0
divsd -0x70(%rbp), %xmm0
callq 0x92d0
xorpd %xmm0, %xmm0
movsd -0x70(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0xe7d83
jp 0xe7d83
movapd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jne 0xe7d83
jnp 0xe7dab
movapd -0x30(%rbp), %xmm0
mulsd %xmm0, %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
sqrtsd %xmm1, %xmm1
movsd -0x60(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x92d0
movsd -0xd0(%rbp), %xmm0
addsd 0x440d5(%rip), %xmm0    # 0x12be90
mulsd 0x440d5(%rip), %xmm0    # 0x12be98
addsd 0x440d5(%rip), %xmm0    # 0x12bea0
movapd -0xf0(%rbp), %xmm1
mulsd 0x3675d(%rip), %xmm1    # 0x11e538
addsd %xmm0, %xmm1
leaq 0x2251f2(%rip), %rax    # 0x30cfd8
movsd 0x21372(%rip), %xmm3    # 0x109160
movsd (%rax), %xmm0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
movsd 0x23b0e(%rip), %xmm1    # 0x10b910
mulsd %xmm1, %xmm0
movsd 0x36372(%rip), %xmm2    # 0x11e180
divsd %xmm2, %xmm0
xorpd %xmm4, %xmm4
xorl %eax, %eax
ucomisd %xmm4, %xmm0
movapd 0x2136c(%rip), %xmm1    # 0x109190
andpd %xmm0, %xmm1
cvttpd2dq %xmm1, %xmm1
setae %al
cvtdq2pd %xmm1, %xmm1
leaq 0x250b6(%rip), %rcx     # 0x10cef0
mulsd (%rcx,%rax,8), %xmm1
addsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm1, %xmm2
movapd %xmm1, %xmm0
cmpltsd %xmm4, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm1, %xmm0
orpd %xmm2, %xmm0
mulsd %xmm3, %xmm0
movapd %xmm0, -0x40(%rbp)
movsd (%rbx), %xmm0
callq 0x9710
movsd %xmm0, -0x48(%rbp)
movsd 0x23a91(%rip), %xmm0    # 0x10b910
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x9710
mulsd -0x48(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x70(%rbp)
movsd (%rbx), %xmm0
callq 0x9710
movsd %xmm0, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x9080
mulsd -0x48(%rbp), %xmm0
movapd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
movsd (%rbx), %xmm0
callq 0x9080
movsd %xmm0, -0x20(%rbp)
movapd -0x30(%rbp), %xmm0
divsd -0x70(%rbp), %xmm0
callq 0x92d0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm6
movsd -0x70(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jne 0xe7f0b
jp 0xe7f0b
movapd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jne 0xe7f0b
jnp 0xe7f4a
movapd -0x30(%rbp), %xmm0
mulsd %xmm0, %xmm0
movsd -0x70(%rbp), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
subsd -0x20(%rbp), %xmm0
sqrtsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movapd %xmm6, -0x60(%rbp)
callq 0x92d0
movapd -0x60(%rbp), %xmm6
movapd %xmm0, -0x90(%rbp)
movapd %xmm6, %xmm0
movsd 0x238d2(%rip), %xmm2    # 0x10b828
addsd %xmm2, %xmm0
xorpd %xmm4, %xmm4
movsd -0x70(%rbp), %xmm3
movapd %xmm3, %xmm1
cmpltsd %xmm4, %xmm1
xorpd %xmm5, %xmm5
andpd %xmm1, %xmm0
andnpd %xmm6, %xmm1
orpd %xmm0, %xmm1
movapd %xmm1, %xmm0
addsd %xmm2, %xmm0
addsd %xmm2, %xmm0
movapd -0x30(%rbp), %xmm4
cmpltsd %xmm5, %xmm4
movapd %xmm4, %xmm2
andnpd %xmm1, %xmm2
andpd %xmm0, %xmm4
orpd %xmm2, %xmm4
xorpd %xmm2, %xmm2
cmpltsd %xmm3, %xmm2
andpd %xmm2, %xmm4
andnpd %xmm1, %xmm2
orpd %xmm4, %xmm2
movsd 0x211a1(%rip), %xmm1    # 0x109160
mulsd %xmm1, %xmm2
movapd -0x40(%rbp), %xmm0
subsd %xmm2, %xmm0
mulsd 0x2393c(%rip), %xmm0    # 0x10b910
movapd %xmm0, -0x40(%rbp)
callq 0x9710
movsd %xmm0, -0x30(%rbp)
movaps -0x40(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x48(%rbp)
movaps -0x90(%rbp), %xmm0
callq 0x9710
movaps %xmm0, -0x60(%rbp)
movaps -0x90(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x70(%rbp)
movsd (%rbx), %xmm0
callq 0x9710
movsd %xmm0, -0x40(%rbp)
movsd (%rbx), %xmm0
callq 0x9080
movapd %xmm0, %xmm3
movsd %xmm0, -0x20(%rbp)
movapd 0x21176(%rip), %xmm0    # 0x1091b0
movapd -0x60(%rbp), %xmm2
xorpd %xmm2, %xmm0
mulsd -0x48(%rbp), %xmm0
mulsd %xmm3, %xmm2
mulsd -0x30(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
subsd %xmm2, %xmm1
callq 0x9050
mulsd 0x210f4(%rip), %xmm0    # 0x109160
movsd 0x360c4(%rip), %xmm1    # 0x11e138
addsd %xmm0, %xmm1
movapd %xmm0, %xmm2
cmpltsd 0x21093(%rip), %xmm2    # 0x109118
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
leaq 0x225750(%rip), %rbx    # 0x30d7e8
movlpd %xmm2, (%rbx)
movapd -0x60(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x9660
xorps %xmm2, %xmm2
cvtsd2ss (%rbx), %xmm2
mulsd 0x2108f(%rip), %xmm0    # 0x109160
leaq 0x225718(%rip), %rax    # 0x30d7f0
xorps %xmm1, %xmm1
cvtsd2ss %xmm0, %xmm1
movsd %xmm0, (%rax)
movl $0x3e9, %edi            # imm = 0x3E9
movaps %xmm2, %xmm0
addq $0xe8, %rsp
popq %rbx
popq %rbp
jmp 0x5ace1