// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: st1idiu_(double*, double*, double*, double*, double*, double*)
int st1idiu_(double *xsta, double *xsun, double *xmon,
             double *fac2sun, double *fac2mon, double *xcorsta)
{
    /* Initialized data */

    static double dhi = -.0025;
    static double dli = -7e-4;

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

    /* Local variables */
    static double rsta, rmon, rsun, cosla, demon, sinla, dnmon, desun, 
            drmon, dnsun, drsun;
    static double de, dn, dr, cosphi, sinphi, cos2phi;

    if(xsta == 0) return (-1);
    if(xsun == 0) return (-1);
    if(xmon == 0) return (-1);
    if(fac2sun == 0) return (-1);
    if(fac2mon == 0) return (-1);
    if(xcorsta == 0) return (-1);

/* this subroutine gives the out-of-phase corrections induced by */
/* mantle inelasticity in the diurnal band */
/*  input: xsta,xsun,xmon,fac2sun,fac2mon */
/* output: xcorsta */

    /* Function Body */
    rsta = enorm8_(&xsta[0]);
    sinphi = xsta[2] / rsta;
/* Computing 2nd power */
    d__1 = xsta[0];
/* Computing 2nd power */
    d__2 = xsta[1];
    cosphi = sqrt(d__1 * d__1 + d__2 * d__2) / rsta;
/* Computing 2nd power */
    d__1 = cosphi;
/* Computing 2nd power */
    d__2 = sinphi;
    cos2phi = d__1 * d__1 - d__2 * d__2;
    sinla = xsta[1] / cosphi / rsta;
    cosla = xsta[0] / cosphi / rsta;
    rmon = enorm8_(&xmon[0]);
    rsun = enorm8_(&xsun[0]);
/* Computing 2nd power */
    d__1 = rsun;
    drsun = dhi * -3. * sinphi * cosphi * *fac2sun * xsun[2] * (xsun[0] * 
            sinla - xsun[1] * cosla) / (d__1 * d__1);
/* Computing 2nd power */
    d__1 = rmon;
    drmon = dhi * -3. * sinphi * cosphi * *fac2mon * xmon[2] * (xmon[0] * 
            sinla - xmon[1] * cosla) / (d__1 * d__1);
/* Computing 2nd power */
    d__1 = rsun;
    dnsun = dli * -3. * cos2phi * *fac2sun * xsun[2] * (xsun[0] * sinla - 
            xsun[1] * cosla) / (d__1 * d__1);
/* Computing 2nd power */
    d__1 = rmon;
    dnmon = dli * -3. * cos2phi * *fac2mon * xmon[2] * (xmon[0] * sinla - 
            xmon[1] * cosla) / (d__1 * d__1);
/* Computing 2nd power */
    d__1 = rsun;
    desun = dli * -3. * sinphi * *fac2sun * xsun[2] * (xsun[0] * cosla + xsun[
            1] * sinla) / (d__1 * d__1);
/* Computing 2nd power */
    d__1 = rmon;
    demon = dli * -3. * sinphi * *fac2mon * xmon[2] * (xmon[0] * cosla + xmon[
            1] * sinla) / (d__1 * d__1);
    dr = drsun + drmon;
    dn = dnsun + dnmon;
    de = desun + demon;
    xcorsta[0] = dr * cosla * cosphi - de * sinla - dn * sinphi * cosla;
    xcorsta[1] = dr * sinla * cosphi + de * cosla - dn * sinphi * sinla;
    xcorsta[2] = dr * sinphi + dn * cosphi;
    return 0;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %r10b
orb %al, %r10b
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %r11b
orb %al, %r11b
orb %r10b, %r11b
testq %r8, %r8
sete %al
testq %r9, %r9
sete %r10b
orb %al, %r10b
orb %r11b, %r10b
je 0xd801c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
pushq %rbp
movq %rsp, %rbp
movsd (%rdi), %xmm7
movsd 0x8(%rdi), %xmm3
movapd %xmm3, %xmm1
mulsd %xmm3, %xmm1
movapd %xmm7, %xmm2
mulsd %xmm7, %xmm2
addsd %xmm1, %xmm2
movsd 0x10(%rdi), %xmm0
movapd %xmm0, %xmm4
mulsd %xmm0, %xmm4
addsd %xmm2, %xmm4
sqrtsd %xmm4, %xmm5
divsd %xmm5, %xmm0
sqrtsd %xmm2, %xmm1
divsd %xmm5, %xmm1
movapd %xmm0, %xmm6
mulsd %xmm0, %xmm6
movapd %xmm1, %xmm4
mulsd %xmm1, %xmm4
subsd %xmm6, %xmm4
divsd %xmm1, %xmm3
divsd %xmm5, %xmm3
divsd %xmm1, %xmm7
movsd %xmm1, -0x18(%rbp)
divsd %xmm5, %xmm7
movsd (%rdx), %xmm2
movsd 0x8(%rdx), %xmm5
movapd %xmm5, %xmm6
movsd %xmm5, -0x8(%rbp)
mulsd %xmm5, %xmm6
movapd %xmm2, %xmm10
mulsd %xmm2, %xmm10
addsd %xmm6, %xmm10
movsd 0x10(%rdx), %xmm11
movsd 0x3e2e6(%rip), %xmm6    # 0x1163a0
movsd %xmm0, -0x10(%rbp)
mulsd %xmm0, %xmm6
mulsd %xmm1, %xmm6
movsd (%rcx), %xmm8
movapd %xmm6, %xmm9
mulsd %xmm8, %xmm9
movsd (%r8), %xmm14
mulsd %xmm14, %xmm6
mulsd %xmm11, %xmm6
movsd 0x3e2ba(%rip), %xmm13   # 0x1163a8
mulsd %xmm13, %xmm4
movapd %xmm4, %xmm12
mulsd %xmm8, %xmm12
mulsd %xmm14, %xmm4
mulsd %xmm11, %xmm4
mulsd %xmm0, %xmm13
mulsd %xmm13, %xmm8
mulsd %xmm14, %xmm13
mulsd %xmm11, %xmm13
movapd %xmm11, %xmm14
mulsd %xmm11, %xmm14
addsd %xmm10, %xmm14
movsd (%rsi), %xmm1
movsd 0x8(%rsi), %xmm11
movapd %xmm11, %xmm15
mulsd %xmm11, %xmm15
movapd %xmm1, %xmm10
mulsd %xmm1, %xmm10
addsd %xmm15, %xmm10
movsd 0x10(%rsi), %xmm15
mulsd %xmm15, %xmm9
mulsd %xmm15, %xmm12
mulsd %xmm15, %xmm8
mulsd %xmm15, %xmm15
addsd %xmm10, %xmm15
movapd %xmm7, %xmm10
mulsd %xmm11, %xmm10
movapd %xmm1, %xmm0
mulsd %xmm3, %xmm0
subsd %xmm10, %xmm0
movapd %xmm7, %xmm10
mulsd %xmm5, %xmm10
movapd %xmm2, %xmm5
mulsd %xmm3, %xmm5
subsd %xmm10, %xmm5
sqrtsd %xmm14, %xmm10
sqrtsd %xmm15, %xmm14
mulsd %xmm0, %xmm9
mulsd %xmm14, %xmm14
divsd %xmm14, %xmm9
mulsd %xmm5, %xmm6
mulsd %xmm10, %xmm10
divsd %xmm10, %xmm6
addsd %xmm9, %xmm6
mulsd %xmm0, %xmm12
mulsd %xmm5, %xmm4
mulsd %xmm3, %xmm11
mulsd %xmm7, %xmm1
addsd %xmm11, %xmm1
mulsd %xmm8, %xmm1
divsd %xmm14, %xmm12
divsd %xmm14, %xmm1
movsd -0x8(%rbp), %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm7, %xmm2
addsd %xmm0, %xmm2
mulsd %xmm13, %xmm2
divsd %xmm10, %xmm4
divsd %xmm10, %xmm2
addsd %xmm1, %xmm2
addsd %xmm12, %xmm4
movapd %xmm3, %xmm0
mulsd %xmm2, %xmm0
movapd 0x1af8b(%rip), %xmm1    # 0xf31b0
xorpd %xmm4, %xmm1
movsd -0x10(%rbp), %xmm8
mulsd %xmm8, %xmm1
movapd %xmm1, %xmm5
mulsd %xmm7, %xmm5
mulsd %xmm7, %xmm2
mulsd %xmm6, %xmm7
movsd -0x18(%rbp), %xmm9
mulsd %xmm9, %xmm7
subsd %xmm0, %xmm7
addsd %xmm7, %xmm5
movsd %xmm5, (%r9)
mulsd %xmm3, %xmm1
mulsd %xmm6, %xmm3
mulsd %xmm9, %xmm3
addsd %xmm2, %xmm3
addsd %xmm1, %xmm3
movsd %xmm3, 0x8(%r9)
mulsd %xmm9, %xmm4
mulsd %xmm8, %xmm6
addsd %xmm4, %xmm6
movsd %xmm6, 0x10(%r9)
xorl %eax, %eax
popq %rbp
retq