#include <perms.h>

                                                                //      1  %begin ;! force an extra scope since top-level routines like printsymbol were clashing with perms version.
#line 1 "regression-bugs-tmp/writeprint.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3  %reals %long
                                                                //      4  
                                                                //      5  ! This program shows explicitly the results of write(m,n) for each significant
                                                                //      6  ! size of m and n, and tests the extreme cases of MIN and MAX INT.
                                                                //      7  
                                                                //      8  ! First, we replace the standard output calls with local versions which
                                                                //      9  ! keep track of 'outpos', to help with formatting output into columns:
                                                                //     10  
                                                                //     11  ! In order to do this for the in-built 'write' etc, we have reimplemented local copies
                                                                //     12  ! of the current library versions which have been tested and confirmed to be identical.
                                                                //     13  
                                                                //     14  ! The output table is rather wide and may need to be viewed using a small font.
                                                                //     15  
                                                                //     16  %own %integer outpos = 0
#line 16 "regression-bugs-tmp/writeprint.imp"
static int OUTPOS = 0;
                                                                //     17  
                                                                //     18  %routine intrinsic printsymbol(%integer ch)
#line 18 "regression-bugs-tmp/writeprint.imp"
void INTRINSICPRINTSYMBOL( int CH )
#line 18 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     19     printsymbol(ch)
#line 19 "regression-bugs-tmp/writeprint.imp"
_imp_PRINTSYMBOL(CH);
                                                                //     20  %end
#line 20 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block INTRINSICPRINTSYMBOL at level 2
                                                                //     21  
                                                                //     22  %routine printsymbol(%integer ch)
#line 22 "regression-bugs-tmp/writeprint.imp"
void PRINTSYMBOL( int CH )
#line 22 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     23     intrinsic printsymbol(ch)
#line 23 "regression-bugs-tmp/writeprint.imp"
INTRINSICPRINTSYMBOL(CH);
                                                                //     24     %if ch = 'J'&31 %or ch = 'M'&31 %or ch = 'L'&31 %start ;! nl cr ff
#line 24 "regression-bugs-tmp/writeprint.imp"
if (((CH) == (((74) & (31))))) goto L_0002;
#line 24 "regression-bugs-tmp/writeprint.imp"
if (((CH) == (((77) & (31))))) goto L_0002;
#line 24 "regression-bugs-tmp/writeprint.imp"
if (((CH) != (((76) & (31))))) goto L_0003;
#line 24 "regression-bugs-tmp/writeprint.imp"
L_0002:;
                                                                //     25        outpos = 0
#line 25 "regression-bugs-tmp/writeprint.imp"
OUTPOS = 0;
                                                                //     26     %else %if ch = 'H'&31 ;! bs
#line 26 "regression-bugs-tmp/writeprint.imp"
goto L_0004;
#line 26 "regression-bugs-tmp/writeprint.imp"
L_0003:;
#line 26 "regression-bugs-tmp/writeprint.imp"
if (((CH) != (((72) & (31))))) goto L_0005;
                                                                //     27        outpos = outpos - 1 %if outpos > 0
#line 27 "regression-bugs-tmp/writeprint.imp"
if (((OUTPOS) <= (0))) goto L_0006;
#line 27 "regression-bugs-tmp/writeprint.imp"
OUTPOS = (((int)(OUTPOS)) - (1));
#line 27 "regression-bugs-tmp/writeprint.imp"
L_0006:;
                                                                //     28     %else %if ch = 'I'&31 ;! tab
#line 28 "regression-bugs-tmp/writeprint.imp"
goto L_0004;
#line 28 "regression-bugs-tmp/writeprint.imp"
L_0005:;
#line 28 "regression-bugs-tmp/writeprint.imp"
if (((CH) != (((73) & (31))))) goto L_0007;
                                                                //     29        outpos = (outpos + 8) & (\7)  ;! at least on linux
#line 29 "regression-bugs-tmp/writeprint.imp"
OUTPOS = (((((int)(OUTPOS)) + (8))) & ((~(7))));
                                                                //     30     %else
#line 30 "regression-bugs-tmp/writeprint.imp"
goto L_0004;
#line 30 "regression-bugs-tmp/writeprint.imp"
L_0007:;
                                                                //     31        outpos = outpos + 1
#line 31 "regression-bugs-tmp/writeprint.imp"
OUTPOS = (((int)(OUTPOS)) + (1));
                                                                //     32     %finish
#line 32 "regression-bugs-tmp/writeprint.imp"
L_0004:;
                                                                //     33  %end
#line 33 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINTSYMBOL at level 2
                                                                //     34  
                                                                //     35  %routine newline
#line 35 "regression-bugs-tmp/writeprint.imp"
void NEWLINE( void )
#line 35 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     36     printsymbol(nl)
#line 36 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(10);
                                                                //     37  %end
#line 37 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block NEWLINE at level 2
                                                                //     38  
                                                                //     39  %routine newlines(%integer n)
#line 39 "regression-bugs-tmp/writeprint.imp"
void NEWLINES( int N )
#line 39 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     40     %integer i
#line 40 "regression-bugs-tmp/writeprint.imp"
int I;
                                                                //     41     %return %if n <= 0
#line 41 "regression-bugs-tmp/writeprint.imp"
if (((N) > (0))) goto L_0008;
#line 41 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 41 "regression-bugs-tmp/writeprint.imp"
L_0008:;
                                                                //     42     newline %for i = 1, 1, n
#line 42 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = N; I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, N");
I -= _increment; _control -= _increment;
L_0009:;
if (I == _final) goto L_000a;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
#line 42 "regression-bugs-tmp/writeprint.imp"
NEWLINE();
#line 42 "regression-bugs-tmp/writeprint.imp"
goto L_0009;
#line 42 "regression-bugs-tmp/writeprint.imp"
L_000a:;
                                                                //     43  %end
#line 43 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block NEWLINES at level 2
                                                                //     44  
                                                                //     45  %routine space
#line 45 "regression-bugs-tmp/writeprint.imp"
void SPACE( void )
#line 45 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     46     printsymbol(' ')
#line 46 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(32);
                                                                //     47  %end
#line 47 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block SPACE at level 2
                                                                //     48  
                                                                //     49  %routine spaces(%integer n)
#line 49 "regression-bugs-tmp/writeprint.imp"
void SPACES( int N )
#line 49 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     50     %integer i
#line 50 "regression-bugs-tmp/writeprint.imp"
int I;
                                                                //     51     %return %if n <= 0
#line 51 "regression-bugs-tmp/writeprint.imp"
if (((N) > (0))) goto L_000c;
#line 51 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 51 "regression-bugs-tmp/writeprint.imp"
L_000c:;
                                                                //     52     space %for i = 1, 1, n
#line 52 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = N; I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, N");
I -= _increment; _control -= _increment;
L_000d:;
if (I == _final) goto L_000e;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
#line 52 "regression-bugs-tmp/writeprint.imp"
SPACE();
#line 52 "regression-bugs-tmp/writeprint.imp"
goto L_000d;
#line 52 "regression-bugs-tmp/writeprint.imp"
L_000e:;
                                                                //     53  %end
#line 53 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block SPACES at level 2
                                                                //     54  
                                                                //     55  %routine printstring(%string (255) s)
#line 55 "regression-bugs-tmp/writeprint.imp"
void PRINTSTRING( _imp_string /*%string(255)*/ S )
#line 55 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     56     %integer i
#line 56 "regression-bugs-tmp/writeprint.imp"
int I;
                                                                //     57     printsymbol(charno(s, i)) %for i = 1, 1, length(s)
#line 57 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = *_imp_LENGTH(&S); I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, *_imp_LENGTH(&S)");
I -= _increment; _control -= _increment;
L_0010:;
if (I == _final) goto L_0011;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
#line 57 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(*_imp_CHARNO(&S, I));
#line 57 "regression-bugs-tmp/writeprint.imp"
goto L_0010;
#line 57 "regression-bugs-tmp/writeprint.imp"
L_0011:;
                                                                //     58  %end
#line 58 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINTSTRING at level 2
                                                                //     59  
                                                                //     60  %routine write(%integer m, n)
#line 60 "regression-bugs-tmp/writeprint.imp"
void WRITE( int M, int N )
#line 60 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     61    printstring("Please don't ever use plain 'write' in this program.  Use write68k for now."); newline
#line 61 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("Please don't ever use plain 'write' in this program.  Use write68k for now."));
#line 61 "regression-bugs-tmp/writeprint.imp"
NEWLINE();
                                                                //     62    printstring("The implementation in the current Imp77 is severely broken w.r.t. formatting."); newline
#line 62 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("The implementation in the current Imp77 is severely broken w.r.t. formatting."));
#line 62 "regression-bugs-tmp/writeprint.imp"
NEWLINE();
                                                                //     63    %stop
#line 63 "regression-bugs-tmp/writeprint.imp"
exit(0);
                                                                //     64  %end
#line 64 "regression-bugs-tmp/writeprint.imp"
return;
} // End of block WRITE at level 2
                                                                //     65  
                                                                //     66  !%begin ; ! Sorry, all original comments {in brackets} were lost in an unfortunate reformatting.
                                                                //     67  
                                                                //     68  
                                                                //     69  ! -----------------------------------------------------------------------------------------
                                                                //     70  
                                                                //     71     %routine write3l(%integer n, places);! Same as current Imp library
#line 71 "regression-bugs-tmp/writeprint.imp"
void WRITE3L( int N, int PLACES )
#line 71 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     72     
                                                                //     73       ! Write an integer on the current output stream, to
                                                                //     74       ! occupy PLACES character spaces on the page.
                                                                //     75       ! Nominally based on PrintString(I to S(n, places))
                                                                //     76       ! This version doesn't use strings though, and is
                                                                //     77       ! therefore smaller and quicker.  It builds the
                                                                //     78       ! characters "backwards" in an array
                                                                //     79     
                                                                //     80        %routine decimal(%integer n, %integer %name places, digits, vec)
#line 80 "regression-bugs-tmp/writeprint.imp"
void DECIMAL( int N, int /*name*/*PLACES, int /*name*/*DIGITS, int /*name*/*VEC )
#line 80 "regression-bugs-tmp/writeprint.imp"
{
                                                                //     81           %integer p, sign, d, x
#line 81 "regression-bugs-tmp/writeprint.imp"
int P;
#line 81 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 81 "regression-bugs-tmp/writeprint.imp"
int D;
#line 81 "regression-bugs-tmp/writeprint.imp"
int X;
                                                                //     82           vec = vec + 15
#line 82 "regression-bugs-tmp/writeprint.imp"
*VEC = ((*(int *)(VEC)) + (15));
                                                                //     83           sign = '-'
#line 83 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
                                                                //     84           %if n >= 0 %start
#line 84 "regression-bugs-tmp/writeprint.imp"
if (((N) < (0))) goto L_0013;
                                                                //     85              n = -n
#line 85 "regression-bugs-tmp/writeprint.imp"
N = (-(N));
                                                                //     86              sign = ' '
#line 86 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //     87              sign = 0 %if places <= 0
#line 87 "regression-bugs-tmp/writeprint.imp"
if (((*PLACES) > (0))) goto L_0014;
#line 87 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
#line 87 "regression-bugs-tmp/writeprint.imp"
L_0014:;
                                                                //     88           %finish
#line 88 "regression-bugs-tmp/writeprint.imp"
L_0013:;
                                                                //     89           %if places <= 0 %then places = -places %else places = places + 1
#line 89 "regression-bugs-tmp/writeprint.imp"
if (((*PLACES) > (0))) goto L_0015;
#line 89 "regression-bugs-tmp/writeprint.imp"
*PLACES = (-(*PLACES));
#line 89 "regression-bugs-tmp/writeprint.imp"
goto L_0016;
#line 89 "regression-bugs-tmp/writeprint.imp"
L_0015:;
#line 89 "regression-bugs-tmp/writeprint.imp"
*PLACES = ((*(int *)(PLACES)) + (1));
#line 89 "regression-bugs-tmp/writeprint.imp"
L_0016:;
                                                                //     90           p = vec
#line 90 "regression-bugs-tmp/writeprint.imp"
P = *VEC;
                                                                //     91           %cycle 
#line 91 "regression-bugs-tmp/writeprint.imp"
L_0017:;
                                                                //     92              x = n // 10
#line 92 "regression-bugs-tmp/writeprint.imp"
X = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //     93              d = n - x * 10
#line 93 "regression-bugs-tmp/writeprint.imp"
D = ((N) - ((int)((((int)(X)) * (10)))));
                                                                //     94              n = x
#line 94 "regression-bugs-tmp/writeprint.imp"
N = X;
                                                                //     95              vec = vec - 1
#line 95 "regression-bugs-tmp/writeprint.imp"
*VEC = ((*(int *)(VEC)) - (1));
                                                                //     96              byteinteger(vec) = '0' - d
#line 96 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(*VEC) = (((int)(48)) - (D));
                                                                //     97           %repeat %until n = 0
#line 97 "regression-bugs-tmp/writeprint.imp"
if (((N) == (0))) goto L_0018;
#line 97 "regression-bugs-tmp/writeprint.imp"
goto L_0017;
#line 97 "regression-bugs-tmp/writeprint.imp"
L_0018:;
                                                                //     98           %if sign # 0 %start
#line 98 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_001a;
                                                                //     99              vec = vec - 1
#line 99 "regression-bugs-tmp/writeprint.imp"
*VEC = ((*(int *)(VEC)) - (1));
                                                                //    100              byteinteger(vec) = sign
#line 100 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(*VEC) = SIGN;
                                                                //    101           %finish
#line 101 "regression-bugs-tmp/writeprint.imp"
L_001a:;
                                                                //    102           digits = p - vec
#line 102 "regression-bugs-tmp/writeprint.imp"
*DIGITS = (((int)(P)) - (*VEC));
                                                                //    103        %end
#line 103 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DECIMAL at level 3
                                                                //    104        %string (32) ch
#line 104 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(32)*/ CH;
                                                                //    105        ! Enough room for a 32 bit integer, plus sign
                                                                //    106        %integer new, digit, sign, i
#line 106 "regression-bugs-tmp/writeprint.imp"
int NEW;
#line 106 "regression-bugs-tmp/writeprint.imp"
int DIGIT;
#line 106 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 106 "regression-bugs-tmp/writeprint.imp"
int I;
                                                                //    107        length(ch) = 0
#line 107 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&CH) = 0;
                                                                //    108        ! First collect the digits
                                                                //    109        %if n = 0 %start
#line 109 "regression-bugs-tmp/writeprint.imp"
if (((N) != (0))) goto L_001b;
                                                                //    110           length(ch) = length(ch) + 1
#line 110 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&CH) = ((*(int *)(_imp_LENGTH(&CH))) + (1));
                                                                //    111           charno(ch, length(ch)) = '0'
#line 111 "regression-bugs-tmp/writeprint.imp"
*_imp_CHARNO(&CH, *_imp_LENGTH(&CH)) = 48;
                                                                //    112           sign = 0
#line 112 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    113        %else
#line 113 "regression-bugs-tmp/writeprint.imp"
goto L_001c;
#line 113 "regression-bugs-tmp/writeprint.imp"
L_001b:;
                                                                //    114           sign = 1
#line 114 "regression-bugs-tmp/writeprint.imp"
SIGN = 1;
                                                                //    115           ! we make everything negative to avoid the -ve MaxInt wrap problem
                                                                //    116           %if n > 0 %start
#line 116 "regression-bugs-tmp/writeprint.imp"
if (((N) <= (0))) goto L_001d;
                                                                //    117              sign = 0
#line 117 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    118              n = -n
#line 118 "regression-bugs-tmp/writeprint.imp"
N = (-(N));
                                                                //    119           %finish
#line 119 "regression-bugs-tmp/writeprint.imp"
L_001d:;
                                                                //    120           %while n # 0 %cycle
#line 120 "regression-bugs-tmp/writeprint.imp"
L_001e:;
#line 120 "regression-bugs-tmp/writeprint.imp"
if (((N) == (0))) goto L_001f;
                                                                //    121              new = n // 10
#line 121 "regression-bugs-tmp/writeprint.imp"
NEW = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //    122              digit = (new * 10) - n
#line 122 "regression-bugs-tmp/writeprint.imp"
DIGIT = (((int)((((int)(NEW)) * (10)))) - (N));
                                                                //    123              length(ch) = length(ch) + 1
#line 123 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&CH) = ((*(int *)(_imp_LENGTH(&CH))) + (1));
                                                                //    124              charno(ch, length(ch)) = digit + '0'
#line 124 "regression-bugs-tmp/writeprint.imp"
*_imp_CHARNO(&CH, *_imp_LENGTH(&CH)) = (((int)(DIGIT)) + (48));
                                                                //    125              n = new
#line 125 "regression-bugs-tmp/writeprint.imp"
N = NEW;
                                                                //    126           %repeat
#line 126 "regression-bugs-tmp/writeprint.imp"
goto L_001e;
#line 126 "regression-bugs-tmp/writeprint.imp"
L_001f:;
                                                                //    127        %finish
#line 127 "regression-bugs-tmp/writeprint.imp"
L_001c:;
                                                                //    128        ! Now deal with the sign, taking into account the slightly
                                                                //    129        ! idiosyncratic behaviour on positive numbers
                                                                //    130        %if sign # 0 %start
#line 130 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_0021;
                                                                //    131           length(ch) = length(ch) + 1
#line 131 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&CH) = ((*(int *)(_imp_LENGTH(&CH))) + (1));
                                                                //    132           charno(ch, length(ch)) = '-'
#line 132 "regression-bugs-tmp/writeprint.imp"
*_imp_CHARNO(&CH, *_imp_LENGTH(&CH)) = 45;
                                                                //    133        %else
#line 133 "regression-bugs-tmp/writeprint.imp"
goto L_0022;
#line 133 "regression-bugs-tmp/writeprint.imp"
L_0021:;
                                                                //    134           %if places > 0 %start
#line 134 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (0))) goto L_0023;
                                                                //    135              length(ch) = length(ch) + 1
#line 135 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&CH) = ((*(int *)(_imp_LENGTH(&CH))) + (1));
                                                                //    136              charno(ch, length(ch)) = ' '
#line 136 "regression-bugs-tmp/writeprint.imp"
*_imp_CHARNO(&CH, *_imp_LENGTH(&CH)) = 32;
                                                                //    137           %finish
#line 137 "regression-bugs-tmp/writeprint.imp"
L_0023:;
                                                                //    138        %finish
#line 138 "regression-bugs-tmp/writeprint.imp"
L_0022:;
                                                                //    139        ! Now we adjust Places, also slightly mysteriously
                                                                //    140        %if places <= 0 %then places = -places %else places = places + 1
#line 140 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) > (0))) goto L_0024;
#line 140 "regression-bugs-tmp/writeprint.imp"
PLACES = (-(PLACES));
#line 140 "regression-bugs-tmp/writeprint.imp"
goto L_0025;
#line 140 "regression-bugs-tmp/writeprint.imp"
L_0024:;
#line 140 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) + (1));
#line 140 "regression-bugs-tmp/writeprint.imp"
L_0025:;
                                                                //    141        ! The array at CH now contains the characters (backwards)
                                                                //    142        ! and the character count is in NEXT
                                                                //    143        %while places > length(ch) %cycle
#line 143 "regression-bugs-tmp/writeprint.imp"
L_0026:;
#line 143 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (*_imp_LENGTH(&CH)))) goto L_0027;
                                                                //    144           length(ch) = length(ch) + 1
#line 144 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&CH) = ((*(int *)(_imp_LENGTH(&CH))) + (1));
                                                                //    145           charno(ch, length(ch)) = ' '
#line 145 "regression-bugs-tmp/writeprint.imp"
*_imp_CHARNO(&CH, *_imp_LENGTH(&CH)) = 32;
                                                                //    146           places = places - 1
#line 146 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
                                                                //    147        %repeat
#line 147 "regression-bugs-tmp/writeprint.imp"
goto L_0026;
#line 147 "regression-bugs-tmp/writeprint.imp"
L_0027:;
                                                                //    148        %for i = length(ch), -1, 1 %cycle
#line 148 "regression-bugs-tmp/writeprint.imp"
I = ((*(unsigned char *)(_imp_LENGTH(&CH))) + (1));
if ((((1)-(*_imp_LENGTH(&CH))) % ((-1))) != 0) _imp_signal(5,1,0,"Illegal cycle I = *_imp_LENGTH(&CH), (-1), 1");
L_0029:;
if (I == 1) goto L_002a;
I += (-1);
                                                                //    149           printsymbol(charno(ch, i))
#line 149 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(*_imp_CHARNO(&CH, I));
                                                                //    150        %repeat
#line 150 "regression-bugs-tmp/writeprint.imp"
goto L_0029;
#line 150 "regression-bugs-tmp/writeprint.imp"
L_002a:;
                                                                //    151     %end
#line 151 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block WRITE3L at level 2
                                                                //    152     
                                                                //    153  ! -----------------------------------------------------------------------------------------
                                                                //    154  
                                                                //    155  %routine vax write(%integer n, p)
#line 155 "regression-bugs-tmp/writeprint.imp"
void VAXWRITE( int N, int P )
#line 155 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    156  %string(63)%fn itos(%integer n, p)
#line 156 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(63)*/ ITOS( int N, int P )
#line 156 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    157     %string(255) answer
#line 157 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(255)*/ ANSWER;
                                                                //    158     %byteintegerarray a(0:64)
#line 158 "regression-bugs-tmp/writeprint.imp"
unsigned char A[65];
                                                                //    159     %integer sign, sym, pt, val
#line 159 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 159 "regression-bugs-tmp/writeprint.imp"
int SYM;
#line 159 "regression-bugs-tmp/writeprint.imp"
int PT;
#line 159 "regression-bugs-tmp/writeprint.imp"
int VAL;
                                                                //    160     val = p
#line 160 "regression-bugs-tmp/writeprint.imp"
VAL = P;
                                                                //    161     %if p > 0 %then p = p+1 %else p = -p
#line 161 "regression-bugs-tmp/writeprint.imp"
if (((P) <= (0))) goto L_002c;
#line 161 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) + (1));
#line 161 "regression-bugs-tmp/writeprint.imp"
goto L_002d;
#line 161 "regression-bugs-tmp/writeprint.imp"
L_002c:;
#line 161 "regression-bugs-tmp/writeprint.imp"
P = (-(P));
#line 161 "regression-bugs-tmp/writeprint.imp"
L_002d:;
                                                                //    162     p = 63 %if p > 63
#line 162 "regression-bugs-tmp/writeprint.imp"
if (((P) <= (63))) goto L_002e;
#line 162 "regression-bugs-tmp/writeprint.imp"
P = 63;
#line 162 "regression-bugs-tmp/writeprint.imp"
L_002e:;
                                                                //    163     sign = ' '
#line 163 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    164     sign = 0 %if val <= 0
#line 164 "regression-bugs-tmp/writeprint.imp"
if (((VAL) > (0))) goto L_002f;
#line 164 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
#line 164 "regression-bugs-tmp/writeprint.imp"
L_002f:;
                                                                //    165     pt = 0
#line 165 "regression-bugs-tmp/writeprint.imp"
PT = 0;
                                                                //    166     %if n < 0 %start
#line 166 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_0030;
                                                                //    167        sign = '-'
#line 167 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
                                                                //    168        %if n = 16_80000000 %start
#line 168 "regression-bugs-tmp/writeprint.imp"
if (((N) != ((-2147483648)))) goto L_0031;
                                                                //    169           string(addr(a(pt))) = "8463847412"
#line 169 "regression-bugs-tmp/writeprint.imp"
*_imp_STRING(_imp_ADDR(&A[PT])) = _imp_str_literal("8463847412");
                                                                //    170           pt = pt + 10
#line 170 "regression-bugs-tmp/writeprint.imp"
PT = (((int)(PT)) + (10));
                                                                //    171           -> set
#line 171 "regression-bugs-tmp/writeprint.imp"
goto U_1000;
                                                                //    172           %finish
#line 172 "regression-bugs-tmp/writeprint.imp"
L_0031:;
                                                                //    173        n = -n
#line 173 "regression-bugs-tmp/writeprint.imp"
N = (-(N));
                                                                //    174        %finish
#line 174 "regression-bugs-tmp/writeprint.imp"
L_0030:;
                                                                //    175     %cycle
#line 175 "regression-bugs-tmp/writeprint.imp"
L_0032:;
                                                                //    176        sym = n-n//10*10
#line 176 "regression-bugs-tmp/writeprint.imp"
SYM = ((N) - (((((long)((long)((int)(N)) / (long)((int)(10))))) * (10))));
                                                                //    177        pt = pt+1
#line 177 "regression-bugs-tmp/writeprint.imp"
PT = (((int)(PT)) + (1));
                                                                //    178        a(pt) = sym+'0'
#line 178 "regression-bugs-tmp/writeprint.imp"
A[PT] = (((int)(SYM)) + (48));
                                                                //    179        n = n//10
#line 179 "regression-bugs-tmp/writeprint.imp"
N = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //    180     %repeat %until n = 0
#line 180 "regression-bugs-tmp/writeprint.imp"
if (((N) == (0))) goto L_0033;
#line 180 "regression-bugs-tmp/writeprint.imp"
goto L_0032;
#line 180 "regression-bugs-tmp/writeprint.imp"
L_0033:;
                                                                //    181    set:
#line 181 "regression-bugs-tmp/writeprint.imp"
U_1000:;
                                                                //    182     %if sign # 0 %start
#line 182 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_0035;
                                                                //    183        pt = pt+1;  a(pt) = sign
#line 183 "regression-bugs-tmp/writeprint.imp"
PT = (((int)(PT)) + (1));
#line 183 "regression-bugs-tmp/writeprint.imp"
A[PT] = SIGN;
                                                                //    184     %finish
#line 184 "regression-bugs-tmp/writeprint.imp"
L_0035:;
                                                                //    185     %while pt < p %cycle
#line 185 "regression-bugs-tmp/writeprint.imp"
L_0036:;
#line 185 "regression-bugs-tmp/writeprint.imp"
if (((PT) >= (P))) goto L_0037;
                                                                //    186        pt = pt+1;  a(pt) = ' '
#line 186 "regression-bugs-tmp/writeprint.imp"
PT = (((int)(PT)) + (1));
#line 186 "regression-bugs-tmp/writeprint.imp"
A[PT] = 32;
                                                                //    187     %repeat
#line 187 "regression-bugs-tmp/writeprint.imp"
goto L_0036;
#line 187 "regression-bugs-tmp/writeprint.imp"
L_0037:;
                                                                //    188     answer = ""
#line 188 "regression-bugs-tmp/writeprint.imp"
ANSWER = _imp_str_literal("");
                                                                //    189     %cycle
#line 189 "regression-bugs-tmp/writeprint.imp"
L_0039:;
                                                                //    190        answer = answer.tostring(a(pt))
#line 190 "regression-bugs-tmp/writeprint.imp"
ANSWER = _imp_join((_imp_string)ANSWER,(_imp_string)_imp_TOSTRING(A[PT]));
                                                                //    191        pt = pt-1
#line 191 "regression-bugs-tmp/writeprint.imp"
PT = (((int)(PT)) - (1));
                                                                //    192     %repeat %until pt = 0
#line 192 "regression-bugs-tmp/writeprint.imp"
if (((PT) == (0))) goto L_003a;
#line 192 "regression-bugs-tmp/writeprint.imp"
goto L_0039;
#line 192 "regression-bugs-tmp/writeprint.imp"
L_003a:;
                                                                //    193     %result = answer
#line 193 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return ANSWER;
                                                                //    194  %end
#line 194 "regression-bugs-tmp/writeprint.imp"
} // End of block ITOS at level 3
                                                                //    195     space %and p = p-1 %while p > 62
