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

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

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

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

    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;
    sinla = xsta[1] / cosphi / rsta;
    cosla = xsta[0] / cosphi / rsta;
/* Computing 2nd power */
    d__1 = cosla;
/* Computing 2nd power */
    d__2 = sinla;
    costwola = d__1 * d__1 - d__2 * d__2;
    sintwola = cosla * 2. * sinla;
    rmon = enorm8_(&xmon[0]);
    rsun = enorm8_(&xsun[0]);
/* Computing 2nd power */
    d__1 = cosphi;
/* Computing 2nd power */
    d__2 = xsun[0];
/* Computing 2nd power */
    d__3 = xsun[1];
/* Computing 2nd power */
    d__4 = rsun;
    drsun = dhi * -.75 * (d__1 * d__1) * *fac2sun * ((d__2 * d__2 - d__3 * 
            d__3) * sintwola - xsun[0] * 2.f * xsun[1] * costwola) / (d__4 * 
            d__4);
/* Computing 2nd power */
    d__1 = cosphi;
/* Computing 2nd power */
    d__2 = xmon[0];
/* Computing 2nd power */
    d__3 = xmon[1];
/* Computing 2nd power */
    d__4 = rmon;
    drmon = dhi * -.75 * (d__1 * d__1) * *fac2mon * ((d__2 * d__2 - d__3 * 
            d__3) * sintwola - xmon[0] * 2.f * xmon[1] * costwola) / (d__4 * 
            d__4);
/* Computing 2nd power */
    d__1 = xsun[0];
/* Computing 2nd power */
    d__2 = xsun[1];
/* Computing 2nd power */
    d__3 = rsun;
    dnsun = dli * 1.5 * sinphi * cosphi * *fac2sun * ((d__1 * d__1 - d__2 * 
            d__2) * sintwola - xsun[0] * 2. * xsun[1] * costwola) / (d__3 * 
            d__3);
/* Computing 2nd power */
    d__1 = xmon[0];
/* Computing 2nd power */
    d__2 = xmon[1];
/* Computing 2nd power */
    d__3 = rmon;
    dnmon = dli * 1.5 * sinphi * cosphi * *fac2mon * ((d__1 * d__1 - d__2 * 
            d__2) * sintwola - xmon[0] * 2. * xmon[1] * costwola) / (d__3 * 
            d__3);
/* Computing 2nd power */
    d__1 = xsun[0];
/* Computing 2nd power */
    d__2 = xsun[1];
/* Computing 2nd power */
    d__3 = rsun;
    desun = dli * -1.5 * cosphi * *fac2sun * ((d__1 * d__1 - d__2 * d__2) * 
            costwola + xsun[0] * 2.f * xsun[1] * sintwola) / (d__3 * d__3);
/* Computing 2nd power */
    d__1 = xmon[0];
/* Computing 2nd power */
    d__2 = xmon[1];
/* Computing 2nd power */
    d__3 = rmon;
    demon = dli * -1.5 * cosphi * *fac2mon * ((d__1 * d__1 - d__2 * d__2) * 
            costwola + xmon[0] * 2. * xmon[1] * sintwola) / (d__3 * d__3);
    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
