// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: step2lon_(double*, double*, double*, double*)
int step2lon_(double *xsta, double *fhr, double *t, double *xcorsta)
{
    /* Initialized data */

    static double deg2rad = .017453292519943295769;
    static double datdi[45] /* was [9][5] */ = { 0.,0.,0.,1.,0.,.47,.23,
            .16,.07,0.,2.,0.,0.,0.,-.2,-.12,-.11,-.05,1.,0.,-1.,0.,0.,-.11,
            -.08,-.09,-.04,2.,0.,0.,0.,0.,-.13,-.11,-.15,-.07,2.,0.,0.,1.,0.,
            -.05,-.05,-.06,-.03 };

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

    /* Local variables */
    static double rsta, h;
    static int i, j;
    static double p, s, cosla, sinla, de, dn, dr, pr, ps, thetaf, cosphi, 
            dn_tot__, sinphi, dr_tot__, zns;

    if(xsta == 0) return (-1);
    if(fhr == 0) return (-1);
    if(t == 0) return (-1);
    if(xcorsta == 0) return (-1);

    /* Function Body */
/* cf. table 7.5b of IERS conventions 2003 (TN.32, pg.82) */
/* columns are s,h,p,N',ps, dR(ip),dT(ip),dR(op),dT(op) */
/* IERS cols.= s,h,p,N',ps, dR(ip),dR(op),dT(ip),dT(op) */
/* units of mm */
/* Computing 3rd power */
    d__1 = *t, d__2 = d__1;
    s = *t * 481267.88194 + 218.31664563 - *t * .0014663889 * *t + d__2 * (
            d__1 * d__1) * 1.85139e-6;
/* Computing 3rd power */
    d__1 = *t, d__2 = d__1;
/* Computing 4th power */
    d__3 = *t, d__3 *= d__3;
    pr = *t * 1.396971278f + *t * 3.08889e-4f * *t + d__2 * (d__1 * d__1) * 
            2.1e-8f + d__3 * d__3 * 7e-9f;
    s += pr;
/* Computing 3rd power */
    d__1 = *t, d__2 = d__1;
/* Computing 4th power */
    d__3 = *t, d__3 *= d__3;
    h = *t * 36000.7697489 + 280.46645 + *t * 3.0322222e-4 * *t + d__2 * (
            d__1 * d__1) * 2e-8f - d__3 * d__3 * 6.54e-9f;
/* Computing 3rd power */
    d__1 = *t, d__2 = d__1;
/* Computing 4th power */
    d__3 = *t, d__3 *= d__3;
    p = *t * 4069.01363525 + 83.35324312 - *t * .01032172222 * *t - d__2 * (
            d__1 * d__1) * 1.24991e-5 + d__3 * d__3 * 5.263e-8;
/* Computing 3rd power */
    d__1 = *t, d__2 = d__1;
/* Computing 4th power */
    d__3 = *t, d__3 *= d__3;
    zns = *t * 1934.13626197 + 234.95544499 - *t * .00207561111 * *t - d__2 * 
            (d__1 * d__1) * 2.13944e-6 + d__3 * d__3 * 1.65e-8;
/* Computing 3rd power */
    d__1 = *t, d__2 = d__1;
/* Computing 4th power */
    d__3 = *t, d__3 *= d__3;
    ps = *t * 1.71945766667 + 282.93734098 + *t * 4.5688889e-4 * *t - d__2 * (
            d__1 * d__1) * 1.778e-8 - d__3 * d__3 * 3.34e-9;
/* Computing 2nd power */
    d__1 = xsta[0];
/* Computing 2nd power */
    d__2 = xsta[1];
/* Computing 2nd power */
    d__3 = xsta[2];
    rsta = sqrt(d__1 * d__1 + d__2 * d__2 + d__3 * d__3);
    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;
    cosla = xsta[0] / cosphi / rsta;
    sinla = xsta[1] / cosphi / rsta;
/* reduce angles to between 0 and 360 */
    s = d_mod(&s, &c_b56);
/* **** tau=dmod(tau,360.d0)       !*** tau not used here--09jul28 */
    h = d_mod(&h, &c_b56);
    p = d_mod(&p, &c_b56);
    zns = d_mod(&zns, &c_b56);
    ps = d_mod(&ps, &c_b56);
    dr_tot__ = 0.;
    dn_tot__ = 0.;
    for(i=0; i<= 2; ++i) {
        xcorsta[i] = 0.;
    }
/*             1 2 3 4   5   6      7      8      9 */
/* columns are s,h,p,N',ps, dR(ip),dT(ip),dR(op),dT(op) */
    for(j=1; j<=5; ++j) {
        thetaf = (datdi[j * 9 - 9] * s + datdi[j * 9 - 8] * h + datdi[j * 9 - 
                7] * p + datdi[j * 9 - 6] * zns + datdi[j * 9 - 5] * ps) * 
                deg2rad;
/* Computing 2nd power */
        d__1 = sinphi;
/* Computing 2nd power */
        d__2 = sinphi;
        dr = datdi[j * 9 - 4] * (d__1 * d__1 * 3. - 1.) / 2.f * cos(thetaf) + 
                datdi[j * 9 - 2] * (d__2 * d__2 * 3. - 1.) / 2.f * sin(thetaf)
                ;
        dn = datdi[j * 9 - 3] * (cosphi * sinphi * 2.) * cos(thetaf) + datdi[
                j * 9 - 1] * (cosphi * sinphi * 2.) * sin(thetaf);
        de = 0.;
        dr_tot__ += dr;
        dn_tot__ += dn;
        xcorsta[0] = xcorsta[0] + dr * cosla * cosphi - de * sinla - dn * 
                sinphi * cosla;
        xcorsta[1] = xcorsta[1] + dr * sinla * cosphi + de * cosla - dn * 
                sinphi * sinla;
        xcorsta[2] = xcorsta[2] + dr * sinphi + dn * cosphi;
    }
    for(i=0; i<= 2; ++i) {
        xcorsta[i] /= 1e3;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rcx, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
testq %rbx, %rbx
sete %sil
orb %al, %sil
orb %cl, %sil
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0xeddf8
movsd (%rdx), %xmm0
movsd 0x3ec7d(%rip), %xmm2    # 0x12c4a8
mulsd %xmm0, %xmm2
addsd 0x3ec79(%rip), %xmm2    # 0x12c4b0
movsd 0x3ec79(%rip), %xmm1    # 0x12c4b8
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x3ec8d(%rip), %xmm5    # 0x12c4e8
mulsd %xmm0, %xmm5
mulsd %xmm0, %xmm5
movsd 0x3ec85(%rip), %xmm6    # 0x12c4f0
mulsd %xmm0, %xmm6
movsd 0x3ec91(%rip), %xmm7    # 0x12c508
mulsd %xmm0, %xmm7
movsd 0x3ec94(%rip), %xmm8    # 0x12c518
mulsd %xmm0, %xmm8
mulsd %xmm0, %xmm8
movapd 0x1b91a(%rip), %xmm4    # 0x1091b0
movapd %xmm2, %xmm3
xorpd %xmm4, %xmm3
movsd 0x3ec89(%rip), %xmm9    # 0x12c530
mulsd %xmm0, %xmm9
movsd 0x3ec8b(%rip), %xmm10   # 0x12c540
mulsd %xmm0, %xmm10
mulsd %xmm0, %xmm10
xorpd %xmm0, %xmm4
movsd 0x3ec8c(%rip), %xmm11   # 0x12c558
mulsd %xmm0, %xmm11
movsd 0x3ec8e(%rip), %xmm12   # 0x12c568
mulsd %xmm0, %xmm12
mulsd %xmm0, %xmm12
movsd 0x3ec93(%rip), %xmm13   # 0x12c580
mulsd %xmm0, %xmm13
movsd 0x3ec95(%rip), %xmm14   # 0x12c590
mulsd %xmm0, %xmm14
mulsd %xmm0, %xmm14
movapd %xmm0, %xmm15
mulsd %xmm2, %xmm15
movsd 0x3eba9(%rip), %xmm0    # 0x12c4c0
mulsd %xmm15, %xmm0
addsd %xmm1, %xmm0
addsd %xmm5, %xmm6
movsd 0x3ebcc(%rip), %xmm5    # 0x12c4f8
mulsd %xmm15, %xmm5
addsd %xmm6, %xmm5
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm2
movsd 0x3ebb7(%rip), %xmm6    # 0x12c500
mulsd %xmm2, %xmm6
addsd %xmm5, %xmm6
addsd %xmm0, %xmm6
addsd 0x3ebb3(%rip), %xmm7    # 0x12c510
addsd %xmm7, %xmm8
mulsd 0x3ebb5(%rip), %xmm15   # 0x12c520
addsd %xmm8, %xmm15
movsd 0x3ebb0(%rip), %xmm0    # 0x12c528
mulsd %xmm3, %xmm0
addsd %xmm15, %xmm0
addsd 0x3ebae(%rip), %xmm9    # 0x12c538
movsd %xmm0, 0x28dcde(%rip)   # 0x37b670
addsd %xmm9, %xmm10
movsd 0x3eba9(%rip), %xmm0    # 0x12c548
mulsd %xmm4, %xmm0
addsd %xmm10, %xmm0
movsd 0x3eba0(%rip), %xmm5    # 0x12c550
mulsd %xmm2, %xmm5
addsd %xmm0, %xmm5
movsd %xmm5, 0x28dcc0(%rip)   # 0x37b680
addsd 0x3eb97(%rip), %xmm11   # 0x12c560
addsd %xmm11, %xmm12
movsd 0x3eb9a(%rip), %xmm0    # 0x12c570
mulsd %xmm4, %xmm0
mulsd 0x3eb96(%rip), %xmm2    # 0x12c578
addsd %xmm12, %xmm0
addsd %xmm0, %xmm2
addsd 0x3eb94(%rip), %xmm13   # 0x12c588
movsd %xmm2, 0x28dcdc(%rip)   # 0x37b6d8
addsd %xmm13, %xmm14
mulsd 0x3eb8f(%rip), %xmm4    # 0x12c598
addsd %xmm14, %xmm4
mulsd 0x3eb8a(%rip), %xmm3    # 0x12c5a0
addsd %xmm4, %xmm3
movsd %xmm3, 0x28dc86(%rip)   # 0x37b6a8
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm2
movsd 0x10(%rdi), %xmm3
movapd %xmm2, %xmm4
mulsd %xmm2, %xmm4
movapd %xmm0, %xmm5
mulsd %xmm0, %xmm5
addsd %xmm4, %xmm5
movapd %xmm3, %xmm4
mulsd %xmm3, %xmm4
addsd %xmm5, %xmm4
sqrtsd %xmm4, %xmm4
divsd %xmm4, %xmm3
movsd %xmm3, 0x28dc68(%rip)   # 0x37b6c8
xorps %xmm3, %xmm3
sqrtsd %xmm5, %xmm3
divsd %xmm4, %xmm3
movsd %xmm3, 0x28dc45(%rip)   # 0x37b6b8
divsd %xmm3, %xmm0
divsd %xmm4, %xmm0
movsd %xmm0, 0x28dc0d(%rip)   # 0x37b690
divsd %xmm3, %xmm2
divsd %xmm4, %xmm2
movsd %xmm2, 0x28dc05(%rip)   # 0x37b698
movsd 0x3069d(%rip), %xmm1    # 0x11e138
movapd %xmm6, %xmm0
callq 0x94d0
movsd %xmm0, 0x28dbdc(%rip)   # 0x37b688
movsd 0x28dbbc(%rip), %xmm0   # 0x37b670
movsd 0x3067c(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd %xmm0, 0x28dba7(%rip)   # 0x37b670
movsd 0x28dbaf(%rip), %xmm0   # 0x37b680
movsd 0x3065f(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd %xmm0, 0x28db9a(%rip)   # 0x37b680
movsd 0x28dbea(%rip), %xmm0   # 0x37b6d8
movsd 0x30642(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd %xmm0, 0x28dbd5(%rip)   # 0x37b6d8
movsd 0x28db9d(%rip), %xmm0   # 0x37b6a8
movsd 0x30625(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd %xmm0, 0x28db88(%rip)   # 0x37b6a8
xorl %eax, %eax
movq %rax, 0x28dba7(%rip)    # 0x37b6d0
movq %rax, 0x28db90(%rip)    # 0x37b6c0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq %rax, 0x10(%rbx)
movl $0x1, 0x28db32(%rip)    # 0x37b678
movl $0x1, %eax
movsd 0x28db74(%rip), %xmm8   # 0x37b6c8
leaq 0x3da45(%rip), %r14     # 0x12b5a0
leal (%rax,%rax,8), %eax
cltq
movsd -0x40(%r14,%rax,8), %xmm0
mulsd 0x28db01(%rip), %xmm0   # 0x37b670
movsd -0x48(%r14,%rax,8), %xmm1
mulsd 0x28db0a(%rip), %xmm1   # 0x37b688
addsd %xmm0, %xmm1
movsd -0x38(%r14,%rax,8), %xmm0
mulsd 0x28daef(%rip), %xmm0   # 0x37b680
addsd %xmm1, %xmm0
movsd -0x30(%r14,%rax,8), %xmm1
mulsd 0x28db34(%rip), %xmm1   # 0x37b6d8
addsd %xmm0, %xmm1
movsd -0x28(%r14,%rax,8), %xmm0
mulsd 0x28daf1(%rip), %xmm0   # 0x37b6a8
addsd %xmm1, %xmm0
mulsd 0x1dd4d(%rip), %xmm0    # 0x10b910
movsd %xmm0, 0x28dae5(%rip)   # 0x37b6b0
mulsd %xmm8, %xmm8
mulsd 0x1de2f(%rip), %xmm8    # 0x10ba08
addsd 0x1b516(%rip), %xmm8    # 0x1090f8
movsd %xmm8, -0x18(%rbp)
movsd -0x20(%r14,%rax,8), %xmm2
mulsd %xmm8, %xmm2
movsd 0x1b46c(%rip), %xmm1    # 0x109068
mulsd %xmm1, %xmm2
movsd %xmm2, -0x30(%rbp)
callq 0x9710
movsd %xmm0, -0x20(%rbp)
movslq 0x28da62(%rip), %rax    # 0x37b678
leaq (%rax,%rax,8), %rax
movsd -0x18(%rbp), %xmm0
mulsd -0x10(%r14,%rax,8), %xmm0
mulsd 0x1b43a(%rip), %xmm0    # 0x109068
movsd %xmm0, -0x18(%rbp)
movsd 0x28da75(%rip), %xmm0   # 0x37b6b0
callq 0x9080
mulsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x28da45(%rip)   # 0x37b6a0
movslq 0x28da16(%rip), %rax    # 0x37b678
leaq (%rax,%rax,8), %rax
movsd 0x28da4a(%rip), %xmm0   # 0x37b6b8
mulsd 0x28da52(%rip), %xmm0   # 0x37b6c8
addsd %xmm0, %xmm0
mulsd -0x18(%r14,%rax,8), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x28da22(%rip), %xmm0   # 0x37b6b0
callq 0x9710
movaps %xmm0, -0x30(%rbp)
movslq 0x28d9da(%rip), %rax    # 0x37b678
leaq (%rax,%rax,8), %rax
movsd 0x28da0e(%rip), %xmm0   # 0x37b6b8
mulsd 0x28da16(%rip), %xmm0   # 0x37b6c8
addsd %xmm0, %xmm0
mulsd -0x8(%r14,%rax,8), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x28d9e6(%rip), %xmm0   # 0x37b6b0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
movapd -0x30(%rbp), %xmm9
mulsd -0x18(%rbp), %xmm9
addsd %xmm0, %xmm9
movsd 0x28d9b3(%rip), %xmm0   # 0x37b6a0
movsd 0x28d9db(%rip), %xmm1   # 0x37b6d0
addsd %xmm0, %xmm1
movsd %xmm1, 0x28d9cf(%rip)   # 0x37b6d0
movsd 0x28d9b7(%rip), %xmm1   # 0x37b6c0
addsd %xmm9, %xmm1
movsd %xmm1, 0x28d9aa(%rip)   # 0x37b6c0
movsd 0x28d972(%rip), %xmm2   # 0x37b690
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm4
movsd 0x28d98a(%rip), %xmm1   # 0x37b6b8
mulsd %xmm1, %xmm4
addsd (%rbx), %xmm4
movsd 0x28d95a(%rip), %xmm3   # 0x37b698
movapd %xmm0, %xmm5
mulsd %xmm3, %xmm5
movapd %xmm3, %xmm6
mulsd 0x3ddae(%rip), %xmm6    # 0x12bb00
addsd %xmm4, %xmm6
movsd 0x28d969(%rip), %xmm8   # 0x37b6c8
movapd %xmm9, %xmm4
xorpd 0x1b444(%rip), %xmm4    # 0x1091b0
mulsd %xmm8, %xmm4
movapd %xmm4, %xmm7
mulsd %xmm2, %xmm7
addsd %xmm6, %xmm7
movsd %xmm7, (%rbx)
mulsd %xmm1, %xmm5
addsd 0x8(%rbx), %xmm5
mulsd %xmm3, %xmm4
mulsd 0x1b382(%rip), %xmm2    # 0x109118
addsd %xmm5, %xmm2
addsd %xmm2, %xmm4
movsd %xmm4, 0x8(%rbx)
mulsd %xmm8, %xmm0
addsd 0x10(%rbx), %xmm0
mulsd %xmm1, %xmm9
addsd %xmm0, %xmm9
movsd %xmm9, 0x10(%rbx)
movl 0x28d8b5(%rip), %ecx    # 0x37b678
leal 0x1(%rcx), %eax
movl %eax, 0x28d8ac(%rip)    # 0x37b678
cmpl $0x5, %ecx
jl 0xedb5b
xorl %eax, %eax
movsd 0x1b259(%rip), %xmm0    # 0x109038
xorl %ecx, %ecx
movsd (%rbx,%rcx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rcx,8)
incq %rcx
cmpq $0x3, %rcx
jne 0xedde1
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq