// File: /workspace/github_cpp_makefile_star2_O1/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 0x4554f(%rip), %xmm8    # 0x12bc88
addsd %xmm0, %xmm8
movsd 0x4554a(%rip), %xmm2    # 0x12bc90
mulsd %xmm8, %xmm2
addsd 0x45545(%rip), %xmm2    # 0x12bc98
movsd 0x251ad(%rip), %xmm6    # 0x10b908
mulsd %xmm6, %xmm2
movsd 0x37971(%rip), %xmm7    # 0x11e0d8
divsd %xmm7, %xmm2
movapd 0x22a0c(%rip), %xmm9    # 0x109180
movapd %xmm2, %xmm1
andpd %xmm9, %xmm1
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm3
xorpd %xmm10, %xmm10
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movsd 0x2295d(%rip), %xmm1    # 0x1090f8
movapd %xmm4, %xmm5
andpd %xmm1, %xmm5
movsd 0x228c4(%rip), %xmm11   # 0x109070
andnpd %xmm11, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm7, %xmm4
movapd %xmm4, %xmm2
addsd %xmm7, %xmm2
movapd %xmm4, %xmm3
cmpltsd %xmm10, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm4, %xmm3
orpd %xmm2, %xmm3
movapd %xmm3, -0x20(%rbp)
movsd 0x454b4(%rip), %xmm2    # 0x12bca0
mulsd %xmm8, %xmm2
addsd 0x454af(%rip), %xmm2    # 0x12bca8
mulsd %xmm6, %xmm2
divsd %xmm7, %xmm2
movapd %xmm2, %xmm3
andpd %xmm9, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movapd %xmm4, %xmm5
andpd %xmm1, %xmm5
andnpd %xmm11, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm7, %xmm4
movapd %xmm4, %xmm2
addsd %xmm7, %xmm2
movapd %xmm4, %xmm3
cmpltsd %xmm10, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm4, %xmm3
orpd %xmm2, %xmm3
movapd %xmm3, -0x60(%rbp)
movsd 0x4544d(%rip), %xmm2    # 0x12bcb0
mulsd %xmm8, %xmm2
addsd 0x45448(%rip), %xmm2    # 0x12bcb8
mulsd %xmm6, %xmm2
divsd %xmm7, %xmm2
movapd %xmm2, %xmm3
andpd %xmm9, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
xorpd %xmm4, %xmm4
cmplesd %xmm2, %xmm4
movapd %xmm4, %xmm5
andpd %xmm1, %xmm5
andnpd %xmm11, %xmm4
orpd %xmm5, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
mulsd %xmm7, %xmm4
movapd %xmm4, %xmm2
addsd %xmm7, %xmm2
movapd %xmm4, %xmm5
cmpltsd %xmm10, %xmm5
andpd %xmm5, %xmm2
andnpd %xmm4, %xmm5
orpd %xmm2, %xmm5
movapd %xmm5, -0x40(%rbp)
movsd 0x453e6(%rip), %xmm2    # 0x12bcc0
mulsd %xmm8, %xmm2
addsd 0x453e1(%rip), %xmm2    # 0x12bcc8
mulsd %xmm6, %xmm2
divsd %xmm7, %xmm2
xorpd %xmm3, %xmm3
cmplesd %xmm2, %xmm3
movapd %xmm3, %xmm4
andpd %xmm1, %xmm4
andnpd %xmm11, %xmm3
orpd %xmm4, %xmm3
movapd %xmm2, %xmm4
andpd %xmm9, %xmm4
cvttpd2dq %xmm4, %xmm4
cvtdq2pd %xmm4, %xmm4
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
mulsd %xmm7, %xmm3
movapd %xmm3, %xmm2
addsd %xmm7, %xmm2
movapd %xmm3, %xmm4
cmpltsd %xmm10, %xmm4
andpd %xmm4, %xmm2
andnpd %xmm3, %xmm4
orpd %xmm2, %xmm4
movapd %xmm4, -0xb0(%rbp)
movsd 0x4537c(%rip), %xmm2    # 0x12bcd0
movsd %xmm8, -0xe8(%rbp)
mulsd %xmm8, %xmm2
addsd 0x4536e(%rip), %xmm2    # 0x12bcd8
mulsd %xmm6, %xmm2
divsd %xmm7, %xmm2
xorpd %xmm3, %xmm3
cmplesd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm11, %xmm3
orpd %xmm1, %xmm3
andpd %xmm2, %xmm9
cvttpd2dq %xmm9, %xmm1
cvtdq2pd %xmm1, %xmm1
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd %xmm7, %xmm3
movapd %xmm3, %xmm1
addsd %xmm7, %xmm1
movapd %xmm3, %xmm4
cmpltsd %xmm10, %xmm4
andpd %xmm4, %xmm1
andnpd %xmm3, %xmm4
movsd 0x24fbc(%rip), %xmm2    # 0x10b980
movsd %xmm0, -0xe0(%rbp)
addsd %xmm0, %xmm2
orpd %xmm1, %xmm4
movapd %xmm4, -0x50(%rbp)
movapd %xmm2, -0x90(%rbp)
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
movapd %xmm5, %xmm0
callq 0x9080
mulsd 0x45262(%rip), %xmm0    # 0x12bc60
movsd %xmm0, -0x30(%rbp)
movapd -0x40(%rbp), %xmm0
callq 0x9710
movapd %xmm0, %xmm1
mulsd 0x45247(%rip), %xmm1    # 0x12bc60
movsd 0x2264f(%rip), %xmm0    # 0x109070
movaps %xmm0, -0xd0(%rbp)
movsd 0x22640(%rip), %xmm0    # 0x109070
addsd %xmm0, %xmm1
mulsd -0x30(%rbp), %xmm1
addsd -0x40(%rbp), %xmm1
movsd %xmm1, -0x30(%rbp)
movapd %xmm1, %xmm0
callq 0x9710
addsd 0x4528c(%rip), %xmm0    # 0x12bce0
mulsd 0x4528c(%rip), %xmm0    # 0x12bce8
movsd %xmm0, -0x70(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x4527d(%rip), %xmm0    # 0x12bcf0
mulsd 0x4526d(%rip), %xmm0    # 0x12bce8
movsd %xmm0, -0x68(%rbp)
divsd -0x70(%rbp), %xmm0
callq 0x92d0
movsd 0x24d86(%rip), %xmm3    # 0x10b818
movsd -0x70(%rbp), %xmm5
movapd %xmm5, %xmm1
xorpd %xmm4, %xmm4
cmpltsd %xmm4, %xmm1
movapd %xmm1, %xmm2
andnpd %xmm0, %xmm2
addsd %xmm3, %xmm0
andpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movapd %xmm0, %xmm1
addsd %xmm3, %xmm1
addsd %xmm3, %xmm1
movsd -0x68(%rbp), %xmm6
movapd %xmm6, %xmm2
cmpltsd %xmm4, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm0, %xmm3
andpd %xmm1, %xmm2
orpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm5, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
movapd %xmm5, %xmm0
orpd %xmm2, %xmm1
movapd %xmm1, -0x30(%rbp)
movapd %xmm6, %xmm1
mulsd %xmm6, %xmm1
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0xe6b1c
sqrtsd %xmm0, %xmm0
jmp 0xe6b21
callq 0x9270
movsd %xmm0, -0x70(%rbp)
movapd -0x90(%rbp), %xmm0
subsd -0x80(%rbp), %xmm0
movapd %xmm0, -0x90(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0x68(%rbp)
movapd -0x30(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
movapd %xmm0, -0x30(%rbp)
callq 0x9710
movsd %xmm0, -0x80(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0xa0(%rbp)
movapd -0x30(%rbp), %xmm0
callq 0x9080
mulsd -0xa0(%rbp), %xmm0
mulsd 0x4516b(%rip), %xmm0    # 0x12bcf8
movsd -0x80(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
addsd %xmm0, %xmm1
mulsd -0x70(%rbp), %xmm1
movsd %xmm1, -0x80(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0xa0(%rbp)
movaps -0x30(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0x68(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x9710
movsd %xmm0, -0xc0(%rbp)
movapd -0x30(%rbp), %xmm0
callq 0x9080
mulsd -0xc0(%rbp), %xmm0
mulsd 0x45111(%rip), %xmm0    # 0x12bd00
movsd -0x68(%rbp), %xmm1
mulsd -0xa0(%rbp), %xmm1
addsd %xmm0, %xmm1
mulsd -0x70(%rbp), %xmm1
movsd %xmm1, -0x68(%rbp)
movapd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x450ec(%rip), %xmm0    # 0x12bd08
mulsd -0x70(%rbp), %xmm0
movapd %xmm0, -0x30(%rbp)
movsd -0x68(%rbp), %xmm0
divsd -0x80(%rbp), %xmm0
callq 0x92d0
movsd -0x80(%rbp), %xmm5
movapd %xmm5, %xmm1
xorpd %xmm4, %xmm4
cmpltsd %xmm4, %xmm1
movapd %xmm1, %xmm2
andnpd %xmm0, %xmm2
movsd 0x24bc1(%rip), %xmm3    # 0x10b818
addsd %xmm3, %xmm0
andpd %xmm1, %xmm0
orpd %xmm2, %xmm0
movapd %xmm0, %xmm1
addsd %xmm3, %xmm1
addsd %xmm3, %xmm1
movsd -0x68(%rbp), %xmm6
movapd %xmm6, %xmm2
cmpltsd %xmm4, %xmm2
movapd %xmm2, %xmm3
andnpd %xmm0, %xmm3
andpd %xmm1, %xmm2
orpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
cmpltsd %xmm5, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
movapd %xmm5, %xmm0
orpd %xmm2, %xmm1
movapd %xmm1, -0xa0(%rbp)
movapd %xmm6, %xmm1
mulsd %xmm6, %xmm1
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0xe6ccd
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0xe6cd6
callq 0x9270
movapd %xmm0, %xmm1
movapd %xmm1, -0x80(%rbp)
movapd -0x90(%rbp), %xmm0
mulsd 0x22355(%rip), %xmm0    # 0x109040
movapd %xmm0, -0x90(%rbp)
movapd -0x30(%rbp), %xmm0
divsd %xmm1, %xmm0
callq 0x92d0
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
movapd -0x80(%rbp), %xmm3
cmpltsd %xmm3, %xmm1
cmpltsd %xmm2, %xmm3
xorpd %xmm4, %xmm4
movapd %xmm3, %xmm2
movapd %xmm3, %xmm5
andnpd %xmm0, %xmm2
movsd 0x24ae8(%rip), %xmm3    # 0x10b818
addsd %xmm3, %xmm0
andpd %xmm5, %xmm0
orpd %xmm2, %xmm0
movapd %xmm0, %xmm2
addsd %xmm3, %xmm2
addsd %xmm3, %xmm2
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
movapd -0x30(%rbp), %xmm1
cmpltsd %xmm4, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
movapd %xmm2, -0xc0(%rbp)
movapd -0xb0(%rbp), %xmm1
addsd -0x50(%rbp), %xmm1
movapd -0x60(%rbp), %xmm2
movapd -0x40(%rbp), %xmm0
addsd %xmm0, %xmm2
movapd %xmm0, %xmm3
movapd -0x20(%rbp), %xmm0
addsd %xmm0, %xmm2
movapd %xmm2, %xmm4
subsd %xmm1, %xmm4
movsd %xmm4, -0x68(%rbp)
subsd %xmm0, %xmm2
movapd %xmm2, -0x60(%rbp)
movsd 0x24c68(%rip), %xmm0    # 0x10ba20
mulsd %xmm4, %xmm0
movsd %xmm0, -0x80(%rbp)
addsd %xmm3, %xmm0
movsd %xmm0, -0xb0(%rbp)
callq 0x9080
mulsd 0x44f36(%rip), %xmm0    # 0x12bd10
movsd %xmm0, -0x20(%rbp)
movsd -0x68(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x9080
mulsd 0x44f1e(%rip), %xmm0    # 0x12bd18
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x50(%rbp), %xmm0
callq 0x9080
mulsd 0x44f0a(%rip), %xmm0    # 0x12bd20
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x40(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0xd8(%rbp)
subsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x44ee5(%rip), %xmm0    # 0x12bd28
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x50(%rbp), %xmm0
addsd -0xb0(%rbp), %xmm0
callq 0x9080
mulsd 0x44ec9(%rip), %xmm0    # 0x12bd30
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x30(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
callq 0x9080
mulsd 0x44eb0(%rip), %xmm0    # 0x12bd38
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x30(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
callq 0x9080
mulsd 0x44e97(%rip), %xmm0    # 0x12bd40
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x40(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
callq 0x9080
mulsd 0x44e7e(%rip), %xmm0    # 0x12bd48
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x68(%rbp), %xmm0
callq 0x9080
mulsd 0x44e6a(%rip), %xmm0    # 0x12bd50
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movapd -0x50(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
callq 0x9080
mulsd 0x44e51(%rip), %xmm0    # 0x12bd58
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movapd -0x60(%rbp), %xmm0
addsd %xmm0, %xmm0
subsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd 0x44e34(%rip), %xmm0    # 0x12bd60
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x68(%rbp), %xmm0
mulsd 0x44e25(%rip), %xmm0    # 0x12bd68
addsd -0x40(%rbp), %xmm0
callq 0x9080
movapd %xmm0, %xmm1
mulsd 0x44e17(%rip), %xmm1    # 0x12bd70
addsd -0x50(%rbp), %xmm1
movsd 0x249a2(%rip), %xmm0    # 0x10b908
mulsd %xmm0, %xmm1
addsd -0xa0(%rbp), %xmm1
movsd %xmm1, -0x20(%rbp)
movsd -0x80(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x44dea(%rip), %xmm0    # 0x12bd78
movsd %xmm0, -0x50(%rbp)
movapd -0x40(%rbp), %xmm0
subsd -0x60(%rbp), %xmm0
addsd -0x80(%rbp), %xmm0
callq 0x9080
mulsd 0x44dd1(%rip), %xmm0    # 0x12bd80
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movapd -0x40(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
addsd -0x80(%rbp), %xmm0
callq 0x9080
mulsd 0x44db3(%rip), %xmm0    # 0x12bd88
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x44d9a(%rip), %xmm0    # 0x12bd90
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0xd8(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
callq 0x9080
mulsd 0x44d7e(%rip), %xmm0    # 0x12bd98
addsd -0x40(%rbp), %xmm0
movsd 0x248e1(%rip), %xmm1    # 0x10b908
mulsd %xmm1, %xmm0
addsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
mulsd 0x247db(%rip), %xmm0    # 0x10b820
divsd 0x247cb(%rip), %xmm0    # 0x10b818
movsd %xmm0, -0x60(%rbp)
subsd 0x292d0e(%rip), %xmm0   # 0x379d68
mulsd %xmm1, %xmm0
callq 0x9710
movsd 0x22005(%rip), %xmm1    # 0x109070
subsd %xmm0, %xmm1
mulsd 0x21ff1(%rip), %xmm1    # 0x109068
movsd %xmm1, 0x292ce1(%rip)   # 0x379d60
movsd -0xb0(%rbp), %xmm0
callq 0x9710
mulsd 0x44d0c(%rip), %xmm0    # 0x12bda0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9710
mulsd 0x44cf8(%rip), %xmm0    # 0x12bda8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x2475e(%rip), %xmm0    # 0x10b820
mulsd -0x40(%rbp), %xmm0
divsd 0x24749(%rip), %xmm0    # 0x10b818
movsd 0x36fb9(%rip), %xmm1    # 0x11e090
callq 0x94d0
movapd %xmm0, %xmm3
movsd 0x36fa8(%rip), %xmm1    # 0x11e090
addsd %xmm1, %xmm3
movapd %xmm0, %xmm2
cmpltsd 0x2201f(%rip), %xmm2    # 0x109118
andpd %xmm2, %xmm3
andnpd %xmm0, %xmm2
orpd %xmm3, %xmm2
movlpd %xmm2, 0x29434b(%rip)   # 0x37b458
movsd -0x60(%rbp), %xmm0
callq 0x94d0
movsd 0x36f71(%rip), %xmm2    # 0x11e090
addsd %xmm0, %xmm2
movapd %xmm0, %xmm1
cmpltsd 0x21fe8(%rip), %xmm1    # 0x109118
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm2, %xmm1
movlpd %xmm1, 0x29431c(%rip)   # 0x37b460
leaq 0x225e85(%rip), %rbx    # 0x30cfd0
movsd (%rbx), %xmm0
leaq 0x225e8a(%rip), %rax    # 0x30cfe0
movsd (%rax), %xmm1
callq 0xe765f
mulsd -0x50(%rbp), %xmm0
mulsd 0x21ecc(%rip), %xmm0    # 0x109038
movsd %xmm0, 0x2942f4(%rip)   # 0x37b468
movsd -0x20(%rbp), %xmm0
callq 0x9710
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x9710
mulsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x9080
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x9710
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x9080
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0xe0(%rbp), %xmm0
movl $0x1, %edi
callq 0xe0757
movsd %xmm0, -0x30(%rbp)
callq 0x9710
movaps %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9080
mulsd -0x70(%rbp), %xmm0
movapd -0x40(%rbp), %xmm1
mulsd -0x20(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x9710
mulsd -0x70(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x20(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x50(%rbp)
movapd -0x40(%rbp), %xmm0
divsd -0x60(%rbp), %xmm0
callq 0x92d0
xorpd %xmm2, %xmm2
movsd -0x60(%rbp), %xmm0
ucomisd %xmm2, %xmm0
jne 0xe7278
jp 0xe7278
movapd -0x40(%rbp), %xmm0
ucomisd %xmm2, %xmm0
jne 0xe7278
jnp 0xe72b1
movapd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm1
movsd -0x60(%rbp), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xe729a
sqrtsd %xmm0, %xmm0
jmp 0xe729f
callq 0x9270
movsd -0x50(%rbp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x92d0
movsd -0xe8(%rbp), %xmm0
addsd 0x44aef(%rip), %xmm0    # 0x12bdb0
mulsd 0x44aef(%rip), %xmm0    # 0x12bdb8
addsd 0x44aef(%rip), %xmm0    # 0x12bdc0
movapd -0x90(%rbp), %xmm1
mulsd 0x371b7(%rip), %xmm1    # 0x11e498
addsd %xmm0, %xmm1
leaq 0x225cec(%rip), %rax    # 0x30cfd8
movsd 0x21e64(%rip), %xmm3    # 0x109158
movsd (%rax), %xmm0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
movsd 0x24600(%rip), %xmm1    # 0x10b908
mulsd %xmm1, %xmm0
movsd 0x36dc4(%rip), %xmm2    # 0x11e0d8
divsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm1, %xmm0
xorpd %xmm4, %xmm4
movapd 0x21e52(%rip), %xmm1    # 0x109180
andpd %xmm0, %xmm1
cvttpd2dq %xmm1, %xmm1
setae %al
cvtdq2pd %xmm1, %xmm1
leaq 0x25b4c(%rip), %rcx     # 0x10ce90
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, -0x30(%rbp)
movsd (%rbx), %xmm0
callq 0x9710
movsd %xmm0, -0x20(%rbp)
movsd 0x2457f(%rip), %xmm0    # 0x10b908
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
callq 0x9710
mulsd -0x20(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
movsd (%rbx), %xmm0
callq 0x9710
movsd %xmm0, -0x20(%rbp)
movsd -0x90(%rbp), %xmm0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
movapd -0x40(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
movsd (%rbx), %xmm0
callq 0x9080
movsd -0x50(%rbp), %xmm1
subsd %xmm0, %xmm1
movapd -0x40(%rbp), %xmm3
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movsd -0x60(%rbp), %xmm2
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
movsd %xmm1, -0x50(%rbp)
movapd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm2, -0x90(%rbp)
addsd %xmm2, %xmm0
ucomisd 0x21cef(%rip), %xmm0    # 0x109118
movapd %xmm3, %xmm1
jae 0xe7439
callq 0x9270
movapd -0x40(%rbp), %xmm1
movapd %xmm1, %xmm0
divsd -0x60(%rbp), %xmm0
callq 0x92d0
movapd -0x40(%rbp), %xmm4
movsd -0x60(%rbp), %xmm1
ucomisd 0x21cbf(%rip), %xmm1    # 0x109118
jne 0xe7469
jp 0xe7469
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm4
jne 0xe7469
jnp 0xe74b3
movapd %xmm0, -0x20(%rbp)
xorpd %xmm0, %xmm0
movsd -0x90(%rbp), %xmm1
ucomisd %xmm0, %xmm1
movapd %xmm1, %xmm0
jb 0xe748a
sqrtsd %xmm0, %xmm0
jmp 0xe748f
callq 0x9270
movsd -0x50(%rbp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x92d0
movapd %xmm0, -0xd0(%rbp)
movapd -0x40(%rbp), %xmm4
movapd -0x20(%rbp), %xmm0
movapd %xmm0, %xmm6
movsd 0x24359(%rip), %xmm2    # 0x10b818
addsd %xmm2, %xmm6
xorpd %xmm5, %xmm5
movsd -0x60(%rbp), %xmm3
movapd %xmm3, %xmm1
cmpltsd %xmm5, %xmm1
andpd %xmm1, %xmm6
andnpd %xmm0, %xmm1
orpd %xmm6, %xmm1
movapd %xmm1, %xmm0
addsd %xmm2, %xmm0
addsd %xmm2, %xmm0
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 0x21c39(%rip), %xmm1    # 0x109158
mulsd %xmm1, %xmm2
movapd -0x30(%rbp), %xmm0
subsd %xmm2, %xmm0
mulsd 0x243d4(%rip), %xmm0    # 0x10b908
movapd %xmm0, -0x30(%rbp)
callq 0x9710
movsd %xmm0, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x20(%rbp)
movaps -0xd0(%rbp), %xmm0
callq 0x9710
movaps %xmm0, -0x30(%rbp)
movaps -0xd0(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x60(%rbp)
movsd (%rbx), %xmm0
callq 0x9710
movsd %xmm0, -0x50(%rbp)
movsd (%rbx), %xmm0
callq 0x9080
movapd %xmm0, %xmm3
movsd %xmm0, -0x90(%rbp)
movapd 0x21c03(%rip), %xmm0    # 0x1091a0
movapd -0x30(%rbp), %xmm2
xorpd %xmm2, %xmm0
mulsd -0x20(%rbp), %xmm0
mulsd %xmm3, %xmm2
mulsd -0x40(%rbp), %xmm2
movsd -0x50(%rbp), %xmm1
mulsd -0x60(%rbp), %xmm1
subsd %xmm2, %xmm1
callq 0x9050
mulsd 0x21b89(%rip), %xmm0    # 0x109158
movsd 0x36ab9(%rip), %xmm1    # 0x11e090
addsd %xmm0, %xmm1
movapd %xmm0, %xmm2
cmpltsd 0x21b30(%rip), %xmm2    # 0x109118
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
leaq 0x2261ed(%rip), %rbx    # 0x30d7e8
movlpd %xmm2, (%rbx)
movapd -0x30(%rbp), %xmm0
mulsd -0x50(%rbp), %xmm0
mulsd -0x40(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
mulsd -0x60(%rbp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x9660
xorps %xmm2, %xmm2
cvtsd2ss (%rbx), %xmm2
mulsd 0x21b21(%rip), %xmm0    # 0x109158
leaq 0x2261b2(%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 0x5ad98