// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r15
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
testq %r12, %r12
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 0xec44a
movq %r9, %rbx
movq %rsi, %r13
movq %rdi, %r14
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 %r8, -0x30(%rbp)
jb 0xec101
sqrtsd %xmm0, %xmm0
jmp 0xec10a
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28f65e(%rip)   # 0x37b770
movsd 0x10(%r14), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x28f684(%rip)   # 0x37b7a8
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xec147
sqrtsd %xmm0, %xmm0
jmp 0xec14c
callq 0x9270
movsd 0x28f61c(%rip), %xmm1   # 0x37b770
divsd %xmm1, %xmm0
movsd %xmm0, 0x28f640(%rip)   # 0x37b7a0
movsd 0x8(%r14), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28f622(%rip)   # 0x37b798
movsd (%r14), %xmm3
divsd %xmm0, %xmm3
divsd %xmm1, %xmm3
movsd %xmm3, 0x28f605(%rip)   # 0x37b790
movapd %xmm3, %xmm0
addsd %xmm3, %xmm3
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm2
mulsd %xmm0, %xmm0
subsd %xmm2, %xmm0
movsd %xmm0, 0x28f5d5(%rip)   # 0x37b780
movsd %xmm3, 0x28f5d5(%rip)   # 0x37b788
movsd (%r15), %xmm1
movsd 0x8(%r15), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%r15), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0xec1e8
sqrtsd %xmm0, %xmm0
jmp 0xec1f1
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28f57f(%rip)   # 0x37b778
movsd (%r13), %xmm1
movsd 0x8(%r13), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%r13), %xmm0
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xec22b
sqrtsd %xmm0, %xmm0
jmp 0xec230
callq 0x9270
movq -0x30(%rbp), %rax
movsd 0x28f563(%rip), %xmm14  # 0x37b7a0
movsd (%r13), %xmm4
movsd 0x8(%r13), %xmm8
movapd %xmm14, %xmm1
mulsd %xmm14, %xmm1
mulsd 0x40145(%rip), %xmm1    # 0x12c3a0
movsd (%r12), %xmm5
movapd %xmm1, %xmm6
mulsd %xmm5, %xmm6
movapd %xmm4, %xmm2
movsd 0x1f7ab(%rip), %xmm7    # 0x10ba20
movapd %xmm4, %xmm9
mulsd %xmm7, %xmm9
mulsd %xmm8, %xmm9
addsd %xmm4, %xmm4
mulsd %xmm8, %xmm4
mulsd %xmm8, %xmm8
mulsd %xmm2, %xmm2
subsd %xmm8, %xmm2
movsd 0x28f4e4(%rip), %xmm11  # 0x37b788
movsd 0x28f4d3(%rip), %xmm10  # 0x37b780
mulsd %xmm10, %xmm9
movapd %xmm2, %xmm3
mulsd %xmm11, %xmm3
addsd %xmm9, %xmm3
mulsd %xmm3, %xmm6
mulsd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
divsd %xmm0, %xmm6
movsd (%r15), %xmm12
movsd 0x8(%r15), %xmm15
movsd 0x28f493(%rip), %xmm9   # 0x37b778
movsd (%rax), %xmm13
mulsd %xmm13, %xmm1
movapd %xmm12, %xmm8
mulsd %xmm12, %xmm7
mulsd %xmm15, %xmm7
addsd %xmm12, %xmm12
mulsd %xmm15, %xmm12
mulsd %xmm15, %xmm15
mulsd %xmm8, %xmm8
subsd %xmm15, %xmm8
mulsd %xmm10, %xmm7
movapd %xmm8, %xmm15
mulsd %xmm11, %xmm15
addsd %xmm7, %xmm15
mulsd %xmm15, %xmm1
mulsd %xmm9, %xmm9
divsd %xmm9, %xmm1
addsd %xmm6, %xmm1
movsd 0x28f462(%rip), %xmm7   # 0x37b7a8
movsd 0x4005a(%rip), %xmm6    # 0x12c3a8
mulsd %xmm7, %xmm6
mulsd %xmm14, %xmm6
movapd %xmm5, %xmm0
mulsd %xmm6, %xmm5
mulsd %xmm3, %xmm5
mulsd %xmm13, %xmm6
mulsd %xmm15, %xmm6
mulsd %xmm11, %xmm4
mulsd %xmm10, %xmm2
addsd %xmm4, %xmm2
movsd 0x4002d(%rip), %xmm4    # 0x12c3b0
mulsd %xmm14, %xmm4
mulsd %xmm4, %xmm0
mulsd %xmm0, %xmm2
movsd -0x38(%rbp), %xmm0
divsd %xmm0, %xmm5
divsd %xmm0, %xmm2
mulsd %xmm13, %xmm4
mulsd %xmm11, %xmm12
divsd %xmm9, %xmm6
mulsd %xmm10, %xmm8
addsd %xmm12, %xmm8
mulsd %xmm4, %xmm8
divsd %xmm9, %xmm8
addsd %xmm2, %xmm8
addsd %xmm5, %xmm6
movsd 0x28f3bf(%rip), %xmm0   # 0x37b790
movapd %xmm1, %xmm3
mulsd %xmm0, %xmm3
movsd 0x28f3b7(%rip), %xmm2   # 0x37b798
movapd 0x1cdb7(%rip), %xmm4    # 0x1091a0
xorpd %xmm6, %xmm4
mulsd %xmm7, %xmm4
movapd %xmm4, %xmm5
movapd %xmm1, %xmm9
mulsd %xmm2, %xmm9
mulsd %xmm2, %xmm4
mulsd %xmm8, %xmm2
mulsd %xmm14, %xmm3
subsd %xmm2, %xmm3
mulsd %xmm0, %xmm5
addsd %xmm3, %xmm5
movsd %xmm5, (%rbx)
mulsd %xmm0, %xmm8
mulsd %xmm14, %xmm9
addsd %xmm8, %xmm9
addsd %xmm9, %xmm4
movsd %xmm4, 0x8(%rbx)
mulsd %xmm14, %xmm6
mulsd %xmm7, %xmm1
addsd %xmm6, %xmm1
movsd %xmm1, 0x10(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq