#include <perms.h>
int _imp_mainep(int _imp_argc, char **_imp_argv) {
  static const int Framestorexl = 0;
  static const int Framestorexr = 687;
  static const int Framestoreyb = 0;
  static const int Framestoreyt = 511;
  static const int Windowframe = 12;
  static const int Windowxl = Framestorexl + Windowframe;
  static const int Windowxr = Framestorexr - Windowframe;
  static const int Windowyb = Framestoreyb + Windowframe;
  static const int Windowyt = Framestoreyt - Windowframe;
  static const int Vgridxl = 0;
  static const int Vgridxr = 255;
  static const int Vgridyb = 0;
  static const int Vgridyt = 255;
  unsigned char Vgrid[256 /*0:255*/][256 /*0:255*/];
  unsigned char Hvgrid[257 /*0:256*/][256 /*0:255*/];
  unsigned char Vvgrid[256 /*0:255*/][257 /*0:256*/];
  static const int Mpoly = 1;
  static const int Mdiff = 2;
  static const int Mmetal1 = 3;
  static const int Mmetal2 = 4;
  static const int Mcontact = 5;
  static const int Msubcon = 6;
  static const int Mtranx = 7;
  static const int Mtrany = 8;
  static const int Mptranx = 9;
  static const int Mptrany = 10;
  static const int Mpwell = 11;
  static const int Mzoom = 12;
  static const int Minput = 13;
  static const int Moutput = 14;
  static const int Mitems = 14;
  static const int Mwscale = 8;
  static const int Mtscale = 4;
  static const int Mtscale3 = 12;
  static const int Mitemx[14 /*1:14*/] = {20, 48, 76,  104, 132, 160, 22,
                                          56, 90, 124, 158, 20,  20,  68};
  static const int Mitemxl[14 /*1:14*/] = {0,  34, 62,  90,  118, 146, 0,
                                           39, 73, 107, 141, 0,   0,   53};
  static const int Mitemxr[14 /*1:14*/] = {33, 61,  89,  117, 145, 180, 38,
                                           72, 106, 140, 180, 41,  52,  110};
  static const int Mitemy[14 /*1:14*/] = {
      [0 ... 5] = 96, [6 ... 10] = 66, 36, [12 ... 13] = 10};
  static const int Mitemyb[14 /*1:14*/] = {
      [0 ... 5] = 84, [6 ... 10] = 49, 23, [12 ... 13] = 0};
  static const int Mitemyt[14 /*1:14*/] = {
      [0 ... 5] = 114, [6 ... 10] = 83, 48, [12 ... 13] = 22};
  static const int Menuxs = 180;
  static const int Menuys = 114;
  static const int Curxl[14 /*1:14*/] = {
      [0 ... 5] = -1, [6 ... 10] = -3, [11 ... 13] = -1};
  static const int Curxr[14 /*1:14*/] = {
      [0 ... 5] = 1, [6 ... 10] = 3, [11 ... 13] = 1};
  static const int Curyb[14 /*1:14*/] = {
      [0 ... 5] = -1, [6 ... 10] = -3, [11 ... 13] = -1};
  static const int Curyt[14 /*1:14*/] = {
      [0 ... 5] = 1, [6 ... 10] = 3, [11 ... 13] = 1};
  static const int Poly = 1;
  static const int Diff = 2;
  static const int Metal1 = 4;
  static const int Metal2 = 8;
  static const int Pwell = 16;
  static const int Contact = 32;
  static const int Alllayers = 63;
  static const int Grid = 64;
  static const int Menuback = 128;
  static const int Polywireerased = 16;
  static const int Diffwireerased = 32;
  static const int Metal1wireerased = 64;
  static const int Metal2wireerased = 128;
  static const int Tranx = 1;
  static const int Trany = 2;
  static const int Subcon = 4;
  static const int Windowframelr[14 /*1:14*/] = {
      1, 2, 4, 8, 128, 128, 1, 2, 1, 2, 16, [11 ... 13] = 128};
  static const int Windowframebt[14 /*1:14*/] = {
      1, 2, 4, 8, 128, 128, 2, 1, 2, 1, 16, [11 ... 13] = 128};
  static const int Nodir = 0;
  static const int South = 1;
  static const int East = 2;
  static const int North = 3;
  static const int West = 4;
  static const int Nostate = 0;
  static const int Drawing = 1;
  static const int Erasing = 2;
  static const int Notpressed = 0;
  static const int Pressed = 1;
  static const int Released = 2;
  static const int Stillpressed = 3;
  unsigned short Cmap[256 /*0:255*/];
  int Backgroundcolour;
  int Flashcolour;
  auto void Setupcolourmap(void);
  auto void Drawwindowframe(int B, int R, int T, int L);
  auto void Setupnewscale(int Newscale);
  auto void Clipfill(int Xl, int Yb, int Xr, int Yt);
  auto void Clipvline(int X, int Yb, int Yt);
  auto void Cliphline(int Xl, int Xr, int Y);
  auto void Clipdbtline(int Xl, int Yb, int Xr, int Yt);
  auto void Clipdtbline(int Xl, int Yt, int Xr, int Yb);
  auto void Outline(int Xl, int Yb, int Xr, int Yt);
  auto void Clipoutline(int Xl, int Yb, int Xr, int Yt);
  auto void Drawwirex(int Layer, int Gx, int Gy);
  auto void Erasewirex(int Layer, int Gx, int Gy);
  auto void Drawwirey(int Layer, int Gx, int Gy);
  auto void Erasewirey(int Layer, int Gx, int Gy);
  auto void Drawtranx(int Gx, int Gy);
  auto void Drawtrany(int Gx, int Gy);
  auto void Drawcontact(int Gx, int Gy);
  auto void Drawsubcon(int Gx, int Gy);
  auto void Drawpwell(int Gx, int Gy);
  auto void Redrawdesign(void);
  auto void Redrawgridpoint(int Gx, int Gy);
  auto void Redrawprim(int Gx, int Gy);
  auto void Redrawwirex(int Gx, int Gy);
  auto void Redrawwirey(int Gx, int Gy);
  auto void Drawcursor(void);
  auto void Erasecursor(void);
  auto void Pan(int Xi, int Yi);
  auto void Zoomin(void);
  auto void Zoomout(void);
  auto void Drawmenu(void);
  auto void Erasemenu(void);
  auto void Flash(void);
  short Gridx[258 /*-1:256*/];
  short Gridy[258 /*-1:256*/];
  int Wgridxl;
  int Wgridxr;
  int Wgridyb;
  int Wgridyt;
  static const int Gridxl = 0;
  static const int Gridyb = 0;
  int Gridxr;
  int Gridyt;
  int Menuxl;
  int Menuxr;
  int Menuyb;
  int Menuyt;
  int Curbuts;
  int Curgx;
  int Curgy;
  int Newbuts;
  int Newgx;
  int Newgy;
  int Vgx;
  int Vgy;
  int Vg;
  int Vgw;
  int Scale;
  int Scale2;
  int Scale3;
  int Scale4;
  int Scale6;
  int X;
  int Y;
  int Xi;
  int Yi;
  int Curx;
  int Cury;
  int S;
  int State;
  int Butl;
  int Butm;
  int Butr;
  int Curtype;
  int Newtype;
  int Vgwh;
  int Vgwv;
  int Wirestartgx;
  int Wirestartgy;
  int Wirecurgx;
  int Wirecurgy;
  int Curwiredir;
  int Newwiredir;
  int Layer;
  int Xl;
  int Xr;
  int Yb;
  int Yt;
  static int Action_sw;
  static void *Action[14 /*1:14*/] = {
      &&Action_1,  &&Action_2,  &&Action_3,       &&Action_4,       &&Action_5,
      &&Action_6,  &&Action_7,  &&Action_8,       &&Action_9,       &&Action_10,
      &&Action_11, &&Action_12, &&Action_default, &&Action_default,
  };
  static int Wireaction_sw;
  static void *Wireaction[3 /*0:2*/] = {
      &&Wireaction_0,
      &&Wireaction_1,
      &&Wireaction_default,
  };
  static int Wiredrawn_sw;
  static void *Wiredrawn[5 /*0:4*/] = {
      &&Wiredrawn_0, &&Wiredrawn_1, &&Wiredrawn_2, &&Wiredrawn_3, &&Wiredrawn_4,
  };
  static int Undrawwire_sw;
  static void *Undrawwire[5 /*0:4*/] = {
      &&Undrawwire_0, &&Undrawwire_1, &&Undrawwire_2,
      &&Undrawwire_3, &&Undrawwire_4,
  };
  static int Drawwire_sw;
  static void *Drawwire[5 /*0:4*/] = {
      &&Drawwire_0, &&Drawwire_1, &&Drawwire_2, &&Drawwire_3, &&Drawwire_4,
  };
  static int Wireerased_sw;
  static void *Wireerased[5 /*0:4*/] = {
      &&Wireerased_default, &&Wireerased_default, &&Wireerased_default,
      &&Wireerased_default, &&Wireerased_default,
  };
  static int Unerasewire_sw;
  static void *Unerasewire[5 /*0:4*/] = {
      &&Unerasewire_default, &&Unerasewire_default, &&Unerasewire_default,
      &&Unerasewire_default, &&Unerasewire_default,
  };
  static int Erasewire_sw;
  static void *Erasewire[5 /*0:4*/] = {
      &&Erasewire_default, &&Erasewire_default, &&Erasewire_default,
      &&Erasewire_default, &&Erasewire_default,
  };
  for (X = Vgridxl; X <= Vgridxr; X++)
    for (Y = Vgridyb; Y <= Vgridyt; Y++) {
      Vgrid[X][Y] = 0;
      Hvgrid[X][Y] = 0;
      Vvgrid[X][Y] = 0;
    }
  for (Y = Vgridyb; Y <= Vgridyt; Y++) Hvgrid[Vgridxr + 1][Y] = 0;
  for (X = Vgridxl; X <= Vgridxr; X++) Vvgrid[X][Vgridyt + 1] = 0;
  Clear;
  Setupcolourmap();
  Drawwindowframe(Poly, Poly, Poly, Poly);
  Wgridxl = (Vgridxl + Vgridxr) / 2;
  Wgridyb = (Vgridyb + Vgridyt) / 2;
  Curgx = 0;
  Curgy = 0;
  Gridx[Curgx] = (Windowxl + Windowxr) / 2;
  Gridy[Curgy] = (Windowyb + Windowyt) / 2;
  Setupnewscale(6);
  Mousex = (Windowxr + Windowxl) / 2;
  Mousey = (Windowyt + Windowyb) / 2;
  Curbuts = Mousebuttons;
  Curtype = Mpoly;
  Drawcursor();
Menu:;
  Drawmenu();
Menuloop:;
  X = Mousex;
  Y = Mousey;
  if (X < Menuxl) {
    X = Menuxl;
    Mousex = X;
  } else if (X > Menuxr) {
    X = Menuxr;
    Mousex = X;
  }
  if (Y < Menuyb) {
    Y = Menuyb;
    Mousey = Y;
  } else if (Y > Menuyt) {
    Y = Menuyt;
    Mousey = Y;
  }
  X -= Menuxl;
  Y -= Menuyb;
  for (Newtype = 1; Newtype <= Mitems; Newtype++)
    if (Mitemxl[Newtype] <= X && X <= Mitemxr[Newtype] &&
        Mitemyb[Newtype] <= Y && Y <= Mitemyt[Newtype])
      break;
  if (Newtype != Curtype) {
    Colour;
    Enable;
    Outline(Mitemxl[Curtype] + Menuxl, Mitemyb[Curtype] + Menuyb,
            Mitemxr[Curtype] + Menuxl, Mitemyt[Curtype] + Menuyb);
    Curtype = Newtype;
    Colour;
    Enable;
    Outline(Mitemxl[Curtype] + Menuxl, Mitemyb[Curtype] + Menuyb,
            Mitemxr[Curtype] + Menuxl, Mitemyt[Curtype] + Menuyb);
  }
  Newbuts = Mousebuttons;
  Butl = (Curbuts & 1) << 1 | (Newbuts & 1);
  Butm = (Curbuts & 2) | (unsigned)(Newbuts & 2) >> 1;
  Butr = (unsigned)(Curbuts & 4) >> 1 | (unsigned)(Newbuts & 4) >> 2;
  Curbuts = Newbuts;
  if (Butl != Pressed && Butm != Pressed) goto Menuloop;
  Drawwindowframe(Windowframebt[Curtype], Windowframelr[Curtype],
                  Windowframebt[Curtype], Windowframelr[Curtype]);
Display:;
  Erasemenu();
  Drawcursor();
  State = Nostate;
Displayloop:;
  X = Mousex;
  Y = Mousey;
  Xi = 0;
  Yi = 0;
  if (X < Windowxl)
    Xi = -1;
  else if (X > Windowxr)
    Xi = 1;
  if (Y < Windowyb)
    Yi = -1;
  else if (Y > Windowyt)
    Yi = 1;
  if (Xi != 0 || Yi != 0) {
    if (X < Framestorexl) {
      X = Framestorexl;
      Mousex = X;
    }
    if (X > Framestorexr) {
      X = Framestorexr;
      Mousex = X;
    }
    if (Y < Framestoreyb) {
      Y = Framestoreyb;
      Mousey = Y;
    }
    if (Y > Framestoreyt) {
      Y = Framestoreyt;
      Mousey = Y;
    }
    Erasecursor();
    Colour;
    Enable;
    Plot;
    Pan(Xi, Yi);
    goto Displayloop;
  }
  Newgx = X / Scale6;
  Newgy = Y / Scale6;
  if (Newgx < Gridxl)
    Newgx = Gridxl;
  else if (Newgx > Gridxr)
    Newgx = Gridxr;
  if (Newgy < Gridyb)
    Newgy = Gridyb;
  else if (Newgy > Gridyt)
    Newgy = Gridyt;
  if (Newgx != Curgx || Newgy != Curgy) {
    Erasecursor();
    Curgx = Newgx;
    Curgy = Newgy;
    Drawcursor();
  }
  Newbuts = Mousebuttons;
  Butl = (Curbuts & 1) << 1 | (Newbuts & 1);
  Butm = (Curbuts & 2) | (unsigned)(Newbuts & 2) >> 1;
  Butr = (unsigned)(Curbuts & 4) >> 1 | (unsigned)(Newbuts & 4) >> 2;
  Curbuts = Newbuts;
  if (Butr == Pressed) goto Menu;
  Vgx = Curgx + Wgridxl;
  Vgy = Curgy + Wgridyb;
  Vg = Vgrid[Vgx][Vgy];
  Vgwh = Hvgrid[Vgx][Vgy] | Hvgrid[Vgx + 1][Vgy];
  Vgwv = Vvgrid[Vgx][Vgy] | Vvgrid[Vgx][Vgy + 1];
  Vgw = Vgwh | Vgwv;
  goto *Action[Action_sw = (Curtype)-1];
Action_1:;
  Layer = Poly;
  goto *Wireaction[Wireaction_sw = State];
Action_2:;
  Layer = Diff;
  goto *Wireaction[Wireaction_sw = State];
Action_3:;
  Layer = Metal1;
  goto *Wireaction[Wireaction_sw = State];
Action_4:;
  Layer = Metal2;
  goto *Wireaction[Wireaction_sw = State];
Wireaction_0:;
  if (Butm == Pressed || Butl == Pressed) {
    Wirestartgx = Curgx;
    Wirestartgy = Curgy;
    Wirecurgx = Curgx;
    Wirecurgy = Curgy;
    Curwiredir = Nodir;
    if (Butm == Pressed)
      State = Drawing;
    else
      State = Erasing;
  }
  goto Displayloop;
Wireaction_1:;
  if (Butm == Stillpressed) goto Wiredrawing;
  State = Nostate;
  goto *Wiredrawn[Wiredrawn_sw = Curwiredir];
Wiredrawn_0:;
  goto Displayloop;
Wiredrawn_1:;
  X = Wirestartgx + Wgridxl;
  Yb = Wirecurgy + Wgridyb + 1;
  Yt = Wirestartgy + Wgridyb;
Wireydrawn:;
  for (Y = Yb; Y <= Yt; Y++) {
    if (Vvgrid[X][Y] & Layer) continue;
    if (Layer == Poly) {
      if (((Vvgrid[X][Y - 1] | Vvgrid[X][Y] | Vvgrid[X][Y + 1]) & Diff) != 0 ||
          ((Vgrid[X][Y - 1] | Vgrid[X][Y]) & (Tranx | Contact | Subcon)) != 0 ||
          (((Hvgrid[X][Y - 1] | Hvgrid[X + 1][Y - 1]) & Diff) != 0 &&
           (Vgrid[X - 1][Y] & Trany) == 0) ||
          (((Hvgrid[X][Y] | Hvgrid[X + 1][Y]) & Diff) != 0 &&
           (Vgrid[X][Y] & Trany) == 0))
        goto Wireyko;
    } else if (Layer == Diff) {
      if (((Vvgrid[X][Y - 1] | Vvgrid[X][Y] | Vvgrid[X][Y + 1]) & Poly) != 0 ||
          ((Vgrid[X][Y - 1] | Vgrid[X][Y]) & (Trany | Contact | Subcon)) != 0 ||
          (((Hvgrid[X][Y - 1] | Hvgrid[X + 1][Y - 1]) & Poly) != 0 &&
           (Vgrid[X][Y - 1] & Tranx) == 0) ||
          (((Hvgrid[X][Y] | Hvgrid[X + 1][Y]) & Poly) != 0 &&
           (Vgrid[X][Y] & Tranx) == 0))
        goto Wireyko;
    } else if ((Vgrid[X][Y - 1] | Vgrid[X][Y]) & (Contact | Subcon))
      goto Wireyko;
    Vvgrid[X][Y] = Vvgrid[X][Y] | Layer;
    continue;
  Wireyko:
    Erasewirey(Layer, X - Wgridxl, Y - Wgridyb);
    if (Y != Yt) Drawwirey(Layer, X - Wgridxl, Y + 1 - Wgridyb);
    Flash();
  }
  goto Displayloop;
Wiredrawn_2:;
  Xl = Wirestartgx + Wgridxl + 1;
  Xr = Wirecurgx + Wgridxl;
  Y = Wirestartgy + Wgridyb;
Wirexdrawn:;
  for (X = Xl; X <= Xr; X++) {
    if (Hvgrid[X][Y] & Layer) continue;
    if (Layer == Poly) {
      if (((Hvgrid[X - 1][Y] | Hvgrid[X][Y] | Hvgrid[X + 1][Y]) & Diff) != 0 ||
          ((Vgrid[X - 1][Y] | Vgrid[X][Y]) & (Trany | Contact | Subcon)) != 0 ||
          (Vgrid[X - 1][Y] & Pwell) != (Vgrid[X][Y] & Pwell) ||
          (((Vvgrid[X - 1][Y] | Vvgrid[X - 1][Y + 1]) & Diff) != 0 &&
           (Vgrid[X - 1][Y] & Tranx) == 0) ||
          (((Vvgrid[X][Y] | Vvgrid[X][Y + 1]) & Diff) != 0 &&
           (Vgrid[X][Y] & Tranx) == 0))
        goto Wirexko;
    } else if (Layer == Diff) {
      if (((Hvgrid[X - 1][Y] | Hvgrid[X][Y] | Hvgrid[X + 1][Y]) & Poly) != 0 ||
          ((Vgrid[X - 1][Y] | Vgrid[X][Y]) & (Tranx | Contact | Subcon)) != 0 ||
          (((Vvgrid[X - 1][Y] | Vvgrid[X - 1][Y + 1]) & Poly) != 0 &&
           (Vgrid[X - 1][Y] & Trany) == 0) ||
          (((Vvgrid[X][Y] | Vvgrid[X][Y + 1]) & Poly) != 0 &&
           (Vgrid[X][Y] & Trany) == 0))
        goto Wirexko;
    } else if ((Vgrid[X - 1][Y] | Vgrid[X][Y]) & (Contact | Subcon))
      goto Wirexko;
    Hvgrid[X][Y] = Hvgrid[X][Y] | Layer;
    Drawwirex(Layer, X - Wgridxl, Y - Wgridyb);
    continue;
  Wirexko:
    Erasewirex(Layer, X - Wgridxl, Y - Wgridyb);
    if (X != Xr) Drawwirex(Layer, X + 1 - Wgridxl, Y - Wgridyb);
    Flash();
  }
  goto Displayloop;
Wiredrawn_3:;
  X = Wirestartgx + Wgridxl;
  Yb = Wirestartgy + Wgridyb + 1;
  Yt = Wirecurgy + Wgridyb;
  goto Wireydrawn;
Wiredrawn_4:;
  Xl = Wirecurgx + Wgridxl + 1;
  Xr = Wirestartgx + Wgridxl;
  Y = Wirestartgy + Wgridyb;
  goto Wirexdrawn;
Wiredrawing:;
  X = Curgx - Wirestartgx;
  Y = Curgy - Wirestartgy;
  if (X == 0 && Y == 0)
    Newwiredir = Nodir;
  else if (X >= Y)
    if (X > -Y)
      Newwiredir = East;
    else
      Newwiredir = South;
  else if (X > -Y)
    Newwiredir = North;
  else
    Newwiredir = West;
  if (Newwiredir != Curwiredir) {
    goto *Undrawwire[Undrawwire_sw = Curwiredir];
  Undrawwire_0:;
    goto Endundrawwire;
  Undrawwire_1:;
    for (Y = Wirecurgy + 1; Y <= Wirestartgy; Y++)
      Erasewirey(Layer, Wirestartgx, Y);
    goto Endundrawwire;
  Undrawwire_2:;
    for (X = Wirecurgx; X >= Wirestartgx + 1; X--)
      Erasewirex(Layer, X, Wirestartgy);
    goto Endundrawwire;
  Undrawwire_3:;
    for (Y = Wirecurgy; Y >= Wirestartgy + 1; Y--)
      Erasewirey(Layer, Wirestartgx, Y);
    goto Endundrawwire;
  Undrawwire_4:;
    for (X = Wirecurgx + 1; X <= Wirestartgx; X++)
      Erasewirex(Layer, X, Wirestartgy);
    goto Endundrawwire;
  Endundrawwire:;
    Wirecurgx = Wirestartgx;
    Wirecurgy = Wirestartgy;
    Curwiredir = Newwiredir;
  }
  goto *Drawwire[Drawwire_sw = Curwiredir];
Drawwire_0:;
  Drawcursor();
  goto Displayloop;
Drawwire_1:;
  if (Curgy <= Wirecurgy) {
    Yt = Wirecurgy + 1;
    if (Wirecurgy == Wirestartgy) Yt--;
    for (Y = Yt; Y >= Curgy + 1; Y--) Drawwirey(Layer, Wirestartgx, Y);
  } else
    for (Y = Wirecurgy + 1; Y <= Curgy; Y++) Erasewirey(Layer, Wirestartgx, Y);
  Wirecurgy = Curgy;
  goto Displayloop;
Drawwire_2:;
  if (Curgx >= Wirecurgx) {
    Xl = Wirecurgx;
    if (Wirecurgx == Wirestartgx) Xl++;
    for (X = Xl; X <= Curgx; X++) Drawwirex(Layer, X, Wirestartgy);
  } else
    for (X = Wirecurgx; X >= Curgx + 1; X--) Erasewirex(Layer, X, Wirestartgy);
  Wirecurgx = Curgx;
  goto Displayloop;
Drawwire_3:;
  if (Curgy >= Wirecurgy) {
    Yb = Wirecurgy;
    if (Wirecurgy == Wirestartgy) Yb++;
    for (Y = Yb; Y <= Curgy; Y++) Drawwirey(Layer, Wirestartgx, Y);
  } else
    for (Y = Wirecurgy; Y >= Curgy + 1; Y--) Erasewirey(Layer, Wirestartgx, Y);
  Wirecurgy = Curgy;
  goto Displayloop;
Drawwire_4:;
  if (Curgx <= Wirecurgx) {
    Xr = Wirecurgx + 1;
    if (Wirecurgx == Wirestartgx) Xr--;
    for (X = Xr; X >= Curgx + 1; X--) Drawwirex(Layer, X, Wirestartgy);
  } else
    for (X = Wirecurgx + 1; X <= Curgx; X++) Erasewirex(Layer, X, Wirestartgy);
  Wirecurgx = Curgx;
  goto Displayloop;
Action_5:;
  if (Butm == Pressed)
    if ((Vg & (Tranx | Trany | Subcon)) != 0 ||
        (Vgw != (Poly | Metal1) && Vgw != (Diff | Metal1) &&
         Vgw != (Metal1 | Metal2)))
      Flash();
    else
      Vgrid[Vgx][Vgy] = Vg | Contact;
  else if (Butl == Pressed)
    Vgrid[Vgx][Vgy] = Vg & (~Contact);
  goto Displayloop;
Action_6:;
  if (Butm == Pressed)
    if ((Vg & (Tranx | Trany | Contact)) != 0 || (Vgw & (~Metal2)) != Metal1)
      Flash();
    else
      Vgrid[Vgx][Vgy] = Vg | Subcon;
  else if (Butl == Pressed)
    Vgrid[Vgx][Vgy] = Vg & (~Subcon);
  goto Displayloop;
Action_7:;
  if (Butm == Pressed)
    if ((Vg & (Trany | Contact | Subcon)) != 0 || (Vgwh & Diff) != 0 ||
        (Vgwv & Poly) != 0)
      Flash();
    else
      Vgrid[Vgx][Vgy] = Vg | Tranx;
  else if (Butl == Pressed)
    Vgrid[Vgx][Vgy] = Vg & (~Tranx);
  goto Displayloop;
Action_8:;
  if (Butm == Pressed)
    if ((Vg & (Tranx | Contact | Subcon)) != 0 || (Vgwh & Poly) != 0 ||
        (Vgwv & Diff) != 0)
      Flash();
    else
      Vgrid[Vgx][Vgy] = Vg | Trany;
  else if (Butl == Pressed)
    Vgrid[Vgx][Vgy] = Vg & (~Trany);
  goto Displayloop;
Action_9:;
  if (Butm == Pressed)
    if ((Vg & (Trany | Contact | Subcon)) != 0 || (Vgwh & Diff) != 0 ||
        (Vgwv & Poly) != 0)
      Flash();
    else
      Vgrid[Vgx][Vgy] = Vg | Tranx | Pwell;
  else if (Butl == Pressed)
    Vgrid[Vgx][Vgy] = Vg & (~Tranx) & (~Pwell);
  goto Displayloop;
Action_10:;
  if (Butm == Pressed)
    if ((Vg & (Tranx | Contact | Subcon)) != 0 || (Vgwh & Poly) != 0 ||
        (Vgwv & Diff) != 0)
      Flash();
    else
      Vgrid[Vgx][Vgy] = Vg | Trany | Pwell;
  else if (Butl == Pressed)
    Vgrid[Vgx][Vgy] = Vg & (~Trany) & (~Pwell);
  goto Displayloop;
Action_11:;
  if (Butm == Pressed)
    ;
  else if (Butl == Pressed)
    ;
  goto Displayloop;
Action_12:;
  if (Butm == Pressed)
    Zoomin();
  else if (Butl == Pressed)
    Zoomout();
  goto Displayloop;
  void Setupcolourmap(void) {
    int Cmapc(int Red, int Green, int Blue) {
      return (((Blue << 5 | Green) << 5) + Red);
    }
    int I;
    for (I = 0; I <= 255; I++) Cmap[I] = 0;
    Backgroundcolour = Cmapc(14, 16, 14);
    Flashcolour = Cmapc(31, 0, 0);
    Cmap[0] = Backgroundcolour;
    Cmap[Poly] = Cmapc(28, 0, 0);
    Cmap[Diff] = Cmapc(0, 26, 0);
    Cmap[Diff + Poly] = Cmapc(18, 18, 0);
    Cmap[Metal1] = Cmapc(15, 15, 31);
    Cmap[Metal1 + Poly] = Cmapc(22, 8, 22);
    Cmap[Metal1 + Diff] = Cmapc(8, 24, 24);
    Cmap[Metal1 + Diff + Poly] = Cmapc(18, 18, 31);
    Cmap[Metal2] = Cmapc(0, 0, 31);
    Cmap[Metal2 + Poly] = Cmapc(24, 0, 31);
    Cmap[Metal2 + Diff] = Cmapc(0, 24, 31);
    Cmap[Metal2 + Diff + Poly] = Cmapc(24, 24, 31);
    Cmap[Metal2 + Metal1] = Cmapc(8, 8, 31);
    Cmap[Metal2 + Metal1 + Poly] = Cmapc(31, 8, 31);
    Cmap[Metal2 + Metal1 + Diff] = Cmapc(8, 31, 31);
    Cmap[Metal2 + Metal1 + Diff + Poly] = Cmapc(24, 24, 24);
    Cmap[Pwell] = Cmapc(20, 20, 0);
    for (I = 1; I <= Pwell - 1; I++) Cmap[Pwell + I] = Cmap[I];
    for (I = Contact; I <= 2 * Contact - 1; I++) Cmap[I] = Cmapc(24, 24, 24);
    for (I = Grid; I <= 2 * Grid - 1; I++) Cmap[I] = Cmapc(28, 28, 28);
    for (I = Menuback; I <= 2 * Menuback - 1; I++) Cmap[I] = Cmapc(16, 18, 16);
    for (I = 1; I <= Grid - 1; I++) Cmap[Menuback + I] = Cmap[I];
    Updatecolourmap;
  }
  void Drawwindowframe(int B, int R, int T, int L) {
    static int Frame = 0;
    if (!Frame) {
      Colour;
      Enable;
      Outline(Framestorexl, Framestoreyb, Framestorexr, Windowyb - 1);
      Outline(Windowxr + 1, Framestoreyb, Framestorexr, Framestoreyt);
      Outline(Framestorexl, Windowyt + 1, Framestorexr, Framestoreyt);
      Outline(Framestorexl, Framestoreyb, Windowxl - 1, Framestoreyt);
      Frame = 1;
    }
    Colour;
    Enable;
    Fill;
    Fill;
    Fill;
    Fill;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
  }
  void Setupnewscale(int Newscale) {
    int X;
    int Y;
    int Curx;
    int Cury;
    int Curvgx;
    int Curvgy;
    Scale = Newscale;
    Scale2 = 2 * Scale;
    Scale3 = 3 * Scale;
    Scale4 = 4 * Scale;
    Scale6 = 6 * Scale;
    Curx = Gridx[Curgx];
    Cury = Gridy[Curgy];
    Curvgx = Curgx + Wgridxl;
    Curvgy = Curgy + Wgridyb;
    Wgridxl = Curvgx - (Curx - Windowxl) / Scale6;
    Wgridxr = Curvgx + (Windowxr - Curx) / Scale6;
    Wgridyb = Curvgy - (Cury - Windowyb) / Scale6;
    Wgridyt = Curvgy + (Windowyt - Cury) / Scale6;
    Gridxr = Wgridxr - Wgridxl;
    Gridyt = Wgridyt - Wgridyb;
    Curgx = Curvgx - Wgridxl;
    Curgy = Curvgy - Wgridyb;
    Curx -= Scale6 * (Curgx + 1);
    for (X = -1; X <= Gridxr + 1; X++) {
      Gridx[X] = Curx;
      Curx += Scale6;
    }
    Cury -= Scale6 * (Curgy + 1);
    for (Y = -1; Y <= Gridyt + 1; Y++) {
      Gridy[Y] = Cury;
      Cury += Scale6;
    }
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    for (X = Gridxl; X <= Gridxr; X++)
      for (Y = Gridyb; Y <= Gridyt; Y++) Plot;
    Redrawdesign();
  }
  void Clipfill(int Xl, int Yb, int Xr, int Yt) {
    if (Xl < Windowxl) Xl = Windowxl;
    if (Yb < Windowyb) Yb = Windowyb;
    if (Xr > Windowxr) Xr = Windowxr;
    if (Yt > Windowyt) Yt = Windowyt;
    Fill;
  }
  void Clipvline(int X, int Yb, int Yt) {
    if (X < Windowxl || X > Windowxr) return;
    if (Yb < Windowyb) Yb = Windowyb;
    if (Yt > Windowyt) Yt = Windowyt;
    Vline;
  }
  void Cliphline(int Xl, int Xr, int Y) {
    if (Y < Windowyb || Y > Windowyt) return;
    if (Xl < Windowxl) Xl = Windowxl;
    if (Xr > Windowxr) Xr = Windowxr;
    Hline;
  }
  void Clipdbtline(int Xl, int Yb, int Xr, int Yt) {
    int Xll;
    int Xrr;
    if (Xl < Windowxl || Yb < Windowyb) {
      Xll = Xl + Windowyb - Yb;
      if (Xll >= Windowxl) {
        Xl = Xll;
        Yb = Windowyb;
      } else {
        Xl = Windowxl;
        Yb = Yb + Windowxl - Xl;
      }
    }
    if (Xr > Windowxr || Yt > Windowyt) {
      Xrr = Xr + Windowyt - Yt;
      if (Xrr <= Windowxr) {
        Xr = Xrr;
        Yt = Windowyt;
      } else {
        Xr = Windowxr;
        Yt = Yt + Windowxr - Xr;
      }
    }
    Line;
  }
  void Clipdtbline(int Xl, int Yt, int Xr, int Yb) {
    int Xll;
    int Xrr;
    if (Xl < Windowxl || Yt > Windowyt) {
      Xll = Xl + Yt - Windowyt;
      if (Xll >= Windowxl) {
        Xl = Xll;
        Yt = Windowyt;
      } else {
        Xl = Windowxl;
        Yt = Yt + Xl - Windowxl;
      }
    }
    if (Xr > Windowxr || Yb < Windowyb) {
      Xrr = Xr + Yb - Windowyb;
      if (Xrr <= Windowxr) {
        Xr = Xrr;
        Yb = Windowyb;
      } else {
        Xr = Windowxr;
        Yb = Yb + Xr - Windowxr;
      }
    }
    Line;
  }
  void Outline(int Xl, int Yb, int Xr, int Yt) {
    Hline;
    Vline;
    Hline;
    Vline;
  }
  void Clipoutline(int Xl, int Yb, int Xr, int Yt) {
    if (Yb >= Windowyb) Cliphline(Xl, Xr, Yb);
    if (Xr <= Windowxr) Clipvline(Xr, Yb, Yt);
    if (Yt <= Windowyt) Cliphline(Xl, Xr, Yt);
    if (Xl >= Windowxl) Clipvline(Xl, Yb, Yt);
  }
  void Drawwirex(int Layer, int Gx, int Gy) {
    Colour;
    Enable;
    Clipfill(Gridx[Gx - 1] - Scale, Gridy[Gy] - Scale, Gridx[Gx] + Scale,
             Gridy[Gy] + Scale);
  }
  void Erasewirex(int Layer, int Gx, int Gy) {
    Colour;
    Enable;
    Clipfill(Gridx[Gx - 1] - Scale, Gridy[Gy] - Scale, Gridx[Gx] + Scale,
             Gridy[Gy] + Scale);
    Redrawgridpoint(Gx - 1, Gy);
    Redrawgridpoint(Gx, Gy);
  }
  void Drawwirey(int Layer, int Gx, int Gy) {
    Colour;
    Enable;
    Clipfill(Gridx[Gx] - Scale, Gridy[Gy - 1] - Scale, Gridx[Gx] + Scale,
             Gridy[Gy] + Scale);
  }
  void Erasewirey(int Layer, int Gx, int Gy) {
    Colour;
    Enable;
    Clipfill(Gridx[Gx] - Scale, Gridy[Gy - 1] - Scale, Gridx[Gx] + Scale,
             Gridy[Gy] + Scale);
    Redrawgridpoint(Gx, Gy - 1);
    Redrawgridpoint(Gx, Gy);
  }
  void Drawtranx(int Gx, int Gy) {
    Colour;
    Enable;
    Clipfill(Gridx[Gx] - Scale3, Gridy[Gy] - Scale, Gridx[Gx] + Scale3,
             Gridy[Gy] + Scale);
    Colour;
    Enable;
    Clipfill(Gridx[Gx] - Scale, Gridy[Gy] - Scale3, Gridx[Gx] + Scale,
             Gridy[Gy] + Scale3);
  }
  void Drawtrany(int Gx, int Gy) {
    Colour;
    Enable;
    Clipfill(Gridx[Gx] - Scale, Gridy[Gy] - 3 * Scale, Gridx[Gx] + Scale,
             Gridy[Gy] + 3 * Scale);
    Colour;
    Enable;
    Clipfill(Gridx[Gx] - 3 * Scale, Gridy[Gy] - Scale, Gridx[Gx] + 3 * Scale,
             Gridy[Gy] + Scale);
  }
  void Drawcontact(int Gx, int Gy) {
    int Xm;
    int Xp;
    int Ym;
    int Yp;
    Colour;
    Enable;
    Xm = Gridx[Gx] - Scale2;
    Xp = Xm + Scale4;
    Ym = Gridy[Gy] - Scale2;
    Yp = Ym + Scale4;
    Cliphline(Xm, Xp, Ym);
    Clipvline(Xp, Ym, Yp);
    Cliphline(Xm, Xp, Yp);
    Clipvline(Xm, Ym, Yp);
    Clipdbtline(Xm, Ym, Xp, Yp);
    Clipdtbline(Xm, Yp, Xp, Ym);
  }
  void Drawsubcon(int Gx, int Gy) {
    int X;
    int Y;
    int Xm;
    int Xp;
    int Ym;
    int Yp;
    Colour;
    Enable;
    X = Gridx[Gx];
    Xm = X - Scale2;
    Xp = Xm + Scale4;
    Y = Gridy[Gy];
    Ym = Y - Scale2;
    Yp = Ym + Scale4;
    Cliphline(Xm, Xp, Ym);
    Clipvline(Xp, Ym, Yp);
    Cliphline(Xm, Xp, Yp);
    Clipvline(Xm, Ym, Yp);
    Clipvline(X, Ym, Yp);
    Cliphline(Xm, Xp, Y);
  }
  void Drawpwell(int Gx, int Gy) {
    int X;
    int Y;
    Colour;
    Enable;
    X = Gridx[Gx];
    Y = Gridy[Gy];
    Clipfill(X - Scale3, Y - Scale3, X + Scale3, Y + Scale3);
  }
  void Redrawdesign(void) {
    int X;
    int Y;
    for (X = Gridxl; X <= Gridxr; X++)
      for (Y = Gridyb; Y <= Gridyt; Y++) {
        Redrawprim(X, Y);
        Redrawwirex(X, Y);
        Redrawwirey(X, Y);
      }
    for (Y = Gridyb; Y <= Gridyt; Y++) Redrawwirex(Gridxr + 1, Y);
    for (X = Gridxl; X <= Gridxr; X++) Redrawwirey(X, Gridyt + 1);
  }
  void Redrawgridpoint(int Gx, int Gy) {
    Redrawprim(Gx, Gy);
    Redrawwirex(Gx, Gy);
    Redrawwirex(Gx + 1, Gy);
    Redrawwirey(Gx, Gy);
    Redrawwirey(Gx, Gy + 1);
  }
  void Redrawprim(int Gx, int Gy) {
    int P;
    P = Vgrid[Gx + Wgridxl][Gy + Wgridyb];
    if (P) {
      if (P & Pwell) Drawpwell(Gx, Gy);
      if (P & Tranx)
        Drawtranx(Gx, Gy);
      else if (P & Trany)
        Drawtrany(Gx, Gy);
      else if (P & Contact)
        Drawcontact(Gx, Gy);
      else if (P & Subcon)
        Drawsubcon(Gx, Gy);
    }
  }
  void Redrawwirex(int Gx, int Gy) {
    int Wires;
    int Drawn;
    int Erased;
    int Layers;
    Wires = Hvgrid[Gx + Wgridxl][Gy + Wgridyb];
    Drawn = Wires & 0xF;
    Erased = (unsigned)Wires >> 4;
    Layers = Drawn & (~Erased);
    if (Layers) Drawwirex(Layers, Gx, Gy);
  }
  void Redrawwirey(int Gx, int Gy) {
    int Layers;
    Layers = Vvgrid[Gx + Wgridxl][Gy + Wgridyb];
    if (Layers) Drawwirey(Layers, Gx, Gy);
  }
  void Pan(int Xi, int Yi) {
    Colour;
    Enable;
    Fill;
    Wgridxl += Xi;
    Wgridxr += Xi;
    Wgridyb += Yi;
    Wgridyt += Yi;
    Redrawdesign();
  }
  void Zoomin(void) { Setupnewscale(Scale + 1); }
  void Zoomout(void) {
    if (Scale != 1) Setupnewscale(Scale - 1);
  }
  void Drawmenu(void) {
    int X;
    int Y;
    int Xl;
    int Xr;
    int Yb;
    int Yt;
    Erasecursor();
    Menuxl = Mousex - Mitemx[Curtype];
    Menuxr = Menuxl + Menuxs;
    if (Menuxl < Windowxl) {
      Menuxl = Windowxl;
      Menuxr = Menuxl + Menuxs;
    }
    if (Menuxr > Windowxr) {
      Menuxr = Windowxr;
      Menuxl = Menuxr - Menuxs;
    }
    Menuyb = Mousey - Mitemy[Curtype];
    Menuyt = Menuyb + Menuys;
    if (Menuyb < Windowyb) {
      Menuyb = Windowyb;
      Menuyt = Menuyb + Menuys;
    }
    if (Menuyt > Windowyt) {
      Menuyt = Windowyt;
      Menuyb = Menuyt - Menuys;
    }
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Outline(Menuxl, Menuyb, Menuxr, Menuyt);
    X = Mitemx[Mpoly] + Menuxl;
    Y = Mitemy[Mpoly] + Menuyb;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mdiff] + Menuxl;
    Y = Mitemy[Mdiff] + Menuyb;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mmetal1] + Menuxl;
    Y = Mitemy[Mmetal1] + Menuyb;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mmetal2] + Menuxl;
    Y = Mitemy[Mmetal2] + Menuyb;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mcontact] + Menuxl;
    Xl = X - Mwscale;
    Xr = X + Mwscale;
    Y = Mitemy[Mcontact] + Menuyb;
    Yb = Y - Mwscale;
    Yt = Y + Mwscale;
    Colour;
    Enable;
    Outline(Xl, Yb, Xr, Yt);
    Line;
    Line;
    X = Mitemx[Msubcon] + Menuxl;
    Xl = X - Mwscale;
    Xr = X + Mwscale;
    Y = Mitemy[Msubcon] + Menuyb;
    Yb = Y - Mwscale;
    Yt = Y + Mwscale;
    Colour;
    Enable;
    Outline(Xl, Yb, Xr, Yt);
    Vline;
    Hline;
    X = Mitemx[Mtranx] + Menuxl;
    Y = Mitemy[Mtranx] + Menuyb;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mtrany] + Menuxl;
    Y = Mitemy[Mtrany] + Menuyb;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mptranx] + Menuxl;
    Y = Mitemy[Mptranx] + Menuyb;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mptrany] + Menuxl;
    Y = Mitemy[Mptrany] + Menuyb;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    Fill;
    X = Mitemx[Mpwell] + Menuxl;
    Y = Mitemy[Mpwell] + Menuyb;
    Colour;
    Enable;
    Fill;
    Colour;
    Enable;
    X = Mitemx[Mzoom] + Menuxl;
    Y = Mitemy[Mzoom] + Menuyb;
    Outline(X - Mwscale, Y - Mwscale, X + Mwscale, Y + Mwscale);
    Outline(X - Mtscale, Y - Mtscale, X + Mtscale, Y + Mtscale);
    X = Mitemx[Minput] + Menuxl;
    Y = Mitemy[Minput] + Menuyb;
    Textat;
    Showstring;
    X = Mitemx[Moutput] + Menuxl;
    Y = Mitemy[Moutput] + Menuyb;
    Textat;
    Showstring;
    Colour;
    Enable;
    Outline(Mitemxl[Curtype] + Menuxl, Mitemyb[Curtype] + Menuyb,
            Mitemxr[Curtype] + Menuxl, Mitemyt[Curtype] + Menuyb);
  }
  void Erasemenu(void) {
    Colour;
    Enable;
    Fill;
    Redrawdesign();
    Curgx = Mousex / Scale6;
    Curgy = Mousey / Scale6;
    Drawcursor();
  }
  void Drawcursor(void) {
    int X;
    int Y;
    int Xl;
    int Yb;
    int Xr;
    int Yt;
    int Layer;
    static int Cur_sw;
    static void *Cur[14 /*1:14*/] = {
        &&Cur_1,  &&Cur_2,  &&Cur_3,       &&Cur_4,       &&Cur_5,
        &&Cur_6,  &&Cur_7,  &&Cur_8,       &&Cur_9,       &&Cur_10,
        &&Cur_11, &&Cur_12, &&Cur_default, &&Cur_default,
    };
    goto *Cur[Cur_sw = (Curtype)-1];
  Cur_1:
    Layer = Poly;
    goto Wirecursor;
  Cur_2:
    Layer = Diff;
    goto Wirecursor;
  Cur_3:
    Layer = Metal1;
    goto Wirecursor;
  Cur_4:
    Layer = Metal2;
    goto Wirecursor;
  Wirecursor:;
    X = Gridx[Curgx];
    Xl = X - Scale;
    Xr = X + Scale;
    Y = Gridy[Curgy];
    Yb = Y - Scale;
    Yt = Y + Scale;
    Colour;
    Enable;
    Clipfill(Xl, Yb, Xr, Yt);
    goto Drawout;
  Cur_5:
    Drawcontact(Curgx, Curgy);
    goto Drawout;
  Cur_6:
    Drawsubcon(Curgx, Curgy);
    goto Drawout;
  Cur_7:
    Drawtranx(Curgx, Curgy);
    goto Drawout;
  Cur_8:
    Drawtrany(Curgx, Curgy);
    goto Drawout;
  Cur_9:
    Drawpwell(Curgx, Curgy);
    Drawtranx(Curgx, Curgy);
    goto Drawout;
  Cur_10:
    Drawpwell(Curgx, Curgy);
    Drawtrany(Curgx, Curgy);
    goto Drawout;
  Cur_11:
    Drawpwell(Curgx, Curgy);
    goto Drawout;
  Cur_12:;
    X = Gridx[Curgx];
    Xl = X - Scale2;
    Xr = X + Scale2;
    Y = Gridy[Curgy];
    Yb = Y - Scale2;
    Yt = Y + Scale2;
    Colour;
    Enable;
    Clipoutline(Xl, Yb, Xr, Yt);
    goto Drawout;
  Drawout:;
    Colour;
    Enable;
    X = Gridx[Curgx];
    Y = Gridy[Curgy];
    Clipoutline(X + Curxl[Curtype] * Scale, Y + Curyb[Curtype] * Scale,
                X + Curxr[Curtype] * Scale, Y + Curyt[Curtype] * Scale);
    goto Cur_skip;
  Cur_default:
    fprintf(stderr, "\nSwitch label 'Cur(%d):' not set in %s\n", Cur_sw + 1,
            __PRETTY_FUNCTION__);
    fflush(stderr);
    abort();
  Cur_skip:;
  }
  void Erasecursor(void) {
    int X;
    int Y;
    X = Gridx[Curgx];
    Y = Gridy[Curgy];
    Colour;
    Enable;
    Clipfill(X - Scale3, Y - Scale3, X + Scale3, Y + Scale3);
    Redrawgridpoint(Curgx, Curgy);
  }
  void Flash(void) {
    int I;
    Cmap[0] = Flashcolour;
    Updatecolourmap;
    for (I = 1; I <= 20000; I++)
      ;
    Cmap[0] = Backgroundcolour;
    Updatecolourmap;
  }
  goto Erasewire_skip;
Erasewire_default:
  fprintf(stderr, "\nSwitch label 'Erasewire(%d):' not set in %s\n",
          Erasewire_sw, __PRETTY_FUNCTION__);
  fflush(stderr);
  abort();
Erasewire_skip:;
  goto Unerasewire_skip;
Unerasewire_default:
  fprintf(stderr, "\nSwitch label 'Unerasewire(%d):' not set in %s\n",
          Unerasewire_sw, __PRETTY_FUNCTION__);
  fflush(stderr);
  abort();
Unerasewire_skip:;
  goto Wireerased_skip;
Wireerased_default:
  fprintf(stderr, "\nSwitch label 'Wireerased(%d):' not set in %s\n",
          Wireerased_sw, __PRETTY_FUNCTION__);
  fflush(stderr);
  abort();
Wireerased_skip:;
  goto Wireaction_skip;
Wireaction_default:
  fprintf(stderr, "\nSwitch label 'Wireaction(%d):' not set in %s\n",
          Wireaction_sw, __PRETTY_FUNCTION__);
  fflush(stderr);
  abort();
Wireaction_skip:;
  goto Action_skip;
Action_default:
  fprintf(stderr, "\nSwitch label 'Action(%d):' not set in %s\n", Action_sw + 1,
          __PRETTY_FUNCTION__);
  fflush(stderr);
  abort();
Action_skip:;
  exit(0);
  return (1);
}
