#include <perms.h>

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

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

  //     2    %recordformat low(%integer a, b, c, d)

  struct LOW {
    union {
      struct {
        int A;
        int B;
        int C;
        int D;
      };
    };
  };

  //     3    %recordformat mid(%real p, q, r, %record(low) x)

  struct MID {
    union {
      struct {
        float P;
        float Q;
        float R;
        struct LOW X;
      };
    };
  };

  //     4    %recordformat top(%string(255) f, %string(255) g, %string(255) h, %record (mid) e)

  struct TOP {
    union {
      struct {
        _imp_string255 F;
        _imp_string255 G;
        _imp_string255 H;
        struct MID E;
      };
    };
  };

  //     5
  //     6    %record (top) rec

  struct TOP REC;

  //     7
  //     8    %integer n

  int N;

  //     9
  //    10    rec_e_x_d = 42

  REC.E.X.D = 42;

  //    11
  //    12  %endofprogram

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