#include <perms.h>

                                                                //      1  %systemstring(127)%fn rtos(%real r,%integer n,m)
#line 1 "regression-bugs-tmp/rtos.imp"
extern _imp_string /*%string(127)*/ rtos( float R, int N, int M )
#line 1 "regression-bugs-tmp/rtos.imp"
{
  __label__ _imp_endofblock;
                                                                //      2    %constreal pmax = 2147483647.0
_imp_current_line = 2; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 2 "regression-bugs-tmp/rtos.imp"
const float PMAX = 2147483647.0;
                                                                //      3    %real y,z
_imp_current_line = 3; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 3 "regression-bugs-tmp/rtos.imp"
float Y;
#line 3 "regression-bugs-tmp/rtos.imp"
float Z;
                                                                //      4    %integer i=0,l,count=0,sign
_imp_current_line = 4; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 4 "regression-bugs-tmp/rtos.imp"
int I;
#line 4 "regression-bugs-tmp/rtos.imp"
I = 0;
#line 4 "regression-bugs-tmp/rtos.imp"
int L;
#line 4 "regression-bugs-tmp/rtos.imp"
int COUNT;
#line 4 "regression-bugs-tmp/rtos.imp"
COUNT = 0;
#line 4 "regression-bugs-tmp/rtos.imp"
int SIGN;
                                                                //      5    %string(127) result = ""
_imp_current_line = 5; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 5 "regression-bugs-tmp/rtos.imp"
_imp_string /*%string(127)*/ RESULT;
#line 5 "regression-bugs-tmp/rtos.imp"
RESULT = _imp_str_literal("");
                                                                //      6    !
                                                                //      7    sign = ' '
_imp_current_line = 7; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 7 "regression-bugs-tmp/rtos.imp"
SIGN = 32;
                                                                //      8    sign = '-' %if r < 0
_imp_current_line = 8; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 8 "regression-bugs-tmp/rtos.imp"
if (((R) >= (0))) goto L_0002;
#line 8 "regression-bugs-tmp/rtos.imp"
SIGN = 45;
#line 8 "regression-bugs-tmp/rtos.imp"
L_0002:;
                                                                //      9    y = |r|+0.5/10.0\{^}m;  !modulus, rounded
_imp_current_line = 9; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 9 "regression-bugs-tmp/rtos.imp"
Y = (((_imp_MOD(R))) + (((double)((double)((double)(0.5)) / (double)((_imp_REXP(10.0, M)))))));
                                                                //     10    %if y > pmax %start
_imp_current_line = 10; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 10 "regression-bugs-tmp/rtos.imp"
if (((Y) <= (PMAX))) goto L_0003;
                                                                //     11      count = count+1 %and y = y/10.0 %until y < 10.0
_imp_current_line = 11; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 11 "regression-bugs-tmp/rtos.imp"
L_0004:;
#line 11 "regression-bugs-tmp/rtos.imp"
COUNT = (((int)(COUNT)) + (1));
#line 11 "regression-bugs-tmp/rtos.imp"
Y = (double)((double)((float)(Y)) / (double)((double)(10.0)));
#line 11 "regression-bugs-tmp/rtos.imp"
if (((Y) < (10.0))) goto L_0005;
#line 11 "regression-bugs-tmp/rtos.imp"
goto L_0004;
#line 11 "regression-bugs-tmp/rtos.imp"
L_0005:;
                                                                //     12    %finish
_imp_current_line = 12; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 12 "regression-bugs-tmp/rtos.imp"
L_0003:;
                                                                //     13    z = 1.0
_imp_current_line = 13; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 13 "regression-bugs-tmp/rtos.imp"
Z = 1.0;
                                                                //     14    %cycle
_imp_current_line = 14; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 14 "regression-bugs-tmp/rtos.imp"
L_0007:;
                                                                //     15      i = i+1;  z = z*10.0
_imp_current_line = 15; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 15 "regression-bugs-tmp/rtos.imp"
I = (((int)(I)) + (1));
_imp_current_line = 15; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 15 "regression-bugs-tmp/rtos.imp"
Z = (((double)(Z)) * (10.0));
                                                                //     16    %repeat %until z > y
_imp_current_line = 16; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 16 "regression-bugs-tmp/rtos.imp"
if (((Z) > (Y))) goto L_0008;
#line 16 "regression-bugs-tmp/rtos.imp"
goto L_0007;
#line 16 "regression-bugs-tmp/rtos.imp"
L_0008:;
                                                                //     17    result = result." " %for l = 1,1,n-i;  !l not used before here
_imp_current_line = 17; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 17 "regression-bugs-tmp/rtos.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = (((int)(N)) - (I)); L = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle L = 1, 1, (((int)(N)) - (I))");
L -= _increment; _control -= _increment;
L_000a:;
if (L == _final) goto L_000b;
L += _increment; _control += _increment;
if (L != _control) _imp_signal(4,2,0,"Corrupt control variable L"); /* FOR loop control variable corrupted */
}
#line 17 "regression-bugs-tmp/rtos.imp"
RESULT = _imp_join((_imp_string)RESULT,(_imp_string)_imp_str_literal(" "));
#line 17 "regression-bugs-tmp/rtos.imp"
goto L_000a;
#line 17 "regression-bugs-tmp/rtos.imp"
L_000b:;
                                                                //     18    result = result.tostring(sign) %unless sign = ' ' %and n <= 0
