#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/dec10-print.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3  %ROUTINE DEC10 FRACTION(%REAL R, %INTEGER PLACES)
#line 3 "regression-bugs-tmp/dec10-print.imp"
void DEC10FRACTION( float R, int PLACES )
#line 3 "regression-bugs-tmp/dec10-print.imp"
{
                                                                //      4     %RETURN %IF PLACES<=0
#line 4 "regression-bugs-tmp/dec10-print.imp"
if (((PLACES) > (0))) goto L_0002;
#line 4 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 4 "regression-bugs-tmp/dec10-print.imp"
L_0002:;
                                                                //      5     PRINTSYMBOL('.')
#line 5 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL(46);
                                                                //      6     %WHILE PLACES>0 %CYCLE
#line 6 "regression-bugs-tmp/dec10-print.imp"
L_0003:;
#line 6 "regression-bugs-tmp/dec10-print.imp"
if (((PLACES) <= (0))) goto L_0004;
                                                                //      7        R = FRACPT(R)*10.0
#line 7 "regression-bugs-tmp/dec10-print.imp"
R = (((double)(_imp_FRACPT(R))) * (10.0));
                                                                //      8        PLACES=PLACES-1
#line 8 "regression-bugs-tmp/dec10-print.imp"
PLACES = (((int)(PLACES)) - (1));
                                                                //      9        PRINTSYMBOL(INTPT(R)+'0')
#line 9 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL((((int)(_imp_INTPT(R))) + (48)));
                                                                //     10     %REPEAT
#line 10 "regression-bugs-tmp/dec10-print.imp"
goto L_0003;
#line 10 "regression-bugs-tmp/dec10-print.imp"
L_0004:;
                                                                //     11  %END
#line 11 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10FRACTION at level 2
                                                                //     12  
                                                                //     13  %ROUTINE DEC10 PRINTFL(%REAL R, %INTEGER P)
#line 13 "regression-bugs-tmp/dec10-print.imp"
void DEC10PRINTFL( float R, int P )
#line 13 "regression-bugs-tmp/dec10-print.imp"
{
                                                                //     14     %INTEGER EXP,SIGN
#line 14 "regression-bugs-tmp/dec10-print.imp"
int EXP;
#line 14 "regression-bugs-tmp/dec10-print.imp"
int SIGN;
                                                                //     15     SIGN=' '
#line 15 "regression-bugs-tmp/dec10-print.imp"
SIGN = 32;
                                                                //     16     SIGN='-' %AND R=-R %IF R<0
#line 16 "regression-bugs-tmp/dec10-print.imp"
if (((R) >= (0))) goto L_0006;
#line 16 "regression-bugs-tmp/dec10-print.imp"
SIGN = 45;
#line 16 "regression-bugs-tmp/dec10-print.imp"
R = (-(R));
#line 16 "regression-bugs-tmp/dec10-print.imp"
L_0006:;
                                                                //     17     PRINTSYMBOL(SIGN)
#line 17 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL(SIGN);
                                                                //     18     %IF R=0 %START
#line 18 "regression-bugs-tmp/dec10-print.imp"
if (((R) != (0))) goto L_0007;
                                                                //     19        EXP=-99
#line 19 "regression-bugs-tmp/dec10-print.imp"
EXP = (-99);
                                                                //     20     %ELSE
#line 20 "regression-bugs-tmp/dec10-print.imp"
goto L_0008;
#line 20 "regression-bugs-tmp/dec10-print.imp"
L_0007:;
                                                                //     21        %IF P<=0 %START
#line 21 "regression-bugs-tmp/dec10-print.imp"
if (((P) > (0))) goto L_0009;
                                                                //     22           R=R+0.5
#line 22 "regression-bugs-tmp/dec10-print.imp"
R = (((double)(R)) + (0.5));
                                                                //     23        %ELSE
#line 23 "regression-bugs-tmp/dec10-print.imp"
goto L_000a;
#line 23 "regression-bugs-tmp/dec10-print.imp"
L_0009:;
/*promote*/                                                                //     24           R=R+0.5*10\(-P)
#line 24 "regression-bugs-tmp/dec10-print.imp"
R = ((R) + ((float)(((0.5) * ((double)(_imp_REXP(10, (-(P)))))))));
                                                                //     25        %FINISH
#line 25 "regression-bugs-tmp/dec10-print.imp"
L_000a:;
                                                                //     26        EXP=0
#line 26 "regression-bugs-tmp/dec10-print.imp"
EXP = 0;
                                                                //     27        EXP=EXP+1 %AND R=R*0.1 %WHILE R >=10.0
#line 27 "regression-bugs-tmp/dec10-print.imp"
L_000b:;
#line 27 "regression-bugs-tmp/dec10-print.imp"
if (((R) < (10.0))) goto L_000c;
#line 27 "regression-bugs-tmp/dec10-print.imp"
EXP = (((int)(EXP)) + (1));
#line 27 "regression-bugs-tmp/dec10-print.imp"
R = (((double)(R)) * (0.1));
#line 27 "regression-bugs-tmp/dec10-print.imp"
goto L_000b;
#line 27 "regression-bugs-tmp/dec10-print.imp"
L_000c:;
                                                                //     28        EXP=EXP-1 %AND R=R*10.0 %WHILE R< 1.0
#line 28 "regression-bugs-tmp/dec10-print.imp"
L_000e:;
#line 28 "regression-bugs-tmp/dec10-print.imp"
if (((R) >= (1.0))) goto L_000f;
#line 28 "regression-bugs-tmp/dec10-print.imp"
EXP = (((int)(EXP)) - (1));
#line 28 "regression-bugs-tmp/dec10-print.imp"
R = (((double)(R)) * (10.0));
#line 28 "regression-bugs-tmp/dec10-print.imp"
goto L_000e;
#line 28 "regression-bugs-tmp/dec10-print.imp"
L_000f:;
                                                                //     29     %FINISH
#line 29 "regression-bugs-tmp/dec10-print.imp"
L_0008:;
                                                                //     30     PRINTSYMBOL(INT PT(R)+'0')
#line 30 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL((((int)(_imp_INTPT(R))) + (48)));
                                                                //     31     DEC10 FRACTION(R,P)
#line 31 "regression-bugs-tmp/dec10-print.imp"
DEC10FRACTION(R, P);
                                                                //     32     PRINTSYMBOL('@'); WRITE(EXP,1)
#line 32 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL(64);
#line 32 "regression-bugs-tmp/dec10-print.imp"
_imp_WRITE(EXP, 1);
                                                                //     33  %END
#line 33 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10PRINTFL at level 2
                                                                //     34  
                                                                //     35  %ROUTINE DEC10 PRINT(%REAL R, %INTEGER B,A)
#line 35 "regression-bugs-tmp/dec10-print.imp"
void DEC10PRINT( float R, int B, int A )
#line 35 "regression-bugs-tmp/dec10-print.imp"
{
                                                                //     36     %REAL RM
#line 36 "regression-bugs-tmp/dec10-print.imp"
float RM;
                                                                //     37     %CONSTINTEGER MAX INT= 8_377777777777
                                                                //     38     %INTEGER SIGN
#line 38 "regression-bugs-tmp/dec10-print.imp"
int SIGN;
                                                                //     39     %ROUTINE P(%INTEGER N)
#line 39 "regression-bugs-tmp/dec10-print.imp"
void P( int N )
#line 39 "regression-bugs-tmp/dec10-print.imp"
{
                                                                //     40        B = B-1
#line 40 "regression-bugs-tmp/dec10-print.imp"
B = (((int)(B)) - (1));
                                                                //     41        P(N//10) %IF N >= 10
#line 41 "regression-bugs-tmp/dec10-print.imp"
if (((N) < (10))) goto L_0011;
#line 41 "regression-bugs-tmp/dec10-print.imp"
P(((long)((long)((int)(N)) / (long)((int)(10)))));
#line 41 "regression-bugs-tmp/dec10-print.imp"
L_0011:;
                                                                //     42        %IF SIGN # 0 %START
#line 42 "regression-bugs-tmp/dec10-print.imp"
if (((SIGN) == (0))) goto L_0012;
                                                                //     43           SPACES(B-1)
#line 43 "regression-bugs-tmp/dec10-print.imp"
_imp_SPACES((((int)(B)) - (1)));
                                                                //     44           PRINTSYMBOL(SIGN);  SIGN = 0
#line 44 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL(SIGN);
#line 44 "regression-bugs-tmp/dec10-print.imp"
SIGN = 0;
                                                                //     45        %FINISH
#line 45 "regression-bugs-tmp/dec10-print.imp"
L_0012:;
                                                                //     46        PRINTSYMBOL(REM(N,10)+'0')
#line 46 "regression-bugs-tmp/dec10-print.imp"
_imp_PRINTSYMBOL((((int)(_imp_REM(N, 10))) + (48)));
                                                                //     47     %END
#line 47 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block P at level 3
                                                                //     48     RM=|R|
#line 48 "regression-bugs-tmp/dec10-print.imp"
RM = _imp_MOD(R);
                                                                //     49     DEC10 PRINTFL(R, B+A) %AND %RETURN %IF RM> MAX INT
#line 49 "regression-bugs-tmp/dec10-print.imp"
if (((RM) <= ((-1)))) goto L_0013;
#line 49 "regression-bugs-tmp/dec10-print.imp"
DEC10PRINTFL(R, (((int)(B)) + (A)));
#line 49 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 49 "regression-bugs-tmp/dec10-print.imp"
L_0013:;
                                                                //     50     %IF A<=0 %START
#line 50 "regression-bugs-tmp/dec10-print.imp"
if (((A) > (0))) goto L_0014;
                                                                //     51        RM=RM+0.5
#line 51 "regression-bugs-tmp/dec10-print.imp"
RM = (((double)(RM)) + (0.5));
                                                                //     52     %ELSE
#line 52 "regression-bugs-tmp/dec10-print.imp"
goto L_0015;
#line 52 "regression-bugs-tmp/dec10-print.imp"
L_0014:;
/*promote*/                                                                //     53        RM=RM+0.5*10\(-A)
#line 53 "regression-bugs-tmp/dec10-print.imp"
RM = ((RM) + ((float)(((0.5) * ((double)(_imp_REXP(10, (-(A)))))))));
                                                                //     54     %FINISH
#line 54 "regression-bugs-tmp/dec10-print.imp"
L_0015:;
                                                                //     55     %IF B<=0 %THEN SIGN=0 %ELSE SIGN=' '
#line 55 "regression-bugs-tmp/dec10-print.imp"
if (((B) > (0))) goto L_0016;
#line 55 "regression-bugs-tmp/dec10-print.imp"
SIGN = 0;
#line 55 "regression-bugs-tmp/dec10-print.imp"
goto L_0017;
#line 55 "regression-bugs-tmp/dec10-print.imp"
L_0016:;
#line 55 "regression-bugs-tmp/dec10-print.imp"
SIGN = 32;
#line 55 "regression-bugs-tmp/dec10-print.imp"
L_0017:;
                                                                //     56     %IF R<0 %THEN SIGN='-'
#line 56 "regression-bugs-tmp/dec10-print.imp"
if (((R) >= (0))) goto L_0018;
#line 56 "regression-bugs-tmp/dec10-print.imp"
SIGN = 45;
#line 56 "regression-bugs-tmp/dec10-print.imp"
L_0018:;
                                                                //     57     P(INT PT(RM));  !THUS ALLOWING FOR -0.1 ETC.
#line 57 "regression-bugs-tmp/dec10-print.imp"
P(_imp_INTPT(RM));
                                                                //     58     DEC10 FRACTION(RM,A)
#line 58 "regression-bugs-tmp/dec10-print.imp"
DEC10FRACTION(RM, A);
                                                                //     59  %END
#line 59 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10PRINT at level 2
                                                                //     60  
                                                                //     61  %endofprogram
#line 61 "regression-bugs-tmp/dec10-print.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 61 "regression-bugs-tmp/dec10-print.imp"
// End of file