#line 195 "regression-bugs-tmp/writeprint.imp"
L_003c:;
#line 195 "regression-bugs-tmp/writeprint.imp"
if (((P) <= (62))) goto L_003d;
#line 195 "regression-bugs-tmp/writeprint.imp"
SPACE();
#line 195 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
#line 195 "regression-bugs-tmp/writeprint.imp"
goto L_003c;
#line 195 "regression-bugs-tmp/writeprint.imp"
L_003d:;
                                                                //    196     printstring(itos(n, p))
#line 196 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(ITOS(N, P));
                                                                //    197  %end
#line 197 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block VAXWRITE at level 2
                                                                //    198  
                                                                //    199  ! -----------------------------------------------------------------------------------------
                                                                //    200     
                                                                //    201     %routine write68k(%integer v, p)
#line 201 "regression-bugs-tmp/writeprint.imp"
void WRITE68K( int V, int P )
#line 201 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    202        %integer vv, q, pos
#line 202 "regression-bugs-tmp/writeprint.imp"
int VV;
#line 202 "regression-bugs-tmp/writeprint.imp"
int Q;
#line 202 "regression-bugs-tmp/writeprint.imp"
int POS;
                                                                //    203        %byte %integer %array store(0 : 15)
#line 203 "regression-bugs-tmp/writeprint.imp"
unsigned char STORE[16];
                                                                //    204        vv = v
#line 204 "regression-bugs-tmp/writeprint.imp"
VV = V;
                                                                //    205        vv = -vv %if vv > 0
#line 205 "regression-bugs-tmp/writeprint.imp"
if (((VV) <= (0))) goto L_003f;
#line 205 "regression-bugs-tmp/writeprint.imp"
VV = (-(VV));
#line 205 "regression-bugs-tmp/writeprint.imp"
L_003f:;
                                                                //    206        pos = 15
#line 206 "regression-bugs-tmp/writeprint.imp"
POS = 15;
                                                                //    207        %while vv <= -10 %cycle
#line 207 "regression-bugs-tmp/writeprint.imp"
L_0040:;
#line 207 "regression-bugs-tmp/writeprint.imp"
if (((VV) > ((-10)))) goto L_0041;
                                                                //    208           q = vv // 10
#line 208 "regression-bugs-tmp/writeprint.imp"
Q = (long)((long)((int)(VV)) / (long)((int)(10)));
                                                                //    209           store(pos) = q * 10 - vv + '0'
#line 209 "regression-bugs-tmp/writeprint.imp"
STORE[POS] = (((int)((((int)((((int)(Q)) * (10)))) - (VV)))) + (48));
                                                                //    210           pos = pos - 1
#line 210 "regression-bugs-tmp/writeprint.imp"
POS = (((int)(POS)) - (1));
                                                                //    211           vv = q
#line 211 "regression-bugs-tmp/writeprint.imp"
VV = Q;
                                                                //    212        %repeat
#line 212 "regression-bugs-tmp/writeprint.imp"
goto L_0040;
#line 212 "regression-bugs-tmp/writeprint.imp"
L_0041:;
                                                                //    213        store(pos) = '0' - vv
#line 213 "regression-bugs-tmp/writeprint.imp"
STORE[POS] = (((int)(48)) - (VV));
                                                                //    214        %if p <= 0 %start
#line 214 "regression-bugs-tmp/writeprint.imp"
if (((P) > (0))) goto L_0043;
                                                                //    215           spaces(pos - 16 - p) %if p < 0
#line 215 "regression-bugs-tmp/writeprint.imp"
if (((P) >= (0))) goto L_0044;
#line 215 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)((((int)(POS)) - (16)))) - (P)));
#line 215 "regression-bugs-tmp/writeprint.imp"
L_0044:;
                                                                //    216        %finish %else %start
#line 216 "regression-bugs-tmp/writeprint.imp"
goto L_0045;
#line 216 "regression-bugs-tmp/writeprint.imp"
L_0043:;
                                                                //    217           spaces(pos - 16 + p)
#line 217 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)((((int)(POS)) - (16)))) + (P)));
                                                                //    218           printsymbol(' ') %if v >= 0
#line 218 "regression-bugs-tmp/writeprint.imp"
if (((V) < (0))) goto L_0046;
#line 218 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(32);
#line 218 "regression-bugs-tmp/writeprint.imp"
L_0046:;
                                                                //    219        %finish
#line 219 "regression-bugs-tmp/writeprint.imp"
L_0045:;
                                                                //    220        printsymbol('-') %if v < 0
#line 220 "regression-bugs-tmp/writeprint.imp"
if (((V) >= (0))) goto L_0047;
#line 220 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(45);
#line 220 "regression-bugs-tmp/writeprint.imp"
L_0047:;
                                                                //    221        printsymbol(store(pos)) %and pos = pos + 1 %until pos = 16
#line 221 "regression-bugs-tmp/writeprint.imp"
L_0048:;
#line 221 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(STORE[POS]);
#line 221 "regression-bugs-tmp/writeprint.imp"
POS = (((int)(POS)) + (1));
#line 221 "regression-bugs-tmp/writeprint.imp"
if (((POS) == (16))) goto L_0049;
#line 221 "regression-bugs-tmp/writeprint.imp"
goto L_0048;
#line 221 "regression-bugs-tmp/writeprint.imp"
L_0049:;
                                                                //    222     %end
#line 222 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block WRITE68K at level 2
                                                                //    223  
                                                                //    224  ! -----------------------------------------------------------------------------------------
                                                                //    225     
                                                                //    226  %routine emaswrite(%integer value, places)
#line 226 "regression-bugs-tmp/writeprint.imp"
void EMASWRITE( int VALUE, int PLACES )
#line 226 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    227     !***********************************************************************
                                                                //    228     !*    SIMPLE MINDED ALL IMP VERSION NOT USING STRINGS                  *
                                                                //    229     !***********************************************************************
                                                                //    230     %string (15) %fn swrite %alias "S#SWRITE"(%integer value, places)
#line 230 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(15)*/ SWRITE( int VALUE, int PLACES )
#line 230 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    231        !***********************************************************************
                                                                //    232        !*    SIMPLE MINDED ALL IMP VERSION                                    *
                                                                //    233        !***********************************************************************
                                                                //    234        %string (1) sign
#line 234 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(1)*/ SIGN;
                                                                //    235        %string (255{15}) res
#line 235 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(255)*/ RES;
                                                                //    236        %integer work, ptr
#line 236 "regression-bugs-tmp/writeprint.imp"
int WORK;
#line 236 "regression-bugs-tmp/writeprint.imp"
int PTR;
                                                                //    237        %string (1) %array ch(0 : 15)
#line 237 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(1)*/ CH[16];
                                                                //    238        res = ""
#line 238 "regression-bugs-tmp/writeprint.imp"
RES = _imp_str_literal("");
                                                                //    239        sign = " "
#line 239 "regression-bugs-tmp/writeprint.imp"
SIGN = _imp_str_literal(" ");
                                                                //    240        %if value = X'80000000' %then %start
#line 240 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) != ((-2147483648)))) goto L_004b;
                                                                //    241           res = "-2147483548"
#line 241 "regression-bugs-tmp/writeprint.imp"
RES = _imp_str_literal("-2147483548");
                                                                //    242           !res = " " . res %for ptr = 1, 1, places - 10   ;! causes run-time string overflow
                                                                //    243           %if places <= 0 %start
#line 243 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) > (0))) goto L_004c;
                                                                //    244              places = -15 %if places < -15
#line 244 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) >= ((-15)))) goto L_004d;
#line 244 "regression-bugs-tmp/writeprint.imp"
PLACES = (-15);
#line 244 "regression-bugs-tmp/writeprint.imp"
L_004d:;
                                                                //    245              res = " " . res %while length(res) < |places|
#line 245 "regression-bugs-tmp/writeprint.imp"
L_004e:;
#line 245 "regression-bugs-tmp/writeprint.imp"
if (((*_imp_LENGTH(&RES)) >= (_imp_IMOD(PLACES)))) goto L_004f;
#line 245 "regression-bugs-tmp/writeprint.imp"
RES = _imp_join((_imp_string)_imp_str_literal(" "),(_imp_string)RES);
#line 245 "regression-bugs-tmp/writeprint.imp"
goto L_004e;
#line 245 "regression-bugs-tmp/writeprint.imp"
L_004f:;
                                                                //    246           %else
#line 246 "regression-bugs-tmp/writeprint.imp"
goto L_0051;
#line 246 "regression-bugs-tmp/writeprint.imp"
L_004c:;
                                                                //    247              places = 14 %if places > 14
#line 247 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (14))) goto L_0052;
#line 247 "regression-bugs-tmp/writeprint.imp"
PLACES = 14;
#line 247 "regression-bugs-tmp/writeprint.imp"
L_0052:;
                                                                //    248              res = " " . res %while length(res) < places
#line 248 "regression-bugs-tmp/writeprint.imp"
L_0053:;
#line 248 "regression-bugs-tmp/writeprint.imp"
if (((*_imp_LENGTH(&RES)) >= (PLACES))) goto L_0054;
#line 248 "regression-bugs-tmp/writeprint.imp"
RES = _imp_join((_imp_string)_imp_str_literal(" "),(_imp_string)RES);
#line 248 "regression-bugs-tmp/writeprint.imp"
goto L_0053;
#line 248 "regression-bugs-tmp/writeprint.imp"
L_0054:;
                                                                //    249              res = " " . res
#line 249 "regression-bugs-tmp/writeprint.imp"
RES = _imp_join((_imp_string)_imp_str_literal(" "),(_imp_string)RES);
                                                                //    250           %finish
#line 250 "regression-bugs-tmp/writeprint.imp"
L_0051:;
                                                                //    251           %result = res
#line 251 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return RES;
                                                                //    252        %finish
#line 252 "regression-bugs-tmp/writeprint.imp"
L_004b:;
                                                                //    253        %if value = X'80000000' %then %result = "-2147483648"
#line 253 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) != ((-2147483648)))) goto L_0056;
#line 253 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return _imp_str_literal("-2147483648");
#line 253 "regression-bugs-tmp/writeprint.imp"
L_0056:;
                                                                //    254        %if value < 0 %then sign = "-" %and value = -value
#line 254 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) >= (0))) goto L_0057;
#line 254 "regression-bugs-tmp/writeprint.imp"
SIGN = _imp_str_literal("-");
#line 254 "regression-bugs-tmp/writeprint.imp"
VALUE = (-(VALUE));
#line 254 "regression-bugs-tmp/writeprint.imp"
L_0057:;
                                                                //    255        ptr = 0
#line 255 "regression-bugs-tmp/writeprint.imp"
PTR = 0;
                                                                //    256        %cycle 
#line 256 "regression-bugs-tmp/writeprint.imp"
L_0058:;
                                                                //    257           work = value // 10
#line 257 "regression-bugs-tmp/writeprint.imp"
WORK = (long)((long)((int)(VALUE)) / (long)((int)(10)));
                                                                //    258           ch(ptr) = tostring(value - 10 * work + '0')
#line 258 "regression-bugs-tmp/writeprint.imp"
CH[PTR] = _imp_TOSTRING((((int)(((VALUE) - ((int)((((int)(10)) * (WORK))))))) + (48)));
                                                                //    259           value = work
#line 259 "regression-bugs-tmp/writeprint.imp"
VALUE = WORK;
                                                                //    260           ptr = ptr + 1
#line 260 "regression-bugs-tmp/writeprint.imp"
PTR = (((int)(PTR)) + (1));
                                                                //    261        %repeat %until value = 0
#line 261 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) == (0))) goto L_0059;
#line 261 "regression-bugs-tmp/writeprint.imp"
goto L_0058;
#line 261 "regression-bugs-tmp/writeprint.imp"
L_0059:;
                                                                //    262        res = res . " " %for work = ptr, 1, places - 1
#line 262 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = PTR; _increment = 1; _final = (((int)(PLACES)) - (1)); WORK = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle WORK = PTR, 1, (((int)(PLACES)) - (1))");
WORK -= _increment; _control -= _increment;
L_005b:;
if (WORK == _final) goto L_005c;
WORK += _increment; _control += _increment;
if (WORK != _control) _imp_signal(4,2,0,"Corrupt control variable WORK"); /* FOR loop control variable corrupted */
}
#line 262 "regression-bugs-tmp/writeprint.imp"
RES = _imp_join((_imp_string)RES,(_imp_string)_imp_str_literal(" "));
#line 262 "regression-bugs-tmp/writeprint.imp"
goto L_005b;
#line 262 "regression-bugs-tmp/writeprint.imp"
L_005c:;
                                                                //    263        work = ptr - 1
#line 263 "regression-bugs-tmp/writeprint.imp"
WORK = (((int)(PTR)) - (1));
                                                                //    264        res = res . sign
#line 264 "regression-bugs-tmp/writeprint.imp"
RES = _imp_join((_imp_string)RES,(_imp_string)SIGN);
                                                                //    265        res = res . ch(ptr) %for ptr = work, -1, 0
#line 265 "regression-bugs-tmp/writeprint.imp"
PTR = ((WORK) + ((int)(1)));
if ((((0)-(WORK)) % ((-1))) != 0) _imp_signal(5,1,0,"Illegal cycle PTR = WORK, (-1), 0");
L_005e:;
if (PTR == 0) goto L_005f;
PTR += (-1);
#line 265 "regression-bugs-tmp/writeprint.imp"
RES = _imp_join((_imp_string)RES,(_imp_string)CH[PTR]);
#line 265 "regression-bugs-tmp/writeprint.imp"
goto L_005e;
#line 265 "regression-bugs-tmp/writeprint.imp"
L_005f:;
                                                                //    266        %result = res
#line 266 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return RES;
                                                                //    267     %end
#line 267 "regression-bugs-tmp/writeprint.imp"
} // End of block SWRITE at level 3
                                                                //    268     %integer sign, work, ptr
#line 268 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 268 "regression-bugs-tmp/writeprint.imp"
int WORK;
#line 268 "regression-bugs-tmp/writeprint.imp"
int PTR;
                                                                //    269     %byte %integer %array ch(0 : 15)
#line 269 "regression-bugs-tmp/writeprint.imp"
unsigned char CH[16];
                                                                //    270     sign = ' '
#line 270 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    271     %if value = X'80000000' %then printstring(swrite(value, places)) %and %return
#line 271 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) != ((-2147483648)))) goto L_0061;
#line 271 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(SWRITE(VALUE, PLACES));
#line 271 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 271 "regression-bugs-tmp/writeprint.imp"
L_0061:;
                                                                //    272     %if value < 0 %then sign = '-' %and value = -value
#line 272 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) >= (0))) goto L_0062;
#line 272 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
#line 272 "regression-bugs-tmp/writeprint.imp"
VALUE = (-(VALUE));
#line 272 "regression-bugs-tmp/writeprint.imp"
L_0062:;
                                                                //    273     ptr = 0
#line 273 "regression-bugs-tmp/writeprint.imp"
PTR = 0;
                                                                //    274     %cycle 
#line 274 "regression-bugs-tmp/writeprint.imp"
L_0063:;
                                                                //    275        work = value // 10
#line 275 "regression-bugs-tmp/writeprint.imp"
WORK = (long)((long)((int)(VALUE)) / (long)((int)(10)));
                                                                //    276        ch(ptr) = value - 10 * work
#line 276 "regression-bugs-tmp/writeprint.imp"
CH[PTR] = ((VALUE) - ((int)((((int)(10)) * (WORK)))));
                                                                //    277        value = work
#line 277 "regression-bugs-tmp/writeprint.imp"
VALUE = WORK;
                                                                //    278        ptr = ptr + 1
#line 278 "regression-bugs-tmp/writeprint.imp"
PTR = (((int)(PTR)) + (1));
                                                                //    279     %repeat %until value = 0
#line 279 "regression-bugs-tmp/writeprint.imp"
if (((VALUE) == (0))) goto L_0064;
#line 279 "regression-bugs-tmp/writeprint.imp"
goto L_0063;
#line 279 "regression-bugs-tmp/writeprint.imp"
L_0064:;
                                                                //    280     %if places > ptr %then spaces(places - ptr)
#line 280 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (PTR))) goto L_0066;
#line 280 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(PLACES)) - (PTR)));
#line 280 "regression-bugs-tmp/writeprint.imp"
L_0066:;
                                                                //    281     work = ptr - 1
#line 281 "regression-bugs-tmp/writeprint.imp"
WORK = (((int)(PTR)) - (1));
                                                                //    282     printsymbol(sign)
#line 282 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
                                                                //    283     printsymbol(ch(ptr) + '0') %for ptr = work, -1, 0
#line 283 "regression-bugs-tmp/writeprint.imp"
PTR = ((WORK) + ((int)(1)));
if ((((0)-(WORK)) % ((-1))) != 0) _imp_signal(5,1,0,"Illegal cycle PTR = WORK, (-1), 0");
L_0067:;
if (PTR == 0) goto L_0068;
PTR += (-1);
#line 283 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(CH[PTR])) + (48)));
#line 283 "regression-bugs-tmp/writeprint.imp"
goto L_0067;
#line 283 "regression-bugs-tmp/writeprint.imp"
L_0068:;
                                                                //    284  %end
#line 284 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block EMASWRITE at level 2
                                                                //    285  
                                                                //    286  ! -----------------------------------------------------------------------------------------
                                                                //    287     
                                                                //    288     %routine emasi77write(%integer num, pl)
#line 288 "regression-bugs-tmp/writeprint.imp"
void EMASI77WRITE( int NUM, int PL )
#line 288 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    289        %string (63) %function itos(%integer n, places)
#line 289 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(63)*/ ITOS( int N, int PLACES )
#line 289 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    290           !
                                                                //    291           ! ITOS0
                                                                //    292           !
                                                                //    293           ! Returns a string representing the argument as
                                                                //    294           ! a decimal number, without any space justification
                                                                //    295           ! or padding.
                                                                //    296           !
                                                                //    297           %const %integer maxdigits = 255 - 64
                                                                //    298           %const %integer maxint = 16_7FFFFFFF
                                                                //    299           %const %integer minint = 16_80000000
                                                                //    300           %const %integer minintlastdigit = '8'
                                                                //    301           %string (maxdigits) %function itos0(%integer n)
#line 301 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(191)*/ ITOS0( int N )
#line 301 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    302              %string (maxdigits) res
#line 302 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(191)*/ RES;
                                                                //    303              %integer s, p, e
#line 303 "regression-bugs-tmp/writeprint.imp"
int S;
#line 303 "regression-bugs-tmp/writeprint.imp"
int P;
#line 303 "regression-bugs-tmp/writeprint.imp"
int E;
                                                                //    304              s = 0
#line 304 "regression-bugs-tmp/writeprint.imp"
S = 0;
                                                                //    305              %if n < 0 %start
#line 305 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_006a;
                                                                //    306                 s = -1
#line 306 "regression-bugs-tmp/writeprint.imp"
S = (-1);
                                                                //    307                 ! mark -ve
                                                                //    308                 %if n = minint %start
#line 308 "regression-bugs-tmp/writeprint.imp"
if (((N) != ((-2147483648)))) goto L_006b;
                                                                //    309                    ! special case
                                                                //    310                    n = maxint
#line 310 "regression-bugs-tmp/writeprint.imp"
N = 2147483647;
                                                                //    311                    ! rely on  "max int = (-min int) - 1"
                                                                //    312                    s = 1
#line 312 "regression-bugs-tmp/writeprint.imp"
S = 1;
                                                                //    313                    ! mark special
                                                                //    314                 %finish %else %start
#line 314 "regression-bugs-tmp/writeprint.imp"
goto L_006c;
#line 314 "regression-bugs-tmp/writeprint.imp"
L_006b:;
                                                                //    315                    n = -n
#line 315 "regression-bugs-tmp/writeprint.imp"
N = (-(N));
                                                                //    316                 %finish
#line 316 "regression-bugs-tmp/writeprint.imp"
L_006c:;
                                                                //    317              %finish
#line 317 "regression-bugs-tmp/writeprint.imp"
L_006a:;
                                                                //    318              p = addr(res) + maxdigits
#line 318 "regression-bugs-tmp/writeprint.imp"
P = (((int)(_imp_ADDR(&RES))) + (191));
                                                                //    319              e = p
#line 319 "regression-bugs-tmp/writeprint.imp"
E = P;
                                                                //    320              ! end point
                                                                //    321              byteinteger(p) = rem(n, 10) + '0' %and n = n // 10 %and p = p - 1 %until n = 0
#line 321 "regression-bugs-tmp/writeprint.imp"
L_006d:;
#line 321 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(P) = (((int)(_imp_REM(N, 10))) + (48));
#line 321 "regression-bugs-tmp/writeprint.imp"
N = (long)((long)((int)(N)) / (long)((int)(10)));
#line 321 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
#line 321 "regression-bugs-tmp/writeprint.imp"
if (((N) == (0))) goto L_006e;
#line 321 "regression-bugs-tmp/writeprint.imp"
goto L_006d;
#line 321 "regression-bugs-tmp/writeprint.imp"
L_006e:;
                                                                //    322              %if s # 0 %start
#line 322 "regression-bugs-tmp/writeprint.imp"
if (((S) == (0))) goto L_0070;
                                                                //    323                 ! negative
                                                                //    324                 byteinteger(p) = '-'
#line 324 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(P) = 45;
                                                                //    325                 p = p - 1
#line 325 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
                                                                //    326                 %if s > 0 %start
#line 326 "regression-bugs-tmp/writeprint.imp"
if (((S) <= (0))) goto L_0071;
                                                                //    327                    ! min int
                                                                //    328                    charno(res, maxdigits) = minintlastdigit
#line 328 "regression-bugs-tmp/writeprint.imp"
*_imp_CHARNO(&RES, 191) = 56;
                                                                //    329                 %finish
#line 329 "regression-bugs-tmp/writeprint.imp"
L_0071:;
                                                                //    330              %finish
#line 330 "regression-bugs-tmp/writeprint.imp"
L_0070:;
                                                                //    331              byteinteger(p) = e - p
#line 331 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(P) = (((int)(E)) - (P));
                                                                //    332              ! length byte
                                                                //    333              %result = string(p)
#line 333 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return *_imp_STRING(P);
                                                                //    334           %end
#line 334 "regression-bugs-tmp/writeprint.imp"
} // End of block ITOS0 at level 4
                                                                //    335           %string (63 + maxdigits) res
#line 335 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(254)*/ RES;
                                                                //    336           %integer p, slen
#line 336 "regression-bugs-tmp/writeprint.imp"
int P;
#line 336 "regression-bugs-tmp/writeprint.imp"
int SLEN;
                                                                //    337           p = addr(res) + 62
#line 337 "regression-bugs-tmp/writeprint.imp"
P = (((int)(_imp_ADDR(&RES))) + (62));
                                                                //    338           ! digit string right justified
                                                                //    339           string(p) = itos0(n)
#line 339 "regression-bugs-tmp/writeprint.imp"
*_imp_STRING(P) = ITOS0(N);
                                                                //    340           slen = byteinteger(p)
#line 340 "regression-bugs-tmp/writeprint.imp"
SLEN = *_imp_BYTEINTEGER(P);
                                                                //    341           %if n > 0 %and places > 0 %start
#line 341 "regression-bugs-tmp/writeprint.imp"
if (((N) <= (0))) goto L_0072;
#line 341 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (0))) goto L_0072;
                                                                //    342              byteinteger(p) = ' '
#line 342 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(P) = 32;
                                                                //    343              p = p - 1
#line 343 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
                                                                //    344              slen = slen + 1
#line 344 "regression-bugs-tmp/writeprint.imp"
SLEN = (((int)(SLEN)) + (1));
                                                                //    345           %finish
#line 345 "regression-bugs-tmp/writeprint.imp"
L_0072:;
                                                                //    346           %if places <= 0 %start
#line 346 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) > (0))) goto L_0073;
                                                                //    347              places = -places
#line 347 "regression-bugs-tmp/writeprint.imp"
PLACES = (-(PLACES));
                                                                //    348           %finish %else %start
#line 348 "regression-bugs-tmp/writeprint.imp"
goto L_0074;
#line 348 "regression-bugs-tmp/writeprint.imp"
L_0073:;
                                                                //    349              places = places + 1
#line 349 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) + (1));
                                                                //    350           %finish
#line 350 "regression-bugs-tmp/writeprint.imp"
L_0074:;
                                                                //    351           places = 63 %if places > 63
#line 351 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (63))) goto L_0075;
#line 351 "regression-bugs-tmp/writeprint.imp"
PLACES = 63;
#line 351 "regression-bugs-tmp/writeprint.imp"
L_0075:;
                                                                //    352           %while slen < places %cycle
#line 352 "regression-bugs-tmp/writeprint.imp"
L_0076:;
#line 352 "regression-bugs-tmp/writeprint.imp"
if (((SLEN) >= (PLACES))) goto L_0077;
                                                                //    353              byteinteger(p) = ' '
#line 353 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(P) = 32;
                                                                //    354              p = p - 1
#line 354 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
                                                                //    355              slen = slen + 1
#line 355 "regression-bugs-tmp/writeprint.imp"
SLEN = (((int)(SLEN)) + (1));
                                                                //    356           %repeat
#line 356 "regression-bugs-tmp/writeprint.imp"
goto L_0076;
#line 356 "regression-bugs-tmp/writeprint.imp"
L_0077:;
                                                                //    357           byteinteger(p) = slen
#line 357 "regression-bugs-tmp/writeprint.imp"
*_imp_BYTEINTEGER(P) = SLEN;
                                                                //    358           %result = string(p)
#line 358 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return *_imp_STRING(P);
                                                                //    359        %end
#line 359 "regression-bugs-tmp/writeprint.imp"
} // End of block ITOS at level 3
                                                                //    360        %string (63) res
#line 360 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(63)*/ RES;
                                                                //    361        res = itos(num, pl)
#line 361 "regression-bugs-tmp/writeprint.imp"
RES = ITOS(NUM, PL);
                                                                //    362        pl = \pl %if pl < 0
#line 362 "regression-bugs-tmp/writeprint.imp"
if (((PL) >= (0))) goto L_0079;
#line 362 "regression-bugs-tmp/writeprint.imp"
PL = (~(PL));
#line 362 "regression-bugs-tmp/writeprint.imp"
L_0079:;
                                                                //    363        spaces(pl - 62)
#line 363 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(PL)) - (62)));
                                                                //    364        printstring(res)
#line 364 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(RES);
                                                                //    365     %end
#line 365 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block EMASI77WRITE at level 2
                                                                //    366  
                                                                //    367  ! -----------------------------------------------------------------------------------------
                                                                //    368  
                                                                //    369     %routine mouseswrite(%integer n, p)
#line 369 "regression-bugs-tmp/writeprint.imp"
void MOUSESWRITE( int N, int P )
#line 369 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    370        %string (72) %fn itos(%integer n, p)
#line 370 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(72)*/ ITOS( int N, int P )
#line 370 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    371           %byte %array s(0 : 72)
#line 371 "regression-bugs-tmp/writeprint.imp"
unsigned char S[73];
                                                                //    372           %integer x, sign
#line 372 "regression-bugs-tmp/writeprint.imp"
int X;
#line 372 "regression-bugs-tmp/writeprint.imp"
int SIGN;
                                                                //    373           x = 73
#line 373 "regression-bugs-tmp/writeprint.imp"
X = 73;
                                                                //    374           sign = 0
#line 374 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    375           %if p > 0 %start
#line 375 "regression-bugs-tmp/writeprint.imp"
if (((P) <= (0))) goto L_007a;
                                                                //    376              sign = ' '
#line 376 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    377              p = 72 - p
#line 377 "regression-bugs-tmp/writeprint.imp"
P = (((int)(72)) - (P));
                                                                //    378           %else
#line 378 "regression-bugs-tmp/writeprint.imp"
goto L_007b;
#line 378 "regression-bugs-tmp/writeprint.imp"
L_007a:;
                                                                //    379              p = p + 73
#line 379 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) + (73));
                                                                //    380           %finish
#line 380 "regression-bugs-tmp/writeprint.imp"
L_007b:;
                                                                //    381           p = 1 %if p <= 0
#line 381 "regression-bugs-tmp/writeprint.imp"
if (((P) > (0))) goto L_007c;
#line 381 "regression-bugs-tmp/writeprint.imp"
P = 1;
#line 381 "regression-bugs-tmp/writeprint.imp"
L_007c:;
                                                                //    382           %if n < 0 %start
#line 382 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_007d;
                                                                //    383              sign = '-'
#line 383 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
                                                                //    384              n = -n
#line 384 "regression-bugs-tmp/writeprint.imp"
N = (-(N));
                                                                //    385              %if n < 0 %start
#line 385 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_007e;
                                                                //    386                 !max int
                                                                //    387                 n = n // (-10)
#line 387 "regression-bugs-tmp/writeprint.imp"
N = (long)((long)((int)(N)) / (long)((int)((-10))));
                                                                //    388                 x = x - 1
#line 388 "regression-bugs-tmp/writeprint.imp"
X = (((int)(X)) - (1));
                                                                //    389                 s(x) = '8'
#line 389 "regression-bugs-tmp/writeprint.imp"
S[X] = 56;
                                                                //    390              %finish
#line 390 "regression-bugs-tmp/writeprint.imp"
L_007e:;
                                                                //    391           %finish
#line 391 "regression-bugs-tmp/writeprint.imp"
L_007d:;
                                                                //    392           %cycle 
#line 392 "regression-bugs-tmp/writeprint.imp"
L_007f:;
                                                                //    393              x = x - 1
#line 393 "regression-bugs-tmp/writeprint.imp"
X = (((int)(X)) - (1));
                                                                //    394              s(x) = rem(n, 10) + '0'
#line 394 "regression-bugs-tmp/writeprint.imp"
S[X] = (((int)(_imp_REM(N, 10))) + (48));
                                                                //    395              n = n // 10
#line 395 "regression-bugs-tmp/writeprint.imp"
N = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //    396           %repeat %until n = 0
#line 396 "regression-bugs-tmp/writeprint.imp"
if (((N) == (0))) goto L_0080;
#line 396 "regression-bugs-tmp/writeprint.imp"
goto L_007f;
#line 396 "regression-bugs-tmp/writeprint.imp"
L_0080:;
                                                                //    397           %if sign # 0 %start
#line 397 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_0082;
                                                                //    398              x = x - 1
#line 398 "regression-bugs-tmp/writeprint.imp"
X = (((int)(X)) - (1));
                                                                //    399              s(x) = sign
#line 399 "regression-bugs-tmp/writeprint.imp"
S[X] = SIGN;
                                                                //    400           %finish
#line 400 "regression-bugs-tmp/writeprint.imp"
L_0082:;
                                                                //    401           %while x > p %cycle
#line 401 "regression-bugs-tmp/writeprint.imp"
L_0083:;
#line 401 "regression-bugs-tmp/writeprint.imp"
if (((X) <= (P))) goto L_0084;
                                                                //    402              x = x - 1
#line 402 "regression-bugs-tmp/writeprint.imp"
X = (((int)(X)) - (1));
                                                                //    403              s(x) = ' '
#line 403 "regression-bugs-tmp/writeprint.imp"
S[X] = 32;
                                                                //    404           %repeat
#line 404 "regression-bugs-tmp/writeprint.imp"
goto L_0083;
#line 404 "regression-bugs-tmp/writeprint.imp"
L_0084:;
                                                                //    405           x = x - 1
#line 405 "regression-bugs-tmp/writeprint.imp"
X = (((int)(X)) - (1));
                                                                //    406           s(x) = 72 - x
#line 406 "regression-bugs-tmp/writeprint.imp"
S[X] = (((int)(72)) - (X));
                                                                //    407           %result = string(addr(s(x)))
#line 407 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return *_imp_STRING(_imp_ADDR(&S[X]));
                                                                //    408        %end
#line 408 "regression-bugs-tmp/writeprint.imp"
} // End of block ITOS at level 3
                                                                //    409        printstring(itos(n, p))
#line 409 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(ITOS(N, P));
                                                                //    410     %end
#line 410 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block MOUSESWRITE at level 2
                                                                //    411  
                                                                //    412  ! -----------------------------------------------------------------------------------------
                                                                //    413  
                                                                //    414  %ROUTINE DEC10 WRITE(%INTEGER N, S)
#line 414 "regression-bugs-tmp/writeprint.imp"
void DEC10WRITE( int N, int S )
#line 414 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    415     %ROUTINESPEC P(%INTEGER N)
#line 415 "regression-bugs-tmp/writeprint.imp"
auto void P( int N );
                                                                //    416     %INTEGER SIGN
#line 416 "regression-bugs-tmp/writeprint.imp"
int SIGN;
                                                                //    417     %IF S<=0 %THEN SIGN=S %ELSE SIGN = ' ';  !GIVE NO SIGN FOR WRITE(N,0)
#line 417 "regression-bugs-tmp/writeprint.imp"
if (((S) > (0))) goto L_0086;
#line 417 "regression-bugs-tmp/writeprint.imp"
SIGN = S;
#line 417 "regression-bugs-tmp/writeprint.imp"
goto L_0087;
#line 417 "regression-bugs-tmp/writeprint.imp"
L_0086:;
#line 417 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
#line 417 "regression-bugs-tmp/writeprint.imp"
L_0087:;
                                                                //    418     S=|S|; S=63 %IF S>63
#line 418 "regression-bugs-tmp/writeprint.imp"
S = _imp_IMOD(S);
#line 418 "regression-bugs-tmp/writeprint.imp"
if (((S) <= (63))) goto L_0088;
#line 418 "regression-bugs-tmp/writeprint.imp"
S = 63;
#line 418 "regression-bugs-tmp/writeprint.imp"
L_0088:;
                                                                //    419     %IF N < 0 %START         ;! doesn't use negative trick but could be easily modified to.
#line 419 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_0089;
                                                                //    420        N = -N
#line 420 "regression-bugs-tmp/writeprint.imp"
N = (-(N));
                                                                //    421        SIGN = '-'
#line 421 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
                                                                //    422     %FINISH
#line 422 "regression-bugs-tmp/writeprint.imp"
L_0089:;
                                                                //    423     P(N)
#line 423 "regression-bugs-tmp/writeprint.imp"
P(N);
                                                                //    424     %ROUTINE P(%INTEGER N)
#line 424 "regression-bugs-tmp/writeprint.imp"
void P( int N )
#line 424 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    425        S = S-1
#line 425 "regression-bugs-tmp/writeprint.imp"
S = (((int)(S)) - (1));
                                                                //    426        P(N//10) %IF N >= 10
#line 426 "regression-bugs-tmp/writeprint.imp"
if (((N) < (10))) goto L_008a;
#line 426 "regression-bugs-tmp/writeprint.imp"
P(((long)((long)((int)(N)) / (long)((int)(10)))));
#line 426 "regression-bugs-tmp/writeprint.imp"
L_008a:;
                                                                //    427        %IF SIGN > 0 %START
#line 427 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) <= (0))) goto L_008b;
                                                                //    428           SPACES(S-1)
#line 428 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(S)) - (1)));
                                                                //    429           PRINTSYMBOL(SIGN);  SIGN = 0
#line 429 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
#line 429 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    430        %FINISH %ELSE %IF SIGN<0 %THEN SPACES(S) %AND SIGN=0;   !FOR -VE S
#line 430 "regression-bugs-tmp/writeprint.imp"
goto L_008c;
#line 430 "regression-bugs-tmp/writeprint.imp"
L_008b:;
#line 430 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) >= (0))) goto L_008d;
#line 430 "regression-bugs-tmp/writeprint.imp"
SPACES(S);
#line 430 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
#line 430 "regression-bugs-tmp/writeprint.imp"
L_008d:;
#line 430 "regression-bugs-tmp/writeprint.imp"
L_008c:;
                                                                //    431        PRINTSYMBOL(REM(N,10)+'0')
#line 431 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(_imp_REM(N, 10))) + (48)));
                                                                //    432     %END
#line 432 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block P at level 3
                                                                //    433  %END
#line 433 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10WRITE at level 2
                                                                //    434  
                                                                //    435  ! -----------------------------------------------------------------------------------------
                                                                //    436  
                                                                //    437  ! #########################################################################################
                                                                //    438  
                                                                //    439  %ROUTINESPEC EMAS PRINTFL (%LONGREAL X, %INTEGER N)
#line 439 "regression-bugs-tmp/writeprint.imp"
auto void EMASPRINTFL( double X, int N );
                                                                //    440  
                                                                //    441  %ROUTINE EMAS PRINT(%LONGREAL X, %INTEGER N,M)
#line 441 "regression-bugs-tmp/writeprint.imp"
void EMASPRINT( double X, int N, int M )
#line 441 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    442  !***********************************************************************
                                                                //    443  !*       PRINTS A REAL NUMBER (X) ALLOWING N PLACES BEFORE THE DECIMAL *
                                                                //    444  !*       POINT AND M PLACES AFTER.IT REQUIRES (M+N+2) PRINT PLACES     *
                                                                //    445  !*       UNLESS (M=0) WHEN  (N+1) PLACES ARE REQUIRED.                 *
                                                                //    446  !*                                                                     *
                                                                //    447  !*       A LITTLE CARE IS NEEDED TO AVOID UNNECESSARY LOSS OF ACCURACY *
                                                                //    448  !*       AND TO AVOID OVERFLOW WHEN DEALING WITH VERY LARGE NUMBERS    *
                                                                //    449  !***********************************************************************
                                                                //    450  %CONSTLONGREAL DZ=0
#line 450 "regression-bugs-tmp/writeprint.imp"
const double DZ = 0;
                                                                //    451  %LONGREAL Y,Z,ROUND,FACTOR
#line 451 "regression-bugs-tmp/writeprint.imp"
double Y;
#line 451 "regression-bugs-tmp/writeprint.imp"
double Z;
#line 451 "regression-bugs-tmp/writeprint.imp"
double ROUND;
#line 451 "regression-bugs-tmp/writeprint.imp"
double FACTOR;
                                                                //    452  %INTEGER I,J,L,MORIG
#line 452 "regression-bugs-tmp/writeprint.imp"
int I;
#line 452 "regression-bugs-tmp/writeprint.imp"
int J;
#line 452 "regression-bugs-tmp/writeprint.imp"
int L;
#line 452 "regression-bugs-tmp/writeprint.imp"
int MORIG;
                                                                //    453  %BYTEINTEGER SIGN
