#include <perms.h>

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

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

  //     2    %predicate calgol(%longreal c, %integerfn f(%integer p), %integername n)

  int CALGOL(double C, int (*F)(int P), int *N) {
    //     3      %true %if n = f(n)

    if (*N != F(*N)) goto L_0001;
    return 1 /*TRUE*/;
  L_0001:;

  //     4      %false

    return 0 /*FALSE*/;

    //     5    %end

  } /* end of CALGOL */

  // ?C unused
  //     6    %integerfn simple(%integer param)

  int SIMPLE(int PARAM) {
    //     7      printstring("Called"); newline

    _imp_PRINTSTRING(_imp_str_literal("Called"));
    _imp_NEWLINE();

    //     8      %result = param

    return PARAM;

    //     9    %end

  } /* end of SIMPLE */

  //    10    %longreal a = 1.23

  double A;
  A = 1.23;

  //    11    %integer num

  int NUM;

  //    12    num = 3

  NUM = 3;

  //    13    %if calgol(a, simple, num) %start

  if (!(CALGOL(A, SIMPLE, /*?*/ &NUM))) goto L_0002;

    //    14      num = 1

  NUM = 1;

  //    15    %finish

L_0002:;

//    16  %endofprogram

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