// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %r13
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %sil
orb %al, %sil
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %dl
orb %al, %dl
orb %sil, %dl
testq %r8, %r8
sete %al
testq %r9, %r9
sete %sil
orb %al, %sil
orb %dl, %sil
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0xec99b
movq %r9, %rbx
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 %rcx, -0x38(%rbp)
movq %r8, %r12
jb 0xec4ee
sqrtsd %xmm0, %xmm0
jmp 0xec4f7
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28f111(%rip)   # 0x37b610
movsd 0x10(%r14), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x28f127(%rip)   # 0x37b638
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xec534
sqrtsd %xmm0, %xmm0
jmp 0xec539
callq 0x9270
movsd 0x28f0cf(%rip), %xmm1   # 0x37b610
divsd %xmm1, %xmm0
movsd %xmm0, 0x28f0e3(%rip)   # 0x37b630
movsd 0x8(%r14), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28f0c5(%rip)   # 0x37b628
movsd (%r14), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28f0a8(%rip)   # 0x37b620
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 0xec5ad
sqrtsd %xmm0, %xmm0
jmp 0xec5b6
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28f05a(%rip)   # 0x37b618
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 0xec5f0
sqrtsd %xmm0, %xmm0
jmp 0xec5f5
callq 0x9270
movsd %xmm0, -0x30(%rbp)
movq -0x38(%rbp), %rcx
movsd 0x28f032(%rip), %xmm1   # 0x37b638
movapd %xmm1, %xmm7
movapd %xmm1, %xmm4
mulsd %xmm1, %xmm7
movsd 0x28f015(%rip), %xmm9   # 0x37b630
movsd %xmm9, -0x50(%rbp)
mulsd %xmm9, %xmm9
subsd %xmm7, %xmm9
mulsd 0x3fd85(%rip), %xmm7    # 0x12c3b8
movsd (%rcx), %xmm5
movapd %xmm5, %xmm6
mulsd %xmm7, %xmm6
movapd %xmm7, %xmm13
movsd %xmm7, -0x60(%rbp)
movsd 0x10(%r13), %xmm8
mulsd %xmm8, %xmm6
movsd 0x28efc4(%rip), %xmm3   # 0x37b620
movsd (%r13), %xmm10
movsd 0x8(%r13), %xmm1
movsd 0x28efb8(%rip), %xmm7   # 0x37b628
movapd %xmm1, %xmm2
mulsd %xmm7, %xmm2
movapd %xmm10, %xmm11
mulsd %xmm3, %xmm11
addsd %xmm2, %xmm11
mulsd %xmm6, %xmm11
movsd (%r15), %xmm6
movsd 0x8(%r15), %xmm2
movapd %xmm7, %xmm12
mulsd %xmm2, %xmm12
movapd %xmm6, %xmm15
mulsd %xmm3, %xmm15
addsd %xmm12, %xmm15
movsd (%r12), %xmm12
mulsd %xmm12, %xmm13
movsd 0x10(%r15), %xmm14
mulsd %xmm14, %xmm13
mulsd %xmm13, %xmm15
movsd -0x30(%rbp), %xmm0
mulsd %xmm0, %xmm0
divsd %xmm0, %xmm11
movsd 0x28ef36(%rip), %xmm13  # 0x37b618
mulsd %xmm13, %xmm13
divsd %xmm13, %xmm15
movsd %xmm13, -0x68(%rbp)
addsd %xmm11, %xmm15
movsd 0x3fcc0(%rip), %xmm11   # 0x12c3c0
movsd %xmm4, -0x40(%rbp)
mulsd %xmm4, %xmm11
mulsd %xmm11, %xmm9
mulsd %xmm9, %xmm5
mulsd %xmm8, %xmm5
mulsd %xmm3, %xmm1
mulsd %xmm7, %xmm10
subsd %xmm1, %xmm10
mulsd %xmm5, %xmm10
divsd %xmm0, %xmm10
movapd %xmm0, %xmm8
mulsd %xmm12, %xmm9
mulsd %xmm14, %xmm9
mulsd %xmm3, %xmm2
mulsd %xmm7, %xmm6
subsd %xmm2, %xmm6
mulsd %xmm9, %xmm6
divsd %xmm13, %xmm6
addsd %xmm10, %xmm6
movsd 0x1f2a5(%rip), %xmm1    # 0x10ba08
mulsd %xmm1, %xmm6
mulsd %xmm1, %xmm15
movapd 0x1ca2b(%rip), %xmm10   # 0x1091a0
movsd -0x50(%rbp), %xmm0
movapd %xmm0, %xmm1
mulsd %xmm15, %xmm1
movapd %xmm1, %xmm5
movsd %xmm1, -0x30(%rbp)
xorpd %xmm10, %xmm15
mulsd %xmm4, %xmm15
movapd %xmm3, %xmm12
mulsd %xmm15, %xmm12
movapd %xmm6, %xmm1
mulsd %xmm7, %xmm1
subsd %xmm1, %xmm12
movsd %xmm12, (%rbx)
mulsd %xmm7, %xmm15
mulsd %xmm3, %xmm6
addsd %xmm15, %xmm6
movsd %xmm6, 0x8(%rbx)
movsd %xmm5, 0x10(%rbx)
movapd %xmm7, %xmm1
movsd %xmm7, -0x48(%rbp)
mulsd %xmm7, %xmm1
movapd %xmm3, %xmm13
movsd %xmm3, -0x58(%rbp)
mulsd %xmm3, %xmm13
subsd %xmm1, %xmm13
movsd (%r13), %xmm4
movapd %xmm4, %xmm1
addsd %xmm4, %xmm1
movsd 0x8(%r13), %xmm5
mulsd %xmm5, %xmm1
movapd %xmm4, %xmm14
movsd 0x1f20f(%rip), %xmm11   # 0x10ba20
mulsd %xmm11, %xmm4
mulsd %xmm5, %xmm4
mulsd %xmm5, %xmm5
mulsd %xmm14, %xmm14
subsd %xmm5, %xmm14
movapd %xmm3, %xmm5
addsd %xmm3, %xmm5
mulsd %xmm7, %xmm5
mulsd %xmm5, %xmm1
movapd %xmm8, %xmm9
movapd %xmm14, %xmm15
mulsd %xmm13, %xmm15
addsd %xmm1, %xmm15
movsd 0x3fb64(%rip), %xmm7    # 0x12c3b8
mulsd -0x40(%rbp), %xmm7
mulsd %xmm0, %xmm7
movapd %xmm0, %xmm8
movsd (%rcx), %xmm3
movapd %xmm7, %xmm0
mulsd %xmm3, %xmm0
mulsd %xmm0, %xmm15
movsd (%r15), %xmm1
movapd %xmm1, %xmm0
movapd %xmm1, %xmm2
mulsd %xmm11, %xmm1
addsd %xmm2, %xmm2
movsd 0x8(%r15), %xmm11
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm1
mulsd %xmm11, %xmm11
mulsd %xmm0, %xmm0
subsd %xmm11, %xmm0
mulsd %xmm5, %xmm2
movapd %xmm0, %xmm11
mulsd %xmm13, %xmm11
addsd %xmm2, %xmm11
movsd (%r12), %xmm2
mulsd %xmm2, %xmm7
mulsd %xmm7, %xmm11
divsd %xmm9, %xmm15
movsd -0x68(%rbp), %xmm7
divsd %xmm7, %xmm11
addsd %xmm15, %xmm11
mulsd %xmm13, %xmm4
mulsd %xmm5, %xmm14
addsd %xmm4, %xmm14
movapd %xmm8, %xmm4
movsd -0x60(%rbp), %xmm8
mulsd %xmm4, %xmm8
mulsd %xmm8, %xmm3
mulsd %xmm3, %xmm14
divsd %xmm9, %xmm14
mulsd %xmm2, %xmm8
mulsd %xmm13, %xmm1
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
mulsd %xmm8, %xmm0
divsd %xmm7, %xmm0
addsd %xmm14, %xmm0
movsd 0x1f0d5(%rip), %xmm1    # 0x10ba08
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm11
movapd %xmm0, %xmm1
movsd -0x48(%rbp), %xmm2
mulsd %xmm2, %xmm1
subsd %xmm1, %xmm12
xorpd %xmm11, %xmm10
mulsd -0x40(%rbp), %xmm10
movapd %xmm10, %xmm1
movsd -0x58(%rbp), %xmm3
mulsd %xmm3, %xmm1
addsd %xmm12, %xmm1
movsd %xmm1, (%rbx)
mulsd %xmm3, %xmm0
addsd %xmm6, %xmm0
mulsd %xmm2, %xmm10
addsd %xmm0, %xmm10
movsd %xmm10, 0x8(%rbx)
mulsd %xmm4, %xmm11
addsd -0x30(%rbp), %xmm11
movsd %xmm11, 0x10(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq