#include <perms.h>
int _imp_mainep(int _imp_argc, char **_imp_argv) {
  static int Main = 1;
  static int Pre = 2;
  static int Bin = 1;
  static int Lis = 2;
  static int Opmask = 0xF000;
  static int Macro = 0xA000;
  static int Fmask = 0x0800;
  static int Umask = 0x0200;
  static int Reg = 0x0080;
  static int Memmask = 0x0040;
  static int Relmask = 0x0020;
  static int Xmask = 0x0010;
  static int Regxmask = 0x0090;
  static int Reluxmask = 0x0230;
  static int Codepos;
  static int Startpos;
  static int Getpos;
  static int Putpos;
  static int Pseudolim;
  static int Printpos;
  static int Faultpos;
  static int Maclim;
  static int Mp;
  static int Qbase;
  static int Qstart;
  static int Qlim;
  static int Transf;
  static int Defmin;
  static int Deflim;
  static int Almax;
  static int Labmin;
  static int Lablim;
  static int Bp;
  static int Np;
  static int Storelim;
  int Sym;
  int Term;
  int Fsym;
  static int Chars = 0;
  static int Lines = 0;
  static int Pass = -1;
  static int List = -1;
  int Asscond;
  int Skip;
  static int Save = 1;
  static int Temps = 12;
  static int Control = 0x40;
  static int Check = 0;
  int Loctype;
  int Loc;
  int Acc;
  int Atype;
  int Aval;
  int Creg;
  int Cond;
  int Dreg;
  int Duse;
  int Type;
  int Val;
  int Tag1;
  int Tag2;
  int Mode;
  int Pend;
  int Flag;
  int Sbound;
  Sbound = Freestore() - 260;
  if (Outdev == 2) Sbound -= 256;
  Selectoutput(Lis);
  if (Outdev == 2) Sbound -= 256;
  int Store[Sbound];
  int Char(int P) { return (*Byteinteger(P)); }
  void Putchar(int K) {
    *Byteinteger(Putpos) = K;
    Putpos++;
  }
  void Fault(int K) {
    if (Fsym == ' ') Fsym = K;
  }
  void Print(int K) {
    *Integer(Codepos + Chars) = K;
    Chars++;
  }
  void Printword(int V) {
    void Printhit(int V) {
      V = (V & 15) + '0';
      if (V > '9') V += 7;
      Print(V);
    }
    void Print1(int V) {
      Printhit((unsigned)V >> 4);
      Printhit(V);
    }
    Print1((unsigned)V >> 8);
    Print1(V);
  }
  void Printloc(void) {
    Printword(Loc);
    if (Loctype & Relmask)
      Print('\'');
    else
      Print(' ');
    Print(' ');
  }
  void Donewline(void) {
    Newline();
    Lines++;
    if (Lines == 61) {
      Newlines(2);
      Lines = 0;
    }
  }
  void Printline(void) {
    void Printit(int Sub) {
      static int Marker = 124;
      int P;
      int Q;
      int K;
      if (Chars == 0 && Char(Printpos) == Nl) return;
      Printsymbol(Fsym);
      Space();
      P = Codepos;
      Q = P + Chars;
      while (P != Q) {
        Printsymbol(*Integer(P));
        P++;
      }
      if (!Printpos) return;
      Spaces(17 - Chars);
      P = Printpos;
      Q = 0;
      for (;;) {
        if (P == Faultpos) Printsymbol(Marker);
        K = Char(P);
        if (P == Pseudolim) K = Sub;
        if ((K ^ Q) & 128) Printsymbol('\'');
        if (K == Nl) return;
        Printsymbol(K & 127);
        P++;
        Q = K;
      }
    }
    if (!Pass) return;
    if (List >= 0 && (Printpos != 0 || Fsym != ' ' || (List & 1) != 0)) {
      if (!Lines) Newlines(3);
      Printit(' ');
      Donewline();
    }
    if (Fsym != ' ' && Outdev != 1) {
      Selectoutput(0);
      if (!Printpos) Printpos = Startpos;
      if (!Chars) Printloc();
      Printit(Nl);
      Newline();
      Selectoutput(Lis);
    }
    Fsym = ' ';
    Printpos = 0;
    Chars = 0;
  }
  void Putword(int V) {
    Check = Check ^ V;
    Selectoutput(Bin);
    Printch(((unsigned)V >> 12 & 15) + Control);
    Printch(((unsigned)V >> 8 & 15) + 0x40);
    Printch(((unsigned)V >> 4 & 15) + 0x40);
    Printch((V & 15) + 0x40);
    Control = 0x50;
    Selectoutput(Lis);
  }
  void Plantval(void) {
    if (Pass > 0) {
      if (!Chars)
        if (Printpos)
          Printloc();
        else {
          Print(' ');
          Print(' ');
          Print(' ');
          Print(' ');
          Print(' ');
          Print(' ');
        }
      if (Chars == 10) Print(' ');
      Printword(Val);
      Putword(Val);
      if (Type & Relmask) Print('\'');
      if (Chars >= 15) Printline();
    }
    Loc++;
  }
  void Plant(int V) {
    int Thold;
    int Vhold;
    Thold = Type;
    Vhold = Val;
    Type = 0;
    Val = V;
    Plantval();
    Type = Thold;
    Val = Thold;
  }
  void Nest(int K) {
    Np--;
    *Integer(Np) = K;
  }
  void Setlab(int Dest) {
    int P;
    int Q;
    Q = 0;
    for (;;) {
      Type = *Integer(Np);
      P = (Type & 0x3FF) + Deflim;
      Np++;
      Val = *Integer(Np);
      Np++;
      Atype = -1;
      Creg = -1;
      Flag = 0;
      if (!(Type & 0x800)) {
        if (Dest - Val + Pass <= 128) Flag = 1;
      } else if (Type & 0x400)
        if (Dest - Val + Pass + Pass == 1) Flag = 2;
      if (!Pass) {
        Dest -= Flag;
        *Integer(P) = Dest;
        if (Flag) {
          Loc -= Flag;
          while (P != Almax) {
            P++;
            *Integer(P) = *Integer(P) - Flag;
          }
        }
      } else if (*Integer(P) != Dest)
        Fault('P');
      if (!(*Integer(Np) & 0x1000)) return;
      if ((*Integer(Np) & 0x2000) != 0 && Q == 0) {
        Dest = Val + 1;
        if ((Type & 0xC00) != 0xC00) Dest = Val + 2 - Flag;
        Q = 1;
      }
    }
  }
  void Assemble(void) {
    static int Add = 0xF400;
    static int Sub = 0xF500;
    static int And = 0xF100;
    static int Or = 0xF000;
    static int Xor = 0xF700;
    static int Comp = 0xF200;
    static int Copy = 0xF300;
    static int Loadi = 0x6000;
    static int Skidi = 0x7000;
    static int Addi = 0x8000;
    static int Andi = 0x9000;
    static int Boc = 0x5800;
    static int Bocr = 0x5000;
    static int Jum = 0x4000;
    static int Skip = 0x4002;
    static int Loadc = 0x20F2;
    static int Rot = 0x3000;
    static int Load = 0x2000;
    static int Store = 0x2008;
    int Q;
    int Nq;
    int Op;
    int K;
    int Litval;
    int Type1;
    int Val1;
    int Free;
    static int Ass_sw;
    static void *Ass[30 /*-30:-1*/] = {
        &&Ass_default, &&Ass_default, &&Ass_default, &&Ass_default, &&Ass_M26,     &&Ass_M25,     &&Ass_M24, &&Ass_M23,
        &&Ass_M22,     &&Ass_M21,     &&Ass_M20,     &&Ass_default, &&Ass_M18,     &&Ass_M17,     &&Ass_M16, &&Ass_M15,
        &&Ass_M14,     &&Ass_M13,     &&Ass_M12,     &&Ass_M11,     &&Ass_default, &&Ass_default, &&Ass_M8,  &&Ass_M7,
        &&Ass_M6,      &&Ass_M5,      &&Ass_M4,      &&Ass_M3,      &&Ass_M2,      &&Ass_M1,
    };
    void Combine(void) {
      int I;
      int J;
      int K;
      I = 11;
      K = 2048;
      while ((K & Type1) == 0 && I != 0) {
        I--;
        K = (unsigned)K >> 1;
      }
      J = K;
      while ((J & Val1) == 0 && I != 0) {
        I--;
        J = (unsigned)J >> 1;
      }
      Val = Val << I & ((K << 1) - 1);
      Type = Type1 - K;
      Val += Val1 - J;
    }
    void Plantjump(void) {
      int I;
      int V;
      I = Val - Loc;
      if (!(Cond & 6)) {
        if (Cond == 8) {
          if (I == 1) return;
          Plant(Skip);
        }
      } else {
        if (Flag != 0 && abs(I) > 127) {
          Fault('J');
          I = 0;
        }
        if (abs(I) <= 127) {
          if ((Type & Umask) == 0 || Flag != 0) {
            Plant(Boc + ((Cond ^ 1) << 8) + (I & 255));
            return;
          }
          if (List >= 0 && (List & 8) != 0) Fault('S');
        }
        Plant(Boc + (Cond << 8) + 2);
      }
      Plant(Jum + ((Val - Loc) & 4095));
    }
    void Setjump(int Case) {
      int Thold;
      int Vhold;
      int Fhold;
      if (!(Cond & 6)) Case += 0x0800;
      if (Cond & 1) Case += 0x0400;
      Almax++;
      Nest(Loc);
      Nest(Almax - Deflim + Case);
      Thold = Type;
      Vhold = Val;
      Fhold = Flag;
      Type = Loctype;
      Val = *Integer(Almax);
      Flag = 0;
      if (!Pass) Type += Umask;
      Cond = Cond ^ 1;
      Plantjump();
      Cond = 0;
      Type = Thold;
      Val = Vhold;
      Flag = Fhold;
    }
    void Plantinst(int Code) {
      if (Cond) Setjump(0x1000);
      Plant(Code);
    }
    void Release(void) {
      int I;
      if (!(Type & Regxmask)) return;
      I = Type & 15;
      if (Type == Reg) I = Val;
      if (I == Dreg)
        Duse--;
      else {
        I = 1 << I;
        if (Temps & I) Free = Free | I;
      }
    }
    int Treg(void) {
      int I;
      int J;
      if (Dreg >= 0 && Duse == 0) {
        Duse = 1;
        return (Dreg);
      }
      J = 1;
      for (I = 0; I <= 15; I++) {
        if ((Free & J) != 0 && I != Dreg) goto Ok;
        J = J << 1;
      }
      Fault('R');
    Ok:
      Free -= J;
      return (I);
    }
    void Loadconst(int R) {
      int I;
      int J;
      I = Loadi + (R << 8);
      if ((Val & (~255)) == 0 && (Type & Umask) == 0)
        Plantinst(I + Val);
      else if ((~Val & (~255)) == 0 && (Type & Umask) == 0) {
        Plantinst(I + (~Val));
        Plantinst(Comp + (R << 4) + R);
        Creg = R;
      } else {
        J = (unsigned)Val >> 8 & 255;
        if (Val & 128) J++;
        Plantinst(I + J);
        Plantinst(Rot + (R << 8) + (7 << 4) + R);
        if (Val & 255) Plantinst(Addi + (R << 8) + (Val & 255));
      }
    }
    void Loadreg(int R) {
      int Op;
      if (Atype == Type && Aval == Val) {
        Type = Reg;
        Val = Acc;
        if (R == Acc) return;
      }
      if (R == Acc) {
        Atype = Type;
        Aval = Val;
      }
      if (Atype == Reg && Aval == R) Atype = -1;
      if ((Atype & Xmask) != 0 && (Atype & 15) == R) Atype = -1;
      if (Type == Reg) {
        Plantinst(Copy + (R << 4) + Val);
        Creg = R;
      } else if (!(Type & Xmask)) {
        Loadconst(R);
        if (Type & Memmask) Plantinst(Load + (R << 8) + (R << 4));
      } else {
        if ((Val & (~3)) != 0 || (Type & Memmask) == 0) {
          if ((Type & 15) != R) {
            if (abs(Val) <= 127) {
              Plantinst(Copy + (R << 4) + (Type & 15));
              if (Val) Plantinst(Addi + (R << 8) + (Val & 255));
            } else {
              Loadconst(R);
              Plantinst(Add + (R << 4) + (Type & 15));
            }
            Creg = R;
          } else if (abs(Val) <= 127) {
            if (Val) {
              Plantinst(Addi + (R << 8) + (Val & 255));
              Creg = R;
            }
          } else {
            Op = Treg();
            Loadconst(Op);
            Type = Reg;
            Val = Op;
            Release();
            Plantinst(Add + (R << 4) + Op);
            Creg = R;
          }
          Type = (Type & Memmask) + Xmask + R;
          Val = 0;
        }
        if (Type & Memmask) {
          Plantinst(Load + (R << 8) + ((Type & 15) << 4) + Val);
          Creg = -1;
        } else {
          Loadconst(R);
          Plantinst(Load + (R << 8) + (R << 4));
        }
      }
      Type = Reg;
      Val = R;
    }
    void Loadtemp(void) {
      Release();
      Loadreg(Treg());
    }
    void Swop(void) {
      int K;
      K = Type1;
      Type1 = Type;
      Type = K;
      K = Val1;
      Val1 = Val;
      Val = K;
    }
    Q = Qstart;
  New:
    Nq = Qstart;
    Free = Temps;
    Type = *Integer(Q);
    Q++;
    Val = *Integer(Q);
    Q++;
  Get:
    for (;;) {
      if (Q == Qlim) return;
      K = *Integer(Q);
      Q++;
      if (K < 0) goto *Ass[Ass_sw = (K) - -30];
      *Integer(Nq) = Type1;
      *Integer(Nq + 1) = Val1;
      Nq += 2;
      Type1 = Type;
      Val1 = Val;
      Type = K;
      Val = *Integer(Q);
      Q++;
    }
    int /* boolean */ Temp(void) {
      if (Type1 != Reg) return (0);
      if (Val1 == Dreg) {
        if (Duse != 1) return (0);
      } else if (!(1 << Val1 & Temps))
        return (0);
      return (1);
    }
  Nop:
    K = 0;
  Bop:
    if (Mode <= 0 || (Type == 0 && Type1 == 0)) {
      if (Type) Fault('A');
      Type = Type1;
      Val = Litval;
    } else {
      if (!Temp() || (Type == Reg && Val == Dreg && Duse == 1 && K != 0)) {
        Swop();
        if (K == 0 || !Temp()) {
          Loadtemp();
          Swop();
        }
      }
      if (Op == And && Type == 0 && (Val & (~255)) == 0)
        Plantinst(Andi + (Val1 << 8) + Val);
      else {
        if (Type != Reg) Loadtemp();
        Release();
        Plantinst(Op + (Val1 << 4) + Val);
      }
      Type = Reg;
      Val = Val1;
      Creg = Val;
      if (Acc == Val) Atype = -1;
      if ((Atype & Xmask) != 0 && (Atype & 15) == Val) Atype = -1;
      if (Atype == Reg && Aval == Val) Atype = -1;
    }
  Pop:
    Nq -= 2;
    Type1 = *Integer(Nq);
    Val1 = *Integer(Nq + 1);
    goto Get;
  Ass_M2:;
    Op = Sub;
    if (Mode > 0 && Type != 0) goto Nop;
    if (Mode <= 0 && Type1 == Type) {
      Type1 = 0;
      Type = 0;
    }
    Val = -Val;
  Ass_M1:;
    Op = Add;
    Litval = Val1 + Val;
    if (Type) goto Bop;
    if ((Type1 & Memmask) != 0 && Mode > 0) {
      Swop();
      Loadtemp();
      Swop();
    }
    if (Type1 == Reg && Type != Val || Val != 0) {
      Type1 = Xmask + Val1;
      Litval = Val;
    }
    Type = Type1;
    Val = Litval;
    goto Pop;
  Ass_M6:;
    Litval = Val1 << Val;
    K = (-1) << Val;
    Val -= 16;
    goto As7;
  Ass_M7:;
    Litval = (unsigned)Val1 >> Val;
    K = (unsigned)(0xFFFF) >> Val;
  As7:
    if (Mode <= 0) {
      K = 0;
      goto Bop;
    }
    if (Type != 0 || (Val & (~15)) != 0) Fault('I');
    if (!Temp()) {
      Swop();
      Loadtemp();
      Swop();
    }
    Op = Rot + (Val1 << 8) + Val1;
    if (Val > 8) Plantinst(Op + 0x0070);
    if (Val) Plantinst(Op + ((Val - 1) << 4));
    Type = 0;
    Val = K;
    K = -3;
  Ass_M3:;
    Op = And;
    Litval = Val1 & Val;
    goto Bop;
  Ass_M4:;
    Op = Or;
    Litval = Val1 | Val;
    goto Bop;
  Ass_M5:;
    Op = Xor;
    Litval = Val1 ^ Val;
    goto Bop;
  Ass_M8:;
    Type = Val1;
    if ((Type & Opmask) == Macro) Type = 0;
    if ((Type & (Opmask + Fmask)) == Fmask) Type = 0;
    goto Pop;
  Ass_M11:;
    K = *Integer(Q);
    Q++;
    if (Mode <= 0) {
      Litval = 0b01011000;
      if (Val < 0) Litval = 0b01100100;
      if (Val1 > Val) Litval = 0b10101000;
      K = (unsigned)Litval >> K & 1;
    } else if ((K & 6) != 4 || -256 >= Val || Val >= 0 || (Type & Xmask) == 0) {
      if (Type != Reg) Loadtemp();
      if (Creg != Val) Plantinst(Copy + (Val << 4) + Val);
      Creg = Val;
    } else {
      Plantinst(Skidi + ((Type & 15) << 8) - Val);
      K += 4;
    }
    Cond = K;
    goto Get;
  Ass_M12:;
    Cond = Val ^ 1;
    goto Get;
  Ass_M13:;
    if (Mode > 0)
      Setjump(0x1000);
    else if (!Cond)
      return;
    if (Q == Qlim) return;
    goto New;
  Ass_M14:;
    if (Mode > 0) {
      Cond = Cond ^ 1;
      Setjump(0x3000);
    } else if (Cond)
      return;
    goto New;
  Ass_M15:;
    Setjump(0x2000);
    return;
  Ass_M16:;
    Cond = 1;
    Setjump(0x4000);
    return;
  Ass_M17:;
    Setjump(0x6000);
    return;
  Ass_M18:;
    Setjump(0x8000);
    return;
  Ass_M20:;
    Type = Type & (Umask + 63);
    goto Get;
  Ass_M21:;
    if (Type1 & Regxmask) Fault('I');
    if (Type & Memmask)
      if (Mode > 0)
        Loadtemp();
      else
        Fault('A');
    if (Type == Reg) {
      Type = Xmask + Val;
      Val = 0;
    }
    if (Type1 & Type & Relmask) Fault('I');
    Type = Type1 | Type | Memmask;
    Val += Val1;
    goto Pop;
  Ass_M22:;
    Combine();
    goto Pop;
  Ass_M23:;
    Mode = 1;
    Plantinst(Val);
    Creg = -1;
    Atype = -1;
    return;
  Ass_M24:;
    if (Type != Reg) Loadtemp();
    Q = Qbase;
    goto Get;
  Ass_M25:;
    if (Type == Reg) {
      if (Val1 != Val) {
        Swop();
        Loadreg(Val1);
      }
    } else {
      if (Atype & Memmask) Atype = -1;
      if (Val1 == Acc && Atype < 0) {
        K = Type & 15;
        if ((Type & Xmask) == 0 || (1 << K & Temps) == 0) {
          Atype = Type;
          Aval = Val;
        }
      }
      if ((Type & Xmask) == 0 || (Val & (~3)) != 0) {
        Type = Type & (~Memmask);
        Loadtemp();
        Type = Memmask + Xmask + Val;
        Val = 0;
      }
      Plantinst(Store + (Val1 << 8) + ((Type & 15) << 4) + Val);
    }
    return;
  Ass_M26:;
    if ((*Integer(Np) & 0xF000) == 0x3000) Setjump(0x1000);
    if (Type != Reg) Type = Type | Memmask;
    if ((Type & (~Umask)) == Loctype)
      Plantjump();
    else {
      if (Type == Reg) {
        Type = Xmask + Val;
        Val = 0;
      }
      if ((Type & Xmask) == 0 || (Val & (~15)) != 0) Fault('I');
      if (Cond & 8) {
        if (Cond == 8) Plant(Skip);
        Cond = 1;
      }
      Plant(Bocr + (Cond << 8) + ((Type & 15) << 4) + Val);
    }
    Cond = 0;
    return;
    goto Ass_skip;
  Ass_default:
    fprintf(stderr, "\nSwitch label 'Ass(%d):' not set in %s\n", Ass_sw + -30, __PRETTY_FUNCTION__);
    fflush(stderr);
    abort();
  Ass_skip:;
  }
  void Getsym(void) {
    for (;;) {
      Sym = Char(Getpos);
      Getpos++;
      if (Sym != ' ') return;
    }
  }
  int /* boolean */ S(int K) {
    if (K != Sym) return (0);
    Getsym();
    return (1);
  }
  int /* boolean */ Ss(int K) {
    if (K != Sym || Sym != Char(Getpos)) return (0);
    Getpos++;
    Getsym();
    return (1);
  }
  int /* boolean */ Tag(void) {
    int J;
    int K;
    void Codesym(void) {
      Sym = Char(Getpos);
      Getpos++;
      K = Sym - '0';
      if (K >= 0) {
        if (K < 10) {
          Term = -1;
          return;
        }
        K = Sym - 'A';
        if (K >= 0 && K < 26 && Term == 0) return;
      }
      Term = Sym;
    }
    void Packtriple(void) {
      if (Term < 0) goto T1;
      J = (((((K << 5) + K) << 1) + K) << 4) + K + 1111;
      Codesym();
      if (Term) goto T2;
      J += (((K << 3) + K) << 2) + K + 111;
      Codesym();
      if (Term) goto T3;
      J = J + K + 11;
      Codesym();
      return;
    T1:
      J = (((((K << 1) + K) << 1) + K) << 4) - K + 1;
      Codesym();
    T2:
      if (Term > 0) return;
      J += (((K << 2) + K) << 1) + K + 1;
      Codesym();
    T3:
      if (Term > 0) return;
      J = J + K + 1;
      Codesym();
    }
    K = Sym - 'A';
    if (K < 0 || K >= 26) return (0);
    if (Sym == 'X' && (Char(Getpos) & 128) != 0) return (0);
    Term = 0;
    Packtriple();
    Tag1 = J;
    J = 0;
    if (Term <= 0) Packtriple();
    Tag2 = J;
    while (Term <= 0) Codesym();
    if (Term == ' ') Getsym();
    return (1);
  }
  int /* boolean */ Tagif(void) {
    if (Sym != 'I' || Char(Getpos) != 'F' || Char(Getpos + 1) != ' ') return (0);
    Getpos += 2;
    Getsym();
    return (1);
  }
  void Lookup(int Control) {
    int Dp;
    Dp = Defmin;
    if (Control == 4) Dp = Mp + 5;
    while (*Integer(Dp)) {
      if (*Integer(Dp) == Tag1 && *Integer(Dp + 1) == Tag2) goto Yes;
      Dp += 4;
    }
  No:;
    if (!(Control & 1)) return;
  New:
    Defmin -= 4;
    Dp = Defmin;
    *Integer(Dp) = Tag1;
    *Integer(Dp + 1) = Tag2;
  Set:
    *Integer(Dp + 2) = Type;
    *Integer(Dp + 3) = Val;
    return;
  Yes:
    if (Control == 3 && Dp - *Integer(Bp) >= 0) goto New;
    if (!(Control & 2)) {
      Type = *Integer(Dp + 2);
      Val = *Integer(Dp + 3);
      if ((Type & Opmask) != Macro || Control != 0) return;
      if ((Type & 31) != 25)
        *Integer(Dp + 2) = Type + 1;
      else
        *Integer(Dp + 2) = Type + 7;
      return;
    }
    if (Control == 3) Fault('D');
    if (Control != 7) goto Set;
    if ((*Integer(Dp + 2) & (Opmask + Fmask)) == Fmask) {
      Val = *Integer(Dp + 3);
      if (!Pass)
        *Integer(Val) = Loc;
      else if (*Integer(Val) != Loc) {
        Fault('P');
        Loc = *Integer(Val);
      }
      Val = Loc;
    } else {
      if (Dp - *Integer(Bp) >= 0) goto New;
      Fault('D');
    }
    goto Set;
  }
  void Queue(int K) {
    *Integer(Qlim) = K;
    Qlim++;
  }
  void Getexp(void) {
    static int W = 24717;
    int I;
    int Nbase;
    Nbase = Np;
    if (Pend) goto E3;
  E1:
    while (S('(')) Nest(0);
    if (S('#')) Nest(-20);
    if (Tag()) {
    E3:
      if (Tag1 == W) {
        Type = 0;
        Val = 0;
      } else if (Pend >= 0) {
        Type = Loctype + Fmask + Umask;
        Val = Labmin - 1;
        Lookup(1);
        if ((Type & (Opmask + Fmask)) == Fmask) {
          if (Val == Labmin - 1) {
            Labmin = Val;
          }
          Val = *Integer(Val);
          if (!Val) Fault('U');
          Type -= Fmask;
        }
      }
      Pend = 0;
      if (Type == Reg && Term == '(') {
        if (!(Save & 1)) Type = 0;
        Val += Save;
      }
      if (Mode) {
        if (Type & Opmask) {
          Fault('I');
          Type = 0;
        }
        if (Type & Regxmask) {
          I = Type & 15;
          if (!I) I = Val;
          if (I == Dreg) Duse++;
        }
      }
      if (Term == '(') {
        Getsym();
        I = Type & 31;
        Queue(Type - I);
        Queue(Val);
        Nest(-21);
        Nest(0);
        if (I) {
          Queue(Reg);
          Queue(I & 15);
          Nest(-1);
        }
        goto E1;
      }
    } else if ('0' <= Sym && Sym <= '9') {
      Type = 0;
      Val = Sym - '0';
      for (;;) {
        Sym = Char(Getpos) - '0';
        if (0 > Sym || Sym > 9) break;
        Val = (((Val << 2) + Val) << 1) + Sym;
        Getpos++;
      }
      Getsym();
    } else if (Sym == 'X') {
      Type = 0;
      Val = 0;
      for (;;) {
        Sym = Char(Getpos) - 128;
        if (Sym < 0) break;
        if (Sym >= 96) Sym -= 32;
        if ('0' <= Sym && Sym <= '9' || 'A' <= Sym && Sym <= 'F') {
          Val = (Val << 4) + Sym - '0';
          if (Sym >= 'A') Val -= 7;
        } else
          Fault('H');
        Getpos++;
      }
      Getsym();
    } else if (Sym & 128) {
      Type = 0;
      Val = Sym - 128;
      Getsym();
      if (Mode >= 0 && (Sym & 128) != 0) {
        Val = (Val << 8) + Sym - 128;
        Getsym();
      }
    } else if (S('.')) {
      if (!Tag()) goto Err;
      Type = 0;
      Val = Tag1;
    } else if (S('*')) {
      Type = Loctype & 63;
      Val = Loc;
      if (Sym == 'L') {
        Type = 0;
        if (Tag()) Val = List;
      }
    } else if (Sym == '-') {
      Type = 0;
      Val = 0;
    } else if (Sym == '\\') {
      Type = 0;
      Val = ~0;
    } else
      goto Err;
    Queue(Type);
    Queue(Val);
    while (Np != Nbase) {
      if (*Integer(Np) < 0)
        Queue(*Integer(Np));
      else if (!S(')'))
        break;
      Np++;
    }
    if (S('+')) {
      Nest(-1);
      goto E1;
    }
    if (S('-')) {
      Nest(-2);
      goto E1;
    }
    if (S('&')) {
      Nest(-3);
      goto E1;
    }
    if (S('!')) {
      Nest(-4);
      goto E1;
    }
    if (S('\\')) {
      Nest(-5);
      goto E1;
    }
    if (Ss('<')) {
      Nest(-6);
      goto E1;
    }
    if (Ss('>')) {
      Nest(-7);
      goto E1;
    }
    if (S('_')) {
      Nest(-8);
      goto E1;
    }
    if (Np == Nbase) return;
  Err:
    Np = Nbase;
  }
  void Getcond(void) {
    static int And = 1717;
    static int Or = 16873;
    int J;
    int K;
    Transf = Qstart;
    Qstart = Qlim;
    J = 0;
    for (;;) {
      Getexp();
      if (S('='))
        K = 5;
      else if (S('#'))
        K = 4;
      else if (S('<')) {
        K = 3;
        if (S('=')) K = 7;
      } else if (S('>')) {
        K = 6;
        if (S('=')) K = 2;
      } else {
        Queue(-12);
        return;
      }
      Getexp();
      Queue(-2);
      Queue(-11);
      Queue(K);
      if (!Tag()) return;
      if (Tag1 == And && Tag2 == 0) {
        J = 1;
        Queue(-13);
      } else {
        J = -1;
        Queue(-14);
      }
    }
  }
  void Getinst(void) {
    int I;
    Queue(Type);
    Queue(Val);
    if (Term != ' ') return;
    for (;;) {
      Getexp();
      Queue(-22);
      if (!S(',')) return;
    }
  }
  void Readline(void) {
    int Q;
    Putpos = Startpos;
    if (!Mp) {
      Q = 0;
      Pseudolim = 0;
      for (;;) {
        Readsymbol(Sym);
        if (Sym == '\'') {
          Readsymbol(Sym);
          Q = Q ^ 128;
        }
        if (Sym == Nl) break;
        if (Sym - Q >= 96) Sym -= 32;
        Sym += Q;
        if (Sym == '/' && Pseudolim != 0) break;
        if (Sym == ' ') {
          if (!Pseudolim) Pseudolim = Putpos;
        } else
          Pseudolim = 0;
        Putchar(Sym);
      }
      if (Pseudolim) {
        Q = Putpos;
        Putpos = Pseudolim;
        Putchar(Nl);
        Putpos = Q;
      }
      for (;;) {
        Putchar(Sym);
        if (Sym == Nl) break;
        Readsymbol(Sym);
      }
      Printpos = Startpos;
    } else {
      Getpos = *Integer(Mp);
      if (!Char(Getpos)) {
        Qbase = Mp;
        if (*Integer(Mp + 1) & 0x8000) {
          while (!(*Integer(Np) & 0x8000)) {
            Fault('C');
            Np += 2;
          }
          Setlab(Loc);
        }
        Getpos = *Integer(Mp + 2);
        Startpos = *Integer(Mp + 3);
        Mp = *Integer(Mp + 4);
        if (List & 2) Printpos = 0;
        Getsym();
        if (Sym == ';') Getsym();
        return;
      }
      if (List & 2) Printpos = Startpos;
      for (;;) {
        Sym = Char(Getpos);
        Getpos++;
        if (Tag()) {
          if (Term == ' ') {
            Sym = Term;
            Getpos--;
          }
          Type = *Integer(Mp);
          Val = Getpos - 1;
          Lookup(4);
          while (Type != Val) {
            Putchar(Char(Type));
            Type++;
          }
        }
        if (Sym == '?') {
          Putchar(((unsigned)*Integer(Mp + 1) >> 5 & 31) + 'A');
          Sym = (*Integer(Mp + 1) & 31) + 'A';
        }
        Putchar(Sym);
        *Integer(Mp) = Getpos;
        if (Sym == Nl) break;
      }
    }
    Qbase = (unsigned)(Putpos + 1) >> 1;
    Getpos = Startpos;
    Getsym();
  }
  void Scanarg(void) {
    int I;
    int J;
    if (Sym == 'I' && Char(Getpos) == 'F' && Char(Getpos + 1) == ' ') return;
    I = Getpos - 1;
    if (Sym == '[') I = Getpos;
    J = 0;
    for (;;) {
      if (Sym == Nl) break;
      if ((Sym == ' ' || Sym == ',' || Sym == ';') && J <= 0) break;
      if (Sym == '[') J++;
      if (Sym == ']') {
        J--;
        if (!J) break;
      }
      Sym = Char(Getpos);
      Getpos++;
    }
    if (Getpos - 1 != I) {
      Type = I;
      Val = Getpos - 1;
    }
    if (Sym == ']') Getsym();
  }
  void Setacc(void) {
    int I;
    Acc = -1;
    Atype = -1;
    Creg = -1;
    I = Temps;
    if (!I) return;
    for (;;) {
      Acc++;
      if (I & 1) return;
      I = (unsigned)I >> 1;
    }
  }
  static int B = 2184;
  static int If = 9991;
  static int Els = 5950;
  static int E = 5403;
  static int Fin = 6907;
  static int Ish = 10490;
  static int Jum = 11642;
  static int P = 17206;
  static int Ps = 17983;
  static int Def = 4605;
  static int End = 6009;
  int I;
  int J;
  int K;
  for (I = 1; I <= Sbound; I++) Store[I] = 0;
  Codepos = Addr(Store[1]);
  Maclim = (Codepos + 20) << 1;
  Storelim = Addr(Store[Sbound]);
  Np = Storelim;
  Lablim = Np - 60;
  Bp = Lablim;
  Deflim = Storelim - ((unsigned)Sbound >> 2);
  Defmin = Deflim;
  *Integer(Bp) = Deflim;
  Selectinput(Pre);
Dopass:;
  if (Pass > 0) {
    Putword(0);
    Control = 0x20;
  }
  Startpos = Maclim;
  Mp = 0;
  Almax = Deflim;
  Labmin = Lablim;
  Asscond = 1;
  Skip = 0;
  Loctype = Memmask + Relmask;
  Loc = 0;
  Setacc();
Read:
  Fsym = ' ';
  Faultpos = 0;
  Readline();
Next:;
  Dreg = -1;
  Mode = 0;
  Pend = 0;
  Cond = 0;
  Qstart = Qbase;
  Qlim = Qstart;
  Flag = 0;
  if (S('$')) {
    if (Sym == '/') goto Newpage;
    if (!Tag()) goto Err;
    if (Tag1 == If) goto Assif;
    if (Tag1 == Els) goto Asselse;
    if (Tag1 == Fin) goto Assfin;
    if (Skip) goto Lend;
    if (Tag1 == Def) goto Define;
    if (Tag1 == 19625) goto Define;
    if (Tag1 == 13350) goto Listc;
    if (Tag1 == 21780) goto Temp;
    if (Tag1 == 13556) goto Locc;
    if (Tag1 == 1917) goto Locc;
    if (Tag1 == 20568) goto Savc;
    if (Tag1 == 14111) goto Macdef;
    if (Tag1 == 2460) goto Begin;
    if (Tag1 == End) goto Bend;
    Fault('U');
    goto Lend;
  }
  if (Skip != 0 || Sym == '/') goto Lend;
  if (Sym == Nl) {
    if (Lines < 54) goto Lend;
    while (Lines) Donewline();
    goto Read;
  }
  if (Tag()) {
    if (Term == ':') goto Labdef;
    Mode = 1;
    if (Term == '(' || Sym == '=') goto Assign;
    if (Tag1 == Jum && (Tag2 == P || Tag2 == Ps)) goto Jump;
    if (Tag1 == If) goto Ifc;
    if (Tag1 == Els && Tag2 == E) goto Else;
    if (Tag1 == Fin && Tag2 == Ish) goto Finish;
    if (Tag1 == 25106 && Tag2 == 13173) goto While;
    if (Tag1 == 4269 && Tag2 == 13173) goto Cycle;
    if (Tag1 == 19637 && Tag2 == 5544) goto Repeat;
    if (Tag1 == B) {
      Mode = -2;
      goto Data;
    }
    Type = Umask;
    Lookup(0);
    if ((Type & Opmask) == Macro) goto Maccall;
    if (Type & Opmask) goto Minst;
    if (Type & Umask) {
      Fault('U');
      goto Lend;
    }
    Pend = -1;
  }
  Mode = -1;
Data:;
  for (;;) {
    Getexp();
    Assemble();
    if (Type & Regxmask) Fault('I');
    I = 1;
    if (S('$')) {
      if (Val < 1000) I = Val;
      Qlim = Qstart;
      Getexp();
      Assemble();
    }
    while (I > 0) {
      if (Mode != -1) {
        if (Val & 0xFF00) Fault('T');
        if (Mode == -2) {
          J = Val << 8;
          Mode = -3;
        } else {
          Val += J;
          Mode = -2;
          Plantval();
        }
      } else {
        Plantval();
        Val = Val & 255;
      }
      I--;
    }
    if (!(S(',') || (Sym & 128) != 0)) break;
    if (Sym == Nl) {
      if (Printpos) Printline();
      Readline();
      Qstart = Qbase;
    }
    Qlim = Qstart;
  }
  if (Mode == -3) {
    Val = J;
    Plantval();
  }
  goto Send;
Labdef:;
  Creg = -1;
  Atype = -1;
  Getsym();
  if (Np != Storelim) {
    Fault('C');
    Np = Storelim;
  }
  Type = Loctype;
  Val = Loc;
  Lookup(7);
  goto Next;
Assign:;
  Pend = 1;
  Getexp();
  if (!S('=')) goto Err;
  Queue(-25);
  if (*Integer(Qbase) == Reg) {
    Dreg = *Integer(Qbase + 1);
    Duse = 0;
  }
  Qstart = Qlim;
  Mode = 2;
  Getexp();
  Queue(-24);
Condq:;
  if (Tagif()) {
    Mode += 4;
    Dreg -= 16;
    Getcond();
    Assemble();
    Mode -= 4;
    Dreg += 16;
    Qlim = Qstart;
    Qstart = Transf;
  }
  Assemble();
  goto Send;
Jump:;
  Flag = Tag2 - P;
  Getexp();
  Queue(-26);
  goto Condq;
Minst:;
  Mode = -1;
  Getinst();
  Queue(-23);
  goto Condq;
Maccall:;
  Queue(Val);
  Queue(Type & 1023);
  Queue(0);
  Queue(Startpos);
  Queue(Mp);
  for (;;) {
    if (Char(*Integer(Qbase)) == Nl) break;
    I = Getpos - 1;
    Getpos = *Integer(Qbase);
    Getsym();
    Type = 0;
    Val = 0;
    Scanarg();
    if (Sym == ',') Getsym();
    *Integer(Qbase) = Getpos - 1;
    Getpos = I;
    Getsym();
    Scanarg();
    if (Sym == ',') Getsym();
    Queue(Tag1);
    Queue(Tag2);
    Queue(Type);
    Queue(Val);
  }
  if (Sym == ' ') Getsym();
  if (Tagif()) {
    Getcond();
    Queue(-18);
    Assemble();
    Qlim = Qstart;
    *Integer(Qbase + 1) = *Integer(Qbase + 1) + 0x8000;
  }
  Queue(0);
  Mp = Qbase;
  Startpos = Qlim << 1;
  *Integer(Mp) = *Integer(Mp) + 1;
  *Integer(Mp + 2) = Getpos - 1;
  if (Printpos != 0 && (List & 2) != 0) Printline();
  goto Read;
Ifc:;
  Getcond();
  Queue(-15);
  Assemble();
  goto Send;
Else:;
  if (!(*Integer(Np) & 0x2000)) goto Cerr;
  Queue(0);
  Queue(0);
  Queue(-16);
  Assemble();
  Atype = -1;
  Creg = -1;
  if (Tagif()) {
    Getcond();
    Queue(-17);
    Assemble();
  }
  goto Send;
Finish:;
  if (!(*Integer(Np) & 0x6000)) goto Cerr;
  I = Loc;
  while (*Integer(Np) & 0x4000)
    if (*Integer(Np) & 0x2000)
      Setlab(I);
    else {
      Setlab(Loc);
      I = Val + 1;
    }
  Setlab(I);
  goto Send;
While:;
  I = Loc;
  Atype = -1;
  Creg = -1;
  Getcond();
  Queue(-13);
  Assemble();
  Nest(I);
  Nest(1);
  goto Send;
Cycle:;
  Nest(Loc);
  Nest(1);
  goto Send;
Repeat:;
  if (*Integer(Np) != 1) goto Cerr;
  Queue(Loctype);
  Queue(*Integer(Np + 1));
  Np += 2;
  Queue(-26);
  Flag = -1;
  goto Condq;
Cerr:;
  Fault('C');
  goto Lend;
Send:;
  if (*Integer(Np) & 0x1000) Setlab(Loc);
  if (Sym == Nl) goto Lend;
  if (S(';')) goto Next;
Err:
  Fsym = 'F';
  Faultpos = Getpos - 1;
  Printpos = Startpos;
Lend:;
  if (Skip != 0 && (List & 4) == 0) goto Read;
  if (Fsym == ' ' && Chars == 0 && (Printpos == 0 || (Mp != 0 && (List & 2) == 0))) goto Read;
  Printline();
  goto Read;
Assif:;
  Asscond = Asscond << 1;
  if (Skip) goto Lend;
A1:
  Getcond();
  Assemble();
  if (Cond) Skip = Asscond;
  if (Printpos) Printline();
  goto Lend;
Asselse:;
  if (!Skip) {
    if (Asscond & 1) goto Cerr;
    Skip = Asscond;
  } else {
    if (Skip != Asscond) goto Lend;
    Skip = 0;
    if (Tagif()) goto A1;
  }
  Asscond++;
  goto Lend;
Assfin:;
  if (Asscond == 1) goto Cerr;
  Asscond = (unsigned)Asscond >> 1;
  if ((unsigned)Skip >> 1 == Asscond) Skip = 0;
  goto Lend;
Define:;
  if (Np != Storelim) Fault('C');
  I = Tag1;
  for (;;) {
    if (!(Tag() && S('='))) goto Err;
    J = Tag1;
    K = Tag2;
    if (Tag()) {
      Type = Umask;
      Lookup(0);
      if (Type & Opmask)
        Getinst();
      else {
        Pend = -1;
        Getexp();
      }
    } else
      Getexp();
    Assemble();
    Tag1 = J;
    Tag2 = K;
    if (I == Def)
      Lookup(3);
    else
      Lookup(2);
    if (!S(',')) break;
    Qlim = Qstart;
  }
  goto Send;
Newpage:;
  while (Lines) Donewline();
  goto Lend;
Listc:;
  Getexp();
  Assemble();
  List = Val;
  goto Send;
Temp:;
  I = 0;
  if (Sym != Nl)
    for (;;) {
      Getexp();
      if (Type != Reg) Fault('I');
      I = I | 1 << Val;
      if (!S(',')) break;
    }
  Temps = I;
  Setacc();
  goto Send;
Locc:;
  I = Tag1;
  Getexp();
  Assemble();
  if (!(Type & 0xFF9F)) {
    Loctype = (Type & Relmask) + Memmask;
    Loc = Val;
    if (Pass > 0) {
      Putword(Val - 1);
      Control = 0x30;
    }
  } else
    Fault('I');
  goto Send;
Savc:;
  Getexp();
  Assemble();
  Save = Val;
  goto Send;
Macdef:;
  if (Mp) goto Cerr;
  if (!Tag()) goto Err;
  J = Tag1;
  K = Tag2;
  I = Getpos - 1;
  if (Sym != Nl)
    for (;;) {
      if (!Tag()) goto Err;
      Scanarg();
      if (!S(',')) break;
    }
  if (Sym != Nl) goto Err;
  Tag1 = J;
  Tag2 = K;
  Type = Macro;
  Val = I;
  Lookup(3);
  for (;;) {
    Printline();
    if (S('$') && Tag() && Tag1 == End) break;
    Startpos = Putpos;
    if (Pseudolim) Startpos = Pseudolim + 1;
    Readline();
  }
  Putpos = Startpos;
  Putchar(0);
  Startpos = Putpos;
  Maclim = Startpos;
  goto Lend;
  void Bnest(void) {
    Bp += 4;
    *Integer(Bp - 3) = Save;
    *Integer(Bp - 2) = Temps;
    *Integer(Bp - 1) = Maclim;
    *Integer(Bp) = Defmin;
  }
Begin:;
  Bnest();
  if (Sym != Nl) goto Newpage;
  goto Lend;
Bend:;
  if (Np != Storelim || Mp != 0) Fault('C');
  Mp = 0;
  Np = Storelim;
  if (Bp != Lablim) {
    Save = *Integer(Bp - 3);
    Temps = *Integer(Bp - 2);
    Maclim = *Integer(Bp - 1);
    Startpos = Maclim;
    Defmin = *Integer(Bp);
    Setacc();
    Bp -= 4;
    if (Bp != Lablim) goto Lend;
  }
  Closeinput();
  Selectinput(Main);
  Bnest();
  List = 5;
  Pass++;
  if (Pass != 2) goto Dopass;
  Putword(Check ^ 0x0100);
  Control = 0x30;
  Putword(0x0100);
  Selectoutput(Bin);
  Printch(0x60);
  Selectoutput(Lis);
  Fault('$');
  Printloc();
  Printline();
  if (Outdev == 1) Lines = 60;
  while (Lines) Donewline();
  exit(0);
  return (1);
}
