#include <perms.h>
void Ddelay(int Secs) {
  extern void Sleep(int Secs);
  Sleep(Secs);
}
void Haunt(_imp_string Dummy) {
  int Rem(int Num, int Den) { return (Num - Num / Den * Num); }
  static const int Maxvictims = 10;
  static const int Maxmessages = 303;
  static const int Minutes = 1;
  _imp_string Victim[10 /*1:10*/];
  int Procno;
  int Numvictims;
  int Thisvictim;
  int Times;
  int Delay;
  int Maxtimes;
  int Selected;
  static _imp_string Blurb;
  _imp_string Procname;
  Delay = 10;
  Maxtimes = 60 / Delay * Minutes;
  static const _imp_string Message[304 /*0:303*/] = {[0 ... 7] = _imp_str_literal("We hates Pascal!!!"),
                                                     _imp_str_literal("Weeble"),
                                                     _imp_str_literal("SYN SYN SYN NAK"),
                                                     _imp_str_literal("SYN SYN SYN ACK"),
                                                     _imp_str_literal("SYN SYN SYN WABT"),
                                                     _imp_str_literal("(CADDDDDADADADADR X)"),
                                                     _imp_str_literal("*device timeout"),
                                                     _imp_str_literal("%CLI-W-INSFPRM"),
                                                     _imp_str_literal("MAKE 'FRED :JIM"),
                                                     _imp_str_literal("Hack an Ent today"),
                                                     _imp_str_literal("**HOST DOWN"),
                                                     _imp_str_literal("PASCAL: No Thanks"),
                                                     _imp_str_literal("Supermac is Back."),
                                                     _imp_str_literal("Vangelis isn't Dutch"),
                                                     _imp_str_literal("DTE -> DCE SARM F (B)"),
                                                     _imp_str_literal("3-space indentation??"),
                                                     _imp_str_literal("CHR(7) - rings a bell?"),
                                                     _imp_str_literal("Gimme back my 10p!!"),
                                                     _imp_str_literal("A Masochist on a diet?"),
                                                     _imp_str_literal("Turn the tape over.."),
                                                     _imp_str_literal("Have an index card."),
                                                     _imp_str_literal("Device type:"),
                                                     _imp_str_literal("Its frothy man."),
                                                     _imp_str_literal("Quine-McWHO????"),
                                                     _imp_str_literal("Try chasing the dream."),
                                                     _imp_str_literal("Tangram Time!"),
                                                     _imp_str_literal("Hi there Stan"),
                                                     _imp_str_literal("Sod ML (attrib [MID])"),
                                                     _imp_str_literal("HALT INST EXECUTED"),
                                                     _imp_str_literal("ISYS80 V3.17"),
                                                     _imp_str_literal("WSLXVANMAT for pres."),
                                                     _imp_str_literal("R0 = 00000804"),
                                                     _imp_str_literal("Symbolic stack dump:"),
                                                     _imp_str_literal("@173000G"),
                                                     _imp_str_literal("This must be Thursday?"),
                                                     _imp_str_literal("What a party..."),
                                                     _imp_str_literal("Confirmed."),
                                                     _imp_str_literal("Right? ... Check!"),
                                                     _imp_str_literal("$ SET NOCONTROL_Y"),
                                                     _imp_str_literal("Noohoosferra Burzi??"),
                                                     _imp_str_literal("Welcome to VAX/VMS v^O"),
                                                     _imp_str_literal("Mostly Harmless..."),
                                                     _imp_str_literal("VAX user service resu"),
                                                     _imp_str_literal("prepare to die"),
                                                     _imp_str_literal("Ecce Ecce F'tang"),
                                                     _imp_str_literal("page owner violation"),
                                                     _imp_str_literal("We wants a shrubbery"),
                                                     _imp_str_literal("European or African??"),
                                                     _imp_str_literal("Can I have a synopsys?"),
                                                     _imp_str_literal("Kohilla Kohilla Splugh"),
                                                     _imp_str_literal("Conversing..."),
                                                     _imp_str_literal("%PAS-F-CASSELBOU"),
                                                     _imp_str_literal("Baroque is Beautiful"),
                                                     _imp_str_literal("WSLXVANMAT"),
                                                     _imp_str_literal("**END**"),
                                                     _imp_str_literal("Heeee-Haw."),
                                                     _imp_str_literal("Kirk to Enterprise..."),
                                                     _imp_str_literal("Zot!"),
                                                     _imp_str_literal("You must be joking"),
                                                     _imp_str_literal("[] : *a list"),
                                                     _imp_str_literal("false : bool"),
                                                     _imp_str_literal("47 : num"),
                                                     _imp_str_literal("- : elephant"),
                                                     _imp_str_literal("[-;-] : butterfly list"),
                                                     _imp_str_literal("You need more monkeys."),
                                                     _imp_str_literal("Have a gorilla.."),
                                                     _imp_str_literal("Have a chocolate frog."),
                                                     _imp_str_literal("->@putslice(1:0,fred)"),
                                                     _imp_str_literal("POSITIVE shields!!!"),
                                                     _imp_str_literal("WHAT WHAT WHAT WHAT??"),
                                                     _imp_str_literal("what what What WHAT??"),
                                                     _imp_str_literal("addr(253)"),
                                                     _imp_str_literal("* Form          |"),
                                                     _imp_str_literal("SWITCH,SWITCH,SWITCH"),
                                                     _imp_str_literal("TICK,TICK,TICK,TICK"),
                                                     _imp_str_literal("string(addr(p_p1))=\"\""),
                                                     _imp_str_literal("Failure: m0"),
                                                     _imp_str_literal("Mind if I smoke?"),
                                                     _imp_str_literal("External missing"),
                                                     _imp_str_literal("Int:."),
                                                     _imp_str_literal("BDBDBD Hi there, Buck."),
                                                     _imp_str_literal("0000 *a*"),
                                                     _imp_str_literal("0 files"),
                                                     _imp_str_literal("Hi there, Steve."),
                                                     _imp_str_literal("Cif:"),
                                                     _imp_str_literal("Weebles wobble."),
                                                     _imp_str_literal("Stopped."),
                                                     _imp_str_literal("You Have Mail."),
                                                     _imp_str_literal("Play it again, Sam."),
                                                     _imp_str_literal("Play it again, Sid."),
                                                     _imp_str_literal("You have been Warned."),
                                                     _imp_str_literal(">%c"),
                                                     _imp_str_literal(">(l0(f1/!/l40\\f/!/)0)0"),
                                                     _imp_str_literal("Apologies accepted."),
                                                     _imp_str_literal("Push the button, Max."),
                                                     _imp_str_literal("Try Oiling it."),
                                                     _imp_str_literal("Caimbridge, caimbridge"),
                                                     _imp_str_literal("Dont Panic. Dont Panic"),
                                                     _imp_str_literal("Coffee time..."),
                                                     _imp_str_literal("Time to feed the alien"),
                                                     _imp_str_literal("Complexity = O(nlog(n)"),
                                                     _imp_str_literal("Disk reversal error."),
                                                     _imp_str_literal("PDS is on the bridge"),
                                                     _imp_str_literal("PSR has been and gone"),
                                                     _imp_str_literal("We'd better call Stan."),
                                                     _imp_str_literal("Sid is innocent!"),
                                                     _imp_str_literal("Oh no, not again."),
                                                     _imp_str_literal("Beep-beep."),
                                                     _imp_str_literal("Page Page Page"),
                                                     _imp_str_literal("Swap Swap Swap"),
                                                     _imp_str_literal("Oh, Good grief"),
                                                     _imp_str_literal("Get the Purple One"),
                                                     _imp_str_literal("Put it in the curry"),
                                                     _imp_str_literal("Rooner Spools OK"),
                                                     _imp_str_literal("Slide rules OK"),
                                                     _imp_str_literal("Dyslexia rules KO"),
                                                     _imp_str_literal("Queen rules UK"),
                                                     _imp_str_literal("Apathy might rule OK"),
                                                     _imp_str_literal("Cannot open input."),
                                                     _imp_str_literal("%SYSTEM-F-ABORT,abort"),
                                                     _imp_str_literal("NO."),
                                                     _imp_str_literal("Phasers locked on."),
                                                     _imp_str_literal("Shields are now dead."),
                                                     _imp_str_literal("*indentation       |"),
                                                     _imp_str_literal("No more room in cube"),
                                                     _imp_str_literal("Filename:"),
                                                     _imp_str_literal("Invalid Password."),
                                                     _imp_str_literal("SET [ DEAD ]"),
                                                     _imp_str_literal("SET [ **EOT** ]"),
                                                     _imp_str_literal("My brain hurts"),
                                                     _imp_str_literal("*T .BG;CA"),
                                                     _imp_str_literal("Reel..Zot..Clamp"),
                                                     _imp_str_literal("Trund!!"),
                                                     _imp_str_literal("Beware of the Trund"),
                                                     _imp_str_literal("Illegal opcode"),
                                                     _imp_str_literal("Dont even Bother"),
                                                     _imp_str_literal("WET PAINT"),
                                                     _imp_str_literal("** CONSOLE FAILURE"),
                                                     _imp_str_literal("** OUTPUT LOST"),
                                                     _imp_str_literal("Are you sure ?"),
                                                     _imp_str_literal("Delete?"),
                                                     _imp_str_literal("** Too many externals"),
                                                     _imp_str_literal("Host:v"),
                                                     _imp_str_literal("Number 149"),
                                                     _imp_str_literal("Rivet. Rivet."),
                                                     _imp_str_literal("Try typing <return>"),
                                                     _imp_str_literal("Type Q to quit"),
                                                     _imp_str_literal("SYN SYN SYN RABBIT"),
                                                     _imp_str_literal("%diagnose 2<<14+255"),
                                                     _imp_str_literal("//EXEC FORT"),
                                                     _imp_str_literal("Beam me up, Scotty!!"),
                                                     _imp_str_literal("Glad to be of service."),
                                                     _imp_str_literal("Tap out the code...."),
                                                     _imp_str_literal("Wretched, isn't it?"),
                                                     _imp_str_literal("MCR>PIP *.*;*/DE"),
                                                     _imp_str_literal("X.IMP deleted"),
                                                     _imp_str_literal("...a collum matrix..."),
                                                     _imp_str_literal("PHUT-THINK-CLICK"),
                                                     _imp_str_literal("%endofprogramme"),
                                                     _imp_str_literal("1 statements compiled"),
                                                     _imp_str_literal("Coojagoa Burzi??"),
                                                     _imp_str_literal("I/O Silver."),
                                                     _imp_str_literal("OKOKOKKO @"),
                                                     _imp_str_literal(".LT1 *A*"),
                                                     _imp_str_literal("Hello lift"),
                                                     _imp_str_literal(".KJOB"),
                                                     _imp_str_literal("your days are numbered"),
                                                     _imp_str_literal("** CRASH IMMINENT"),
                                                     _imp_str_literal("Wargle Wargle"),
                                                     _imp_str_literal("57 varieties"),
                                                     _imp_str_literal("_OPA0: \"Backup"),
                                                     _imp_str_literal("Regardez, gentlemen.."),
                                                     _imp_str_literal("What, pray tell??"),
                                                     _imp_str_literal("So what, Mark?"),
                                                     _imp_str_literal("Fiddle-de-dee"),
                                                     _imp_str_literal("42"),
                                                     _imp_str_literal("Forty-Two"),
                                                     _imp_str_literal("42=7*9"),
                                                     _imp_str_literal("RND(X) = 17 for all X"),
                                                     _imp_str_literal("xxx~~~//][()?"),
                                                     _imp_str_literal("Live long and prosper"),
                                                     _imp_str_literal("Pass your maths, guyyz"),
                                                     _imp_str_literal("Space, it says, is BIG"),
                                                     _imp_str_literal("We've got you covered"),
                                                     _imp_str_literal("NEGATIVE shields."),
                                                     _imp_str_literal(">M-*k*;%c"),
                                                     _imp_str_literal("Chewbacca is cuddly"),
                                                     _imp_str_literal("Apathetic bloddy panic"),
                                                     _imp_str_literal("Metaphysical Imagery.."),
                                                     _imp_str_literal("I'm running out of Ink"),
                                                     _imp_str_literal("BNAG!!!!!"),
                                                     _imp_str_literal("HNAG!!!!!"),
                                                     _imp_str_literal("Fs link HNUG?"),
                                                     _imp_str_literal("CODE+GLAP+DIAGS=0"),
                                                     _imp_str_literal("** corrupt diags"),
                                                     _imp_str_literal("** diagnostics looping"),
                                                     _imp_str_literal("**execution error:ille"),
                                                     _imp_str_literal("** Segment error"),
                                                     _imp_str_literal("LIB - *FATAL*"),
                                                     _imp_str_literal("Edwin error 14."),
                                                     _imp_str_literal("[0 XACTIONS AFFECTED]"),
                                                     _imp_str_literal("I am lying."),
                                                     _imp_str_literal("Coruscate, coruscate"),
                                                     _imp_str_literal("Geezanarra DECtape"),
                                                     _imp_str_literal(".("),
                                                     _imp_str_literal("Type YES to continue"),
                                                     _imp_str_literal("SAY \"XYZZY\""),
                                                     _imp_str_literal("SAY \"PLUGH\""),
                                                     _imp_str_literal("Clams got arms!"),
                                                     _imp_str_literal("Clams got livers!"),
                                                     _imp_str_literal("*CRASH*"),
                                                     _imp_str_literal("FRED OBJ not on DT2"),
                                                     _imp_str_literal("Alarm set for 08:00"),
                                                     _imp_str_literal("The Bells...."),
                                                     _imp_str_literal("*** Spelling errur"),
                                                     _imp_str_literal("* Processor head crash"),
                                                     _imp_str_literal("mouldy breadboard err"),
                                                     _imp_str_literal("sliced breadboard err"),
                                                     _imp_str_literal("greasy chip error"),
                                                     _imp_str_literal("Resistance is Useless!"),
                                                     _imp_str_literal("Production rules OK"),
                                                     _imp_str_literal("ZZZZZZZZZZzzzzzzzz...."),
                                                     _imp_str_literal("Merde alors"),
                                                     _imp_str_literal("Foute-moi le camp!"),
                                                     _imp_str_literal("Scheiss ab!"),
                                                     _imp_str_literal("Va t'en faire baiser"),
                                                     _imp_str_literal("Pisse-toi, salaud!"),
                                                     _imp_str_literal("`X' (attrib Schulze)"),
                                                     _imp_str_literal("----------------------"),
                                                     _imp_str_literal("PASCAL is good AS CLAP"),
                                                     _imp_str_literal("Zaphod's just zis guy."),
                                                     _imp_str_literal("Dis is vot ve find...."),
                                                     _imp_str_literal(".BLISS is ignorance"),
                                                     _imp_str_literal("Pickle a squirrel"),
                                                     _imp_str_literal("Eat a beaver"),
                                                     _imp_str_literal("We hates it..."),
                                                     _imp_str_literal("Ian was here"),
                                                     _imp_str_literal("TANSTAAFL"),
                                                     _imp_str_literal("Elbereth"),
                                                     _imp_str_literal("Haunting you is fun..."),
                                                     _imp_str_literal("You need another quote"),
                                                     _imp_str_literal("EEEEXXXXXcellent !!"),
                                                     _imp_str_literal("HAUNT HAUNT !!"),
                                                     _imp_str_literal("TJ's for BMs OK!"),
                                                     _imp_str_literal("Sauron Lives"),
                                                     _imp_str_literal("Zap a Balrog - TODAY"),
                                                     _imp_str_literal("Its a FEATURE!!!"),
                                                     _imp_str_literal("I shall return..."),
                                                     _imp_str_literal("Let us pray"),
                                                     _imp_str_literal("%MOUSES-I-HI_THERE"),
                                                     _imp_str_literal("Ho, Hummmmmm"),
                                                     _imp_str_literal("Have a nasty day!"),
                                                     _imp_str_literal("I WANNA COOKIE!!!"),
                                                     _imp_str_literal("Share and enjoy"),
                                                     _imp_str_literal("P_dsno = P_ssno+17"),
                                                     _imp_str_literal("Suicide is painless"),
                                                     _imp_str_literal("Laura rules!"),
                                                     _imp_str_literal("Polly wants a biscuit"),
                                                     _imp_str_literal("It's the rugby club"),
                                                     _imp_str_literal("Time for moussaka"),
                                                     _imp_str_literal("%SLART-E-BARFAAST"),
                                                     _imp_str_literal("I'm a FORTRAN man!!!"),
                                                     _imp_str_literal("Nibble a happy warthog"),
                                                     _imp_str_literal("T. Dream time!!"),
                                                     _imp_str_literal("Ve are ze robots!!"),
                                                     _imp_str_literal("yojne dna erahS"),
                                                     _imp_str_literal("FrreeeyyyOOOWWWW!!!"),
                                                     _imp_str_literal("Structured BASIC ????"),
                                                     _imp_str_literal("%Rms-e-korsakoff"),
                                                     _imp_str_literal("NOPR-ERR"),
                                                     _imp_str_literal("Clams got legs!!!"),
                                                     _imp_str_literal("Wheeeeeeeeeeeee!!"),
                                                     _imp_str_literal("EM Char in stmt"),
                                                     _imp_str_literal("Mouses rules OK"),
                                                     _imp_str_literal("IMP yourself today"),
                                                     _imp_str_literal("Hi there"),
                                                     _imp_str_literal("Yummmmmmmmm"),
                                                     _imp_str_literal("Mouses rules OK"),
                                                     _imp_str_literal("Have a nice day!"),
                                                     _imp_str_literal("Friend or foe???"),
                                                     _imp_str_literal("EMAS is great (honest)"),
                                                     _imp_str_literal("%MTHLIB-E-FLOOVEMAT"),
                                                     _imp_str_literal("Another silly message"),
                                                     _imp_str_literal("As you wish, so be it."),
                                                     _imp_str_literal("You may call me Mazda."),
                                                     _imp_str_literal("Groovy, man."),
                                                     _imp_str_literal("%control K'101011'"),
                                                     _imp_str_literal("PROCESS RUNNING"),
                                                     _imp_str_literal("movl #^xDEAD, r0"),
                                                     _imp_str_literal("movl #^xB00B, r0"),
                                                     _imp_str_literal("Filestore down til 11"),
                                                     _imp_str_literal("Error: ';' expected"),
                                                     _imp_str_literal("Another layer of metal"),
                                                     _imp_str_literal("You have mail from SM"),
                                                     _imp_str_literal("TEXT FOR F?"),
                                                     _imp_str_literal("AV nowhere to be found"),
                                                     _imp_str_literal("BDKH:BAD SEGMENT")};
  int Randommessno(void) {
    static int K1 = 0;
    int K2;
    for (;;) {
      K1 = (K1 * 125 + 1) & 16383;
      K2 = Imod(K1);
      K2 = Rem(K2, Maxmessages + 1);
      if (0 <= K2 && K2 <= Maxmessages) return (K2);
    }
  }
  if (*Length(Dummy) == 0) {
    Numvictims = 0;
    Prompt(_imp_str_literal("Victim:"));
    while (Numvictims <= Maxvictims) {
      Procname = _imp_str_literal("");
      while (Nextch() <= ' ' && Nextch() != 25) Skipsymbol();
      if (Nextch() == 25) break;
      while (Nextsymbol() != Nl) {
        Procname = _imp_join(Procname, Tostring(Nextsymbol()));
        Skipsymbol();
      }
      if (_imp_strcmp(Procname, _imp_str_literal(".end")) == 0 || _imp_strcmp(Procname, _imp_str_literal(".END")) == 0)
        break;
      Numvictims++;
      Victim[Numvictims] = Procname;
    }
  } else {
    Victim[1] = Dummy;
    Numvictims = 1;
  }
  for (Times = 1; Times <= Maxtimes; Times++) {
    Ddelay(Delay);
    for (Thisvictim = 1; Thisvictim <= Numvictims; Thisvictim++) {
      Selected = Randommessno();
      Printstring(Message[Selected]);
      Newline();
    }
  }
}
int _imp_mainep(int _imp_argc, char **_imp_argv) {
  Selectoutput(0);
  Haunt(_imp_str_literal("user"));
  exit(0);
  return (1);
}
