#include <perms.h>

                                                                //      1  %EXTERNALROUTINE DRAUGHTS(%STRING(12) S)
#line 1 "regression-bugs-tmp/draft4.imp"
void DRAUGHTS( _imp_string /*%string(12)*/ S )
#line 1 "regression-bugs-tmp/draft4.imp"
{
                                                                //      2  !%EXTERNALROUTINESPEC CPULIMIT (%STRING(255) S)
                                                                //      3  !%EXTERNALROUTINESPEC PROMPT(%STRING(15) S)
                                                                //      4  %OWNINTEGER MOB WT = 6
#line 4 "regression-bugs-tmp/draft4.imp"
static int MOBWT = 6;
                                                                //      5  %CONSTINTEGER TRUE =1, FALSE = 0
                                                                //      6  
                                                                //      7  %OWNINTEGER BACK WT = 4
#line 7 "regression-bugs-tmp/draft4.imp"
static int BACKWT = 4;
                                                                //      8  %OWNINTEGER CENT WT = 4
#line 8 "regression-bugs-tmp/draft4.imp"
static int CENTWT = 4;
                                                                //      9  %OWNINTEGER ADV1 WT = 450
#line 9 "regression-bugs-tmp/draft4.imp"
static int ADV1WT = 450;
                                                                //     10  %OWNINTEGER ADV2 WT = 50
#line 10 "regression-bugs-tmp/draft4.imp"
static int ADV2WT = 50;
                                                                //     11  %OWNINTEGER CRAMP WT = 6
#line 11 "regression-bugs-tmp/draft4.imp"
static int CRAMPWT = 6;
                                                                //     12  %OWNINTEGER MON = 'Q'
#line 12 "regression-bugs-tmp/draft4.imp"
static int MON = 81;
                                                                //     13  %OWNINTEGER A WIN = 0
#line 13 "regression-bugs-tmp/draft4.imp"
static int AWIN = 0;
                                                                //     14  %OWNINTEGER SEARCH LIMIT = 3
#line 14 "regression-bugs-tmp/draft4.imp"
static int SEARCHLIMIT = 3;
                                                                //     15  %OWNINTEGER CROWN = 1800
#line 15 "regression-bugs-tmp/draft4.imp"
static int CROWN = 1800;
                                                                //     16  %OWNINTEGERARRAY BACK1(1:5) = 77, 75, 73, 71, 64
#line 16 "regression-bugs-tmp/draft4.imp"
static int BACK1[5] = { 77, 75, 73, 71, 64,  };
                                                                //     17  %OWNINTEGERARRAY BACK2(1:5) =  0,  2,  4,  6, 13
#line 17 "regression-bugs-tmp/draft4.imp"
static int BACK2[5] = { 0, 2, 4, 6, 13,  };
                                                                //     18  %OWNINTEGERARRAY CENTSQ(0:7) = 51, 53, 42, 44, 33, 35, 24, 26
#line 18 "regression-bugs-tmp/draft4.imp"
static int CENTSQ[8] = { 51, 53, 42, 44, 33, 35, 24, 26,  };
                                                                //     19  %OWNINTEGERARRAY MOVE(0:7) =  9, 18, 11, 22, -9,-18,-11,-22
#line 19 "regression-bugs-tmp/draft4.imp"
static int MOVE[8] = { 9, 18, 11, 22, (-9), (-18), (-11), (-22),  };
                                                                //     20  %OWNINTEGERARRAY PLAYER1(-1:26) =     'W',    1,
#line 20 "regression-bugs-tmp/draft4.imp"
static int PLAYER1[28] = { 87, 1, 77, 75, 73, 71, 64, 66, 62, 60, 57, 55, 53, 51, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 12, 0,  };
                                                                //     21     77,   75,   73,   71,   64,   66,   62,   60,   57,   55,   53,   51,
                                                                //     22   1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
                                                                //     23     12,    0
                                                                //     24  %OWNINTEGERARRAY PLAYER2(-1:26) =     'B',    2,
#line 24 "regression-bugs-tmp/draft4.imp"
static int PLAYER2[28] = { 66, 2, 0, 2, 4, 6, 13, 11, 15, 17, 20, 22, 24, 26, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 12, 0,  };
                                                                //     25      0,    2,    4,    6,   13,   11,   15,   17,   20,   22,   24,   26,
                                                                //     26   1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000,
                                                                //     27     12,    0
                                                                //     28  %OWNINTEGERARRAY BOARD(-1:78) = %C
#line 28 "regression-bugs-tmp/draft4.imp"
static int BOARD[80] = { [0 ... 79] = 32 };
                                                                //     29    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     30    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     31    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     32    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     33    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     34    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     35    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
                                                                //     36    ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
                                                                //     37  ! This program compiles and runs under i2c if the following auto arrays are converted into own arrays.
                                                                //     38  ! As soon as auto arrays are handled properly this program should run without modification.
                                                                //     39  %INTEGERARRAY MIN(1:12)
#line 39 "regression-bugs-tmp/draft4.imp"
int MIN[12];
                                                                //     40  %INTEGERARRAY MAX(1:12)
#line 40 "regression-bugs-tmp/draft4.imp"
int MAX[12];
                                                                //     41  %INTEGERARRAY REPLY(1:9)
#line 41 "regression-bugs-tmp/draft4.imp"
int REPLY[9];
                                                                //     42  %INTEGERARRAY COMP(-1:26)
#line 42 "regression-bugs-tmp/draft4.imp"
int COMP[28];
                                                                //     43  %INTEGERARRAY OPP(-1:26)
#line 43 "regression-bugs-tmp/draft4.imp"
int OPP[28];
                                                                //     44  %INTEGERNAME COMPNUM, OPPNUM
#line 44 "regression-bugs-tmp/draft4.imp"
int /*name*/*COMPNUM;
#line 44 "regression-bugs-tmp/draft4.imp"
int /*name*/*OPPNUM;
                                                                //     45  %INTEGERARRAY PSTACK(1:12);            ! piece position take stack
#line 45 "regression-bugs-tmp/draft4.imp"
int PSTACK[12];
                                                                //     46  %INTEGERARRAY TSTACK(1:12);            ! piece type stack
#line 46 "regression-bugs-tmp/draft4.imp"
int TSTACK[12];
                                                                //     47  %INTEGERARRAY NSTACK(1:12);            ! piece number stack
#line 47 "regression-bugs-tmp/draft4.imp"
int NSTACK[12];
                                                                //     48  %OWNINTEGER SP;                        ! stack pointer
#line 48 "regression-bugs-tmp/draft4.imp"
static int SP;
                                                                //     49  %OWNINTEGER ME = 1
#line 49 "regression-bugs-tmp/draft4.imp"
static int ME = 1;
                                                                //     50  %OWNINTEGER ONE = 1
#line 50 "regression-bugs-tmp/draft4.imp"
static int ONE = 1;
                                                                //     51  %OWNINTEGER TWO = 2
#line 51 "regression-bugs-tmp/draft4.imp"
static int TWO = 2;
                                                                //     52  %OWNINTEGER THREE = 3
#line 52 "regression-bugs-tmp/draft4.imp"
static int THREE = 3;
                                                                //     53  %INTEGER BEST PIECE, BEST MOVE, BEST TAKE
#line 53 "regression-bugs-tmp/draft4.imp"
int BESTPIECE;
#line 53 "regression-bugs-tmp/draft4.imp"
int BESTMOVE;
#line 53 "regression-bugs-tmp/draft4.imp"
int BESTTAKE;
                                                                //     54  %INTEGER VALUEB, I, P, M, PIECE, JMAN, JUMP, DIF, MODIF, MORE
#line 54 "regression-bugs-tmp/draft4.imp"
int VALUEB;
#line 54 "regression-bugs-tmp/draft4.imp"
int I;
#line 54 "regression-bugs-tmp/draft4.imp"
int P;
#line 54 "regression-bugs-tmp/draft4.imp"
int M;
#line 54 "regression-bugs-tmp/draft4.imp"
int PIECE;
#line 54 "regression-bugs-tmp/draft4.imp"
int JMAN;
#line 54 "regression-bugs-tmp/draft4.imp"
int JUMP;
#line 54 "regression-bugs-tmp/draft4.imp"
int DIF;
#line 54 "regression-bugs-tmp/draft4.imp"
int MODIF;
#line 54 "regression-bugs-tmp/draft4.imp"
int MORE;
                                                                //     55  %INTEGER OLDPOS, NEWPOS, LASTPOS, COMPOS
#line 55 "regression-bugs-tmp/draft4.imp"
int OLDPOS;
#line 55 "regression-bugs-tmp/draft4.imp"
int NEWPOS;
#line 55 "regression-bugs-tmp/draft4.imp"
int LASTPOS;
#line 55 "regression-bugs-tmp/draft4.imp"
int COMPOS;
                                                                //     56  %INTEGER NODES, PLY NUMBER, EXPECTED MOVE
#line 56 "regression-bugs-tmp/draft4.imp"
int NODES;
#line 56 "regression-bugs-tmp/draft4.imp"
int PLYNUMBER;
#line 56 "regression-bugs-tmp/draft4.imp"
int EXPECTEDMOVE;
                                                                //     57  %INTEGER A,B,C,POS
#line 57 "regression-bugs-tmp/draft4.imp"
int A;
#line 57 "regression-bugs-tmp/draft4.imp"
int B;
#line 57 "regression-bugs-tmp/draft4.imp"
int C;
#line 57 "regression-bugs-tmp/draft4.imp"
int POS;
                                                                //     58  
                                                                //     59  !*   P L A Y I N G   F U N C T I O N S
                                                                //     60  
                                                                //     61     %INTEGERFN VALID POS(%INTEGER POS)
#line 61 "regression-bugs-tmp/draft4.imp"
int VALIDPOS( int POS )
#line 61 "regression-bugs-tmp/draft4.imp"
{
                                                                //     62     %INTEGER I
#line 62 "regression-bugs-tmp/draft4.imp"
int I;
                                                                //     63        ! on the board?
                                                                //     64        I = POS>>1
#line 64 "regression-bugs-tmp/draft4.imp"
I = (int)((((unsigned int)(POS)) >> (1)));
                                                                //     65        %RESULT = -1 %IF POS < 0 %OR POS > 77 %C
#line 65 "regression-bugs-tmp/draft4.imp"
if (((POS) < (0))) goto L_0002;
#line 65 "regression-bugs-tmp/draft4.imp"
if (((POS) > (77))) goto L_0002;
#line 65 "regression-bugs-tmp/draft4.imp"
if (((I) == (4))) goto L_0002;
#line 65 "regression-bugs-tmp/draft4.imp"
if (((I) == (14))) goto L_0002;
#line 65 "regression-bugs-tmp/draft4.imp"
if (((I) == (24))) goto L_0002;
#line 65 "regression-bugs-tmp/draft4.imp"
if (((I) != (34))) goto L_0003;
#line 65 "regression-bugs-tmp/draft4.imp"
L_0002:;
#line 65 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
#line 65 "regression-bugs-tmp/draft4.imp"
L_0003:;
                                                                //     66                     %OR I = 4 %OR I = 14 %OR I = 24 %OR I = 34
                                                                //     67        ! square vacant?
                                                                //     68        %CYCLE I = 1, 1, 12
#line 68 "regression-bugs-tmp/draft4.imp"
I = 0;
if ((((12)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 12");
L_0004:;
if (I == 12) goto L_0005;
I += 1;
                                                                //     69           %RESULT = 1 %IF (I <= COMPNUM %AND POS = COMP(I)) %C
#line 69 "regression-bugs-tmp/draft4.imp"
if (((I) > (*COMPNUM))) goto L_0007;
#line 69 "regression-bugs-tmp/draft4.imp"
if (((POS) == (COMP[((I) + ((int)(1)))]))) goto L_0008;
#line 69 "regression-bugs-tmp/draft4.imp"
L_0007:;
#line 69 "regression-bugs-tmp/draft4.imp"
if (((I) > (*OPPNUM))) goto L_0009;
#line 69 "regression-bugs-tmp/draft4.imp"
if (((POS) != (OPP[((I) + ((int)(1)))]))) goto L_0009;
#line 69 "regression-bugs-tmp/draft4.imp"
L_0008:;
#line 69 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 1;
#line 69 "regression-bugs-tmp/draft4.imp"
L_0009:;
                                                                //     70                       %OR (I <= OPPNUM %AND POS = OPP(I))
                                                                //     71        %REPEAT
#line 71 "regression-bugs-tmp/draft4.imp"
goto L_0004;
#line 71 "regression-bugs-tmp/draft4.imp"
L_0005:;
                                                                //     72        %RESULT = 0
#line 72 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 0;
                                                                //     73     %END
#line 73 "regression-bugs-tmp/draft4.imp"
} // End of block VALIDPOS at level 2
                                                                //     74  
                                                                //     75     %INTEGERFN VALID MOVE(%INTEGER M, P, %INTEGERARRAYNAME COMP, OPP)
#line 75 "regression-bugs-tmp/draft4.imp"
int VALIDMOVE( int M, int P, int /*arrayname*/*COMP, int /*arrayname*/*OPP )
#line 75 "regression-bugs-tmp/draft4.imp"
{
                                                                //     76        %INTEGER CPOS, I, T
#line 76 "regression-bugs-tmp/draft4.imp"
int CPOS;
#line 76 "regression-bugs-tmp/draft4.imp"
int I;
#line 76 "regression-bugs-tmp/draft4.imp"
int T;
                                                                //     77        %UNLESS COMP(P+12) = CROWN %START
#line 77 "regression-bugs-tmp/draft4.imp"
if (((COMP[(((int)(P)) + (12))]) == (CROWN))) goto L_000a;
                                                                //     78           %IF COMP(0) = 1 %START;       ! player 1
#line 78 "regression-bugs-tmp/draft4.imp"
if (((COMP[0]) != (1))) goto L_000b;
                                                                //     79              %RESULT = -1 %IF M&4 = 0;  ! backward move
#line 79 "regression-bugs-tmp/draft4.imp"
if (((((M) & (4))) != (0))) goto L_000c;
#line 79 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
#line 79 "regression-bugs-tmp/draft4.imp"
L_000c:;
                                                                //     80           %FINISH %ELSE %START;         ! else player 2
#line 80 "regression-bugs-tmp/draft4.imp"
goto L_000d;
#line 80 "regression-bugs-tmp/draft4.imp"
L_000b:;
                                                                //     81              %RESULT = -1 %IF M&4 # 0;  ! backward move
#line 81 "regression-bugs-tmp/draft4.imp"
if (((((M) & (4))) == (0))) goto L_000e;
#line 81 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
#line 81 "regression-bugs-tmp/draft4.imp"
L_000e:;
                                                                //     82           %FINISH
#line 82 "regression-bugs-tmp/draft4.imp"
L_000d:;
                                                                //     83        %FINISH
#line 83 "regression-bugs-tmp/draft4.imp"
L_000a:;
                                                                //     84        CPOS = COMP(P)
#line 84 "regression-bugs-tmp/draft4.imp"
CPOS = COMP[P];
                                                                //     85        %RESULT = -1 %UNLESS VALID POS(CPOS+MOVE(M)) = 0
#line 85 "regression-bugs-tmp/draft4.imp"
if (((VALIDPOS((((int)(CPOS)) + (MOVE[M])))) == (0))) goto L_000f;
#line 85 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
#line 85 "regression-bugs-tmp/draft4.imp"
L_000f:;
                                                                //     86        %RESULT = 0 %IF M&1 = 0;         ! ordinary move
#line 86 "regression-bugs-tmp/draft4.imp"
if (((((M) & (1))) != (0))) goto L_0010;
#line 86 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 0;
#line 86 "regression-bugs-tmp/draft4.imp"
L_0010:;
                                                                //     87        %RESULT = -1 %IF OPP(25)=0
#line 87 "regression-bugs-tmp/draft4.imp"
if (((OPP[25]) != (0))) goto L_0011;
#line 87 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
#line 87 "regression-bugs-tmp/draft4.imp"
L_0011:;
                                                                //     88        I = CPOS+MOVE(M-1);              !  else take-move
#line 88 "regression-bugs-tmp/draft4.imp"
I = (((int)(CPOS)) + (MOVE[(((int)(M)) - (1))]));
                                                                //     89        %CYCLE T = 1, 1, OPP(25)
#line 89 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = OPP[25]; T = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle T = 1, 1, OPP[25]");
T -= _increment; _control -= _increment;
L_0012:;
if (T == _final) goto L_0013;
T += _increment; _control += _increment;
if (T != _control) _imp_signal(4,2,0,"Corrupt control variable T"); /* FOR loop control variable corrupted */
}
                                                                //     90           %RESULT = T %IF I = OPP(T);   ! piece to take?
#line 90 "regression-bugs-tmp/draft4.imp"
if (((I) != (OPP[T]))) goto L_0015;
#line 90 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return T;
#line 90 "regression-bugs-tmp/draft4.imp"
L_0015:;
                                                                //     91        %REPEAT
#line 91 "regression-bugs-tmp/draft4.imp"
goto L_0012;
#line 91 "regression-bugs-tmp/draft4.imp"
L_0013:;
                                                                //     92        %RESULT = -1
#line 92 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
                                                                //     93     %END
#line 93 "regression-bugs-tmp/draft4.imp"
} // End of block VALIDMOVE at level 2
                                                                //     94  
                                                                //     95     %INTEGERFN PENDING MOVE(%INTEGERARRAYNAME COMP, OPP)
#line 95 "regression-bugs-tmp/draft4.imp"
int PENDINGMOVE( int /*arrayname*/*COMP, int /*arrayname*/*OPP )
#line 95 "regression-bugs-tmp/draft4.imp"
{
                                                                //     96     %INTEGER P, M, T, COMPNUM
#line 96 "regression-bugs-tmp/draft4.imp"
int P;
#line 96 "regression-bugs-tmp/draft4.imp"
int M;
#line 96 "regression-bugs-tmp/draft4.imp"
int T;
#line 96 "regression-bugs-tmp/draft4.imp"
int COMPNUM;
                                                                //     97        COMPNUM = COMP(25)
#line 97 "regression-bugs-tmp/draft4.imp"
COMPNUM = COMP[25];
                                                                //     98        %RESULT = -1 %IF COMPNUM = 0;    ! no pieces left!!
#line 98 "regression-bugs-tmp/draft4.imp"
if (((COMPNUM) != (0))) goto L_0016;
#line 98 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
#line 98 "regression-bugs-tmp/draft4.imp"
L_0016:;
                                                                //     99        %CYCLE P = 1, 1, COMPNUM
#line 99 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = COMPNUM; P = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, COMPNUM");
P -= _increment; _control -= _increment;
L_0017:;
if (P == _final) goto L_0018;
P += _increment; _control += _increment;
if (P != _control) _imp_signal(4,2,0,"Corrupt control variable P"); /* FOR loop control variable corrupted */
}
                                                                //    100           %CYCLE M = 1, 2, 7
#line 100 "regression-bugs-tmp/draft4.imp"
M = (-1);
if ((((7)-(1)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle M = 1, 2, 7");
L_001a:;
if (M == 7) goto L_001b;
M += 2;
                                                                //    101              T = VALID MOVE(M, P, COMP, OPP)
#line 101 "regression-bugs-tmp/draft4.imp"
T = VALIDMOVE(M, P, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    102              %RESULT = P %IF T > 0;     ! return piece doing take
#line 102 "regression-bugs-tmp/draft4.imp"
if (((T) <= (0))) goto L_001d;
#line 102 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return P;
#line 102 "regression-bugs-tmp/draft4.imp"
L_001d:;
                                                                //    103           %REPEAT
#line 103 "regression-bugs-tmp/draft4.imp"
goto L_001a;
#line 103 "regression-bugs-tmp/draft4.imp"
L_001b:;
                                                                //    104        %REPEAT
#line 104 "regression-bugs-tmp/draft4.imp"
goto L_0017;
#line 104 "regression-bugs-tmp/draft4.imp"
L_0018:;
                                                                //    105        ! ordinary moves
                                                                //    106        %CYCLE P = 1, 1, COMPNUM
#line 106 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = COMPNUM; P = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, COMPNUM");
P -= _increment; _control -= _increment;
L_001e:;
if (P == _final) goto L_001f;
P += _increment; _control += _increment;
if (P != _control) _imp_signal(4,2,0,"Corrupt control variable P"); /* FOR loop control variable corrupted */
}
                                                                //    107           %CYCLE M = 0, 2, 6
#line 107 "regression-bugs-tmp/draft4.imp"
M = (-2);
if ((((6)-(0)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle M = 0, 2, 6");
L_0021:;
if (M == 6) goto L_0022;
M += 2;
                                                                //    108              T = VALID MOVE(M, P, COMP, OPP)
#line 108 "regression-bugs-tmp/draft4.imp"
T = VALIDMOVE(M, P, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    109              %RESULT = 0 %IF T = 0;     ! move ok
#line 109 "regression-bugs-tmp/draft4.imp"
if (((T) != (0))) goto L_0024;
#line 109 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 0;
#line 109 "regression-bugs-tmp/draft4.imp"
L_0024:;
                                                                //    110           %REPEAT
#line 110 "regression-bugs-tmp/draft4.imp"
goto L_0021;
#line 110 "regression-bugs-tmp/draft4.imp"
L_0022:;
                                                                //    111        %REPEAT
#line 111 "regression-bugs-tmp/draft4.imp"
goto L_001e;
#line 111 "regression-bugs-tmp/draft4.imp"
L_001f:;
                                                                //    112        %RESULT = -1;                   ! no moves
#line 112 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-1);
                                                                //    113     %END
#line 113 "regression-bugs-tmp/draft4.imp"
} // End of block PENDINGMOVE at level 2
                                                                //    114  
                                                                //    115     %INTEGERFN CROWNING(%INTEGER POS, PLAYER)
#line 115 "regression-bugs-tmp/draft4.imp"
int CROWNING( int POS, int PLAYER )
#line 115 "regression-bugs-tmp/draft4.imp"
{
                                                                //    116        ! assumes valid pos
                                                                //    117        %RESULT=TRUE %IF (PLAYER = 1 %AND POS < 7) %C
#line 117 "regression-bugs-tmp/draft4.imp"
if (((PLAYER) != (1))) goto L_0025;
#line 117 "regression-bugs-tmp/draft4.imp"
if (((POS) < (7))) goto L_0020;
#line 117 "regression-bugs-tmp/draft4.imp"
L_0025:;
#line 117 "regression-bugs-tmp/draft4.imp"
if (((PLAYER) != (2))) goto L_0026;
#line 117 "regression-bugs-tmp/draft4.imp"
if (((POS) <= (70))) goto L_0026;
#line 117 "regression-bugs-tmp/draft4.imp"
L_0020:;
#line 117 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 1;
#line 117 "regression-bugs-tmp/draft4.imp"
L_0026:;
                                                                //    118              %OR (PLAYER = 2 %AND POS > 70)
                                                                //    119        %RESULT=FALSE
#line 119 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 0;
                                                                //    120     %END
#line 120 "regression-bugs-tmp/draft4.imp"
} // End of block CROWNING at level 2
                                                                //    121  
                                                                //    122     %INTEGERFN MOD(%INTEGER N)
#line 122 "regression-bugs-tmp/draft4.imp"
int MOD( int N )
#line 122 "regression-bugs-tmp/draft4.imp"
{
                                                                //    123  
                                                                //    124        %RESULT = -N %IF N<0
#line 124 "regression-bugs-tmp/draft4.imp"
if (((N) >= (0))) goto L_0027;
#line 124 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-(N));
#line 124 "regression-bugs-tmp/draft4.imp"
L_0027:;
                                                                //    125        %RESULT = N
#line 125 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return N;
                                                                //    126  
                                                                //    127     %END
#line 127 "regression-bugs-tmp/draft4.imp"
} // End of block MOD at level 2
                                                                //    128  
                                                                //    129     %INTEGERFN VALUE OF SIDE(%INTEGERARRAYNAME COMP, OPP)
#line 129 "regression-bugs-tmp/draft4.imp"
int VALUEOFSIDE( int /*arrayname*/*COMP, int /*arrayname*/*OPP )
#line 129 "regression-bugs-tmp/draft4.imp"
{
                                                                //    130     %INTEGER V1, V2, V3, V4, V5, V6, V7
#line 130 "regression-bugs-tmp/draft4.imp"
int V1;
#line 130 "regression-bugs-tmp/draft4.imp"
int V2;
#line 130 "regression-bugs-tmp/draft4.imp"
int V3;
#line 130 "regression-bugs-tmp/draft4.imp"
int V4;
#line 130 "regression-bugs-tmp/draft4.imp"
int V5;
#line 130 "regression-bugs-tmp/draft4.imp"
int V6;
#line 130 "regression-bugs-tmp/draft4.imp"
int V7;
                                                                //    131     %INTEGER P, PP, M, MM, MV, ADV1, VM, PLAYER
#line 131 "regression-bugs-tmp/draft4.imp"
int P;
#line 131 "regression-bugs-tmp/draft4.imp"
int PP;
#line 131 "regression-bugs-tmp/draft4.imp"
int M;
#line 131 "regression-bugs-tmp/draft4.imp"
int MM;
#line 131 "regression-bugs-tmp/draft4.imp"
int MV;
#line 131 "regression-bugs-tmp/draft4.imp"
int ADV1;
#line 131 "regression-bugs-tmp/draft4.imp"
int VM;
#line 131 "regression-bugs-tmp/draft4.imp"
int PLAYER;
                                                                //    132     %INTEGERNAME CPOS, CTYPE
#line 132 "regression-bugs-tmp/draft4.imp"
int /*name*/*CPOS;
#line 132 "regression-bugs-tmp/draft4.imp"
int /*name*/*CTYPE;
                                                                //    133        PLAYER = COMP(0)
#line 133 "regression-bugs-tmp/draft4.imp"
PLAYER = COMP[0];
                                                                //    134  
                                                                //    135        ! back control
                                                                //    136        V2 = 0
#line 136 "regression-bugs-tmp/draft4.imp"
V2 = 0;
                                                                //    137        %IF OPP(26) = 0 %START;          ! OPP has no crowns yet
#line 137 "regression-bugs-tmp/draft4.imp"
if (((OPP[26]) != (0))) goto L_0028;
                                                                //    138           %IF PLAYER = 1 %START;        ! player 1
#line 138 "regression-bugs-tmp/draft4.imp"
if (((PLAYER) != (1))) goto L_0029;
                                                                //    139              %CYCLE P = 1, 1, 5
#line 139 "regression-bugs-tmp/draft4.imp"
P = 0;
if ((((5)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, 5");
L_002a:;
if (P == 5) goto L_002b;
P += 1;
                                                                //    140                 V2 = V2+BACK WT %IF COMP(P) = BACK1(P)
#line 140 "regression-bugs-tmp/draft4.imp"
if (((COMP[P]) != ((BACK1-1)[P]))) goto L_002d;
#line 140 "regression-bugs-tmp/draft4.imp"
V2 = (((int)(V2)) + (BACKWT));
#line 140 "regression-bugs-tmp/draft4.imp"
L_002d:;
                                                                //    141              %REPEAT
#line 141 "regression-bugs-tmp/draft4.imp"
goto L_002a;
#line 141 "regression-bugs-tmp/draft4.imp"
L_002b:;
                                                                //    142           %FINISH %ELSE %START;         ! player 2
#line 142 "regression-bugs-tmp/draft4.imp"
goto L_002e;
#line 142 "regression-bugs-tmp/draft4.imp"
L_0029:;
                                                                //    143              %CYCLE P = 1, 1, 5
#line 143 "regression-bugs-tmp/draft4.imp"
P = 0;
if ((((5)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, 5");
L_002f:;
if (P == 5) goto L_0030;
P += 1;
                                                                //    144                 V2 = V2+BACK WT %IF COMP(P) = BACK2(P)
#line 144 "regression-bugs-tmp/draft4.imp"
if (((COMP[P]) != ((BACK2-1)[P]))) goto L_0032;
#line 144 "regression-bugs-tmp/draft4.imp"
V2 = (((int)(V2)) + (BACKWT));
#line 144 "regression-bugs-tmp/draft4.imp"
L_0032:;
                                                                //    145              %REPEAT
#line 145 "regression-bugs-tmp/draft4.imp"
goto L_002f;
#line 145 "regression-bugs-tmp/draft4.imp"
L_0030:;
                                                                //    146           %FINISH
#line 146 "regression-bugs-tmp/draft4.imp"
L_002e:;
                                                                //    147        %FINISH
#line 147 "regression-bugs-tmp/draft4.imp"
L_0028:;
                                                                //    148  
                                                                //    149        V1 = 0;  V3 = 0;  V4 = 0;  V5 = 0;  V6 = 0;  V7 = 0
#line 149 "regression-bugs-tmp/draft4.imp"
V1 = 0;
#line 149 "regression-bugs-tmp/draft4.imp"
V3 = 0;
#line 149 "regression-bugs-tmp/draft4.imp"
V4 = 0;
#line 149 "regression-bugs-tmp/draft4.imp"
V5 = 0;
#line 149 "regression-bugs-tmp/draft4.imp"
V6 = 0;
#line 149 "regression-bugs-tmp/draft4.imp"
V7 = 0;
                                                                //    150        %CYCLE P = 1, 1, COMP(25)
#line 150 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = COMP[25]; P = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, COMP[25]");
P -= _increment; _control -= _increment;
L_0033:;
if (P == _final) goto L_0034;
P += _increment; _control += _increment;
if (P != _control) _imp_signal(4,2,0,"Corrupt control variable P"); /* FOR loop control variable corrupted */
}
                                                                //    151           CPOS ==COMP(P);  CTYPE ==  COMP(P+12)
#line 151 "regression-bugs-tmp/draft4.imp"
CPOS = &COMP[P];
#line 151 "regression-bugs-tmp/draft4.imp"
CTYPE = &COMP[(((int)(P)) + (12))];
                                                                //    152           ADV1 = 0
#line 152 "regression-bugs-tmp/draft4.imp"
ADV1 = 0;
                                                                //    153  
                                                                //    154           ! add up piece values
                                                                //    155           V1 = V1+CTYPE
#line 155 "regression-bugs-tmp/draft4.imp"
V1 = (((int)(V1)) + (*CTYPE));
                                                                //    156  
                                                                //    157           %CYCLE M = 0, 1, 7
#line 157 "regression-bugs-tmp/draft4.imp"
M = (-1);
if ((((7)-(0)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle M = 0, 1, 7");
L_0036:;
if (M == 7) goto L_0037;
M += 1;
                                                                //    158              VM = VALID MOVE(M, P, COMP, OPP)
#line 158 "regression-bugs-tmp/draft4.imp"
VM = VALIDMOVE(M, P, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    159              MV = MOVE(M)
#line 159 "regression-bugs-tmp/draft4.imp"
MV = MOVE[M];
                                                                //    160  
                                                                //    161              ! centre control
                                                                //    162              %IF CPOS = CENTSQ(M) %START
#line 162 "regression-bugs-tmp/draft4.imp"
if (((*CPOS) != (CENTSQ[M]))) goto L_0039;
                                                                //    163                 V4 = V4+CENT WT
#line 163 "regression-bugs-tmp/draft4.imp"
V4 = (((int)(V4)) + (CENTWT));
                                                                //    164                 V4 = V4+CENT WT+1 %IF CTYPE = CROWN
#line 164 "regression-bugs-tmp/draft4.imp"
if (((*CTYPE) != (CROWN))) goto L_003a;
#line 164 "regression-bugs-tmp/draft4.imp"
V4 = (((int)((((int)(V4)) + (CENTWT)))) + (1));
#line 164 "regression-bugs-tmp/draft4.imp"
L_003a:;
                                                                //    165              %FINISH
#line 165 "regression-bugs-tmp/draft4.imp"
L_0039:;
                                                                //    166  
                                                                //    167              %IF VM >= 0 %START
#line 167 "regression-bugs-tmp/draft4.imp"
if (((VM) < (0))) goto L_003b;
                                                                //    168  
                                                                //    169                 ! mobility
                                                                //    170                 V3 = V3+MOB WT
#line 170 "regression-bugs-tmp/draft4.imp"
V3 = (((int)(V3)) + (MOBWT));
                                                                //    171                 V3 = V3+MOB WT %IF VM > 0
#line 171 "regression-bugs-tmp/draft4.imp"
if (((VM) <= (0))) goto L_003c;
#line 171 "regression-bugs-tmp/draft4.imp"
V3 = (((int)(V3)) + (MOBWT));
#line 171 "regression-bugs-tmp/draft4.imp"
L_003c:;
                                                                //    172  
                                                                //    173                 %IF CTYPE # CROWN %START
#line 173 "regression-bugs-tmp/draft4.imp"
if (((*CTYPE) == (CROWN))) goto L_003d;
                                                                //    174  
                                                                //    175                    ! advancement 1
                                                                //    176                    %IF ADV1 = 0 %AND TRUE=CROWNING(CPOS+MV, PLAYER) %THEN %C
#line 176 "regression-bugs-tmp/draft4.imp"
if (((ADV1) != (0))) goto L_003e;
#line 176 "regression-bugs-tmp/draft4.imp"
if (((1) != (CROWNING(((*(int *)(CPOS)) + (MV)), PLAYER)))) goto L_003e;
#line 176 "regression-bugs-tmp/draft4.imp"
V5 = (((int)(V5)) + (ADV1WT));
#line 176 "regression-bugs-tmp/draft4.imp"
ADV1 = 1;
#line 176 "regression-bugs-tmp/draft4.imp"
L_003e:;
                                                                //    177                     V5 = V5+ADV1 WT %AND ADV1 = 1
                                                                //    178  
                                                                //    179                    ! advancement 2
                                                                //    180                    %IF VM = 0 %START;   ! ignore jumps to crown
#line 180 "regression-bugs-tmp/draft4.imp"
if (((VM) != (0))) goto L_003f;
                                                                //    181                       CPOS = CPOS+MV
#line 181 "regression-bugs-tmp/draft4.imp"
*CPOS = ((*(int *)(CPOS)) + (MV));
                                                                //    182                       %CYCLE MM = 0, 2, 6
#line 182 "regression-bugs-tmp/draft4.imp"
MM = (-2);
if ((((6)-(0)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle MM = 0, 2, 6");
L_0040:;
if (MM == 6) goto L_0041;
MM += 2;
                                                                //    183                          %IF TRUE=CROWNING(CPOS+MOVE(MM), PLAYER) %C
#line 183 "regression-bugs-tmp/draft4.imp"
if (((1) != (CROWNING(((*(int *)(CPOS)) + (MOVE[MM])), PLAYER)))) goto L_0043;
#line 183 "regression-bugs-tmp/draft4.imp"
if (((VALIDMOVE(MM, P, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0])) < (0))) goto L_0043;
                                                                //    184                           %AND VALID MOVE(MM, P, COMP, OPP) >= 0 %START
                                                                //    185                             V6 = V6+ADV2 WT;  %EXIT
#line 185 "regression-bugs-tmp/draft4.imp"
V6 = (((int)(V6)) + (ADV2WT));
#line 185 "regression-bugs-tmp/draft4.imp"
goto L_0041;
                                                                //    186                          %FINISH
#line 186 "regression-bugs-tmp/draft4.imp"
L_0043:;
                                                                //    187                       %REPEAT
#line 187 "regression-bugs-tmp/draft4.imp"
goto L_0040;
#line 187 "regression-bugs-tmp/draft4.imp"
L_0041:;
                                                                //    188                       CPOS = CPOS-MV
#line 188 "regression-bugs-tmp/draft4.imp"
*CPOS = ((*(int *)(CPOS)) - (MV));
                                                                //    189                    %FINISH
#line 189 "regression-bugs-tmp/draft4.imp"
L_003f:;
                                                                //    190                 %FINISH
#line 190 "regression-bugs-tmp/draft4.imp"
L_003d:;
                                                                //    191  
                                                                //    192                 ! cramp
                                                                //    193                 %IF VM = 0 %AND CTYPE = CROWN %AND OPP(25) > 0 %START
#line 193 "regression-bugs-tmp/draft4.imp"
if (((VM) != (0))) goto L_0044;
#line 193 "regression-bugs-tmp/draft4.imp"
if (((*CTYPE) != (CROWN))) goto L_0044;
#line 193 "regression-bugs-tmp/draft4.imp"
if (((OPP[25]) <= (0))) goto L_0044;
                                                                //    194                    CPOS = CPOS+MV
#line 194 "regression-bugs-tmp/draft4.imp"
*CPOS = ((*(int *)(CPOS)) + (MV));
                                                                //    195                    %CYCLE PP = 1, 1, OPP(25)
#line 195 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = OPP[25]; PP = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle PP = 1, 1, OPP[25]");
PP -= _increment; _control -= _increment;
L_0045:;
if (PP == _final) goto L_0046;
PP += _increment; _control += _increment;
if (PP != _control) _imp_signal(4,2,0,"Corrupt control variable PP"); /* FOR loop control variable corrupted */
}
                                                                //    196                       %CYCLE MM = 1, 2, 7
#line 196 "regression-bugs-tmp/draft4.imp"
MM = (-1);
if ((((7)-(1)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle MM = 1, 2, 7");
L_0048:;
if (MM == 7) goto L_0049;
MM += 2;
                                                                //    197                          %IF VALID MOVE(MM, PP, OPP, COMP) >= 0 %START
#line 197 "regression-bugs-tmp/draft4.imp"
if (((VALIDMOVE(MM, PP, /*is_array_name_param2 BUG? */ &OPP[0], /*is_array_name_param2 BUG? */ &COMP[0])) < (0))) goto L_004b;
                                                                //    198                             V5 = V5-CRAMP WT;  %EXIT
#line 198 "regression-bugs-tmp/draft4.imp"
V5 = (((int)(V5)) - (CRAMPWT));
#line 198 "regression-bugs-tmp/draft4.imp"
goto L_0049;
                                                                //    199                          %FINISH
#line 199 "regression-bugs-tmp/draft4.imp"
L_004b:;
                                                                //    200                       %REPEAT
#line 200 "regression-bugs-tmp/draft4.imp"
goto L_0048;
#line 200 "regression-bugs-tmp/draft4.imp"
L_0049:;
                                                                //    201                    %REPEAT
#line 201 "regression-bugs-tmp/draft4.imp"
goto L_0045;
#line 201 "regression-bugs-tmp/draft4.imp"
L_0046:;
                                                                //    202                    CPOS = CPOS-MV
#line 202 "regression-bugs-tmp/draft4.imp"
*CPOS = ((*(int *)(CPOS)) - (MV));
                                                                //    203                 %FINISH
#line 203 "regression-bugs-tmp/draft4.imp"
L_0044:;
                                                                //    204              %FINISH
#line 204 "regression-bugs-tmp/draft4.imp"
L_003b:;
                                                                //    205           %REPEAT
#line 205 "regression-bugs-tmp/draft4.imp"
goto L_0036;
#line 205 "regression-bugs-tmp/draft4.imp"
L_0037:;
                                                                //    206        %REPEAT
#line 206 "regression-bugs-tmp/draft4.imp"
goto L_0033;
#line 206 "regression-bugs-tmp/draft4.imp"
L_0034:;
                                                                //    207        %RESULT = V1+V2+V3+V4+V5+V6+V7
#line 207 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (((int)((((int)((((int)((((int)((((int)((((int)(V1)) + (V2)))) + (V3)))) + (V4)))) + (V5)))) + (V6)))) + (V7));
                                                                //    208     %END
#line 208 "regression-bugs-tmp/draft4.imp"
} // End of block VALUEOFSIDE at level 2
                                                                //    209  
                                                                //    210     %INTEGERFN VALUE OF POS(%INTEGERARRAYNAME COMP, OPP)
#line 210 "regression-bugs-tmp/draft4.imp"
int VALUEOFPOS( int /*arrayname*/*COMP, int /*arrayname*/*OPP )
#line 210 "regression-bugs-tmp/draft4.imp"
{
                                                                //    211     %INTEGER VALUE
#line 211 "regression-bugs-tmp/draft4.imp"
int VALUE;
                                                                //    212        %IF PENDING MOVE(COMP, OPP) >= 0 %START
#line 212 "regression-bugs-tmp/draft4.imp"
if (((PENDINGMOVE(/*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0])) < (0))) goto L_004c;
                                                                //    213           VALUE = VALUE OF SIDE(COMP, OPP)-VALUE OF SIDE(OPP, COMP)-PLY NUMBER
#line 213 "regression-bugs-tmp/draft4.imp"
VALUE = (((int)((((int)(VALUEOFSIDE(/*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]))) - (VALUEOFSIDE(/*is_array_name_param2 BUG? */ &OPP[0], /*is_array_name_param2 BUG? */ &COMP[0]))))) - (PLYNUMBER));
                                                                //    214        %FINISH %ELSE VALUE = -100000+PLYNUMBER;   ! no mobility!!
#line 214 "regression-bugs-tmp/draft4.imp"
goto L_004d;
#line 214 "regression-bugs-tmp/draft4.imp"
L_004c:;
#line 214 "regression-bugs-tmp/draft4.imp"
VALUE = (((int)((-100000))) + (PLYNUMBER));
#line 214 "regression-bugs-tmp/draft4.imp"
L_004d:;
                                                                //    215        %RESULT = VALUE %IF COMP(0) = ME
#line 215 "regression-bugs-tmp/draft4.imp"
if (((COMP[0]) != (ME))) goto L_004e;
#line 215 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return VALUE;
#line 215 "regression-bugs-tmp/draft4.imp"
L_004e:;
                                                                //    216        %RESULT = -VALUE
#line 216 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (-(VALUE));
                                                                //    217     %END
#line 217 "regression-bugs-tmp/draft4.imp"
} // End of block VALUEOFPOS at level 2
                                                                //    218  
                                                                //    219     %ROUTINE MAKE MOVE(%INTEGER MV, P, %INTEGERNAME T, %C
#line 219 "regression-bugs-tmp/draft4.imp"
void MAKEMOVE( int MV, int P, int /*name*/*T, int /*arrayname*/*COMP, int /*arrayname*/*OPP )
#line 219 "regression-bugs-tmp/draft4.imp"
{
                                                                //    220                                       %INTEGERARRAYNAME COMP, OPP)
                                                                //    221     %INTEGERNAME CPOS, CTYPE, OPOS, OTYPE, ONUM, ONUMC
#line 221 "regression-bugs-tmp/draft4.imp"
int /*name*/*CPOS;
#line 221 "regression-bugs-tmp/draft4.imp"
int /*name*/*CTYPE;
#line 221 "regression-bugs-tmp/draft4.imp"
int /*name*/*OPOS;
#line 221 "regression-bugs-tmp/draft4.imp"
int /*name*/*OTYPE;
#line 221 "regression-bugs-tmp/draft4.imp"
int /*name*/*ONUM;
#line 221 "regression-bugs-tmp/draft4.imp"
int /*name*/*ONUMC;
                                                                //    222        CPOS == COMP(P);  CTYPE == COMP(P+12)
#line 222 "regression-bugs-tmp/draft4.imp"
CPOS = &COMP[P];
#line 222 "regression-bugs-tmp/draft4.imp"
CTYPE = &COMP[(((int)(P)) + (12))];
                                                                //    223        CPOS = CPOS+MV
#line 223 "regression-bugs-tmp/draft4.imp"
*CPOS = ((*(int *)(CPOS)) + (MV));
                                                                //    224        %IF T # 0 %START;                ! a take
#line 224 "regression-bugs-tmp/draft4.imp"
if (((*T) == (0))) goto L_004f;
                                                                //    225           OPOS == OPP(T);  OTYPE == OPP(T+12)
#line 225 "regression-bugs-tmp/draft4.imp"
OPOS = &OPP[*T];
#line 225 "regression-bugs-tmp/draft4.imp"
OTYPE = &OPP[((*(int *)(T)) + (12))];
                                                                //    226           ONUM == OPP(25);  ONUMC == OPP(26)
#line 226 "regression-bugs-tmp/draft4.imp"
ONUM = &OPP[25];
#line 226 "regression-bugs-tmp/draft4.imp"
ONUMC = &OPP[26];
                                                                //    227           SP = SP+1
#line 227 "regression-bugs-tmp/draft4.imp"
SP = (((int)(SP)) + (1));
                                                                //    228           PSTACK(SP) = OPOS;            ! save position of taken piece
#line 228 "regression-bugs-tmp/draft4.imp"
PSTACK[(((int)(SP)) - (1))] = *OPOS;
                                                                //    229           TSTACK(SP) = OTYPE;           ! save piece type
#line 229 "regression-bugs-tmp/draft4.imp"
TSTACK[(((int)(SP)) - (1))] = *OTYPE;
                                                                //    230           NSTACK(SP) = T;               ! save piece number
#line 230 "regression-bugs-tmp/draft4.imp"
NSTACK[(((int)(SP)) - (1))] = *T;
                                                                //    231           OPOS = OPP(ONUM);             ! remove piece from board
#line 231 "regression-bugs-tmp/draft4.imp"
*OPOS = OPP[*ONUM];
                                                                //    232           ONUM = ONUM-1;                ! reduce piece count for opp
#line 232 "regression-bugs-tmp/draft4.imp"
*ONUM = ((*(int *)(ONUM)) - (1));
                                                                //    233           ONUMC = ONUMC-1 %IF OTYPE = CROWN
#line 233 "regression-bugs-tmp/draft4.imp"
if (((*OTYPE) != (CROWN))) goto L_0050;
#line 233 "regression-bugs-tmp/draft4.imp"
*ONUMC = ((*(int *)(ONUMC)) - (1));
#line 233 "regression-bugs-tmp/draft4.imp"
L_0050:;
                                                                //    234           OTYPE = OPP(ONUM+13)
#line 234 "regression-bugs-tmp/draft4.imp"
*OTYPE = OPP[((*(int *)(ONUM)) + (13))];
                                                                //    235        %FINISH
#line 235 "regression-bugs-tmp/draft4.imp"
L_004f:;
                                                                //    236        %IF CTYPE # CROWN %AND TRUE=CROWNING(CPOS, COMP(0)) %START
#line 236 "regression-bugs-tmp/draft4.imp"
if (((*CTYPE) == (CROWN))) goto L_0051;
#line 236 "regression-bugs-tmp/draft4.imp"
if (((1) != (CROWNING(*CPOS, COMP[0])))) goto L_0051;
                                                                //    237           CTYPE = CROWN;                ! crown piece
#line 237 "regression-bugs-tmp/draft4.imp"
*CTYPE = CROWN;
                                                                //    238           COMP(26) = COMP(26)+1;        ! increase crown count
#line 238 "regression-bugs-tmp/draft4.imp"
COMP[26] = (((int)(COMP[26])) + (1));
                                                                //    239           T = 0;                        ! no more takes
#line 239 "regression-bugs-tmp/draft4.imp"
*T = 0;
                                                                //    240        %FINISH
#line 240 "regression-bugs-tmp/draft4.imp"
L_0051:;
                                                                //    241     %END
#line 241 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block MAKEMOVE at level 2
                                                                //    242  
                                                                //    243     %INTEGERFN TRY POSSIBLE MOVES(%INTEGER PLY, DEPTH, %C
#line 243 "regression-bugs-tmp/draft4.imp"
int TRYPOSSIBLEMOVES( int PLY, int DEPTH, int /*arrayname*/*COMP, int /*arrayname*/*OPP )
#line 243 "regression-bugs-tmp/draft4.imp"
{
                                                                //    244                                   %INTEGERARRAYNAME COMP, OPP)
                                                                //    245     %INTEGER M,MM,MMM,MMF,P,T,TT,APT,VALUE,TAKES,OLDPOS,OLDTYPE
#line 245 "regression-bugs-tmp/draft4.imp"
int M;
#line 245 "regression-bugs-tmp/draft4.imp"
int MM;
#line 245 "regression-bugs-tmp/draft4.imp"
int MMM;
#line 245 "regression-bugs-tmp/draft4.imp"
int MMF;
#line 245 "regression-bugs-tmp/draft4.imp"
int P;
#line 245 "regression-bugs-tmp/draft4.imp"
int T;
#line 245 "regression-bugs-tmp/draft4.imp"
int TT;
#line 245 "regression-bugs-tmp/draft4.imp"
int APT;
#line 245 "regression-bugs-tmp/draft4.imp"
int VALUE;
#line 245 "regression-bugs-tmp/draft4.imp"
int TAKES;
#line 245 "regression-bugs-tmp/draft4.imp"
int OLDPOS;
#line 245 "regression-bugs-tmp/draft4.imp"
int OLDTYPE;
                                                                //    246     %INTEGERNAME MAXPLY, MINPLY
#line 246 "regression-bugs-tmp/draft4.imp"
int /*name*/*MAXPLY;
#line 246 "regression-bugs-tmp/draft4.imp"
int /*name*/*MINPLY;
                                                                //    247  
                                                                //    248        %INTEGERFN PURSUIT
#line 248 "regression-bugs-tmp/draft4.imp"
int PURSUIT( void )
#line 248 "regression-bugs-tmp/draft4.imp"
{
                                                                //    249           %RESULT = 1 %IF PLY = 1
#line 249 "regression-bugs-tmp/draft4.imp"
if (((PLY) != (1))) goto L_0052;
#line 249 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 1;
#line 249 "regression-bugs-tmp/draft4.imp"
L_0052:;
                                                                //    250           %RESULT = \M&1
#line 250 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return (((~(M))) & (1));
                                                                //    251        %END
#line 251 "regression-bugs-tmp/draft4.imp"
} // End of block PURSUIT at level 3
                                                                //    252  
                                                                //    253        NODES = NODES+1
#line 253 "regression-bugs-tmp/draft4.imp"
NODES = (((int)(NODES)) + (1));
                                                                //    254        APT = PENDING MOVE(COMP, OPP)
#line 254 "regression-bugs-tmp/draft4.imp"
APT = PENDINGMOVE(/*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    255        PLY NUMBER = PLY-1 %AND %RESULT = VALUE OF POS(COMP, OPP) %C
#line 255 "regression-bugs-tmp/draft4.imp"
if (((DEPTH) < (SEARCHLIMIT))) goto L_0053;
#line 255 "regression-bugs-tmp/draft4.imp"
if (((APT) <= (0))) goto L_0035;
#line 255 "regression-bugs-tmp/draft4.imp"
L_0053:;
#line 255 "regression-bugs-tmp/draft4.imp"
if (((PLY) <= (12))) goto L_0054;
#line 255 "regression-bugs-tmp/draft4.imp"
L_0035:;
#line 255 "regression-bugs-tmp/draft4.imp"
PLYNUMBER = (((int)(PLY)) - (1));
#line 255 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return VALUEOFPOS(/*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
#line 255 "regression-bugs-tmp/draft4.imp"
L_0054:;
                                                                //    256         %IF (DEPTH >= SEARCH LIMIT %AND APT <=0) %OR PLY > 12
                                                                //    257        MINPLY == MIN(PLY);  MINPLY = 100000
#line 257 "regression-bugs-tmp/draft4.imp"
MINPLY = &MIN[(((int)(PLY)) - (1))];
#line 257 "regression-bugs-tmp/draft4.imp"
*MINPLY = 100000;
                                                                //    258        MAXPLY == MAX(PLY);  MAXPLY =-100000
#line 258 "regression-bugs-tmp/draft4.imp"
MAXPLY = &MAX[(((int)(PLY)) - (1))];
#line 258 "regression-bugs-tmp/draft4.imp"
*MAXPLY = (-100000);
                                                                //    259        %IF APT >= 0 %START;             ! COMP able to move
#line 259 "regression-bugs-tmp/draft4.imp"
if (((APT) < (0))) goto L_0055;
                                                                //    260           %IF APT > 0 %START;           ! take priority
#line 260 "regression-bugs-tmp/draft4.imp"
if (((APT) <= (0))) goto L_0056;
                                                                //    261              P = APT;  APT = 2;  MMM = 1 ; MMF = 7
#line 261 "regression-bugs-tmp/draft4.imp"
P = APT;
#line 261 "regression-bugs-tmp/draft4.imp"
APT = 2;
#line 261 "regression-bugs-tmp/draft4.imp"
MMM = 1;
#line 261 "regression-bugs-tmp/draft4.imp"
MMF = 7;
                                                                //    262              SEARCH LIMIT = 2 %IF PLY = 1
#line 262 "regression-bugs-tmp/draft4.imp"
if (((PLY) != (1))) goto L_0057;
#line 262 "regression-bugs-tmp/draft4.imp"
SEARCHLIMIT = 2;
#line 262 "regression-bugs-tmp/draft4.imp"
L_0057:;
                                                                //    263           %FINISH %ELSE %START
#line 263 "regression-bugs-tmp/draft4.imp"
goto L_0058;
#line 263 "regression-bugs-tmp/draft4.imp"
L_0056:;
                                                                //    264              P = 1;  APT = 2;  MMM = 0; MMF=6
#line 264 "regression-bugs-tmp/draft4.imp"
P = 1;
#line 264 "regression-bugs-tmp/draft4.imp"
APT = 2;
#line 264 "regression-bugs-tmp/draft4.imp"
MMM = 0;
#line 264 "regression-bugs-tmp/draft4.imp"
MMF = 6;
                                                                //    265           %FINISH
#line 265 "regression-bugs-tmp/draft4.imp"
L_0058:;
                                                                //    266           %CYCLE P = P, 1, COMP(25)
#line 266 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = P; _increment = 1; _final = COMP[25]; P = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle P = P, 1, COMP[25]");
P -= _increment; _control -= _increment;
L_0059:;
if (P == _final) goto L_005a;
P += _increment; _control += _increment;
if (P != _control) _imp_signal(4,2,0,"Corrupt control variable P"); /* FOR loop control variable corrupted */
}
                                                                //    267              OLDPOS = COMP(P);  OLDTYPE = COMP(P+12)
#line 267 "regression-bugs-tmp/draft4.imp"
OLDPOS = COMP[P];
#line 267 "regression-bugs-tmp/draft4.imp"
OLDTYPE = COMP[(((int)(P)) + (12))];
                                                                //    268              %CYCLE M = MMM, APT, MMF
#line 268 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = MMM; _increment = APT; _final = MMF; M = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle M = MMM, APT, MMF");
M -= _increment; _control -= _increment;
L_005c:;
if (M == _final) goto L_005d;
M += _increment; _control += _increment;
if (M != _control) _imp_signal(4,2,0,"Corrupt control variable M"); /* FOR loop control variable corrupted */
}
                                                                //    269                 TAKES = 0
#line 269 "regression-bugs-tmp/draft4.imp"
TAKES = 0;
                                                                //    270                 T = VALID MOVE(M, P, COMP, OPP)
#line 270 "regression-bugs-tmp/draft4.imp"
T = VALIDMOVE(M, P, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    271                 %IF T >= 0 %START;               ! valid move
#line 271 "regression-bugs-tmp/draft4.imp"
if (((T) < (0))) goto L_005f;
                                                                //    272                    MM = M;  TT = T
#line 272 "regression-bugs-tmp/draft4.imp"
MM = M;
#line 272 "regression-bugs-tmp/draft4.imp"
TT = T;
                                                                //    273  ANOTHER TAKE:     TAKES = TAKES+1 %IF TT > 0
#line 273 "regression-bugs-tmp/draft4.imp"
U_1000:;
#line 273 "regression-bugs-tmp/draft4.imp"
if (((TT) <= (0))) goto L_0060;
#line 273 "regression-bugs-tmp/draft4.imp"
TAKES = (((int)(TAKES)) + (1));
#line 273 "regression-bugs-tmp/draft4.imp"
L_0060:;
                                                                //    274                    MAKE MOVE(MOVE(MM), P, TT, COMP, OPP);! try this move
#line 274 "regression-bugs-tmp/draft4.imp"
MAKEMOVE(MOVE[MM], P, &TT, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    275                    %IF TT > 0 %START;             ! another take
#line 275 "regression-bugs-tmp/draft4.imp"
if (((TT) <= (0))) goto L_0061;
                                                                //    276                       %CYCLE MM = 1, 2, 7
#line 276 "regression-bugs-tmp/draft4.imp"
MM = (-1);
if ((((7)-(1)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle MM = 1, 2, 7");
L_0062:;
if (MM == 7) goto L_0063;
MM += 2;
                                                                //    277                          TT = VALID MOVE(MM, P, COMP, OPP)
#line 277 "regression-bugs-tmp/draft4.imp"
TT = VALIDMOVE(MM, P, /*is_array_name_param2 BUG? */ &COMP[0], /*is_array_name_param2 BUG? */ &OPP[0]);
                                                                //    278                          -> ANOTHER TAKE %IF TT > 0
#line 278 "regression-bugs-tmp/draft4.imp"
if (((TT) <= (0))) goto L_0065;
#line 278 "regression-bugs-tmp/draft4.imp"
goto U_1000;
#line 278 "regression-bugs-tmp/draft4.imp"
L_0065:;
                                                                //    279                       %REPEAT
#line 279 "regression-bugs-tmp/draft4.imp"
goto L_0062;
#line 279 "regression-bugs-tmp/draft4.imp"
L_0063:;
                                                                //    280                    %FINISH
#line 280 "regression-bugs-tmp/draft4.imp"
L_0061:;
                                                                //    281                    VALUE = TRY POSSIBLE MOVES(PLY+1, DEPTH+PURSUIT, OPP, COMP)
#line 281 "regression-bugs-tmp/draft4.imp"
VALUE = TRYPOSSIBLEMOVES((((int)(PLY)) + (1)), (((int)(DEPTH)) + (PURSUIT())), /*is_array_name_param2 BUG? */ &OPP[0], /*is_array_name_param2 BUG? */ &COMP[0]);
                                                                //    282                    COMP(P) = OLDPOS;  COMP(P+12) = OLDTYPE
#line 282 "regression-bugs-tmp/draft4.imp"
COMP[P] = OLDPOS;
#line 282 "regression-bugs-tmp/draft4.imp"
COMP[(((int)(P)) + (12))] = OLDTYPE;
                                                                //    283                    OPP(25) = OPP(25)+TAKES
#line 283 "regression-bugs-tmp/draft4.imp"
OPP[25] = (((int)(OPP[25])) + (TAKES));
                                                                //    284                    %WHILE TAKES > 0 %CYCLE
#line 284 "regression-bugs-tmp/draft4.imp"
L_0066:;
#line 284 "regression-bugs-tmp/draft4.imp"
if (((TAKES) <= (0))) goto L_0067;
                                                                //    285                       TT = NSTACK(SP)
#line 285 "regression-bugs-tmp/draft4.imp"
TT = NSTACK[(((int)(SP)) - (1))];
                                                                //    286                       OPP(TT) = PSTACK(SP)
#line 286 "regression-bugs-tmp/draft4.imp"
OPP[TT] = PSTACK[(((int)(SP)) - (1))];
                                                                //    287                       OPP(TT+12) = TSTACK(SP)
#line 287 "regression-bugs-tmp/draft4.imp"
OPP[(((int)(TT)) + (12))] = TSTACK[(((int)(SP)) - (1))];
                                                                //    288                       TAKES = TAKES-1
#line 288 "regression-bugs-tmp/draft4.imp"
TAKES = (((int)(TAKES)) - (1));
                                                                //    289                       SP = SP-1
#line 289 "regression-bugs-tmp/draft4.imp"
SP = (((int)(SP)) - (1));
                                                                //    290                    %REPEAT
#line 290 "regression-bugs-tmp/draft4.imp"
goto L_0066;
#line 290 "regression-bugs-tmp/draft4.imp"
L_0067:;
                                                                //    291                    %IF COMP(0) = ME %START
#line 291 "regression-bugs-tmp/draft4.imp"
if (((COMP[0]) != (ME))) goto L_0069;
                                                                //    292                       %IF VALUE > MAXPLY %START
#line 292 "regression-bugs-tmp/draft4.imp"
if (((VALUE) <= (*MAXPLY))) goto L_006a;
                                                                //    293                          MAXPLY = VALUE
#line 293 "regression-bugs-tmp/draft4.imp"
*MAXPLY = VALUE;
                                                                //    294                          %IF PLY = 1 %START
#line 294 "regression-bugs-tmp/draft4.imp"
if (((PLY) != (1))) goto L_006b;
                                                                //    295                             BEST MOVE = M
#line 295 "regression-bugs-tmp/draft4.imp"
BESTMOVE = M;
                                                                //    296                             BEST TAKE = T
#line 296 "regression-bugs-tmp/draft4.imp"
BESTTAKE = T;
                                                                //    297                             BEST PIECE = P
#line 297 "regression-bugs-tmp/draft4.imp"
BESTPIECE = P;
                                                                //    298                          %FINISH
#line 298 "regression-bugs-tmp/draft4.imp"
L_006b:;
                                                                //    299                       %FINISH
#line 299 "regression-bugs-tmp/draft4.imp"
L_006a:;
                                                                //    300                       %RESULT = MAXPLY %IF PLY # 1 %AND MAXPLY >= MIN(PLY-1)
#line 300 "regression-bugs-tmp/draft4.imp"
if (((PLY) == (1))) goto L_006c;
#line 300 "regression-bugs-tmp/draft4.imp"
if (((*MAXPLY) < (MIN[(((int)((((int)(PLY)) - (1)))) - (1))]))) goto L_006c;
#line 300 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return *MAXPLY;
#line 300 "regression-bugs-tmp/draft4.imp"
L_006c:;
                                                                //    301                    %FINISH %ELSE %START
#line 301 "regression-bugs-tmp/draft4.imp"
goto L_006d;
#line 301 "regression-bugs-tmp/draft4.imp"
L_0069:;
                                                                //    302                       MINPLY = VALUE %IF VALUE < MINPLY
#line 302 "regression-bugs-tmp/draft4.imp"
if (((VALUE) >= (*MINPLY))) goto L_006e;
#line 302 "regression-bugs-tmp/draft4.imp"
*MINPLY = VALUE;
#line 302 "regression-bugs-tmp/draft4.imp"
L_006e:;
                                                                //    303                       %RESULT = MINPLY %IF MINPLY <= MAX(PLY-1)
#line 303 "regression-bugs-tmp/draft4.imp"
if (((*MINPLY) > (MAX[(((int)((((int)(PLY)) - (1)))) - (1))]))) goto L_006f;
#line 303 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return *MINPLY;
#line 303 "regression-bugs-tmp/draft4.imp"
L_006f:;
                                                                //    304                    %FINISH
#line 304 "regression-bugs-tmp/draft4.imp"
L_006d:;
                                                                //    305                 %FINISH
#line 305 "regression-bugs-tmp/draft4.imp"
L_005f:;
                                                                //    306              %REPEAT
#line 306 "regression-bugs-tmp/draft4.imp"
goto L_005c;
#line 306 "regression-bugs-tmp/draft4.imp"
L_005d:;
                                                                //    307           %REPEAT
#line 307 "regression-bugs-tmp/draft4.imp"
goto L_0059;
#line 307 "regression-bugs-tmp/draft4.imp"
L_005a:;
                                                                //    308        %FINISH
#line 308 "regression-bugs-tmp/draft4.imp"
L_0055:;
                                                                //    309        %RESULT = MAXPLY %IF COMP(0) = ME
#line 309 "regression-bugs-tmp/draft4.imp"
if (((COMP[0]) != (ME))) goto L_0070;
#line 309 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return *MAXPLY;
#line 309 "regression-bugs-tmp/draft4.imp"
L_0070:;
                                                                //    310        %RESULT = MINPLY
#line 310 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return *MINPLY;
                                                                //    311     %END
#line 311 "regression-bugs-tmp/draft4.imp"
} // End of block TRYPOSSIBLEMOVES at level 2
                                                                //    312  
                                                                //    313     %ROUTINE SAY PLEASE
#line 313 "regression-bugs-tmp/draft4.imp"
void SAYPLEASE( void )
#line 313 "regression-bugs-tmp/draft4.imp"
{
                                                                //    314        PRINTSTRING("Please re-type your move
#line 314 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Please re-type your move\n"));
                                                                //    315  ")
                                                                //    316     %END
#line 316 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block SAYPLEASE at level 2
                                                                //    317  
                                                                //    318     %ROUTINE PRINT BOARD
#line 318 "regression-bugs-tmp/draft4.imp"
void PRINTBOARD( void )
#line 318 "regression-bugs-tmp/draft4.imp"
{
                                                                //    319     %INTEGER I, J, POS
#line 319 "regression-bugs-tmp/draft4.imp"
int I;
#line 319 "regression-bugs-tmp/draft4.imp"
int J;
#line 319 "regression-bugs-tmp/draft4.imp"
int POS;
                                                                //    320        %CYCLE I = 0, 1, 7
#line 320 "regression-bugs-tmp/draft4.imp"
I = (-1);
if ((((7)-(0)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 0, 1, 7");
L_0071:;
if (I == 7) goto L_0072;
I += 1;
                                                                //    321           %CYCLE J = 0, 2, 6
#line 321 "regression-bugs-tmp/draft4.imp"
J = (-2);
if ((((6)-(0)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle J = 0, 2, 6");
L_0074:;
if (J == 6) goto L_0075;
J += 2;
                                                                //    322              BOARD(10*I+J+I&1) = '#'
#line 322 "regression-bugs-tmp/draft4.imp"
(BOARD+1)[((((((int)((((int)(10)) * (I)))) + (J)))) + (((I) & (1))))] = 35;
                                                                //    323           %REPEAT
#line 323 "regression-bugs-tmp/draft4.imp"
goto L_0074;
#line 323 "regression-bugs-tmp/draft4.imp"
L_0075:;
                                                                //    324        %REPEAT
#line 324 "regression-bugs-tmp/draft4.imp"
goto L_0071;
#line 324 "regression-bugs-tmp/draft4.imp"
L_0072:;
                                                                //    325        %CYCLE I = 1, 1, 12
#line 325 "regression-bugs-tmp/draft4.imp"
I = 0;
if ((((12)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 12");
L_0077:;
if (I == 12) goto L_0078;
I += 1;
                                                                //    326           %IF I <= COMP(25) %START
#line 326 "regression-bugs-tmp/draft4.imp"
if (((I) > (COMP[26]))) goto L_007a;
                                                                //    327              POS = COMP(I)
#line 327 "regression-bugs-tmp/draft4.imp"
POS = COMP[((I) + ((int)(1)))];
                                                                //    328             %IF COMP(I+12) = CROWN %THEN BOARD(POS) = 'X' %C
#line 328 "regression-bugs-tmp/draft4.imp"
if (((COMP[(((unsigned char)((((int)(I)) + (12)))) + (1))]) != (CROWN))) goto L_007b;
#line 328 "regression-bugs-tmp/draft4.imp"
(BOARD+1)[POS] = 88;
#line 328 "regression-bugs-tmp/draft4.imp"
goto L_007c;
#line 328 "regression-bugs-tmp/draft4.imp"
L_007b:;
#line 328 "regression-bugs-tmp/draft4.imp"
(BOARD+1)[POS] = 120;
#line 328 "regression-bugs-tmp/draft4.imp"
L_007c:;
                                                                //    329               %ELSE BOARD(POS) = 'x'
                                                                //    330           %FINISH
#line 330 "regression-bugs-tmp/draft4.imp"
L_007a:;
                                                                //    331           %IF I <= OPP(25) %START
#line 331 "regression-bugs-tmp/draft4.imp"
if (((I) > (OPP[26]))) goto L_007d;
                                                                //    332              POS = OPP(I)
#line 332 "regression-bugs-tmp/draft4.imp"
POS = OPP[((I) + ((int)(1)))];
                                                                //    333              %IF OPP(I+12) = CROWN %THEN BOARD(POS) = 'O' %C
#line 333 "regression-bugs-tmp/draft4.imp"
if (((OPP[(((unsigned char)((((int)(I)) + (12)))) + (1))]) != (CROWN))) goto L_007e;
#line 333 "regression-bugs-tmp/draft4.imp"
(BOARD+1)[POS] = 79;
#line 333 "regression-bugs-tmp/draft4.imp"
goto L_007f;
#line 333 "regression-bugs-tmp/draft4.imp"
L_007e:;
#line 333 "regression-bugs-tmp/draft4.imp"
(BOARD+1)[POS] = 111;
#line 333 "regression-bugs-tmp/draft4.imp"
L_007f:;
                                                                //    334               %ELSE BOARD(POS) = 'o'
                                                                //    335           %FINISH
#line 335 "regression-bugs-tmp/draft4.imp"
L_007d:;
                                                                //    336        %REPEAT
#line 336 "regression-bugs-tmp/draft4.imp"
goto L_0077;
#line 336 "regression-bugs-tmp/draft4.imp"
L_0078:;
                                                                //    337        PRINTSTRING("
#line 337 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("\n  A B C D E F G H"));
                                                                //    338    A B C D E F G H")
                                                                //    339        %CYCLE I = 70, -10, 0
#line 339 "regression-bugs-tmp/draft4.imp"
I = 80;
if ((((0)-(70)) % ((-10))) != 0) _imp_signal(5,1,0,"Illegal cycle I = 70, (-10), 0");
L_0080:;
if (I == 0) goto L_0081;
I += (-10);
                                                                //    340           NEWLINE
#line 340 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    341           PRINTSYMBOL(I//10+'1')
#line 341 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(((((long)((long)((int)(I)) / (long)((int)(10))))) + (49)));
                                                                //    342           %CYCLE J = 0, 1, 7
#line 342 "regression-bugs-tmp/draft4.imp"
J = (-1);
if ((((7)-(0)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle J = 0, 1, 7");
L_0083:;
if (J == 7) goto L_0084;
J += 1;
                                                                //    343              SPACE
#line 343 "regression-bugs-tmp/draft4.imp"
_imp_SPACE();
                                                                //    344              PRINTSYMBOL(BOARD(J+I))
#line 344 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL((BOARD+1)[(((int)(J)) + (I))]);
                                                                //    345           %REPEAT
#line 345 "regression-bugs-tmp/draft4.imp"
goto L_0083;
#line 345 "regression-bugs-tmp/draft4.imp"
L_0084:;
                                                                //    346           SPACE
#line 346 "regression-bugs-tmp/draft4.imp"
_imp_SPACE();
                                                                //    347           PRINTSYMBOL(I//10+'1')
#line 347 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(((((long)((long)((int)(I)) / (long)((int)(10))))) + (49)));
                                                                //    348        %REPEAT
#line 348 "regression-bugs-tmp/draft4.imp"
goto L_0080;
#line 348 "regression-bugs-tmp/draft4.imp"
L_0081:;
                                                                //    349        PRINTSTRING("
#line 349 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("\n  A B C D E F G H\n"));
                                                                //    350    A B C D E F G H
                                                                //    351  ")
                                                                //    352     %END
#line 352 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block PRINTBOARD at level 2
                                                                //    353  
                                                                //    354     %ROUTINE TROUT(%INTEGER OLDPOS, NEWPOS, %INTEGERNAME MODE)
#line 354 "regression-bugs-tmp/draft4.imp"
void TROUT( int OLDPOS, int NEWPOS, int /*name*/*MODE )
#line 354 "regression-bugs-tmp/draft4.imp"
{
                                                                //    355     %INTEGER OLDX, OLDY, NEWX, NEWY
#line 355 "regression-bugs-tmp/draft4.imp"
int OLDX;
#line 355 "regression-bugs-tmp/draft4.imp"
int OLDY;
#line 355 "regression-bugs-tmp/draft4.imp"
int NEWX;
#line 355 "regression-bugs-tmp/draft4.imp"
int NEWY;
                                                                //    356        OLDY = OLDPOS//10;  OLDX = OLDPOS-10*OLDY
#line 356 "regression-bugs-tmp/draft4.imp"
OLDY = (long)((long)((int)(OLDPOS)) / (long)((int)(10)));
#line 356 "regression-bugs-tmp/draft4.imp"
OLDX = ((OLDPOS) - ((int)((((int)(10)) * (OLDY)))));
                                                                //    357        NEWY = NEWPOS//10;  NEWX = NEWPOS-10*NEWY
#line 357 "regression-bugs-tmp/draft4.imp"
NEWY = (long)((long)((int)(NEWPOS)) / (long)((int)(10)));
#line 357 "regression-bugs-tmp/draft4.imp"
NEWX = ((NEWPOS) - ((int)((((int)(10)) * (NEWY)))));
                                                                //    358        %IF MODE = 0 %THEN PRINTSTRING("DRAFT4's move is ") %AND MODE = 1  %C
#line 358 "regression-bugs-tmp/draft4.imp"
if (((*MODE) != (0))) goto L_0086;
#line 358 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("DRAFT4's move is "));
#line 358 "regression-bugs-tmp/draft4.imp"
*MODE = 1;
#line 358 "regression-bugs-tmp/draft4.imp"
goto L_0087;
#line 358 "regression-bugs-tmp/draft4.imp"
L_0086:;
#line 358 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal(" , "));
#line 358 "regression-bugs-tmp/draft4.imp"
L_0087:;
                                                                //    359                     %ELSE PRINTSTRING(" , ")
                                                                //    360        PRINTSYMBOL(OLDX+'A')
#line 360 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL((((int)(OLDX)) + (65)));
                                                                //    361        PRINTSYMBOL(OLDY+'1')
#line 361 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL((((int)(OLDY)) + (49)));
                                                                //    362        PRINTSYMBOL('-')
#line 362 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(45);
                                                                //    363        PRINTSYMBOL(NEWX+'A')
#line 363 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL((((int)(NEWX)) + (65)));
                                                                //    364        PRINTSYMBOL(NEWY+'1')
#line 364 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL((((int)(NEWY)) + (49)));
                                                                //    365     %END
#line 365 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block TROUT at level 2
                                                                //    366  
                                                                //    367     %INTEGERFN POSITION OF(%INTEGER S1, S2)
#line 367 "regression-bugs-tmp/draft4.imp"
int POSITIONOF( int S1, int S2 )
#line 367 "regression-bugs-tmp/draft4.imp"
{
                                                                //    368        %RESULT = (S1-'A')+10*(S2-'1')
#line 368 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return ((((((int)(S1)) - (65)))) + (((10) * ((int)((((int)(S2)) - (49)))))));
                                                                //    369     %END
#line 369 "regression-bugs-tmp/draft4.imp"
} // End of block POSITIONOF at level 2
                                                                //    370  
                                                                //    371     %ROUTINE SKIP SPACES AND NLS
#line 371 "regression-bugs-tmp/draft4.imp"
void SKIPSPACESANDNLS( void )
#line 371 "regression-bugs-tmp/draft4.imp"
{
                                                                //    372        SKIP SYMBOL %WHILE NEXT SYMBOL=' ' %OR NEXT SYMBOL=NL
#line 372 "regression-bugs-tmp/draft4.imp"
L_0088:;
#line 372 "regression-bugs-tmp/draft4.imp"
if (((_imp_NEXTSYMBOL()) == (32))) goto L_008a;
#line 372 "regression-bugs-tmp/draft4.imp"
if (((_imp_NEXTSYMBOL()) != (10))) goto L_0089;
#line 372 "regression-bugs-tmp/draft4.imp"
L_008a:;
#line 372 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
#line 372 "regression-bugs-tmp/draft4.imp"
goto L_0088;
#line 372 "regression-bugs-tmp/draft4.imp"
L_0089:;
                                                                //    373     %END
#line 373 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block SKIPSPACESANDNLS at level 2
                                                                //    374  
                                                                //    375     COMPNUM == COMP(25);  OPPNUM == OPP(25)
#line 375 "regression-bugs-tmp/draft4.imp"
COMPNUM = &COMP[26];
#line 375 "regression-bugs-tmp/draft4.imp"
OPPNUM = &OPP[26];
                                                                //    376     !CPULIMIT ("12"); ! FOR EMAS - JGH MOD, AS CS1 WERE RUNNING OUT
                                                                //    377     PRINTSTRING("The Draughts programme  DRAFT4.4
#line 377 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("The Draughts programme  DRAFT4.4\n\n"));
                                                                //    378  
                                                                //    379  ")
                                                                //    380     PRINT STRING("Do you want some help?"); NEWLINE
#line 380 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Do you want some help?"));
#line 380 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    381     PROMPT(":")
#line 381 "regression-bugs-tmp/draft4.imp"
_imp_PROMPT(_imp_str_literal(":"));
                                                                //    382     READ SYMBOL(REPLY(1)); SKIP SYMBOL %WHILE NEXT SYMBOL#NL; SKIP SYMBOL
#line 382 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&REPLY[0]);
#line 382 "regression-bugs-tmp/draft4.imp"
L_008b:;
#line 382 "regression-bugs-tmp/draft4.imp"
if (((_imp_NEXTSYMBOL()) == (10))) goto L_008c;
#line 382 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
#line 382 "regression-bugs-tmp/draft4.imp"
goto L_008b;
#line 382 "regression-bugs-tmp/draft4.imp"
L_008c:;
#line 382 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
                                                                //    383     REPLY(1) = REPLY(1)-32 %IF REPLY(1)>='a'
#line 383 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) < (97))) goto L_008e;
#line 383 "regression-bugs-tmp/draft4.imp"
REPLY[0] = (((int)(REPLY[0])) - (32));
#line 383 "regression-bugs-tmp/draft4.imp"
L_008e:;
                                                                //    384     %IF REPLY(1)='Y' %START
#line 384 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (89))) goto L_008f;
                                                                //    385        PRINTSTRING("
#line 385 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("\n\n   Moves are typed in in the following form:  (e.g.)\n\n      C3-D4      move the piece on square C3 to square D4."));
                                                                //    386  
                                                                //    387     Moves are typed in in the following form:  (e.g.)
                                                                //    388  
                                                                //    389        C3-D4      move the piece on square C3 to square D4.")
                                                                //    390  PRINTSTRING("
#line 390 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("\n      C3-E5      move C3 to E5, taking the piece on D4\n"));
                                                                //    391        C3-E5      move C3 to E5, taking the piece on D4
                                                                //    392  "); PRINTSTRING("      C3-E5,
#line 392 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("      C3-E5,\n      E5-C7      an example of a multiple jump\n\n                                                    e.t.c."));
                                                                //    393        E5-C7      an example of a multiple jump
                                                                //    394  
                                                                //    395                                                      e.t.c.")
                                                                //    396     %FINISH
#line 396 "regression-bugs-tmp/draft4.imp"
L_008f:;
                                                                //    397  RESTART:
#line 397 "regression-bugs-tmp/draft4.imp"
U_1001:;
                                                                //    398     EXPECTED MOVE = 0
#line 398 "regression-bugs-tmp/draft4.imp"
EXPECTEDMOVE = 0;
                                                                //    399     ! setting up the pieces
                                                                //    400     %CYCLE P = -1, 1, 26
#line 400 "regression-bugs-tmp/draft4.imp"
P = (-2);
if ((((26)-((-1))) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle P = (-1), 1, 26");
L_0090:;
if (P == 26) goto L_0091;
P += 1;
                                                                //    401        COMP(P) = PLAYER1(P)
#line 401 "regression-bugs-tmp/draft4.imp"
COMP[((P) + ((int)(1)))] = (PLAYER1+1)[P];
                                                                //    402        OPP(P) = PLAYER2(P)
#line 402 "regression-bugs-tmp/draft4.imp"
OPP[((P) + ((int)(1)))] = (PLAYER2+1)[P];
                                                                //    403     %REPEAT
#line 403 "regression-bugs-tmp/draft4.imp"
goto L_0090;
#line 403 "regression-bugs-tmp/draft4.imp"
L_0091:;
                                                                //    404     NEWLINE
#line 404 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    405     PRINT STRING("Do you want to start?")
#line 405 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Do you want to start?"));
                                                                //    406     NEWLINE
#line 406 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    407     PROMPT(":")
#line 407 "regression-bugs-tmp/draft4.imp"
_imp_PROMPT(_imp_str_literal(":"));
                                                                //    408     READ SYMBOL(REPLY(1))
#line 408 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&REPLY[0]);
                                                                //    409     REPLY(1) = REPLY(1)-32 %IF REPLY(1)>='a'
#line 409 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) < (97))) goto L_0093;
#line 409 "regression-bugs-tmp/draft4.imp"
REPLY[0] = (((int)(REPLY[0])) - (32));
#line 409 "regression-bugs-tmp/draft4.imp"
L_0093:;
                                                                //    410     SKIP SYMBOL %WHILE NEXT SYMBOL#NL; SKIP SYMBOL
#line 410 "regression-bugs-tmp/draft4.imp"
L_0094:;
#line 410 "regression-bugs-tmp/draft4.imp"
if (((_imp_NEXTSYMBOL()) == (10))) goto L_0095;
#line 410 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
#line 410 "regression-bugs-tmp/draft4.imp"
goto L_0094;
#line 410 "regression-bugs-tmp/draft4.imp"
L_0095:;
#line 410 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
                                                                //    411     %IF REPLY(1)='R' %START
#line 411 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (82))) goto L_0097;
                                                                //    412        ! Read board position
                                                                //    413        %CYCLE P = -1,1,26
#line 413 "regression-bugs-tmp/draft4.imp"
P = (-2);
if ((((26)-((-1))) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle P = (-1), 1, 26");
L_0098:;
if (P == 26) goto L_0099;
P += 1;
                                                                //    414           COMP(P) = 0
#line 414 "regression-bugs-tmp/draft4.imp"
COMP[((P) + ((int)(1)))] = 0;
                                                                //    415           OPP(P) = 0
#line 415 "regression-bugs-tmp/draft4.imp"
OPP[((P) + ((int)(1)))] = 0;
                                                                //    416        %REPEAT
#line 416 "regression-bugs-tmp/draft4.imp"
goto L_0098;
#line 416 "regression-bugs-tmp/draft4.imp"
L_0099:;
                                                                //    417        PRINT STRING("Where are your pieces?"); NEWLINE
#line 417 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Where are your pieces?"));
#line 417 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    418        PROMPT(":")
#line 418 "regression-bugs-tmp/draft4.imp"
_imp_PROMPT(_imp_str_literal(":"));
                                                                //    419        %CYCLE P = 1,1,12
#line 419 "regression-bugs-tmp/draft4.imp"
P = 0;
if ((((12)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, 12");
L_009b:;
if (P == 12) goto L_009c;
P += 1;
                                                                //    420           SKIP SPACES AND NLS
#line 420 "regression-bugs-tmp/draft4.imp"
SKIPSPACESANDNLS();
                                                                //    421           READ SYMBOL(A); %IF A='.' %THEN %EXIT
#line 421 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&A);
#line 421 "regression-bugs-tmp/draft4.imp"
if (((A) != (46))) goto L_009e;
#line 421 "regression-bugs-tmp/draft4.imp"
goto L_009c;
#line 421 "regression-bugs-tmp/draft4.imp"
L_009e:;
                                                                //    422           READ SYMBOL(B); READ SYMBOL(C)
#line 422 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&B);
#line 422 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&C);
                                                                //    423           A = A-32 %IF A>='a'
#line 423 "regression-bugs-tmp/draft4.imp"
if (((A) < (97))) goto L_009f;
#line 423 "regression-bugs-tmp/draft4.imp"
A = (((int)(A)) - (32));
#line 423 "regression-bugs-tmp/draft4.imp"
L_009f:;
                                                                //    424           B = B-32 %IF A>='a'
#line 424 "regression-bugs-tmp/draft4.imp"
if (((A) < (97))) goto L_00a0;
#line 424 "regression-bugs-tmp/draft4.imp"
B = (((int)(B)) - (32));
#line 424 "regression-bugs-tmp/draft4.imp"
L_00a0:;
                                                                //    425           POS = POSITION OF(A,B)
#line 425 "regression-bugs-tmp/draft4.imp"
POS = POSITIONOF(A, B);
                                                                //    426           OPP(P) = POS
#line 426 "regression-bugs-tmp/draft4.imp"
OPP[((P) + ((int)(1)))] = POS;
                                                                //    427           %IF C=' ' %THEN OPP(P+12) = 1000 %ELSE OPP(P+12) = CROWN
#line 427 "regression-bugs-tmp/draft4.imp"
if (((C) != (32))) goto L_00a1;
#line 427 "regression-bugs-tmp/draft4.imp"
OPP[(((unsigned char)((((int)(P)) + (12)))) + (1))] = 1000;
#line 427 "regression-bugs-tmp/draft4.imp"
goto L_00a2;
#line 427 "regression-bugs-tmp/draft4.imp"
L_00a1:;
#line 427 "regression-bugs-tmp/draft4.imp"
OPP[(((unsigned char)((((int)(P)) + (12)))) + (1))] = CROWN;
#line 427 "regression-bugs-tmp/draft4.imp"
L_00a2:;
                                                                //    428        %REPEAT
#line 428 "regression-bugs-tmp/draft4.imp"
goto L_009b;
#line 428 "regression-bugs-tmp/draft4.imp"
L_009c:;
                                                                //    429        OPP(0) = 2
#line 429 "regression-bugs-tmp/draft4.imp"
OPP[1] = 2;
                                                                //    430        OPP(25) = P;        ! no of pieces.
#line 430 "regression-bugs-tmp/draft4.imp"
OPP[26] = P;
                                                                //    431        PRINT STRING("Where are my pieces?"); NEWLINE
#line 431 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Where are my pieces?"));
#line 431 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    432        %CYCLE P = 1,1,12
#line 432 "regression-bugs-tmp/draft4.imp"
P = 0;
if ((((12)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, 12");
L_00a3:;
if (P == 12) goto L_00a4;
P += 1;
                                                                //    433           SKIP SPACES AND NLS
#line 433 "regression-bugs-tmp/draft4.imp"
SKIPSPACESANDNLS();
                                                                //    434           READ SYMBOL(A); %IF A='.' %THEN %EXIT
#line 434 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&A);
#line 434 "regression-bugs-tmp/draft4.imp"
if (((A) != (46))) goto L_00a6;
#line 434 "regression-bugs-tmp/draft4.imp"
goto L_00a4;
#line 434 "regression-bugs-tmp/draft4.imp"
L_00a6:;
                                                                //    435           READ SYMBOL(B); READ SYMBOL(C)
#line 435 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&B);
#line 435 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&C);
                                                                //    436           A = A-32 %IF A>='a'
#line 436 "regression-bugs-tmp/draft4.imp"
if (((A) < (97))) goto L_00a7;
#line 436 "regression-bugs-tmp/draft4.imp"
A = (((int)(A)) - (32));
#line 436 "regression-bugs-tmp/draft4.imp"
L_00a7:;
                                                                //    437           B = B-32 %IF B>='a'
#line 437 "regression-bugs-tmp/draft4.imp"
if (((B) < (97))) goto L_00a8;
#line 437 "regression-bugs-tmp/draft4.imp"
B = (((int)(B)) - (32));
#line 437 "regression-bugs-tmp/draft4.imp"
L_00a8:;
                                                                //    438           POS = POSITION OF(A,B)
#line 438 "regression-bugs-tmp/draft4.imp"
POS = POSITIONOF(A, B);
                                                                //    439           COMP(P) = POS
#line 439 "regression-bugs-tmp/draft4.imp"
COMP[((P) + ((int)(1)))] = POS;
                                                                //    440           %IF C=' ' %THEN COMP(P+12) = 1000 %ELSE COMP(P+12) = CROWN
#line 440 "regression-bugs-tmp/draft4.imp"
if (((C) != (32))) goto L_00a9;
#line 440 "regression-bugs-tmp/draft4.imp"
COMP[(((unsigned char)((((int)(P)) + (12)))) + (1))] = 1000;
#line 440 "regression-bugs-tmp/draft4.imp"
goto L_00aa;
#line 440 "regression-bugs-tmp/draft4.imp"
L_00a9:;
#line 440 "regression-bugs-tmp/draft4.imp"
COMP[(((unsigned char)((((int)(P)) + (12)))) + (1))] = CROWN;
#line 440 "regression-bugs-tmp/draft4.imp"
L_00aa:;
                                                                //    441        %REPEAT
#line 441 "regression-bugs-tmp/draft4.imp"
goto L_00a3;
#line 441 "regression-bugs-tmp/draft4.imp"
L_00a4:;
                                                                //    442        COMP(0)  = ME
#line 442 "regression-bugs-tmp/draft4.imp"
COMP[1] = ME;
                                                                //    443        COMP(25) = P;        ! NO OF PIECES
#line 443 "regression-bugs-tmp/draft4.imp"
COMP[26] = P;
                                                                //    444        SKIP SYMBOL;       ! NL
#line 444 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
                                                                //    445        PROMPT("Your move?")
#line 445 "regression-bugs-tmp/draft4.imp"
_imp_PROMPT(_imp_str_literal("Your move?"));
                                                                //    446        READ SYMBOL(A)
#line 446 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&A);
                                                                //    447        SKIP SYMBOL %WHILE NEXT SYMBOL#NL; SKIP SYMBOL
#line 447 "regression-bugs-tmp/draft4.imp"
L_00ab:;
#line 447 "regression-bugs-tmp/draft4.imp"
if (((_imp_NEXTSYMBOL()) == (10))) goto L_00ac;
#line 447 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
#line 447 "regression-bugs-tmp/draft4.imp"
goto L_00ab;
#line 447 "regression-bugs-tmp/draft4.imp"
L_00ac:;
#line 447 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
                                                                //    448        A = A-32 %IF A>='a'
#line 448 "regression-bugs-tmp/draft4.imp"
if (((A) < (97))) goto L_00ae;
#line 448 "regression-bugs-tmp/draft4.imp"
A = (((int)(A)) - (32));
#line 448 "regression-bugs-tmp/draft4.imp"
L_00ae:;
                                                                //    449        %IF A='Y' %THEN -> READ MOVE %ELSE -> COMP MOVE
#line 449 "regression-bugs-tmp/draft4.imp"
if (((A) != (89))) goto L_00af;
#line 449 "regression-bugs-tmp/draft4.imp"
goto U_1002;
#line 449 "regression-bugs-tmp/draft4.imp"
L_00af:;
#line 449 "regression-bugs-tmp/draft4.imp"
goto U_1003;
                                                                //    450     %FINISH
#line 450 "regression-bugs-tmp/draft4.imp"
L_0097:;
                                                                //    451     %IF REPLY(1) = 'N' %START
#line 451 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (78))) goto L_00b0;
                                                                //    452        PRINT STRING("Think of a number please"); NEWLINE
#line 452 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Think of a number please"));
#line 452 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    453        READ SYMBOL(I); SKIP SYMBOL
#line 453 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&I);
#line 453 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
                                                                //    454        I = (I-'0')&3
#line 454 "regression-bugs-tmp/draft4.imp"
I = (((((int)(I)) - (48))) & (3));
                                                                //    455        COMP(-1) = 'B';  OPP(-1) = 'W'
#line 455 "regression-bugs-tmp/draft4.imp"
COMP[0] = 66;
#line 455 "regression-bugs-tmp/draft4.imp"
OPP[0] = 87;
                                                                //    456        PRINTSTRING("DRAFT4's opening move is ")
#line 456 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("DRAFT4's opening move is "));
                                                                //    457        %IF I = 1 %THEN PRINTSTRING("D6-C5") %AND COMP(11) = 42
#line 457 "regression-bugs-tmp/draft4.imp"
if (((I) != (1))) goto L_00b1;
#line 457 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("D6-C5"));
#line 457 "regression-bugs-tmp/draft4.imp"
COMP[12] = 42;
#line 457 "regression-bugs-tmp/draft4.imp"
L_00b1:;
                                                                //    458        %IF I = 2 %THEN PRINTSTRING("D6-E5") %AND COMP(11) = 44
#line 458 "regression-bugs-tmp/draft4.imp"
if (((I) != (2))) goto L_00b2;
#line 458 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("D6-E5"));
#line 458 "regression-bugs-tmp/draft4.imp"
COMP[12] = 44;
#line 458 "regression-bugs-tmp/draft4.imp"
L_00b2:;
                                                                //    459        %IF I = 3 %THEN PRINTSTRING("F6-E5") %AND COMP(10) = 44
#line 459 "regression-bugs-tmp/draft4.imp"
if (((I) != (3))) goto L_00b3;
#line 459 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("F6-E5"));
#line 459 "regression-bugs-tmp/draft4.imp"
COMP[11] = 44;
#line 459 "regression-bugs-tmp/draft4.imp"
L_00b3:;
                                                                //    460        NEWLINE
#line 460 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    461     %FINISH
#line 461 "regression-bugs-tmp/draft4.imp"
L_00b0:;
                                                                //    462  READ MOVE:
#line 462 "regression-bugs-tmp/draft4.imp"
U_1002:;
                                                                //    463     PRINT BOARD
#line 463 "regression-bugs-tmp/draft4.imp"
PRINTBOARD();
                                                                //    464     PROMPT("Your move:")
#line 464 "regression-bugs-tmp/draft4.imp"
_imp_PROMPT(_imp_str_literal("Your move:"));
                                                                //    465     SKIP SYMBOL %WHILE NEXT SYMBOL <= ' '
#line 465 "regression-bugs-tmp/draft4.imp"
L_00b4:;
#line 465 "regression-bugs-tmp/draft4.imp"
if (((_imp_NEXTSYMBOL()) > (32))) goto L_00b5;
#line 465 "regression-bugs-tmp/draft4.imp"
_imp_SKIPSYMBOL();
#line 465 "regression-bugs-tmp/draft4.imp"
goto L_00b4;
#line 465 "regression-bugs-tmp/draft4.imp"
L_00b5:;
                                                                //    466     %CYCLE I = 1, 1, 8
#line 466 "regression-bugs-tmp/draft4.imp"
I = 0;
if ((((8)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 8");
L_00b7:;
if (I == 8) goto L_00b8;
I += 1;
                                                                //    467        READ SYMBOL(REPLY(I))
#line 467 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&REPLY[(((int)(I)) - (1))]);
                                                                //    468        REPLY(I) = REPLY(I)-32 %IF REPLY(I)>='a'
#line 468 "regression-bugs-tmp/draft4.imp"
if (((REPLY[(((int)(I)) - (1))]) < (97))) goto L_00ba;
#line 468 "regression-bugs-tmp/draft4.imp"
REPLY[(((int)(I)) - (1))] = (((int)(REPLY[(((int)(I)) - (1))])) - (32));
#line 468 "regression-bugs-tmp/draft4.imp"
L_00ba:;
                                                                //    469        %EXIT %IF REPLY(I) = NL
#line 469 "regression-bugs-tmp/draft4.imp"
if (((REPLY[(((int)(I)) - (1))]) != (10))) goto L_00bb;
#line 469 "regression-bugs-tmp/draft4.imp"
goto L_00b8;
#line 469 "regression-bugs-tmp/draft4.imp"
L_00bb:;
                                                                //    470     %REPEAT
#line 470 "regression-bugs-tmp/draft4.imp"
goto L_00b7;
#line 470 "regression-bugs-tmp/draft4.imp"
L_00b8:;
                                                                //    471     REPLY(I) = ' ' %AND I = I+1 %UNTIL I = 9
#line 471 "regression-bugs-tmp/draft4.imp"
L_00bc:;
#line 471 "regression-bugs-tmp/draft4.imp"
REPLY[(((int)(I)) - (1))] = 32;
#line 471 "regression-bugs-tmp/draft4.imp"
I = (((int)(I)) + (1));
#line 471 "regression-bugs-tmp/draft4.imp"
if (((I) == (9))) goto L_00bd;
#line 471 "regression-bugs-tmp/draft4.imp"
goto L_00bc;
#line 471 "regression-bugs-tmp/draft4.imp"
L_00bd:;
                                                                //    472     %IF REPLY(1) = 'M' %THEN MON = 'M' %AND -> READ MOVE
#line 472 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (77))) goto L_00bf;
#line 472 "regression-bugs-tmp/draft4.imp"
MON = 77;
#line 472 "regression-bugs-tmp/draft4.imp"
goto U_1002;
#line 472 "regression-bugs-tmp/draft4.imp"
L_00bf:;
                                                                //    473     %IF REPLY(1) = 'Q' %THEN MON = 'Q' %AND -> READ MOVE
#line 473 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (81))) goto L_00c0;
#line 473 "regression-bugs-tmp/draft4.imp"
MON = 81;
#line 473 "regression-bugs-tmp/draft4.imp"
goto U_1002;
#line 473 "regression-bugs-tmp/draft4.imp"
L_00c0:;
                                                                //    474  TRANS:
#line 474 "regression-bugs-tmp/draft4.imp"
U_1004:;
                                                                //    475     %IF REPLY(1) = 'I' %THEN -> STOP
#line 475 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (73))) goto L_00c1;
#line 475 "regression-bugs-tmp/draft4.imp"
goto U_1005;
#line 475 "regression-bugs-tmp/draft4.imp"
L_00c1:;
                                                                //    476     %IF REPLY(6) = ','%THEN MORE = 'M' %ELSE MORE = ' '
#line 476 "regression-bugs-tmp/draft4.imp"
if (((REPLY[5]) != (44))) goto L_00c2;
#line 476 "regression-bugs-tmp/draft4.imp"
MORE = 77;
#line 476 "regression-bugs-tmp/draft4.imp"
goto L_00c3;
#line 476 "regression-bugs-tmp/draft4.imp"
L_00c2:;
#line 476 "regression-bugs-tmp/draft4.imp"
MORE = 32;
#line 476 "regression-bugs-tmp/draft4.imp"
L_00c3:;
                                                                //    477     OLDPOS = POSITION OF(REPLY(1), REPLY(2))
#line 477 "regression-bugs-tmp/draft4.imp"
OLDPOS = POSITIONOF(REPLY[0], REPLY[1]);
                                                                //    478     NEWPOS = POSITION OF(REPLY(4), REPLY(5))
#line 478 "regression-bugs-tmp/draft4.imp"
NEWPOS = POSITIONOF(REPLY[3], REPLY[4]);
                                                                //    479     %IF VALID POS(OLDPOS) = -1 %START
#line 479 "regression-bugs-tmp/draft4.imp"
if (((VALIDPOS(OLDPOS)) != ((-1)))) goto L_00c4;
                                                                //    480        PRINTSTRING("The square ")
#line 480 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("The square "));
                                                                //    481        PRINT SYMBOL(REPLY(1));  PRINT SYMBOL(REPLY(2))
#line 481 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[0]);
#line 481 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[1]);
                                                                //    482        PRINTSTRING(" does not exist!
#line 482 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal(" does not exist!\n"));
                                                                //    483  ")
                                                                //    484        SAY PLEASE
#line 484 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    485        -> READ MOVE
#line 485 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    486     %FINISH
#line 486 "regression-bugs-tmp/draft4.imp"
L_00c4:;
                                                                //    487     M = VALID POS(NEWPOS)
#line 487 "regression-bugs-tmp/draft4.imp"
M = VALIDPOS(NEWPOS);
                                                                //    488     %IF M = -1 %START
#line 488 "regression-bugs-tmp/draft4.imp"
if (((M) != ((-1)))) goto L_00c5;
                                                                //    489        PRINTSTRING("You cannot move to square ")
#line 489 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You cannot move to square "));
                                                                //    490        PRINTSYMBOL(REPLY(4));  PRINTSYMBOL(REPLY(5))
#line 490 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[3]);
#line 490 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[4]);
                                                                //    491        PRINTSTRING(";  it does not exist!
#line 491 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal(";  it does not exist!\n"));
                                                                //    492  ")
                                                                //    493        SAY PLEASE
#line 493 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    494        -> READ MOVE
#line 494 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    495     %FINISH
#line 495 "regression-bugs-tmp/draft4.imp"
L_00c5:;
                                                                //    496     %IF M = 1 %START
#line 496 "regression-bugs-tmp/draft4.imp"
if (((M) != (1))) goto L_00c6;
                                                                //    497        PRINTSTRING("You cannot move to square ")
#line 497 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You cannot move to square "));
                                                                //    498        PRINT SYMBOL(REPLY(4));  PRINT SYMBOL(REPLY(5))
#line 498 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[3]);
#line 498 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[4]);
                                                                //    499        PRINTSTRING(";  it is already occupied!
#line 499 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal(";  it is already occupied!\n"));
                                                                //    500  ")
                                                                //    501        SAY PLEASE
#line 501 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    502        -> READ MOVE
#line 502 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    503     %FINISH
#line 503 "regression-bugs-tmp/draft4.imp"
L_00c6:;
                                                                //    504     %CYCLE P = 1, 1, OPP(25)
#line 504 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = OPP[26]; P = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle P = 1, 1, OPP[26]");
P -= _increment; _control -= _increment;
L_00c7:;
if (P == _final) goto L_00c8;
P += _increment; _control += _increment;
if (P != _control) _imp_signal(4,2,0,"Corrupt control variable P"); /* FOR loop control variable corrupted */
}
                                                                //    505        %IF OLDPOS = OPP(P) %THENEXIT
#line 505 "regression-bugs-tmp/draft4.imp"
if (((OLDPOS) != (OPP[((P) + ((int)(1)))]))) goto L_00ca;
#line 505 "regression-bugs-tmp/draft4.imp"
goto L_00c8;
#line 505 "regression-bugs-tmp/draft4.imp"
L_00ca:;
                                                                //    506     %REPEAT
#line 506 "regression-bugs-tmp/draft4.imp"
goto L_00c7;
#line 506 "regression-bugs-tmp/draft4.imp"
L_00c8:;
                                                                //    507     %UNLESS OLDPOS = OPP(P) %START
#line 507 "regression-bugs-tmp/draft4.imp"
if (((OLDPOS) == (OPP[((P) + ((int)(1)))]))) goto L_00cb;
                                                                //    508        PRINTSTRING("You do not have a piece on square ")
#line 508 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You do not have a piece on square "));
                                                                //    509        PRINT SYMBOL(REPLY(1));  PRINT SYMBOL(REPLY(2))
#line 509 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[0]);
#line 509 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSYMBOL(REPLY[1]);
                                                                //    510        NEWLINE
#line 510 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    511        SAY PLEASE
#line 511 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    512        -> READ MOVE
#line 512 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    513     %FINISH
#line 513 "regression-bugs-tmp/draft4.imp"
L_00cb:;
                                                                //    514     PIECE = P
#line 514 "regression-bugs-tmp/draft4.imp"
PIECE = P;
                                                                //    515     DIF = NEWPOS-OLDPOS
#line 515 "regression-bugs-tmp/draft4.imp"
DIF = (((int)(NEWPOS)) - (OLDPOS));
                                                                //    516     MODIF = MOD(DIF)
#line 516 "regression-bugs-tmp/draft4.imp"
MODIF = MOD(DIF);
                                                                //    517     %IF MODIF < 12 %AND EXPECTED MOVE > 0 %START
#line 517 "regression-bugs-tmp/draft4.imp"
if (((MODIF) >= (12))) goto L_00cc;
#line 517 "regression-bugs-tmp/draft4.imp"
if (((EXPECTEDMOVE) <= (0))) goto L_00cc;
                                                                //    518        PRINTSTRING("You MUST take the piece that I am offering you
#line 518 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You MUST take the piece that I am offering you\n"));
                                                                //    519  ")
                                                                //    520        SAY PLEASE
#line 520 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    521        -> READ MOVE
#line 521 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    522     %FINISH
#line 522 "regression-bugs-tmp/draft4.imp"
L_00cc:;
                                                                //    523     %IF MODIF < 12 %AND MORE = 'M' %START
#line 523 "regression-bugs-tmp/draft4.imp"
if (((MODIF) >= (12))) goto L_00cd;
#line 523 "regression-bugs-tmp/draft4.imp"
if (((MORE) != (77))) goto L_00cd;
                                                                //    524        PRINTSTRING("That's not part of a multiple jump move
#line 524 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("That's not part of a multiple jump move\n"));
                                                                //    525  ")
                                                                //    526        SAY PLEASE
#line 526 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    527        -> READ MOVE
#line 527 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    528     %FINISH
#line 528 "regression-bugs-tmp/draft4.imp"
L_00cd:;
                                                                //    529     %IF DIF < 0 %AND OPP(PIECE+12) # CROWN %START
#line 529 "regression-bugs-tmp/draft4.imp"
if (((DIF) >= (0))) goto L_00ce;
#line 529 "regression-bugs-tmp/draft4.imp"
if (((OPP[(((unsigned char)((((int)(PIECE)) + (12)))) + (1))]) == (CROWN))) goto L_00ce;
                                                                //    530        PRINTSTRING("You cannot move that piece backwards!
#line 530 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You cannot move that piece backwards!\n"));
                                                                //    531  ")
                                                                //    532        SAY PLEASE
#line 532 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    533        -> READ MOVE
#line 533 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    534     %FINISH
#line 534 "regression-bugs-tmp/draft4.imp"
L_00ce:;
                                                                //    535     %UNLESS MODIF = 11 %OR MODIF = 9 %OR MODIF = 22 %OR MODIF = 18 %START
#line 535 "regression-bugs-tmp/draft4.imp"
if (((MODIF) == (11))) goto L_00cf;
#line 535 "regression-bugs-tmp/draft4.imp"
if (((MODIF) == (9))) goto L_00cf;
#line 535 "regression-bugs-tmp/draft4.imp"
if (((MODIF) == (22))) goto L_00cf;
#line 535 "regression-bugs-tmp/draft4.imp"
if (((MODIF) == (18))) goto L_00cf;
                                                                //    536        PRINTSTRING("That move does not exist in my rule book!
#line 536 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("That move does not exist in my rule book!\n"));
                                                                //    537  ")
                                                                //    538        SAY PLEASE
#line 538 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    539        -> READ MOVE
#line 539 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    540     %FINISH
#line 540 "regression-bugs-tmp/draft4.imp"
L_00cf:;
                                                                //    541     %IF MODIF > 11 %START
#line 541 "regression-bugs-tmp/draft4.imp"
if (((MODIF) <= (11))) goto L_00d0;
                                                                //    542        JUMP = DIF//2
#line 542 "regression-bugs-tmp/draft4.imp"
JUMP = (long)((long)((int)(DIF)) / (long)((int)(2)));
                                                                //    543        COMPOS = OLDPOS+JUMP
#line 543 "regression-bugs-tmp/draft4.imp"
COMPOS = (((int)(OLDPOS)) + (JUMP));
                                                                //    544        %CYCLE I = 1, 1, COMP(25)
#line 544 "regression-bugs-tmp/draft4.imp"
{static int _initial, _increment, _final, _control;
_initial = 1; _increment = 1; _final = COMP[26]; I = _control = _initial;
if (((_final-_initial) % _increment) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, COMP[26]");
I -= _increment; _control -= _increment;
L_00d1:;
if (I == _final) goto L_00d2;
I += _increment; _control += _increment;
if (I != _control) _imp_signal(4,2,0,"Corrupt control variable I"); /* FOR loop control variable corrupted */
}
                                                                //    545           %EXIT %IF COMPOS = COMP(I)
#line 545 "regression-bugs-tmp/draft4.imp"
if (((COMPOS) != (COMP[((I) + ((int)(1)))]))) goto L_00d4;
#line 545 "regression-bugs-tmp/draft4.imp"
goto L_00d2;
#line 545 "regression-bugs-tmp/draft4.imp"
L_00d4:;
                                                                //    546        %REPEAT
#line 546 "regression-bugs-tmp/draft4.imp"
goto L_00d1;
#line 546 "regression-bugs-tmp/draft4.imp"
L_00d2:;
                                                                //    547        %UNLESS COMPOS = COMP(I) %START
#line 547 "regression-bugs-tmp/draft4.imp"
if (((COMPOS) == (COMP[((I) + ((int)(1)))]))) goto L_00d5;
                                                                //    548           PRINTSTRING("You cannot do that.  You are not jumping one of my pieces
#line 548 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You cannot do that.  You are not jumping one of my pieces\n"));
                                                                //    549  ")
                                                                //    550           SAY PLEASE
#line 550 "regression-bugs-tmp/draft4.imp"
SAYPLEASE();
                                                                //    551           -> READ MOVE
#line 551 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    552        %FINISH
#line 552 "regression-bugs-tmp/draft4.imp"
L_00d5:;
                                                                //    553        JMAN = I
#line 553 "regression-bugs-tmp/draft4.imp"
JMAN = I;
                                                                //    554     %FINISH %ELSE JMAN = 0
#line 554 "regression-bugs-tmp/draft4.imp"
goto L_00d6;
#line 554 "regression-bugs-tmp/draft4.imp"
L_00d0:;
#line 554 "regression-bugs-tmp/draft4.imp"
JMAN = 0;
#line 554 "regression-bugs-tmp/draft4.imp"
L_00d6:;
                                                                //    555     MAKE MOVE(DIF, PIECE, JMAN, OPP, COMP)
#line 555 "regression-bugs-tmp/draft4.imp"
MAKEMOVE(DIF, PIECE, &JMAN, &OPP[-((-1))], &COMP[-((-1))]);
                                                                //    556     %IF MORE = 'M' %START
#line 556 "regression-bugs-tmp/draft4.imp"
if (((MORE) != (77))) goto L_00d7;
                                                                //    557        LASTPOS = NEWPOS
#line 557 "regression-bugs-tmp/draft4.imp"
LASTPOS = NEWPOS;
                                                                //    558  READ AGAIN:
#line 558 "regression-bugs-tmp/draft4.imp"
U_1006:;
                                                                //    559        PROMPT("and:")
#line 559 "regression-bugs-tmp/draft4.imp"
_imp_PROMPT(_imp_str_literal("and:"));
                                                                //    560        %CYCLE I = 1, 1, 8
#line 560 "regression-bugs-tmp/draft4.imp"
I = 0;
if ((((8)-(1)) % (1)) != 0) _imp_signal(5,1,0,"Illegal cycle I = 1, 1, 8");
L_00d8:;
if (I == 8) goto L_00d9;
I += 1;
                                                                //    561           READ SYMBOL(REPLY(I))
#line 561 "regression-bugs-tmp/draft4.imp"
_imp_READSYMBOL(&REPLY[(((int)(I)) - (1))]);
                                                                //    562           REPLY(I) = REPLY(I)-32 %IF REPLY(I)>='a'
#line 562 "regression-bugs-tmp/draft4.imp"
if (((REPLY[(((int)(I)) - (1))]) < (97))) goto L_00db;
#line 562 "regression-bugs-tmp/draft4.imp"
REPLY[(((int)(I)) - (1))] = (((int)(REPLY[(((int)(I)) - (1))])) - (32));
#line 562 "regression-bugs-tmp/draft4.imp"
L_00db:;
                                                                //    563           %EXIT %IF REPLY(I) = NL
#line 563 "regression-bugs-tmp/draft4.imp"
if (((REPLY[(((int)(I)) - (1))]) != (10))) goto L_00dc;
#line 563 "regression-bugs-tmp/draft4.imp"
goto L_00d9;
#line 563 "regression-bugs-tmp/draft4.imp"
L_00dc:;
                                                                //    564        %REPEAT
#line 564 "regression-bugs-tmp/draft4.imp"
goto L_00d8;
#line 564 "regression-bugs-tmp/draft4.imp"
L_00d9:;
                                                                //    565        %IF REPLY(1) = '.'%THEN -> COMP MOVE
#line 565 "regression-bugs-tmp/draft4.imp"
if (((REPLY[0]) != (46))) goto L_00dd;
#line 565 "regression-bugs-tmp/draft4.imp"
goto U_1003;
#line 565 "regression-bugs-tmp/draft4.imp"
L_00dd:;
                                                                //    566        REPLY(I) = ' ' %AND I = I+1 %UNTIL I = 9
#line 566 "regression-bugs-tmp/draft4.imp"
L_00de:;
#line 566 "regression-bugs-tmp/draft4.imp"
REPLY[(((int)(I)) - (1))] = 32;
#line 566 "regression-bugs-tmp/draft4.imp"
I = (((int)(I)) + (1));
#line 566 "regression-bugs-tmp/draft4.imp"
if (((I) == (9))) goto L_00df;
#line 566 "regression-bugs-tmp/draft4.imp"
goto L_00de;
#line 566 "regression-bugs-tmp/draft4.imp"
L_00df:;
                                                                //    567        OLDPOS = POSITION OF(REPLY(1), REPLY(2))
#line 567 "regression-bugs-tmp/draft4.imp"
OLDPOS = POSITIONOF(REPLY[0], REPLY[1]);
                                                                //    568        NEWPOS = POSITION OF(REPLY(4), REPLY(5))
#line 568 "regression-bugs-tmp/draft4.imp"
NEWPOS = POSITIONOF(REPLY[3], REPLY[4]);
                                                                //    569        DIF = NEWPOS-OLDPOS
#line 569 "regression-bugs-tmp/draft4.imp"
DIF = (((int)(NEWPOS)) - (OLDPOS));
                                                                //    570        DIF = MOD(DIF)
#line 570 "regression-bugs-tmp/draft4.imp"
DIF = MOD(DIF);
                                                                //    571        %IF DIF > 11 %AND OLDPOS = LASTPOS %THEN -> TRANS
#line 571 "regression-bugs-tmp/draft4.imp"
if (((DIF) <= (11))) goto L_00e1;
#line 571 "regression-bugs-tmp/draft4.imp"
if (((OLDPOS) != (LASTPOS))) goto L_00e1;
#line 571 "regression-bugs-tmp/draft4.imp"
goto U_1004;
#line 571 "regression-bugs-tmp/draft4.imp"
L_00e1:;
                                                                //    572        PRINTSTRING("That's not part of a multiple jump
#line 572 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("That's not part of a multiple jump\nPlease re-type that part\n"));
                                                                //    573  Please re-type that part
                                                                //    574  ")
                                                                //    575        -> READ AGAIN
#line 575 "regression-bugs-tmp/draft4.imp"
goto U_1006;
                                                                //    576     %FINISH
#line 576 "regression-bugs-tmp/draft4.imp"
L_00d7:;
                                                                //    577  COMP MOVE: ! COMPUTER MAKES MOVE.
#line 577 "regression-bugs-tmp/draft4.imp"
U_1003:;
                                                                //    578     %IF COMPNUM = 0 %START
#line 578 "regression-bugs-tmp/draft4.imp"
if (((*COMPNUM) != (0))) goto L_00e2;
                                                                //    579        PRINTSTRING(" I have no pieces left so I suppose you have won
#line 579 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal(" I have no pieces left so I suppose you have won\n"));
                                                                //    580  ")
                                                                //    581        -> STOP
#line 581 "regression-bugs-tmp/draft4.imp"
goto U_1005;
                                                                //    582     %FINISH
#line 582 "regression-bugs-tmp/draft4.imp"
L_00e2:;
                                                                //    583     %IF PENDING MOVE(COMP, OPP) = -1 %START
#line 583 "regression-bugs-tmp/draft4.imp"
if (((PENDINGMOVE(&COMP[-((-1))], &OPP[-((-1))])) != ((-1)))) goto L_00e3;
                                                                //    584        PRINTSTRING("I cannot move any of my pieces so you win
#line 584 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("I cannot move any of my pieces so you win\n"));
                                                                //    585  ")
                                                                //    586         -> STOP
#line 586 "regression-bugs-tmp/draft4.imp"
goto U_1005;
                                                                //    587     %FINISH
#line 587 "regression-bugs-tmp/draft4.imp"
L_00e3:;
                                                                //    588     ! If in end game then increase search.
                                                                //    589     I = COMPNUM+OPPNUM
#line 589 "regression-bugs-tmp/draft4.imp"
I = ((*(int *)(COMPNUM)) + (*OPPNUM));
                                                                //    590     %IF I <= 6 %THEN SEARCH LIMIT = 4
#line 590 "regression-bugs-tmp/draft4.imp"
if (((I) > (6))) goto L_00e4;
#line 590 "regression-bugs-tmp/draft4.imp"
SEARCHLIMIT = 4;
#line 590 "regression-bugs-tmp/draft4.imp"
L_00e4:;
                                                                //    591     ! FIND BEST MOVE.
                                                                //    592     NODES = 0;  SP = 0
#line 592 "regression-bugs-tmp/draft4.imp"
NODES = 0;
#line 592 "regression-bugs-tmp/draft4.imp"
SP = 0;
                                                                //    593     VALUEB = TRY POSSIBLE MOVES(1, 1, COMP, OPP)
#line 593 "regression-bugs-tmp/draft4.imp"
VALUEB = TRYPOSSIBLEMOVES(1, 1, &COMP[-((-1))], &OPP[-((-1))]);
                                                                //    594     %IF VALUEB <= -99990 %START
#line 594 "regression-bugs-tmp/draft4.imp"
if (((VALUEB) > ((-99990)))) goto L_00e5;
                                                                //    595         PRINTSTRING("I resign
#line 595 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("I resign\n"));
                                                                //    596  ")
                                                                //    597         -> STOP
#line 597 "regression-bugs-tmp/draft4.imp"
goto U_1005;
                                                                //    598     %FINISH
#line 598 "regression-bugs-tmp/draft4.imp"
L_00e5:;
                                                                //    599     I = 0
#line 599 "regression-bugs-tmp/draft4.imp"
I = 0;
                                                                //    600  ANOTHER TAKE:
#line 600 "regression-bugs-tmp/draft4.imp"
U_1007:;
                                                                //    601     TROUT(COMP(BEST PIECE), COMP(BEST PIECE)+MOVE(BEST MOVE), I)
#line 601 "regression-bugs-tmp/draft4.imp"
TROUT(COMP[((BESTPIECE) + ((int)(1)))], (((int)(COMP[((BESTPIECE) + ((int)(1)))])) + (MOVE[BESTMOVE])), &I);
                                                                //    602     MAKE MOVE(MOVE(BEST MOVE), BEST PIECE, BEST TAKE, COMP, OPP)
#line 602 "regression-bugs-tmp/draft4.imp"
MAKEMOVE(MOVE[BESTMOVE], BESTPIECE, &BESTTAKE, &COMP[-((-1))], &OPP[-((-1))]);
                                                                //    603     %IF BEST TAKE > 0 %START
#line 603 "regression-bugs-tmp/draft4.imp"
if (((BESTTAKE) <= (0))) goto L_00e6;
                                                                //    604        %CYCLE BEST MOVE = 1, 2, 7
#line 604 "regression-bugs-tmp/draft4.imp"
BESTMOVE = (-1);
if ((((7)-(1)) % (2)) != 0) _imp_signal(5,1,0,"Illegal cycle BESTMOVE = 1, 2, 7");
L_00e7:;
if (BESTMOVE == 7) goto L_00e8;
BESTMOVE += 2;
                                                                //    605           BEST TAKE = VALID MOVE(BEST MOVE, BEST PIECE, COMP, OPP)
#line 605 "regression-bugs-tmp/draft4.imp"
BESTTAKE = VALIDMOVE(BESTMOVE, BESTPIECE, &COMP[-((-1))], &OPP[-((-1))]);
                                                                //    606           -> ANOTHER TAKE %IF BEST TAKE>0
#line 606 "regression-bugs-tmp/draft4.imp"
if (((BESTTAKE) <= (0))) goto L_00ea;
#line 606 "regression-bugs-tmp/draft4.imp"
goto U_1007;
#line 606 "regression-bugs-tmp/draft4.imp"
L_00ea:;
                                                                //    607        %REPEAT
#line 607 "regression-bugs-tmp/draft4.imp"
goto L_00e7;
#line 607 "regression-bugs-tmp/draft4.imp"
L_00e8:;
                                                                //    608     %FINISH
#line 608 "regression-bugs-tmp/draft4.imp"
L_00e6:;
                                                                //    609     NEWLINE
#line 609 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    610     %IF MON = 'M' %START
#line 610 "regression-bugs-tmp/draft4.imp"
if (((MON) != (77))) goto L_00eb;
                                                                //    611        PRINTSTRING("Nodes considered =");  WRITE(NODES, 4)
#line 611 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("Nodes considered ="));
#line 611 "regression-bugs-tmp/draft4.imp"
_imp_WRITE(NODES, 4);
                                                                //    612        PRINTSTRING("
#line 612 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("\nValue of board ="));
                                                                //    613  Value of board =");  WRITE(VALUEB, 4)
#line 613 "regression-bugs-tmp/draft4.imp"
_imp_WRITE(VALUEB, 4);
                                                                //    614        NEWLINE
#line 614 "regression-bugs-tmp/draft4.imp"
_imp_NEWLINE();
                                                                //    615     %FINISH
#line 615 "regression-bugs-tmp/draft4.imp"
L_00eb:;
                                                                //    616     %IF OPPNUM = 0 %START
#line 616 "regression-bugs-tmp/draft4.imp"
if (((*OPPNUM) != (0))) goto L_00ec;
                                                                //    617         PRINTSTRING("You have no pieces left so I win
#line 617 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You have no pieces left so I win\n"));
                                                                //    618  ")
                                                                //    619        -> STOP
#line 619 "regression-bugs-tmp/draft4.imp"
goto U_1005;
                                                                //    620     %FINISH
#line 620 "regression-bugs-tmp/draft4.imp"
L_00ec:;
                                                                //    621     EXPECTED MOVE = PENDING MOVE(OPP, COMP)
#line 621 "regression-bugs-tmp/draft4.imp"
EXPECTEDMOVE = PENDINGMOVE(&OPP[-((-1))], &COMP[-((-1))]);
                                                                //    622     %IF EXPECTED MOVE = -1 %START
#line 622 "regression-bugs-tmp/draft4.imp"
if (((EXPECTEDMOVE) != ((-1)))) goto L_00ed;
                                                                //    623        PRINTSTRING("You cannot move any of your pieces so I win
#line 623 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("You cannot move any of your pieces so I win\n"));
                                                                //    624  ")
                                                                //    625        -> STOP
#line 625 "regression-bugs-tmp/draft4.imp"
goto U_1005;
                                                                //    626     %FINISH
#line 626 "regression-bugs-tmp/draft4.imp"
L_00ed:;
                                                                //    627     %IF VALUEB >= 99990  %AND AWIN = 0 %START
#line 627 "regression-bugs-tmp/draft4.imp"
if (((VALUEB) < (99990))) goto L_00ee;
#line 627 "regression-bugs-tmp/draft4.imp"
if (((AWIN) != (0))) goto L_00ee;
                                                                //    628        PRINTSTRING("He-He!  I am going to win!!
#line 628 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("He-He!  I am going to win!!\n"));
                                                                //    629  ")
                                                                //    630        AWIN = 1
#line 630 "regression-bugs-tmp/draft4.imp"
AWIN = 1;
                                                                //    631     %FINISH
#line 631 "regression-bugs-tmp/draft4.imp"
L_00ee:;
                                                                //    632     -> READ MOVE
#line 632 "regression-bugs-tmp/draft4.imp"
goto U_1002;
                                                                //    633  STOP:
#line 633 "regression-bugs-tmp/draft4.imp"
U_1005:;
                                                                //    634     PRINTSTRING("
#line 634 "regression-bugs-tmp/draft4.imp"
_imp_PRINTSTRING(_imp_str_literal("\nThe final board position is -\n"));
                                                                //    635  The final board position is -
                                                                //    636  ")
                                                                //    637     PRINT BOARD
#line 637 "regression-bugs-tmp/draft4.imp"
PRINTBOARD();
                                                                //    638  %END
#line 638 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return;
} // End of block DRAUGHTS at level 1
                                                                //    639  
                                                                //    640  %begin
#line 640 "regression-bugs-tmp/draft4.imp"
int main(int argc, char **argv) {
  _imp_initialise(argc, argv);
                                                                //    641    select input(0)
#line 641 "regression-bugs-tmp/draft4.imp"
_imp_SELECTINPUT(0);
                                                                //    642    select output(0)
#line 642 "regression-bugs-tmp/draft4.imp"
_imp_SELECTOUTPUT(0);
                                                                //    643    DRAUGHTS("")
#line 643 "regression-bugs-tmp/draft4.imp"
DRAUGHTS(_imp_str_literal(""));
                                                                //    644  %end
#line 644 "regression-bugs-tmp/draft4.imp"
/* Remove %on %event handler here if present for this block */
return 0;
} // End of block _imp_main at level 1
                                                                //    645  
                                                                //    646  %ENDOFFILE
#line 646 "regression-bugs-tmp/draft4.imp"
// End of file
