#include <perms.h>

                                                                //      1  %begin
#line 1 "regression-bugs-tmp/write-mouses.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //      2  
                                                                //      3  %routine MOUSES WRITE(%integer n, p)
#line 3 "regression-bugs-tmp/write-mouses.imp"
void MOUSESWRITE( int N, int P )
#line 3 "regression-bugs-tmp/write-mouses.imp"
{
                                                                //      4  
                                                                //      5  %string(72)%fn ITOS(%integer n, p)
#line 5 "regression-bugs-tmp/write-mouses.imp"
_imp_string /*%string(72)*/ ITOS( int N, int P )
#line 5 "regression-bugs-tmp/write-mouses.imp"
{
                                                                //      6     %byte %array s(0:72)
#line 6 "regression-bugs-tmp/write-mouses.imp"
unsigned char S[73];
                                                                //      7     %integer x, sign
#line 7 "regression-bugs-tmp/write-mouses.imp"
int X;
#line 7 "regression-bugs-tmp/write-mouses.imp"
int SIGN;
                                                                //      8     x = 73
#line 8 "regression-bugs-tmp/write-mouses.imp"
X = 73;
                                                                //      9     sign = 0
#line 9 "regression-bugs-tmp/write-mouses.imp"
SIGN = 0;
                                                                //     10     %if p > 0 %start
#line 10 "regression-bugs-tmp/write-mouses.imp"
if (((P) <= (0))) goto L_0002;
                                                                //     11        sign = ' '
#line 11 "regression-bugs-tmp/write-mouses.imp"
SIGN = 32;
                                                                //     12        p = 72-p
#line 12 "regression-bugs-tmp/write-mouses.imp"
P = (((int)(72)) - (P));
                                                                //     13     %else
#line 13 "regression-bugs-tmp/write-mouses.imp"
goto L_0003;
#line 13 "regression-bugs-tmp/write-mouses.imp"
L_0002:;
                                                                //     14        p = p+73
#line 14 "regression-bugs-tmp/write-mouses.imp"
P = (((int)(P)) + (73));
                                                                //     15     %finish
#line 15 "regression-bugs-tmp/write-mouses.imp"
L_0003:;
                                                                //     16     p = 1 %if p <= 0
#line 16 "regression-bugs-tmp/write-mouses.imp"
if (((P) > (0))) goto L_0004;
#line 16 "regression-bugs-tmp/write-mouses.imp"
P = 1;
#line 16 "regression-bugs-tmp/write-mouses.imp"
L_0004:;
                                                                //     17     %if n < 0 %start
#line 17 "regression-bugs-tmp/write-mouses.imp"
if (((N) >= (0))) goto L_0005;
                                                                //     18        sign = '-'
#line 18 "regression-bugs-tmp/write-mouses.imp"
SIGN = 45;
                                                                //     19        n = -n
#line 19 "regression-bugs-tmp/write-mouses.imp"
N = (-(N));
                                                                //     20        %if n < 0 %start;      !max int
#line 20 "regression-bugs-tmp/write-mouses.imp"
if (((N) >= (0))) goto L_0006;
                                                                //     21           n = n//(-10)
#line 21 "regression-bugs-tmp/write-mouses.imp"
N = (long)((long)((int)(N)) / (long)((int)((-10))));
                                                                //     22           x = x-1
#line 22 "regression-bugs-tmp/write-mouses.imp"
X = (((int)(X)) - (1));
                                                                //     23           s(x) = '8'
#line 23 "regression-bugs-tmp/write-mouses.imp"
S[X] = 56;
                                                                //     24        %finish
#line 24 "regression-bugs-tmp/write-mouses.imp"
L_0006:;
                                                                //     25     %finish
#line 25 "regression-bugs-tmp/write-mouses.imp"
L_0005:;
                                                                //     26     %cycle
#line 26 "regression-bugs-tmp/write-mouses.imp"
L_0007:;
                                                                //     27        x=x-1
#line 27 "regression-bugs-tmp/write-mouses.imp"
X = (((int)(X)) - (1));
                                                                //     28        s(x) = rem(n,10)+'0'
#line 28 "regression-bugs-tmp/write-mouses.imp"
S[X] = (((int)(_imp_REM(N, 10))) + (48));
                                                                //     29        n = n//10
#line 29 "regression-bugs-tmp/write-mouses.imp"
N = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //     30     %repeat %until n = 0
#line 30 "regression-bugs-tmp/write-mouses.imp"
if (((N) == (0))) goto L_0008;
#line 30 "regression-bugs-tmp/write-mouses.imp"
goto L_0007;
#line 30 "regression-bugs-tmp/write-mouses.imp"
L_0008:;
                                                                //     31     %if sign # 0 %start
#line 31 "regression-bugs-tmp/write-mouses.imp"
if (((SIGN) == (0))) goto L_000a;
                                                                //     32        x = x-1;  s(x) = sign
#line 32 "regression-bugs-tmp/write-mouses.imp"
X = (((int)(X)) - (1));
#line 32 "regression-bugs-tmp/write-mouses.imp"
S[X] = SIGN;
                                                                //     33     %finish
#line 33 "regression-bugs-tmp/write-mouses.imp"
L_000a:;
                                                                //     34     %while x > p %cycle
#line 34 "regression-bugs-tmp/write-mouses.imp"
L_000b:;
#line 34 "regression-bugs-tmp/write-mouses.imp"
if (((X) <= (P))) goto L_000c;
                                                                //     35        x = x-1;  s(x) = ' '
#line 35 "regression-bugs-tmp/write-mouses.imp"
X = (((int)(X)) - (1));
#line 35 "regression-bugs-tmp/write-mouses.imp"
S[X] = 32;
                                                                //     36     %repeat
#line 36 "regression-bugs-tmp/write-mouses.imp"
goto L_000b;
#line 36 "regression-bugs-tmp/write-mouses.imp"
L_000c:;
                                                                //     37     x = x-1
#line 37 "regression-bugs-tmp/write-mouses.imp"
X = (((int)(X)) - (1));
                                                                //     38     s(x) = 72-x
#line 38 "regression-bugs-tmp/write-mouses.imp"
S[X] = (((int)(72)) - (X));
                                                                //     39     %result = string(addr(s(x)))
#line 39 "regression-bugs-tmp/write-mouses.imp"
/* Remove %on %event handler here if present for this block */
return *_imp_STRING(_imp_ADDR(&S[X]));
                                                                //     40  %end
#line 40 "regression-bugs-tmp/write-mouses.imp"
} // End of block ITOS at level 3
                                                                //     41  
                                                                //     42     printstring(itos(n, p))
#line 42 "regression-bugs-tmp/write-mouses.imp"
_imp_PRINTSTRING(ITOS(N, P));
                                                                //     43  %end
#line 43 "regression-bugs-tmp/write-mouses.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block MOUSESWRITE at level 2
                                                                //     44  
                                                                //     45  %endofprogram
#line 45 "regression-bugs-tmp/write-mouses.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
#line 45 "regression-bugs-tmp/write-mouses.imp"
// End of file