#line 453 "regression-bugs-tmp/writeprint.imp"
unsigned char SIGN;
                                                                //    454        M=M&63;                           ! DEAL WITH STUPID PARAMS
#line 454 "regression-bugs-tmp/writeprint.imp"
M = ((M) & (63));
                                                                //    455        MORIG=M
#line 455 "regression-bugs-tmp/writeprint.imp"
MORIG = M;
                                                                //    456        %IF N<0 %THEN N=1; N=N&31;        ! DEAL WITH STUPID PARAMS
#line 456 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_008e;
#line 456 "regression-bugs-tmp/writeprint.imp"
N = 1;
#line 456 "regression-bugs-tmp/writeprint.imp"
L_008e:;
#line 456 "regression-bugs-tmp/writeprint.imp"
N = ((N) & (31));
                                                                //    457        X=X+DZ;                           ! NORMALISE
#line 457 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) + (DZ));
                                                                //    458        SIGN=' ';                         ! '+' IMPLIED
#line 458 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    459        %IF X<0 %THEN SIGN='-'
#line 459 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_008f;
#line 459 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
#line 459 "regression-bugs-tmp/writeprint.imp"
L_008f:;
                                                                //    460        Y=|X|;                            ! ALL WORK DONE WITH Y
#line 460 "regression-bugs-tmp/writeprint.imp"
Y = _imp_MOD(X);
                                                                //    461        ROUND=0.5/10^M;                  ! ROUNDING FACTOR
#line 461 "regression-bugs-tmp/writeprint.imp"
ROUND = (double)((double)((double)(0.5)) / (double)((_imp_REXP(10, M))));
/*promote*/                                                                //    462        %IF Y>1.0*10^16 %OR N=0 %THENSTART;    ! MEANINGLESS FIGURES GENERATED
#line 462 "regression-bugs-tmp/writeprint.imp"
if (((Y) > (((1.0) * ((double)(_imp_REXP(10, 16))))))) goto L_0085;
#line 462 "regression-bugs-tmp/writeprint.imp"
if (((N) != (0))) goto L_0090;
#line 462 "regression-bugs-tmp/writeprint.imp"
L_0085:;
                                                                //    463           %IF N>M %THEN M=N;             ! FOR FIXED POINT PRINTING
#line 463 "regression-bugs-tmp/writeprint.imp"
if (((N) <= (M))) goto L_0091;
#line 463 "regression-bugs-tmp/writeprint.imp"
M = N;
#line 463 "regression-bugs-tmp/writeprint.imp"
L_0091:;
                                                                //    464           EMAS PRINTFL(X,M);             ! OF ENORMOUS NUMBERS
#line 464 "regression-bugs-tmp/writeprint.imp"
EMASPRINTFL(X, M);
                                                                //    465           %RETURN;                       ! SO PRINT IN FLOATING FORM
#line 465 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    466        %FINISH
#line 466 "regression-bugs-tmp/writeprint.imp"
L_0090:;
                                                                //    467        I=0; Z=1; Y=Y+ROUND
#line 467 "regression-bugs-tmp/writeprint.imp"
I = 0;
#line 467 "regression-bugs-tmp/writeprint.imp"
Z = 1;
#line 467 "regression-bugs-tmp/writeprint.imp"
Y = (((double)(Y)) + (ROUND));
                                                                //    468        %CYCLE;                ! COUNT LEADING PLACES
#line 468 "regression-bugs-tmp/writeprint.imp"
L_0092:;
                                                                //    469           I=I+1; Z=10*Z;                 ! NO DANGER OF OVERFLOW HERE
#line 469 "regression-bugs-tmp/writeprint.imp"
I = (((int)(I)) + (1));
/*promote*/#line 469 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(10)) * (Z));
                                                                //    470        %REPEAT %UNTIL Z>Y
#line 470 "regression-bugs-tmp/writeprint.imp"
if (((Z) > (Y))) goto L_0093;
#line 470 "regression-bugs-tmp/writeprint.imp"
goto L_0092;
#line 470 "regression-bugs-tmp/writeprint.imp"
L_0093:;
                                                                //    471        PRINTSYMBOL(SIGN)
#line 471 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
                                                                //    472        J=I-1; Z=10^J
#line 472 "regression-bugs-tmp/writeprint.imp"
J = (((int)(I)) - (1));
#line 472 "regression-bugs-tmp/writeprint.imp"
Z = _imp_REXP(10, J);
                                                                //    473        FACTOR=1/10
#line 473 "regression-bugs-tmp/writeprint.imp"
FACTOR = (double)((double)((float)(1)) / (double)((float)(10)));
                                                                //    474        %CYCLE
#line 474 "regression-bugs-tmp/writeprint.imp"
L_0095:;
                                                                //    475           %CYCLE
#line 475 "regression-bugs-tmp/writeprint.imp"
L_0098:;
                                                                //    476              L=INT PT(Y/Z);              ! OBTAIN NEXT DIGIT
#line 476 "regression-bugs-tmp/writeprint.imp"
L = _imp_INTPT(((double)((double)((double)(Y)) / (double)((double)(Z)))));
/*promote*//*promote*/                                                                //    477              Y=Y-L*Z; Z=Z*FACTOR;        ! AND REDUCE TOTAL
#line 477 "regression-bugs-tmp/writeprint.imp"
Y = ((Y) - ((double)((((double)(L)) * (Z)))));
#line 477 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(Z)) * (FACTOR));
                                                                //    478              PRINTSYMBOL(L+'0')
#line 478 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(L)) + (48)));
                                                                //    479              J=J-1
#line 479 "regression-bugs-tmp/writeprint.imp"
J = (((int)(J)) - (1));
                                                                //    480           %REPEAT %UNTIL J<0
#line 480 "regression-bugs-tmp/writeprint.imp"
if (((J) < (0))) goto L_0099;
#line 480 "regression-bugs-tmp/writeprint.imp"
goto L_0098;
#line 480 "regression-bugs-tmp/writeprint.imp"
L_0099:;
                                                                //    481           %IF M=0 %THEN %EXIT;           ! NO DECIMAL PART TO BE O/P
#line 481 "regression-bugs-tmp/writeprint.imp"
if (((M) != (0))) goto L_009b;
#line 481 "regression-bugs-tmp/writeprint.imp"
goto L_0096;
#line 481 "regression-bugs-tmp/writeprint.imp"
L_009b:;
                                                                //    482           PRINTSTRING(".")
#line 482 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("."));
                                                                //    483           J=M-1; Z=10^(J-1); M=0
#line 483 "regression-bugs-tmp/writeprint.imp"
J = (((int)(M)) - (1));
#line 483 "regression-bugs-tmp/writeprint.imp"
Z = _imp_REXP(10, (((int)(J)) - (1)));
#line 483 "regression-bugs-tmp/writeprint.imp"
M = 0;
/*promote*//*promote*/                                                                //    484           Y=10*Y*Z
#line 484 "regression-bugs-tmp/writeprint.imp"
Y = (((double)((((double)(10)) * (Y)))) * (Z));
                                                                //    485        %REPEAT
#line 485 "regression-bugs-tmp/writeprint.imp"
goto L_0095;
#line 485 "regression-bugs-tmp/writeprint.imp"
L_0096:;
                                                                //    486        %if MORIG>0 %start          { Chop any redundant trailing 0s}
#line 486 "regression-bugs-tmp/writeprint.imp"
if (((MORIG) <= (0))) goto L_009c;
                                                                //    487           !opline_length=opline_length-1 %while %c
                                                                //    488           !  opline_l(opline_length-1)='0' %and opline_l(opline_length-2)#'.'
                                                                //    489        %finish
#line 489 "regression-bugs-tmp/writeprint.imp"
L_009c:;
                                                                //    490  %END;                                   ! OF ROUTINE PRINT
#line 490 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block EMASPRINT at level 2
                                                                //    491  
                                                                //    492  %ROUTINE EMAS PRINTFL (%LONGREAL X, %INTEGER N)
#line 492 "regression-bugs-tmp/writeprint.imp"
void EMASPRINTFL( double X, int N )
#line 492 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    493  !***********************************************************************
                                                                //    494  !*       PRINTS IN FLOATING POINT FORMAT WITH N PLACES AFTER THE       *
                                                                //    495  !*       DECIMAL POINT. ALWAYS TAKES N+7 PRINTING POSITIONS.           *
                                                                //    496  !*       CARE REQUIRED TO AVOID OVERFLOW WITH LARGE X                  *
                                                                //    497  !***********************************************************************
                                                                //    498  %LONGREAL SIGN,ROUND,FACTOR,LB,UB
#line 498 "regression-bugs-tmp/writeprint.imp"
double SIGN;
#line 498 "regression-bugs-tmp/writeprint.imp"
double ROUND;
#line 498 "regression-bugs-tmp/writeprint.imp"
double FACTOR;
#line 498 "regression-bugs-tmp/writeprint.imp"
double LB;
#line 498 "regression-bugs-tmp/writeprint.imp"
double UB;
                                                                //    499  %CONSTLONGREAL DZ=0
#line 499 "regression-bugs-tmp/writeprint.imp"
const double DZ = 0;
                                                                //    500  %INTEGER COUNT,INC
#line 500 "regression-bugs-tmp/writeprint.imp"
int COUNT;
#line 500 "regression-bugs-tmp/writeprint.imp"
int INC;
                                                                //    501        inc=integer(addr(x))
#line 501 "regression-bugs-tmp/writeprint.imp"
INC = *_imp_INTEGER(_imp_ADDR(&X));
                                                                //    502        %if inc>>20&x'7ff'=x'7ff' %start
#line 502 "regression-bugs-tmp/writeprint.imp"
if ((((((int)((((unsigned int)(INC)) >> (20)))) & (2047))) != (2047))) goto L_009d;
                                                                //    503           printstring("NAN");
#line 503 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("NAN"));
                                                                //    504           !outhex(inc);
                                                                //    505           !outhex(integer(addr(x)+4))
                                                                //    506           !outsym('}');
                                                                //    507           %return
#line 507 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    508        %finish
#line 508 "regression-bugs-tmp/writeprint.imp"
L_009d:;
                                                                //    509        ROUND=0.5/10^N;                  ! TO ROUND SCALED NO
#line 509 "regression-bugs-tmp/writeprint.imp"
ROUND = (double)((double)((double)(0.5)) / (double)((_imp_REXP(10, N))));
/*promote*/                                                                //    510        LB=1-ROUND; UB=10-ROUND
#line 510 "regression-bugs-tmp/writeprint.imp"
LB = (((double)(1)) - (ROUND));
/*promote*/#line 510 "regression-bugs-tmp/writeprint.imp"
UB = (((double)(10)) - (ROUND));
                                                                //    511        SIGN=1
#line 511 "regression-bugs-tmp/writeprint.imp"
SIGN = 1;
                                                                //    512        X=X+DZ;                           ! NORMALISE
#line 512 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) + (DZ));
                                                                //    513        %IF X=0 %THEN COUNT=0 %ELSESTART
#line 513 "regression-bugs-tmp/writeprint.imp"
if (((X) != (0))) goto L_009e;
#line 513 "regression-bugs-tmp/writeprint.imp"
COUNT = 0;
#line 513 "regression-bugs-tmp/writeprint.imp"
goto L_009f;
#line 513 "regression-bugs-tmp/writeprint.imp"
L_009e:;
                                                                //    514           %IF X<0 %THEN X=-X %AND SIGN=-SIGN
#line 514 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_00a0;
#line 514 "regression-bugs-tmp/writeprint.imp"
X = (-(X));
#line 514 "regression-bugs-tmp/writeprint.imp"
SIGN = (-(SIGN));
#line 514 "regression-bugs-tmp/writeprint.imp"
L_00a0:;
                                                                //    515           INC=1; COUNT=0
#line 515 "regression-bugs-tmp/writeprint.imp"
INC = 1;
#line 515 "regression-bugs-tmp/writeprint.imp"
COUNT = 0;
                                                                //    516           FACTOR=1/10
#line 516 "regression-bugs-tmp/writeprint.imp"
FACTOR = (double)((double)((float)(1)) / (double)((float)(10)));
                                                                //    517           %IF X<=1 %THEN FACTOR=10 %AND INC=-1
#line 517 "regression-bugs-tmp/writeprint.imp"
if (((X) > (1))) goto L_00a1;
#line 517 "regression-bugs-tmp/writeprint.imp"
FACTOR = 10;
#line 517 "regression-bugs-tmp/writeprint.imp"
INC = (-1);
#line 517 "regression-bugs-tmp/writeprint.imp"
L_00a1:;
                                                                //    518                                          ! FORCE INTO RANGE 1->10
                                                                //    519           %WHILE X<LB %OR X>=UB %CYCLE
#line 519 "regression-bugs-tmp/writeprint.imp"
L_00a2:;
#line 519 "regression-bugs-tmp/writeprint.imp"
if (((X) < (LB))) goto L_00a4;
#line 519 "regression-bugs-tmp/writeprint.imp"
if (((X) < (UB))) goto L_00a3;
#line 519 "regression-bugs-tmp/writeprint.imp"
L_00a4:;
                                                                //    520              X=X*FACTOR; COUNT=COUNT+INC
#line 520 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) * (FACTOR));
#line 520 "regression-bugs-tmp/writeprint.imp"
COUNT = (((int)(COUNT)) + (INC));
                                                                //    521           %REPEAT
#line 521 "regression-bugs-tmp/writeprint.imp"
goto L_00a2;
#line 521 "regression-bugs-tmp/writeprint.imp"
L_00a3:;
                                                                //    522        %FINISH
#line 522 "regression-bugs-tmp/writeprint.imp"
L_009f:;
                                                                //    523        EMAS PRINT(SIGN*X,1,N)
#line 523 "regression-bugs-tmp/writeprint.imp"
EMASPRINT((((double)(SIGN)) * (X)), 1, N);
                                                                //    524        %if count#0 %start
#line 524 "regression-bugs-tmp/writeprint.imp"
if (((COUNT) == (0))) goto L_00a5;
                                                                //    525           PRINTSTRING("@")  ;! original had 'E' - was that correct?
#line 525 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("@"));
                                                                //    526           WRITE68K(COUNT,0)
#line 526 "regression-bugs-tmp/writeprint.imp"
WRITE68K(COUNT, 0);
                                                                //    527        %finish
#line 527 "regression-bugs-tmp/writeprint.imp"
L_00a5:;
                                                                //    528  %END;                                   ! OF ROUTINE PRINTFL
#line 528 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block EMASPRINTFL at level 2
                                                                //    529  
                                                                //    530  ! -----------------------------------------------------------------------------------------
                                                                //    531  %ROUTINESPEC ERCC PRINTFL(%LONGREAL X, %INTEGER N)
#line 531 "regression-bugs-tmp/writeprint.imp"
auto void ERCCPRINTFL( double X, int N );
                                                                //    532  %ROUTINE ERCC PRINT(%LONGREAL X, %INTEGER N,M)
#line 532 "regression-bugs-tmp/writeprint.imp"
void ERCCPRINT( double X, int N, int M )
#line 532 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    533  !***********************************************************************
                                                                //    534  !*       PRINTS A REAL NUMBER (X) ALLOWING N PLACES BEFORE THE DECIMAL *
                                                                //    535  !*       POINT AND M PLACES AFTER.IT REQUIRES (M+N+2) PRINT PLACES     *
                                                                //    536  !*       UNLESS (M=0) WHEN  (N+1) PLACES ARE REQUIRED.                 *
                                                                //    537  !*                                                                     *
                                                                //    538  !*       A LITTLE CARE IS NEEDED TO AVOID UNNECESSARY LOSS OF ACCURACY *
                                                                //    539  !*       AND TO AVOID OVERFLOW WHEN DEALING WITH VERY LARGE NUMBERS    *
                                                                //    540  !***********************************************************************
                                                                //    541  %CONSTLONGREAL PMAX= 1@16
#line 541 "regression-bugs-tmp/writeprint.imp"
const double PMAX = 1E16;
                                                                //    542  %CONSTLONGREAL DZ=0
#line 542 "regression-bugs-tmp/writeprint.imp"
const double DZ = 0;
                                                                //    543  %LONGREAL Y,Z,ROUND,FACTOR
#line 543 "regression-bugs-tmp/writeprint.imp"
double Y;
#line 543 "regression-bugs-tmp/writeprint.imp"
double Z;
#line 543 "regression-bugs-tmp/writeprint.imp"
double ROUND;
#line 543 "regression-bugs-tmp/writeprint.imp"
double FACTOR;
                                                                //    544  %INTEGER I,J,L
#line 544 "regression-bugs-tmp/writeprint.imp"
int I;
#line 544 "regression-bugs-tmp/writeprint.imp"
int J;
#line 544 "regression-bugs-tmp/writeprint.imp"
int L;
                                                                //    545  %BYTEINTEGER SIGN
#line 545 "regression-bugs-tmp/writeprint.imp"
unsigned char SIGN;
                                                                //    546        M=M&63;                           ! DEAL WITH STUPID PARAMS
#line 546 "regression-bugs-tmp/writeprint.imp"
M = ((M) & (63));
                                                                //    547        %IF N<0 %THEN N=1; N=N&31;        ! DEAL WITH STUPID PARAMS
#line 547 "regression-bugs-tmp/writeprint.imp"
if (((N) >= (0))) goto L_00a6;
#line 547 "regression-bugs-tmp/writeprint.imp"
N = 1;
#line 547 "regression-bugs-tmp/writeprint.imp"
L_00a6:;
#line 547 "regression-bugs-tmp/writeprint.imp"
N = ((N) & (31));
                                                                //    548        X=X+DZ;                           ! NORMALISE
#line 548 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) + (DZ));
                                                                //    549        SIGN=' ';                         ! '+' IMPLIED
#line 549 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    550        %IF X<0 %THEN SIGN='-'
#line 550 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_00a7;
#line 550 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
#line 550 "regression-bugs-tmp/writeprint.imp"
L_00a7:;
                                                                //    551        Y=|X|;                            ! ALL WORK DONE WITH Y
#line 551 "regression-bugs-tmp/writeprint.imp"
Y = _imp_MOD(X);
                                                                //    552        ROUND=0.5/10^M;                   ! ROUNDING FACTOR
#line 552 "regression-bugs-tmp/writeprint.imp"
ROUND = (double)((double)((double)(0.5)) / (double)((_imp_REXP(10, M))));
                                                                //    553        %IF Y>PMAX %OR N=0 %THENSTART;    ! MEANINGLESS FIGURES GENERATED
#line 553 "regression-bugs-tmp/writeprint.imp"
if (((Y) > (PMAX))) goto L_0097;
#line 553 "regression-bugs-tmp/writeprint.imp"
if (((N) != (0))) goto L_00a8;
#line 553 "regression-bugs-tmp/writeprint.imp"
L_0097:;
                                                                //    554           %IF N>M %THEN M=N;             ! FOR FIXED POINT PRINTING
#line 554 "regression-bugs-tmp/writeprint.imp"
if (((N) <= (M))) goto L_00a9;
#line 554 "regression-bugs-tmp/writeprint.imp"
M = N;
#line 554 "regression-bugs-tmp/writeprint.imp"
L_00a9:;
                                                                //    555           ERCC PRINTFL(X,M);             ! OF ENORMOUS NUMBERS
#line 555 "regression-bugs-tmp/writeprint.imp"
ERCCPRINTFL(X, M);
                                                                //    556           %RETURN;                       ! SO PRINT IN FLOATING FORM
#line 556 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //    557        %FINISH
#line 557 "regression-bugs-tmp/writeprint.imp"
L_00a8:;
                                                                //    558        I=0; Z=1; Y=Y+ROUND
#line 558 "regression-bugs-tmp/writeprint.imp"
I = 0;
#line 558 "regression-bugs-tmp/writeprint.imp"
Z = 1;
#line 558 "regression-bugs-tmp/writeprint.imp"
Y = (((double)(Y)) + (ROUND));
                                                                //    559        %CYCLE;                           ! COUNT LEADING PLACES
#line 559 "regression-bugs-tmp/writeprint.imp"
L_00aa:;
                                                                //    560           I=I+1; Z=10*Z;                 ! NO DANGER OF OVERFLOW HERE
#line 560 "regression-bugs-tmp/writeprint.imp"
I = (((int)(I)) + (1));
/*promote*/#line 560 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(10)) * (Z));
                                                                //    561        %REPEAT %UNTIL Z>Y
#line 561 "regression-bugs-tmp/writeprint.imp"
if (((Z) > (Y))) goto L_00ab;
#line 561 "regression-bugs-tmp/writeprint.imp"
goto L_00aa;
#line 561 "regression-bugs-tmp/writeprint.imp"
L_00ab:;
                                                                //    562        SPACES(N-I);                      ! O.K FOR ZERO OR -VE SPACES
#line 562 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(N)) - (I)));
                                                                //    563        PRINT SYMBOL(SIGN)
#line 563 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
                                                                //    564        J=I-1; Z=10^J
#line 564 "regression-bugs-tmp/writeprint.imp"
J = (((int)(I)) - (1));
#line 564 "regression-bugs-tmp/writeprint.imp"
Z = _imp_REXP(10, J);
                                                                //    565        FACTOR=1/10
#line 565 "regression-bugs-tmp/writeprint.imp"
FACTOR = (double)((double)((float)(1)) / (double)((float)(10)));
                                                                //    566        %CYCLE
#line 566 "regression-bugs-tmp/writeprint.imp"
L_00ad:;
                                                                //    567           %CYCLE
#line 567 "regression-bugs-tmp/writeprint.imp"
L_00b0:;
                                                                //    568              L=INT PT(Y/Z);              ! OBTAIN NEXT DIGIT
#line 568 "regression-bugs-tmp/writeprint.imp"
L = _imp_INTPT(((double)((double)((double)(Y)) / (double)((double)(Z)))));
/*promote*//*promote*/                                                                //    569              Y=Y-L*Z; Z=Z*FACTOR;        ! AND REDUCE TOTAL
#line 569 "regression-bugs-tmp/writeprint.imp"
Y = ((Y) - ((double)((((double)(L)) * (Z)))));
#line 569 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(Z)) * (FACTOR));
                                                                //    570              PRINT SYMBOL(L+'0')
