#include <perms.h>

//          Edinburgh IMP77 Compiler - Version 8.4
//
//     1  %begin

int main(int argc, char **argv) { /*%begin*/
  _imp_initialise(argc, argv);

  //     2    %integer i, j, k, l

  int I;
  int J;
  int K;
  int L;

  //     3
  //     4  userlab:

U_1000:;

//     5
//     6    printstring("until:")

  _imp_PRINTSTRING(_imp_str_literal("until:"));

  //     7    %cycle

L_0001:;

//     8      printstring("until exit:")

  _imp_PRINTSTRING(_imp_str_literal("until exit:"));

  //     9      %exitif i=k

  if (I != K) goto L_0002;
  goto L_0003;
L_0002:;

//    10      printstring("until continue:")

  _imp_PRINTSTRING(_imp_str_literal("until continue:"));

  //    11      %continueif k=l

  if (K != L) goto L_0004;
  goto L_0005;
L_0004:;

//    12      printstring("until repeat:")

  _imp_PRINTSTRING(_imp_str_literal("until repeat:"));

  //    13    %repeatuntil i=j

L_0005:;
  if (I == J) goto L_0003;
  goto L_0001;
L_0003:;

//    14
//    15    printstring("while:");

  _imp_PRINTSTRING(_imp_str_literal("while:"));

  //    16    %while j#k %cycle

L_0006:;
  if (J == K) goto L_0007;

    //    17      printstring("while exit:")

  _imp_PRINTSTRING(_imp_str_literal("while exit:"));

  //    18      %exitif i=k

  if (I != K) goto L_0008;
  goto L_0007;
L_0008:;

//    19      printstring("while continue:")

  _imp_PRINTSTRING(_imp_str_literal("while continue:"));

  //    20      %continueif k=l

  if (K != L) goto L_0009;
  goto L_000A;
L_0009:;

//    21      printstring("while repeat:")

  _imp_PRINTSTRING(_imp_str_literal("while repeat:"));

  //    22    %repeat

L_000A:;
  goto L_0006;
L_0007:;

//    23
//    24    printstring("for:");

  _imp_PRINTSTRING(_imp_str_literal("for:"));

  //    25    %for i = j,1,k %cycle

  // %for I = J, 1, K %cycle
  {
    int _initial = J, _final = K;
    if (invalid_for_loop(_initial, 1, _final)) _imp_signal(5, 1, 0, "Illegal cycle I = J, 1, K");
    I = _initial - (1);
  L_000B:
    if (I == _final) goto L_000C;
    I += 1;

    //    26      printstring("for exit:")

    _imp_PRINTSTRING(_imp_str_literal("for exit:"));

    //    27      %exitif i=k

    if (I != K) goto L_000E;
    goto L_000C;
  L_000E:;

  //    28      printstring("for continue:")

    _imp_PRINTSTRING(_imp_str_literal("for continue:"));

    //    29      %continueif k=l

    if (K != L) goto L_000F;
    goto L_000D;
  L_000F:;

  //    30      printstring("for repeat:")

    _imp_PRINTSTRING(_imp_str_literal("for repeat:"));

    //    31    %repeat

  L_000D:;
    goto L_000B;
  }

L_000C:;

//    32
//    33  ->userlab

  goto U_1000;

  //    34
  //    35  %endofprogram

end_0:;
}