#include <perms.h>

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

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

  //     2    %integer q,w,e,r,t,y { bump up indexes for easier debugging }

  int Q;
  int W;
  int E;
  int R;
  int T;
  int Y;

  //     3    %recordformat testfm(%integer one, two)

  struct TESTFM {
    union {
      struct {
        int ONE;
        int TWO;
      };
    };
  };

  //     4    %integer u,i,o,p

  int U;
  int I;
  int O;
  int P;

  //     5    %record (testfm) %array test(0:10)

  struct TESTFM TEST[11];
  struct _imp_dv TEST_dv = {TEST, sizeof(struct TESTFM) /*, dims, <bounds> */};

  //     6    %integer a,s,d,f

  int A;
  int S;
  int D;
  int F;

  //     7    q = 5

  Q = 5;

  //     8    a = test(q)_two

  A = TEST[Q].TWO;

  //     9
  //    10  %endofprogram

  _imp_stop(0);
  return 0;
end_0:;
}