#include <perms.h>

//          Edinburgh IMP77 Compiler - Version 8.4
//
//     1  !%constinteger one=1, two=one+one
//     2  %constinteger one=1, two=2
//     3
//     4  %constintegerarray fred(1:4) = one, one+one, two+one, two*two

const int FRED[4] = {1, 2, 3, 4};

//     5
//     6  %begin

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

  //     7    %switch x(1:4)

  int X_index;
  int X_line;
  char *X_file;
  static const void *X[4] = {&&case_X_1, &&case_X_2, &&case_X_3, &&case_X_4};

  //     8    x(one):

case_X_1:;

//     9    x(one+one):

case_X_2:;

//    10    x(two+one):

case_X_3:;

//    11    x(two*two):

case_X_4:;

//    12  %endofprogram

  _imp_stop(0);
  return 0;

case_X_dispatch:
  if (X_index < 1 || X_index > 4)
    _imp_signalf(6, 3, X_index, "->X(%d) out of bounds at %s line %d", X_index, X_file, X_line);
  goto *X[X_index - 1];
end_0:;
}