#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/printfl-apm.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3  %routine print 68k(%real x, %integer n,m)
#line 3 "regression-bugs-tmp/printfl-apm.imp"
void PRINT68K( float X, int N, int M )
#line 3 "regression-bugs-tmp/printfl-apm.imp"
{
                                                                //      4  %constreal pmax = 2147483647.0
#line 4 "regression-bugs-tmp/printfl-apm.imp"
const float PMAX = 2147483647.0;
                                                                //      5  %real y,z
#line 5 "regression-bugs-tmp/printfl-apm.imp"
float Y;
#line 5 "regression-bugs-tmp/printfl-apm.imp"
float Z;
                                                                //      6  %integer i=0,l,count=0,sign
#line 6 "regression-bugs-tmp/printfl-apm.imp"
int I;
#line 6 "regression-bugs-tmp/printfl-apm.imp"
I = 0;
#line 6 "regression-bugs-tmp/printfl-apm.imp"
int L;
#line 6 "regression-bugs-tmp/printfl-apm.imp"
int COUNT;
#line 6 "regression-bugs-tmp/printfl-apm.imp"
COUNT = 0;
#line 6 "regression-bugs-tmp/printfl-apm.imp"
int SIGN;
                                                                //      7    sign = ' '
#line 7 "regression-bugs-tmp/printfl-apm.imp"
SIGN = 32;
                                                                //      8    sign = '-' %if x < 0
#line 8 "regression-bugs-tmp/printfl-apm.imp"
if (((X) >= (0))) goto L_0002;
#line 8 "regression-bugs-tmp/printfl-apm.imp"
SIGN = 45;
#line 8 "regression-bugs-tmp/printfl-apm.imp"
L_0002:;
                                                                //      9    y = |x|+0.5/10.0\{^}m;  !modulus, rounded
#line 9 "regression-bugs-tmp/printfl-apm.imp"
Y = (((_imp_MOD(X))) + (((double)((double)((double)(0.5)) / (double)((_imp_REXP(10.0, M)))))));
                                                                //     10    %if y > pmax %start
#line 10 "regression-bugs-tmp/printfl-apm.imp"
if (((Y) <= (PMAX))) goto L_0003;
                                                                //     11      count = count+1 %and y = y/10.0 %until y < 10.0
#line 11 "regression-bugs-tmp/printfl-apm.imp"
L_0004:;
#line 11 "regression-bugs-tmp/printfl-apm.imp"
COUNT = (((int)(COUNT)) + (1));
#line 11 "regression-bugs-tmp/printfl-apm.imp"
Y = (double)((double)((float)(Y)) / (double)((double)(10.0)));
#line 11 "regression-bugs-tmp/printfl-apm.imp"
if (((Y) < (10.0))) goto L_0005;
#line 11 "regression-bugs-tmp/printfl-apm.imp"
goto L_0004;
#line 11 "regression-bugs-tmp/printfl-apm.imp"
L_0005:;
                                                                //     12    %finish
#line 12 "regression-bugs-tmp/printfl-apm.imp"
L_0003:;
                                                                //     13    z = 1.0
#line 13 "regression-bugs-tmp/printfl-apm.imp"
Z = 1.0;
                                                                //     14    %cycle
#line 14 "regression-bugs-tmp/printfl-apm.imp"
L_0007:;
                                                                //     15      i = i+1;  z = z*10.0
#line 15 "regression-bugs-tmp/printfl-apm.imp"
I = (((int)(I)) + (1));
#line 15 "regression-bugs-tmp/printfl-apm.imp"
Z = (((double)(Z)) * (10.0));
                                                                //     16    %repeat %until z > y
#line 16 "regression-bugs-tmp/printfl-apm.imp"
if (((Z) > (Y))) goto L_0008;
#line 16 "regression-bugs-tmp/printfl-apm.imp"
goto L_0007;
#line 16 "regression-bugs-tmp/printfl-apm.imp"
L_0008:;
                                                                //     17    spaces(n-i)
#line 17 "regression-bugs-tmp/printfl-apm.imp"
_imp_SPACES((((int)(N)) - (I)));
                                                                //     18    printsymbol(sign) %unless sign = ' ' %and n <= 0
#line 18 "regression-bugs-tmp/printfl-apm.imp"
if (((SIGN) != (32))) goto L_0009;
#line 18 "regression-bugs-tmp/printfl-apm.imp"
if (((N) <= (0))) goto L_000a;
#line 18 "regression-bugs-tmp/printfl-apm.imp"
L_0009:;
#line 18 "regression-bugs-tmp/printfl-apm.imp"
_imp_PRINTSYMBOL(SIGN);
#line 18 "regression-bugs-tmp/printfl-apm.imp"
L_000a:;
                                                                //     19    %cycle
#line 19 "regression-bugs-tmp/printfl-apm.imp"
L_000b:;
                                                                //     20      z = z/10.0
#line 20 "regression-bugs-tmp/printfl-apm.imp"
Z = (double)((double)((float)(Z)) / (double)((double)(10.0)));
                                                                //     21      l = int pt(y/z)
#line 21 "regression-bugs-tmp/printfl-apm.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
#line 22 "regression-bugs-tmp/printfl-apm.imp"
Y = ((Y) - ((float)((((float)(L)) * (Z)))));
                                                                //     23      printsymbol(l+'0')
#line 23 "regression-bugs-tmp/printfl-apm.imp"
_imp_PRINTSYMBOL((((int)(L)) + (48)));
                                                                //     24      i = i-1
#line 24 "regression-bugs-tmp/printfl-apm.imp"
I = (((int)(I)) - (1));
                                                                //     25      %exit %if i+m <= 0
#line 25 "regression-bugs-tmp/printfl-apm.imp"
if ((((((int)(I)) + (M))) > (0))) goto L_000e;
#line 25 "regression-bugs-tmp/printfl-apm.imp"
goto L_000c;
#line 25 "regression-bugs-tmp/printfl-apm.imp"
L_000e:;
                                                                //     26      print symbol('.') %if i = 0
#line 26 "regression-bugs-tmp/printfl-apm.imp"
if (((I) != (0))) goto L_000f;
#line 26 "regression-bugs-tmp/printfl-apm.imp"
_imp_PRINTSYMBOL(46);
#line 26 "regression-bugs-tmp/printfl-apm.imp"
L_000f:;
                                                                //     27    %repeat
#line 27 "regression-bugs-tmp/printfl-apm.imp"
goto L_000b;
#line 27 "regression-bugs-tmp/printfl-apm.imp"
L_000c:;
                                                                //     28    printsymbol('@') {%and write 68k(count,0)} %if count # 0
#line 28 "regression-bugs-tmp/printfl-apm.imp"
if (((COUNT) == (0))) goto L_0010;
#line 28 "regression-bugs-tmp/printfl-apm.imp"
_imp_PRINTSYMBOL(64);
#line 28 "regression-bugs-tmp/printfl-apm.imp"
L_0010:;
                                                                //     29  %end;  !print
#line 29 "regression-bugs-tmp/printfl-apm.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINT68K at level 2
                                                                //     30  
                                                                //     31  %routine printfl 68k(%real x, %integer n)
#line 31 "regression-bugs-tmp/printfl-apm.imp"
void PRINTFL68K( float X, int N )
#line 31 "regression-bugs-tmp/printfl-apm.imp"
{
                                                                //     32  %real y,round
#line 32 "regression-bugs-tmp/printfl-apm.imp"
float Y;
#line 32 "regression-bugs-tmp/printfl-apm.imp"
float ROUND;
                                                                //     33  %integer count=-99,sign=0
#line 33 "regression-bugs-tmp/printfl-apm.imp"
int COUNT;
#line 33 "regression-bugs-tmp/printfl-apm.imp"
COUNT = (-99);
#line 33 "regression-bugs-tmp/printfl-apm.imp"
int SIGN;
#line 33 "regression-bugs-tmp/printfl-apm.imp"
SIGN = 0;
                                                                //     34    %if x # 0 %start
#line 34 "regression-bugs-tmp/printfl-apm.imp"
if (((X) == (0))) goto L_0011;
                                                                //     35      x = -x %and sign = 1 %if x < 0
#line 35 "regression-bugs-tmp/printfl-apm.imp"
if (((X) >= (0))) goto L_0012;
#line 35 "regression-bugs-tmp/printfl-apm.imp"
X = (-(X));
#line 35 "regression-bugs-tmp/printfl-apm.imp"
SIGN = 1;
#line 35 "regression-bugs-tmp/printfl-apm.imp"
L_0012:;
                                                                //     36     !Adjust X so that 1.0 <= rounded(X) < 10.0
                                                                //     37      count = 0;  round = 0.5\{^}n
#line 37 "regression-bugs-tmp/printfl-apm.imp"
COUNT = 0;
#line 37 "regression-bugs-tmp/printfl-apm.imp"
ROUND = _imp_REXP(0.5, N);
                                                                //     38      y = 1.0-round
#line 38 "regression-bugs-tmp/printfl-apm.imp"
Y = ((1.0) - ((double)(ROUND)));
                                                                //     39      %if x < y %start;  !ie rounded(X) < 1.0
#line 39 "regression-bugs-tmp/printfl-apm.imp"
if (((X) >= (Y))) goto L_0013;
                                                                //     40        count = count-1 %and x = x*10.0 %until x >= y
#line 40 "regression-bugs-tmp/printfl-apm.imp"
L_0014:;
#line 40 "regression-bugs-tmp/printfl-apm.imp"
COUNT = (((int)(COUNT)) - (1));
#line 40 "regression-bugs-tmp/printfl-apm.imp"
X = (((double)(X)) * (10.0));
#line 40 "regression-bugs-tmp/printfl-apm.imp"
if (((X) >= (Y))) goto L_0015;
#line 40 "regression-bugs-tmp/printfl-apm.imp"
goto L_0014;
#line 40 "regression-bugs-tmp/printfl-apm.imp"
L_0015:;
                                                                //     41      %finish %else %start
#line 41 "regression-bugs-tmp/printfl-apm.imp"
goto L_0017;
#line 41 "regression-bugs-tmp/printfl-apm.imp"
L_0013:;
                                                                //     42        y = 10.0-round
#line 42 "regression-bugs-tmp/printfl-apm.imp"
Y = ((10.0) - ((double)(ROUND)));
                                                                //     43        %while x >= y %cycle;  !ie rounded(X) > 10.0
#line 43 "regression-bugs-tmp/printfl-apm.imp"
L_0018:;
#line 43 "regression-bugs-tmp/printfl-apm.imp"
if (((X) < (Y))) goto L_0019;
                                                                //     44          count = count+1;  x = x/10.0
#line 44 "regression-bugs-tmp/printfl-apm.imp"
COUNT = (((int)(COUNT)) + (1));
#line 44 "regression-bugs-tmp/printfl-apm.imp"
X = (double)((double)((float)(X)) / (double)((double)(10.0)));
                                                                //     45        %repeat
#line 45 "regression-bugs-tmp/printfl-apm.imp"
goto L_0018;
#line 45 "regression-bugs-tmp/printfl-apm.imp"
L_0019:;
                                                                //     46      %finish
#line 46 "regression-bugs-tmp/printfl-apm.imp"
L_0017:;
                                                                //     47      x = -x %if sign # 0
#line 47 "regression-bugs-tmp/printfl-apm.imp"
if (((SIGN) == (0))) goto L_001b;
#line 47 "regression-bugs-tmp/printfl-apm.imp"
X = (-(X));
#line 47 "regression-bugs-tmp/printfl-apm.imp"
L_001b:;
                                                                //     48    %finish
#line 48 "regression-bugs-tmp/printfl-apm.imp"
L_0011:;
                                                                //     49    print 68k(x,1,n)
#line 49 "regression-bugs-tmp/printfl-apm.imp"
PRINT68K(X, 1, N);
                                                                //     50    printsymbol('@')
#line 50 "regression-bugs-tmp/printfl-apm.imp"
_imp_PRINTSYMBOL(64);
                                                                //     51  !  write 68k(count,0)
                                                                //     52  %end;  !printfl
#line 52 "regression-bugs-tmp/printfl-apm.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINTFL68K at level 2
                                                                //     53  
                                                                //     54  %endofprogram
#line 54 "regression-bugs-tmp/printfl-apm.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 54 "regression-bugs-tmp/printfl-apm.imp"
// End of file
