#include <perms.h>

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

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

  //     2  %byteinteger c,d

  unsigned char C;
  unsigned char D;

  //     3  %integer i,j,k

  int I;
  int J;
  int K;

  //     4  %routine test(%byte b,%integername n,%byte c)

  void TEST(unsigned char B, int *N, unsigned char C) {
    //     5  %if c='c' %and b='b' %and n=12345678 %then printstring("test ok ") %c

    if (C != 99) goto L_0001;
    if (B != 98) goto L_0001;
    if (*N != 12345678) goto L_0001;
    _imp_PRINTSTRING(_imp_str_literal("test ok "));
    goto L_0002;
  L_0001:;
    _imp_PRINTSTRING(_imp_str_literal("Fail"));
    /*_imp_monitor(__LINE__, __FILE__, PRETTY_FUNCTION);*/
  L_0002:;

  //     6+        %else printstring("Fail") %and %monitor
  //     7  %end

    return;
  } /* end of TEST */

  //     8  j=12345678

  J = 12345678;

  //     9  test('b',j,'c')

  TEST(98, /*?*/ &J, 99);

  //    10  %endofprogram

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