#include <perms.h>

                                                                //      1  %systemstring(127)%fn itos(%integer v,p)
#line 1 "regression-bugs-tmp/itos.imp"
extern _imp_string /*%string(127)*/ itos( int V, int P )
#line 1 "regression-bugs-tmp/itos.imp"
{
                                                                //      2  %string(127)store
#line 2 "regression-bugs-tmp/itos.imp"
_imp_string /*%string(127)*/ STORE;
                                                                //      3  %bytename l
#line 3 "regression-bugs-tmp/itos.imp"
unsigned char /*name*/*L;
                                                                //      4    %routine printsymbol(%integer x)
#line 4 "regression-bugs-tmp/itos.imp"
void PRINTSYMBOL( int X )
#line 4 "regression-bugs-tmp/itos.imp"
{
                                                                //      5      l = l+1; charno(store,l) = x
#line 5 "regression-bugs-tmp/itos.imp"
*L = ((*(int *)(L)) + (1));
#line 5 "regression-bugs-tmp/itos.imp"
*_imp_CHARNO(&STORE, *L) = X;
                                                                //      6    %end
#line 6 "regression-bugs-tmp/itos.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINTSYMBOL at level 2
                                                                //      7    %routine spaces(%integer x)
#line 7 "regression-bugs-tmp/itos.imp"
void SPACES( int X )
#line 7 "regression-bugs-tmp/itos.imp"
{
                                                                //      8      x = x-1 %and printsymbol(' ') %while x>0
#line 8 "regression-bugs-tmp/itos.imp"
L_0002:;
#line 8 "regression-bugs-tmp/itos.imp"
if (((X) <= (0))) goto L_0003;
#line 8 "regression-bugs-tmp/itos.imp"
X = (((int)(X)) - (1));
#line 8 "regression-bugs-tmp/itos.imp"
PRINTSYMBOL(32);
#line 8 "regression-bugs-tmp/itos.imp"
goto L_0002;
#line 8 "regression-bugs-tmp/itos.imp"
L_0003:;
                                                                //      9    %end
#line 9 "regression-bugs-tmp/itos.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block SPACES at level 2
                                                                //     10    %routine write(%integer n,p)
#line 10 "regression-bugs-tmp/itos.imp"
void WRITE( int N, int P )
#line 10 "regression-bugs-tmp/itos.imp"
{
                                                                //     11    %integer q,r
#line 11 "regression-bugs-tmp/itos.imp"
int Q;
#line 11 "regression-bugs-tmp/itos.imp"
int R;
                                                                //     12      %if p>0 %start
#line 12 "regression-bugs-tmp/itos.imp"
if (((P) <= (0))) goto L_0005;
                                                                //     13        p = \p; printsymbol(' ') %and p = p+1 %if n>=0
#line 13 "regression-bugs-tmp/itos.imp"
P = (~(P));
#line 13 "regression-bugs-tmp/itos.imp"
if (((N) < (0))) goto L_0006;
#line 13 "regression-bugs-tmp/itos.imp"
PRINTSYMBOL(32);
#line 13 "regression-bugs-tmp/itos.imp"
P = (((int)(P)) + (1));
#line 13 "regression-bugs-tmp/itos.imp"
L_0006:;
                                                                //     14      %finish
#line 14 "regression-bugs-tmp/itos.imp"
L_0005:;
                                                                //     15      p = -120 %if p<-120
#line 15 "regression-bugs-tmp/itos.imp"
if (((P) >= ((-120)))) goto L_0007;
#line 15 "regression-bugs-tmp/itos.imp"
P = (-120);
#line 15 "regression-bugs-tmp/itos.imp"
L_0007:;
                                                                //     16      q = n//10; *move.l d1,r
#line 16 "regression-bugs-tmp/itos.imp"
Q = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //     17      %if q=0 %start
#line 17 "regression-bugs-tmp/itos.imp"
if (((Q) != (0))) goto L_0008;
                                                                //     18        p = p+1 %if n<0; spaces(-1-p); printsymbol('-') %if n<0
#line 18 "regression-bugs-tmp/itos.imp"
if (((N) >= (0))) goto L_0009;
#line 18 "regression-bugs-tmp/itos.imp"
P = (((int)(P)) + (1));
#line 18 "regression-bugs-tmp/itos.imp"
L_0009:;
#line 18 "regression-bugs-tmp/itos.imp"
SPACES((((int)((-1))) - (P)));
#line 18 "regression-bugs-tmp/itos.imp"
if (((N) >= (0))) goto L_000a;
#line 18 "regression-bugs-tmp/itos.imp"
PRINTSYMBOL(45);
#line 18 "regression-bugs-tmp/itos.imp"
L_000a:;
                                                                //     19      %else
#line 19 "regression-bugs-tmp/itos.imp"
goto L_000b;
#line 19 "regression-bugs-tmp/itos.imp"
L_0008:;
                                                                //     20        p = p+1 %if p<0; write(q,p)
#line 20 "regression-bugs-tmp/itos.imp"
if (((P) >= (0))) goto L_000c;
#line 20 "regression-bugs-tmp/itos.imp"
P = (((int)(P)) + (1));
#line 20 "regression-bugs-tmp/itos.imp"
L_000c:;
#line 20 "regression-bugs-tmp/itos.imp"
WRITE(Q, P);
                                                                //     21      %finish
#line 21 "regression-bugs-tmp/itos.imp"
L_000b:;
                                                                //     22      printsymbol(|r|+'0')
#line 22 "regression-bugs-tmp/itos.imp"
PRINTSYMBOL(((_imp_IMOD(R)) + (48)));
                                                                //     23    %end
#line 23 "regression-bugs-tmp/itos.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block WRITE at level 2
                                                                //     24    store = ""; l == length(store)
#line 24 "regression-bugs-tmp/itos.imp"
STORE = _imp_str_literal("");
#line 24 "regression-bugs-tmp/itos.imp"
L = _imp_LENGTH(&STORE);
                                                                //     25    write(v,p)
#line 25 "regression-bugs-tmp/itos.imp"
WRITE(V, P);
                                                                //     26    %result = store
#line 26 "regression-bugs-tmp/itos.imp"
/* Remove %on %event handler here if present for this block */
return STORE;
                                                                //     27  %end
#line 27 "regression-bugs-tmp/itos.imp"
} // End of block itos at level 1
                                                                //     28  
                                                                //     29  %begin
#line 29 "regression-bugs-tmp/itos.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //     30  %end
#line 30 "regression-bugs-tmp/itos.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
                                                                //     31  
                                                                //     32  %endoffile
#line 32 "regression-bugs-tmp/itos.imp"
// End of file
