#include <perms.h>

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

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

  //     2     %integer faults = -42

  int FAULTS;
  FAULTS = -42;

  //     3     %if faults > 0 %start

  if (FAULTS <= 0) goto L_0001;

    //     4        ! Label ID generation messes up due to block structure. Note that the problem
    //     5        ! is either in pass1 or icode2ast.c - changing genc.c to output the block as
    //     6        ! an anonymous procedure or just a simple C "{ ... }" grouping has no effect
    //     7        ! on the label IDs used for these two %if statements...
    //     8        %begin

  { /*%begin*/

    //     9           printsymbol('s') %if faults > 1

    if (FAULTS <= 1) goto L_0001;
    _imp_PRINTSYMBOL(115);
  L_0001:;

  //    10           printstring("BUG!"); newline

    _imp_PRINTSTRING(_imp_str_literal("BUG!"));
    _imp_NEWLINE();

    //    11        %end

    goto end_1000;
  end_1000:;
  }

  //    12     %finish

L_0002:;

//    13  %end %of %program

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