_imp_current_line = 18; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 18 "regression-bugs-tmp/rtos.imp"
if (((SIGN) != (32))) goto L_000c;
#line 18 "regression-bugs-tmp/rtos.imp"
if (((N) <= (0))) goto L_000d;
#line 18 "regression-bugs-tmp/rtos.imp"
L_000c:;
#line 18 "regression-bugs-tmp/rtos.imp"
RESULT = _imp_join((_imp_string)RESULT,(_imp_string)_imp_TOSTRING(SIGN));
#line 18 "regression-bugs-tmp/rtos.imp"
L_000d:;
                                                                //     19    %cycle
_imp_current_line = 19; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 19 "regression-bugs-tmp/rtos.imp"
L_000e:;
                                                                //     20      z = z/10.0
_imp_current_line = 20; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 20 "regression-bugs-tmp/rtos.imp"
Z = (double)((double)((float)(Z)) / (double)((double)(10.0)));
                                                                //     21      l = int pt(y/z)
_imp_current_line = 21; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 21 "regression-bugs-tmp/rtos.imp"
L = _imp_INTPT(((double)((double)((float)(Y)) / (double)((float)(Z)))));
/*Warning: potential loss of precision converting from integer AST_VAR (L - 4 bytes) to real AST_VAR (Z - 4 bytes) detected at ast.c line 108 */
/*promote*/                                                                //     22      y = y-l*z
_imp_current_line = 22; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 22 "regression-bugs-tmp/rtos.imp"
Y = ((Y) - ((float)((((float)(L)) * (Z)))));
                                                                //     23      result = result.tostring(l+'0')
_imp_current_line = 23; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 23 "regression-bugs-tmp/rtos.imp"
RESULT = _imp_join((_imp_string)RESULT,(_imp_string)_imp_TOSTRING((((int)(L)) + (48))));
                                                                //     24      i = i-1
_imp_current_line = 24; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 24 "regression-bugs-tmp/rtos.imp"
I = (((int)(I)) - (1));
                                                                //     25      %exit %if i+m <= 0
_imp_current_line = 25; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 25 "regression-bugs-tmp/rtos.imp"
if ((((((int)(I)) + (M))) > (0))) goto L_0011;
#line 25 "regression-bugs-tmp/rtos.imp"
goto L_000f;
#line 25 "regression-bugs-tmp/rtos.imp"
L_0011:;
                                                                //     26      result = result."." %if i = 0
_imp_current_line = 26; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 26 "regression-bugs-tmp/rtos.imp"
if (((I) != (0))) goto L_0012;
#line 26 "regression-bugs-tmp/rtos.imp"
RESULT = _imp_join((_imp_string)RESULT,(_imp_string)_imp_str_literal("."));
#line 26 "regression-bugs-tmp/rtos.imp"
L_0012:;
                                                                //     27    %repeat
_imp_current_line = 27; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 27 "regression-bugs-tmp/rtos.imp"
goto L_000e;
#line 27 "regression-bugs-tmp/rtos.imp"
L_000f:;
                                                                //     28    result = result."@".itos(count,0) %if count # 0
_imp_current_line = 28; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 28 "regression-bugs-tmp/rtos.imp"
if (((COUNT) == (0))) goto L_0013;
#line 28 "regression-bugs-tmp/rtos.imp"
RESULT = _imp_join((_imp_string)_imp_join((_imp_string)RESULT,(_imp_string)_imp_str_literal("@")),(_imp_string)_imp_ITOS(COUNT, 0));
#line 28 "regression-bugs-tmp/rtos.imp"
L_0013:;
                                                                //     29    %result = result
_imp_current_line = 29; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 29 "regression-bugs-tmp/rtos.imp"
return RESULT;
                                                                //     30  %end;  !rtos
_imp_current_line = 30; _imp_current_file = "regression-bugs-tmp/rtos.imp";
#line 30 "regression-bugs-tmp/rtos.imp"
_imp_endofblock: ;
} // End of block rtos at level 1
                                                                //     31  
                                                                //     32  %endoffile
#line 32 "regression-bugs-tmp/rtos.imp"
// End of file