#line 570 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(L)) + (48)));
                                                                //    571              J=J-1
#line 571 "regression-bugs-tmp/writeprint.imp"
J = (((int)(J)) - (1));
                                                                //    572           %REPEAT %UNTIL J<0
#line 572 "regression-bugs-tmp/writeprint.imp"
if (((J) < (0))) goto L_00b1;
#line 572 "regression-bugs-tmp/writeprint.imp"
goto L_00b0;
#line 572 "regression-bugs-tmp/writeprint.imp"
L_00b1:;
                                                                //    573           %IF M=0 %THENRETURN;           ! NO DECIMAL PART TO BE O/P
#line 573 "regression-bugs-tmp/writeprint.imp"
if (((M) != (0))) goto L_00b3;
#line 573 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 573 "regression-bugs-tmp/writeprint.imp"
L_00b3:;
                                                                //    574           PRINTSTRING(".")
#line 574 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("."));
                                                                //    575           J=M-1; Z=10^(J-1); M=0
#line 575 "regression-bugs-tmp/writeprint.imp"
J = (((int)(M)) - (1));
#line 575 "regression-bugs-tmp/writeprint.imp"
Z = _imp_REXP(10, (((int)(J)) - (1)));
#line 575 "regression-bugs-tmp/writeprint.imp"
M = 0;
/*promote*//*promote*/                                                                //    576           Y=10*Y*Z
#line 576 "regression-bugs-tmp/writeprint.imp"
Y = (((double)((((double)(10)) * (Y)))) * (Z));
                                                                //    577        %REPEAT
#line 577 "regression-bugs-tmp/writeprint.imp"
goto L_00ad;
                                                                //    578  %END;                                   ! OF ROUTINE PRINT
#line 578 "regression-bugs-tmp/writeprint.imp"
return;
} // End of block ERCCPRINT at level 2
                                                                //    579  
                                                                //    580  %ROUTINE ERCC PRINTFL(%LONGREAL X, %INTEGER N)
#line 580 "regression-bugs-tmp/writeprint.imp"
void ERCCPRINTFL( double X, int N )
#line 580 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    581  !***********************************************************************
                                                                //    582  !*       PRINTS IN FLOATING POINT FORMAT WITH N PLACES AFTER THE       *
                                                                //    583  !*       DECIMAL POINT. ALWAYS TAKES N+7 PRINTING POSITIONS.           *
                                                                //    584  !*       CARE REQUIRED TO AVOID OVERFLOW WITH LARGE X                  *
                                                                //    585  !***********************************************************************
                                                                //    586  %CONSTLONGREAL DZ=0
#line 586 "regression-bugs-tmp/writeprint.imp"
const double DZ = 0;
                                                                //    587  %LONGREAL SIGN,ROUND,FACTOR,LB,UB
#line 587 "regression-bugs-tmp/writeprint.imp"
double SIGN;
#line 587 "regression-bugs-tmp/writeprint.imp"
double ROUND;
#line 587 "regression-bugs-tmp/writeprint.imp"
double FACTOR;
#line 587 "regression-bugs-tmp/writeprint.imp"
double LB;
#line 587 "regression-bugs-tmp/writeprint.imp"
double UB;
                                                                //    588  %INTEGER COUNT,INC
#line 588 "regression-bugs-tmp/writeprint.imp"
int COUNT;
#line 588 "regression-bugs-tmp/writeprint.imp"
int INC;
                                                                //    589        ROUND=0.5/10^N;                   ! TO ROUND SCALED NO
#line 589 "regression-bugs-tmp/writeprint.imp"
ROUND = (double)((double)((double)(0.5)) / (double)((_imp_REXP(10, N))));
/*promote*/                                                                //    590        LB=1-ROUND; UB=10-ROUND
#line 590 "regression-bugs-tmp/writeprint.imp"
LB = (((double)(1)) - (ROUND));
/*promote*/#line 590 "regression-bugs-tmp/writeprint.imp"
UB = (((double)(10)) - (ROUND));
                                                                //    591        SIGN=1
#line 591 "regression-bugs-tmp/writeprint.imp"
SIGN = 1;
                                                                //    592        X=X+DZ;                           ! NORMALISE
#line 592 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) + (DZ));
                                                                //    593        %IF X=0 %THEN COUNT=-99 %ELSESTART
#line 593 "regression-bugs-tmp/writeprint.imp"
if (((X) != (0))) goto L_00ae;
#line 593 "regression-bugs-tmp/writeprint.imp"
COUNT = (-99);
#line 593 "regression-bugs-tmp/writeprint.imp"
goto L_00b4;
#line 593 "regression-bugs-tmp/writeprint.imp"
L_00ae:;
                                                                //    594           %IF X<0 %THEN X=-X %AND SIGN=-SIGN
#line 594 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_00b5;
#line 594 "regression-bugs-tmp/writeprint.imp"
X = (-(X));
#line 594 "regression-bugs-tmp/writeprint.imp"
SIGN = (-(SIGN));
#line 594 "regression-bugs-tmp/writeprint.imp"
L_00b5:;
                                                                //    595           INC=1; COUNT=0
#line 595 "regression-bugs-tmp/writeprint.imp"
INC = 1;
#line 595 "regression-bugs-tmp/writeprint.imp"
COUNT = 0;
                                                                //    596           FACTOR=1/10
#line 596 "regression-bugs-tmp/writeprint.imp"
FACTOR = (double)((double)((float)(1)) / (double)((float)(10)));
                                                                //    597           %IF X<=1 %THEN FACTOR=10 %AND INC=-1
#line 597 "regression-bugs-tmp/writeprint.imp"
if (((X) > (1))) goto L_00b6;
#line 597 "regression-bugs-tmp/writeprint.imp"
FACTOR = 10;
#line 597 "regression-bugs-tmp/writeprint.imp"
INC = (-1);
#line 597 "regression-bugs-tmp/writeprint.imp"
L_00b6:;
                                                                //    598                                          ! FORCE INTO RANGE 1->10
                                                                //    599           %WHILE X<LB %OR X>=UB %CYCLE
#line 599 "regression-bugs-tmp/writeprint.imp"
L_00b7:;
#line 599 "regression-bugs-tmp/writeprint.imp"
if (((X) < (LB))) goto L_00b9;
#line 599 "regression-bugs-tmp/writeprint.imp"
if (((X) < (UB))) goto L_00b8;
#line 599 "regression-bugs-tmp/writeprint.imp"
L_00b9:;
                                                                //    600              X=X*FACTOR; COUNT=COUNT+INC
#line 600 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) * (FACTOR));
#line 600 "regression-bugs-tmp/writeprint.imp"
COUNT = (((int)(COUNT)) + (INC));
                                                                //    601           %REPEAT
#line 601 "regression-bugs-tmp/writeprint.imp"
goto L_00b7;
#line 601 "regression-bugs-tmp/writeprint.imp"
L_00b8:;
                                                                //    602        %FINISH
#line 602 "regression-bugs-tmp/writeprint.imp"
L_00b4:;
                                                                //    603        ERCC PRINT(SIGN*X,1,N)
#line 603 "regression-bugs-tmp/writeprint.imp"
ERCCPRINT((((double)(SIGN)) * (X)), 1, N);
                                                                //    604        PRINTSTRING("@")
#line 604 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(_imp_str_literal("@"));
                                                                //    605        emasWRITE(COUNT,2)
#line 605 "regression-bugs-tmp/writeprint.imp"
EMASWRITE(COUNT, 2);
                                                                //    606  %END;                                   ! OF ROUTINE PRINTFL
#line 606 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block ERCCPRINTFL at level 2
                                                                //    607  ! -----------------------------------------------------------------------------------------
                                                                //    608  
                                                                //    609  %routine vax printfl(%long %real r, %integer places)
#line 609 "regression-bugs-tmp/writeprint.imp"
void VAXPRINTFL( double R, int PLACES )
#line 609 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    610     %string (63) %fn ftos(%long %real r, %integer p)
#line 610 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(63)*/ FTOS( double R, int P )
#line 610 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    611        %routine vax fraction(%long %real r, %integer places, %string (*) %name s)
#line 611 "regression-bugs-tmp/writeprint.imp"
void VAXFRACTION( double R, int PLACES, _imp_string /*%string(255)*/ /*name*/*S )
#line 611 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    612           %long %real %fn fracpt(%long %real x)
#line 612 "regression-bugs-tmp/writeprint.imp"
double FRACPT( double X )
#line 612 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    613              %long %real z
#line 613 "regression-bugs-tmp/writeprint.imp"
double Z;
/*promote*/                                                                //    614              z = x - intpt(x)
#line 614 "regression-bugs-tmp/writeprint.imp"
Z = ((X) - ((double)(_imp_INTPT(X))));
                                                                //    615              z = z + 1.0 %if z < 0
#line 615 "regression-bugs-tmp/writeprint.imp"
if (((Z) >= (0))) goto L_00ba;
#line 615 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(Z)) + (1.0));
#line 615 "regression-bugs-tmp/writeprint.imp"
L_00ba:;
                                                                //    616              %result = z
#line 616 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return Z;
                                                                //    617           %end
#line 617 "regression-bugs-tmp/writeprint.imp"
} // End of block FRACPT at level 5
                                                                //    618           %return %if places <= 0
#line 618 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) > (0))) goto L_00bb;
#line 618 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 618 "regression-bugs-tmp/writeprint.imp"
L_00bb:;
                                                                //    619           s = s . "."
#line 619 "regression-bugs-tmp/writeprint.imp"
*S = _imp_join((_imp_string)*S,(_imp_string)_imp_str_literal("."));
                                                                //    620           %while places > 0 %cycle
#line 620 "regression-bugs-tmp/writeprint.imp"
L_00bc:;
#line 620 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (0))) goto L_00bd;
                                                                //    621              places = places - 1
#line 621 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
/*promote*/                                                                //    622              r = fracpt(r) * 10
#line 622 "regression-bugs-tmp/writeprint.imp"
R = ((FRACPT(R)) * ((double)(10)));
                                                                //    623              s = s . tostring(intpt(r) + '0')
#line 623 "regression-bugs-tmp/writeprint.imp"
*S = _imp_join((_imp_string)*S,(_imp_string)_imp_TOSTRING((((int)(_imp_INTPT(R))) + (48))));
                                                                //    624           %repeat
#line 624 "regression-bugs-tmp/writeprint.imp"
goto L_00bc;
#line 624 "regression-bugs-tmp/writeprint.imp"
L_00bd:;
                                                                //    625        %end
#line 625 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block VAXFRACTION at level 4
                                                                //    626        %routine round(%long %real %name v, %integer p)
#line 626 "regression-bugs-tmp/writeprint.imp"
void ROUND( double /*name*/*V, int P )
#line 626 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    627           %long %real x
#line 627 "regression-bugs-tmp/writeprint.imp"
double X;
                                                                //    628           %return %if v = 0
#line 628 "regression-bugs-tmp/writeprint.imp"
if (((*V) != (0))) goto L_00bf;
#line 628 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 628 "regression-bugs-tmp/writeprint.imp"
L_00bf:;
                                                                //    629           %if v < 0 %then x = -0.5 %else x = 0.5
#line 629 "regression-bugs-tmp/writeprint.imp"
if (((*V) >= (0))) goto L_00c0;
#line 629 "regression-bugs-tmp/writeprint.imp"
X = (-0.5);
#line 629 "regression-bugs-tmp/writeprint.imp"
goto L_00c1;
#line 629 "regression-bugs-tmp/writeprint.imp"
L_00c0:;
#line 629 "regression-bugs-tmp/writeprint.imp"
X = 0.5;
#line 629 "regression-bugs-tmp/writeprint.imp"
L_00c1:;
                                                                //    630           %cycle 
#line 630 "regression-bugs-tmp/writeprint.imp"
L_00c2:;
                                                                //    631              p = p - 1
#line 631 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
                                                                //    632              %exit %if p < 0
#line 632 "regression-bugs-tmp/writeprint.imp"
if (((P) >= (0))) goto L_00c5;
#line 632 "regression-bugs-tmp/writeprint.imp"
goto L_00c3;
#line 632 "regression-bugs-tmp/writeprint.imp"
L_00c5:;
                                                                //    633              x = x / 10
#line 633 "regression-bugs-tmp/writeprint.imp"
X = (double)((double)((double)(X)) / (double)((float)(10)));
                                                                //    634           %repeat
#line 634 "regression-bugs-tmp/writeprint.imp"
goto L_00c2;
#line 634 "regression-bugs-tmp/writeprint.imp"
L_00c3:;
                                                                //    635           v = v + x
#line 635 "regression-bugs-tmp/writeprint.imp"
*V = ((*(double *)(V)) + (X));
                                                                //    636        %end
#line 636 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block ROUND at level 4
                                                                //    637        {XOWN}%string (63) s = ""
#line 637 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(63)*/ S;
#line 637 "regression-bugs-tmp/writeprint.imp"
S = _imp_str_literal("");
                                                                //    638        %integer exp, sym
#line 638 "regression-bugs-tmp/writeprint.imp"
int EXP;
#line 638 "regression-bugs-tmp/writeprint.imp"
int SYM;
                                                                //    639        !p = 7 %if p > 7                                                  ;! WHY??????????????????????????    p = 7 %if p > 7
                                                                //    640                                                                           ! removing the p<=7 constraint makes this behave the same as EMAS PRINTFL
                                                                //    641        %if r < 0 %then sym = '-' %and r = -r %else sym = ' '
#line 641 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (0))) goto L_00c6;
#line 641 "regression-bugs-tmp/writeprint.imp"
SYM = 45;
#line 641 "regression-bugs-tmp/writeprint.imp"
R = (-(R));
#line 641 "regression-bugs-tmp/writeprint.imp"
goto L_00c7;
#line 641 "regression-bugs-tmp/writeprint.imp"
L_00c6:;
#line 641 "regression-bugs-tmp/writeprint.imp"
SYM = 32;
#line 641 "regression-bugs-tmp/writeprint.imp"
L_00c7:;
                                                                //    642        %if r = 0 %start
#line 642 "regression-bugs-tmp/writeprint.imp"
if (((R) != (0))) goto L_00c8;
                                                                //    643           exp = -99
#line 643 "regression-bugs-tmp/writeprint.imp"
EXP = (-99);
                                                                //    644        %else
#line 644 "regression-bugs-tmp/writeprint.imp"
goto L_00c9;
#line 644 "regression-bugs-tmp/writeprint.imp"
L_00c8:;
                                                                //    645           exp = 0
#line 645 "regression-bugs-tmp/writeprint.imp"
EXP = 0;
                                                                //    646           exp = exp + 1 %and r = r / 10 %while r >= 10
#line 646 "regression-bugs-tmp/writeprint.imp"
L_00ca:;
#line 646 "regression-bugs-tmp/writeprint.imp"
if (((R) < (10))) goto L_00cb;
#line 646 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) + (1));
#line 646 "regression-bugs-tmp/writeprint.imp"
R = (double)((double)((double)(R)) / (double)((float)(10)));
#line 646 "regression-bugs-tmp/writeprint.imp"
goto L_00ca;
#line 646 "regression-bugs-tmp/writeprint.imp"
L_00cb:;
/*promote*/                                                                //    647           exp = exp - 1 %and r = r * 10 %while r < 1
#line 647 "regression-bugs-tmp/writeprint.imp"
L_00cd:;
#line 647 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (1))) goto L_00ce;
#line 647 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) - (1));
#line 647 "regression-bugs-tmp/writeprint.imp"
R = ((R) * ((double)(10)));
#line 647 "regression-bugs-tmp/writeprint.imp"
goto L_00cd;
#line 647 "regression-bugs-tmp/writeprint.imp"
L_00ce:;
                                                                //    648        %finish
#line 648 "regression-bugs-tmp/writeprint.imp"
L_00c9:;
                                                                //    649        round(r, p)
#line 649 "regression-bugs-tmp/writeprint.imp"
ROUND(&R, P);
                                                                //    650        exp = exp + 1 %and r = r / 10 %if r >= 10
#line 650 "regression-bugs-tmp/writeprint.imp"
if (((R) < (10))) goto L_00d0;
#line 650 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) + (1));
#line 650 "regression-bugs-tmp/writeprint.imp"
R = (double)((double)((double)(R)) / (double)((float)(10)));
#line 650 "regression-bugs-tmp/writeprint.imp"
L_00d0:;
                                                                //    651        s = s . tostring(intpt(r) + '0')
#line 651 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_TOSTRING((((int)(_imp_INTPT(R))) + (48))));
                                                                //    652        vax fraction(r, p, s)
#line 652 "regression-bugs-tmp/writeprint.imp"
VAXFRACTION(R, P, &S);
                                                                //    653        %result = tostring(sym) . s . "@" . itos(exp, 0)
#line 653 "regression-bugs-tmp/writeprint.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));
                                                                //    654     %end
#line 654 "regression-bugs-tmp/writeprint.imp"
} // End of block FTOS at level 3
                                                                //    655     places = \places %if places < 0
#line 655 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) >= (0))) goto L_00d1;
#line 655 "regression-bugs-tmp/writeprint.imp"
PLACES = (~(PLACES));
#line 655 "regression-bugs-tmp/writeprint.imp"
L_00d1:;
                                                                //    656     spaces(places - 62)
#line 656 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(PLACES)) - (62)));
                                                                //    657     printstring(ftos(r, places))
#line 657 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(FTOS(R, PLACES));
                                                                //    658  %end
#line 658 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block VAXPRINTFL at level 2
                                                                //    659  
                                                                //    660  ! -----------------------------------------------------------------------------------------
                                                                //    661  
                                                                //    662  %long %real %fn dec10 fracpt(%long %real x)
#line 662 "regression-bugs-tmp/writeprint.imp"
double DEC10FRACPT( double X )
#line 662 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    663     %long %real z
#line 663 "regression-bugs-tmp/writeprint.imp"
double Z;
/*promote*/                                                                //    664     z = x - intpt(x)
#line 664 "regression-bugs-tmp/writeprint.imp"
Z = ((X) - ((double)(_imp_INTPT(X))));
                                                                //    665     z = z + 1.0 %if z < 0
#line 665 "regression-bugs-tmp/writeprint.imp"
if (((Z) >= (0))) goto L_00d2;
#line 665 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(Z)) + (1.0));
#line 665 "regression-bugs-tmp/writeprint.imp"
L_00d2:;
/*promote*/                                                                //    666     %result = x - intpt(x)
#line 666 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return ((X) - ((double)(_imp_INTPT(X))));
                                                                //    667     
                                                                //    668  %end
#line 668 "regression-bugs-tmp/writeprint.imp"
} // End of block DEC10FRACPT at level 2
                                                                //    669           
                                                                //    670  %ROUTINE DEC10 FRACTION(%LONG %REAL R, %INTEGER PLACES)
#line 670 "regression-bugs-tmp/writeprint.imp"
void DEC10FRACTION( double R, int PLACES )
#line 670 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    671     %RETURN %IF PLACES <= 0
#line 671 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) > (0))) goto L_00d3;
#line 671 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 671 "regression-bugs-tmp/writeprint.imp"
L_00d3:;
                                                                //    672     PRINTSYMBOL('.')
#line 672 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(46);
                                                                //    673     %WHILE PLACES>0 %CYCLE
#line 673 "regression-bugs-tmp/writeprint.imp"
L_00d4:;
#line 673 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (0))) goto L_00d5;
                                                                //    674        R = dec10 FRACPT(R)*10.0   ; ! first digit after the point of a 0.xxxxxxx positive number.
#line 674 "regression-bugs-tmp/writeprint.imp"
R = (((double)(DEC10FRACPT(R))) * (10.0));
                                                                //    675        PLACES = PLACES-1
#line 675 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
                                                                //    676        PRINTSYMBOL(INTPT(R)+'0')
#line 676 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(_imp_INTPT(R))) + (48)));
                                                                //    677     %REPEAT
#line 677 "regression-bugs-tmp/writeprint.imp"
goto L_00d4;
#line 677 "regression-bugs-tmp/writeprint.imp"
L_00d5:;
                                                                //    678  %END
#line 678 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10FRACTION at level 2
                                                                //    679  
                                                                //    680  %ROUTINE DEC10 PRINTFL(%LONG %REAL R, %INTEGER P)
#line 680 "regression-bugs-tmp/writeprint.imp"
void DEC10PRINTFL( double R, int P )
#line 680 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    681     %INTEGER EXP,SIGN, pp
#line 681 "regression-bugs-tmp/writeprint.imp"
int EXP;
#line 681 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 681 "regression-bugs-tmp/writeprint.imp"
int PP;
                                                                //    682     %real roundup
#line 682 "regression-bugs-tmp/writeprint.imp"
double ROUNDUP;
                                                                //    683     SIGN=' '
#line 683 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    684     SIGN='-' %AND R = -R %IF R < 0
#line 684 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (0))) goto L_00d7;
#line 684 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
#line 684 "regression-bugs-tmp/writeprint.imp"
R = (-(R));
#line 684 "regression-bugs-tmp/writeprint.imp"
L_00d7:;
                                                                //    685     PRINTSYMBOL(SIGN)
#line 685 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
                                                                //    686     %IF R = 0 %START
#line 686 "regression-bugs-tmp/writeprint.imp"
if (((R) != (0))) goto L_00d8;
                                                                //    687        EXP = 0   ;! Was EXP = 99 for completely unknown reasons.
#line 687 "regression-bugs-tmp/writeprint.imp"
EXP = 0;
                                                                //    688     %ELSE
#line 688 "regression-bugs-tmp/writeprint.imp"
goto L_00d9;
#line 688 "regression-bugs-tmp/writeprint.imp"
L_00d8:;
                                                                //    689        ! Normalise:
                                                                //    690        EXP = 0
#line 690 "regression-bugs-tmp/writeprint.imp"
EXP = 0;
                                                                //    691        EXP = EXP + 1 %AND R = R*0.1 %WHILE R >= 10.0
#line 691 "regression-bugs-tmp/writeprint.imp"
L_00da:;
#line 691 "regression-bugs-tmp/writeprint.imp"
if (((R) < (10.0))) goto L_00db;
#line 691 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) + (1));
#line 691 "regression-bugs-tmp/writeprint.imp"
R = (((double)(R)) * (0.1));
#line 691 "regression-bugs-tmp/writeprint.imp"
goto L_00da;
#line 691 "regression-bugs-tmp/writeprint.imp"
L_00db:;
                                                                //    692        EXP = EXP - 1 %AND R = R*10.0 %WHILE R < 1.0
#line 692 "regression-bugs-tmp/writeprint.imp"
L_00dd:;
#line 692 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (1.0))) goto L_00de;
#line 692 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) - (1));
#line 692 "regression-bugs-tmp/writeprint.imp"
R = (((double)(R)) * (10.0));
#line 692 "regression-bugs-tmp/writeprint.imp"
goto L_00dd;
#line 692 "regression-bugs-tmp/writeprint.imp"
L_00de:;
                                                                //    693        ! R should now be a single digit followed by a decimal part, with the exponent adjusted appropriately
                                                                //    694        ! Round to P places:
                                                                //    695        roundup = 0.5
#line 695 "regression-bugs-tmp/writeprint.imp"
ROUNDUP = 0.5;
                                                                //    696        %IF P <= 0 %START
#line 696 "regression-bugs-tmp/writeprint.imp"
if (((P) > (0))) goto L_00e0;
                                                                //    697           !R = R+0.5 ;! round to an int?
                                                                //    698           pp = 0
#line 698 "regression-bugs-tmp/writeprint.imp"
PP = 0;
                                                                //    699        %ELSE
#line 699 "regression-bugs-tmp/writeprint.imp"
goto L_00e1;
#line 699 "regression-bugs-tmp/writeprint.imp"
L_00e0:;
                                                                //    700           ! This was just not working so I've replaced it with the 'pp' code below.  I suspect faulty exponentiation?
                                                                //    701           !R = R + 0.5*10\(-P)
                                                                //    702           !R = R + 0.5*10^(-P)
                                                                //    703           pp = p
#line 703 "regression-bugs-tmp/writeprint.imp"
PP = P;
                                                                //    704        %FINISH
#line 704 "regression-bugs-tmp/writeprint.imp"
L_00e1:;
                                                                //    705        %while pp > 0 %then roundup = roundup / 10 %and pp = pp - 1
#line 705 "regression-bugs-tmp/writeprint.imp"
L_00e2:;
#line 705 "regression-bugs-tmp/writeprint.imp"
if (((PP) <= (0))) goto L_00e3;
#line 705 "regression-bugs-tmp/writeprint.imp"
ROUNDUP = (double)((double)((double)(ROUNDUP)) / (double)((float)(10)));
#line 705 "regression-bugs-tmp/writeprint.imp"
PP = (((int)(PP)) - (1));
#line 705 "regression-bugs-tmp/writeprint.imp"
goto L_00e2;
#line 705 "regression-bugs-tmp/writeprint.imp"
L_00e3:;
                                                                //    706        R = R + roundup
#line 706 "regression-bugs-tmp/writeprint.imp"
R = (((double)(R)) + (ROUNDUP));
                                                                //    707     %FINISH
#line 707 "regression-bugs-tmp/writeprint.imp"
L_00d9:;
                                                                //    708     PRINTSYMBOL(INT PT(R)+'0')
#line 708 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(_imp_INTPT(R))) + (48)));
                                                                //    709     DEC10 FRACTION(R,P)
#line 709 "regression-bugs-tmp/writeprint.imp"
DEC10FRACTION(R, P);
                                                                //    710     PRINTSYMBOL('@'); WRITE68K(EXP,1)
#line 710 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(64);
#line 710 "regression-bugs-tmp/writeprint.imp"
WRITE68K(EXP, 1);
                                                                //    711  %END
#line 711 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10PRINTFL at level 2
                                                                //    712  
                                                                //    713  %ROUTINE DEC10 PRINT(%LONG %REAL R, %INTEGER B,A)
#line 713 "regression-bugs-tmp/writeprint.imp"
void DEC10PRINT( double R, int B, int A )
#line 713 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    714     %LONG %REAL RM
#line 714 "regression-bugs-tmp/writeprint.imp"
double RM;
                                                                //    715     %CONSTINTEGER MAX INT=16_7FFFFFFF
                                                                //    716     %INTEGER SIGN
#line 716 "regression-bugs-tmp/writeprint.imp"
int SIGN;
                                                                //    717     %ROUTINE P(%INTEGER N)
#line 717 "regression-bugs-tmp/writeprint.imp"
void P( int N )
#line 717 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    718        B = B-1
#line 718 "regression-bugs-tmp/writeprint.imp"
B = (((int)(B)) - (1));
                                                                //    719        P(N//10) %IF N >= 10
#line 719 "regression-bugs-tmp/writeprint.imp"
if (((N) < (10))) goto L_00e5;
#line 719 "regression-bugs-tmp/writeprint.imp"
P(((long)((long)((int)(N)) / (long)((int)(10)))));
#line 719 "regression-bugs-tmp/writeprint.imp"
L_00e5:;
                                                                //    720        %IF SIGN # 0 %START
#line 720 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_00e6;
                                                                //    721           SPACES(B-1)
#line 721 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(B)) - (1)));
                                                                //    722           PRINTSYMBOL(SIGN);  SIGN = 0
#line 722 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
#line 722 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    723        %FINISH
#line 723 "regression-bugs-tmp/writeprint.imp"
L_00e6:;
                                                                //    724        PRINTSYMBOL(REM(N,10)+'0')
#line 724 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(_imp_REM(N, 10))) + (48)));
                                                                //    725     %END
#line 725 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block P at level 3
                                                                //    726     RM=|R|
#line 726 "regression-bugs-tmp/writeprint.imp"
RM = _imp_MOD(R);
                                                                //    727     DEC10 PRINTFL(R, B+A) %AND %RETURN %IF RM> MAX INT
#line 727 "regression-bugs-tmp/writeprint.imp"
if (((RM) <= (2147483647))) goto L_00e7;
#line 727 "regression-bugs-tmp/writeprint.imp"
DEC10PRINTFL(R, (((int)(B)) + (A)));
#line 727 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 727 "regression-bugs-tmp/writeprint.imp"
L_00e7:;
                                                                //    728     %IF A<=0 %START
#line 728 "regression-bugs-tmp/writeprint.imp"
if (((A) > (0))) goto L_00e8;
                                                                //    729        RM=RM+0.5
#line 729 "regression-bugs-tmp/writeprint.imp"
RM = (((double)(RM)) + (0.5));
                                                                //    730     %ELSE
#line 730 "regression-bugs-tmp/writeprint.imp"
goto L_00e9;
#line 730 "regression-bugs-tmp/writeprint.imp"
L_00e8:;
/*promote*/                                                                //    731        !RM=RM+0.5*10\(-A)
                                                                //    732        RM=RM+0.5*10^(-A)
#line 732 "regression-bugs-tmp/writeprint.imp"
RM = ((RM) + ((double)(((0.5) * ((double)(_imp_REXP(10, (-(A)))))))));
                                                                //    733     %FINISH
#line 733 "regression-bugs-tmp/writeprint.imp"
L_00e9:;
                                                                //    734     %IF B<=0 %THEN SIGN=0 %ELSE SIGN=' '
#line 734 "regression-bugs-tmp/writeprint.imp"
if (((B) > (0))) goto L_00ea;
#line 734 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
#line 734 "regression-bugs-tmp/writeprint.imp"
goto L_00eb;
#line 734 "regression-bugs-tmp/writeprint.imp"
L_00ea:;
#line 734 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
#line 734 "regression-bugs-tmp/writeprint.imp"
L_00eb:;
                                                                //    735     %IF R<0 %THEN SIGN='-'
#line 735 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (0))) goto L_00ec;
#line 735 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
#line 735 "regression-bugs-tmp/writeprint.imp"
L_00ec:;
                                                                //    736     P(INT PT(RM));  !THUS ALLOWING FOR -0.1 ETC.
#line 736 "regression-bugs-tmp/writeprint.imp"
P(_imp_INTPT(RM));
                                                                //    737     DEC10 FRACTION(RM,A)
#line 737 "regression-bugs-tmp/writeprint.imp"
DEC10FRACTION(RM, A);
                                                                //    738  %END
#line 738 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DEC10PRINT at level 2
                                                                //    739  
                                                                //    740  ! -----------------------------------------------------------------------------------------
                                                                //    741  
                                                                //    742  %routine print 68k(%long %real x, %integer n,m)
#line 742 "regression-bugs-tmp/writeprint.imp"
void PRINT68K( double X, int N, int M )
#line 742 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    743  %constreal pmax = 2147483647.0
#line 743 "regression-bugs-tmp/writeprint.imp"
const double PMAX = 2147483647.0;
                                                                //    744  %long %real y,z,POW
#line 744 "regression-bugs-tmp/writeprint.imp"
double Y;
#line 744 "regression-bugs-tmp/writeprint.imp"
double Z;
#line 744 "regression-bugs-tmp/writeprint.imp"
double POW;
                                                                //    745  %integer i=0,l,count=0,sign
#line 745 "regression-bugs-tmp/writeprint.imp"
int I;
#line 745 "regression-bugs-tmp/writeprint.imp"
I = 0;
#line 745 "regression-bugs-tmp/writeprint.imp"
int L;
#line 745 "regression-bugs-tmp/writeprint.imp"
int COUNT;
#line 745 "regression-bugs-tmp/writeprint.imp"
COUNT = 0;
#line 745 "regression-bugs-tmp/writeprint.imp"
int SIGN;
                                                                //    746    sign = ' '
#line 746 "regression-bugs-tmp/writeprint.imp"
SIGN = 32;
                                                                //    747    sign = '-' %if x < 0
#line 747 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_00ed;
#line 747 "regression-bugs-tmp/writeprint.imp"
SIGN = 45;
#line 747 "regression-bugs-tmp/writeprint.imp"
L_00ed:;
                                                                //    748    !y = |x|+0.5/10.0\{^}m;  !modulus, rounded
                                                                //    749    POW = 10.0^|m|
#line 749 "regression-bugs-tmp/writeprint.imp"
POW = _imp_REXP(10.0, _imp_IMOD(M));
                                                                //    750    POW = 0.5/POW
#line 750 "regression-bugs-tmp/writeprint.imp"
POW = (double)((double)((double)(0.5)) / (double)((double)(POW)));
                                                                //    751    y = |x|
#line 751 "regression-bugs-tmp/writeprint.imp"
Y = _imp_MOD(X);
                                                                //    752    y = y+POW;  !modulus, rounded
#line 752 "regression-bugs-tmp/writeprint.imp"
Y = (((double)(Y)) + (POW));
                                                                //    753    %if y > pmax %start
#line 753 "regression-bugs-tmp/writeprint.imp"
if (((Y) <= (PMAX))) goto L_00ee;
                                                                //    754      count = count+1 %and y = y/10.0 %until y < 10.0
#line 754 "regression-bugs-tmp/writeprint.imp"
L_00ef:;
#line 754 "regression-bugs-tmp/writeprint.imp"
COUNT = (((int)(COUNT)) + (1));
#line 754 "regression-bugs-tmp/writeprint.imp"
Y = (double)((double)((double)(Y)) / (double)((double)(10.0)));
#line 754 "regression-bugs-tmp/writeprint.imp"
if (((Y) < (10.0))) goto L_00f0;
#line 754 "regression-bugs-tmp/writeprint.imp"
goto L_00ef;
#line 754 "regression-bugs-tmp/writeprint.imp"
L_00f0:;
                                                                //    755    %finish
#line 755 "regression-bugs-tmp/writeprint.imp"
L_00ee:;
                                                                //    756    z = 1.0
#line 756 "regression-bugs-tmp/writeprint.imp"
Z = 1.0;
                                                                //    757    %cycle
#line 757 "regression-bugs-tmp/writeprint.imp"
L_00f2:;
                                                                //    758      i = i+1;  z = z*10.0
#line 758 "regression-bugs-tmp/writeprint.imp"
I = (((int)(I)) + (1));
#line 758 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(Z)) * (10.0));
                                                                //    759    %repeat %until z > y
#line 759 "regression-bugs-tmp/writeprint.imp"
if (((Z) > (Y))) goto L_00f3;
#line 759 "regression-bugs-tmp/writeprint.imp"
goto L_00f2;
#line 759 "regression-bugs-tmp/writeprint.imp"
L_00f3:;
                                                                //    760    spaces(n-i)
#line 760 "regression-bugs-tmp/writeprint.imp"
SPACES((((int)(N)) - (I)));
                                                                //    761    printsymbol(sign) %unless sign = ' ' %and n <= 0            ;! n < 0 just makes a difference of one space character
#line 761 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) != (32))) goto L_00f4;
#line 761 "regression-bugs-tmp/writeprint.imp"
if (((N) <= (0))) goto L_00f5;
#line 761 "regression-bugs-tmp/writeprint.imp"
L_00f4:;
#line 761 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(SIGN);
#line 761 "regression-bugs-tmp/writeprint.imp"
L_00f5:;
                                                                //    762    %cycle
#line 762 "regression-bugs-tmp/writeprint.imp"
L_00f6:;
                                                                //    763      z = z/10.0
#line 763 "regression-bugs-tmp/writeprint.imp"
Z = (double)((double)((double)(Z)) / (double)((double)(10.0)));
                                                                //    764      l = int pt(y/z)
#line 764 "regression-bugs-tmp/writeprint.imp"
L = _imp_INTPT(((double)((double)((double)(Y)) / (double)((double)(Z)))));
/*promote*//*promote*/                                                                //    765      y = y-l*z
#line 765 "regression-bugs-tmp/writeprint.imp"
Y = ((Y) - ((double)((((double)(L)) * (Z)))));
                                                                //    766      printsymbol(l+'0')
#line 766 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(L)) + (48)));
                                                                //    767      i = i-1
#line 767 "regression-bugs-tmp/writeprint.imp"
I = (((int)(I)) - (1));
                                                                //    768      %exit %if i+m <= 0
#line 768 "regression-bugs-tmp/writeprint.imp"
if ((((((int)(I)) + (M))) > (0))) goto L_00f9;
#line 768 "regression-bugs-tmp/writeprint.imp"
goto L_00f7;
#line 768 "regression-bugs-tmp/writeprint.imp"
L_00f9:;
                                                                //    769      print symbol('.') %if i = 0
#line 769 "regression-bugs-tmp/writeprint.imp"
if (((I) != (0))) goto L_00fa;
#line 769 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(46);
#line 769 "regression-bugs-tmp/writeprint.imp"
L_00fa:;
                                                                //    770    %repeat
#line 770 "regression-bugs-tmp/writeprint.imp"
goto L_00f6;
#line 770 "regression-bugs-tmp/writeprint.imp"
L_00f7:;
                                                                //    771    printsymbol('@') %and write 68k(count,0) %if count # 0
#line 771 "regression-bugs-tmp/writeprint.imp"
if (((COUNT) == (0))) goto L_00fb;
#line 771 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(64);
#line 771 "regression-bugs-tmp/writeprint.imp"
WRITE68K(COUNT, 0);
#line 771 "regression-bugs-tmp/writeprint.imp"
L_00fb:;
                                                                //    772  %end;  !print
#line 772 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINT68K at level 2
                                                                //    773  
                                                                //    774  %routine printfl 68k(%long %real x, %integer n)
#line 774 "regression-bugs-tmp/writeprint.imp"
void PRINTFL68K( double X, int N )
#line 774 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    775  %long %real y,round
#line 775 "regression-bugs-tmp/writeprint.imp"
double Y;
#line 775 "regression-bugs-tmp/writeprint.imp"
double ROUND;
                                                                //    776  %integer count=-99,sign=0
#line 776 "regression-bugs-tmp/writeprint.imp"
int COUNT;
#line 776 "regression-bugs-tmp/writeprint.imp"
COUNT = (-99);
#line 776 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 776 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    777    %if x # 0 %start
#line 777 "regression-bugs-tmp/writeprint.imp"
if (((X) == (0))) goto L_00fc;
                                                                //    778      x = -x %and sign = 1 %if x < 0
#line 778 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_00fd;
#line 778 "regression-bugs-tmp/writeprint.imp"
X = (-(X));
#line 778 "regression-bugs-tmp/writeprint.imp"
SIGN = 1;
#line 778 "regression-bugs-tmp/writeprint.imp"
L_00fd:;
                                                                //    779      !Adjust X so that 1.0 <= rounded(X) < 10.0
                                                                //    780      !count = 0;  round = 0.5\{^}n
                                                                //    781      count = 0;  round = 0.5^|n|
#line 781 "regression-bugs-tmp/writeprint.imp"
COUNT = 0;
#line 781 "regression-bugs-tmp/writeprint.imp"
ROUND = _imp_REXP(0.5, _imp_IMOD(N));
                                                                //    782      y = 1.0-round
#line 782 "regression-bugs-tmp/writeprint.imp"
Y = (((double)(1.0)) - (ROUND));
                                                                //    783      %if x < y %start;  !ie rounded(X) < 1.0
#line 783 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (Y))) goto L_00fe;
                                                                //    784        count = count-1 %and x = x*10.0 %until x >= y
#line 784 "regression-bugs-tmp/writeprint.imp"
L_00ff:;
#line 784 "regression-bugs-tmp/writeprint.imp"
COUNT = (((int)(COUNT)) - (1));
#line 784 "regression-bugs-tmp/writeprint.imp"
X = (((double)(X)) * (10.0));
#line 784 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (Y))) goto L_0100;
#line 784 "regression-bugs-tmp/writeprint.imp"
goto L_00ff;
#line 784 "regression-bugs-tmp/writeprint.imp"
L_0100:;
                                                                //    785      %finish %else %start
#line 785 "regression-bugs-tmp/writeprint.imp"
goto L_0102;
#line 785 "regression-bugs-tmp/writeprint.imp"
L_00fe:;
                                                                //    786        y = 10.0-round
#line 786 "regression-bugs-tmp/writeprint.imp"
Y = (((double)(10.0)) - (ROUND));
                                                                //    787        %while x >= y %cycle;  !ie rounded(X) > 10.0
#line 787 "regression-bugs-tmp/writeprint.imp"
L_0103:;
#line 787 "regression-bugs-tmp/writeprint.imp"
if (((X) < (Y))) goto L_0104;
                                                                //    788          count = count+1;  x = x/10.0
#line 788 "regression-bugs-tmp/writeprint.imp"
COUNT = (((int)(COUNT)) + (1));
#line 788 "regression-bugs-tmp/writeprint.imp"
X = (double)((double)((double)(X)) / (double)((double)(10.0)));
                                                                //    789        %repeat
#line 789 "regression-bugs-tmp/writeprint.imp"
goto L_0103;
#line 789 "regression-bugs-tmp/writeprint.imp"
L_0104:;
                                                                //    790      %finish
#line 790 "regression-bugs-tmp/writeprint.imp"
L_0102:;
                                                                //    791      x = -x %if sign # 0
#line 791 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_0106;
#line 791 "regression-bugs-tmp/writeprint.imp"
X = (-(X));
#line 791 "regression-bugs-tmp/writeprint.imp"
L_0106:;
                                                                //    792    %finish
#line 792 "regression-bugs-tmp/writeprint.imp"
L_00fc:;
                                                                //    793    print 68k(x,1,n)
#line 793 "regression-bugs-tmp/writeprint.imp"
PRINT68K(X, 1, N);
                                                                //    794    printsymbol('@')
#line 794 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(64);
                                                                //    795    write 68k(count,0)
#line 795 "regression-bugs-tmp/writeprint.imp"
WRITE68K(COUNT, 0);
                                                                //    796  %end;  !printfl
#line 796 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINTFL68K at level 2
                                                                //    797  
                                                                //    798  ! -----------------------------------------------------------------------------------------
                                                                //    799  %routine mousesprintfl(%real r, %integer places)
#line 799 "regression-bugs-tmp/writeprint.imp"
void MOUSESPRINTFL( double R, int PLACES )
#line 799 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    800     %routine round(%real %name v, %integer p)
#line 800 "regression-bugs-tmp/writeprint.imp"
void ROUND( double /*name*/*V, int P )
#line 800 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    801        %real x
#line 801 "regression-bugs-tmp/writeprint.imp"
double X;
                                                                //    802        %return %if v = 0
#line 802 "regression-bugs-tmp/writeprint.imp"
if (((*V) != (0))) goto L_0107;
#line 802 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 802 "regression-bugs-tmp/writeprint.imp"
L_0107:;
                                                                //    803        %if v < 0 %then x = -0.5 %else x = 0.5
#line 803 "regression-bugs-tmp/writeprint.imp"
if (((*V) >= (0))) goto L_0108;
#line 803 "regression-bugs-tmp/writeprint.imp"
X = (-0.5);
#line 803 "regression-bugs-tmp/writeprint.imp"
goto L_0109;
#line 803 "regression-bugs-tmp/writeprint.imp"
L_0108:;
#line 803 "regression-bugs-tmp/writeprint.imp"
X = 0.5;
#line 803 "regression-bugs-tmp/writeprint.imp"
L_0109:;
                                                                //    804        %cycle 
#line 804 "regression-bugs-tmp/writeprint.imp"
L_010a:;
                                                                //    805           p = p - 1
#line 805 "regression-bugs-tmp/writeprint.imp"
P = (((int)(P)) - (1));
                                                                //    806           %exit %if p < 0
#line 806 "regression-bugs-tmp/writeprint.imp"
if (((P) >= (0))) goto L_010d;
#line 806 "regression-bugs-tmp/writeprint.imp"
goto L_010b;
#line 806 "regression-bugs-tmp/writeprint.imp"
L_010d:;
                                                                //    807           x = x / 10
#line 807 "regression-bugs-tmp/writeprint.imp"
X = (double)((double)((double)(X)) / (double)((float)(10)));
                                                                //    808        %repeat
#line 808 "regression-bugs-tmp/writeprint.imp"
goto L_010a;
#line 808 "regression-bugs-tmp/writeprint.imp"
L_010b:;
                                                                //    809        v = v + x
#line 809 "regression-bugs-tmp/writeprint.imp"
*V = ((*(double *)(V)) + (X));
                                                                //    810     %end
#line 810 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block ROUND at level 3
                                                                //    811     %routine fraction(%real r, %integer places, %string (*) %name s)
#line 811 "regression-bugs-tmp/writeprint.imp"
void FRACTION( double R, int PLACES, _imp_string /*%string(255)*/ /*name*/*S )
#line 811 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    812        %long %real %fn fracpt(%long %real x)
#line 812 "regression-bugs-tmp/writeprint.imp"
double FRACPT( double X )
#line 812 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    813           %long %real z
#line 813 "regression-bugs-tmp/writeprint.imp"
double Z;
/*promote*/                                                                //    814           z = x - intpt(x)
#line 814 "regression-bugs-tmp/writeprint.imp"
Z = ((X) - ((double)(_imp_INTPT(X))));
                                                                //    815           z = z + 1.0 %if z < 0
#line 815 "regression-bugs-tmp/writeprint.imp"
if (((Z) >= (0))) goto L_010e;
#line 815 "regression-bugs-tmp/writeprint.imp"
Z = (((double)(Z)) + (1.0));
#line 815 "regression-bugs-tmp/writeprint.imp"
L_010e:;
                                                                //    816           %result = z
#line 816 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return Z;
                                                                //    817        %end
#line 817 "regression-bugs-tmp/writeprint.imp"
} // End of block FRACPT at level 4
                                                                //    818        !%realfn MOUSES FRACPT(%real r)   ;! dependent on machine representation of floating point.
                                                                //    819        !   %integer m,x,z
                                                                //    820        !   %if |R| >= 1.0 %start
                                                                //    821        !      x = integer(addr(r))
                                                                //    822        !      z = x>>24&b'01111111'
                                                                //    823        !      %result = 0 %if z > x'46'
                                                                //    824        !      m = -1
                                                                //    825        !      m = m<<4 %and z = z+1 %while z < x'46'
                                                                //    826        !      x = x&(m!x'FF000000')
                                                                //    827        !      r = r-real(addr(x))
                                                                //    828        !   %finish
                                                                //    829        !   r = r+1 %if r < 0
                                                                //    830        !   %result = r
                                                                //    831        !%end
                                                                //    832                                                           
                                                                //    833        %return %if places <= 0
#line 833 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) > (0))) goto L_010f;
#line 833 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
#line 833 "regression-bugs-tmp/writeprint.imp"
L_010f:;
                                                                //    834        s = s . "."
#line 834 "regression-bugs-tmp/writeprint.imp"
*S = _imp_join((_imp_string)*S,(_imp_string)_imp_str_literal("."));
                                                                //    835        %while places > 0 %cycle
#line 835 "regression-bugs-tmp/writeprint.imp"
L_0110:;
#line 835 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (0))) goto L_0111;
                                                                //    836           places = places - 1
#line 836 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
/*promote*/                                                                //    837           r = fracpt(r) * 10
#line 837 "regression-bugs-tmp/writeprint.imp"
R = ((FRACPT(R)) * ((double)(10)));
                                                                //    838           s = s . tostring(intpt(r) + '0')
#line 838 "regression-bugs-tmp/writeprint.imp"
*S = _imp_join((_imp_string)*S,(_imp_string)_imp_TOSTRING((((int)(_imp_INTPT(R))) + (48))));
                                                                //    839        %repeat
#line 839 "regression-bugs-tmp/writeprint.imp"
goto L_0110;
#line 839 "regression-bugs-tmp/writeprint.imp"
L_0111:;
                                                                //    840     %end
#line 840 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block FRACTION at level 3
                                                                //    841     %string (64) %fn ftos(%real r, %integer p)
#line 841 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(64)*/ FTOS( double R, int P )
#line 841 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    842        {XOWN}%string (64) s = ""
#line 842 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(64)*/ S;
#line 842 "regression-bugs-tmp/writeprint.imp"
S = _imp_str_literal("");
                                                                //    843        %integer exp, sym
#line 843 "regression-bugs-tmp/writeprint.imp"
int EXP;
#line 843 "regression-bugs-tmp/writeprint.imp"
int SYM;
                                                                //    844        p = 7 %if p > 7
#line 844 "regression-bugs-tmp/writeprint.imp"
if (((P) <= (7))) goto L_0113;
#line 844 "regression-bugs-tmp/writeprint.imp"
P = 7;
#line 844 "regression-bugs-tmp/writeprint.imp"
L_0113:;
                                                                //    845        %if r < 0 %then sym = '-' %and r = -r %else sym = ' '
#line 845 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (0))) goto L_0114;
#line 845 "regression-bugs-tmp/writeprint.imp"
SYM = 45;
#line 845 "regression-bugs-tmp/writeprint.imp"
R = (-(R));
#line 845 "regression-bugs-tmp/writeprint.imp"
goto L_0115;
#line 845 "regression-bugs-tmp/writeprint.imp"
L_0114:;
#line 845 "regression-bugs-tmp/writeprint.imp"
SYM = 32;
#line 845 "regression-bugs-tmp/writeprint.imp"
L_0115:;
                                                                //    846        %if r = 0 %start
#line 846 "regression-bugs-tmp/writeprint.imp"
if (((R) != (0))) goto L_0116;
                                                                //    847           exp = -99
#line 847 "regression-bugs-tmp/writeprint.imp"
EXP = (-99);
                                                                //    848        %else
#line 848 "regression-bugs-tmp/writeprint.imp"
goto L_0117;
#line 848 "regression-bugs-tmp/writeprint.imp"
L_0116:;
                                                                //    849           exp = 0
#line 849 "regression-bugs-tmp/writeprint.imp"
EXP = 0;
                                                                //    850           exp = exp + 1 %and r = r / 10 %while r >= 10
#line 850 "regression-bugs-tmp/writeprint.imp"
L_0118:;
#line 850 "regression-bugs-tmp/writeprint.imp"
if (((R) < (10))) goto L_0119;
#line 850 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) + (1));
#line 850 "regression-bugs-tmp/writeprint.imp"
R = (double)((double)((double)(R)) / (double)((float)(10)));
#line 850 "regression-bugs-tmp/writeprint.imp"
goto L_0118;
#line 850 "regression-bugs-tmp/writeprint.imp"
L_0119:;
/*promote*/                                                                //    851           exp = exp - 1 %and r = r * 10 %while r < 1
#line 851 "regression-bugs-tmp/writeprint.imp"
L_011b:;
#line 851 "regression-bugs-tmp/writeprint.imp"
if (((R) >= (1))) goto L_011c;
#line 851 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) - (1));
#line 851 "regression-bugs-tmp/writeprint.imp"
R = ((R) * ((double)(10)));
#line 851 "regression-bugs-tmp/writeprint.imp"
goto L_011b;
#line 851 "regression-bugs-tmp/writeprint.imp"
L_011c:;
                                                                //    852        %finish
#line 852 "regression-bugs-tmp/writeprint.imp"
L_0117:;
                                                                //    853        round(r, p)
#line 853 "regression-bugs-tmp/writeprint.imp"
ROUND(&R, P);
                                                                //    854        exp = exp + 1 %and r = r / 10 %if r >= 10
#line 854 "regression-bugs-tmp/writeprint.imp"
if (((R) < (10))) goto L_011e;
#line 854 "regression-bugs-tmp/writeprint.imp"
EXP = (((int)(EXP)) + (1));
#line 854 "regression-bugs-tmp/writeprint.imp"
R = (double)((double)((double)(R)) / (double)((float)(10)));
#line 854 "regression-bugs-tmp/writeprint.imp"
L_011e:;
                                                                //    855        s = s . tostring(intpt(r) + '0')
#line 855 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_TOSTRING((((int)(_imp_INTPT(R))) + (48))));
                                                                //    856        fraction(r, p, s)
#line 856 "regression-bugs-tmp/writeprint.imp"
FRACTION(R, P, &S);
                                                                //    857        s = s . "@" . itos(exp, 0)
#line 857 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_join((_imp_string)S,(_imp_string)_imp_str_literal("@")),(_imp_string)_imp_ITOS(EXP, 0));
                                                                //    858        %result = s
#line 858 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return S;
                                                                //    859     %end
#line 859 "regression-bugs-tmp/writeprint.imp"
} // End of block FTOS at level 3
                                                                //    860     printstring(ftos(r, places))
#line 860 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(FTOS(R, PLACES));
                                                                //    861  %end
#line 861 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block MOUSESPRINTFL at level 2
                                                                //    862  ! -----------------------------------------------------------------------------------------
                                                                //    863  
                                                                //    864      ! Convert a floating point number to a string, along the lines of
                                                                //    865      ! +/-nnn.nnn@+/-nn, to occupy Places character spaces
                                                                //    866      !                        with sf significant figures.
                                                                //    867      ! Rounding/truncation will occur to ensure sf limits
                                                                //    868      !
                                                                //    869      ! %longreal f = floating point number to convert to a string
                                                                //    870      ! %integer sf = number of significant figures required
                                                                //    871      !      places = number of characters in converted string
                                                                //    872      !
                                                                //    873      ! N.B. sf must be in the range of accuracy of %longreal (<15)
                                                                //    874      !  places must be slightly greater than sf
                                                                //    875      !         (to allow for sign and scientific notation)
                                                                //    876      !         sign uses 1 character (+ is omitted)
                                                                //    877      !         decimal point uses 1 character
                                                                //    878      !         scientific notation could use :
                                                                //    879      !                1 char for "@" ndicating scientific notation
                                                                //    880      !                1 char for sign of exponent (sign always present)
                                                                //    881      !                1+ char for integer exponent
                                                                //    882      !
                                                                //    883      ! N.B. scientific notation is only used if the decimal string could
                                                                //    884      !      not fit in the places required
                                                                //    885      !
                                                                //    886      ! eg. F to S (0.003999, 3, 7) -> " 0.004 " (note rounding creates zeros after the 4)
                                                                //    887      ! or
                                                                //    888      ! eg. F to S (0.003999, 3, 4) -> " 4.00@-3" (converted to scientific notation to fit)
                                                                //    889      ! eg. F to S (0.003999, 3, 6) -> " 0.004" (fits exactly)
                                                                //    890      !
                                                                //    891      %string(255) %function imp77 F to S( %longreal f, %integer sf, places)
#line 891 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(255)*/ IMP77FTOS( double F, int SF, int PLACES )
#line 891 "regression-bugs-tmp/writeprint.imp"
{
                                                                //    892          %string(255) s,sx
#line 892 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(255)*/ S;
#line 892 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(255)*/ SX;
                                                                //    893          %string(15) science
#line 893 "regression-bugs-tmp/writeprint.imp"
_imp_string /*%string(15)*/ SCIENCE;
                                                                //    894          %integer dc,carry
#line 894 "regression-bugs-tmp/writeprint.imp"
int DC;
#line 894 "regression-bugs-tmp/writeprint.imp"
int CARRY;
                                                                //    895          %integer sign,exponent, digit, point
#line 895 "regression-bugs-tmp/writeprint.imp"
int SIGN;
#line 895 "regression-bugs-tmp/writeprint.imp"
int EXPONENT;
#line 895 "regression-bugs-tmp/writeprint.imp"
int DIGIT;
#line 895 "regression-bugs-tmp/writeprint.imp"
int POINT;
                                                                //    896  
                                                                //    897          %if (sf > 14) %then sf = 14
#line 897 "regression-bugs-tmp/writeprint.imp"
if (((SF) <= (14))) goto L_011f;
#line 897 "regression-bugs-tmp/writeprint.imp"
SF = 14;
#line 897 "regression-bugs-tmp/writeprint.imp"
L_011f:;
                                                                //    898  
                                                                //    899          %begin
#line 899 "regression-bugs-tmp/writeprint.imp"
void _BLOCK_1_LEVEL_2_(void) {
                                                                //    900              %integer i
#line 900 "regression-bugs-tmp/writeprint.imp"
int I;
                                                                //    901              %integerarray digits(1:sf+1)
#line 901 "regression-bugs-tmp/writeprint.imp"
int DIGITS[(((unsigned char)((((int)((((int)(SF)) + (1)))) - (1)))) + (1))];
                                                                //    902  
                                                                //    903              sign = 0
#line 903 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    904  
                                                                //    905              %for i = 1,1,sf+1 %cycle
#line 905 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = (((int)(SF)) + (1)); I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, (((int)(SF)) + (1))");
I -= _increment; _control -= _increment;
L_0120:;
if (I == _final) goto L_0121;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //    906                  digits(i) = 0
#line 906 "regression-bugs-tmp/writeprint.imp"
DIGITS[(((int)(I)) - (1))] = 0;
                                                                //    907              %repeat
#line 907 "regression-bugs-tmp/writeprint.imp"
goto L_0120;
#line 907 "regression-bugs-tmp/writeprint.imp"
L_0121:;
                                                                //    908  
                                                                //    909              %if (f < 0) %then sign = 1 %and f = -f
#line 909 "regression-bugs-tmp/writeprint.imp"
if (((F) >= (0))) goto L_0123;
#line 909 "regression-bugs-tmp/writeprint.imp"
SIGN = 1;
#line 909 "regression-bugs-tmp/writeprint.imp"
F = (-(F));
#line 909 "regression-bugs-tmp/writeprint.imp"
L_0123:;
                                                                //    910  
                                                                //    911              ! clear the floating point string
                                                                //    912              length(s) = 0
#line 912 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&S) = 0;
                                                                //    913  
                                                                //    914              %if (f = 0) %start
#line 914 "regression-bugs-tmp/writeprint.imp"
if (((F) != (0))) goto L_0124;
                                                                //    915                  ! convert to positive zero
                                                                //    916                  sign = 0
#line 916 "regression-bugs-tmp/writeprint.imp"
SIGN = 0;
                                                                //    917                  dc = 2
#line 917 "regression-bugs-tmp/writeprint.imp"
DC = 2;
                                                                //    918                  sf = 2
#line 918 "regression-bugs-tmp/writeprint.imp"
SF = 2;
                                                                //    919                  exponent = 0
#line 919 "regression-bugs-tmp/writeprint.imp"
EXPONENT = 0;
                                                                //    920                  point = 1
#line 920 "regression-bugs-tmp/writeprint.imp"
POINT = 1;
                                                                //    921              %finish %else %start
#line 921 "regression-bugs-tmp/writeprint.imp"
goto L_0125;
#line 921 "regression-bugs-tmp/writeprint.imp"
L_0124:;
                                                                //    922                  ! prepare the exponent, point values for (f # 0)
                                                                //    923                  ! evaluate the exponent value
                                                                //    924                  exponent = 0
#line 924 "regression-bugs-tmp/writeprint.imp"
EXPONENT = 0;
                                                                //    925                  %while f < 1 %cycle
#line 925 "regression-bugs-tmp/writeprint.imp"
L_0126:;
#line 925 "regression-bugs-tmp/writeprint.imp"
if (((F) >= (1))) goto L_0127;
/*promote*/                                                                //    926                      f = f * 10
#line 926 "regression-bugs-tmp/writeprint.imp"
F = ((F) * ((double)(10)));
                                                                //    927                      exponent = exponent - 1
#line 927 "regression-bugs-tmp/writeprint.imp"
EXPONENT = (((int)(EXPONENT)) - (1));
                                                                //    928                  %repeat
#line 928 "regression-bugs-tmp/writeprint.imp"
goto L_0126;
#line 928 "regression-bugs-tmp/writeprint.imp"
L_0127:;
                                                                //    929  
                                                                //    930                  %while f >= 10 %cycle
#line 930 "regression-bugs-tmp/writeprint.imp"
L_0129:;
#line 930 "regression-bugs-tmp/writeprint.imp"
if (((F) < (10))) goto L_012a;
                                                                //    931                      f = f / 10
#line 931 "regression-bugs-tmp/writeprint.imp"
F = (double)((double)((double)(F)) / (double)((float)(10)));
                                                                //    932                      exponent = exponent + 1
#line 932 "regression-bugs-tmp/writeprint.imp"
EXPONENT = (((int)(EXPONENT)) + (1));
                                                                //    933                  %repeat
#line 933 "regression-bugs-tmp/writeprint.imp"
goto L_0129;
#line 933 "regression-bugs-tmp/writeprint.imp"
L_012a:;
                                                                //    934  
                                                                //    935                  ! locate the decimal point
                                                                //    936                  point = 1
#line 936 "regression-bugs-tmp/writeprint.imp"
POINT = 1;
                                                                //    937                  ! zero the digit count
                                                                //    938                  dc = 0
#line 938 "regression-bugs-tmp/writeprint.imp"
DC = 0;
                                                                //    939  
                                                                //    940                  ! Loop to get the significant figure digits with an extra digit
                                                                //    941                  ! so we can use it to round the the required sig figs
                                                                //    942                  ! Rounding as we go through this loop can "oversize" the digit.
                                                                //    943                  ! The next stage does the rounding to the correct sig fig.
                                                                //    944                  %for i = 1,1,sf + 1 %cycle
#line 944 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = (((int)(SF)) + (1)); I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, (((int)(SF)) + (1))");
I -= _increment; _control -= _increment;
L_012c:;
if (I == _final) goto L_012d;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //    945                      digit = int pt(f)
#line 945 "regression-bugs-tmp/writeprint.imp"
DIGIT = _imp_INTPT(F);
                                                                //    946                      %if (digit > 9) %then digit = 9
#line 946 "regression-bugs-tmp/writeprint.imp"
if (((DIGIT) <= (9))) goto L_012f;
#line 946 "regression-bugs-tmp/writeprint.imp"
DIGIT = 9;
#line 946 "regression-bugs-tmp/writeprint.imp"
L_012f:;
                                                                //    947                      dc = dc + 1
#line 947 "regression-bugs-tmp/writeprint.imp"
DC = (((int)(DC)) + (1));
                                                                //    948                      digits(dc) = digit
#line 948 "regression-bugs-tmp/writeprint.imp"
DIGITS[(((int)(DC)) - (1))] = DIGIT;
/*promote*//*Warning: potential loss of precision converting from integer AST_ICONST (10 - 4 bytes) to real AST_BINOP (((F) - ((double)(DIGIT))) - 0 bytes) detected at ast.c line 108 */
                                                                //    949                      f = (f - digit)*10
#line 949 "regression-bugs-tmp/writeprint.imp"
F = ((((F) - ((double)(DIGIT)))) * ((10)));
                                                                //    950                  %repeat
#line 950 "regression-bugs-tmp/writeprint.imp"
goto L_012c;
#line 950 "regression-bugs-tmp/writeprint.imp"
L_012d:;
                                                                //    951  
                                                                //    952                  ! do the rounding to the sf significant figures
                                                                //    953                  %if (digits(dc) > 4) %start
#line 953 "regression-bugs-tmp/writeprint.imp"
if (((DIGITS[(((int)(DC)) - (1))]) <= (4))) goto L_0130;
                                                                //    954                      ! we need to possibly round up the digits sequence
                                                                //    955                      carry = 1
#line 955 "regression-bugs-tmp/writeprint.imp"
CARRY = 1;
                                                                //    956                      %for i = dc - 1,-1,1 %cycle
#line 956 "regression-bugs-tmp/writeprint.imp"
I = (((unsigned char)((((int)(DC)) - (1)))) + (1));
if ((((1)-((((int)(DC)) - (1)))) % ((-1))) != 0) _imp_signal(5,1,0,"Illegal cycle I = (((int)(DC)) - (1)), (-1), 1");
L_0131:;
if (I == 1) goto L_0132;
I += (-1);
                                                                //    957                          digits(i) = digits(i) + carry
#line 957 "regression-bugs-tmp/writeprint.imp"
DIGITS[(((int)(I)) - (1))] = (((int)(DIGITS[(((int)(I)) - (1))])) + (CARRY));
                                                                //    958                          %if (digits(i) > 9) %start
#line 958 "regression-bugs-tmp/writeprint.imp"
if (((DIGITS[(((int)(I)) - (1))]) <= (9))) goto L_0134;
                                                                //    959                              carry = 1
#line 959 "regression-bugs-tmp/writeprint.imp"
CARRY = 1;
                                                                //    960                              digits(i) = 0
#line 960 "regression-bugs-tmp/writeprint.imp"
DIGITS[(((int)(I)) - (1))] = 0;
                                                                //    961                          %finish %else %start
#line 961 "regression-bugs-tmp/writeprint.imp"
goto L_0135;
#line 961 "regression-bugs-tmp/writeprint.imp"
L_0134:;
                                                                //    962                              carry = 0
#line 962 "regression-bugs-tmp/writeprint.imp"
CARRY = 0;
                                                                //    963                          %finish
#line 963 "regression-bugs-tmp/writeprint.imp"
L_0135:;
                                                                //    964                      %repeat
#line 964 "regression-bugs-tmp/writeprint.imp"
goto L_0131;
#line 964 "regression-bugs-tmp/writeprint.imp"
L_0132:;
                                                                //    965                  %finish
#line 965 "regression-bugs-tmp/writeprint.imp"
L_0130:;
                                                                //    966                  ! ignore the rounding digit
                                                                //    967                  dc = dc - 1
#line 967 "regression-bugs-tmp/writeprint.imp"
DC = (((int)(DC)) - (1));
                                                                //    968  
                                                                //    969                  ! Now eliminate any trailing zeros
                                                                //    970                  ! We assume that rounding has created
                                                                //    971                  ! a sequence of trailing zeros
                                                                //    972                  %while (digits(dc) = 0) %and (dc > 1) %cycle
#line 972 "regression-bugs-tmp/writeprint.imp"
L_0136:;
#line 972 "regression-bugs-tmp/writeprint.imp"
if (((DIGITS[(((int)(DC)) - (1))]) != (0))) goto L_0137;
#line 972 "regression-bugs-tmp/writeprint.imp"
if (((DC) <= (1))) goto L_0137;
                                                                //    973                      dc = dc - 1
#line 973 "regression-bugs-tmp/writeprint.imp"
DC = (((int)(DC)) - (1));
                                                                //    974                  %repeat
#line 974 "regression-bugs-tmp/writeprint.imp"
goto L_0136;
#line 974 "regression-bugs-tmp/writeprint.imp"
L_0137:;
                                                                //    975                  sf = dc
#line 975 "regression-bugs-tmp/writeprint.imp"
SF = DC;
                                                                //    976              %finish
#line 976 "regression-bugs-tmp/writeprint.imp"
L_0125:;
                                                                //    977  
                                                                //    978              length(s) = 0
#line 978 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&S) = 0;
                                                                //    979              point = 1
#line 979 "regression-bugs-tmp/writeprint.imp"
POINT = 1;
                                                                //    980              %for i = 1,1,sf %cycle
#line 980 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = SF; I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, SF");
I -= _increment; _control -= _increment;
L_0139:;
if (I == _final) goto L_013a;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //    981                  s = s.tostring(digits(i) + '0')
#line 981 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_TOSTRING((((int)(DIGITS[(((int)(I)) - (1))])) + (48))));
                                                                //    982                  %if (point = i) %then s = s."."
#line 982 "regression-bugs-tmp/writeprint.imp"
if (((POINT) != (I))) goto L_013c;
#line 982 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal("."));
#line 982 "regression-bugs-tmp/writeprint.imp"
L_013c:;
                                                                //    983              %repeat
#line 983 "regression-bugs-tmp/writeprint.imp"
goto L_0139;
#line 983 "regression-bugs-tmp/writeprint.imp"
L_013a:;
                                                                //    984              %if (sf = point) %then s = s."0"
#line 984 "regression-bugs-tmp/writeprint.imp"
if (((SF) != (POINT))) goto L_013d;
#line 984 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal("0"));
#line 984 "regression-bugs-tmp/writeprint.imp"
L_013d:;
                                                                //    985              %if (exponent < 0) %then s=s."@-".itos(-exponent,0)
#line 985 "regression-bugs-tmp/writeprint.imp"
if (((EXPONENT) >= (0))) goto L_013e;
#line 985 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_join((_imp_string)S,(_imp_string)_imp_str_literal("@-")),(_imp_string)_imp_ITOS((-(EXPONENT)), 0));
#line 985 "regression-bugs-tmp/writeprint.imp"
L_013e:;
                                                                //    986              %if (exponent > 0) %then s=s."@+".itos(exponent,0)
#line 986 "regression-bugs-tmp/writeprint.imp"
if (((EXPONENT) <= (0))) goto L_013f;
#line 986 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_join((_imp_string)S,(_imp_string)_imp_str_literal("@+")),(_imp_string)_imp_ITOS(EXPONENT, 0));
#line 986 "regression-bugs-tmp/writeprint.imp"
L_013f:;
                                                                //    987              science = s
#line 987 "regression-bugs-tmp/writeprint.imp"
SCIENCE = S;
                                                                //    988  
                                                                //    989              ! So, now for the other floating point layouts
                                                                //    990              ! we should see which version will fit into the places allowed
                                                                //    991              ! 1) 0.00000nnnn (point <= 0)
                                                                //    992              ! OR
                                                                //    993              ! 2) nnnn.0 (point = sf)
                                                                //    994              ! OR
                                                                //    995              ! 3) nnnn00000.0 (point > sf)
                                                                //    996              !
                                                                //    997              length(s) = 0
#line 997 "regression-bugs-tmp/writeprint.imp"
*_imp_LENGTH(&S) = 0;
                                                                //    998              point = exponent + 1
#line 998 "regression-bugs-tmp/writeprint.imp"
POINT = (((int)(EXPONENT)) + (1));
                                                                //    999              ! First form the sig fig digit string
                                                                //   1000              ! possibly including a decimal point
                                                                //   1001              %for i = 1,1,sf %cycle
#line 1001 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = SF; I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, SF");
I -= _increment; _control -= _increment;
L_0140:;
if (I == _final) goto L_0141;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //   1002                  s = s.tostring(digits(i) + '0')
#line 1002 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_TOSTRING((((int)(DIGITS[(((int)(I)) - (1))])) + (48))));
                                                                //   1003                  %if (point = i) %then s = s."."
#line 1003 "regression-bugs-tmp/writeprint.imp"
if (((POINT) != (I))) goto L_0143;
#line 1003 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal("."));
#line 1003 "regression-bugs-tmp/writeprint.imp"
L_0143:;
                                                                //   1004              %repeat
#line 1004 "regression-bugs-tmp/writeprint.imp"
goto L_0140;
#line 1004 "regression-bugs-tmp/writeprint.imp"
L_0141:;
                                                                //   1005  
                                                                //   1006              ! Checking for format (1)
                                                                //   1007              ! 1) 0.00000nnnn (point <= 0)
                                                                //   1008              %if (point <= 0) %start
#line 1008 "regression-bugs-tmp/writeprint.imp"
if (((POINT) > (0))) goto L_0144;
                                                                //   1009                  %for i=1,1,-point %cycle
#line 1009 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = (-(POINT)); I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, (-(POINT))");
I -= _increment; _control -= _increment;
L_0145:;
if (I == _final) goto L_0146;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //   1010                      s = "0".s
#line 1010 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_str_literal("0"),(_imp_string)S);
                                                                //   1011                  %repeat
#line 1011 "regression-bugs-tmp/writeprint.imp"
goto L_0145;
#line 1011 "regression-bugs-tmp/writeprint.imp"
L_0146:;
                                                                //   1012                  s = "0.".s
#line 1012 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_str_literal("0."),(_imp_string)S);
                                                                //   1013              %finish
#line 1013 "regression-bugs-tmp/writeprint.imp"
L_0144:;
                                                                //   1014  
                                                                //   1015              ! Checking for format (2)
                                                                //   1016              ! 2) nnnn.0 (point = sf)
                                                                //   1017              %if (point = sf) %start
#line 1017 "regression-bugs-tmp/writeprint.imp"
if (((POINT) != (SF))) goto L_0148;
                                                                //   1018                  s = s."0"
#line 1018 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal("0"));
                                                                //   1019              %finish
#line 1019 "regression-bugs-tmp/writeprint.imp"
L_0148:;
                                                                //   1020  
                                                                //   1021              ! Checking for format (3)
                                                                //   1022              ! 3) nnnn00000.0 (point > sf)
                                                                //   1023              %if (point > sf) %start
#line 1023 "regression-bugs-tmp/writeprint.imp"
if (((POINT) <= (SF))) goto L_0149;
                                                                //   1024                  %for i = 1,1,(point - sf) %cycle
#line 1024 "regression-bugs-tmp/writeprint.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = (((int)(POINT)) - (SF)); I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, (((int)(POINT)) - (SF))");
I -= _increment; _control -= _increment;
L_014a:;
if (I == _final) goto L_014b;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //   1025                      s = s."0"
#line 1025 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal("0"));
                                                                //   1026                  %repeat
#line 1026 "regression-bugs-tmp/writeprint.imp"
goto L_014a;
#line 1026 "regression-bugs-tmp/writeprint.imp"
L_014b:;
                                                                //   1027                  s = s.".0"
#line 1027 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal(".0"));
                                                                //   1028              %finish
#line 1028 "regression-bugs-tmp/writeprint.imp"
L_0149:;
                                                                //   1029  
                                                                //   1030              ! Check to see which fits scientific v decimal notation
                                                                //   1031              ! Preference is for the decimal notation
                                                                //   1032              %if (length(s) > places) %start
#line 1032 "regression-bugs-tmp/writeprint.imp"
if (((*_imp_LENGTH(&S)) <= (PLACES))) goto L_014d;
                                                                //   1033                  s = science
#line 1033 "regression-bugs-tmp/writeprint.imp"
S = SCIENCE;
                                                                //   1034              %finish
#line 1034 "regression-bugs-tmp/writeprint.imp"
L_014d:;
                                                                //   1035  
                                                                //   1036              %if (sign # 0) %start
#line 1036 "regression-bugs-tmp/writeprint.imp"
if (((SIGN) == (0))) goto L_014e;
                                                                //   1037                  s = "-".s
#line 1037 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_str_literal("-"),(_imp_string)S);
                                                                //   1038              %finish %else %start
#line 1038 "regression-bugs-tmp/writeprint.imp"
goto L_014f;
#line 1038 "regression-bugs-tmp/writeprint.imp"
L_014e:;
                                                                //   1039                  s = " ".s
#line 1039 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)_imp_str_literal(" "),(_imp_string)S);
                                                                //   1040              %finish
#line 1040 "regression-bugs-tmp/writeprint.imp"
L_014f:;
                                                                //   1041  
                                                                //   1042              %if (length(s) < places) %start
#line 1042 "regression-bugs-tmp/writeprint.imp"
if (((*_imp_LENGTH(&S)) >= (PLACES))) goto L_0150;
                                                                //   1043                  %while (length(s) < places) %cycle
#line 1043 "regression-bugs-tmp/writeprint.imp"
L_0151:;
#line 1043 "regression-bugs-tmp/writeprint.imp"
if (((*_imp_LENGTH(&S)) >= (PLACES))) goto L_0152;
                                                                //   1044                      s = s." "
#line 1044 "regression-bugs-tmp/writeprint.imp"
S = _imp_join((_imp_string)S,(_imp_string)_imp_str_literal(" "));
                                                                //   1045                  %repeat
#line 1045 "regression-bugs-tmp/writeprint.imp"
goto L_0151;
#line 1045 "regression-bugs-tmp/writeprint.imp"
L_0152:;
                                                                //   1046              %finish
#line 1046 "regression-bugs-tmp/writeprint.imp"
L_0150:;
                                                                //   1047          %end
#line 1047 "regression-bugs-tmp/writeprint.imp"
return;
} // End of block _BLOCK_1_LEVEL_2_ at level 3
_BLOCK_1_LEVEL_2_();
                                                                //   1048  
                                                                //   1049          %result = s
#line 1049 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return S;
                                                                //   1050      %end
#line 1050 "regression-bugs-tmp/writeprint.imp"
} // End of block IMP77FTOS at level 2
                                                                //   1051  
                                                                //   1052      %routine imp77 print(%longreal f, %integer sf,places)
#line 1052 "regression-bugs-tmp/writeprint.imp"
void IMP77PRINT( double F, int SF, int PLACES )
#line 1052 "regression-bugs-tmp/writeprint.imp"
{
                                                                //   1053          printstring( imp77 F to S( f, sf, places ) )
#line 1053 "regression-bugs-tmp/writeprint.imp"
PRINTSTRING(IMP77FTOS(F, SF, PLACES));
                                                                //   1054      %end
#line 1054 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block IMP77PRINT at level 2
                                                                //   1055  
                                                                //   1056      ! Print a floating point number out, along the lines of
                                                                //   1057      ! +/-nnn.nnn@+/-nn, to occupy Places character spaces.
                                                                //   1058      ! Note - there's a bug in this code such that it does not
                                                                //   1059      ! round the number properly.  EG 3.999999999 to 4 places
                                                                //   1060      ! should be 4.00 but we print 3.99
                                                                //   1061  
                                                                //   1062      %routine imp77 printfl(%longreal x, %integer places)
#line 1062 "regression-bugs-tmp/writeprint.imp"
void IMP77PRINTFL( double X, int PLACES )
#line 1062 "regression-bugs-tmp/writeprint.imp"
{
                                                                //   1063          %integer exponent, digit, point, printexpo
#line 1063 "regression-bugs-tmp/writeprint.imp"
int EXPONENT;
#line 1063 "regression-bugs-tmp/writeprint.imp"
int DIGIT;
#line 1063 "regression-bugs-tmp/writeprint.imp"
int POINT;
#line 1063 "regression-bugs-tmp/writeprint.imp"
int PRINTEXPO;
                                                                //   1064  
                                                                //   1065          %if x = 0 %start
#line 1065 "regression-bugs-tmp/writeprint.imp"
if (((X) != (0))) goto L_0154;
                                                                //   1066              printsymbol('0')
#line 1066 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(48);
                                                                //   1067              printsymbol('.')
#line 1067 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(46);
                                                                //   1068              printsymbol('0')
#line 1068 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(48);
                                                                //   1069              %while places > 3 %cycle
#line 1069 "regression-bugs-tmp/writeprint.imp"
L_0155:;
#line 1069 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (3))) goto L_0156;
                                                                //   1070                  printsymbol('0')
#line 1070 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(48);
                                                                //   1071                  places = places - 1
#line 1071 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
                                                                //   1072              %repeat
#line 1072 "regression-bugs-tmp/writeprint.imp"
goto L_0155;
#line 1072 "regression-bugs-tmp/writeprint.imp"
L_0156:;
                                                                //   1073              %return
#line 1073 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
                                                                //   1074          %finish
#line 1074 "regression-bugs-tmp/writeprint.imp"
L_0154:;
                                                                //   1075  
                                                                //   1076          %if x < 0 %then printsymbol('-') %and x = -x %and places = places - 1
#line 1076 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (0))) goto L_0158;
#line 1076 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(45);
#line 1076 "regression-bugs-tmp/writeprint.imp"
X = (-(X));
#line 1076 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
#line 1076 "regression-bugs-tmp/writeprint.imp"
L_0158:;
                                                                //   1077  
                                                                //   1078          %if places < 3 %then places = 3
#line 1078 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) >= (3))) goto L_0159;
#line 1078 "regression-bugs-tmp/writeprint.imp"
PLACES = 3;
#line 1078 "regression-bugs-tmp/writeprint.imp"
L_0159:;
                                                                //   1079     
                                                                //   1080          exponent = 0
#line 1080 "regression-bugs-tmp/writeprint.imp"
EXPONENT = 0;
                                                                //   1081          printexpo = 0
#line 1081 "regression-bugs-tmp/writeprint.imp"
PRINTEXPO = 0;
                                                                //   1082  
                                                                //   1083          %while x < 1 %cycle
#line 1083 "regression-bugs-tmp/writeprint.imp"
L_015a:;
#line 1083 "regression-bugs-tmp/writeprint.imp"
if (((X) >= (1))) goto L_015b;
/*promote*/                                                                //   1084              x = x * 10
#line 1084 "regression-bugs-tmp/writeprint.imp"
X = ((X) * ((double)(10)));
                                                                //   1085              exponent = exponent - 1
#line 1085 "regression-bugs-tmp/writeprint.imp"
EXPONENT = (((int)(EXPONENT)) - (1));
                                                                //   1086          %repeat
#line 1086 "regression-bugs-tmp/writeprint.imp"
goto L_015a;
#line 1086 "regression-bugs-tmp/writeprint.imp"
L_015b:;
                                                                //   1087  
                                                                //   1088          %while x >= 10 %cycle
#line 1088 "regression-bugs-tmp/writeprint.imp"
L_015d:;
#line 1088 "regression-bugs-tmp/writeprint.imp"
if (((X) < (10))) goto L_015e;
                                                                //   1089              x = x / 10
#line 1089 "regression-bugs-tmp/writeprint.imp"
X = (double)((double)((double)(X)) / (double)((float)(10)));
                                                                //   1090              exponent = exponent + 1
#line 1090 "regression-bugs-tmp/writeprint.imp"
EXPONENT = (((int)(EXPONENT)) + (1));
                                                                //   1091          %repeat
#line 1091 "regression-bugs-tmp/writeprint.imp"
goto L_015d;
#line 1091 "regression-bugs-tmp/writeprint.imp"
L_015e:;
                                                                //   1092  
                                                                //   1093          ! Now X is between 1.0 and 9.99 and exponent is set accordingly
                                                                //   1094          ! If the exponent is "large" we will use scientific notation
                                                                //   1095          point = places - 2;     ! for useful digits after the "0."
#line 1095 "regression-bugs-tmp/writeprint.imp"
POINT = (((int)(PLACES)) - (2));
                                                                //   1096          %if exponent >= places %or exponent < -point %start
#line 1096 "regression-bugs-tmp/writeprint.imp"
if (((EXPONENT) >= (PLACES))) goto L_015f;
#line 1096 "regression-bugs-tmp/writeprint.imp"
if (((EXPONENT) >= ((-(POINT))))) goto L_0160;
#line 1096 "regression-bugs-tmp/writeprint.imp"
L_015f:;
                                                                //   1097              printexpo = exponent
#line 1097 "regression-bugs-tmp/writeprint.imp"
PRINTEXPO = EXPONENT;
                                                                //   1098              exponent = 0
#line 1098 "regression-bugs-tmp/writeprint.imp"
EXPONENT = 0;
                                                                //   1099              places = places - 2
#line 1099 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (2));
                                                                //   1100          %finish
#line 1100 "regression-bugs-tmp/writeprint.imp"
L_0160:;
                                                                //   1101  
                                                                //   1102          ! Now the exponent is small-ish
                                                                //   1103          %if exponent < 0 %start;      ! 0.nnnn
#line 1103 "regression-bugs-tmp/writeprint.imp"
if (((EXPONENT) >= (0))) goto L_0161;
                                                                //   1104              printsymbol('0')
#line 1104 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(48);
                                                                //   1105              printsymbol('.')
#line 1105 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(46);
                                                                //   1106              places = places - 2
#line 1106 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (2));
                                                                //   1107  
                                                                //   1108              %while exponent < -1 %cycle
#line 1108 "regression-bugs-tmp/writeprint.imp"
L_0162:;
#line 1108 "regression-bugs-tmp/writeprint.imp"
if (((EXPONENT) >= ((-1)))) goto L_0163;
                                                                //   1109                  printsymbol('0')
#line 1109 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(48);
                                                                //   1110                  exponent = exponent + 1
#line 1110 "regression-bugs-tmp/writeprint.imp"
EXPONENT = (((int)(EXPONENT)) + (1));
                                                                //   1111                  places = places - 1
#line 1111 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
                                                                //   1112              %repeat
#line 1112 "regression-bugs-tmp/writeprint.imp"
goto L_0162;
#line 1112 "regression-bugs-tmp/writeprint.imp"
L_0163:;
                                                                //   1113  
                                                                //   1114              point = -1; ! because we've already passed that
#line 1114 "regression-bugs-tmp/writeprint.imp"
POINT = (-1);
                                                                //   1115          %else;          ! nnn.nnn
#line 1115 "regression-bugs-tmp/writeprint.imp"
goto L_0165;
#line 1115 "regression-bugs-tmp/writeprint.imp"
L_0161:;
                                                                //   1116              point = exponent
#line 1116 "regression-bugs-tmp/writeprint.imp"
POINT = EXPONENT;
                                                                //   1117          %finish
#line 1117 "regression-bugs-tmp/writeprint.imp"
L_0165:;
                                                                //   1118  
                                                                //   1119          %while places > 0 %cycle
#line 1119 "regression-bugs-tmp/writeprint.imp"
L_0166:;
#line 1119 "regression-bugs-tmp/writeprint.imp"
if (((PLACES) <= (0))) goto L_0167;
                                                                //   1120              digit = int pt(x)
#line 1120 "regression-bugs-tmp/writeprint.imp"
DIGIT = _imp_INTPT(X);
                                                                //   1121              ! Rounding as we go through this loop can "oversize" the digit.  This
                                                                //   1122              ! of course tells us that we should have printed (eg) 40000 but we
                                                                //   1123              ! are now stuck with printing 39999
                                                                //   1124              %if digit > 9 %then digit = 9
#line 1124 "regression-bugs-tmp/writeprint.imp"
if (((DIGIT) <= (9))) goto L_0169;
#line 1124 "regression-bugs-tmp/writeprint.imp"
DIGIT = 9;
#line 1124 "regression-bugs-tmp/writeprint.imp"
L_0169:;
                                                                //   1125              printsymbol(digit + '0')
#line 1125 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL((((int)(DIGIT)) + (48)));
/*promote*//*Warning: potential loss of precision converting from integer AST_ICONST (10 - 4 bytes) to real AST_BINOP (((X) - ((double)(DIGIT))) - 0 bytes) detected at ast.c line 108 */
                                                                //   1126              x = (x - digit)*10
#line 1126 "regression-bugs-tmp/writeprint.imp"
X = ((((X) - ((double)(DIGIT)))) * ((10)));
                                                                //   1127              %if point = 0 %then printsymbol('.') %and places = places - 1
#line 1127 "regression-bugs-tmp/writeprint.imp"
if (((POINT) != (0))) goto L_016a;
#line 1127 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(46);
#line 1127 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
#line 1127 "regression-bugs-tmp/writeprint.imp"
L_016a:;
                                                                //   1128              point = point - 1
#line 1128 "regression-bugs-tmp/writeprint.imp"
POINT = (((int)(POINT)) - (1));
                                                                //   1129              places = places - 1
#line 1129 "regression-bugs-tmp/writeprint.imp"
PLACES = (((int)(PLACES)) - (1));
                                                                //   1130          %repeat
#line 1130 "regression-bugs-tmp/writeprint.imp"
goto L_0166;
#line 1130 "regression-bugs-tmp/writeprint.imp"
L_0167:;
                                                                //   1131  
                                                                //   1132          %if printexpo # 0 %start
#line 1132 "regression-bugs-tmp/writeprint.imp"
if (((PRINTEXPO) == (0))) goto L_016b;
                                                                //   1133              printsymbol('@')
#line 1133 "regression-bugs-tmp/writeprint.imp"
PRINTSYMBOL(64);
                                                                //   1134              write68k(printexpo, 1)
#line 1134 "regression-bugs-tmp/writeprint.imp"
WRITE68K(PRINTEXPO, 1);
                                                                //   1135          %finish
#line 1135 "regression-bugs-tmp/writeprint.imp"
L_016b:;
                                                                //   1136      %end
#line 1136 "regression-bugs-tmp/writeprint.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block IMP77PRINTFL at level 2
/* Procedure parameter. probably no args given yet. */                                                                //   1137  
                                                                //   1138  ! #########################################################################################
                                                                //   1139  
                                                                //   1140     %routine writetest(%string (255) procname, %routine testedwrite(%integer n, p))
#line 1140 "regression-bugs-tmp/writeprint.imp"
void WRITETEST( _imp_string /*%string(255)*/ PROCNAME, void TESTEDWRITE( 