docs: def _dspace(
         irez,
         d2201,  d2211,  d3210,   d3222,  d4410,
         d4422,  d5220,  d5232,   d5421,  d5433,
         dedt,   del1,   del2,    del3,   didt,
         dmdt,   dnodt,  domdt,   argpo,  argpdot,
         t,      tc,     gsto,    xfact,  xlamo,
         no,
         atime, em,    argpm,  inclm, xli,
         mm,    xni,   nodem,  nm,
         ):
  
       fasx2 = 0.13130908;
       fasx4 = 2.8843198;
       fasx6 = 0.37448087;
       g22   = 5.7686396;
       g32   = 0.95240898;
       g44   = 1.8014998;
       g52   = 1.0508330;
       g54   = 4.4108898;
       rptim = 4.37526908801129966e-3; # equates to 7.29211514668855e-5 rad/sec
       stepp =    720.0;
       stepn =   -720.0;
       step2 = 259200.0;
  
       #  ----------- calculate deep space resonance effects -----------
       dndt   = 0.0;
       theta  = (gsto + tc * rptim) % twopi
       em     = em + dedt * t;
  
       inclm  = inclm + didt * t;
       argpm  = argpm + domdt * t;
       nodem  = nodem + dnodt * t;
       mm     = mm + dmdt * t;
  
       """
       //   sgp4fix for negative inclinations
       //   the following if statement should be commented out
       //  if (inclm < 0.0)
       // {
       //    inclm = -inclm;
       //    argpm = argpm - pi;
       //    nodem = nodem + pi;
       //  }
  
       /* - update resonances : numerical (euler-maclaurin) integration - */
       /* ------------------------- epoch restart ----------------------  */
       //   sgp4fix for propagator problems
       //   the following integration works for negative time steps and periods
       //   the specific changes are unknown because the original code was so convoluted
  
       // sgp4fix take out atime = 0.0 and fix for faster operation
       """
       ft    = 0.0;
       if irez != 0:
  
           #  sgp4fix streamline check
           if atime == 0.0 or t * atime <= 0.0 or fabs(t) < fabs(atime):
  
               atime  = 0.0;
               xni    = no;
               xli    = xlamo;
  
           # sgp4fix move check outside loop
           if t > 0.0:
                 delt = stepp;
           else:
                 delt = stepn;
  
           iretn = 381; # added for do loop
           iret  =   0; # added for loop
           while iretn == 381:
  
               #  ------------------- dot terms calculated -------------
               #  ----------- near - synchronous resonance terms -------
               if irez != 2:
  
                   xndt  = del1 * sin(xli - fasx2) + del2 * sin(2.0 * (xli - fasx4)) + \
                           del3 * sin(3.0 * (xli - fasx6));
                   xldot = xni + xfact;
                   xnddt = del1 * cos(xli - fasx2) + \
                           2.0 * del2 * cos(2.0 * (xli - fasx4)) + \
                           3.0 * del3 * cos(3.0 * (xli - fasx6));
                   xnddt = xnddt * xldot;
  
               else:
  
                   # --------- near - half-day resonance terms --------
                   xomi  = argpo + argpdot * atime;
                   x2omi = xomi + xomi;
                   x2li  = xli + xli;
                   xndt  = (d2201 * sin(x2omi + xli - g22) + d2211 * sin(xli - g22) +
                         d3210 * sin(xomi + xli - g32)  + d3222 * sin(-xomi + xli - g32)+
                         d4410 * sin(x2omi + x2li - g44)+ d4422 * sin(x2li - g44) +
                         d5220 * sin(xomi + xli - g52)  + d5232 * sin(-xomi + xli - g52)+
                         d5421 * sin(xomi + x2li - g54) + d5433 * sin(-xomi + x2li - g54));
                   xldot = xni + xfact;
                   xnddt = (d2201 * cos(x2omi + xli - g22) + d2211 * cos(xli - g22) +
                         d3210 * cos(xomi + xli - g32) + d3222 * cos(-xomi + xli - g32) +
                         d5220 * cos(xomi + xli - g52) + d5232 * cos(-xomi + xli - g52) +
                         2.0 * (d4410 * cos(x2omi + x2li - g44) +
                         d4422 * cos(x2li - g44) + d5421 * cos(xomi + x2li - g54) +
                         d5433 * cos(-xomi + x2li - g54)));
                   xnddt = xnddt * xldot;
  
               #  ----------------------- integrator -------------------
               #  sgp4fix move end checks to end of routine
               if fabs(t - atime) >= stepp:
                   iret  = 0;
                   iretn = 381;
  
               else:
                   ft    = t - atime;
                   iretn = 0;
  
               if iretn == 381:
  
                   xli   = xli + xldot * delt + xndt * step2;
                   xni   = xni + xndt * delt + xnddt * step2;
                   atime = atime + delt;
  
           nm = xni + xndt * ft + xnddt * ft * ft * 0.5;
           xl = xli + xldot * ft + xndt * ft * ft * 0.5;
           if irez != 1:
               mm   = xl - 2.0 * nodem + 2.0 * theta;
               dndt = nm - no;
  
           else:
               mm   = xl - nodem - argpm + theta;
               dndt = nm - no;
  
           nm = no + dndt;
  
       return (
         atime, em,    argpm,  inclm, xli,
         mm,    xni,   nodem,  dndt,  nm,
         )