// File: /workspace/github_cpp_makefile_star2_O2/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
je 0xd913b
pushq $-0x1
popq %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movsd (%rdx), %xmm0
movsd 0x3d291(%rip), %xmm2    # 0x1163d8
mulsd %xmm0, %xmm2
addsd 0x3d28d(%rip), %xmm2    # 0x1163e0
movsd 0x3d28d(%rip), %xmm1    # 0x1163e8
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x3d2a1(%rip), %xmm5    # 0x116418
mulsd %xmm0, %xmm5
mulsd %xmm0, %xmm5
movsd 0x3d299(%rip), %xmm6    # 0x116420
mulsd %xmm0, %xmm6
movsd 0x3d2a5(%rip), %xmm7    # 0x116438
mulsd %xmm0, %xmm7
movsd 0x3d2a8(%rip), %xmm8    # 0x116448
mulsd %xmm0, %xmm8
mulsd %xmm0, %xmm8
movapd 0x19ffe(%rip), %xmm4    # 0xf31b0
movapd %xmm2, %xmm3
xorpd %xmm4, %xmm3
movsd 0x3d29d(%rip), %xmm9    # 0x116460
mulsd %xmm0, %xmm9
movsd 0x3d29f(%rip), %xmm10   # 0x116470
mulsd %xmm0, %xmm10
mulsd %xmm0, %xmm10
xorpd %xmm0, %xmm4
movsd 0x3d2a0(%rip), %xmm11   # 0x116488
mulsd %xmm0, %xmm11
movsd 0x3d2a2(%rip), %xmm12   # 0x116498
mulsd %xmm0, %xmm12
mulsd %xmm0, %xmm12
movsd 0x3d2a7(%rip), %xmm13   # 0x1164b0
mulsd %xmm0, %xmm13
movsd 0x3d2a9(%rip), %xmm14   # 0x1164c0
mulsd %xmm0, %xmm14
mulsd %xmm0, %xmm14
movapd %xmm0, %xmm15
mulsd %xmm2, %xmm15
movsd 0x3d1bd(%rip), %xmm0    # 0x1163f0
mulsd %xmm15, %xmm0
addsd %xmm1, %xmm0
addsd %xmm5, %xmm6
movsd 0x3d1e0(%rip), %xmm5    # 0x116428
mulsd %xmm15, %xmm5
addsd %xmm6, %xmm5
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm2
movsd 0x3d1cb(%rip), %xmm6    # 0x116430
mulsd %xmm2, %xmm6
addsd %xmm5, %xmm6
addsd %xmm0, %xmm6
addsd 0x3d1c7(%rip), %xmm7    # 0x116440
addsd %xmm7, %xmm8
mulsd 0x3d1c9(%rip), %xmm15   # 0x116450
addsd %xmm8, %xmm15
movsd 0x3d1c4(%rip), %xmm0    # 0x116458
mulsd %xmm3, %xmm0
addsd %xmm15, %xmm0
addsd 0x3d1c2(%rip), %xmm9    # 0x116468
movsd %xmm0, 0x28c3c2(%rip)   # 0x365670
addsd %xmm9, %xmm10
movsd 0x3d1bd(%rip), %xmm0    # 0x116478
mulsd %xmm4, %xmm0
addsd %xmm10, %xmm0
movsd 0x3d1b4(%rip), %xmm5    # 0x116480
mulsd %xmm2, %xmm5
addsd %xmm0, %xmm5
movsd %xmm5, 0x28c3a4(%rip)   # 0x365680
addsd 0x3d1ab(%rip), %xmm11   # 0x116490
addsd %xmm11, %xmm12
movsd 0x3d1ae(%rip), %xmm0    # 0x1164a0
mulsd %xmm4, %xmm0
mulsd 0x3d1aa(%rip), %xmm2    # 0x1164a8
addsd %xmm12, %xmm0
addsd %xmm0, %xmm2
addsd 0x3d1a8(%rip), %xmm13   # 0x1164b8
movsd %xmm2, 0x28c3c0(%rip)   # 0x3656d8
addsd %xmm13, %xmm14
mulsd 0x3d1a3(%rip), %xmm4    # 0x1164c8
addsd %xmm14, %xmm4
mulsd 0x3d19e(%rip), %xmm3    # 0x1164d0
addsd %xmm4, %xmm3
movsd %xmm3, 0x28c36a(%rip)   # 0x3656a8
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, 0x28c34c(%rip)   # 0x3656c8
sqrtsd %xmm5, %xmm3
divsd %xmm4, %xmm3
movsd %xmm3, 0x28c32c(%rip)   # 0x3656b8
divsd %xmm3, %xmm0
divsd %xmm4, %xmm0
movsd %xmm0, 0x28c2f4(%rip)   # 0x365690
divsd %xmm3, %xmm2
divsd %xmm4, %xmm2
movsd %xmm2, 0x28c2ec(%rip)   # 0x365698
movsd 0x2edfc(%rip), %xmm1    # 0x1081b0
movapd %xmm6, %xmm0
callq 0x94d0
movsd %xmm0, 0x28c2c3(%rip)   # 0x365688
movsd 0x28c2a3(%rip), %xmm0   # 0x365670
movsd 0x2eddb(%rip), %xmm1    # 0x1081b0
callq 0x94d0
movsd %xmm0, 0x28c28e(%rip)   # 0x365670
movsd 0x28c296(%rip), %xmm0   # 0x365680
movsd 0x2edbe(%rip), %xmm1    # 0x1081b0
callq 0x94d0
movsd %xmm0, 0x28c281(%rip)   # 0x365680
movsd 0x28c2d1(%rip), %xmm0   # 0x3656d8
movsd 0x2eda1(%rip), %xmm1    # 0x1081b0
callq 0x94d0
movsd %xmm0, 0x28c2bc(%rip)   # 0x3656d8
movsd 0x28c284(%rip), %xmm0   # 0x3656a8
movsd 0x2ed84(%rip), %xmm1    # 0x1081b0
callq 0x94d0
movsd %xmm0, 0x28c26f(%rip)   # 0x3656a8
andq $0x0, 0x28c28f(%rip)    # 0x3656d0
andq $0x0, 0x28c277(%rip)    # 0x3656c0
xorl %eax, %eax
cmpq $0x3, %rax
je 0xd945b
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0xd944b
pushq $0x1
popq %rax
leaq 0x3bf8b(%rip), %r14     # 0x1153f0
movl %eax, 0x28c20d(%rip)    # 0x365678
cmpl $0x6, %eax
jge 0xd96e4
leal (%rax,%rax,8), %eax
cltq
movsd -0x48(%r14,%rax,8), %xmm0
movsd -0x40(%r14,%rax,8), %xmm1
mulsd 0x28c1e1(%rip), %xmm1   # 0x365670
mulsd 0x28c1f1(%rip), %xmm0   # 0x365688
addsd %xmm1, %xmm0
movsd -0x38(%r14,%rax,8), %xmm1
mulsd 0x28c1d6(%rip), %xmm1   # 0x365680
addsd %xmm0, %xmm1
movsd -0x30(%r14,%rax,8), %xmm2
mulsd 0x28c21b(%rip), %xmm2   # 0x3656d8
addsd %xmm1, %xmm2
movsd -0x28(%r14,%rax,8), %xmm0
mulsd 0x28c1d8(%rip), %xmm0   # 0x3656a8
addsd %xmm2, %xmm0
mulsd 0x1c4ac(%rip), %xmm0    # 0xf5988
movsd %xmm0, 0x28c1cc(%rip)   # 0x3656b0
movsd 0x28c1dc(%rip), %xmm1   # 0x3656c8
mulsd %xmm1, %xmm1
mulsd 0x1c588(%rip), %xmm1    # 0xf5a80
addsd 0x19bf8(%rip), %xmm1    # 0xf30f8
movsd %xmm1, -0x18(%rbp)
movsd -0x20(%r14,%rax,8), %xmm2
mulsd %xmm1, %xmm2
movsd 0x19b50(%rip), %xmm1    # 0xf3068
mulsd %xmm1, %xmm2
movsd %xmm2, -0x30(%rbp)
callq 0x9710
movsd %xmm0, -0x20(%rbp)
movslq 0x28c146(%rip), %rax    # 0x365678
imulq $0x48, %rax, %rax
movsd -0x18(%rbp), %xmm0
mulsd -0x10(%rax,%r14), %xmm0
mulsd 0x19b1e(%rip), %xmm0    # 0xf3068
movsd %xmm0, -0x18(%rbp)
movsd 0x28c159(%rip), %xmm0   # 0x3656b0
callq 0x9080
mulsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
mulsd -0x30(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x28c129(%rip)   # 0x3656a0
movslq 0x28c0fa(%rip), %rax    # 0x365678
imulq $0x48, %rax, %rax
movsd 0x28c12e(%rip), %xmm0   # 0x3656b8
mulsd 0x28c136(%rip), %xmm0   # 0x3656c8
addsd %xmm0, %xmm0
mulsd -0x18(%rax,%r14), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x28c106(%rip), %xmm0   # 0x3656b0
callq 0x9710
movaps %xmm0, -0x30(%rbp)
movslq 0x28c0be(%rip), %rax    # 0x365678
imulq $0x48, %rax, %rax
movsd 0x28c0f2(%rip), %xmm0   # 0x3656b8
mulsd 0x28c0fa(%rip), %xmm0   # 0x3656c8
addsd %xmm0, %xmm0
mulsd -0x8(%rax,%r14), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x28c0ca(%rip), %xmm0   # 0x3656b0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
movapd -0x30(%rbp), %xmm9
mulsd -0x18(%rbp), %xmm9
addsd %xmm0, %xmm9
movsd 0x28c097(%rip), %xmm0   # 0x3656a0
movsd 0x28c0bf(%rip), %xmm1   # 0x3656d0
addsd %xmm0, %xmm1
movsd %xmm1, 0x28c0b3(%rip)   # 0x3656d0
movsd 0x28c09b(%rip), %xmm1   # 0x3656c0
addsd %xmm9, %xmm1
movsd %xmm1, 0x28c08e(%rip)   # 0x3656c0
movsd 0x28c056(%rip), %xmm2   # 0x365690
movapd %xmm0, %xmm3
mulsd %xmm2, %xmm3
movsd 0x28c06e(%rip), %xmm1   # 0x3656b8
mulsd %xmm1, %xmm3
addsd (%rbx), %xmm3
movsd 0x28c03e(%rip), %xmm6   # 0x365698
movsd 0x28c066(%rip), %xmm4   # 0x3656c8
movapd %xmm9, %xmm5
xorpd 0x19b41(%rip), %xmm5    # 0xf31b0
mulsd %xmm4, %xmm5
movapd %xmm5, %xmm7
movapd %xmm0, %xmm8
mulsd %xmm6, %xmm8
mulsd %xmm6, %xmm5
mulsd 0x3c3a3(%rip), %xmm6    # 0x115a30
addsd %xmm3, %xmm6
mulsd %xmm2, %xmm7
addsd %xmm6, %xmm7
movsd %xmm7, (%rbx)
mulsd %xmm1, %xmm8
addsd 0x8(%rbx), %xmm8
mulsd 0x19a68(%rip), %xmm2    # 0xf3118
addsd %xmm8, %xmm2
addsd %xmm2, %xmm5
movsd %xmm5, 0x8(%rbx)
mulsd %xmm4, %xmm0
addsd 0x10(%rbx), %xmm0
mulsd %xmm1, %xmm9
addsd %xmm0, %xmm9
movsd %xmm9, 0x10(%rbx)
movl 0x28bf9b(%rip), %eax    # 0x365678
incl %eax
jmp 0xd9465
xorl %eax, %eax
movsd 0x1994a(%rip), %xmm0    # 0xf3038
xorl %ecx, %ecx
cmpq $0x3, %rcx
je 0xd9132
movsd (%rbx,%rcx,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rcx,8)
incq %rcx
jmp 0xd96f0