subq $0x60, %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 0x143b43
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14439c
cmpq $0x0, -0x18(%rbp)
jne 0x143b56
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14439c
cmpq $0x0, -0x20(%rbp)
jne 0x143b69
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14439c
cmpq $0x0, -0x28(%rbp)
jne 0x143b7c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14439c
cmpq $0x0, -0x30(%rbp)
jne 0x143b8f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14439c
cmpq $0x0, -0x38(%rbp)
jne 0x143ba2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14439c
movq -0x10(%rbp), %rdi
callq 0x146850
movsd %xmm0, 0x296fc5(%rip)   # 0x3dab78
movq -0x10(%rbp), %rax
movsd 0x10(%rax), %xmm0
divsd 0x296fb4(%rip), %xmm0   # 0x3dab78
movsd %xmm0, 0x297034(%rip)   # 0x3dac00
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x9280
divsd 0x296f68(%rip), %xmm0   # 0x3dab78
movsd %xmm0, 0x296fe0(%rip)   # 0x3dabf8
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
divsd 0x296fcf(%rip), %xmm0   # 0x3dabf8
divsd 0x296f47(%rip), %xmm0   # 0x3dab78
movsd %xmm0, 0x296f77(%rip)   # 0x3dabb0
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
divsd 0x296faf(%rip), %xmm0   # 0x3dabf8
divsd 0x296f27(%rip), %xmm0   # 0x3dab78
movsd %xmm0, 0x296f47(%rip)   # 0x3daba0
movsd 0x296f3f(%rip), %xmm0   # 0x3daba0
movsd %xmm0, -0x40(%rbp)
movsd 0x296f42(%rip), %xmm0   # 0x3dabb0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm1
mulsd -0x48(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x296ee2(%rip)   # 0x3dab90
movsd 0x2b49a(%rip), %xmm0    # 0x16f150
mulsd 0x296ee2(%rip), %xmm0   # 0x3daba0
mulsd 0x296eea(%rip), %xmm0   # 0x3dabb0
movsd %xmm0, 0x296eca(%rip)   # 0x3dab98
movq -0x20(%rbp), %rdi
callq 0x146850
movsd %xmm0, 0x296ea1(%rip)   # 0x3dab80
movq -0x18(%rbp), %rdi
callq 0x146850
movsd %xmm0, 0x296e98(%rip)   # 0x3dab88
movsd 0x296f00(%rip), %xmm0   # 0x3dabf8
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x296e68(%rip), %xmm0   # 0x3dab88
movsd %xmm0, -0x58(%rbp)
movsd 0x4b1ab(%rip), %xmm0    # 0x18eed8
mulsd 0x8b803(%rip), %xmm0    # 0x1cf538
movsd -0x40(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
mulsd (%rax), %xmm0
movsd -0x48(%rbp), %xmm1
movsd -0x48(%rbp), %xmm3
movsd -0x50(%rbp), %xmm2
mulsd -0x50(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x296e12(%rip), %xmm3   # 0x3dab98
movq -0x18(%rbp), %rax
movsd 0x2b3be(%rip), %xmm2    # 0x16f150
mulsd (%rax), %xmm2
movq -0x18(%rbp), %rax
mulsd 0x8(%rax), %xmm2
mulsd 0x296de9(%rip), %xmm2   # 0x3dab90
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x296df8(%rip)   # 0x3dabd8
movsd 0x296e10(%rip), %xmm0   # 0x3dabf8
movsd %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x296d70(%rip), %xmm0   # 0x3dab80
movsd %xmm0, -0x58(%rbp)
movsd 0x4b0bb(%rip), %xmm0    # 0x18eed8
mulsd 0x8b713(%rip), %xmm0    # 0x1cf538
movsd -0x40(%rbp), %xmm1
mulsd -0x40(%rbp), %xmm1
mulsd %xmm1, %xmm0
movq -0x30(%rbp), %rax
mulsd (%rax), %xmm0
movsd -0x48(%rbp), %xmm1
movsd -0x48(%rbp), %xmm3
movsd -0x50(%rbp), %xmm2
mulsd -0x50(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x296d22(%rip), %xmm3   # 0x3dab98
movq -0x20(%rbp), %rax
movsd 0x2b2ce(%rip), %xmm2    # 0x16f150
mulsd (%rax), %xmm2
movq -0x20(%rbp), %rax
mulsd 0x8(%rax), %xmm2
mulsd 0x296cf9(%rip), %xmm2   # 0x3dab90
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x296cf8(%rip)   # 0x3dabc8
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x296c95(%rip), %xmm0   # 0x3dab88
movsd %xmm0, -0x50(%rbp)
movsd 0x2b1d8(%rip), %xmm0    # 0x16f0d8
mulsd 0x8b638(%rip), %xmm0    # 0x1cf540
mulsd 0x296cf0(%rip), %xmm0   # 0x3dac00
mulsd 0x296ce0(%rip), %xmm0   # 0x3dabf8
movq -0x28(%rbp), %rax
mulsd (%rax), %xmm0
movsd -0x40(%rbp), %xmm1
movsd -0x40(%rbp), %xmm3
movsd -0x48(%rbp), %xmm2
mulsd -0x48(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x296c3d(%rip), %xmm3   # 0x3dab98
movq -0x18(%rbp), %rax
movsd 0x2b1e9(%rip), %xmm2    # 0x16f150
mulsd (%rax), %xmm2
movq -0x18(%rbp), %rax
mulsd 0x8(%rax), %xmm2
mulsd 0x296c14(%rip), %xmm2   # 0x3dab90
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x296c1b(%rip)   # 0x3dabd0
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x296ba8(%rip), %xmm0   # 0x3dab80
movsd %xmm0, -0x50(%rbp)
movsd 0x2b0f3(%rip), %xmm0    # 0x16f0d8
mulsd 0x8b553(%rip), %xmm0    # 0x1cf540
mulsd 0x296c0b(%rip), %xmm0   # 0x3dac00
mulsd 0x296bfb(%rip), %xmm0   # 0x3dabf8
movq -0x30(%rbp), %rax
mulsd (%rax), %xmm0
movsd -0x40(%rbp), %xmm1
movsd -0x40(%rbp), %xmm3
movsd -0x48(%rbp), %xmm2
mulsd -0x48(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x296b58(%rip), %xmm3   # 0x3dab98
movq -0x20(%rbp), %rax
movsd 0x2b104(%rip), %xmm2    # 0x16f150
mulsd (%rax), %xmm2
movq -0x20(%rbp), %rax
mulsd 0x8(%rax), %xmm2
mulsd 0x296b2f(%rip), %xmm2   # 0x3dab90
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x296b1e(%rip)   # 0x3dabb8
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x296acb(%rip), %xmm0   # 0x3dab88
movsd %xmm0, -0x50(%rbp)
movsd 0x4abb6(%rip), %xmm0    # 0x18ec80
mulsd 0x8b46e(%rip), %xmm0    # 0x1cf540
mulsd 0x296b1e(%rip), %xmm0   # 0x3dabf8
movq -0x28(%rbp), %rax
mulsd (%rax), %xmm0
movsd -0x40(%rbp), %xmm1
movsd -0x40(%rbp), %xmm3
movsd -0x48(%rbp), %xmm2
mulsd -0x48(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x296a73(%rip), %xmm3   # 0x3dab90
movq -0x18(%rbp), %rax
movsd 0x2b027(%rip), %xmm2    # 0x16f150
mulsd (%rax), %xmm2
movq -0x18(%rbp), %rax
mulsd 0x8(%rax), %xmm2
mulsd 0x296a5a(%rip), %xmm2   # 0x3dab98
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x296a60(%rip)   # 0x3dabc0
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x2969fd(%rip), %xmm0   # 0x3dab80
movsd %xmm0, -0x50(%rbp)
movsd 0x4aaf0(%rip), %xmm0    # 0x18ec80
mulsd 0x8b3a8(%rip), %xmm0    # 0x1cf540
mulsd 0x296a58(%rip), %xmm0   # 0x3dabf8
movq -0x30(%rbp), %rax
mulsd (%rax), %xmm0
movsd -0x40(%rbp), %xmm1
movsd -0x40(%rbp), %xmm3
movsd -0x48(%rbp), %xmm2
mulsd -0x48(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x2969ad(%rip), %xmm3   # 0x3dab90
movq -0x20(%rbp), %rax
movsd 0x2af61(%rip), %xmm2    # 0x16f150
mulsd (%rax), %xmm2
movq -0x20(%rbp), %rax
mulsd 0x8(%rax), %xmm2
mulsd 0x296994(%rip), %xmm2   # 0x3dab98
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd -0x50(%rbp), %xmm1
mulsd -0x50(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x296982(%rip)   # 0x3daba8
movsd 0x2969aa(%rip), %xmm0   # 0x3dabd8
addsd 0x296992(%rip), %xmm0   # 0x3dabc8
movsd %xmm0, 0x2969b2(%rip)   # 0x3dabf0
movsd 0x29698a(%rip), %xmm0   # 0x3dabd0
addsd 0x29696a(%rip), %xmm0   # 0x3dabb8
movsd %xmm0, 0x296992(%rip)   # 0x3dabe8
movsd 0x296962(%rip), %xmm0   # 0x3dabc0
addsd 0x296942(%rip), %xmm0   # 0x3daba8
movsd %xmm0, 0x296972(%rip)   # 0x3dabe0
movsd 0x29697a(%rip), %xmm1   # 0x3dabf0
mulsd 0x296922(%rip), %xmm1   # 0x3daba0
movsd 0x296972(%rip), %xmm2   # 0x3dabf8
movsd 0x296952(%rip), %xmm0   # 0x3dabe0
mulsd 0x29691a(%rip), %xmm0   # 0x3dabb0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x29692b(%rip), %xmm0   # 0x3dabe8
mulsd 0x29693b(%rip), %xmm0   # 0x3dac00
movsd 0x2968d3(%rip), %xmm2   # 0x3daba0
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, (%rax)
movsd 0x2968f4(%rip), %xmm1   # 0x3dabf0
mulsd 0x2968ac(%rip), %xmm1   # 0x3dabb0
movsd 0x2968ec(%rip), %xmm2   # 0x3dabf8
movsd 0x2968cc(%rip), %xmm0   # 0x3dabe0
mulsd 0x296884(%rip), %xmm0   # 0x3daba0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x2968bc(%rip), %xmm0   # 0x3dabe8
mulsd 0x2968cc(%rip), %xmm0   # 0x3dac00
movsd 0x296874(%rip), %xmm2   # 0x3dabb0
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, 0x8(%rax)
movsd 0x296884(%rip), %xmm0   # 0x3dabf0
movsd 0x29688c(%rip), %xmm2   # 0x3dac00
movsd 0x29686c(%rip), %xmm1   # 0x3dabe8
mulsd 0x296874(%rip), %xmm1   # 0x3dabf8
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x38(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)