#include <perms.h>

                                                                //      1  %externalroutine vax write(%integer n, p)
#line 1 "regression-bugs-tmp/vax-write.imp"
void VAXWRITE( int N, int P )
#line 1 "regression-bugs-tmp/vax-write.imp"
{
                                                                //      2  %string(63)%fn itos(%integer n, p)
#line 2 "regression-bugs-tmp/vax-write.imp"
_imp_string /*%string(63)*/ ITOS( int N, int P )
#line 2 "regression-bugs-tmp/vax-write.imp"
{
                                                                //      3     %string(255) answer
#line 3 "regression-bugs-tmp/vax-write.imp"
_imp_string /*%string(255)*/ ANSWER;
                                                                //      4     %byteintegerarray a(0:64)
#line 4 "regression-bugs-tmp/vax-write.imp"
unsigned char A[65];
                                                                //      5     %integer sign, sym, pt, val
#line 5 "regression-bugs-tmp/vax-write.imp"
int SIGN;
#line 5 "regression-bugs-tmp/vax-write.imp"
int SYM;
#line 5 "regression-bugs-tmp/vax-write.imp"
int PT;
#line 5 "regression-bugs-tmp/vax-write.imp"
int VAL;
                                                                //      6     val = p
#line 6 "regression-bugs-tmp/vax-write.imp"
VAL = P;
                                                                //      7     %if p > 0 %then p = p+1 %else p = -p
#line 7 "regression-bugs-tmp/vax-write.imp"
if (((P) <= (0))) goto L_0002;
#line 7 "regression-bugs-tmp/vax-write.imp"
P = (((int)(P)) + (1));
#line 7 "regression-bugs-tmp/vax-write.imp"
goto L_0003;
#line 7 "regression-bugs-tmp/vax-write.imp"
L_0002:;
#line 7 "regression-bugs-tmp/vax-write.imp"
P = (-(P));
#line 7 "regression-bugs-tmp/vax-write.imp"
L_0003:;
                                                                //      8     p = 63 %if p > 63
#line 8 "regression-bugs-tmp/vax-write.imp"
if (((P) <= (63))) goto L_0004;
#line 8 "regression-bugs-tmp/vax-write.imp"
P = 63;
#line 8 "regression-bugs-tmp/vax-write.imp"
L_0004:;
                                                                //      9     sign = ' '
#line 9 "regression-bugs-tmp/vax-write.imp"
SIGN = 32;
                                                                //     10     sign = 0 %if val <= 0
#line 10 "regression-bugs-tmp/vax-write.imp"
if (((VAL) > (0))) goto L_0005;
#line 10 "regression-bugs-tmp/vax-write.imp"
SIGN = 0;
#line 10 "regression-bugs-tmp/vax-write.imp"
L_0005:;
                                                                //     11     pt = 0
#line 11 "regression-bugs-tmp/vax-write.imp"
PT = 0;
                                                                //     12     %if n < 0 %start
#line 12 "regression-bugs-tmp/vax-write.imp"
if (((N) >= (0))) goto L_0006;
                                                                //     13        sign = '-'
#line 13 "regression-bugs-tmp/vax-write.imp"
SIGN = 45;
                                                                //     14        %if n = 16_80000000 %start
#line 14 "regression-bugs-tmp/vax-write.imp"
if (((N) != ((-2147483648)))) goto L_0007;
                                                                //     15           string(addr(a(pt))) = "8463847412"
#line 15 "regression-bugs-tmp/vax-write.imp"
*_imp_STRING(_imp_ADDR(&A[PT])) = _imp_str_literal("8463847412");
                                                                //     16           pt = pt + 10
#line 16 "regression-bugs-tmp/vax-write.imp"
PT = (((int)(PT)) + (10));
                                                                //     17           -> set
#line 17 "regression-bugs-tmp/vax-write.imp"
goto U_1000;
                                                                //     18           %finish
#line 18 "regression-bugs-tmp/vax-write.imp"
L_0007:;
                                                                //     19        n = -n
#line 19 "regression-bugs-tmp/vax-write.imp"
N = (-(N));
                                                                //     20        %finish
#line 20 "regression-bugs-tmp/vax-write.imp"
L_0006:;
                                                                //     21     %cycle
#line 21 "regression-bugs-tmp/vax-write.imp"
L_0008:;
                                                                //     22        sym = n-n//10*10
#line 22 "regression-bugs-tmp/vax-write.imp"
SYM = ((N) - (((((long)((long)((int)(N)) / (long)((int)(10))))) * (10))));
                                                                //     23        pt = pt+1
#line 23 "regression-bugs-tmp/vax-write.imp"
PT = (((int)(PT)) + (1));
                                                                //     24        a(pt) = sym+'0'
#line 24 "regression-bugs-tmp/vax-write.imp"
A[PT] = (((int)(SYM)) + (48));
                                                                //     25        n = n//10
#line 25 "regression-bugs-tmp/vax-write.imp"
N = (long)((long)((int)(N)) / (long)((int)(10)));
                                                                //     26     %repeat %until n = 0
#line 26 "regression-bugs-tmp/vax-write.imp"
if (((N) == (0))) goto L_0009;
#line 26 "regression-bugs-tmp/vax-write.imp"
goto L_0008;
#line 26 "regression-bugs-tmp/vax-write.imp"
L_0009:;
                                                                //     27    set:
#line 27 "regression-bugs-tmp/vax-write.imp"
U_1000:;
                                                                //     28     %if sign # 0 %start
#line 28 "regression-bugs-tmp/vax-write.imp"
if (((SIGN) == (0))) goto L_000b;
                                                                //     29        pt = pt+1;  a(pt) = sign
#line 29 "regression-bugs-tmp/vax-write.imp"
PT = (((int)(PT)) + (1));
#line 29 "regression-bugs-tmp/vax-write.imp"
A[PT] = SIGN;
                                                                //     30     %finish
#line 30 "regression-bugs-tmp/vax-write.imp"
L_000b:;
                                                                //     31     %while pt < p %cycle
#line 31 "regression-bugs-tmp/vax-write.imp"
L_000c:;
#line 31 "regression-bugs-tmp/vax-write.imp"
if (((PT) >= (P))) goto L_000d;
                                                                //     32        pt = pt+1;  a(pt) = ' '
#line 32 "regression-bugs-tmp/vax-write.imp"
PT = (((int)(PT)) + (1));
#line 32 "regression-bugs-tmp/vax-write.imp"
A[PT] = 32;
                                                                //     33     %repeat
#line 33 "regression-bugs-tmp/vax-write.imp"
goto L_000c;
#line 33 "regression-bugs-tmp/vax-write.imp"
L_000d:;
                                                                //     34     answer = ""
#line 34 "regression-bugs-tmp/vax-write.imp"
ANSWER = _imp_str_literal("");
                                                                //     35     %cycle
#line 35 "regression-bugs-tmp/vax-write.imp"
L_000f:;
                                                                //     36        answer = answer.tostring(a(pt))
#line 36 "regression-bugs-tmp/vax-write.imp"
ANSWER = _imp_join((_imp_string)ANSWER,(_imp_string)_imp_TOSTRING(A[PT]));
                                                                //     37        pt = pt-1
#line 37 "regression-bugs-tmp/vax-write.imp"
PT = (((int)(PT)) - (1));
                                                                //     38     %repeat %until pt = 0
#line 38 "regression-bugs-tmp/vax-write.imp"
if (((PT) == (0))) goto L_0010;
#line 38 "regression-bugs-tmp/vax-write.imp"
goto L_000f;
#line 38 "regression-bugs-tmp/vax-write.imp"
L_0010:;
                                                                //     39     %result = answer
#line 39 "regression-bugs-tmp/vax-write.imp"
/* Remove %on %event handler here if present for this block */
return ANSWER;
                                                                //     40  %end
#line 40 "regression-bugs-tmp/vax-write.imp"
} // End of block ITOS at level 2
                                                                //     41     space %and p = p-1 %while p > 62
#line 41 "regression-bugs-tmp/vax-write.imp"
L_0012:;
#line 41 "regression-bugs-tmp/vax-write.imp"
if (((P) <= (62))) goto L_0013;
#line 41 "regression-bugs-tmp/vax-write.imp"
_imp_SPACE();
#line 41 "regression-bugs-tmp/vax-write.imp"
P = (((int)(P)) - (1));
#line 41 "regression-bugs-tmp/vax-write.imp"
goto L_0012;
#line 41 "regression-bugs-tmp/vax-write.imp"
L_0013:;
                                                                //     42     printstring(itos(n, p))
#line 42 "regression-bugs-tmp/vax-write.imp"
_imp_PRINTSTRING(ITOS(N, P));
                                                                //     43  %end
#line 43 "regression-bugs-tmp/vax-write.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block VAXWRITE at level 1
                                                                //     44  
                                                                //     45  %endoffile
#line 45 "regression-bugs-tmp/vax-write.imp"
// End of file
