// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r13
movq %rdx, %r14
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
testq %r13, %r13
sete %dl
orb %al, %dl
orb %cl, %dl
testq %r8, %r8
sete %al
testq %r9, %r9
sete %cl
orb %al, %cl
orb %dl, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0xec063
movq %r8, %r15
movq %rsi, %r12
movq %rdi, %rbx
movsd (%rdi), %xmm1
movsd 0x8(%rdi), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rdi), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movq %r9, -0x30(%rbp)
jb 0xebd42
sqrtsd %xmm0, %xmm0
jmp 0xebd4b
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28f9e5(%rip)   # 0x37b738
movsd 0x10(%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x28f9fc(%rip)   # 0x37b760
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xebd85
sqrtsd %xmm0, %xmm0
jmp 0xebd8a
callq 0x9270
movsd 0x28f9a6(%rip), %xmm1   # 0x37b738
divsd %xmm1, %xmm0
movsd %xmm0, 0x28f9ba(%rip)   # 0x37b758
movsd 0x28f9ba(%rip), %xmm2   # 0x37b760
mulsd %xmm2, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
subsd %xmm2, %xmm3
movsd %xmm3, 0x28f9aa(%rip)   # 0x37b768
movsd 0x8(%rbx), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28f97d(%rip)   # 0x37b750
movsd (%rbx), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28f961(%rip)   # 0x37b748
movsd (%r14), %xmm1
movsd 0x8(%r14), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%r14), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0xebe1c
sqrtsd %xmm0, %xmm0
jmp 0xebe25
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28f913(%rip)   # 0x37b740
movsd (%r12), %xmm1
movsd 0x8(%r12), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%r12), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xebe61
sqrtsd %xmm0, %xmm0
jmp 0xebe66
callq 0x9270
movq -0x30(%rbp), %rax
movsd 0x28f8ee(%rip), %xmm2   # 0x37b760
movsd %xmm2, -0x50(%rbp)
movsd 0x40511(%rip), %xmm1    # 0x12c390
mulsd %xmm2, %xmm1
movsd 0x28f8cd(%rip), %xmm2   # 0x37b758
movsd %xmm2, -0x58(%rbp)
mulsd %xmm2, %xmm1
movsd (%r13), %xmm14
movapd %xmm1, %xmm7
mulsd %xmm14, %xmm7
movsd 0x10(%r12), %xmm2
movsd %xmm2, -0x40(%rbp)
mulsd %xmm2, %xmm7
movsd 0x28f895(%rip), %xmm4   # 0x37b750
movsd (%r12), %xmm3
movsd 0x8(%r12), %xmm6
movsd %xmm6, -0x48(%rbp)
movsd 0x28f873(%rip), %xmm5   # 0x37b748
movapd %xmm5, %xmm2
mulsd %xmm6, %xmm2
movapd %xmm3, %xmm8
mulsd %xmm4, %xmm8
subsd %xmm2, %xmm8
mulsd %xmm8, %xmm7
mulsd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
divsd %xmm0, %xmm7
movsd (%r14), %xmm11
movsd 0x8(%r14), %xmm12
movapd %xmm5, %xmm2
mulsd %xmm12, %xmm2
movapd %xmm11, %xmm6
mulsd %xmm4, %xmm6
subsd %xmm2, %xmm6
movsd (%r15), %xmm10
mulsd %xmm10, %xmm1
movsd 0x10(%r14), %xmm15
mulsd %xmm15, %xmm1
mulsd %xmm6, %xmm1
movsd 0x28f7ff(%rip), %xmm13  # 0x37b740
mulsd %xmm13, %xmm13
divsd %xmm13, %xmm1
addsd %xmm7, %xmm1
movsd 0x40441(%rip), %xmm2    # 0x12c398
movsd 0x28f809(%rip), %xmm7   # 0x37b768
mulsd %xmm2, %xmm7
movapd %xmm14, %xmm9
mulsd %xmm7, %xmm9
movsd -0x40(%rbp), %xmm0
mulsd %xmm0, %xmm9
mulsd %xmm8, %xmm9
mulsd %xmm10, %xmm7
mulsd %xmm15, %xmm7
mulsd %xmm6, %xmm7
movsd -0x50(%rbp), %xmm6
mulsd %xmm6, %xmm2
mulsd %xmm2, %xmm14
mulsd %xmm0, %xmm14
movsd -0x48(%rbp), %xmm0
mulsd %xmm4, %xmm0
mulsd %xmm5, %xmm3
addsd %xmm0, %xmm3
mulsd %xmm14, %xmm3
movsd -0x38(%rbp), %xmm0
divsd %xmm0, %xmm9
divsd %xmm0, %xmm3
mulsd %xmm10, %xmm2
mulsd %xmm15, %xmm2
mulsd %xmm4, %xmm12
mulsd %xmm5, %xmm11
addsd %xmm12, %xmm11
mulsd %xmm2, %xmm11
divsd %xmm13, %xmm7
divsd %xmm13, %xmm11
addsd %xmm3, %xmm11
addsd %xmm9, %xmm7
movapd %xmm4, %xmm0
mulsd %xmm11, %xmm0
movapd 0x1d19c(%rip), %xmm2    # 0x1091a0
xorpd %xmm7, %xmm2
mulsd %xmm6, %xmm2
movapd %xmm2, %xmm3
mulsd %xmm5, %xmm3
mulsd %xmm5, %xmm11
mulsd %xmm1, %xmm5
movsd -0x58(%rbp), %xmm8
mulsd %xmm8, %xmm5
subsd %xmm0, %xmm5
addsd %xmm5, %xmm3
movsd %xmm3, (%rax)
mulsd %xmm4, %xmm2
mulsd %xmm1, %xmm4
mulsd %xmm8, %xmm4
addsd %xmm11, %xmm4
addsd %xmm2, %xmm4
movsd %xmm4, 0x8(%rax)
mulsd %xmm8, %xmm7
mulsd %xmm6, %xmm1
addsd %xmm7, %xmm1
movsd %xmm1, 0x10(%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq