#include <perms.h>

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

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

  //     2  {%LONG} %INTEGER L

  int L;

  //     3  %SWITCH SW(2:4)

  int SW_index;
  int SW_line;
  char *SW_file;
  static const void *SW[3] = {&&case_SW_default, &&case_SW_3, &&case_SW_default};

  //     4        L=3

  L = 3;

  //     5        ->SW(L)

  SW_line = __LINE__;
  SW_file = __FILE__;
  SW_index = L;
  goto case_SW_dispatch;

  //     6  SW(*):

case_SW_default:;

//     7        PRINTSTRING("WRONG PLACE"); %STOP

  _imp_PRINTSTRING(_imp_str_literal("WRONG PLACE"));
  _imp_stop(0);

  //     8  SW(3):

case_SW_3:;

//     9        PRINTSTRING("TEST OK

  _imp_PRINTSTRING(_imp_str_literal("TEST OK\n"));

  //    10+ ")
  //    11        %STOP

  _imp_stop(0);

  //    12  %ENDOFPROGRAM

case_SW_dispatch:
  if (SW_index < 2 || SW_index > 4)
    _imp_signalf(6, 3, SW_index, "->SW(%d) out of bounds at %s line %d", SW_index, SW_file, SW_line);
  goto *SW[SW_index - 2];
end_0:;
}