// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: detide_(double*, int*, double*, double*, double*, double*)
int detide_(double *xsta, int *mjd, double *fmjd,
         double *xsun, double *xmon, double *dxtide)
{
    /* Initialized data */

    static double h20 = .6078;
    static double l20 = .0847;
    static double h3 = .292;
    static double l3 = .015;

    /* F2C generated locals */
    double d__1, d__2;

    /* Local variables */
    static double mass_ratio_moon__;
    static double rsta, rmon, rsun, p2mon, p3mon, x2mon, x3mon, p2sun, p3sun;
    static int i;
    static double x2sun, x3sun;
    static double t, scmon;
    static double h2, scsun, l2;
    static double re, cosphi, dmjdtt, fmjdtt, tsectt;
    static double fac2mon, fac3mon, fac2sun, fac3sun;
    static double mass_ratio_sun__;
    static double fhr, scm, scs, tsecgps, xcorsta[3];

    static double sinphi;
    static double cosla, sinla;
    static double dr, dn;

    if(xsta == 0) return (-1);
    if(mjd == 0) return (-1); 
    if(fmjd == 0) return (-1); 
    if(xsun == 0) return (-1); 
    if(xmon == 0) return (-1); 
    if(dxtide == 0) return (-1); 

/* computation of tidal corrections of station displacements caused */
/*    by lunar and solar gravitational attraction */
/* step 1 (here general degree 2 and 3 corrections + */
/*         call st1idiu + call st1isem + call st1l1) */
/*   + step 2 (call step2diu + call step2lon + call step2idiu) */
/* it has been decided that the step 3 un-correction for permanent tide */
/* would *not* be applied in order to avoid jump in the reference frame */
/*** (this step 3 must added in order to get the mean tide station position*/
/* and to be conformed with the iag resolution.) */
/* inputs */
/***   xsta(i),i=1,2,3   -- geocentric position of the station (ITRF/ECEF)
*/
/*   xsun(i),i=1,2,3   -- geoc. position of the sun (ECEF) */
/*   xmon(i),i=1,2,3   -- geoc. position of the moon (ECEF) */
/***   mjd,fmjd          -- modified julian day (and fraction) (in GPS time)*/
/****old calling sequence****************************************************/
/***   dmjd               -- time in mean julian date (including day fract
ion)*/
/*   fhr=hr+zmin/60.+sec/3600.   -- hr in the day */
/* outputs */
/*   dxtide(i),i=1,2,3           -- displacement vector (ITRF) */
/* author iers 1996 :  v. dehant, s. mathews and j. gipson */
/*    (test between two subroutines) */
/* author iers 2000 :  v. dehant, c. bruyninx and s. mathews */
/*    (test in the bernese program by c. bruyninx) */
/* created:  96/03/23 (see above) */
/* modified from dehanttideinelMJD.f by Dennis Milbert 2006sep10 */
/* bug fix regarding fhr (changed calling sequence, too) */
/* modified to reflect table 7.5a and b IERS Conventions 2003 */
/* modified to use TT time system to call step 2 functions */
/* sign correction by V.Dehant to match eq.16b, p.81, Conventions */
/* applied by Dennis Milbert 2007may05 */
/*** nominal second degree and third degree love numbers and shida numbers
*/
    /* Function Body */
/* internal support for new calling sequence */
/* also convert GPS time into TT time */
    tsecgps = *fmjd * 86400.;
/* *** GPS time (sec of */
    tsectt = gps2tt_(&tsecgps);
/* *** TT  time (sec of */
    fmjdtt = tsectt / 86400.;
/* *** TT  time (fract. */
    dmjdtt = *mjd + fmjdtt;
/* commented line was live code in dehanttideinelMJD.f */
/* changed on the suggestion of Dr. Don Kim, UNB -- 09mar21 */
/* Julian date for 2000 January 1 00:00:00.0 UT is  JD 2451544.5 */
/* MJD         for 2000 January 1 00:00:00.0 UT is MJD   51544.0 */
/***** t=(dmjdtt-51545.d0)/36525.d0                !*** days to centuries,
 TT*/
/* *** float MJD in TT */
    t = (dmjdtt - 51544.) / 36525.;
/* *** days to centuries */
    fhr = (dmjdtt - (int) dmjdtt) * 24.;
/* scalar product of station vector with sun/moon vector */
/* *** hours in the day, */
    sprod_(&xsta[0], &xsun[0], &scs, &rsta, &rsun);
    sprod_(&xsta[0], &xmon[0], &scm, &rsta, &rmon);
    scsun = scs / rsta / rsun;
    scmon = scm / rsta / rmon;
/* computation of new h2 and l2 */
    cosphi = sqrt(xsta[0] * xsta[0] + xsta[1] * xsta[1]) / rsta;
    h2 = h20 - (1. - cosphi * 1.5 * cosphi) * 6e-4;
    l2 = l20 + (1. - cosphi * 1.5 * cosphi) * 2e-4;
/* p2-term */
    p2sun = (h2 / 2. - l2) * 3. * scsun * scsun - h2 / 2.;
    p2mon = (h2 / 2. - l2) * 3. * scmon * scmon - h2 / 2.;
/* p3-term */
/* Computing 3rd power */
    d__1 = scsun, d__2 = d__1;
    p3sun = (h3 - l3 * 3.) * 2.5 * (d__2 * (d__1 * d__1)) + (l3 - h3) * 1.5 * 
            scsun;
/* Computing 3rd power */
    d__1 = scmon, d__2 = d__1;
    p3mon = (h3 - l3 * 3.) * 2.5 * (d__2 * (d__1 * d__1)) + (l3 - h3) * 1.5 * 
            scmon;
/* term in direction of sun/moon vector */
    x2sun = l2 * 3. * scsun;
    x2mon = l2 * 3. * scmon;
    x3sun = l3 * 3. / 2. * (scsun * 5. * scsun - 1.);
    x3mon = l3 * 3. / 2. * (scmon * 5. * scmon - 1.);
/* factors for sun/moon */
    mass_ratio_sun__ = 332945.943062;
    mass_ratio_moon__ = .012300034;
    re = 6378136.55;
/* Computing 3rd power */
    d__1 = re / rsun, d__2 = d__1;
    fac2sun = mass_ratio_sun__ * re * (d__2 * (d__1 * d__1));
/* Computing 3rd power */
    d__1 = re / rmon, d__2 = d__1;
    fac2mon = mass_ratio_moon__ * re * (d__2 * (d__1 * d__1));
    fac3sun = fac2sun * (re / rsun);
    fac3mon = fac2mon * (re / rmon);
/* total displacement */
    for(i=0; i<=2; ++i) {
        dxtide[i] = fac2sun * (x2sun * xsun[i] / rsun + p2sun * xsta[i] / 
                rsta) + fac2mon * (x2mon * xmon[i] / rmon + p2mon * xsta[i] / 
                rsta) + fac3sun * (x3sun * xsun[i] / rsun + p3sun * xsta[i] / 
                rsta) + fac3mon * (x3mon * xmon[i] / rmon + p3mon * xsta[i] / 
                rsta);
    }
    zero_vec8__(xcorsta);

/* corrections for the out-of-phase part of love numbers */
/*     (part h_2^(0)i and l_2^(0)i ) */
/* first, for the diurnal band */
    st1idiu_(&xsta[0], &xsun[0], &xmon[0], &fac2sun, &fac2mon, xcorsta);
    dxtide[0] += xcorsta[0];
    dxtide[1] += xcorsta[1];
    dxtide[2] += xcorsta[2];
/* second, for the semi-diurnal band */
    st1isem_(&xsta[0], &xsun[0], &xmon[0], &fac2sun, &fac2mon, xcorsta);
    dxtide[0] += xcorsta[0];
    dxtide[1] += xcorsta[1];
    dxtide[2] += xcorsta[2];
/*** corrections for the latitude dependence of love numbers (part l^(1) ) */
    st1l1_(&xsta[0], &xsun[0], &xmon[0], &fac2sun, &fac2mon, xcorsta);
    dxtide[0] += xcorsta[0];
    dxtide[1] += xcorsta[1];
    dxtide[2] += xcorsta[2];

/* consider corrections for step 2 */
/* corrections for the diurnal band: */
/*  first, we need to know the date converted in julian centuries */
/***  this is now handled at top of code   (also convert to TT time system) */
/* **** t=(dmjd-51545.)/36525. */
/***** fhr=dmjd-int(dmjd)             !*** this is/was a buggy line (day vs. hr) */
/*  second, the diurnal band corrections, */
/*   (in-phase and out-of-phase frequency dependence): */
    step2diu_(&xsta[0], &fhr, &t, xcorsta);
    dxtide[0] += xcorsta[0];
    dxtide[1] += xcorsta[1];
    dxtide[2] += xcorsta[2];
/*  corrections for the long-period band, */
/*   (in-phase and out-of-phase frequency dependence): */
    step2lon_(&xsta[0], &fhr, &t, xcorsta);
    dxtide[0] += xcorsta[0];
    dxtide[1] += xcorsta[1];
    dxtide[2] += xcorsta[2];

/* consider corrections for step 3 */
/* ----------------------------------------------------------------------- */
/* The code below is commented to prevent restoring deformation */
/* due to permanent tide.  All the code above removes */
/* total tidal deformation with conventional Love numbers. */
/* The code above realizes a conventional tide free crust (i.e. ITRF). */
/* This does NOT conform to Resolution 16 of the 18th General Assembly */
/* of the IAG (1983).  This resolution has not been implemented by */
/* the space geodesy community in general (c.f. IERS Conventions 2003). */

/* ----------------------------------------------------------------------- */
/*** uncorrect for the permanent tide  (only if you want mean tide system)
*/
   if(tide_options & CALC_MEAN_TIDES) {
       sinphi = xsta[2] / rsta;
       cosphi = sqrt((xsta[0]*xsta[0])  + (xsta[1]*xsta[1])) / rsta;
       cosla = xsta[0] / cosphi / rsta;
       sinla = xsta[0] / cosphi / rsta;
       dr = -sqrt(5./4./PI) * h2 * 0.31460 * (3./2. * (sinphi*sinphi) - 0.5);
       dn = -sqrt(5./4./PI) * l2 * 0.31460 * 3. * cosphi*sinphi;
       dxtide[0] = dxtide[0]-dr*cosla*cosphi+dn*cosla*sinphi;
       dxtide[1] = dxtide[1]-dr*sinla*cosphi+dn*sinla*sinphi;
       dxtide[2] = dxtide[2]-dr*sinphi-dn*cosphi;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1423a3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1430a7
cmpq $0x0, -0x18(%rbp)
jne 0x1423b6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1430a7
cmpq $0x0, -0x20(%rbp)
jne 0x1423c9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1430a7
cmpq $0x0, -0x28(%rbp)
jne 0x1423dc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1430a7
cmpq $0x0, -0x30(%rbp)
jne 0x1423ef
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1430a7
cmpq $0x0, -0x38(%rbp)
jne 0x142402
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1430a7
movq -0x20(%rbp), %rax
movsd 0x2cbfa(%rip), %xmm0    # 0x16f008
mulsd (%rax), %xmm0
movsd %xmm0, 0x2984e6(%rip)   # 0x3da900
leaq 0x2984df(%rip), %rdi    # 0x3da900
callq 0x143260
movsd %xmm0, 0x29848a(%rip)   # 0x3da8b8
movsd 0x298482(%rip), %xmm0   # 0x3da8b8
movsd 0x2cbca(%rip), %xmm1    # 0x16f008
divsd %xmm1, %xmm0
movsd %xmm0, 0x298466(%rip)   # 0x3da8b0
movq -0x18(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
addsd 0x298456(%rip), %xmm0   # 0x3da8b0
movsd %xmm0, 0x298446(%rip)   # 0x3da8a8
movsd 0x29843e(%rip), %xmm0   # 0x3da8a8
movsd 0x4ca46(%rip), %xmm1    # 0x18eeb8
subsd %xmm1, %xmm0
movsd 0x4bf02(%rip), %xmm1    # 0x18e380
divsd %xmm1, %xmm0
movsd %xmm0, 0x2983e6(%rip)   # 0x3da870
movsd 0x298416(%rip), %xmm0   # 0x3da8a8
cvttsd2si 0x29840e(%rip), %eax # 0x3da8a8
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
movsd 0x2cb8e(%rip), %xmm1    # 0x16f038
mulsd %xmm1, %xmm0
movsd %xmm0, 0x298432(%rip)   # 0x3da8e8
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq 0x298433(%rip), %rdx    # 0x3da8f8
leaq 0x298344(%rip), %rcx    # 0x3da810
leaq 0x29834d(%rip), %r8     # 0x3da820
callq 0x1432b0
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x298409(%rip), %rdx    # 0x3da8f0
leaq 0x298322(%rip), %rcx    # 0x3da810
leaq 0x298323(%rip), %r8     # 0x3da818
callq 0x1432b0
movsd 0x2983f6(%rip), %xmm0   # 0x3da8f8
divsd 0x298306(%rip), %xmm0   # 0x3da810
divsd 0x29830e(%rip), %xmm0   # 0x3da820
movsd %xmm0, 0x29836e(%rip)   # 0x3da888
movsd 0x2983ce(%rip), %xmm0   # 0x3da8f0
divsd 0x2982e6(%rip), %xmm0   # 0x3da810
divsd 0x2982e6(%rip), %xmm0   # 0x3da818
movsd %xmm0, 0x29833e(%rip)   # 0x3da878
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movsd (%rax), %xmm2
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x10(%rbp), %rax
mulsd 0x8(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x9280
divsd 0x29829f(%rip), %xmm0   # 0x3da810
movsd %xmm0, 0x298327(%rip)   # 0x3da8a0
movsd 0x8cdf7(%rip), %xmm1    # 0x1cf378
movsd 0x2cb4f(%rip), %xmm0    # 0x16f0d8
mulsd 0x29830f(%rip), %xmm0   # 0x3da8a0
movsd 0x298307(%rip), %xmm2   # 0x3da8a0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
movsd 0x2caac(%rip), %xmm2    # 0x16f068
addsd %xmm2, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x4c8d1(%rip), %xmm2    # 0x18eeb0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x298291(%rip)   # 0x3da880
movsd 0x8cd89(%rip), %xmm1    # 0x1cf380
movsd 0x2cad9(%rip), %xmm0    # 0x16f0d8
mulsd 0x298299(%rip), %xmm0   # 0x3da8a0
movsd 0x298291(%rip), %xmm2   # 0x3da8a0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
movsd 0x2ca36(%rip), %xmm2    # 0x16f068
addsd %xmm2, %xmm0
movsd 0x4c86a(%rip), %xmm2    # 0x18eea8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x298242(%rip)   # 0x3da890
movsd 0x29822a(%rip), %xmm0   # 0x3da880
movsd 0x2caf2(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
subsd 0x298226(%rip), %xmm0   # 0x3da890
movsd 0x2cb6e(%rip), %xmm1    # 0x16f1e0
mulsd %xmm1, %xmm0
mulsd 0x29820a(%rip), %xmm0   # 0x3da888
movsd 0x298202(%rip), %xmm2   # 0x3da888
movsd 0x2981f2(%rip), %xmm1   # 0x3da880
movsd 0x2caba(%rip), %xmm3    # 0x16f150
divsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x298187(%rip)   # 0x3da848
movsd 0x2981b7(%rip), %xmm0   # 0x3da880
movsd 0x2ca7f(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
subsd 0x2981b3(%rip), %xmm0   # 0x3da890
movsd 0x2cafb(%rip), %xmm1    # 0x16f1e0
mulsd %xmm1, %xmm0
mulsd 0x298187(%rip), %xmm0   # 0x3da878
movsd 0x29817f(%rip), %xmm2   # 0x3da878
movsd 0x29817f(%rip), %xmm1   # 0x3da880
movsd 0x2ca47(%rip), %xmm3    # 0x16f150
divsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2980f4(%rip)   # 0x3da828
movsd 0x29814c(%rip), %xmm0   # 0x3da888
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x8cc35(%rip), %xmm1    # 0x1cf388
movsd 0x8cc35(%rip), %xmm0    # 0x1cf390
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x2ca66(%rip), %xmm2    # 0x16f1e0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x2c9ce(%rip), %xmm1    # 0x16f158
mulsd %xmm1, %xmm0
movsd -0x48(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm2
movsd 0x8cbe7(%rip), %xmm1    # 0x1cf390
subsd 0x8cbd7(%rip), %xmm1    # 0x1cf388
movsd 0x2c91f(%rip), %xmm3    # 0x16f0d8
mulsd %xmm3, %xmm1
mulsd 0x2980c3(%rip), %xmm1   # 0x3da888
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x29807b(%rip)   # 0x3da850
movsd 0x29809b(%rip), %xmm0   # 0x3da878
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x8cb94(%rip), %xmm1    # 0x1cf388
movsd 0x8cb94(%rip), %xmm0    # 0x1cf390
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x2c9c5(%rip), %xmm2    # 0x16f1e0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x2c92d(%rip), %xmm1    # 0x16f158
mulsd %xmm1, %xmm0
movsd -0x48(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm2
movsd 0x8cb46(%rip), %xmm1    # 0x1cf390
subsd 0x8cb36(%rip), %xmm1    # 0x1cf388
movsd 0x2c87e(%rip), %xmm3    # 0x16f0d8
mulsd %xmm3, %xmm1
mulsd 0x298012(%rip), %xmm1   # 0x3da878
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x297fba(%rip)   # 0x3da830
movsd 0x2c962(%rip), %xmm0    # 0x16f1e0
mulsd 0x29800a(%rip), %xmm0   # 0x3da890
mulsd 0x297ffa(%rip), %xmm0   # 0x3da888
movsd %xmm0, 0x297fca(%rip)   # 0x3da860
movsd 0x2c942(%rip), %xmm0    # 0x16f1e0
mulsd 0x297fea(%rip), %xmm0   # 0x3da890
mulsd 0x297fca(%rip), %xmm0   # 0x3da878
movsd %xmm0, 0x297f82(%rip)   # 0x3da838
movsd 0x2c922(%rip), %xmm0    # 0x16f1e0
mulsd 0x8caca(%rip), %xmm0    # 0x1cf390
movsd 0x2c882(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
movsd 0x2c886(%rip), %xmm1    # 0x16f160
mulsd 0x297fa6(%rip), %xmm1   # 0x3da888
movsd 0x297f9e(%rip), %xmm2   # 0x3da888
mulsd %xmm2, %xmm1
movsd 0x2c822(%rip), %xmm2    # 0x16f118
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297f62(%rip)   # 0x3da868
movsd 0x2c8d2(%rip), %xmm0    # 0x16f1e0
mulsd 0x8ca7a(%rip), %xmm0    # 0x1cf390
movsd 0x2c832(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
movsd 0x2c836(%rip), %xmm1    # 0x16f160
mulsd 0x297f46(%rip), %xmm1   # 0x3da878
movsd 0x297f3e(%rip), %xmm2   # 0x3da878
mulsd %xmm2, %xmm1
movsd 0x2c7d2(%rip), %xmm2    # 0x16f118
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297eea(%rip)   # 0x3da840
movsd 0x4c542(%rip), %xmm0    # 0x18eea0
movsd %xmm0, 0x297f7a(%rip)   # 0x3da8e0
movsd 0x4c52a(%rip), %xmm0    # 0x18ee98
movsd %xmm0, 0x297e92(%rip)   # 0x3da808
movsd 0x4c512(%rip), %xmm0    # 0x18ee90
movsd %xmm0, 0x297f12(%rip)   # 0x3da898
movsd 0x297f0a(%rip), %xmm0   # 0x3da898
divsd 0x297e8a(%rip), %xmm0   # 0x3da820
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x297f33(%rip), %xmm0   # 0x3da8e0
mulsd 0x297ee3(%rip), %xmm0   # 0x3da898
movsd -0x48(%rbp), %xmm1
movsd -0x40(%rbp), %xmm2
mulsd -0x40(%rbp), %xmm2
mulsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297efc(%rip)   # 0x3da8d0
movsd 0x297ebc(%rip), %xmm0   # 0x3da898
divsd 0x297e34(%rip), %xmm0   # 0x3da818
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x297e0d(%rip), %xmm0   # 0x3da808
mulsd 0x297e95(%rip), %xmm0   # 0x3da898
movsd -0x48(%rbp), %xmm1
movsd -0x40(%rbp), %xmm2
mulsd -0x40(%rbp), %xmm2
mulsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297e9e(%rip)   # 0x3da8c0
movsd 0x297ea6(%rip), %xmm0   # 0x3da8d0
movsd 0x297e66(%rip), %xmm1   # 0x3da898
divsd 0x297de6(%rip), %xmm1   # 0x3da820
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297e92(%rip)   # 0x3da8d8
movsd 0x297e72(%rip), %xmm0   # 0x3da8c0
movsd 0x297e42(%rip), %xmm1   # 0x3da898
divsd 0x297dba(%rip), %xmm1   # 0x3da818
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297e5e(%rip)   # 0x3da8c8
movl $0x0, 0x297de4(%rip)    # 0x3da858
cmpl $0x2, 0x297ddd(%rip)    # 0x3da858
jg 0x142bf1
movsd 0x297e47(%rip), %xmm0   # 0x3da8d0
movsd 0x297dcf(%rip), %xmm2   # 0x3da860
movq -0x28(%rbp), %rax
movslq 0x297dbc(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm2
divsd 0x297d77(%rip), %xmm2   # 0x3da820
movsd 0x297d97(%rip), %xmm1   # 0x3da848
movq -0x10(%rbp), %rax
movslq 0x297d9c(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm1
divsd 0x297d47(%rip), %xmm1   # 0x3da810
addsd %xmm1, %xmm2
movsd 0x297deb(%rip), %xmm1   # 0x3da8c0
movsd 0x297d5b(%rip), %xmm3   # 0x3da838
movq -0x30(%rbp), %rax
movslq 0x297d70(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm3
divsd 0x297d23(%rip), %xmm3   # 0x3da818
movsd 0x297d2b(%rip), %xmm4   # 0x3da828
movq -0x10(%rbp), %rax
movslq 0x297d50(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm4
divsd 0x297cfb(%rip), %xmm4   # 0x3da810
addsd %xmm4, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x297dab(%rip), %xmm1   # 0x3da8d8
movsd 0x297d33(%rip), %xmm2   # 0x3da868
movq -0x28(%rbp), %rax
movslq 0x297d18(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm2
divsd 0x297cd3(%rip), %xmm2   # 0x3da820
movsd 0x297cfb(%rip), %xmm3   # 0x3da850
movq -0x10(%rbp), %rax
movslq 0x297cf8(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm3
divsd 0x297ca3(%rip), %xmm3   # 0x3da810
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x297d47(%rip), %xmm0   # 0x3da8c8
movsd 0x297cb7(%rip), %xmm2   # 0x3da840
movq -0x30(%rbp), %rax
movslq 0x297cc4(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm2
divsd 0x297c77(%rip), %xmm2   # 0x3da818
movsd 0x297c87(%rip), %xmm3   # 0x3da830
movq -0x10(%rbp), %rax
movslq 0x297ca4(%rip), %rcx    # 0x3da858
mulsd (%rax,%rcx,8), %xmm3
divsd 0x297c4f(%rip), %xmm3   # 0x3da810
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movslq 0x297c80(%rip), %rcx    # 0x3da858
movsd %xmm0, (%rax,%rcx,8)
movl 0x297c75(%rip), %eax    # 0x3da858
addl $0x1, %eax
movl %eax, 0x297c6c(%rip)    # 0x3da858
jmp 0x142a74
leaq 0x297d18(%rip), %rdi    # 0x3da910
callq 0x143430
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x297cc0(%rip), %rcx    # 0x3da8d0
leaq 0x297ca9(%rip), %r8     # 0x3da8c0
leaq 0x297cf2(%rip), %r9     # 0x3da910
callq 0x143480
movsd 0x297ce5(%rip), %xmm0   # 0x3da910
movq -0x38(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd 0x297cd9(%rip), %xmm0   # 0x3da918
movq -0x38(%rbp), %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x297ccb(%rip), %xmm0   # 0x3da920
movq -0x38(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x297c5a(%rip), %rcx    # 0x3da8d0
leaq 0x297c43(%rip), %r8     # 0x3da8c0
leaq 0x297c8c(%rip), %r9     # 0x3da910
callq 0x143b10
movsd 0x297c7f(%rip), %xmm0   # 0x3da910
movq -0x38(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd 0x297c73(%rip), %xmm0   # 0x3da918
movq -0x38(%rbp), %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x297c65(%rip), %xmm0   # 0x3da920
movq -0x38(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x297bf4(%rip), %rcx    # 0x3da8d0
leaq 0x297bdd(%rip), %r8     # 0x3da8c0
leaq 0x297c26(%rip), %r9     # 0x3da910
callq 0x1443b0
movsd 0x297c19(%rip), %xmm0   # 0x3da910
movq -0x38(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd 0x297c0d(%rip), %xmm0   # 0x3da918
movq -0x38(%rbp), %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x297bff(%rip), %xmm0   # 0x3da920
movq -0x38(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rdi
leaq 0x297bae(%rip), %rsi    # 0x3da8e8
leaq 0x297b2f(%rip), %rdx    # 0x3da870
leaq 0x297bc8(%rip), %rcx    # 0x3da910
callq 0x144f00
movsd 0x297bbb(%rip), %xmm0   # 0x3da910
movq -0x38(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd 0x297baf(%rip), %xmm0   # 0x3da918
movq -0x38(%rbp), %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x297ba1(%rip), %xmm0   # 0x3da920
movq -0x38(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x10(%rbp), %rdi
leaq 0x297b50(%rip), %rsi    # 0x3da8e8
leaq 0x297ad1(%rip), %rdx    # 0x3da870
leaq 0x297b6a(%rip), %rcx    # 0x3da910
callq 0x145c80
movsd 0x297b5d(%rip), %xmm0   # 0x3da910
movq -0x38(%rbp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movsd 0x297b51(%rip), %xmm0   # 0x3da918
movq -0x38(%rbp), %rax
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x297b43(%rip), %xmm0   # 0x3da920
movq -0x38(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
leaq 0x22947a(%rip), %rax    # 0x36c26c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1430a0
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
divsd 0x2979ff(%rip), %xmm0   # 0x3da810
movsd %xmm0, 0x297b0f(%rip)   # 0x3da928
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movq -0x10(%rbp), %rax
movsd (%rax), %xmm2
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq -0x10(%rbp), %rax
mulsd 0x8(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x9280
divsd 0x2979c0(%rip), %xmm0   # 0x3da810
movsd %xmm0, 0x297a48(%rip)   # 0x3da8a0
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
divsd 0x297a38(%rip), %xmm0   # 0x3da8a0
divsd 0x2979a0(%rip), %xmm0   # 0x3da810
movsd %xmm0, 0x297ab8(%rip)   # 0x3da930
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
divsd 0x297a18(%rip), %xmm0   # 0x3da8a0
divsd 0x297980(%rip), %xmm0   # 0x3da810
movsd %xmm0, 0x297aa0(%rip)   # 0x3da938
movsd 0x4c028(%rip), %xmm0    # 0x18eec8
callq 0x9280
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd 0x2979bc(%rip), %xmm0   # 0x3da880
movsd 0x4bff4(%rip), %xmm1    # 0x18eec0
mulsd %xmm1, %xmm0
movsd 0x297a50(%rip), %xmm1   # 0x3da928
mulsd 0x297a48(%rip), %xmm1   # 0x3da928
movsd 0x2c1f0(%rip), %xmm2    # 0x16f0d8
mulsd %xmm2, %xmm1
movsd 0x4b51c(%rip), %xmm2    # 0x18e410
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x297a3c(%rip)   # 0x3da940
movsd 0x4bfbc(%rip), %xmm0    # 0x18eec8
callq 0x9280
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd 0x297960(%rip), %xmm0   # 0x3da890
movsd 0x4bf88(%rip), %xmm1    # 0x18eec0
mulsd %xmm1, %xmm0
movsd 0x2c29c(%rip), %xmm1    # 0x16f1e0
mulsd %xmm1, %xmm0
mulsd 0x297950(%rip), %xmm0   # 0x3da8a0
mulsd 0x2979d0(%rip), %xmm0   # 0x3da928
movsd %xmm0, 0x2979e8(%rip)   # 0x3da948
movq -0x38(%rbp), %rax
movsd (%rax), %xmm0
movsd 0x2979d0(%rip), %xmm1   # 0x3da940
mulsd 0x2979b8(%rip), %xmm1   # 0x3da930
movsd 0x297920(%rip), %xmm2   # 0x3da8a0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x2979a1(%rip), %xmm0   # 0x3da948
mulsd 0x297981(%rip), %xmm0   # 0x3da930
movsd 0x297971(%rip), %xmm2   # 0x3da928
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x38(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x297968(%rip), %xmm1   # 0x3da940
mulsd 0x297958(%rip), %xmm1   # 0x3da938
movsd 0x2978b8(%rip), %xmm2   # 0x3da8a0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x297939(%rip), %xmm0   # 0x3da948
mulsd 0x297921(%rip), %xmm0   # 0x3da938
movsd 0x297909(%rip), %xmm2   # 0x3da928
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x38(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd 0x2978ff(%rip), %xmm1   # 0x3da940
movsd 0x2978df(%rip), %xmm2   # 0x3da928
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x2978d8(%rip), %xmm0   # 0x3da948
movsd 0x297828(%rip), %xmm2   # 0x3da8a0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq