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

    static double l1d = .0012;
    static double l1sd = .0024;

    /* 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, dnsun, l1;
    static double de, dn, cosphi, sinphi;

/*** this subroutine gives the corrections induced by the latitude depende
nce*/
/* given by l^(1) in mahtews et al (1991) */
/*  input: xsta,xsun,xmon,fac3sun,fac3mon */
/* output: xcorsta */

    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); 

    /* 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;
    rmon = enorm8_(&xmon[0]);
    rsun = enorm8_(&xsun[0]);
/* for the diurnal band */
    l1 = l1d;
/* Computing 2nd power */
    d__1 = sinphi;
/* Computing 2nd power */
    d__2 = rsun;
    dnsun = -l1 * (d__1 * d__1) * *fac2sun * xsun[2] * (xsun[0] * cosla + 
            xsun[1] * sinla) / (d__2 * d__2);
/* Computing 2nd power */
    d__1 = sinphi;
/* Computing 2nd power */
    d__2 = rmon;
    dnmon = -l1 * (d__1 * d__1) * *fac2mon * xmon[2] * (xmon[0] * cosla + 
            xmon[1] * sinla) / (d__2 * d__2);
/* Computing 2nd power */
    d__1 = cosphi;
/* Computing 2nd power */
    d__2 = sinphi;
/* Computing 2nd power */
    d__3 = rsun;
    desun = l1 * sinphi * (d__1 * d__1 - d__2 * d__2) * *fac2sun * xsun[2] * (
            xsun[0] * sinla - xsun[1] * cosla) / (d__3 * d__3);
/* Computing 2nd power */
    d__1 = cosphi;
/* Computing 2nd power */
    d__2 = sinphi;
/* Computing 2nd power */
    d__3 = rmon;
    demon = l1 * sinphi * (d__1 * d__1 - d__2 * d__2) * *fac2mon * xmon[2] * (
            xmon[0] * sinla - xmon[1] * cosla) / (d__3 * d__3);
    de = (desun + demon) * 3.;
    dn = (dnsun + dnmon) * 3.;
    xcorsta[0] = -de * sinla - dn * sinphi * cosla;
    xcorsta[1] = de * cosla - dn * sinphi * sinla;
    xcorsta[2] = dn * cosphi;
/* for the semi-diurnal band */
    l1 = l1sd;
/* 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;
/* Computing 2nd power */
    d__1 = xsun[0];
/* Computing 2nd power */
    d__2 = xsun[1];
/* Computing 2nd power */
    d__3 = rsun;
    dnsun = -l1 / 2. * sinphi * cosphi * *fac2sun * ((d__1 * d__1 - d__2 * 
            d__2) * costwola + xsun[0] * 2. * 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;
    dnmon = -l1 / 2. * sinphi * cosphi * *fac2mon * ((d__1 * d__1 - d__2 * 
            d__2) * costwola + xmon[0] * 2. * xmon[1] * sintwola) / (d__3 * 
            d__3);
/* Computing 2nd power */
    d__1 = sinphi;
/* Computing 2nd power */
    d__2 = xsun[0];
/* Computing 2nd power */
    d__3 = xsun[1];
/* Computing 2nd power */
    d__4 = rsun;
    desun = -l1 / 2. * (d__1 * d__1) * cosphi * *fac2sun * ((d__2 * d__2 - 
            d__3 * d__3) * sintwola - xsun[0] * 2. * xsun[1] * costwola) / (
            d__4 * d__4);
/* Computing 2nd power */
    d__1 = sinphi;
/* Computing 2nd power */
    d__2 = xmon[0];
/* Computing 2nd power */
    d__3 = xmon[1];
/* Computing 2nd power */
    d__4 = rmon;
    demon = -l1 / 2. * (d__1 * d__1) * cosphi * *fac2mon * ((d__2 * d__2 - 
            d__3 * d__3) * sintwola - xmon[0] * 2. * xmon[1] * costwola) / (
            d__4 * d__4);
    de = (desun + demon) * 3.;
    dn = (dnsun + dnmon) * 3.;
    xcorsta[0] = xcorsta[0] - de * sinla - dn * sinphi * cosla;
    xcorsta[1] = xcorsta[1] + de * cosla - dn * sinphi * sinla;
    xcorsta[2] += 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 0xd85c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
pushq %rbp
movq %rsp, %rbp
movsd (%rdi), %xmm4
movsd 0x8(%rdi), %xmm2
movapd %xmm2, %xmm0
mulsd %xmm2, %xmm0
movapd %xmm4, %xmm1
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rdi), %xmm3
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
divsd %xmm0, %xmm3
movapd %xmm3, %xmm5
sqrtsd %xmm1, %xmm1
divsd %xmm0, %xmm1
divsd %xmm1, %xmm2
divsd %xmm0, %xmm2
movapd %xmm2, %xmm7
divsd %xmm1, %xmm4
divsd %xmm0, %xmm4
movapd %xmm4, %xmm8
movsd (%rdx), %xmm10
movsd 0x8(%rdx), %xmm3
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
movapd %xmm10, %xmm4
mulsd %xmm10, %xmm4
addsd %xmm0, %xmm4
movsd 0x10(%rdx), %xmm9
movapd %xmm5, %xmm6
movapd %xmm5, %xmm13
mulsd %xmm5, %xmm6
movapd %xmm1, %xmm11
movapd %xmm1, %xmm15
mulsd %xmm1, %xmm11
subsd %xmm6, %xmm11
mulsd 0x3dd5a(%rip), %xmm6    # 0x1163c8
movsd (%rcx), %xmm0
movapd %xmm0, %xmm2
movsd (%r8), %xmm5
movapd %xmm6, %xmm1
movapd %xmm6, %xmm14
movsd %xmm6, -0x38(%rbp)
mulsd %xmm5, %xmm1
mulsd %xmm9, %xmm1
movsd 0x3dd35(%rip), %xmm12   # 0x1163d0
mulsd %xmm13, %xmm12
movapd %xmm13, %xmm6
mulsd %xmm12, %xmm11
mulsd %xmm11, %xmm0
mulsd %xmm5, %xmm11
mulsd %xmm9, %xmm11
movapd %xmm9, %xmm5
mulsd %xmm9, %xmm5
addsd %xmm4, %xmm5
movsd (%rsi), %xmm9
movsd 0x8(%rsi), %xmm4
movapd %xmm4, %xmm12
mulsd %xmm4, %xmm12
movapd %xmm9, %xmm13
mulsd %xmm9, %xmm13
addsd %xmm12, %xmm13
mulsd %xmm14, %xmm2
movsd 0x10(%rsi), %xmm12
mulsd %xmm12, %xmm2
mulsd %xmm12, %xmm0
mulsd %xmm12, %xmm12
addsd %xmm13, %xmm12
movapd %xmm7, %xmm13
mulsd %xmm4, %xmm13
movapd %xmm9, %xmm14
mulsd %xmm8, %xmm14
addsd %xmm13, %xmm14
mulsd %xmm2, %xmm14
movapd %xmm7, %xmm13
mulsd %xmm3, %xmm13
movapd %xmm10, %xmm2
mulsd %xmm8, %xmm2
addsd %xmm13, %xmm2
mulsd %xmm1, %xmm2
sqrtsd %xmm5, %xmm1
sqrtsd %xmm12, %xmm5
mulsd %xmm5, %xmm5
divsd %xmm5, %xmm14
movsd %xmm5, -0x28(%rbp)
mulsd %xmm1, %xmm1
divsd %xmm1, %xmm2
movsd %xmm1, -0x20(%rbp)
addsd %xmm14, %xmm2
mulsd %xmm8, %xmm4
mulsd %xmm7, %xmm9
subsd %xmm4, %xmm9
mulsd %xmm0, %xmm9
divsd %xmm5, %xmm9
mulsd %xmm8, %xmm3
mulsd %xmm7, %xmm10
subsd %xmm3, %xmm10
mulsd %xmm11, %xmm10
divsd %xmm1, %xmm10
addsd %xmm9, %xmm10
movsd 0x1d2d4(%rip), %xmm0    # 0xf5a80
mulsd %xmm0, %xmm10
mulsd %xmm0, %xmm2
movapd 0x1a9f2(%rip), %xmm9    # 0xf31b0
movapd %xmm15, %xmm11
movapd %xmm15, %xmm0
mulsd %xmm2, %xmm0
movapd %xmm0, %xmm1
movsd %xmm0, -0x30(%rbp)
xorpd %xmm9, %xmm2
movapd %xmm6, %xmm3
movsd %xmm6, -0x10(%rbp)
mulsd %xmm6, %xmm2
movapd %xmm8, %xmm12
mulsd %xmm2, %xmm12
movapd %xmm10, %xmm0
mulsd %xmm7, %xmm0
subsd %xmm0, %xmm12
movsd %xmm12, (%r9)
mulsd %xmm7, %xmm2
mulsd %xmm8, %xmm10
addsd %xmm2, %xmm10
movsd %xmm10, 0x8(%r9)
movsd %xmm1, 0x10(%r9)
movapd %xmm7, %xmm0
movapd %xmm7, %xmm2
movsd %xmm7, -0x8(%rbp)
mulsd %xmm7, %xmm0
movapd %xmm8, %xmm13
movapd %xmm8, %xmm7
movsd %xmm8, -0x18(%rbp)
mulsd %xmm8, %xmm13
subsd %xmm0, %xmm13
movsd (%rsi), %xmm6
movapd %xmm6, %xmm0
addsd %xmm6, %xmm0
movsd 0x8(%rsi), %xmm1
mulsd %xmm1, %xmm0
movapd %xmm6, %xmm14
movsd 0x1d22d(%rip), %xmm4    # 0xf5a98
mulsd %xmm4, %xmm6
mulsd %xmm1, %xmm6
mulsd %xmm1, %xmm1
mulsd %xmm14, %xmm14
subsd %xmm1, %xmm14
addsd %xmm8, %xmm7
mulsd %xmm2, %xmm7
mulsd %xmm7, %xmm0
movapd %xmm14, %xmm15
mulsd %xmm13, %xmm15
addsd %xmm0, %xmm15
movsd 0x3db22(%rip), %xmm8    # 0x1163c8
mulsd %xmm3, %xmm8
mulsd %xmm11, %xmm8
movsd (%rcx), %xmm5
movapd %xmm8, %xmm0
mulsd %xmm5, %xmm0
mulsd %xmm0, %xmm15
movsd (%rdx), %xmm3
movapd %xmm3, %xmm0
movapd %xmm3, %xmm2
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm2
movsd 0x8(%rdx), %xmm1
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm3
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
subsd %xmm1, %xmm0
mulsd %xmm7, %xmm2
movapd %xmm0, %xmm1
mulsd %xmm13, %xmm1
addsd %xmm2, %xmm1
movsd (%r8), %xmm4
mulsd %xmm4, %xmm8
mulsd %xmm8, %xmm1
movsd -0x28(%rbp), %xmm2
divsd %xmm2, %xmm15
movsd -0x20(%rbp), %xmm8
divsd %xmm8, %xmm1
addsd %xmm15, %xmm1
mulsd %xmm13, %xmm6
mulsd %xmm7, %xmm14
addsd %xmm6, %xmm14
movsd -0x38(%rbp), %xmm6
mulsd %xmm11, %xmm6
mulsd %xmm6, %xmm5
mulsd %xmm5, %xmm14
divsd %xmm2, %xmm14
mulsd %xmm4, %xmm6
mulsd %xmm13, %xmm3
mulsd %xmm7, %xmm0
addsd %xmm3, %xmm0
mulsd %xmm6, %xmm0
divsd %xmm8, %xmm0
addsd %xmm14, %xmm0
movsd 0x1d109(%rip), %xmm2    # 0xf5a80
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm1
movapd %xmm0, %xmm2
movsd -0x8(%rbp), %xmm4
mulsd %xmm4, %xmm2
subsd %xmm2, %xmm12
xorpd %xmm1, %xmm9
mulsd -0x10(%rbp), %xmm9
movapd %xmm9, %xmm2
movsd -0x18(%rbp), %xmm3
mulsd %xmm3, %xmm2
addsd %xmm12, %xmm2
movsd %xmm2, (%r9)
mulsd %xmm3, %xmm0
addsd %xmm10, %xmm0
mulsd %xmm4, %xmm9
addsd %xmm0, %xmm9
movsd %xmm9, 0x8(%r9)
mulsd %xmm11, %xmm1
addsd -0x30(%rbp), %xmm1
movsd %xmm1, 0x10(%r9)
xorl %eax, %eax
popq %rbp
retq