#include <perms.h>

                                                                //      1  %external %routine vaxprintfl(%long %real r, %integer places)
#line 1 "regression-bugs-tmp/vaxprint.imp"
void VAXPRINTFL( double R, int PLACES )
#line 1 "regression-bugs-tmp/vaxprint.imp"
{
                                                                //      2     {%external} %string (63) %fn ftos(%long %real r, %integer p)
#line 2 "regression-bugs-tmp/vaxprint.imp"
_imp_string /*%string(63)*/ FTOS( double R, int P )
#line 2 "regression-bugs-tmp/vaxprint.imp"
{
                                                                //      3        %routine fraction(%long %real r, %integer places, %string (*) %name s)
#line 3 "regression-bugs-tmp/vaxprint.imp"
void FRACTION( double R, int PLACES, _imp_string /*%string(255)*/ /*name*/*S )
#line 3 "regression-bugs-tmp/vaxprint.imp"
{
                                                                //      4           {%external} %long %real %fn fracpt(%long %real x)
#line 4 "regression-bugs-tmp/vaxprint.imp"
double FRACPT( double X )
#line 4 "regression-bugs-tmp/vaxprint.imp"
{
                                                                //      5              %long %real z
#line 5 "regression-bugs-tmp/vaxprint.imp"
double Z;
/*promote*/                                                                //      6              z = x - intpt(x)
#line 6 "regression-bugs-tmp/vaxprint.imp"
Z = ((X) - ((double)(_imp_INTPT(X))));
                                                                //      7              z = z + 1.0 %if z < 0
#line 7 "regression-bugs-tmp/vaxprint.imp"
if (((Z) >= (0))) goto L_0002;
#line 7 "regression-bugs-tmp/vaxprint.imp"
Z = (((double)(Z)) + (1.0));
#line 7 "regression-bugs-tmp/vaxprint.imp"
L_0002:;
                                                                //      8              %result = z
#line 8 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return Z;
                                                                //      9           %end
#line 9 "regression-bugs-tmp/vaxprint.imp"
} // End of block FRACPT at level 4
                                                                //     10           %return %if places <= 0
#line 10 "regression-bugs-tmp/vaxprint.imp"
if (((PLACES) > (0))) goto L_0003;
#line 10 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 10 "regression-bugs-tmp/vaxprint.imp"
L_0003:;
                                                                //     11           s = s . "."
#line 11 "regression-bugs-tmp/vaxprint.imp"
*S = _imp_join((_imp_string)*S,(_imp_string)_imp_str_literal("."));
                                                                //     12           %while places > 0 %cycle
#line 12 "regression-bugs-tmp/vaxprint.imp"
L_0004:;
#line 12 "regression-bugs-tmp/vaxprint.imp"
if (((PLACES) <= (0))) goto L_0005;
                                                                //     13              places = places - 1
#line 13 "regression-bugs-tmp/vaxprint.imp"
PLACES = (((int)(PLACES)) - (1));
/*promote*/                                                                //     14              r = fracpt(r) * 10
#line 14 "regression-bugs-tmp/vaxprint.imp"
R = ((FRACPT(R)) * ((double)(10)));
                                                                //     15              s = s . tostring(intpt(r) + '0')
#line 15 "regression-bugs-tmp/vaxprint.imp"
*S = _imp_join((_imp_string)*S,(_imp_string)_imp_TOSTRING((((int)(_imp_INTPT(R))) + (48))));
                                                                //     16           %repeat
#line 16 "regression-bugs-tmp/vaxprint.imp"
goto L_0004;
#line 16 "regression-bugs-tmp/vaxprint.imp"
L_0005:;
                                                                //     17        %end
#line 17 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block FRACTION at level 3
                                                                //     18        %routine round(%long %real %name v, %integer p)
#line 18 "regression-bugs-tmp/vaxprint.imp"
void ROUND( double /*name*/*V, int P )
#line 18 "regression-bugs-tmp/vaxprint.imp"
{
                                                                //     19           %long %real x
#line 19 "regression-bugs-tmp/vaxprint.imp"
double X;
                                                                //     20           %return %if v = 0
#line 20 "regression-bugs-tmp/vaxprint.imp"
if (((*V) != (0))) goto L_0007;
#line 20 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 20 "regression-bugs-tmp/vaxprint.imp"
L_0007:;
                                                                //     21           %if v < 0 %then x = -0.5 %else x = 0.5
#line 21 "regression-bugs-tmp/vaxprint.imp"
if (((*V) >= (0))) goto L_0008;
#line 21 "regression-bugs-tmp/vaxprint.imp"
X = (-0.5);
#line 21 "regression-bugs-tmp/vaxprint.imp"
goto L_0009;
#line 21 "regression-bugs-tmp/vaxprint.imp"
L_0008:;
#line 21 "regression-bugs-tmp/vaxprint.imp"
X = 0.5;
#line 21 "regression-bugs-tmp/vaxprint.imp"
L_0009:;
                                                                //     22           %cycle 
#line 22 "regression-bugs-tmp/vaxprint.imp"
L_000a:;
                                                                //     23              p = p - 1
#line 23 "regression-bugs-tmp/vaxprint.imp"
P = (((int)(P)) - (1));
                                                                //     24              %exit %if p < 0
#line 24 "regression-bugs-tmp/vaxprint.imp"
if (((P) >= (0))) goto L_000d;
#line 24 "regression-bugs-tmp/vaxprint.imp"
goto L_000b;
#line 24 "regression-bugs-tmp/vaxprint.imp"
L_000d:;
                                                                //     25              x = x / 10
#line 25 "regression-bugs-tmp/vaxprint.imp"
X = (double)((double)((double)(X)) / (double)((float)(10)));
                                                                //     26           %repeat
#line 26 "regression-bugs-tmp/vaxprint.imp"
goto L_000a;
#line 26 "regression-bugs-tmp/vaxprint.imp"
L_000b:;
                                                                //     27           v = v + x
#line 27 "regression-bugs-tmp/vaxprint.imp"
*V = ((*(double *)(V)) + (X));
                                                                //     28        %end
#line 28 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block ROUND at level 3
                                                                //     29        {XOWN}%string (63) s = ""
#line 29 "regression-bugs-tmp/vaxprint.imp"
_imp_string /*%string(63)*/ S;
#line 29 "regression-bugs-tmp/vaxprint.imp"
S = _imp_str_literal("");
                                                                //     30        %integer exp, sym
#line 30 "regression-bugs-tmp/vaxprint.imp"
int EXP;
#line 30 "regression-bugs-tmp/vaxprint.imp"
int SYM;
                                                                //     31        p = 7 %if p > 7
#line 31 "regression-bugs-tmp/vaxprint.imp"
if (((P) <= (7))) goto L_000e;
#line 31 "regression-bugs-tmp/vaxprint.imp"
P = 7;
#line 31 "regression-bugs-tmp/vaxprint.imp"
L_000e:;
                                                                //     32        %if r < 0 %then sym = '-' %and r = -r %else sym = ' '
#line 32 "regression-bugs-tmp/vaxprint.imp"
if (((R) >= (0))) goto L_000f;
#line 32 "regression-bugs-tmp/vaxprint.imp"
SYM = 45;
#line 32 "regression-bugs-tmp/vaxprint.imp"
R = (-(R));
#line 32 "regression-bugs-tmp/vaxprint.imp"
goto L_0010;
#line 32 "regression-bugs-tmp/vaxprint.imp"
L_000f:;
#line 32 "regression-bugs-tmp/vaxprint.imp"
SYM = 32;
#line 32 "regression-bugs-tmp/vaxprint.imp"
L_0010:;
                                                                //     33        %if r = 0 %start
#line 33 "regression-bugs-tmp/vaxprint.imp"
if (((R) != (0))) goto L_0011;
                                                                //     34           exp = -99
#line 34 "regression-bugs-tmp/vaxprint.imp"
EXP = (-99);
                                                                //     35        %else
#line 35 "regression-bugs-tmp/vaxprint.imp"
goto L_0012;
#line 35 "regression-bugs-tmp/vaxprint.imp"
L_0011:;
                                                                //     36           exp = 0
#line 36 "regression-bugs-tmp/vaxprint.imp"
EXP = 0;
                                                                //     37           exp = exp + 1 %and r = r / 10 %while r >= 10
#line 37 "regression-bugs-tmp/vaxprint.imp"
L_0013:;
#line 37 "regression-bugs-tmp/vaxprint.imp"
if (((R) < (10))) goto L_0014;
#line 37 "regression-bugs-tmp/vaxprint.imp"
EXP = (((int)(EXP)) + (1));
#line 37 "regression-bugs-tmp/vaxprint.imp"
R = (double)((double)((double)(R)) / (double)((float)(10)));
#line 37 "regression-bugs-tmp/vaxprint.imp"
goto L_0013;
#line 37 "regression-bugs-tmp/vaxprint.imp"
L_0014:;
/*promote*/                                                                //     38           exp = exp - 1 %and r = r * 10 %while r < 1
#line 38 "regression-bugs-tmp/vaxprint.imp"
L_0016:;
#line 38 "regression-bugs-tmp/vaxprint.imp"
if (((R) >= (1))) goto L_0017;
#line 38 "regression-bugs-tmp/vaxprint.imp"
EXP = (((int)(EXP)) - (1));
#line 38 "regression-bugs-tmp/vaxprint.imp"
R = ((R) * ((double)(10)));
#line 38 "regression-bugs-tmp/vaxprint.imp"
goto L_0016;
#line 38 "regression-bugs-tmp/vaxprint.imp"
L_0017:;
                                                                //     39        %finish
#line 39 "regression-bugs-tmp/vaxprint.imp"
L_0012:;
                                                                //     40        round(r, p)
#line 40 "regression-bugs-tmp/vaxprint.imp"
ROUND(&R, P);
                                                                //     41        exp = exp + 1 %and r = r / 10 %if r >= 10
#line 41 "regression-bugs-tmp/vaxprint.imp"
if (((R) < (10))) goto L_0019;
#line 41 "regression-bugs-tmp/vaxprint.imp"
EXP = (((int)(EXP)) + (1));
#line 41 "regression-bugs-tmp/vaxprint.imp"
R = (double)((double)((double)(R)) / (double)((float)(10)));
#line 41 "regression-bugs-tmp/vaxprint.imp"
L_0019:;
                                                                //     42        s = s . tostring(intpt(r) + '0')
#line 42 "regression-bugs-tmp/vaxprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_TOSTRING((((int)(_imp_INTPT(R))) + (48))));
                                                                //     43        fraction(r, p, s)
#line 43 "regression-bugs-tmp/vaxprint.imp"
FRACTION(R, P, &S);
                                                                //     44        %result = tostring(sym) . s . "@" . itos(exp, 0)
#line 44 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return _imp_join((_imp_string)_imp_join((_imp_string)_imp_join((_imp_string)_imp_TOSTRING(SYM),(_imp_string)S),(_imp_string)_imp_str_literal("@")),(_imp_string)_imp_ITOS(EXP, 0));
                                                                //     45     %end
#line 45 "regression-bugs-tmp/vaxprint.imp"
} // End of block FTOS at level 2
                                                                //     46     places = \places %if places < 0
#line 46 "regression-bugs-tmp/vaxprint.imp"
if (((PLACES) >= (0))) goto L_001a;
#line 46 "regression-bugs-tmp/vaxprint.imp"
PLACES = (~(PLACES));
#line 46 "regression-bugs-tmp/vaxprint.imp"
L_001a:;
                                                                //     47     spaces(places - 62)
#line 47 "regression-bugs-tmp/vaxprint.imp"
_imp_SPACES((((int)(PLACES)) - (62)));
                                                                //     48     printstring(ftos(r, places))
#line 48 "regression-bugs-tmp/vaxprint.imp"
_imp_PRINTSTRING(FTOS(R, PLACES));
                                                                //     49  %end
#line 49 "regression-bugs-tmp/vaxprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block VAXPRINTFL at level 1
                                                                //     50  
                                                                //     51  %endoffile
#line 51 "regression-bugs-tmp/vaxprint.imp"
// End of file
