#include <perms.h>

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

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

  //     2  %recordformat f(%integer i,j,k)

  struct F {
    union {
      struct {
        int I;
        int J;
        int K;
      };
    };
  };

  //     3  %record(f) expopnd

  struct F EXPOPND;

  //     4  %routine test

  void TEST(void) {
    //     5  %record(f)space

    struct F SPACE;

    //     6  %record(f)%name opnd1

    struct F *OPND1;

    //     7  opnd1==space

    OPND1 = (struct F *)/*?*/ &SPACE;

    //     8  opnd1_i=13

    OPND1->I = 13;

    //     9  expopnd=opnd1

    EXPOPND = *OPND1;

    //    10  %end

    return;
  } /* end of TEST */

  //    11  test

  TEST();

  //    12  %if expopnd_i=13 %then printstring("TEST OK") %else printstring("FAIL")

  if (EXPOPND.I != 13) goto L_0001;
  _imp_PRINTSTRING(_imp_str_literal("TEST OK"));
  goto L_0002;
L_0001:;
  _imp_PRINTSTRING(_imp_str_literal("FAIL"));
L_0002:;

//    13  %endofprogram

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