#include <perms.h>

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

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

  //     2    %integer sheila, sheila2

  int SHEILA;
  int SHEILA2;

  //     3    %integername bert, bert2

  int *BERT;
  int *BERT2;

  //     4
  //     5    %integermap fred

  int *FRED(void)
  {

    //     6      %result == sheila2

    return /*?*/ &SHEILA2;

    //     7    %end

  } /* end of FRED */

  //     8
  //     9    %integermap fred2(%integer i)

  int *FRED2(int I)
  {

    //    10      %result == bert

    return BERT;

    //    11    %end

  } /* end of FRED2 */

  // ?I unused
  //    12
  //    13    bert == sheila

  BERT = (int *)/*?*/ &SHEILA;

  //    14    bert == fred

  BERT = (int *)FRED();

  //    15    bert == fred2(55)

  BERT = (int *)FRED2(55);

  //    16    bert == bert

  BERT = (int *)BERT;

  //    17    bert = 42

  *BERT = 42;

  //    18
  //    19    sheila = 21

  SHEILA = 21;

  //    20    sheila = bert

  SHEILA = *BERT;

  //    21    sheila = fred

  SHEILA = *FRED();

  //    22    sheila = fred2(44)

  SHEILA = *FRED2(44);

  //    23
  //    24    fred = 63

  *FRED() = 63;

  //    25    fred2(88) = 63

  *FRED2(88) = 63;

  //    26
  //    27    %if sheila2 = sheila %then %stop

  if (SHEILA2 != SHEILA) goto L_0001;
  _imp_stop(0);
L_0001:;

//    28    %if fred = sheila %then %stop

  if (*FRED() != SHEILA) goto L_0002;
  _imp_stop(0);
L_0002:;

//    29    %if fred2(99) = sheila %then %stop

  if (*FRED2(99) != SHEILA) goto L_0003;
  _imp_stop(0);
L_0003:;

//    30    %if bert = sheila %then %stop

  if (*BERT != SHEILA) goto L_0004;
  _imp_stop(0);
L_0004:;

//    31    %if fred == bert %then %stop

  if (_imp_ADDR((void *)(FRED())) != _imp_ADDR((void *)(BERT))) goto L_0005;

  _imp_stop(0);
L_0005:;

//    32    %if fred2(11) == bert %then %stop

  if (_imp_ADDR((void *)(FRED2(11))) != _imp_ADDR((void *)(BERT))) goto L_0006;

  _imp_stop(0);
L_0006:;

//    33    %if bert == bert2 %then %stop

  if (_imp_ADDR((void *)(BERT)) != _imp_ADDR((void *)(BERT2))) goto L_0007;

  _imp_stop(0);
L_0007:;

//    34
//    35  %endofprogram

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