#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

  int I;

  //     3    %routine R

  void R(void) {
    //     4    %end

    return;
  } /* end of R */

  //     5    %routine RP(%integer I)

  void RP(int I) {
    //     6    %end

    return;
  } /* end of RP */

  // ?I unused
  //     7    %integerarray IA(1:2)

  int IA[2];
  struct _imp_dv IA_dv = {IA, sizeof(int) /*, dims, <bounds> */};

  //     8    %integermap IM

  int *IM(void) {
    //     9      %result == I

    return /*?*/ &I;

    //    10    %end

  } /* end of IM */

  //    11    %integermap IMP(%integer N)

  int *IMP(int N) {
    //    12      %result == IA(N)

    return /*?*/ &IA[N - 1];

    //    13    %end

  } /* end of IMP */

  //    14    %integername IN

  int *IN;

  //    15
  //    16    R

  R();

  //    17    %comment R
  //    18    RP(42)

  RP(42);

  //    19    %comment RP(42)
  //    20    IA(53) = I

  IA[52] = I;

  //    21    %comment IA(53) = I
  //    22    I = IA(64)

  I = IA[63];

  //    23    %comment I = IA(64)
  //    24    IN == IM

  IN = (int *)IM();

  //    25    %comment IN == IM
  //    26    IN == IMP(1)

  IN = (int *)IMP(1);

  //    27    %comment IN == IMP(1)
  //    28    IN == I

  IN = (int *)/*?*/ &I;

  //    29    %comment IN == I
  //    30    IN = I

  *IN = I;

  //    31    %comment IN = I
  //    32    IM = I

  *IM() = I;

  //    33    %comment IM = I
  //    34    IMP(2) = I

  *IMP(2) = I;

  //    35    %comment IMP(2) = I
  //    36
  //    37  %endofprogram

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