// File: /workspace/github_cpp_makefile_star2_O1/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 0xed781
movq %rdi, %r14
movsd (%rdx), %xmm0
movsd 0x3f260(%rip), %xmm2    # 0x12c3c8
mulsd %xmm0, %xmm2
addsd 0x3f25c(%rip), %xmm2    # 0x12c3d0
movsd 0x3f25c(%rip), %xmm1    # 0x12c3d8
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x3f270(%rip), %xmm5    # 0x12c408
mulsd %xmm0, %xmm5
mulsd %xmm0, %xmm5
movsd 0x3f268(%rip), %xmm6    # 0x12c410
mulsd %xmm0, %xmm6
movsd 0x3f274(%rip), %xmm7    # 0x12c428
mulsd %xmm0, %xmm7
movsd 0x3f277(%rip), %xmm8    # 0x12c438
mulsd %xmm0, %xmm8
mulsd %xmm0, %xmm8
movapd 0x1bfcd(%rip), %xmm4    # 0x1091a0
movapd %xmm2, %xmm3
xorpd %xmm4, %xmm3
movsd 0x3f26c(%rip), %xmm9    # 0x12c450
mulsd %xmm0, %xmm9
movsd 0x3f26e(%rip), %xmm10   # 0x12c460
mulsd %xmm0, %xmm10
mulsd %xmm0, %xmm10
xorpd %xmm0, %xmm4
movsd 0x3f26f(%rip), %xmm11   # 0x12c478
mulsd %xmm0, %xmm11
movsd 0x3f271(%rip), %xmm12   # 0x12c488
mulsd %xmm0, %xmm12
mulsd %xmm0, %xmm12
movsd 0x3f276(%rip), %xmm13   # 0x12c4a0
mulsd %xmm0, %xmm13
movsd 0x3f278(%rip), %xmm14   # 0x12c4b0
mulsd %xmm0, %xmm14
mulsd %xmm0, %xmm14
mulsd %xmm2, %xmm0
movsd 0x3f191(%rip), %xmm15   # 0x12c3e0
mulsd %xmm0, %xmm15
addsd %xmm1, %xmm15
addsd %xmm5, %xmm6
movsd 0x3f1b3(%rip), %xmm1    # 0x12c418
mulsd %xmm0, %xmm1
addsd %xmm6, %xmm1
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm2
movsd 0x3f19f(%rip), %xmm5    # 0x12c420
mulsd %xmm2, %xmm5
addsd %xmm1, %xmm5
addsd %xmm15, %xmm5
movsd %xmm5, 0x28e44a(%rip)   # 0x37b6e0
addsd 0x3f192(%rip), %xmm7    # 0x12c430
addsd %xmm7, %xmm8
mulsd 0x3f195(%rip), %xmm0    # 0x12c440
addsd %xmm8, %xmm0
movsd 0x3f190(%rip), %xmm1    # 0x12c448
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
addsd 0x3f18f(%rip), %xmm9    # 0x12c458
movsd %xmm1, 0x28e3f7(%rip)   # 0x37b6c8
addsd %xmm9, %xmm10
movsd 0x3f18a(%rip), %xmm0    # 0x12c468
mulsd %xmm4, %xmm0
addsd %xmm10, %xmm0
movsd 0x3f181(%rip), %xmm1    # 0x12c470
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x28e3d9(%rip)   # 0x37b6d8
addsd 0x3f178(%rip), %xmm11   # 0x12c480
addsd %xmm11, %xmm12
movsd 0x3f17b(%rip), %xmm0    # 0x12c490
mulsd %xmm4, %xmm0
mulsd 0x3f177(%rip), %xmm2    # 0x12c498
addsd %xmm12, %xmm0
addsd %xmm0, %xmm2
addsd 0x3f175(%rip), %xmm13   # 0x12c4a8
movsd %xmm2, 0x28e3f5(%rip)   # 0x37b730
addsd %xmm13, %xmm14
mulsd 0x3f170(%rip), %xmm4    # 0x12c4b8
addsd %xmm14, %xmm4
mulsd 0x3f16b(%rip), %xmm3    # 0x12c4c0
addsd %xmm4, %xmm3
movsd %xmm3, 0x28e39f(%rip)   # 0x37b700
movsd (%rdi), %xmm1
movsd 0x8(%rdi), %xmm2
movsd 0x10(%rdi), %xmm0
mulsd %xmm2, %xmm2
mulsd %xmm1, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0xed393
sqrtsd %xmm0, %xmm0
jmp 0xed39c
callq 0x9270
xorpd %xmm2, %xmm2
movsd %xmm0, 0x28e31c(%rip)   # 0x37b6c0
movsd 0x10(%r14), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x28e36a(%rip)   # 0x37b720
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0xed3d9
sqrtsd %xmm0, %xmm0
jmp 0xed3de
callq 0x9270
movsd 0x28e2da(%rip), %xmm1   # 0x37b6c0
divsd %xmm1, %xmm0
movsd %xmm0, 0x28e31e(%rip)   # 0x37b710
movsd (%r14), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28e2e1(%rip)   # 0x37b6e8
movsd 0x8(%r14), %xmm2
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd %xmm2, 0x28e2d3(%rip)   # 0x37b6f0
movsd 0x28e2bb(%rip), %xmm0   # 0x37b6e0
movsd 0x30c63(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd %xmm0, 0x28e2a6(%rip)   # 0x37b6e0
movsd 0x28e286(%rip), %xmm0   # 0x37b6c8
movsd 0x30c46(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd %xmm0, 0x28e271(%rip)   # 0x37b6c8
movsd 0x28e279(%rip), %xmm0   # 0x37b6d8
movsd 0x30c29(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd %xmm0, 0x28e264(%rip)   # 0x37b6d8
movsd 0x28e2b4(%rip), %xmm0   # 0x37b730
movsd 0x30c0c(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd %xmm0, 0x28e29f(%rip)   # 0x37b730
movsd 0x28e267(%rip), %xmm0   # 0x37b700
movsd 0x30bef(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd %xmm0, 0x28e252(%rip)   # 0x37b700
xorl %eax, %eax
movq %rax, 0x28e271(%rip)    # 0x37b728
movq %rax, 0x28e25a(%rip)    # 0x37b718
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq %rax, 0x10(%rbx)
movl $0x1, 0x28e1fc(%rip)    # 0x37b6d0
movl $0x1, %eax
leaq 0x3dff0(%rip), %r14     # 0x12b4d0
leal (%rax,%rax,8), %eax
cltq
movsd -0x48(%r14,%rax,8), %xmm0
movsd -0x40(%r14,%rax,8), %xmm1
mulsd 0x28e1cd(%rip), %xmm1   # 0x37b6c8
mulsd 0x28e1dd(%rip), %xmm0   # 0x37b6e0
addsd %xmm1, %xmm0
movsd -0x38(%r14,%rax,8), %xmm1
mulsd 0x28e1c2(%rip), %xmm1   # 0x37b6d8
addsd %xmm0, %xmm1
movsd -0x30(%r14,%rax,8), %xmm2
mulsd 0x28e207(%rip), %xmm2   # 0x37b730
addsd %xmm1, %xmm2
movsd -0x28(%r14,%rax,8), %xmm0
mulsd 0x28e1c4(%rip), %xmm0   # 0x37b700
addsd %xmm2, %xmm0
mulsd 0x1e3c0(%rip), %xmm0    # 0x10b908
movsd %xmm0, 0x28e1b8(%rip)   # 0x37b708
movsd 0x28e1c8(%rip), %xmm1   # 0x37b720
mulsd %xmm1, %xmm1
mulsd 0x1e4a4(%rip), %xmm1    # 0x10ba08
addsd 0x1bb8c(%rip), %xmm1    # 0x1090f8
movsd %xmm1, -0x18(%rbp)
movsd -0x20(%r14,%rax,8), %xmm2
mulsd %xmm1, %xmm2
movsd 0x1bae4(%rip), %xmm1    # 0x109068
mulsd %xmm1, %xmm2
movsd %xmm2, -0x30(%rbp)
callq 0x9710
movsd %xmm0, -0x20(%rbp)
movslq 0x28e132(%rip), %rax    # 0x37b6d0
leaq (%rax,%rax,8), %rax
movsd -0x18(%rbp), %xmm0
mulsd -0x10(%r14,%rax,8), %xmm0
mulsd 0x1bab2(%rip), %xmm0    # 0x109068
movsd %xmm0, -0x18(%rbp)
movsd 0x28e145(%rip), %xmm0   # 0x37b708
callq 0x9080
mulsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x28e115(%rip)   # 0x37b6f8
movslq 0x28e0e6(%rip), %rax    # 0x37b6d0
leaq (%rax,%rax,8), %rax
movsd 0x28e11a(%rip), %xmm0   # 0x37b710
mulsd 0x28e122(%rip), %xmm0   # 0x37b720
addsd %xmm0, %xmm0
mulsd -0x18(%r14,%rax,8), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x28e0f2(%rip), %xmm0   # 0x37b708
callq 0x9710
movaps %xmm0, -0x30(%rbp)
movslq 0x28e0aa(%rip), %rax    # 0x37b6d0
leaq (%rax,%rax,8), %rax
movsd 0x28e0de(%rip), %xmm0   # 0x37b710
mulsd 0x28e0e6(%rip), %xmm0   # 0x37b720
addsd %xmm0, %xmm0
mulsd -0x8(%r14,%rax,8), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x28e0b6(%rip), %xmm0   # 0x37b708
callq 0x9080
mulsd -0x20(%rbp), %xmm0
movapd -0x30(%rbp), %xmm9
mulsd -0x18(%rbp), %xmm9
addsd %xmm0, %xmm9
movsd 0x28e083(%rip), %xmm0   # 0x37b6f8
movsd 0x28e0ab(%rip), %xmm1   # 0x37b728
addsd %xmm0, %xmm1
movsd %xmm1, 0x28e09f(%rip)   # 0x37b728
movsd 0x28e087(%rip), %xmm1   # 0x37b718
addsd %xmm9, %xmm1
movsd %xmm1, 0x28e07a(%rip)   # 0x37b718
movsd 0x28e042(%rip), %xmm2   # 0x37b6e8
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm4
movsd 0x28e05a(%rip), %xmm1   # 0x37b710
mulsd %xmm1, %xmm4
addsd (%rbx), %xmm4
movsd 0x28e02a(%rip), %xmm3   # 0x37b6f0
movapd %xmm0, %xmm5
mulsd %xmm3, %xmm5
movapd %xmm3, %xmm6
mulsd 0x3e346(%rip), %xmm6    # 0x12ba20
addsd %xmm4, %xmm6
movsd 0x28e03a(%rip), %xmm4   # 0x37b720
movapd %xmm9, %xmm7
xorpd 0x1baad(%rip), %xmm7    # 0x1091a0
mulsd %xmm4, %xmm7
movapd %xmm7, %xmm8
mulsd %xmm2, %xmm8
addsd %xmm6, %xmm8
movsd %xmm8, (%rbx)
mulsd %xmm1, %xmm5
addsd 0x8(%rbx), %xmm5
mulsd %xmm3, %xmm7
mulsd 0x1b9f8(%rip), %xmm2    # 0x109118
addsd %xmm5, %xmm2
addsd %xmm2, %xmm7
movsd %xmm7, 0x8(%rbx)
mulsd %xmm4, %xmm0
addsd 0x10(%rbx), %xmm0
mulsd %xmm1, %xmm9
addsd %xmm0, %xmm9
movsd %xmm9, 0x10(%rbx)
movl 0x28df84(%rip), %ecx    # 0x37b6d0
leal 0x1(%rcx), %eax
movl %eax, 0x28df7b(%rip)    # 0x37b6d0
cmpl $0x5, %ecx
jl 0xed4e0
xorl %eax, %eax
movsd 0x1b8d0(%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 0xed76a
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq