/* From input file "<stdin>" */


#include <p2c/p2c.h>


/*6:*/

/*------------------------------*/
/* declarations are in mf2ps1.h */
/*------------------------------*/
/*:6*/
/*11:*/

#define memmax          30000
#define maxinternal     100
#define bufsize         500
#define errorline       79
#define halferrorline   50
#define maxprintline    79
#define screenwidth     1024
#define screendepth     1024
#define stacksize       30
#define maxstrings      2000
#define stringvacancies  8000
#define poolsize        32000
#define movesize        5000
#define maxwiggle       300
#define gfbufsize       800
#define filenamesize    256

#define poolname        "mf.pool"

#define pathsize        300
#define bistacksize     785
#define headersize      100
#define ligtablesize    300
#define maxfontdimen    50


/*:11*/
/*18:*/

typedef char ASCIIcode;
   /*:18*/
/*24:*/
typedef uchar eightbits;

/*------------------*/
/*------------------*/
typedef Char UNIXfilename[filenamesize];

typedef struct bytefile {
  long *stdioptr, *locptr;
  UNIXfilename filename;
} bytefile;

/*:24*/
/*37:*/
typedef short poolpointer;

typedef short strnumber;
   /*:37*/
/*101:*/
typedef long scaled;

typedef char smallnumber;

/*:101*/
/*105:*/
typedef long fraction;

/*:105*/
/*106:*/
typedef long angle;

/*:106*/
/*156:*/
typedef short quarterword;

typedef short halfword;

typedef char twochoices;

typedef char threechoices;

typedef struct twohalves {
  halfword rh;
  union {
    halfword lh;
    struct {
      quarterword b0, b1;
    } U2;
  } UU;
} twohalves;

typedef struct fourquarters {
  quarterword b0, b1, b2, b3;
} fourquarters;

typedef union memoryword {
  long int_;
  twohalves hh;
  fourquarters qqqq;
} memoryword;

/*:156*/
/*186:*/
typedef char commandcode;

/*:186*/
/*565:*/
typedef short screenrow;

typedef short screencol;

typedef screencol transspec[screenwidth + 1];
typedef char pixelcolor;

/*:565*/
/*571:*/
typedef char windownumber;

/*:571*/
/*627:*/

typedef struct instaterecord {
  quarterword indexfield;
  halfword startfield, locfield, limitfield, namefield;
} instaterecord;

/*:627*/
/*1151:*/
typedef short gfindex;

typedef eightbits gfbuftype[gfbufsize + 1];

/*:1151*/
/*13:*/


Static long bad;
/*:13*/
/*20:*/
Static ASCIIcode xord[256];
Static Char xchr[128];
/*:20*/
/*25:*/
Static UNIXfilename nameoffile, realnameoffile;
Static short namelength;   /*:25*/
/*29:*/
Static ASCIIcode buffer[bufsize + 1];
Static short first;
Static short last;
Static short maxbufstack;
/*:29*/
/*38:*/
Static ASCIIcode strpool[poolsize + 1];
Static poolpointer strstart[maxstrings + 1];
Static poolpointer poolptr;
Static strnumber strptr;
Static poolpointer initpoolptr;
Static strnumber initstrptr;
Static poolpointer maxpoolptr;
Static strnumber maxstrptr;
/*:38*/
/*42:*/
Static char strref[maxstrings + 1];
/*:42*/
/*50:*/
Static FILE *poolfile;
/*:50*/
/*54:*/
Static FILE *logfile;
/*-------------------------------------------------------------*/
Static FILE *psfile;   /* the PostScript code           */
Static FILE *g;   /* holds the character information after re-arrange*/
Static double lastx0, lasty0;   /* last point in sunpath         */
Static double lastx3, lasty3;   /* make optimization on commands */
Static double prevtox3, prevtoy3;
Static long lastyearval;   /* mark entering to macros       */
Static long lastmonthval;   /* STROKE , FILL , and ERASE     */
/* in MY plain.mf                */
Static long my_xx, my_yy;   /* hold the values of xx & yy    */
Static long LineSource;   /* Identifier for sendline source  */
Static long CurveSource;   /* Identifier for makemoves source */
Static boolean foundnew;   /* true while xchr[s]='[' until ']' */
Static long ascval;   /* holds the ascii of curr. letter */
Static boolean ascii_on;   /* reading ascval is 'on'        */
/*-------------------------------------------------------------*/
Static char selector;
Static char dig[23];
Static long tally;
Static char termoffset;
Static char fileoffset;
Static ASCIIcode trickbuf[errorline + 1];
Static long trickcount, firstcount;
/*:54*/
/*68:*/
Static char interaction;
/*:68*/
/*71:*/
Static boolean deletionsallowed;
Static char history;
Static short errorcount;
/*:71*/
/*74:*/
Static strnumber helpline[6];
Static char helpptr;
Static boolean useerrhelp;
Static strnumber errhelp;
/*:74*/
/*91:*/
Static long interrupt;
Static boolean OKtointerrupt;
/*:91*/
/*97:*/
Static boolean aritherror;
/*:97*/
/*129:*/
Static long twotothe[31];
Static long speclog[28];
/*:129*/
/*137:*/
Static angle specatan[26];
/*:137*/
/*144:*/
Static fraction nsin, ncos;   /*:144*/
/*148:*/
Static fraction randoms[55];
Static char jrandom;
/*:148*/
/*158:*/
Static halfword tempptr;
/*:158*/
/*159:*/
Static memoryword mem[memmax + 30001];
Static halfword lomemmax, himemmin;
/*:159*/
/*160:*/
Static long varused, dynused;
/*:160*/
/*161:*/
Static halfword avail, memend;
/*:161*/
/*166:*/
Static halfword rover;
/*:166*/
/*178:*/
Static uchar freearr[(memmax + 30008) / 8];
Static uchar wasfree[(memmax + 30008) / 8];
Static halfword wasmemend, waslomax, washimin;
Static boolean panicking;
/*:178*/
/*190:*/
Static scaled internal[maxinternal];
Static strnumber intname[maxinternal];
Static char intptr;   /*:190*/
/*196:*/
Static char oldsetting;
/*:196*/
/*198:*/
Static char charclass[128];
/*:198*/
/*200:*/
Static halfword hashused;
Static long stcount;
/*:200*/
/*201:*/
Static twohalves hash[2241];
Static twohalves eqtb[2241];   /*:201*/
/*225:*/
Static halfword gpointer;
/*:225*/
/*230:*/
Static smallnumber bignodesize[2];
/*:230*/
/*250:*/
Static halfword saveptr;
/*:250*/
/*267:*/
Static halfword pathtail;
/*:267*/
/*279:*/
Static scaled deltax[pathsize + 1], deltay[pathsize + 1], delta[pathsize + 1];
Static angle psi[pathsize];
/*:279*/
/*283:*/
Static angle theta[pathsize + 1];
Static fraction uu[pathsize + 1];
Static angle vv[pathsize + 1];
Static fraction ww[pathsize + 1];   /*:283*/
/*298:*/
Static fraction st, ct, sf, cf;
/*:298*/
/*308:*/
Static long move[movesize + 1];
Static short moveptr;
/*:308*/
/*309:*/
Static long bisectstack[bistacksize + 1];
Static short bisectptr;
/*:309*/
/*327:*/
Static halfword curedges;
Static long curwt;
/*:327*/
/*371:*/
Static long tracex, tracey, traceyy;
/*:371*/
/*379:*/
Static char octant;
/*:379*/
/*389:*/
Static scaled curx, cury, maxallowed;
/*:389*/
/*395:*/
Static strnumber octantdir[8];   /*:395*/
/*403:*/
Static halfword curspec;
Static long turningnumber;
Static halfword curpen;
Static char curpathtype;
/*:403*/
/*427:*/
Static scaled before[maxwiggle + 1], after[maxwiggle + 1];
Static halfword nodetoround[maxwiggle + 1];
Static short curroundingptr;
Static short maxroundingptr;
/*:427*/
/*430:*/
Static scaled curgran;
/*:430*/
/*448:*/
Static char octantnumber[8];
Static char octantcode[8];   /*:448*/
/*455:*/
Static boolean revturns;
/*:455*/
/*461:*/
Static char ycorr[8], xycorr[8], zcorr[8];
Static short xcorr[8];   /*:461*/
/*464:*/
Static long m0, n0, m1, n1;
Static char d0, d1;
/*:464*/
/*507:*/
Static long envmove[movesize + 1];
/*:507*/
/*552:*/
Static char tolstep;   /*:552*/
/*555:*/
Static long curt, curtt, timetogo, maxt;
/*:555*/
/*557:*/
Static long delx, dely, tol;
Static short uv, xy;
Static long threel, apprt, apprtt;
/*:557*/
/*566:*/
/*screenpixel:array[screenrow,screencol]of pixelcolor;*/
/*:566*/
/*569:*/
Static boolean screenstarted, screenOK;
/*:569*/
/*572:*/
Static boolean windowopen[16];
Static screencol leftcol[16];
Static screencol rightcol[16];
Static screenrow toprow[16];
Static screenrow botrow[16];
Static long mwindow[16];
Static long nwindow[16];
Static long windowtime[16];
/*:572*/
/*579:*/
Static transspec rowtransition;
/*:579*/
/*585:*/
Static long serialno;
/*:585*/
/*592:*/
Static boolean fixneeded, watchcoefs;
Static halfword depfinal;
/*:592*/
/*624:*/
Static eightbits curcmd;
Static long curmod;
Static halfword cursym;
/*:624*/
/*628:*/
Static instaterecord inputstack[stacksize + 1];
Static char inputptr;
Static char maxinstack;
Static instaterecord curinput;
/*:628*/
/*631:*/
Static char inopen;
Static FILE *inputfile[6];
Static long line;
Static long linestack[6];
/*:631*/
/*633:*/
Sinitializetatic halfword paramstack[151];
Static uchar paramptr;
Static long maxparamstack;
/*:633*/
/*634:*/
Static char fileptr;
/*:634*/
/*659:*/
Static char scannerstatus;
Static long warninginfo;
/*:659*/
/*680:*/
Static boolean forceeof;
/*:680*/
/*699:*/
Static short bgloc, egloc;
/*:699*/
/*738:*/
Static halfword condptr;
Static char iflimit;
Static smallnumber curif;
Static long ifline;
/*:738*/
/*752:*/
Static halfword loopptr;
/*:752*/
/*767:*/
Static strnumber curname, curarea, curext;
/*:767*/
/*768:*/
Static poolpointer areadelimiter, extdelimiter;
/*:768*/
/*775:*/
Static Char MFbasedefault[10];
/*:775*/
/*782:*/
Static strnumber jobname, logname;
/*:782*/
/*785:*/
Static strnumber gfext;
/*:785*/
/*791:*/
Static bytefile gffile;
Static strnumber outputfilename;
/*:791*/
/*796:*/
Static smallnumber curtype;
Static long curexp;
/*:796*/
/*813:*/
Static long maxc[2];
Static halfword maxptr[2];
Static halfword maxlink[2];
/*:813*/
/*821:*/
Static char varflag;
/*:821*/
/*954:*/
Static scaled txx, txy, tyx, tyy, tx, ty;
/*:954*/
/*1077:*/
Static halfword startsym;   /*:1077*/
/*1084:*/
Static boolean longhelpseen;
/*:1084*/
/*1087:*/
Static bytefile tfmfile;
Static strnumber metricfilename;
/*:1087*/
/*1096:*/
Static eightbits bc, ec;
Static scaled tfmwidth[256];
Static scaled tfmheight[256];
Static scaled tfmdepth[256];
Static scaled tfmitalcorr[256];
Static boolean charexists[256];
Static char chartag[256];
Static eightbits charremainder[256];
Static short headerbyte[headersize];
Static fourquarters ligkern[ligtablesize + 1];
Static short nl;
Static scaled kern[256];
Static short nk;
Static fourquarters exten[256];
Static short ne;
Static scaled param[maxfontdimen];
Static char np;
Static short nw, nh, nd, ni;
/*:1096*/
/*1119:*/
Static scaled perturbation;
/*:1119*/
/*1125:*/
Static halfword dimenhead[4];
/*:1125*/
/*1130:*/
Static scaled maxtfmdimen;
Static long tfmchanged;
/*:1130*/
/*1149:*/
Static long gfminm, gfmaxm, gfminn, gfmaxn, gfprevptr, totalchars;
Static long charptr[256];
Static long gfdx[256], gfdy[256];
/*:1149*/
/*1152:*/
Static gfbuftype gfbuf;
Static gfindex halfbuf, gflimit, gfptr;
Static long gfoffset;   /*:1152*/
/*1162:*/
Static long bocc, bocp;
/*:1162*/
/*1183:*/
Static strnumber baseident;   /*:1183*/
/*1188:*/
Static FILE *basefile;
/*:1188*/
/*1203:*/
Static long readyalready;   /*:1203*/
/*1214:*/
Static poolpointer editnamestart;
Static long editnamelength, editline;   /*:1214*/


extern Void unskew PP((long x, long y, int octant));

extern Void sendcurve PP((long x0, long x1, long x2, long x3, long y0,
			  long y1, long y2, long y3, long octant));

extern Void sendline PP((long x0, long y0, long x1, long y1, long octant,
			 long LineSource));

extern Void confusion PP((int s));

extern long abvscd PP((long a, long b, long c, long d));

extern Void makemoves PP((long xx0, long xx1, long xx2, long xx3, long yy0,
			  long yy1, long yy2, long yy3, int xicorr,
			  int etacorr, long CurveSource, int oc));

extern Void print_start PP((FILE **f));

extern Void print_end PP((FILE **f));

extern Void init_ps PP((FILE **f));

extern Void tini_ps PP((FILE **f));

extern Void auxslowprint PP((long s));

extern Void auxprintnl PP((int s));

extern Void sendascii PP((long asc));

/*------------------------------*/
/* $Header: /nfs/loki/data3/emery/REPOSITORY/heaplayers/benchmarks/p2c/foo,v 1.1 2003/09/19 21:11:53 emery Exp $ */

/* declarations for external C assist routines for MetaFont */

extern Void exit_ PP((long x));

extern Void closea PP((FILE **f));

extern Void closew PP((FILE **f));

extern Void dateandtime PP((long *minutes, long *day, long *month, long *year));

extern Void setpaths PV();

extern boolean testaccess PP((Char *nameoffile, Char *realnameoffile,
			      long accessmode, long filepath));

extern Void calledit PP((ASCIIcode *filename, long fnlength, long linenumber));

extern boolean bopenout PP((bytefile *f, Char *name));

extern Void bclose PP((bytefile *f));

extern Void bgetname PP((bytefile *f, Char *name));

extern Void bwritebuf PP((bytefile *f, eightbits *buf, long first, long last));

extern Void bwritebyte PP((bytefile *f, long b));

extern Void bwrite2bytes PP((bytefile *f, long b));

extern Void bwrite4bytes PP((bytefile *f, long b));

extern long makefraction PP((long p, long q));

extern long takefraction PP((long q, long f));

/* $Header: /nfs/loki/data3/emery/REPOSITORY/heaplayers/benchmarks/p2c/foo,v 1.1 2003/09/19 21:11:53 emery Exp $ */

/* External procedures for UNIX MetaFont VIRMF for display graphics */

extern boolean initscreen PV();

extern Void updatescreen PV();

extern Void blankrectangle PP((int leftcol, int rightcol, int toprow,
			       int botrow));

extern Void paintrow PP((int r, int b, screencol *a, int n));

<stdin>, line 571: Warning: Symbol 'CHR' is not defined [221]
<stdin>, line 572: Warning: Symbol 'CHR' is not defined [221]
<stdin>, line 575: Warning: Symbol 'CHR' is not defined [221]


Static Void initialize()
{   /*:130*/
  /*19:*/
  char i;
  /*:19*/
  /*130:*/
  long k;
  short TEMP;

  /*21:*/
  xchr[32] = ' ';
  xchr[33] = '!';
  xchr[34] = '"';
  xchr[35] = '#';
  xchr[36] = '$';
  xchr[37] = '%';
  xchr[38] = '&';
  xchr[39] = '\'';
  xchr[40] = '(';
  xchr[41] = ')';
  xchr[42] = '*';
  xchr[43] = '+';
  xchr[44] = ',';
  xchr[45] = '-';
  xchr[46] = '.';
  xchr[47] = '/';
  xchr[48] = '0';
  xchr[49] = '1';
  xchr[50] = '2';
  xchr[51] = '3';
  xchr[52] = '4';
  xchr[53] = '5';
  xchr[54] = '6';
  xchr[55] = '7';
  xchr[56] = '8';
  xchr[57] = '9';
  xchr[58] = ':';
  xchr[59] = ';';
  xchr[60] = '<';
  xchr[61] = '=';
  xchr[62] = '>';
  xchr[63] = '?';
  xchr[64] = '@';
  xchr[65] = 'A';
  xchr[66] = 'B';
  xchr[67] = 'C';
  xchr[68] = 'D';
  xchr[69] = 'E';
  xchr[70] = 'F';
  xchr[71] = 'G';
  xchr[72] = 'H';
  xchr[73] = 'I';
  xchr[74] = 'J';
  xchr[75] = 'K';
  xchr[76] = 'L';
  xchr[77] = 'M';
  xchr[78] = 'N';
  xchr[79] = 'O';
  xchr[80] = 'P';
  xchr[81] = 'Q';
  xchr[82] = 'R';
  xchr[83] = 'S';
  xchr[84] = 'T';
  xchr[85] = 'U';
  xchr[86] = 'V';
  xchr[87] = 'W';
  xchr[88] = 'X';
  xchr[89] = 'Y';
  xchr[90] = 'Z';
  xchr[91] = '[';
  xchr[92] = '\\';
  xchr[93] = ']';
  xchr[94] = '^';
  xchr[95] = '_';
  xchr[96] = '`';
  xchr[97] = 'a';
  xchr[98] = 'b';
  xchr[99] = 'c';
  xchr[100] = 'd';
  xchr[101] = 'e';
  xchr[102] = 'f';
  xchr[103] = 'g';
  xchr[104] = 'h';
  xchr[105] = 'i';
  xchr[106] = 'j';
  xchr[107] = 'k';
  xchr[108] = 'l';
  xchr[109] = 'm';
  xchr[110] = 'n';
  xchr[111] = 'o';
  xchr[112] = 'p';
  xchr[113] = 'q';
  xchr[114] = 'r';
  xchr[115] = 's';
  xchr[116] = 't';
  xchr[117] = 'u';
  xchr[118] = 'v';
  xchr[119] = 'w';
  xchr[120] = 'x';
  xchr[121] = 'y';
  xchr[122] = 'z';
  xchr[123] = '{';
  xchr[124] = '|';
  xchr[125] = '}';
  xchr[126] = '~';
  xchr[0] = ' ';
  xchr[127] = ' ';   /*:21*/
  /*22:*/
  for (i = 1; i <= 31; i++)
    xchr[i] = ' ';
  xchr[9] = chr(9);
/* p2c: <stdin>, line 571: Warning: Symbol 'CHR' is not defined [221] */
  xchr[12] = chr(12);   /*:22*/
/* p2c: <stdin>, line 572: Warning: Symbol 'CHR' is not defined [221] */
  /*23:*/
  for (TEMP = 0; TEMP <= 127; TEMP++) {
    i = TEMP;
    xord[chr(i)] = 127;
/* p2c: <stdin>, line 575: Warning: Symbol 'CHR' is not defined [221] */
  }
  for (i = 1; i <= 126; i++)   /*:23*/
    xord[xchr[i]] = i;
  /*69:*/
  interaction = 3;   /*:69*/
  /*72:*/
  deletionsallowed = true;
  errorcount = 0;   /*:72*/
  /*75:*/
  helpptr = 0;
  useerrhelp = false;
  errhelp = 0;   /*:75*/
  /*92:*/
  interrupt = 0;
  OKtointerrupt = true;
  /*:92*/
  /*98:*/
  aritherror = false;   /*:98*/
  /*131:*/
  twotothe[0] = 1;
  for (k = 1; k <= 30; k++)
    twotothe[k] = twotothe[k - 1] * 2;
  speclog[0] = 93032640L;
  speclog[1] = 38612034L;
  speclog[2] = 17922280L;
  speclog[3] = 8662214L;
  speclog[4] = 4261238L;
  speclog[5] = 2113709L;
  speclog[6] = 1052693L;
  speclog[7] = 525315L;
  speclog[8] = 262400L;
  speclog[9] = 131136L;
  speclog[10] = 65552L;
  speclog[11] = 32772L;
  speclog[12] = 16385;
  for (k = 14; k <= 27; k++)
    speclog[k - 1] = twotothe[27 - k];
  speclog[27] = 1;   /*:131*/
  /*138:*/
  specatan[0] = 27855475L;
  specatan[1] = 14718068L;
  specatan[2] = 7471121L;
  specatan[3] = 3750058L;
  specatan[4] = , println, printchar, print, slowprint, printnl1876857L;
  specatan[5] = 938658L;
  specatan[6] = 469357L;
  specatan[7] = 234682L;
  specatan[8] = 117342L;
  specatan[9] = 58671L;
  specatan[10] = 29335;
  specatan[11] = 14668;
  specatan[12] = 7334;
  specatan[13] = 3667;
  specatan[14] = 1833;
  specatan[15] = 917;
  specatan[16] = 458;
  specatan[17] = 229;
  specatan[18] = 115;
  specatan[19] = 57;
  specatan[20] = 29;
  specatan[21] = 14;
  specatan[22] = 7;
  specatan[23] = 4;
  specatan[24] = 2;
  specatan[25] = 1;   /*:138*/
  /*179:*/
  /*wasmemend:=-30000;waslomax:=-30000;washimin:=memmax;panicking:=false;*/
  /*:179*/
  /*191:*/
  for (k = 0; k <= 39; k++)
    internal[k] = 0;
  intptr = 40;   /*:191*/
  /*199:*/
  for (k = 48; k <= 57; k++)
    charclass[k] = 0;
  charclass[46] = 1;
  charclass[32] = 2;
  charclass[37] = 3;
  charclass[34] = 4;
  charclass[44] = 5;
  charclass[59] = 6;
  charclass[40] = 7;
  charclass[41] = 8;
  for (k = 65; k <= 90; k++)
    charclass[k] = 9;
  for (k = 97; k <= 122; k++)
    charclass[k] = 9;
  charclass[95] = 9;
  charclass[60] = 10;
  charclass[61] = 10;
  charclass[62] = 10;
  charclass[58] = 10;
  charclass[124] = 10;
  charclass[96] = 11;
  charclass[39] = 11;
  charclass[43] = 12;
  charclass[45] = 12;
  charclass[47] = 13;
  charclass[42] = 13;
  charclass[92] = 13;
  charclass[33] = 14;
  charclass[63] = 14;
  charclass[35] = 15;
  charclass[38] = 15;
  charclass[64] = 15;
  charclass[36] = 15;
  charclass[94] = 16;
  charclass[126] = 16;
  charclass[91] = 17;
  charclass[93] = 18;
  charclass[123] = 19;
  charclass[125] = 19;
  for (k = 0; k <= 31; k++)
    charclass[k] = 20;
  charclass[127] = 20;
  charclass[9] = 2;
  charclass[12] = 2;   /*:199*/
  /*202:*/
  hash[0].UU.lh = 0;
  hash[0].rh = 0;
  eqtb[0].UU.lh = 41;
  eqtb[0].rh = -30000;
  for (k = 1; k <= 2240; k++) {   /*:202*/
    hash[k] = hash[0];
    eqtb[k] = eqtb[0];
  }
  /*231:*/
  bignodesize[0] = 12;
  bignodesize[1] = 4;
  /*:231*/
  /*251:*/
  saveptr = -30000;   /*:251*/
  /*396:*/
  octantdir[0] = 415;
  octantdir[4] = 416;
  octantdir[5] = 417;
  octantdir[1] = 418;
  octantdir[3] = 419;
  octantdir[7] = 420;
  octantdir[6] = 421;
  octantdir[2] = 422;   /*:396*/
  /*428:*/
  maxroundingptr = 0;   /*:428*/
  /*449:*/
  octantcode[0] = 1;
  octantcode[1] = 5;
  octantcode[2] = 6;
  octantcode[3] = 2;
  octantcode[4] = 4;
  octantcode[5] = 8;
  octantcode[6] = 7;
  octantcode[7] = 3;
  for (k = 1; k <= 8; k++)   /*:449*/
    octantnumber[octantcode[k - 1] - 1] = k;
  /*456:*/
  revturns = false;   /*:456*/
  /*462:*/
  xcorr[0] = 0;
  ycorr[0] = 0;
  xycorr[0] = 0;
  xcorr[4] = 0;
  ycorr[4] = 0;
  xycorr[4] = 1;
  xcorr[5] = -1;
  ycorr[5] = 1;
  xycorr[5] = 0;
  xcorr[1] = 1;
  ycorr[1] = 0;
  xycorr[1] = 1;
  xcorr[3] = 0;
  ycorr[3] = 1;
  xycorr[3] = 1;
  xcorr[7] = 0;
  ycorr[7] = 1;
  xycorr[7] = 0;
  xcorr[6] = 1;
  ycorr[6] = 0;
  xycorr[6] = 1;
  xcorr[2] = -1;
  ycorr[2] = 1;
  xycorr[2] = 0;
  for (k = 0; k <= 7; k++)   /*:462*/
    zcorr[k] = xycorr[k] - xcorr[k];
  /*570:*/
  screenstarted = false;
  screenOK = false;   /*:570*/
  /*573:*/
  for (k = 0; k <= 15; k++) {
    windowopen[k] = false;
    windowtime[k] = 0;
  }  /*:573*/
  /*593:*/
  fixneeded = false;
  watchcoefs = true;   /*:593*/
  /*739:*/
  condptr = -30000;
  iflimit = 0;
  curif = 0;
  ifline = 0;   /*:739*/
  /*753:*/
  loopptr = -30000;   /*:753*/
  /*776:*/
  memcpy(MFbasedefault, "plain.base", 10L);   /*:776*/
  /*797:*/
  curexp = 0;   /*:797*/
  /*822:*/
  varflag = 0;   /*:822*/
  /*1078:*/
  startsym = 0;   /*:1078*/
  /*1085:*/
  longhelpseen = false;
  /*:1085*/
  /*1097:*/
  for (k = 0; k <= 255; k++) {
    tfmwidth[k] = 0;
    tfmheight[k] = 0;
    tfmdepth[k] = 0;
    tfmitalcorr[k] = 0;
    charexists[k] = false;
    chartag[k] = 0;
    charremainder[k] = 0;
  }
  for (k = 0; k < headersize; k++)
    headerbyte[k] = -1;
  bc = 255;
  ec = 0;
  nl = 0;
  nk = 0;
  ne = 0;
  np = 0;   /*:1097*/
  /*1150:*/
  gfprevptr = 0;
  totalchars = 0;   /*:1150*/
  /*1153:*/
  halfbuf = gfbufsize / 2;
  gflimit = gfbufsize;
  gfptr = 0;
  gfoffset = 0;   /*:1153*/
  /*1184:*/
  baseident = 0;   /*:1184*/
  /*1215:*/
  editnamestart = 0;
}

<stdin>, line 797: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 798: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 804: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 809: Warning: Symbol 'WRITELN' is not defined [221]


/*:1215*/
/*57:*/

Static Void println()
{
  switch (selector) {

  case 3:
    writeln(stdout);
/* p2c: <stdin>, line 797: Warning: Symbol 'WRITELN' is not defined [221] */
    writeln(logfile);
/* p2c: <stdin>, line 798: Warning: Symbol 'WRITELN' is not defined [221] */
    termoffset = 0;
    fileoffset = 0;
    break;

  case 2:
    writeln(logfile);
/* p2c: <stdin>, line 804: Warning: Symbol 'WRITELN' is not defined [221] */
    fileoffset = 0;
    break;

  case 1:
    writeln(stdout);
/* p2c: <stdin>, line 809: Warning: Symbol 'WRITELN' is not defined [221] */
    termoffset = 0;
    break;

  case 0:
  case 4:
  case 5:
    /* blank case */
    break;
  }
}

<stdin>, line 835: Warning: Symbol 'ORD' is not defined [221]
<stdin>, line 839: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 840: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 844: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 848: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 854: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 861: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 870: Note: Using % for possibly-negative arguments [317]


/*:57*/
/*58:*/

Static Void printchar(s)
ASCIIcode s;
{
  long tmp;

  switch (selector) {

  case 3:
    /*----------------------------------*/
    if (xchr[s] == '[') {
      ascii_on = true;
      ascval = 0;
    } else if (xchr[s] == ']') {
      ascii_on = false;
      sendascii(ascval);
    } else if (ascii_on) {
      tmp = s - ord("0");
/* p2c: <stdin>, line 835: Warning: Symbol 'ORD' is not defined [221] */
      ascval = ascval * 10 + tmp;
    }
    /*-------------------------------------*/
    write(stdout, xchr[s]);
/* p2c: <stdin>, line 839: Warning: Symbol 'WRITE' is not defined [221] */
    write(logfile, xchr[s]);
/* p2c: <stdin>, line 840: Warning: Symbol 'WRITE' is not defined [221] */
    termoffset++;
    fileoffset++;
    if (termoffset == maxprintline) {
      writeln(stdout);
/* p2c: <stdin>, line 844: Warning: Symbol 'WRITELN' is not defined [221] */
      termoffset = 0;
    }
    if (fileoffset == maxprintline) {
      writeln(logfile);
/* p2c: <stdin>, line 848: Warning: Symbol 'WRITELN' is not defined [221] */
      fileoffset = 0;
    }
    break;

  case 2:
    write(logfile, xchr[s]);
/* p2c: <stdin>, line 854: Warning: Symbol 'WRITE' is not defined [221] */
    fileoffset++;
    if (fileoffset == maxprintline)
      println();
    break;

  case 1:
    write(stdout, xchr[s]);
/* p2c: <stdin>, line 861: Warning: Symbol 'WRITE' is not defined [221] */
    termoffset++;
    if (termoffset == maxprintline)
      println();
    break;

  case 0:
    /* blank case */
    break;

  case 4:
    if (tally < trickcount) {
      trickbuf[tally % errorline] = s;
/* p2c: <stdin>, line 870:
 * Note: Using % for possibly-negative arguments [317] */
    }
    break;

  case 5:
    if (poolptr < poolsize) {
      strpool[poolptr] = s;
      poolptr++;
    }
    break;
  }
  tally++;
}


/*:58*/
/*59:*/

Static Void print(s)
long s;
{
  poolpointer j;

  if ((unsigned long)s >= strptr)
    s = 131;
  j = strstart[s];
  while (j < strstart[s + 1]) {
    printchar(strpool[j]);
    j++;
  }
}  /*:59*/


/*60:*/

Static Void slowprint(s)
long s;
{
  poolpointer j;

  if ((unsigned long)s >= strptr)
    s = 131;
  j = strstart[s];
  while (j < strstart[s + 1]) {
    print((long)strpool[j]);
    j++;
  }
}  /*:60*/

<stdin>, line 912: Warning: Symbol 'ODD' is not defined [221]


/*62:*/

Static Void printnl(s)
strnumber s;
{
  if (((termoffset > 0) & odd(selector)) || fileoffset > 0 && selector >= 2) {
/* p2c: <stdin>, line 912: Warning: Symbol 'ODD' is not defined [221] */
    println();
  }
, printthedigs, printint, printscaled, printtwo, printtype, begindiagnostic, enddiagnostic, printdiagnostic,
printfilename, flushstring, jumpout, error  print((long)s);
}


/*:62*/
/*63:*/

Static Void printthedigs(k)
eightbits k;
{
  while (k > 0) {
    k--;
    printchar(dig[k] + 48);
  }
}

<stdin>, line 938: Note: Using % for possibly-negative arguments [317]
<stdin>, line 949: Note: Using % for possibly-negative arguments [317]


/*:63*/
/*64:*/

Static Void printint(n)
long n;
{
  char k;
  long m;

  k = 0;
  if (n < 0) {
    printchar(45);
    if (n > -100000000L)
      n = -n;
    else {
      m = -n - 1;
      n = m / 10;
      m = m % 10 + 1;
/* p2c: <stdin>, line 938:
 * Note: Using % for possibly-negative arguments [317] */
      k = 1;
      if (m < 10)
	dig[0] = m;
      else {
	dig[0] = 0;
	n++;
      }
    }
  }
  do {
    dig[k] = n % 10;
/* p2c: <stdin>, line 949:
 * Note: Using % for possibly-negative arguments [317] */
    n /= 10;
    k++;
  } while (n != 0);
  printthedigs(k);
}

<stdin>, line 965: Note: Using % for possibly-negative arguments [317]
<stdin>, line 973: Note: Using % for possibly-negative arguments [317]


/*:64*/
/*103:*/

Static Void printscaled(s)
long s;
{
  scaled delta;

  if (s < 0) {
    printchar(45);
    s = -s;
  }
  printint(s / 65536L);
  s = s % 65536L * 10 + 5;
/* p2c: <stdin>, line 965:
 * Note: Using % for possibly-negative arguments [317] */
  if (s == 5)
    return;
  delta = 10;
  printchar(46);
  do {
    if (delta > 65536L)
      s += 32768L - delta / 2;
    printchar((int)(s / 65536L + 48));
    s = s % 65536L * 10;
/* p2c: <stdin>, line 973:
 * Note: Using % for possibly-negative arguments [317] */
    delta *= 10;
  } while (s > delta);
}


/*:103*/
/*104:*/

Static Void printtwo(x, y)
long x, y;
{
  printchar(40);
  printscaled(x);
  printchar(44);
  printscaled(y);
  printchar(41);
}


/*:104*/
/*187:*/

Static Void printtype(t)
smallnumber t;
{
  if ((unsigned)t >= 32 || ((1L << t) & 0xfffffeL) == 0) {
    print(217L);
    return;
  }
  switch (t) {

  case 1:
    print(194L);
    break;

  case 2:
    print(195L);
    break;

  case 3:
    print(196L);
    break;

  case 4:
    print(197L);
    break;

  case 5:
    print(198L);
    break;

  case 6:
    print(199L);
    break;

  case 7:
    print(200L);
    break;

  case 8:
    print(201L);
    break;

  case 9:
    print(202L);
    break;

  case 10:
    print(203L);
    break;

  case 11:
    print(204L);
    break;

  case 12:
    print(205L);
    break;

  case 13:
    print(206L);
    break;

  case 14:
    print(207L);
    break;

  case 16:
    print(208L);
    break;

  case 17:
    print(209L);
    break;

  case 18:
    print(210L);
    break;

  case 15:
    print(211L);
    break;

  case 19:
    print(212L);
    break;

  case 20:
    print(213L);
    break;

  case 21:
    print(214L);
    break;

  case 22:
    print(215L);
    break;

  case 23:
    print(216L);
    break;
  }
}


/*:187*/
/*195:*/

Static Void begindiagnostic()
{
  oldsetting = selector;
  if (internal[12] > 0 || selector != 3)
    return;
  selector--;
  if (history == 0)
    history = 1;
}  /* begindiagnostic */


Static Void enddiagnostic(blankline)
boolean blankline;
{
  printnl(155);
  if (blankline)
    println();
  selector = oldsetting;
}


/*:195*/
/*197:*/

Static Void printdiagnostic(s, t, nuline)
strnumber s, t;
boolean nuline;
{
  begindiagnostic();
  if (nuline)
    printnl(s);
  else
    print((long)s);
  print(320L);
  printint(line);
  print((long)t);
  printchar(58);
}


/*:197*/
/*773:*/

Static Void printfilename(n, a, e)
long n, a, e;
{
  print(a);
  print(n);
  print(e);
}


/*:773*/
/*73:*/

Static Void normalizeselector PV();

Static Void getnext PV();

Static Void terminput PV();

Static Void showcontext PV();

Static Void beginfilereading PV();

Static Void openlogfile PV();

Static Void closefilesandtermina PV();

Static Void clearforerrorprompt PV();


/*procedure debughelp;forward;*/
/*43:*/

Static Void flushstring(s)
strnumber s;
{
  if (s < strptr - 1)
    strref[s] = 0;
  else {
    do {
      strptr--;
    } while (strref[strptr - 1] == 0);
  }
  poolptr = strstart[strptr];
}


Static jmp_buf _JL9998;


/*:43*/
/*:73*/
/*76:*/

Static Void jumpout()
{
  longjmp(_JL9998, 1);
}

<stdin>, line 1270: Warning: Symbol 'FLUSH' is not defined [221]


/*:76*/
/*77:*/

Static Void error()
{
  ASCIIcode c;
  long s1, s2, s3;
  poolpointer j;

  if (history < 2)
    history = 2;
  printchar(46);
  showcontext();
  if (interaction == 3) {   /*78:*/
    while (true) {   /*:78*/
_L22:
      clearforerrorprompt();
      print(135L);
      terminput();
      if (last == first)
	goto _L10;
      c = buffer[first];
      if (c >= 97)   /*79:*/
	c -= 32;
      if (c == 88 || c == 83 || c == 82 || c == 81 || c == 73 || c == 72 ||
	  c == 69 || c == 57 || c == 56 || c == 55 || c == 54 || c == 53 ||
	  c == 52 || c == 51 || c == 50 || c == 49 || c == 48)
      {   /*80:*/
	switch (c) {

	case 48:
	case 49:
	case 50:
	case 51:
	case 52:
	case 53:
	case 54:
	case 55:
	case 56:
	case 57:   /*68:begin debughelp;goto 22;end;*/
	  if (deletionsallowed)   /*:83*/
	  {  /*83:*/
	    s1 = curcmd;
	    s2 = curmod;
	    s3 = cursym;
	    OKtointerrupt = false;
	    if (last > first + 1 && buffer[first + 1] >= 48 &&
		buffer[first + 1] <= 57)
	      c = c * 10 + buffer[first + 1] - 528;
	    else
	      c -= 48;
	    while (c > 0) {
	      getnext();
	      /*743:*/
	      if (curcmd == 39) {   /*:743*/
		if (strref[curmod] < 127) {
		  if (strref[curmod] > 1)
		    strref[curmod]--;
		  else
		    flushstring((int)curmod);
		}
	      }
	      c--;
	    }
	    curcmd = s1;
	    curmod = s2;
	    cursym = s3;
	    OKtointerrupt = true;
	    helpptr = 2;
	    helpline[1] = 148;
	    helpline[0] = 149;
	    showcontext();
	    goto _L22;
	  }
	  break;

	case 69:
	  if (fileptr > 0) {
	    editnamestart = strstart[inputstack[fileptr].namefield];
	    editnamelength = strstart[inputstack[fileptr].namefield + 1] -
			     strstart[inputstack[fileptr].namefield];
	    editline = line;
	    jumpout();
	  }
	  break;

	case 72:  /*84:*/
	  if (useerrhelp) {  /*85:*/
	    j = strstart[errhelp];
	    while (j < strstart[errhelp + 1]) {   /*:85*/
	      if (strpool[j] != 37)
		print((long)strpool[j]);
	      else if (j + 1 == strstart[errhelp + 1])
		println();
	      else if (strpool[j + 1] != 37)
		println();
	      else {
		j++;
		printchar(37);
	      }
	      j++;
	    }
	    useerrhelp = false;
	  } else {
	    if (helpptr == 0) {
	      helpptr = 2;
	      helpline[1] = 150;
	      helpline[0] = 151;
	    }
	    do {
	      helpptr--;
	      print((long)helpline[helpptr]);
	      println();
	    } while (helpptr != 0);
	  }
	  helpptr = 4;
	  helpline[3] = 152;
	  helpline[2] = 151;
	  helpline[1] = 153;
	  helpline[0] = 154;
	  goto _L22;
	  break;
	  /*:84*/

	case 73:  /*82:*/
	  beginfilereading();
	  if (last > first + 1) {
	    curinput.locfield = first + 1;
	    buffer[first] = 32;
	  } else {
	    print(147L);
	    terminput();
	    curinput.locfield = first;
	  }
	  first = last + 1;
	  curinput.limitfield = last;
	  goto _L10;
	  break;
	  /*:82*/

	case 81:
	case 82:
	case 83:  /*81:*/
	  errorcount = 0;
	  interaction = c - 81;
	  print(142L);
	  switch (c) {

	  case 81:
	    print(143L);
	    selector--;
	    break;

	  case 82:
	    print(144L);
	    break;

	  case 83:
	    print(145L);
	    break;
	  }
	  print(146L);
	  println();
	  flush(stdout);
/* p2c: <stdin>, line 1270: Warning: Symbol 'FLUSH' is not defined [221] */
	  goto _L10;
	  break;
	  /*:81*/

	case 88:
	  interaction = 2;
	  jumpout();
	  break;
	}
      }
      print(136L);
      printnl(137);
      printnl(138);
      if (fileptr > 0)
	print(139L);
      if (deletionsallowed)
	printnl(140);
      printnl(141);   /*:80*/
      /*:79*/
    }
  }
  errorcount++;
  if (errorcount == 100) {
    printnl(134);
    history = 3;
    jumpout();
  }  /*86:*/
  if (interaction > 0)
    selector--;
  if (useerrhelp) {
    printnl(155);   /*85:*/
    j = strstart[errhelp];
    while (j < strstart[errhelp + 1]) {
      if (strpool[j] != 37)
	print((long)strpool[j]);
      else if (j + 1 == strstart[errhelp + 1])
	println();
      else if (strpool[j + 1] != 37)
	println();
      else {
	j++;
	printchar(37);
      }
 , fatalerror, overflow, confusion, aopenin, aopenout, wopenin, wopenout, aclose, wclose, inputln, initterminal, makestring, streqbuf, strvsstr, printdd     j++;
    }  /*:85*/
  } else {
    while (helpptr > 0) {
      helpptr--;
      printnl(helpline[helpptr]);
    }
  }
  println();
  if (interaction > 0)   /*:86*/
    selector++;
  println();
_L10: ;

}  /*:77*/


/*88:*/

Static Void fatalerror(s)
strnumber s;
{
  normalizeselector();
  printnl(133);
  print(156L);
  helpptr = 1;
  helpline[0] = s;
  if (interaction == 3)
    interaction = 2;
  error();
  /*if interaction>0 then debughelp;*/
  history = 3;
  jumpout();
}


/*:88*/
/*89:*/

Static Void overflow(s, n)
strnumber s;
long n;
{
  normalizeselector();
  printnl(133);
  print(157L);
  print((long)s);
  printchar(61);
  printint(n);
  printchar(93);
  helpptr = 2;
  helpline[1] = 158;
  helpline[0] = 159;
  if (interaction == 3)
    interaction = 2;
  error();
  /*if interaction>0 then debughelp;*/
  history = 3;
  jumpout();
}


/*:89*/
/*90:*/

Void confusion(s)
strnumber s;
{
  normalizeselector();
  if (history < 2) {
    printnl(133);
    print(160L);
    print((long)s);
    printchar(41);
    helpptr = 1;
    helpline[0] = 161;
  } else {
    printnl(133);
    print(162L);
    helpptr = 2;
    helpline[1] = 163;
    helpline[0] = 164;
  }
  if (interaction == 3)
    interaction = 2;
  error();
  /*if interaction>0 then debughelp;*/
  history = 3;
  jumpout();
}

<stdin>, line 1428: Warning: Symbol 'RESET' is not defined [221]


/*:90*/
/*:4*/


/*26:*/

Static boolean aopenin(f, pathspecifier)
FILE **f;
long pathspecifier;
{
  boolean ok;

  if (testaccess(nameoffile, realnameoffile, 4L, pathspecifier)) {
    reset(*f, realnameoffile);
/* p2c: <stdin>, line 1428: Warning: Symbol 'RESET' is not defined [221] */
    ok = true;
  } else
    ok = false;
  return ok;
}  /* aopenin */

<stdin>, line 1440: Warning: Symbol 'REWRITE' is not defined [221]


Static boolean aopenout(f)
FILE **f;
{
  boolean ok;

  if (testaccess(nameoffile, realnameoffile, 2L, 0L)) {
    rewrite(*f, realnameoffile);
/* p2c: <stdin>, line 1440:
 * Warning: Symbol 'REWRITE' is not defined [221] */
    ok = true;
  } else
    ok = false;
  return ok;
}  /* aopenout */

<stdin>, line 1452: Warning: Symbol 'RESET' is not defined [221]


Static boolean wopenin(f)
FILE **f;
{
  boolean ok;

  if (testaccess(nameoffile, realnameoffile, 4L, 7L)) {
    reset(*f, realnameoffile);
/* p2c: <stdin>, line 1452: Warning: Symbol 'RESET' is not defined [221] */
    ok = true;
  } else
    ok = false;
  return ok;
}  /* wopenin */

<stdin>, line 1464: Warning: Symbol 'REWRITE' is not defined [221]


Static boolean wopenout(f)
FILE **f;
{
  boolean ok;

  if (testaccess(nameoffile, realnameoffile, 2L, 0L)) {
    rewrite(*f, nameoffile);
/* p2c: <stdin>, line 1464:
 * Warning: Symbol 'REWRITE' is not defined [221] */
    ok = true;
  } else
    ok = false;
  return ok;
}


/*:26*/
/*27:*/

Static Void aclose(f)
FILE **f;
{
  closea(f);
}  /* aclose */


Static Void wclose(f)
FILE **f;
{
  closew(f);
}

<stdin>, line 1486: Warning: Symbol 'EOF' is not defined [221]
<stdin>, line 1487: Warning: Symbol 'EOLN' is not defined [221]
<stdin>, line 1488: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 1490: Warning: Symbol 'EOF' is not defined [221]
<stdin>, line 1494: Warning: Symbol 'EOLN' is not defined [221]
<stdin>, line 1500: Note: File parameter f can't access buffers (try StructFiles = 1) [318]
<stdin>, line 1501: Warning: Symbol 'GET' is not defined [221]


/*:27*/
/*30:*/

Static boolean inputln(f, bypasseoln)
FILE **f;
boolean bypasseoln;
{
  short lastnonblank;

  if (bypasseoln) {
    if (~eof(*f)) {
/* p2c: <stdin>, line 1486: Warning: Symbol 'EOF' is not defined [221] */
      if (eoln(*f)) {
/* p2c: <stdin>, line 1487: Warning: Symbol 'EOLN' is not defined [221] */
	get(*f);
/* p2c: <stdin>, line 1488: Warning: Symbol 'GET' is not defined [221] */
      }
    }
  }
  last = first;
  if (eof(*f)) {
/* p2c: <stdin>, line 1490: Warning: Symbol 'EOF' is not defined [221] */
    return false;
  } else {
    lastnonblank = first;
    while (~eoln(*f)) {
/* p2c: <stdin>, line 1494: Warning: Symbol 'EOLN' is not defined [221] */
      if (last >= maxbufstack) {
	maxbufstack = last + 1;
	if (maxbufstack == bufsize)
	  overflow(128, (long)bufsize);
      }
      buffer[last] = xord[P_peek(*f)];
/* p2c: <stdin>, line 1500: Note:
 * File parameter f can't access buffers (try StructFiles = 1) [318] */
      get(*f);
/* p2c: <stdin>, line 1501: Warning: Symbol 'GET' is not defined [221] */
      last++;
      if (buffer[last - 1] != 32)
	lastnonblank = last;
    }
    last = lastnonblank;
    return true;
  }
}

<stdin>, line 1518: Warning: Symbol 'ARGC' is not defined [221]
<stdin>, line 1520: Warning: Symbol 'ARGC' is not defined [221]
<stdin>, line 1521: Warning: Symbol 'ARGV' is not defined [221]
<stdin>, line 1543: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 1544: Warning: Symbol 'FLUSH' is not defined [221]
<stdin>, line 1545: Note: Taking address of stdin; consider setting VarFiles = 0 [144]
<stdin>, line 1546: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 1547: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 1559: Warning: Symbol 'WRITELN' is not defined [221]


/*:30*/
/*36:*/

Static boolean initterminal()
{
  boolean Result;
  long i, j, k;
  Char arg[100];
  FILE *TEMP;

  if (argc > 1) {
/* p2c: <stdin>, line 1518: Warning: Symbol 'ARGC' is not defined [221] */
    last = first;
    for (i = 1; i < argc; i++) {
/* p2c: <stdin>, line 1520: Warning: Symbol 'ARGC' is not defined [221] */
      argv(i, arg);
/* p2c: <stdin>, line 1521: Warning: Symbol 'ARGV' is not defined [221] */
      j = 1;
      k = 100;
      while (k > 1 && arg[k - 1] == ' ')
	k--;
      while (j <= k) {
	buffer[last] = xord[arg[j - 1]];
	j++;
	last++;
      }
      if (k > 1) {
	buffer[last] = xord[' '];
	last++;
      }
    }
    if (last > first) {
      curinput.locfield = first;
      Result = true;
      goto _L10;
    }
  }
  while (true) {
    write(stdout, "**");
/* p2c: <stdin>, line 1543: Warning: Symbol 'WRITE' is not defined [221] */
    flush(stdout);
    TEMP = stdin;
/* p2c: <stdin>, line 1544: Warning: Symbol 'FLUSH' is not defined [221] */
    if (!inputln(&TEMP, true)) {
/* p2c: <stdin>, line 1545:
 * Note: Taking address of stdin; consider setting VarFiles = 0 [144] */
      writeln(stdout);
/* p2c: <stdin>, line 1546:
 * Warning: Symbol 'WRITELN' is not defined [221] */
      writeln(stdout, "! End of file on the terminal... why?");
/* p2c: <stdin>, line 1547:
 * Warning: Symbol 'WRITELN' is not defined [221] */
      Result = false;
      goto _L10;
    }
    curinput.locfield = first;
    while (curinput.locfield < last && buffer[curinput.locfield] == 32)
      curinput.locfield++;
    if (curinput.locfield < last) {
      Result = true;
      goto _L10;
    }
    writeln(stdout, "Please type the name of your input file.");
/* p2c: <stdin>, line 1559:
 * Warning: Symbol 'WRITELN' is not defined [221] */
  }
_L10:

  return Result;
}  /* initterminal */


/*:36*/
/*44:*/

Static strnumber makestring()
{
  if (strptr == maxstrptr) {
    if (strptr == maxstrings)
      overflow(130, (long)(maxstrings - initstrptr));
    maxstrptr++;
  }
  strref[strptr] = 1;
  strptr++;
  strstart[strptr] = poolptr;
  return (strptr - 1);
}  /* makestring */


/*:44*/
/*45:*/

Static boolean streqbuf(s, k)
strnumber s;
long k;
{
  poolpointer j;
  boolean result;

  j = strstart[s];
  while (j < strstart[s + 1]) {
    if (strpool[j] != buffer[k]) {
      result = false;
      goto _L45;
    }
    j++;
    k++;
  }
  result = true;
_L45:
  return result;
}


/*:45*/
/*46:*/

Static long strvsstr(s, t)
strnumber s, t;
{
  long Result;
  poolpointer j, k;
  long ls, lt, l;

  ls = strstart[s + 1] - strstart[s];
  lt = strstart[t + 1] - strstart[t];
  if (ls <= lt)
    l = ls;
  else
    l = lt;
  j = strstart[s];
  k = strstart[t];
  while (l > 0) {
    if (strpool[j] != strpool[k]) {
      Result = strpool[j] - strpool[k];
      goto _L10;
    }
    j++;
    k++;
    l--;
  }
  Result = ls - lt;
_L10:

  return Result;
}

<stdin>, line 1672: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 1674: Note: Using % for possibly-negati, terminput, normalizeselector, pauseforinstructions, missingerr, cleararith, slowadd,
rounddecimals, takescaled, makescaled, velocity, abvscdve arguments [317]


/*:46*/
/*47:*/
/*function getstringsstarted:boolean;label 30,10;
var k,l:0..127;m,n:char;g:strnumber;a:integer;c:boolean;
begin poolptr:=0;strptr:=0;maxpoolptr:=0;maxstrptr:=0;strstart[0]:=0;
[48:]for k:=0 to 127 do begin if([49:](k<32)or(k>126)[:49])then begin
begin strpool[poolptr]:=94;poolptr:=poolptr+1;end;
begin strpool[poolptr]:=94;poolptr:=poolptr+1;end;
if k<64 then begin strpool[poolptr]:=k+64;poolptr:=poolptr+1;
end else begin strpool[poolptr]:=k-64;poolptr:=poolptr+1;end;
end else begin strpool[poolptr]:=k;poolptr:=poolptr+1;end;g:=makestring;
strref[g]:=127;end[:48];[51:]nameoffile:=poolname;
if aopenin(poolfile,8)then begin c:=false;
repeat[52:]begin if eof(poolfile)then begin;
writeln(output,'! mf.pool has no check sum.');aclose(poolfile);
getstringsstarted:=false;goto 10;end;read(poolfile,m,n);
if m='*'then[53:]begin a:=0;k:=1;
while true do begin if(xord[n]<48)or(xord[n]>57)then begin;
writeln(output,'! mf.pool check sum doesn''t have nine digits.');
aclose(poolfile);getstringsstarted:=false;goto 10;end;
a:=10*a+xord[n]-48;if k=9 then goto 30;k:=k+1;read(poolfile,n);end;
30:if a<>503742536 then begin;
writeln(output,'! mf.pool doesn''t match; tangle me again.');
aclose(poolfile);getstringsstarted:=false;goto 10;end;c:=true;
end[:53]else begin if(xord[m]<48)or(xord[m]>57)or(xord[n]<48)or(xord[n]>
57)then begin;
writeln(output,'! mf.pool line doesn''t begin with two digits.');
aclose(poolfile);getstringsstarted:=false;goto 10;end;
l:=xord[m]*10+xord[n]-48*11;
if poolptr+l+stringvacancies>poolsize then begin;
writeln(output,'! You have to increase POOLSIZE.');aclose(poolfile);
getstringsstarted:=false;goto 10;end;
for k:=1 to l do begin if eoln(poolfile)then m:=' 'else read(poolfile,m)
;begin strpool[poolptr]:=xord[m];poolptr:=poolptr+1;end;end;
readln(poolfile);g:=makestring;strref[g]:=127;end;end[:52];until c;
aclose(poolfile);getstringsstarted:=true;end else begin;
writeln(output,'! I can''t read mf.pool.');aclose(poolfile);
getstringsstarted:=false;goto 10;end[:51];10:end;*/
/*:47*/
/*65:*/

Static Void printdd(n)
long n;
{
  n = abs(n) % 100;
/* p2c: <stdin>, line 1672: Warning: Symbol 'ABS' is not defined [221] */
  printchar((int)(n / 10 + 48));
/* p2c: <stdin>, line 1674:
 * Note: Using % for possibly-negative arguments [317] */
  printchar((int)(n % 10 + 48));
}

<stdin>, line 1681: Warning: Symbol 'FLUSH' is not defined [221]
<stdin>, line 1682: Note: Taking address of stdin; consider setting VarFiles = 0 [144]


/*:65*/
/*66:*/

Static Void terminput()
{
  short k;
  FILE *TEMP;
  short FORLIM;

  flush(stdout);
  TEMP = stdin;
/* p2c: <stdin>, line 1681: Warning: Symbol 'FLUSH' is not defined [221] */
  if (!inputln(&TEMP, true)) {
/* p2c: <stdin>, line 1682:
 * Note: Taking address of stdin; consider setting VarFiles = 0 [144] */
    fatalerror(132);
  }
  termoffset = 0;
  selector--;
  if (last != first) {
    FORLIM = last;
    for (k = first; k < FORLIM; k++)
      print((long)buffer[k]);
  }
  println();
  buffer[last] = 37;
  selector++;
}


/*:66*/
/*87:*/

Static Void normalizeselector()
{
  if (jobname > 0)
    selector = 3;
  else
    selector = 1;
  if (jobname == 0)
    openlogfile();
  if (interaction == 0)
    selector--;
}


/*:87*/
/*93:*/

Static Void pauseforinstructions()
{
  if (!OKtointerrupt)
    return;
  interaction = 3;
  if (selector == 2 || selector == 0)
    selector++;
  printnl(133);
  print(165L);
  helpptr = 3;
  helpline[2] = 166;
  helpline[1] = 167;
  helpline[0] = 168;
  deletionsallowed = false;
  error();
  deletionsallowed = true;
  interrupt = 0;
}


/*:93*/
/*94:*/

Static Void missingerr(s)
strnumber s;
{
  printnl(133);
  print(169L);
  print((long)s);
  print(170L);
}


/*:94*/
/*99:*/

Static Void cleararith()
{
  printnl(133);
  print(171L);
  helpptr = 4;
  helpline[3] = 172;
  helpline[2] = 173;
  helpline[1] = 174;
  helpline[0] = 175;
  error();
  aritherror = false;
}


/*:99*/
/*100:*/

Static long slowadd(x, y)
long x, y;
{
  if (x >= 0) {
    if (y <= 2147483647L - x)
      return (x + y);
    else {
      aritherror = true;
      return 2147483647L;
    }
  } else if (-y <= x + 2147483647L)
    return (x + y);
  else {
    aritherror = true;
    return -2147483647L;
  }
}


/*:100*/
/*102:*/

Static long rounddecimals(k)
smallnumber k;
{
  long a;

  a = 0;
  while (k > 0) {
    k--;
    a = (a + dig[k] * 131072L) / 10;
  }
  return ((a + 1) / 2);
}

<stdin>, line 1812: Note: Using % for possibly-negative arguments [317]
<stdin>, line 1824: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 1832: Warning: Symbol 'ODD' is not defined [221]


/*:102*/
/*112:*/

Static long takescaled(q, f)
long q, f;
{
  long p;
  boolean negative;
  long n, becareful;   /*110:*/

  if (f >= 0)
    negative = false;
  else {
    f = -f;
    negative = true;
  }
  if (q < 0) {
    q = -q;
    negative = !negative;
  }  /*:110*/
  if (f < 65536L)
    n = 0;
  else {
    n = f / 65536L;
    f %= 65536L;
/* p2c: <stdin>, line 1812:
 * Note: Using % for possibly-negative arguments [317] */
    if (q <= 2147483647L / n)
      n *= q;
    else {
      aritherror = true;
      n = 2147483647L;
    }
  }
  f += 65536L;   /*113:*/
  p = 32768L;
  if (q < 1073741824L) {
    do {
      if (odd(f)) {
/* p2c: <stdin>, line 1824: Warning: Symbol 'ODD' is not defined [221] */
	p = (p + q) / 2;
      } else
	p /= 2;
      f /= 2;
    } while (f != 1);
  } else {
    do {
      if (odd(f)) {
/* p2c: <stdin>, line 1832: Warning: Symbol 'ODD' is not defined [221] */
	p += (q - p) / 2;
      } else
	p /= 2;
      f /= 2;   /*:113*/
    } while (f != 1);
  }
  becareful = n - 2147483647L;
  if (becareful + p > 0) {
    aritherror = true;
    n = 2147483647L - p;
  }
  if (negative)
    return (-(n + p));
  else
    return (n + p);
}

<stdin>, line 1867: Note: Using % for possibly-negative arguments [317]


/*:112*/
/*114:*/

Static long makescaled(p, q)
long p, q;
{
  long f, n;
  boolean negative;
  long becareful;

  if (p >= 0)
    negative = false;
  else {
    p = -p;
    negative = true;
  }
  if (q <= 0) {  /*if q=0 then confusion(47);*/
    q = -q;
    negative = !negative;
  }
  n = p / q;
  p %= q;
/* p2c: <stdin>, line 1867:
 * Note: Using % for possibly-negative arguments [317] */
  if (n >= 32768L) {
    aritherror = true;
    if (negative)
      return -2147483647L;
    else
      return 2147483647L;
  } else {
    n = (n - 1) * 65536L;   /*115:*/
    f = 1;
    do {
      becareful = p - q;
      p += becareful;
      if (p >= 0)
	f += f + 1;
      else {
	f += f;
	p += q;
      }
    } while (f < 65536L);
    becareful = p - q;
    if (becareful + p >= 0)
      f++;   /*:115*/
    if (negative)
      return (-(f + n));
    else
      return (f + n);
  }
}  /*:114*/


/*116:*/

Static long velocity(st, ct, sf, cf, t)
long st, ct, sf, cf, t;
{
  long acc, num, denom;

  acc = takefraction(st - sf / 16, sf - st / 16);
  acc = takefraction(acc, ct - cf);
  num = takefraction(acc, 379625062L) + 536870912L;
  denom = takefraction(ct, 497706707L) + takefraction(cf, 307599661L) + 805306368L;
  if (t != 65536L)
    num = makescaled(num, t);
  if (num / 4 >= denom)
    return 1073741824L;
  else
    return (makefraction(num, denom));
}

<stdin>, line 1976: Note: Using % for possibly-negative arguments [317]
<stdin>, line 1977: Note: Using % for possibly-negative arguments [317]


/*:116*/
/*117:*/

long abvscd(a, b, c, d)
long a, b, c, d;
{
  long Result, q, r;   /*118:*/

  if (a < 0) {
    a = -a;
    b = -b;
  }
  if (c < 0) {
    c = -c;
    d = -d;
  }
  if (d <= 0) {
    if (b >= 0) {
      if ((a == 0 || b == 0) && (c == 0 || d == 0)) {
	Result = 0;
	goto _L10;
      } else {
	Result = 1;
	goto _L10;
      }
    }
    if (d == 0) {
      if (a == 0) {
	Result = 0;
	goto _L10;
      } else {
	Result = -1;
	goto _L10;
      }
    }
    q = a;
    a = c;
    c = q;
    q = -b;
    b = -d;
    d = q;
  } else if (b <= 0) {
    if (b < 0) {
      if (a > 0) {
	Result = -1;
	goto _L10;
      }
    }
    if (c == 0) {
      Result = 0;
      goto _L10;
    } else {
      Result = -1;
      goto _L10;
    }
  }
  while (true) {
    q = a / d;
    r = c / b;
    if , floorscaled, floorunscaled, roundunscaled, roundfraction, squarert, pythadd, pythsub, mlog, mexp, narg, nsincos(q != r) {
      if (q > r) {
	Result = 1;
	goto _L10;
      } else {
	Result = -1;
	goto _L10;
      }
    }
    q = a % d;
/* p2c: <stdin>, line 1976:
 * Note: Using % for possibly-negative arguments [317] */
    r = c % b;
/* p2c: <stdin>, line 1977:
 * Note: Using % for possibly-negative arguments [317] */
    if (r == 0) {
      if (q == 0) {
	Result = 0;
	goto _L10;
      } else {
	Result = 1;
	goto _L10;
      }
    }
    if (q == 0) {
      Result = -1;
      goto _L10;
    }
    a = b;
    b = q;
    c = d;
    d = r;
  }
_L10:

  return Result;

  /*:118*/
}

<stdin>, line 2004: Note: Using % for possibly-negative arguments [317]
<stdin>, line 2007: Note: Using % for possibly-negative arguments [317]


/*:117*/
/*119:*/

Static long floorscaled(x)
long x;
{
  long becareful;

  if (x >= 0) {
    return (x - x % 65536L);
/* p2c: <stdin>, line 2004:
 * Note: Using % for possibly-negative arguments [317] */
  } else {
    becareful = x + 1;
    return (x + -becareful % 65536L - 65535L);
/* p2c: <stdin>, line 2007:
 * Note: Using % for possibly-negative arguments [317] */
  }
}  /* floorscaled */


Static long floorunscaled(x)
long x;
{
  long becareful;

  if (x >= 0)
    return (x / 65536L);
  else {
    becareful = x + 1;
    return (-(-becareful / 65536L + 1));
  }
}  /* floorunscaled */


Static long roundunscaled(x)
long x;
{
  long becareful;

  if (x >= 32768L)
    return ((x - 32768L) / 65536L + 1);
  else if (x >= -32768L)
    return 0;
  else {
    becareful = x + 1;
    return (-((-becareful - 32768L) / 65536L + 1));
  }
}  /* roundunscaled */


Static long roundfraction(x)
long x;
{
  long becareful;

  if (x >= 2048)
    return ((x - 2048) / 4096 + 1);
  else if (x >= -2048)
    return 0;
  else {
    becareful = x + 1;
    return (-((-becareful - 2048) / 4096 + 1));
  }
}


/*:119*/
/*121:*/

Static long squarert(x)
long x;
{
  smallnumber k;
  long y, q;

  if (x <= 0) {  /*122:*/
    if (x >= 0)
      return 0;
    printnl(133);
    print(176L);
    printscaled(x);
    print(177L);
    helpptr = 2;
    helpline[1] = 178;
    helpline[0] = 179;
    error();
    return 0;
  } else {  /*:122*/
    k = 23;
    q = 2;
    while (x < 536870912L) {
      k--;
      x += x + x + x;
    }
    if (x < 1073741824L)
      y = 0;
    else {
      x -= 1073741824L;
      y = 1;
    }  /*123:*/
    do {
      x += x;
      y += y;
      if (x >= 1073741824L) {
	x -= 1073741824L;
	y++;
      }
      x += x;
      y += y - q;
      q += q;
      if (x >= 1073741824L) {
	x -= 1073741824L;
	y++;
      }
      if (y > q) {
	y -= q;
	q += 2;
      } else if (y <= 0) {
	q -= 2;
	y += q;
      }
      k--;   /*:123*/
    } while (k != 0);
    return (q / 2);
  }
}  /*:121*/

<stdin>, line 2122: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 2123: Warning: Symbol 'ABS' is not defined [221]


/*124:*/

Static long pythadd(a, b)
long a, b;
{
  fraction r;
  boolean big;

  a = abs(a);
/* p2c: <stdin>, line 2122: Warning: Symbol 'ABS' is not defined [221] */
  b = abs(b);
/* p2c: <stdin>, line 2123: Warning: Symbol 'ABS' is not defined [221] */
  if (a < b) {
    r = b;
    b = a;
    a = r;
  }
  if (a <= 0)
    return a;
  if (a < 536870912L)
    big = false;
  else {
    a /= 4;
    b /= 4;
    big = true;
  }  /*125:*/
  while (true) {
    r = makefraction(b, a);
    r = takefraction(r, r);
    if (r == 0)
      goto _L30;
    r = makefraction(r, r + 1073741824L);
    a += takefraction(a + a, r);
    b = takefraction(b, r);
  }
_L30:   /*:125*/
  if (!big)
    return a;
  if (a < 536870912L)
    a += a + a + a;
  else {
    aritherror = true;
    a = 2147483647L;
  }
  return a;
}

<stdin>, line 2166: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 2167: Warning: Symbol 'ABS' is not defined [221]


/*:124*/
/*126:*/

Static long pythsub(a, b)
long a, b;
{
  fraction r;
  boolean big;

  a = abs(a);
/* p2c: <stdin>, line 2166: Warning: Symbol 'ABS' is not defined [221] */
  b = abs(b);
/* p2c: <stdin>, line 2167: Warning: Symbol 'ABS' is not defined [221] */
  if (a <= b) {  /*128:*/
    if (a < b) {
      printnl(133);
      print(180L);
      printscaled(a);
      print(181L);
      printscaled(b);
      print(177L);
      helpptr = 2;
      helpline[1] = 178;
      helpline[0] = 179;
      error();
    }
    a = 0;
    return a;
  }
  if (a < 1073741824L)
    big = false;
  else {
    a /= 2;
    b /= 2;
    big = true;
  }  /*127:*/
  while (true) {
    r = makefraction(b, a);
    r = takefraction(r, r);
    if (r == 0)
      goto _L30;
    r = makefraction(r, 1073741824L - r);
    a -= takefraction(a + a, r);
    b = takefraction(b, r);
  }
_L30:   /*:127*/
  if (big)
    a += a;
  return a;

  /*:128*/
}


/*:126*/
/*132:*/

Static long mlog(x)
long x;
{
  long y, z, k;

  if (x <= 0) {  /*134:*/
    printnl(133);
    print(182L);
    printscaled(x);
    print(177L);
    helpptr = 2;
    helpline[1] = 183;
    helpline[0] = 179;
    error();
    return 0;
  } else {  /*:134*/
    y = 1302456860L;
    z = 6581195L;
    while (x < 1073741824L) {
      x += x;
      y -= 93032639L;
      z -= 48782L;
    }
    y += z / 65536L;
    k = 2;
    while (x > 1073741828L)   /*:133*/
    {  /*133:*/
      z = (x - 1) / twotothe[k] + 1;
      while (x < z + 1073741824L) {
	z = (z + 1) / 2;
	k++;
      }
      y += speclog[k - 1];
      x -= z;
    }
    return (y / 8);
  }
}


/*:132*/
/*135:*/

Static long mexp(x)
long x;
{
  smallnumber k;
  long y, z;

  if (x > 174436200L) {
    aritherror = true;
    return 2147483647L;
  } else if (x < -197694359L)
    return 0;
  else {
    if (x <= 0) {
      z = -x * 8;
      y = 1048576L;
    } else {
      if (x <= 127919879L)
	z = 1023359037L - x * 8;
      else
	z = (174436200L - x) * 8;
      y = 2147483647L;
    }  /*136:*/
    k = 1;
    while (z > 0) {   /*:136*/
      while (z >= speclog[k - 1]) {
	z -= speclog[k - 1];
	y += -((y - twotothe[k - 1]) / twotothe[k]) - 1;
      }
      k++;
    }
    if (x <= 127919879L)
      return ((y + 8) / 16);
    else
      return y;
  }
}


/*:135*/
/*139:*/

Static long narg(x, y)
long x, y;
{
  long Result, t;
  angle z;
  smallnumber k;
  char octant;

  if (x >= 0)
    octant = 1;
  else {
    x = -x;
    octant = 2;
  }
  if (y < 0) {
    y = -y;
    octant += 2;
  }
  if (x < y) {
    t = y;
    y = x;
    x = t;
    octant += 4;
  }
  if (x == 0) {  /*140:*/
    printnl(133);
    print(184L);
    helpptr = 2;
    helpline[1] = 185;
    helpline[0] = 179;
    error();
    return 0;
  }
  while (x >= 536870912L) {
    x /= 2;
    y /= 2;
  }
  z = 0;
  if (y > 0) {   /*:142*/
    while (x < 268435456L) {
      x += x;
      y += y;
    }  /*143:*/
    k = 0;
    do {
      y += y;
      k++;
      if (y > x) {
	z += specatan[k - 1];
	t = x;
	x += y / twotothe[k + k];
	y -= t;
      }
    } while (k != 15);
    do {
      y += y;
      k++;
      if (y > x) {   /*:143*/
	z += specatan[k - 1];
	y -= x;
      }
    } while (k != 26);
  }
  /*141:*/
  switch (octant) {

  case 1:
    Result = z;
    break;

  case 5:
    Result = 94371840L - z;
    break;

  case 6:
    Result = z + 94371840L;
    break;

  case 2:
    Result = 188743680L - z;
    break;

  case 4:
    Result = z - 188743680L;
    break;

  case 8:
    Result = -z - 94371840L;
    break;

  case 7:
    Result = z - 94371840L;
    break;

  case 3:
    Result = -z;
    break;
  }/*:141*/
  return Result;

  /*:140*/
  /*142:*/
}

<stdin>, line 2391: Note: Using % for possibly-negative arguments [317]
<stdin>, line 2393: Note: Using % for possibly-negative arguments [317]
<stdin>, line 2396: Warning: Symbol 'ODD' is not defined [221]


/*:139*/
/*145:*/

Static Void nsincos(z)
long z;
{
  smallnumber k;
  char q;
  fraction r;
  long x, y, t;

  while (z < 0)
    z += 377487360L;
  z %= 377487360L;
/* p2c: <stdin>, line 2391:
 * Note: Using % for possibly-negative arguments [317] */
  q = z / 47185920L;
  z %= 47185920L;
/* p2c: <stdin>, line 2393:
 * Note: Using % for possibly-negative arguments [317] */
  x = 268435456L;
  y = x;
  if (~odd(q)) {   /*147:*/
/* p2c: <stdin>, line 2396: Warning: Symbol 'ODD' is not defined [221] */
    z = 47185920L - z;
  }
  k = 1;
  w, newrandoms, initrandoms, unifrand, normrand, showtokenlist, runaway, getavail, getnode, freenodehile (z > 0) {
    if (z >= specatan[k - 1]) {
      z -= specatan[k - 1];
      t = x;
      x = t + y / twotothe[k];
      y -= t / twotothe[k];
    }
    k++;
  }
  if (y < 0)   /*146:*/
    y = 0;   /*:147*/
  switch (q) {   /*:146*/

  case 0:
    /* blank case */
    break;

  case 1:
    t = x;
    x = y;
    y = t;
    break;

  case 2:
    t = x;
    x = -y;
    y = t;
    break;

  case 3:
    x = -x;
    break;

  case 4:
    x = -x;
    y = -y;
    break;

  case 5:
    t = x;
    x = -y;
    y = -t;
    break;

  case 6:
    t = x;
    x = y;
    y = -t;
    break;

  case 7:
    y = -y;
    break;
  }
  r = pythadd(x, y);
  ncos = makefraction(x, r);
  nsin = makefraction(y, r);
}


/*:145*/
/*149:*/

Static Void newrandoms()
{
  char k;
  fraction x;

  for (k = 0; k <= 23; k++) {
    x = randoms[k] - randoms[k + 31];
    if (x < 0)
      x += 268435456L;
    randoms[k] = x;
  }
  for (k = 24; k <= 54; k++) {
    x = randoms[k] - randoms[k - 24];
    if (x < 0)
      x += 268435456L;
    randoms[k] = x;
  }
  jrandom = 54;
}  /*:149*/

<stdin>, line 2478: Warning: Symbol 'ABS' is not defined [221]


/*150:*/

Static Void initrandoms(seed)
long seed;
{
  fraction j, jj, k;
  char i;

  j = abs(seed);
/* p2c: <stdin>, line 2478: Warning: Symbol 'ABS' is not defined [221] */
  while (j >= 268435456L)
    j /= 2;
  k = 1;
  for (i = 0; i <= 54; i++) {
    jj = k;
    k = j - k;
    j = jj;
    if (k < 0)
      k += 268435456L;
    randoms[i * 21 % 55] = j;
  }
  newrandoms();
  newrandoms();
  newrandoms();
}  /*:150*/

<stdin>, line 2504: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 2505: Warning: Symbol 'ABS' is not defined [221]


/*151:*/

Static long unifrand(x)
long x;
{
  scaled y;

  if (jrandom == 0)
    newrandoms();
  else
    jrandom--;
  y = takefraction(abs(x), randoms[jrandom]);
/* p2c: <stdin>, line 2504: Warning: Symbol 'ABS' is not defined [221] */
  if (y == abs(x)) {
/* p2c: <stdin>, line 2505: Warning: Symbol 'ABS' is not defined [221] */
    return 0;
  } else if (x > 0)
    return y;
  else
    return (-y);
}

<stdin>, line 2529: Warning: Symbol 'ABS' is not defined [221]


/*:151*/
/*152:*/

Static long normrand()
{
  long x, u, l;

  do {
    do {
      if (jrandom == 0)
	newrandoms();
      else
	jrandom--;
      x = takefraction(112429L, randoms[jrandom] - 134217728L);
      if (jrandom == 0)
	newrandoms();
      else
	jrandom--;
      u = randoms[jrandom];
/* p2c: <stdin>, line 2529: Warning: Symbol 'ABS' is not defined [221] */
    } while (abs(x) >= u);
    x = makefraction(x, u);
    l = 139548960L - mlog(u);
  } while (abvscd(1024L, l, x, x) < 0);
  return x;
}  /*:152*/


/*157:*/
/*procedure printword(w:memoryword);begin printint(w.int);
printchar(32);printscaled(w.int);printchar(32);
printscaled(w.int div 4096);println;printint(w.hh.lh);printchar(61);
printint(w.hh.b0);printchar(58);printint(w.hh.b1);printchar(59);
printint(w.hh.rh);printchar(32);printint(w.qqqq.b0);printchar(58);
printint(w.qqqq.b1);printchar(58);printint(w.qqqq.b2);printchar(58);
printint(w.qqqq.b3);end;*/
/*:157*/
/*162:*/
/*217:*/

Static Void printcapsule PV();


Static Void showtokenlist(p, q, l, nulltally)
long p, q, l, nulltally;
{
  smallnumber class_, c;
  long r, v;

  class_ = 3;
  tally = nulltally;
  while (p != -30000 && tally < l) {
    if (p == q)   /*:646*/
    {  /*646:*/
      firstcount = tally;
      trickcount = tally + errorline - halferrorline + 1;
      if (trickcount < errorline)
	trickcount = errorline;
    }
    /*218:*/
    c = 9;
    if (p < -30000 || p > memend) {
      print(360L);
      goto _L10;
    }
    if (p < himemmin) {   /*219:*/
      if (mem[p + 30000].hh.UU.U2.b1 == 12) {
	if (mem[p + 30000].hh.UU.U2.b0 == 16) {  /*220:*/
	  if (class_ == 0)
	    printchar(32);
	  v = mem[p + 30001].int_;
	  if (v < 0) {
	    if (class_ == 17)
	      printchar(32);
	    printchar(91);
	    printscaled(v);
	    printchar(93);
	    c = 18;
	  } else {
	    printscaled(v);
	    c = 0;
	  }
	} else if (mem[p + 30000].hh.UU.U2.b0 != 4)
	  print(363L);
	else {
	  printchar(34);
	  slowprint(mem[p + 30001].int_);
	  printchar(34);
	  c = 4;
	}
      } else if (mem[p + 30000].hh.UU.U2.b1 != 11 ||
		 mem[p + 30000].hh.UU.U2.b0 < 1 ||
		 mem[p + 30000].hh.UU.U2.b0 > 19)
	print(363L);
      else {
	gpointer = p;
	printcapsule();
	c = 8;
      }
    } else {   /*:218*/
      r = mem[p + 30000].hh.UU.lh;
      if (r >= 2242) {  /*222:*/
	if (r < 2392) {
	  print(365L);
	  r -= 2242;
	} else if (r < 2542) {
	  print(366L);
	  r -= 2392;
	} else {
	  print(367L);
	  r -= 2542;
	}
	printint(r);
	printchar(41);
	c = 8;
      } else if (r < 1) {
	if (r == 0) {  /*221:*/
	  if (class_ == 17)
	    printchar(32);
	  print(364L);
	  c = 18;
	} else  /*:221*/
	  print(361L);
      } else {
	r = hash[r - 1].rh;
	if ((unsigned long)r >= strptr)   /*223:*/
	  print(362L);
	else {
	  c = charclass[strpool[strstart[r]]];
	  if (c == class_) {
	    if ((unsigned)c < 32 && ((1L << c) & 0x3e0) != 0) {
	      switch (c) {

	      case 9:
		printchar(46);
		break;

	      case 5:
	      case 6:
	      case 7:
	      case 8:
		/* blank case */
		break;
	      }
	    } else
	      printchar(32);
	  }
	  print(r);
	}  /*:223*/
      }
    }
    class_ = c;
    p = mem[p + 30000].hh.rh;
  }
  if (p != -30000)
    print(359L);
_L10: ;


  /*:220*/
  /*:219*/
  /*:222*/
}


/*:217*/
/*665:*/

Static Void runaway()
{
  if (scannerstatus <= 2)
    return;
  printnl(503);
  switch (scannerstatus) {

  case 3:
    print(504L);
    break;

  case 4:
  case 5:
    print(505L);
    break;

  case 6:
    print(506L);
    break;
  }
  println();
  showtokenlist((long)mem[59998].hh.rh, -30000L, errorline - 10L, 0L);
}  /* runaway */


/*:665*/
/*:162*/
/*163:*/

Static halfword getavail()
{
  halfword p;

  p = avail;
  if (p != -30000)
    avail = mem[avail + 30000].hh.rh;
  else if (memend < memmax) {
    memend++;
    p = memend;
  } else {
    himemmin--;
    p = himemmin;
    if (himemmin <= lomemmax) {
      runaway();
      overflow(186, memmax + 30001L);
    }
  }
  mem[p + 30000].hh.rh = -30000;
  /*dynused:=dynused+1;*/
  return p;
}


/*:163*/
/*167:*/

Static halfword getnode(s)
long s;
{
  halfword Result, p, q;
  long r, t, tt;

_L20:
  p = rover;   /*169:*/
  do {
    q = p + mem[p + 30000].hh.UU.lh;
    while (mem[q + 30000].hh.rh == 32767) {
      t = mem[q + 30001].hh.rh;
      tt = mem[q + 30001].hh.UU.lh;
      if (q == rover)
	rover = t;
      mem[t + 30001].hh.UU.lh = tt;
      mem[tt + 30001].hh.rh = t;
      q += mem[q + 30000].hh.UU.lh;
    }
    r = q - s;
    if (r > p + 1)   /*:170*/
    {  /*170:*/
      mem[p + 30000].hh.UU.lh = r - p;
      rover = p;
      goto _L40;
    }
    /*171
    :*/
    if (r == p) {
      if (mem[p + 30001].hh.rh != rover || mem[p + 30001].hh.UU.lh != rover)
      {   /*:171*/
	rover = mem[p + 30001].hh.rh;
	t = mem[p + 30001].hh.UU.lh;
	mem[rover + 30001].hh.UU.lh = t;
	mem[t + 30001].hh.rh = rover;
	goto _L40;
      }
    }
    mem[p + 30000].hh.UU.lh = q - p;   /*:169*/
    p = mem[p + 30001].hh.rh;
  } while (p != rover);
  if (s == 1073741824L) {
    Result = 32767;
    goto _L10;
  }
  if (lomemmax + 2 < himemmin) {
    if (lomemmax <= 2765)   /*:168*/
    {  /*168:*/
      if (lomemmax + 1000 < himemmin)
	t = lomemmax + 1000;
      else
	t = (lomemmax + himemmin + 2) / 2;
      if (t > 2767)
	t = 2767;
      p = mem[rover + 30001].hh.UU.lh;
      q = lomemmax;
      mem[p + 30001].hh.rh = q;
      mem[rover + 30001].hh.UU.lh = q;
      mem[q + 30001].hh.rh = rover;
      mem[q + 30001].hh.UU.lh = p;
      mem[q + 30000].hh.rh = 32767;
      mem[q + 30000].hh.UU.lh = t - lomemmax;
      lomemmax = t;
      mem[lomemmax + 30000].hh.rh = -30000;
      mem[lomemmax + 30000].hh.UU.lh = -30000;
      rover = q;
      goto _L20;
    }
  }
  overflow(186, memmax + 30001L);
_L40:
  mem[r + 30000].hh.rh = -30000;   /*varused:=varused+s;*/
  Result = r;
_L10:

  return Result;
}


/*:167*/
/*172:*/

Static Void freenode(p, s)
halfword p, s;
{
  halfword q;

  mem[p + 30000].hh.UU.lh = s;
  mem[p + 30000].hh.rh = 32767;
  q = mem[rover + 30001].hh.UU.lh;
  mem[p + 30001].hh.UU.lh =, flushlist,
flushnodelist, printop, fixdateandtime q;
  mem[p + 30001].hh.rh = rover;
  mem[rover + 30001].hh.UU.lh = p;
  mem[q + 30001].hh.rh = p;
}


/*varused:=varused-s;*/
/*:172*/
/*173:*/
/*procedure sortavail;var p,q,r:halfword;oldrover:halfword;
begin p:=getnode(1073741824);p:=mem[rover+1].hh.rh;
mem[rover+1].hh.rh:=32767;oldrover:=rover;
while p<>oldrover do[174:]if p<rover then begin q:=p;p:=mem[q+1].hh.rh;
mem[q+1].hh.rh:=rover;rover:=q;end else begin q:=rover;
while mem[q+1].hh.rh<p do q:=mem[q+1].hh.rh;r:=mem[p+1].hh.rh;
mem[p+1].hh.rh:=mem[q+1].hh.rh;mem[q+1].hh.rh:=p;p:=r;end[:174];
p:=rover;
while mem[p+1].hh.rh<>32767 do begin mem[mem[p+1].hh.rh+1].hh.lh:=p;
p:=mem[p+1].hh.rh;end;mem[p+1].hh.rh:=rover;mem[rover+1].hh.lh:=p;end;*/
/*:173*/
/*177:*/

Static Void flushlist(p)
halfword p;
{
  halfword q, r;

  if (p < himemmin)
    return;
  if (p == 30000)
    return;
  r = p;
  do {
    q = r;
    r = mem[r + 30000].hh.rh;   /*dynused:=dynused-1;*/
    if (r < himemmin)
      goto _L30;
  } while (r != 30000);
_L30:
  mem[q + 30000].hh.rh = avail;
  avail = p;
}  /* flushlist */


Static Void flushnodelist(p)
halfword p;
{
  halfword q;

  while (p != -30000) {
    q = p;
    p = mem[p + 30000].hh.rh;
    if (q < himemmin)
      freenode(q, 2);
    else {
      mem[q + 30000].hh.rh = avail;
      avail = q;
    }
  }

  /*dynused:=dynused-1;*/
}


/*:177*/
/*180:*/
/*procedure checkmem(printlocs:boolean);label 31,32;var p,q,r:halfword;
clobbered:boolean;begin for p:=-30000 to lomemmax do freearr[p]:=false;
for p:=himemmin to memend do freearr[p]:=false;[181:]p:=avail;q:=-30000;
clobbered:=false;
while p<>-30000 do begin if(p>memend)or(p<himemmin)then clobbered:=true
else if freearr[p]then clobbered:=true;
if clobbered then begin printnl(187);printint(q);goto 31;end;
freearr[p]:=true;q:=p;p:=mem[q].hh.rh;end;31:[:181];[182:]p:=rover;
q:=-30000;clobbered:=false;
repeat if(p>=lomemmax)or(p<-30000)then clobbered:=true else if(mem[p+1].
hh.rh>=lomemmax)or(mem[p+1].hh.rh<-30000)then clobbered:=true else if
not((mem[p].hh.rh=32767))or(mem[p].hh.lh<2)or(p+mem[p].hh.lh>lomemmax)or
(mem[mem[p+1].hh.rh+1].hh.lh<>p)then clobbered:=true;
if clobbered then begin printnl(188);printint(q);goto 32;end;
for q:=p to p+mem[p].hh.lh-1 do begin if freearr[q]then begin printnl(
189);printint(q);goto 32;end;freearr[q]:=true;end;q:=p;
p:=mem[p+1].hh.rh;until p=rover;32:[:182];[183:]p:=-30000;
while p<=lomemmax do begin if(mem[p].hh.rh=32767)then begin printnl(190)
;printint(p);end;while(p<=lomemmax)and not freearr[p]do p:=p+1;
while(p<=lomemmax)and freearr[p]do p:=p+1;end[:183];[617:]q:=-29987;
p:=mem[q].hh.rh;
while p<>-29987 do begin if mem[p+1].hh.lh<>q then begin printnl(463);
printint(p);end;p:=mem[p+1].hh.rh;r:=himemmin;
repeat if mem[p].hh.lh>=r then begin printnl(464);printint(p);end;
r:=mem[p].hh.lh;q:=p;p:=mem[q].hh.rh;until r=-30000;end[:617];
if printlocs then[184:]begin printnl(191);
for p:=-30000 to lomemmax do if not freearr[p]and((p>waslomax)or wasfree
[p])then begin printchar(32);printint(p);end;
for p:=himemmin to memend do if not freearr[p]and((p<washimin)or(p>
wasmemend)or wasfree[p])then begin printchar(32);printint(p);end;
end[:184];for p:=-30000 to lomemmax do wasfree[p]:=freearr[p];
for p:=himemmin to memend do wasfree[p]:=freearr[p];wasmemend:=memend;
waslomax:=lomemmax;washimin:=himemmin;end;*/
/*:180*/
/*185:*/
/*procedure searchmem(p:halfword);var q:integer;
begin for q:=-30000 to lomemmax do begin if mem[q].hh.rh=p then begin
printnl(192);printint(q);printchar(41);end;
if mem[q].hh.lh=p then begin printnl(193);printint(q);printchar(41);end;
end;
for q:=himemmin to memend do begin if mem[q].hh.rh=p then begin printnl(
192);printint(q);printchar(41);end;
if mem[q].hh.lh=p then begin printnl(193);printint(q);printchar(41);end;
end;
[209:]for q:=1 to 2241 do begin if eqtb[q].rh=p then begin printnl(328);
printint(q);printchar(41);end;end[:209];end;*/
/*:185*/
/*189:*/

Static Void printop(c)
quarterword c;
{
  if (c <= 15) {
    printtype(c);
    return;
  }
  if (c != 30 && c != 31 && c != 100 && c != 99 && c != 98 && c != 97 &&
      c != 96 && c != 95 && c != 94 && c != 92 && c != 91 && c != 90 &&
      c != 89 && c != 88 && c != 87 && c != 86 && c != 85 && c != 84 &&
      c != 83 && c != 82 && c != 81 && c != 80 && c != 79 && c != 78 &&
      c != 77 && c != 76 && c != 75 && c != 74 && c != 73 && c != 72 &&
      c != 71 && c != 70 && c != 69 && c != 68 && c != 67 && c != 66 &&
      c != 65 && c != 64 && c != 63 && c != 62 && c != 61 && c != 60 &&
      c != 59 && c != 58 && c != 57 && c != 56 && c != 55 && c != 54 &&
      c != 53 && c != 52 && c != 51 && c != 50 && c != 49 && c != 48 &&
      c != 47 && c != 46 && c != 45 && c != 44 && c != 43 && c != 42 &&
      c != 41 && c != 40 && c != 39 && c != 38 && c != 37 && c != 36 &&
      c != 35 && c != 34 && c != 33 && c != 32) {

/* p2c: <stdin>, line 3045: 
 * Note: Line breaker spent 0.0 seconds, 5000 tries on line 3496 [251] */
    print(279L);
    return;
  }
  switch (c) {

  case 30:
    print(218L);
    break;

  case 31:
    print(219L);
    break;

  case 32:
    print(220L);
    break;

  case 33:
    print(221L);
    break;

  case 34:
    print(222L);
    break;

  case 35:
    print(223L);
    break;

  case 36:
    print(224L);
    break;

  case 37:
    print(225L);
    break;

  case 38:
    print(226L);
    break;

  case 39:
    print(227L);
    break;

  case 40:
    print(228L);
    break;

  case 41:
    print(229L);
    break;

  case 42:
    print(230L);
    break;

  case 43:
    print(231L);
    break;

  case 44:
    print(232L);
    break;

  case 45:
    print(233L);
    break;

  case 46:
    print(234L);
    break;

  case 47:
    print(235L);
    break;

  case 48:
    print(236L);
    break;

  case 49:
    print(237L);
    break;

  case 50:
    print(238L);
    break;

  case 51:
    print(239L);
    break;

  case 52:
    print(240L);
    break;

  case 53:
    print(241L);
    break;

  case 54:
    print(242L);
    break;

  case 55:
    print(243L);
    break;

  case 56:
    print(244L);
    break;

  case 57:
    print(245L);
    break;

  case 58:
    print(246L);
    break;

  case 59:
    print(247L);
    break;

  case 60:
    print(248L);
    break;

  case 61:
    print(249L);
    break;

  case 62:
    print(250L);
    break;

  case 63:
    print(251L);
    break;

  case 64:
    print(252L);
    break;

  case 65:
    print(253L);
    break;

  case 66:
    print(254L);
    break;

  case 67:
    print(255L);
    break;

  case 68:
    print(256L);
    break;

  case 69:
    printchar(43);
    break;

  case 70:
    printchar(45);
    break;

  case 71:
    printchar(42);
    break;

  case 72:
    printchar(47);
    break;

  case 73:
    print(257L);
    break;

  case 74:
    print(181L);
    break;

  case 75:
    print(258L);
    break;

  case 76:
    print(259L);
    break;

  case 77:
    printchar(60);
    break;

  case 78:
    print(260L);
    break;

  case 79:
    printchar(62);
    break;

  case 80:
    print(261L);
    break;

  case 81:
    printchar(61);
    break;

  case 82:
    print(262L);
    break;

  case 83:
    print(38L);
    break;

  case 84:
    print(263L);
    break;

  case 85:
    print(264L);
    break;

  case 86:
    print(265L);
    break;

  case 87:
    print(266L);
    break;

  case 88:
    print(267L);
    break;

  case 89:
    print(268L);
    break;

  case 90:
    print(269L);
    break;

  case 91:
    print(270L);
    break;

  case 92:
    print(271L);
    break;

  case 94:
    print(272L);
    break;

  case 95:
    print(273L);
    break;

  case 96:
    print(274L);
    break;

  case 97:
    print(275L);
    break;

  case 98:
    print(276L);
    break;

  case 99:
    print(277L);
    break;

  case 100:
    print(278L);
    break;
  }
}  /* printop */


/*:189*/
/*194:*/

Static Void fixdateandtime()
{
  dateandtime(&internal[16], &internal[15], &internal[14], &internal[13]);
  internal[16] *= 65536L;
  internal[15] *= 65536L;
  internal[14] *= 65536L;
  internal[13] *= 65536L;
  /*----------------------------------*/
  lastyearval = internal[13];
  lastmonthval = internal[14];
  /*--------------------------, idlookup, newnumtok, flushtokenlist, deletemacref,
printcmdmod--------*/
}  /* fixdateandtime */


/*:194*/
/*205:*/

Static halfword idlookup(j, l)
long j, l;
{
  long h;
  halfword p, k;

  if (l == 1)   /*:206*/
  {  /*206:*/
    p = buffer[j] + 1;
    hash[p - 1].rh = p - 1;
    goto _L40;
  }
  /*208:*/
  h = buffer[j];
  for (k = j + 1; k < j + l; k++) {   /*:208*/
    h += h + buffer[k];
    while (h >= 1777)
      h -= 1777;
  }
  p = h + 129;
  while (true) {
    if (hash[p - 1].rh > 0) {
      if (strstart[hash[p - 1].rh + 1] - strstart[hash[p - 1].rh] == l) {
	if (streqbuf(hash[p - 1].rh, j))
	  goto _L40;
      }
    }
    if (hash[p - 1].UU.lh == 0)   /*:207*/
    {  /*207:*/
      if (hash[p - 1].rh > 0) {
	do {
	  if (hashused == 1)
	    overflow(327, 2100L);
	  hashused--;
	} while (hash[hashused - 1].rh != 0);
	hash[p - 1].UU.lh = hashused;
	p = hashused;
      }
      if (poolptr + l > maxpoolptr) {
	if (poolptr + l > poolsize)
	  overflow(129, (long)(poolsize - initpoolptr));
	maxpoolptr = poolptr + l;
      }
      for (k = j; k < j + l; k++) {
	strpool[poolptr] = buffer[k];
	poolptr++;
      }
      hash[p - 1].rh = makestring();
      strref[hash[p - 1].rh] = 127;
      /*stcount:=stcount+1;*/
      goto _L40;
    }
    p = hash[p - 1].UU.lh;
  }
_L40:
  return p;
}


/*:205*/
/*210:*/
/*procedure primitive(s:strnumber;c:halfword;o:halfword);
var k:poolpointer;j:smallnumber;l:smallnumber;begin k:=strstart[s];
l:=strstart[s+1]-k;for j:=0 to l-1 do buffer[j]:=strpool[k+j];
cursym:=idlookup(0,l);if s>=128 then begin flushstring(strptr-1);
hash[cursym].rh:=s;end;eqtb[cursym].lh:=c;eqtb[cursym].rh:=o;end;*/
/*:210*/
/*215:*/

Static halfword newnumtok(v)
long v;
{
  halfword p;

  p = getnode(2L);
  mem[p + 30001].int_ = v;
  mem[p + 30000].hh.UU.U2.b0 = 16;
  mem[p + 30000].hh.UU.U2.b1 = 12;
  return p;
}


/*:215*/
/*216:*/

Static Void tokenrecycle PV();


Static Void flushtokenlist(p)
halfword p;
{
  halfword q;

  while (p != -30000) {
    q = p;
    p = mem[p + 30000].hh.rh;
    if (q >= himemmin) {
      mem[q + 30000].hh.rh = avail;
      avail = q;
      continue;
    }
    /*dynused:=dynused-1;*/
    if ((unsigned)mem[q + 30000].hh.UU.U2.b0 < 32 &&
	((1L << mem[q + 30000].hh.UU.U2.b0) & 0xf7ffeL) != 0) {
      switch (mem[q + 30000].hh.UU.U2.b0) {

      case 1:
      case 2:
      case 16:
	/* blank case */
	break;

      case 4:
	if (strref[mem[q + 30001].int_] < 127) {
	  if (strref[mem[q + 30001].int_] > 1)
	    strref[mem[q + 30001].int_]--;
	  else
	    flushstring((int)mem[q + 30001].int_);
	}
	break;

      case 3:
      case 5:
      case 7:
      case 12:
      case 10:
      case 6:
      case 9:
      case 8:
      case 11:
      case 14:
      case 13:
      case 17:
      case 18:
      case 19:
	gpointer = q;
	tokenrecycle();
	break;
      }
    } else
      confusion(358);
    freenode(q, 2);
  }
}  /* flushtokenlist */


/*:216*/
/*226:*/

Static Void deletemacref(p)
halfword p;
{
  if (mem[p + 30000].hh.UU.lh == -30000)
    flushtokenlist(p);
  else
    mem[p + 30000].hh.UU.lh--;
}


/*:226*/
/*227:*/
/*625:*/

Static Void printcmdmod(c, m)
long c, m;
{
  if ((c < 1 || c > 31) && c != 76 && c != 67 && c != 66 && c != 68 &&
      c != 40 && c != 49 && c != 44 && c != 53 && c != 41 && c != 62 &&
      c != 82 && c != 52 && c != 51 && c != 48 && c != 54 && c != 43 &&
      c != 36 && c != 50 && c != 45 && c != 55 && c != 37 && c != 34 &&
      c != 33 && c != 56 && c != 61 && c != 75 && c != 71 && c != 58 &&
      c != 35 && c != 74 && c != 80 && c != 64 && c != 65 && c != 47 &&
      c != 69 && c != 63 && c != 46 && c != 73 && c != 70 && c != 81 &&
      c != 60 && c != 57 && c != 79 && c != 78 && c != 32 && c != 72 &&
      c != 59 && c != 77) {

/* p2c: <stdin>, line 3482: 
 * Note: Line breaker spent 0.0 seconds, 5000 tries on line 3981 [251] */
    print(468L);
    return;
  }
  switch (c) {   /*212:*/

  case 18:
    print(330L);
    break;

  case 77:
    print(329L);
    break;

  case 59:
    print(332L);
    break;

  case 72:
    print(331L);
    break;

  case 32:
    print(333L);
    break;

  case 78:
    print(58L);
    break;

  case 79:
    print(44L);
    break;

  case 57:
    print(334L);
    break;

  case 19:
    print(335L);
    break;

  case 60:
    print(336L);
    break;

  case 27:
    print(337L);
    break;

  case 11:
    print(338L);
    break;

  case 81:
    print(323L);
    break;

  case 26:
    print(339L);
    break;

  case 6:
    print(340L);
    break;

  case 9:
    print(341L);
    break;

  case 70:
    print(342L);
    break;

  case 73:
    print(343L);
    break;

  case 13:
    print(344L);
    break;

  case 46:
    print(123L);
    break;

  case 63:
    print(91L);
    break;

  case 14:
    print(345L);
    break;

  case 15:
    print(346L);
    break;

  case 69:
    print(347L);
    break;

  case 28:
    print(348L);
    break;

  case 47:
    print(279L);
    break;

  case 24:
    print(349L);
    break;

  case 7:
    printchar(92);
    break;

  case 65:
    print(125L);
    break;

  case 64:
    print(93L);
    break;

  case 12:
    print(350L);
    break;

  case 8:
    print(351L);
    break;

  case 80:
    print(59L);
    break;

  case 17:
    print(352L);
    break;

  case 74:
    print(353L);
    break;

  case 35:
    print(354L);
    break;

  case 58:
    print(355L);
    break;

  case 71:
    print(356L);
    break;

  case 75:   /*:212*/
    print(357L);
    break;
    /*684:*/

  case 16:
    if (m <= 2) {
      if (m == 1)
	print(520L);
      else if (m < 1)
	print(324L);
      else
	print(521L);
    } else if (m == 53)
      print(522L);
    else if (m == 44)
      print(523L);
    else
      print(524L);
    break;

  case 4:   /*:684*/
    if (m <= 1) {
      if (m == 1)
	print(527L);
      else
	print(325L);
    } else if (m == 2242)
      print(525L);
    else
      print(526L);
    break;
    /*689:*/

  case 61:   /*:689*/
    if ((unsigned long)m < 32 && ((1L << m) & 0xe) != 0) {
      switch (m) {

      case 1:
	print(529L);
	break;

      case 2:
	printchar(64);
	break;

      case 3:
	print(530L);
	break;
      }
    } else
      print(528L);
    break;
    /*696:*/

  case 56:   /*:696*/
    if (m >= 2242) {
      if (m == 2242)
	print(541L);
      else if (m == 2392)
	print(542L);
      else
	print(543L);
    } else if (m < 2)
      print(544L);
    else if (m == 2)
      print(545L);
    else
      print(546L);
    break;
    /*710:*/

  case 3:
    if (m == 0)
      print(556L);
    else
      print(482L);
    break;

  /*:710*/
  /*741:*/
  case 1:
  case 2:   /*:741*/
    if ((unsigned long)m < 32 && ((1L << m) & 0xe) != 0) {
      switch (m) {

      case 1:
	print(583L);
	break;

      case 2:
	print(322L);
	break;

      case 3:
	print(584L);
	break;
      }
    } else
      print(585L);
    break;
    /*894:*/

  case 33:
  case 34:
  case 37:
  case 55:
  case 45:
  case 50:
  case 36:
  case 43:
  case 54:
  case 48:
  case 51:
  case 52:   /*:894*/
    printop((int)m);
    break;
    /*1014:*/

  case 30:   /*:1014*/
    printtype((int)m);
    break;
    /*1019:*/

  case 82:
    if (m == 0)
      print(776L);
    else
      print(777L);
    break;

  /*:1019*/
  /*1025:*/
  case 23:   /*:1025*/
    if ((unsigned long)m < 32 && ((1L << m) & 0x7) != 0) {
      switch (m) {

      case 0:
	print(143L);
	break;

      case 1:
	print(144L);
	break;

      case 2:
	print(145L);
	break;
      }
    } else
      print(783L);
    break;
    /*1028:*/

  case 21:   /*:1028*/
    if (m == 0)
      print(784L);
    else
      print(785L);
    break;
    /*1038:*/

  case 22:   /*:1038*/
    if ((unsigned long)m < 32 && ((1L << m) & 0xf) != 0) {
      switch (m) {

      case 0:
	print(799L);
	break;

      case 1:
	print(800L);
	break;

      case 2:
	print(801L);
	break;

      case 3:
	print(802L);
	break;
      }
    } else
      print(803L);
    break;
    /*1043:*/

  case 31:
  case 62:
    if (c == 31)
      print(806L);
    else
      print(807L);
    print(808L);
    print((long)hash[m - 1].rh);
    break;

  case 41:
    if (m == -30000)
      print(809L);
    else
      print(810L);
    break;

  case 10:
    print(811L);
    break;

  case 53:
  case 44, showmacro, initbignode, idtransform, newroot, printvariablename, interesting,
newstructure, findvariable:
  case 49:
    printcmdmod(16L, c);
    print(812L);
    println();
    showtokenlist((long)mem[mem[m + 30000].hh.rh + 30000].hh.rh, -30000L,
		  1000L, 0L);
    break;

  case 5:
    print(813L);
    break;

  case 40:   /*:1043*/
    print((long)intname[m - 1]);
    break;
    /*1053:*/

  case 68:
    if (m == 1)
      print(820L);
    else if (m == 0)
      print(821L);
    else
      print(822L);
    break;

  case 66:
    if (m == 6)
      print(823L);
    else
      print(824L);
    break;

  case 67:   /*:1053*/
    if (m == 0)
      print(825L);
    else
      print(826L);
    break;
    /*1080:*/

  case 25:
    if (m < 1)
      print(856L);
    else if (m == 1)
      print(857L);
    else
      print(858L);
    break;

  /*:1080*/
  /*1102:*/
  case 20:   /*:1102*/
    if ((unsigned long)m < 32 && ((1L << m) & 0xf) != 0) {
      switch (m) {

      case 0:
	print(868L);
	break;

      case 1:
	print(869L);
	break;

      case 2:
	print(870L);
	break;

      case 3:
	print(871L);
	break;
      }
    } else
      print(872L);
    break;
    /*1110:*/

  case 76:   /*:1110*/
    if (m == 0)
      print(889L);
    else
      print(890L);
    break;
    /*1180:*/

  case 29:
    if (m == 16)
      print(913L);
    else
      print(912L);
    break;
  }

  /*:1180*/
}  /*:625*/


Static Void showmacro(p, q, l)
halfword p;
long q, l;
{
  halfword r;

  p = mem[p + 30000].hh.rh;
  while (mem[p + 30000].hh.UU.lh > 7) {
    r = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.rh = -30000;
    showtokenlist((long)p, -30000L, l, 0L);
    mem[p + 30000].hh.rh = r;
    p = r;
    if (l <= 0)
      goto _L10;
    l -= tally;
  }
  tally = 0;
  switch (mem[p + 30000].hh.UU.lh) {

  case 0:
    print(368L);
    break;

  case 1:
  case 2:
  case 3:
    printchar(60);
    printcmdmod(56L, (long)mem[p + 30000].hh.UU.lh);
    print(369L);
    break;

  case 4:
    print(370L);
    break;

  case 5:
    print(371L);
    break;

  case 6:
    print(372L);
    break;

  case 7:
    print(373L);
    break;
  }
  showtokenlist((long)mem[p + 30000].hh.rh, q, l - tally, 0L);
_L10: ;

}


/*:227*/
/*232:*/

Static Void initbignode(p)
halfword p;
{
  halfword q;
  smallnumber s;

  s = bignodesize[mem[p + 30000].hh.UU.U2.b0 - 13];
  q = getnode((long)s);
  do {
    s -= 2;   /*586:*/
    mem[q + s + 30000].hh.UU.U2.b0 = 19;
    serialno += 64;
    mem[q + s + 30001].int_ = serialno;   /*:586*/
    mem[q + s + 30000].hh.UU.U2.b1 = s / 2 + 5;
    mem[q + s + 30000].hh.rh = -30000;
  } while (s != 0);
  mem[q + 30000].hh.rh = p;
  mem[p + 30001].int_ = q;
}  /* initbignode */


/*:232*/
/*233:*/

Static halfword idtransform()
{
  halfword p, q, r;

  p = getnode(2L);
  mem[p + 30000].hh.UU.U2.b0 = 13;
  mem[p + 30000].hh.UU.U2.b1 = 11;
  mem[p + 30001].int_ = -30000;
  initbignode(p);
  q = mem[p + 30001].int_;
  r = q + 12;
  do {
    r -= 2;
    mem[r + 30000].hh.UU.U2.b0 = 16;
    mem[r + 30001].int_ = 0;
  } while (r != q);
  mem[q + 30005].int_ = 65536L;
  mem[q + 30011].int_ = 65536L;
  return p;
}


/*:233*/
/*234:*/

Static Void newroot(x)
halfword x;
{
  halfword p;

  p = getnode(2L);
  mem[p + 30000].hh.UU.U2.b0 = 0;
  mem[p + 30000].hh.UU.U2.b1 = 0;
  mem[p + 30000].hh.rh = x;
  eqtb[x - 1].rh = p;
}  /*:234*/


/*235:*/

Static Void printvariablename(p)
halfword p;
{
  halfword q, r;

  while (mem[p + 30000].hh.UU.U2.b1 >= 5)   /*:237*/
  {  /*237:*/
    switch (mem[p + 30000].hh.UU.U2.b1) {

    case 5:
      printchar(120);
      break;

    case 6:
      printchar(121);
      break;

    case 7:
      print(376L);
      break;

    case 8:
      print(377L);
      break;

    case 9:
      print(378L);
      break;

    case 10:
      print(379L);
      break;

    case 11:
      print(380L);
      printint(p + 30000L);
      goto _L10;
      break;
    }
    print(381L);
    p = mem[p + (5 - mem[p + 30000].hh.UU.U2.b1) * 2 + 30000].hh.rh;
  }
  q = -30000;
  while (mem[p + 30000].hh.UU.U2.b1 > 1)   /*:236*/
  {  /*236:*/
    if (mem[p + 30000].hh.UU.U2.b1 == 3) {
      r = newnumtok(mem[p + 30002].int_);
      do {
	p = mem[p + 30000].hh.rh;
      } while (mem[p + 30000].hh.UU.U2.b1 != 4);
    } else if (mem[p + 30000].hh.UU.U2.b1 == 2) {
      p = mem[p + 30000].hh.rh;
      goto _L40;
    } else {
      if (mem[p + 30000].hh.UU.U2.b1 != 4)
	confusion(375);
      r = getavail();
      mem[r + 30000].hh.UU.lh = mem[p + 30002].hh.UU.lh;
    }
    mem[r + 30000].hh.rh = q;
    q = r;
_L40:
    p = mem[p + 30002].hh.rh;
  }
  r = getavail();
  mem[r + 30000].hh.UU.lh = mem[p + 30000].hh.rh;
  mem[r + 30000].hh.rh = q;
  if (mem[p + 30000].hh.UU.U2.b1 == 1)
    print(374L);
  showtokenlist((long)r, -30000L, 2147483647L, tally);
  flushtokenlist(r);
_L10: ;

}  /*:235*/


/*238:*/

Static boolean interesting(p)
halfword p;
{
  smallnumber t;

  if (internal[2] > 0)
    return true;
  else {
    t = mem[p + 30000].hh.UU.U2.b1;
    if (t >= 5) {
      if (t != 11)
	t = mem[mem[p + (5 - t) * 2 + 30000].hh.rh + 30000].hh.UU.U2.b1;
    }
    return (t != 11);
  }
}


/*:238*/
/*239:*/

Static halfword newstructure(p)
halfword p;
{
  halfword q, r;

  if ((unsigned)mem[p + 30000].hh.UU.U2.b1 < 32 &&
      ((1L << mem[p + 30000].hh.UU.U2.b1) & 0x19) != 0) {
    switch (mem[p + 30000].hh.UU.U2.b1) {

    case 0:
      q = mem[p + 30000].hh.rh;
      r = getnode(2L);
      eqtb[q - 1].rh = r;
      break;

    case 3:  /*240:*/
      q = p;
      do {
	q = mem[q + 30000].hh.rh;
      } while (mem[q + 30000].hh.UU.U2.b1 != 4);
      q = mem[q + 30002].hh.rh;
      r = q + 1;
      do {
	q = r;
	r = mem[r + 30000].hh.rh;
      } while (r != p);
      r = getnode(3L);
      mem[q + 30000].hh.rh = r;
      mem[r + 30002].int_ = mem[p + 30002].int_;
      break;
      /*:240*/

    case 4:  /*241:*/
      q = mem[p + 30002].hh.rh;
      r = mem[q + 30001].hh.UU.lh;
      do {
	q = r;
	r = mem[r + 30000].hh.rh;
      } while (r != p);
      r = getnode(3L);
      mem[q + 30000].hh.rh = r;
      mem[r + 30002] = mem[p + 30002];
      if (mem[p + 30002].hh.UU.lh == 0) {
	q = mem[p + 30002].hh.rh + 1;
	while (mem[q + 30000].hh.rh != p)
	  q = mem[q + 30000].hh.rh;
	mem[q + 30000].hh.rh = r;
      }
      break;
    }
  } else  /*:241*/
    confusion(382);
  mem[r + 30000].hh.rh = mem[p + 30000].hh.rh;
  mem[r + 30000].hh.UU.U2.b0 = 21;
  mem[r + 30000].hh.UU.U2.b1 = mem[p + 30000].hh.UU.U2.b1;
  mem[r + 30001].hh.UU.lh = p;
  mem[p + 30000].hh.UU.U2.b1 = 2;
  q = getnode(3L);
  mem[p + 30000].hh.rh = q;
  mem[r + 30001].hh.rh = q;
  mem[q + 30002].hh.rh = r;
  mem[q + 30000].hh.UU.U2.b0 = 0;
  mem[q + 30000].hh.UU.U2.b1 = 4;
  mem[q + 30000].hh.rh = -29983;
  mem[q + 30002].hh.UU.lh = 0;
  return r;
}

<stdin>, line 3738: Note: Using % for possibly-negative arguments [317]


/*:239*/
/*242:*/

Static halfword findvariable(t)
halfword t;
{
  halfword Result, p, q, r, s, pp, qq, rr, ss;
  long n;
  memoryword saveword;

  p = mem[t + 30000].hh.UU.lh;
  t = mem[t + 30000].hh.rh;
  if (eqtb[p - 1].UU.lh % 83 != 41) {
/* p2c: <stdin>, line 3738:
 * Note: Using % for possibly-negative arguments [317] */
    Result = -30000;
    goto _L10;
  }
  if (eqtb[p - 1].rh == -30000)
    newroot(p);
  p = eqtb[p - 1].rh;
  pp = p;
  while (t != -30000) {  /*243:*/
    if (mem[pp + 30000].hh.UU.U2.b0 != 21) {
      if (mem[pp + 30000].hh.UU.U2.b0 > 21) {
	Result = -30000;
	goto _L10;
      }
      ss = newstructure(pp);
      if (p == pp)
	p = ss;
      pp = ss;
    }
    if (mem[p + 30000].hh.UU.U2.b0 != 21)
      p = newstructure(p);   /*:243*/
    if (t < himemmin) {  /*244:*/
      n = mem[t + 30001].int_;
      pp = mem[mem[pp + 30001].hh.UU.lh + 30000].hh.rh;
      q = mem[mem[p + 30001].hh.UU.lh + 30000].hh.rh;
      saveword = mem[q + 30002];
      mem[q + 30002].int_ = 2147483647L;
      s = p + 1;
      do {
	r = s;
	s = mem[s + 30000].hh.rh;
      } while (n > mem[s + 30002].int_);
      if (n == mem[s + 30002].int_)
	p = s;
      else {
	p = getnode(3L);
	mem[r + 30000].hh.rh = p;
	mem[p + 30000].hh.rh = s;
	mem[p + 30002].int_ = n;
	mem[p + 30000].hh.UU.U2.b1 = 3;
	mem[p + 30000].hh.UU.U2.b0 = 0;
      }
      mem[q + 30002] = saveword;
    } else {   /*:244*/
      n =, printpath, printweight, printedges, printpen, printdependency, printdp, stashcurexp mem[t + 30000].hh.UU.lh;
      ss = mem[pp + 30001].hh.UU.lh;
      do {
	rr = ss;
	ss = mem[ss + 30000].hh.rh;
      } while (n > mem[ss + 30002].hh.UU.lh);
      if (n < mem[ss + 30002].hh.UU.lh) {
	qq = getnode(3L);
	mem[rr + 30000].hh.rh = qq;
	mem[qq + 30000].hh.rh = ss;
	mem[qq + 30002].hh.UU.lh = n;
	mem[qq + 30000].hh.UU.U2.b1 = 4;
	mem[qq + 30000].hh.UU.U2.b0 = 0;
	mem[qq + 30002].hh.rh = pp;
	ss = qq;
      }
      if (p == pp) {
	p = ss;
	pp = ss;
      } else {
	pp = ss;
	s = mem[p + 30001].hh.UU.lh;
	do {
	  r = s;
	  s = mem[s + 30000].hh.rh;
	} while (n > mem[s + 30002].hh.UU.lh);
	if (n == mem[s + 30002].hh.UU.lh)
	  p = s;
	else {
	  q = getnode(3L);
	  mem[r + 30000].hh.rh = q;
	  mem[q + 30000].hh.rh = s;
	  mem[q + 30002].hh.UU.lh = n;
	  mem[q + 30000].hh.UU.U2.b1 = 4;
	  mem[q + 30000].hh.UU.U2.b0 = 0;
	  mem[q + 30002].hh.rh = p;
	  p = q;
	}
      }
    }
    t = mem[t + 30000].hh.rh;
  }
  if (mem[pp + 30000].hh.UU.U2.b0 >= 21) {
    if (mem[pp + 30000].hh.UU.U2.b0 != 21) {
      Result = -30000;
      goto _L10;
    }
    pp = mem[pp + 30001].hh.UU.lh;
  }
  if (mem[p + 30000].hh.UU.U2.b0 == 21)
    p = mem[p + 30001].hh.UU.lh;
  if (mem[p + 30000].hh.UU.U2.b0 == 0) {
    if (mem[pp + 30000].hh.UU.U2.b0 == 0) {
      mem[pp + 30000].hh.UU.U2.b0 = 15;
      mem[pp + 30001].int_ = -30000;
    }
    mem[p + 30000].hh.UU.U2.b0 = mem[pp + 30000].hh.UU.U2.b0;
    mem[p + 30001].int_ = -30000;
  }
  Result = p;
_L10:

  return Result;

  /*245:*/
  /*:245*/
}

<stdin>, line 3912: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 3917: Warning: Symbol 'ABS' is not defined [221]


/*:242*/
/*246:*/
/*257:*/

Static Void printpath(h, s, nuline)
halfword h;
strnumber s;
boolean nuline;
{
  halfword p, q;

  printdiagnostic(384, s, nuline);
  println();
  p = h;
  do {
    q = mem[p + 30000].hh.rh;
    if (p == -30000 || q == -30000) {
      printnl(131);
      goto _L30;
    }  /*258:*/
    printtwo(mem[p + 30001].int_, mem[p + 30002].int_);
    if ((unsigned)mem[p + 30000].hh.UU.U2.b1 < 32 &&
	((1L << mem[p + 30000].hh.UU.U2.b1) & 0x1f) != 0) {
      switch (mem[p + 30000].hh.UU.U2.b1) {

      case 0:
	if (mem[p + 30000].hh.UU.U2.b0 == 4)
	  print(385L);
	if (mem[q + 30000].hh.UU.U2.b0 != 0 || q != h)
	  q = -30000;
	goto _L31;
	break;

      case 1:  /*261:*/
	print(391L);
	printtwo(mem[p + 30005].int_, mem[p + 30006].int_);
	print(390L);
	if (mem[q + 30000].hh.UU.U2.b0 != 1)
	  print(392L);
	else
	  printtwo(mem[q + 30003].int_, mem[q + 30004].int_);
	goto _L31;
	break;
	/*:261*/

      case 4:   /*262:*/
	if (mem[p + 30000].hh.UU.U2.b0 != 1 && mem[p + 30000].hh.UU.U2.b0 != 4)
	      /*:262*/
		print(385L);
	break;

      case 3:
      case 2:  /*263:*/
	if (mem[p + 30000].hh.UU.U2.b0 == 4)
	  print(392L);
	if (mem[p + 30000].hh.UU.U2.b1 == 3) {
	  print(388L);
	  printscaled(mem[p + 30005].int_);
	} else {
	  nsincos(mem[p + 30005].int_);
	  printchar(123);
	  printscaled(ncos);
	  printchar(44);
	  printscaled(nsin);
	}
	printchar(125);
	break;
      }
    } else  /*:263*/
      print(131L);
    if (mem[q + 30000].hh.UU.U2.b0 <= 1)
      print(386L);
    else if (mem[p + 30006].int_ != 65536L || mem[q + 30004].int_ != 65536L) {
      print(389L);
      if (mem[p + 30006].int_ < 0)
	print(332L);
/* p2c: <stdin>, line 3912: Warning: Symbol 'ABS' is not defined [221] */
      printscaled(abs(mem[p + 30006].int_));
      if (mem[p + 30006].int_ != mem[q + 30004].int_) {
	print(390L);
	if (mem[q + 30004].int_ < 0)
	  print(332L);
/* p2c: <stdin>, line 3917: Warning: Symbol 'ABS' is not defined [221] */
	printscaled(abs(mem[q + 30004].int_));
      }
    }
_L31:   /*:258*/
    p = q;
    if (p != h || mem[h + 30000].hh.UU.U2.b0 != 0) {  /*259:*/
      printnl(387);
      if (mem[p + 30000].hh.UU.U2.b0 == 2) {
	nsincos(mem[p + 30003].int_);
	printchar(123);
	printscaled(ncos);
	printchar(44);
	printscaled(nsin);
	printchar(125);
      } else if (mem[p + 30000].hh.UU.U2.b0 == 3) {
	print(388L);
	printscaled(mem[p + 30003].int_);
	printchar(125);
      }
    }  /*:259*/
  } while (p != h);
  if (mem[h + 30000].hh.UU.U2.b0 != 0)
    print(256L);
_L30:
  enddiagnostic(true);

  /*260:*/
  /*:260*/
}  /*:257*/


/*332:*/
/*333:*/

Static Void printweight(q, xoff)
halfword q;
long xoff;
{
  long w, m, d;

  d = mem[q + 30000].hh.UU.lh + 32768L;
  w = d & 7;
  m = d / 8 - mem[curedges + 30003].hh.UU.lh;
  if (fileoffset > maxprintline - 9)
    printnl(32);
  else
    printchar(32);
  printint(m + xoff);
  while (w > 4) {
    printchar(43);
    w--;
  }
  while (w < 4) {
    printchar(45);
    w++;
  }
}  /*:333*/


Static Void printedges(s, nuline, xoff, yoff)
strnumber s;
boolean nuline;
long xoff, yoff;
{
  halfword p, q, r;
  long n;

  printdiagnostic(399, s, nuline);
  p = mem[curedges + 30000].hh.UU.lh;
  n = mem[curedges + 30001].hh.rh - 4096;
  while (p != curedges) {
    q = mem[p + 30001].hh.UU.lh;
    r = mem[p + 30001].hh.rh;
    if (q > -29999 || r != 30000) {
      printnl(400);
      printint(n + yoff);
      printchar(58);
      while (q > -29999) {
	printweight(q, xoff);
	q = mem[q + 30000].hh.rh;
      }
      print(401L);
      while (r != 30000) {
	printweight(r, xoff);
	r = mem[r + 30000].hh.rh;
      }
    }
    p = mem[p + 30000].hh.UU.lh;
    n--;
  }
  enddiagnostic(true);
}

<stdin>, line 4023: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 4026: Warning: Symbol 'ODD' is not defined [221]


/*:332*/
/*388:*/

/*---------------------------------------------------
procedure unskew(x, y: scaled; octant: smallnumber);

moved to mf2ps1.p
---------------------------------------------------*/

Static Void printpen(p, s, nuline)
halfword p;
strnumber s;
boolean nuline;
{
  boolean nothingprinted;
  char k;
  halfword h;
  long m, n;
  halfword w, ww;

  printdiagnostic(436, s, nuline);
  nothingprinted = true;
  println();
  for (k = 1; k <= 8; k++) {
    octant = octantcode[k - 1];
    h = p + octant;
    n = mem[h + 30000].hh.UU.lh;
    w = mem[h + 30000].hh.rh;
    if (~odd(k)) {
/* p2c: <stdin>, line 4023: Warning: Symbol 'ODD' is not defined [221] */
      w = mem[w + 30000].hh.UU.lh;
    }
    for (m = 1; m <= n + 1; m++) {
      if (odd(k)) {
/* p2c: <stdin>, line 4026: Warning: Symbol 'ODD' is not defined [221] */
	ww = mem[w + 30000].hh.rh;
      } else
	ww = mem[w + 30000].hh.UU.lh;
      if (mem[ww + 30001].int_ != mem[w + 30001].int_ ||
	  mem[ww + 30002].int_ != mem[w + 30002].int_)
	  /*:474*/
	  {  /*474:*/
	if (nothingprinted)
	  nothingprinted = false;
	else
	  printnl(438);
	unskew(mem[ww + 30001].int_, mem[ww + 30002].int_, octant);
	printtwo(curx, cury);
      }
      w = ww;
    }
  }
  if (nothingprinted) {
    w = mem[p + 30001].hh.rh;
    printtwo(mem[w + 30001].int_ + mem[w + 30002].int_, mem[w + 30002].int_);
  }
  printnl(437);
  enddiagnostic(true);
}

<stdin>, line 4058: Warning: Symbol 'ABS' is not defined [221]


/*:473*/
/*589:*/

Static Void printdependency(p, t)
halfword p;
smallnumber t;
{
  long v;
  halfword pp, q;

  pp = p;
  while (true) {
    v = abs(mem[p + 30001].int_);
/* p2c: <stdin>, line 4058: Warning: Symbol 'ABS' is not defined [221] */
    q = mem[p + 30000].hh.UU.lh;
    if (q == -30000) {
      if (v != 0 || p == pp) {
	if (mem[p + 30001].int_ > 0) {
	  if (p != pp)
	    printchar(43);
	}
	printscaled(mem[p + 30001].int_);
      }
      goto _L10;
    }
    /*590:*/
    if (mem[p + 30001].int_ < 0)
      printchar(45);
    else if (p != pp)
      printchar(43);
    if (t == 17)
      v = roundfraction(v);
    if (v != 65536L)   /*:590*/
      printscaled(v);
    if (mem[q + 30000].hh.UU.U2.b0 != 19)
      confusion(454);
    printvariablename(q);
    v = mem[q + 30001].int_ & 63;
    while (v > 0) {
      print(455L);
      v -= 2;
    }
    p = mem[p + 30000].hh.rh;
  }
_L10: ;

}


/*:589*/
/*801:*/
/*805:*/

Static Void printdp(t, p, verbosity)
smallnumber t;
halfword p;
smallnumber verbosity;
{
  halfword q;

  q = mem[p + 30000].hh.rh;
  if (mem[q + 30000].hh.UU.lh == -30000 || verbosity > 0)
    printdependency(p, t);
  else
    print(628L);
}


/*:805*/
/*799:*/

Static halfword stashcurexp()
{
  halfword p;

  if ((unsigned)curtype < 3, unstashcurexp, printexp, disperr, pplusfq, poverv, valtoobig, makeknown2 && ((1L << curtype) & 0xe74a8L) != 0) {
    switch (curtype) {

    case 3:
    case 5:
    case 7:
    case 12:
    case 10:
    case 13:
    case 14:
    case 17:
    case 18:
    case 19:
      p = curexp;
      break;
    }
  } else {
    p = getnode(2L);
    mem[p + 30000].hh.UU.U2.b1 = 11;
    mem[p + 30000].hh.UU.U2.b0 = curtype;
    mem[p + 30001].int_ = curexp;
  }
  curtype = 1;
  mem[p + 30000].hh.rh = -29999;
  return p;
}


/*:799*/
/*800:*/

Static Void unstashcurexp(p)
halfword p;
{
  curtype = mem[p + 30000].hh.UU.U2.b0;
  if ((unsigned)curtype >= 32 || ((1L << curtype) & 0xe74a8L) == 0) {
    curexp = mem[p + 30001].int_;
    freenode(p, 2);
    return;
  }
  switch (curtype) {

  case 3:
  case 5:
  case 7:
  case 12:
  case 10:
  case 13:
  case 14:
  case 17:
  case 18:
  case 19:
    curexp = p;
    break;
  }
}  /*:800*/


Static Void printexp(p, verbosity)
halfword p;
smallnumber verbosity;
{
  boolean restorecurexp;
  smallnumber t;
  long v;
  halfword q;

  if (p != -30000)
    restorecurexp = false;
  else {
    p = stashcurexp();
    restorecurexp = true;
  }
  t = mem[p + 30000].hh.UU.U2.b0;
  if (t < 17)   /*802:*/
    v = mem[p + 30001].int_;
  else if (t < 19)
    v = mem[p + 30001].hh.rh;
  if ((unsigned)t < 32 && ((1L << t) & 0xffffeL) != 0) {
    switch (t) {

    case 1:
      print(194L);
      break;

    case 2:
      if (v == 30)
	print(218L);
      else
	print(219L);
      break;

    case 3:
    case 5:
    case 7:
    case 12:
    case 10:
    case 15:  /*806:*/
      printtype(t);
      if (v != -30000) {
	printchar(32);
	while (mem[v + 30000].hh.UU.U2.b1 == 11 && v != p)
	  v = mem[v + 30001].int_;
	printvariablename((int)v);
      }
      break;
      /*:806*/

    case 4:
      printchar(34);
      slowprint(v);
      printchar(34);
      break;

    case 6:
    case 8:
    case 9:
    case 11:   /*804:*/
      if (verbosity <= 1)
	printtype(t);
      else {   /*:804*/
	if (selector == 3) {
	  if (internal[12] <= 0) {
	    selector = 1;
	    printtype(t);
	    print(626L);
	    selector = 3;
	  }
	}
	switch (t) {

	case 6:
	  printpen((int)v, 155, false);
	  break;

	case 8:
	  printpath((int)v, 627, false);
	  break;

	case 9:
	  printpath((int)v, 155, false);
	  break;

	case 11:
	  curedges = v;
	  printedges(155, false, 0L, 0L);
	  break;
	}
      }
      break;

    case 13:
    case 14:
      if (v == -30000)   /*803:*/
	printtype(t);
      else {   /*:803*/
	printchar(40);
	q = v + bignodesize[t - 13];
	do {
	  if (mem[v + 30000].hh.UU.U2.b0 == 16)
	    printscaled(mem[v + 30001].int_);
	  else if (mem[v + 30000].hh.UU.U2.b0 == 19)
	    printvariablename((int)v);
	  else
	    printdp(mem[v + 30000].hh.UU.U2.b0, mem[v + 30001].hh.rh,
		    verbosity);
	  v += 2;
	  if (v != q)
	    printchar(44);
	} while (v != q);
	printchar(41);
      }
      break;

    case 16:
      printscaled(v);
      break;

    case 17:
    case 18:
      printdp(t, (int)v, verbosity);
      break;

    case 19:
      printvariablename(p);
      break;
    }
  } else   /*:802*/
    confusion(625);
  if (restorecurexp)
    unstashcurexp(p);
}


/*:801*/
/*807:*/

Static Void disperr(p, s)
halfword p;
strnumber s;
{
  printnl(629);
  printexp(p, 1);
  if (s != 155) {
    printnl(133);
    print((long)s);
  }
}

<stdin>, line 4288: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 4291: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 4308: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 4312: Warning: Symbol 'ABS' is not defined [221]


/*:807*/
/*594:*/

Static halfword pplusfq(p, f, q, t, tt)
halfword p;
long f;
halfword q;
smallnumber t, tt;
{
  halfword pp, qq, r, s;
  long threshold, v;

  if (t == 17)
    threshold = 2685;
  else
    threshold = 8;
  r = 29999;
  pp = mem[p + 30000].hh.UU.lh;
  qq = mem[q + 30000].hh.UU.lh;
  while (true) {
    if (pp == qq) {
      if (pp == -30000) {
	goto _L30;   /*595:*/
	continue;
      }
      if (tt == 17)
	v = mem[p + 30001].int_ + takefraction(f, mem[q + 30001].int_);
      else
	v = mem[p + 30001].int_ + takescaled(f, mem[q + 30001].int_);
      mem[p + 30001].int_ = v;
      s = p;
      p = mem[p + 30000].hh.rh;
      if (abs(v) < threshold) {
/* p2c: <stdin>, line 4288: Warning: Symbol 'ABS' is not defined [221] */
	freenode(s, 2);
      } else {
	if (abs(v) >= 626349397L) {
/* p2c: <stdin>, line 4291: Warning: Symbol 'ABS' is not defined [221] */
	  if (watchcoefs) {
	    mem[qq + 30000].hh.UU.U2.b0 = 0;
	    fixneeded = true;
	  }
	}
	mem[r + 30000].hh.rh = s;
	r = s;
      }
      pp = mem[p + 30000].hh.UU.lh;
      q = mem[q + 30000].hh.rh;
      qq = mem[q + 30000].hh.UU.lh;
      continue;
    }
    if (mem[pp + 30001].int_ >= mem[qq + 30001].int_) {  /*596:*/
      mem[r + 30000].hh.rh = p;
      r = p;
      p = mem[p + 30000].hh.rh;
      pp = mem[p + 30000].hh.UU.lh;
      continue;
    }
    if (tt == 17)
      v = takefraction(f, mem[q + 30001].int_);
    else
      v = takescaled(f, mem[q + 30001].int_);
    if (abs(v) > threshold / 2) {
/* p2c: <stdin>, line 4308: Warning: Symbol 'ABS' is not defined [221] */
      s = getnode(2L);
      mem[s + 30000].hh.UU.lh = qq;
      mem[s + 30001].int_ = v;
      if (abs(v) >= 626349397L) {
/* p2c: <stdin>, line 4312: Warning: Symbol 'ABS' is not defined [221] */
	if (watchcoefs) {
	  mem[qq + 30000].hh.UU.U2.b0 = 0;
	  fixneeded = true;
	}
      }
      mem[r + 30000].hh.rh = s;
      r = s;
    }
    q = mem[q + 30000].hh.rh;
    qq = mem[q + 30000].hh.UU.lh;
  }
_L30:
  if (t == 17)
    mem[p + 30001].int_ = slowadd(mem[p + 30001].int_,
				  takefraction(mem[q + 30001].int_, f));
  else
    mem[p + 30001].int_ = slowadd(mem[p + 30001].int_,
				  takescaled(mem[q + 30001].int_, f));
  mem[r + 30000].hh.rh = p;
  depfinal = p;
  return (mem[59999].hh.rh);

  /*:595*/
  /*:596*/
}  /*:594*/

<stdin>, line 4357: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 4363: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 4368: Warning: Symbol 'ABS' is not defined [221]


/*600:*/

Static halfword poverv(p, v, t0, t1)
halfword p;
long v;
smallnumber t0, t1;
{
  halfword r, s;
  long w, threshold;
  boolean scalingdown;

  if (t0 != t1)
    scalingdown = true;
  else
    scalingdown = false;
  if (t1 == 17)
    threshold = 1342;
  else
    threshold = 4;
  r = 29999;
  while (mem[p + 30000].hh.UU.lh != -30000) {
    if (scalingdown) {
      if (abs(v) < 524288L) {
/* p2c: <stdin>, line 4357: Warning: Symbol 'ABS' is not defined [221] */
	w = makescaled(mem[p + 30001].int_, v * 4096);
      } else
	w = makescaled(roundfraction(mem[p + 30001].int_), v);
    } else
      w = makescaled(mem[p + 30001].int_, v);
    if (abs(w) <= threshold) {
/* p2c: <stdin>, line 4363: Warning: Symbol 'ABS' is not defined [221] */
      s = mem[p + 30000].hh.rh;
      freenode(p, 2);
      p = s;
      continue;
    }
    if (abs(w) >= 626349397L) {
/* p2c: <stdin>, line 4368: Warning: Symbol 'ABS' is not defined [221] */
      fixneeded = true;
      mem[mem[p + 30000].hh.UU.lh + 30000].hh.UU.U2.b0 = 0;
    }
    mem[r + 30000].hh.rh = p;
    r = p;
    mem[p + 30001].int_ = w;
    p = mem[p + 30000].hh.rh;
  }
  mem[r + 30000].hh.rh = p;
  mem[p + 30001].int_ = makescaled(mem[p + 30001].int_, v);
  return (mem[59999].hh.rh);
}  /* poverv */


/*:600*/
/*602:*/

Static Void valtoobig(x)
long x;
{
  if (internal[39] <= 0)
    return;
  printnl(133);
  print(456L);
  printscaled(x);
  printchar(41);
  helpptr = 4;
  helpline[3] = 457;
  helpline[2] = 458;
  helpline[1] = 459;
  helpline[0] = 460;
  error();
}

<stdin>, line 4417: Warning: Symbol 'ABS' is not defined [221]


/*:602*/
/*603:*/

Static Void makeknown(p, q)
halfword p, q;
{
  char t;

  mem[mem[q + 30000].hh.rh + 30001].hh.UU.lh = mem[p + 30001].hh.UU.lh;
  mem[mem[p + 30001].hh.UU.lh + 30000].hh.rh = mem[q + 30000].hh.rh;
  t = mem[p + 30000].hh.UU.U2.b0;
  mem[p + 30000].hh.UU.U2.b0 = 16;
  mem[p + 30001].int_ = mem[q + 30001].int_;
  freenode(q, 2);
  if (abs(mem[p + 30001].int_) >= 268435456L) {
/* p2c: <stdin>, line 4417: Warning: Symbol 'ABS' is not defined [221] */
    valtoobig(mem[p + 30001].int_);
  }
  if (internal[1] , fixdependencies, tossknotlist, tossedges, tosspen, ringdelete, recyclevalue, flushcurexp> 0) {
    if (interesting(p)) {
      begindiagnostic();
      printnl(461);
      printvariablename(p);
      printchar(61);
      printscaled(mem[p + 30001].int_);
      enddiagnostic(false);
    }
  }
  if (curexp != p)
    return;
  if (curtype != t)
    return;
  curtype = 16;
  curexp = mem[p + 30001].int_;
  freenode(p, 2);
}


/*:603*/
/*604:*/

Static Void fixdependencies()
{
  halfword p, q, r, s, t, x;

  r = mem[13].hh.rh;
  s = -30000;
  while (r != -29987) {
    t = r;
    /*605:*/
    r = t + 1;
    while (true) {
      q = mem[r + 30000].hh.rh;
      x = mem[q + 30000].hh.UU.lh;
      if (x == -30000)
	goto _L30;
      if (mem[x + 30000].hh.UU.U2.b0 <= 1) {
	if (mem[x + 30000].hh.UU.U2.b0 < 1) {
	  p = getavail();
	  mem[p + 30000].hh.rh = s;
	  s = p;
	  mem[s + 30000].hh.UU.lh = x;
	  mem[x + 30000].hh.UU.U2.b0 = 1;
	}
	mem[q + 30001].int_ /= 4;
	if (mem[q + 30001].int_ == 0) {
	  mem[r + 30000].hh.rh = mem[q + 30000].hh.rh;
	  freenode(q, 2);
	  q = r;
	}
      }
      r = q;
    }
_L30:   /*:605*/
    r = mem[q + 30000].hh.rh;
    if (q == mem[t + 30001].hh.rh)
      makeknown(t, q);
  }
  while (s != -30000) {
    p = mem[s + 30000].hh.rh;
    x = mem[s + 30000].hh.UU.lh;
    mem[s + 30000].hh.rh = avail;
    avail = s;   /*dynused:=dynused-1;*/
    s = p;
    mem[x + 30000].hh.UU.U2.b0 = 19;
    mem[x + 30001].int_ += 2;
  }
  fixneeded = false;
}  /* fixdependencies */


/*:604*/
/*268:*/

Static Void tossknotlist(p)
halfword p;
{
  halfword q, r;

  q = p;
  do {
    r = mem[q + 30000].hh.rh;
    freenode(q, 7);
    q = r;
  } while (q != p);
}


/*:268*/
/*385:*/

Static Void tossedges(h)
halfword h;
{
  halfword p, q;

  q = mem[h + 30000].hh.rh;
  while (q != h) {
    flushlist(mem[q + 30001].hh.rh);
    if (mem[q + 30001].hh.UU.lh > -29999)
      flushlist(mem[q + 30001].hh.UU.lh);
    p = q;
    q = mem[q + 30000].hh.rh;
    freenode(p, 2);
  }
  freenode(h, 6);
}


/*:385*/
/*487:*/

Static Void tosspen(p)
halfword p;
{
  char k;
  halfword w, ww;

  if (p == -29997)
    return;
  for (k = 30001; k <= 30008; k++) {
    w = mem[p + k].hh.rh;
    do {
      ww = mem[w + 30000].hh.rh;
      freenode(w, 3);
      w = ww;
    } while (w != mem[p + k].hh.rh);
  }
  freenode(p, 10);
}


/*:487*/
/*620:*/

Static Void ringdelete(p)
halfword p;
{
  halfword q;

  q = mem[p + 30001].int_;
  if (q == -30000)
    return;
  if (q == p)
    return;
  while (mem[q + 30001].int_ != p)
    q = mem[q + 30001].int_;
  mem[q + 30001].int_ = mem[p + 30001].int_;
}

<stdin>, line 4625: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 4630: Warning: Symbol 'ABS' is not defined [221]


/*:620*/
/*809:*/

Static Void recyclevalue(p)
halfword p;
{
  smallnumber t;
  long v, vv;
  halfword q, r, s, pp;

  t = mem[p + 30000].hh.UU.U2.b0;
  if (t < 17)
    v = mem[p + 30001].int_;
  switch (t) {

  case 0:
  case 1:
  case 2:
  case 16:
  case 15:
    /* blank case */
    break;

  case 3:
  case 5:
  case 7:
  case 12:
  case 10:
    ringdelete(p);
    break;

  case 4:
    if (strref[v] < 127) {
      if (strref[v] > 1)
	strref[v]--;
      else
	flushstring((int)v);
    }
    break;

  case 6:
    if (mem[v + 30000].hh.UU.lh == -30000)
      tosspen((int)v);
    else
      mem[v + 30000].hh.UU.lh--;
    break;

  case 9:
  case 8:
    tossknotlist((int)v);
    break;

  case 11:
    tossedges((int)v);
    break;

  case 14:
  case 13:   /*810:*/
    if (v != -30000) {   /*:810*/
      q = v + bignodesize[t - 13];
      do {
	q -= 2;
	recyclevalue(q);
      } while (q != v);
      freenode((int)v, bignodesize[t - 13]);
    }
    break;

  case 17:
  case 18:  /*811:*/
    q = mem[p + 30001].hh.rh;
    while (mem[q + 30000].hh.UU.lh != -30000)
      q = mem[q + 30000].hh.rh;
    mem[mem[p + 30001].hh.UU.lh + 30000].hh.rh = mem[q + 30000].hh.rh;
    mem[mem[q + 30000].hh.rh + 30001].hh.UU.lh = mem[p + 30001].hh.UU.lh;
    mem[q + 30000].hh.rh = -30000;
    flushnodelist(mem[p + 30001].hh.rh);
    break;
    /*:811*/

  case 19:  /*812:*/
    maxc[0] = 0;
    maxc[1] = 0;
    maxlink[0] = -30000;
    maxlink[1] = -30000;
    q = mem[13].hh.rh;
    while (q != -29987) {
      s = q + 1;
      while (true) {
	r = mem[s + 30000].hh.rh;
	if (mem[r + 30000].hh.UU.lh == -30000)
	  goto _L30;
	if (mem[r + 30000].hh.UU.lh != p) {
	  s = r;
	  continue;
	}
	t = mem[q + 30000].hh.UU.U2.b0;
	mem[s + 30000].hh.rh = mem[r + 30000].hh.rh;
	mem[r + 30000].hh.UU.lh = q;
	if (abs(mem[r + 30001].int_) <= maxc[t - 17]) {  /*814:*/
	  mem[r + 30000].hh.rh = maxlink[t - 17];
	  maxlink[t - 17] = r;
	  continue;
	}
/* p2c: <stdin>, line 4625: Warning: Symbol 'ABS' is not defined [221] */
	if (maxc[t - 17] > 0) {
	  mem[maxptr[t - 17] + 30000].hh.rh = maxlink[t - 17];
	  maxlink[t - 17] = maxptr[t - 17];
	}
	maxc[t - 17] = abs(mem[r + 30001].int_);
/* p2c: <stdin>, line 4630: Warning: Symbol 'ABS' is not defined [221] */
	maxptr[t - 17] = r;
      }
_L30:
      q = mem[r + 30000].hh.rh;
    }
    if (maxc[0] > 0 || maxc[1] > 0) {  /*815:*/
      if (maxc[0] >= 268435456L || maxc[0] / 4096 >= maxc[1])   /*816:*/
	t = 17;
      else
	t = 18;
      s = maxptr[t - 17];
      pp = mem[s + 30000].hh.UU.lh;
      v = mem[s + 30001].int_;
      if (t == 17)
	mem[s + 30001].int_ = -268435456L;
      else
	mem[s + 30001].int_ = -65536L;
      r = mem[pp + 30001].hh.rh;
      mem[s + 30000].hh.rh = r;
      while (mem[r + 30000].hh.UU.lh != -30000)
	r = mem[r + 30000].hh.rh;
      q = mem[r + 30000].hh.rh;
      mem[r + 30000].hh.rh = -30000;
      mem[q + 30001].hh.UU.lh = mem[pp + 30001].hh.UU.lh;
      mem[mem[pp + 30001].hh.UU.lh + 30000].hh.rh = q;
      mem[pp + 30000].hh.UU.U2.b0 = 19;
      serialno += 64;
      mem[pp + 30001].int_ = serialno;
      if (curexp == pp) {
	if (curtype == t)
	  curtype = 19;
      }
      if (internal[1] > 0) {   /*817:*/
	if (interesting(p)) {   /*:817*/
	  begindiagnostic();
	  printnl(631);
	  if (v > 0)
	    printchar(45);
	  if (t == 17)
	    vv = roundfraction(maxc[0]);
	  else
	    vv = maxc[1];
	  if (vv != 65536L)
	    printscaled(vv);
	  printvariablename(p);
	  while ((mem[p + 30001].int_ & 63) > 0) {
	    print(455L);
	    mem[p + 30001].int_ -= 2;
	  }
	  if (t == 17)
	    printchar(61);
	  else
	    print(632L);
	  printdependency(s, t);
	  enddiagnostic(false);
	}
	/*:816*/
      }
      t = 35 - t;
      if (maxc[t - 17] > 0) {
	mem[maxptr[t - 17] + 30000].hh.rh = maxlink[t - 17];
	maxlink[t - 17] = maxptr[t - 17];
      }
      if (t != 17) {   /*818:*/
	for (t = 17; t <= 18; t++) {   /*:818*/
	  r = maxlink[t - 17];
	  while (r != -30000) {
	    q = mem[r + 30000].hh.UU.lh;
	    mem[q + 30001].hh.rh = pplusfq(mem[q + 30001].hh.rh,
		makefraction(mem[r + 30001].int_, -v), s, t, 17);
	    if (mem[q + 30001].hh.rh == depfinal)
	      makeknown(q, depfinal);
	    q = r;
	    r = mem[r + 30000].hh.rh;
	    freenode(q, 2);
	  }
	}
	/*819:*/
      } else {
	for (t = 17; t <= 18; t++) {   /*:819*/
	  r = maxlink[t - 17];
	  while (r != -30000) {
	    q = mem[r + 30000].hh.UU.lh;
	    if (t == 17) {
	      if (curexp == q) {
		if (curtype == 17)
		  curtype = 18;
	      }
	      mem[q + 30001].hh.rh = poverv(mem[q + 30001].hh.rh, 65536L, 17,
					    18);
	      mem[q + 30000].hh.UU.U2.b0 = 18;
	      mem[r + 30001].int_ = roundfraction(mem[r + 30001].int_);
	    }
	    mem[q + 30001].hh.rh = pplusfq(mem[q + 30001].hh.rh,
		makescaled(mem[r + 30001].int_, -v), s, 18, 18);
	    if (mem[q + 30001].hh.rh == depfinal)
	      makeknown(q, depfinal);
	    q = r;
	    r = mem[r + 30000].hh.rh;
	    freenode(q, 2);
	  }
	}
      }
      flushnodelist(s);
      if (fixneeded)
	fixdependencies();
      if (aritherror)
	cleararith();
    }  /*:815*/
    break;
    /*:812*/

  case 20:
  case 21:
    confusion(630);
    break;

  case 22:
  case 23:
    deletemacref((int)mem[p + 30001].int_);
    break;
  }
  mem[p + 30000].hh.UU.U2.b0 = 0;

  /*:814*/
}


/*:809*/
/*808:*/

Static Void flushcurexp(v)
long v;
{
  if ((unsigned)curtype < 32 && ((1L << curtype) & 0xe7ff8L) != 0) {
    switch (curtype) {

    case 3:
    case 5:
    case 7:
    case 12:
    case 10:
    case 13:
    case 14:
    case 17:
    case 18:
    case 19:, flusherror, putgeterror, putgetflusherror, flushbelowvariable,
flushvariable, undtype, clearsymbol, savevariable, saveinternal, unsave, copyknot, copypath, htapypoc, curlratio
      recyclevalue((int)curexp);
      freenode((int)curexp, 2);
      break;

    case 6:
      if (mem[curexp + 30000].hh.UU.lh == -30000)
	tosspen((int)curexp);
      else
	mem[curexp + 30000].hh.UU.lh--;
      break;

    case 4:
      if (strref[curexp] < 127) {
	if (strref[curexp] > 1)
	  strref[curexp]--;
	else
	  flushstring((int)curexp);
      }
      break;

    case 8:
    case 9:
      tossknotlist((int)curexp);
      break;

    case 11:
      tossedges((int)curexp);
      break;
    }
  }
  curtype = 16;
  curexp = v;
}


/*:808*/
/*820:*/

Static Void flusherror(v)
long v;
{
  error();
  flushcurexp(v);
}


Static Void backerror PV();

Static Void getxnext PV();


Static Void putgeterror()
{
  backerror();
  getxnext();
}  /* putgeterror */


Static Void putgetflusherror(v)
long v;
{
  putgeterror();
  flushcurexp(v);
}


/*:820*/
/*247:*/

Static Void flushbelowvariable(p)
halfword p;
{
  halfword q, r;

  if (mem[p + 30000].hh.UU.U2.b0 != 21) {
    recyclevalue(p);
    return;
  }
  q = mem[p + 30001].hh.rh;
  while (mem[q + 30000].hh.UU.U2.b1 == 3) {
    flushbelowvariable(q);
    r = q;
    q = mem[q + 30000].hh.rh;
    freenode(r, 3);
  }
  r = mem[p + 30001].hh.UU.lh;
  q = mem[r + 30000].hh.rh;
  recyclevalue(r);
  if (mem[p + 30000].hh.UU.U2.b1 <= 1)
    freenode(r, 2);
  else
    freenode(r, 3);
  do {
    flushbelowvariable(q);
    r = q;
    q = mem[q + 30000].hh.rh;
    freenode(r, 3);
  } while (q != -29983);
  mem[p + 30000].hh.UU.U2.b0 = 0;
}  /*:247*/


Static Void flushvariable(p, t, discardsuffixes)
halfword p, t;
boolean discardsuffixes;
{
  halfword q, r, n;

  while (t != -30000) {
    if (mem[p + 30000].hh.UU.U2.b0 != 21)
      goto _L10;
    n = mem[t + 30000].hh.UU.lh;
    t = mem[t + 30000].hh.rh;
    if (n == 0) {
      r = p + 1;
      q = mem[r + 30000].hh.rh;
      while (mem[q + 30000].hh.UU.U2.b1 == 3) {
	flushvariable(q, t, discardsuffixes);
	if (t == -30000) {
	  if (mem[q + 30000].hh.UU.U2.b0 == 21)
	    r = q;
	  else {
	    mem[r + 30000].hh.rh = mem[q + 30000].hh.rh;
	    freenode(q, 3);
	  }
	} else
	  r = q;
	q = mem[r + 30000].hh.rh;
      }
    }
    p = mem[p + 30001].hh.UU.lh;
    do {
      r = p;
      p = mem[p + 30000].hh.rh;
    } while (mem[p + 30002].hh.UU.lh < n);
    if (mem[p + 30002].hh.UU.lh != n)
      goto _L10;
  }
  if (discardsuffixes)
    flushbelowvariable(p);
  else {
    if (mem[p + 30000].hh.UU.U2.b0 == 21)
      p = mem[p + 30001].hh.UU.lh;
    recyclevalue(p);
  }
_L10: ;

}


/*:246*/
/*248:*/

Static smallnumber undtype(p)
halfword p;
{
  smallnumber Result;

  switch (mem[p + 30000].hh.UU.U2.b0) {

  case 0:
  case 1:
    Result = 0;
    break;

  case 2:
  case 3:
    Result = 3;
    break;

  case 4:
  case 5:
    Result = 5;
    break;

  case 6:
  case 7:
  case 8:
    Result = 7;
    break;

  case 9:
  case 10:
    Result = 10;
    break;

  case 11:
  case 12:
    Result = 12;
    break;

  case 13:
  case 14:
  case 15:
    Result = mem[p + 30000].hh.UU.U2.b0;
    break;

  case 16:
  case 17:
  case 18:
  case 19:
    Result = 15;
    break;
  }
  return Result;
}  /*:248*/

<stdin>, line 4916: Note: Using % for possibly-negative arguments [317]
<stdin>, line 4918: Note: Using % for possibly-negative arguments [317]


/*249:*/

Static Void clearsymbol(p, saving)
halfword p;
boolean saving;
{
  halfword q;

  q = eqtb[p - 1].rh;
  if (eqtb[p - 1].UU.lh % 83 == 10 || eqtb[p - 1].UU.lh % 83 == 41 ||
      eqtb[p - 1].UU.lh % 83 == 49 ||
      eqtb[p - 1].UU.lh % 83 == 44 || eqtb[p - 1].UU.lh % 83 == 53) {
/* p2c: <stdin>, line 4916:
 * Note: Using % for possibly-negative arguments [317] */
/* p2c: <stdin>, line 4918:
 * Note: Using % for possibly-negative arguments [317] */
    switch (eqtb[p - 1].UU.lh % 83) {

    case 10:
    case 53:
    case 44:
    case 49:
      if (!saving)
	deletemacref(q);
      break;

    case 41:
      if (q != -30000) {
	if (saving)
	  mem[q + 30000].hh.UU.U2.b1 = 1;
	else {
	  flushbelowvariable(q);
	  freenode(q, 2);
	}
      }
      break;
    }
  }
  eqtb[p - 1] = eqtb[2240];
}


/*:249*/
/*252:*/

Static Void savevariable(q)
halfword q;
{
  halfword p;

  if (saveptr != -30000) {
    p = getnode(2L);
    mem[p + 30000].hh.UU.lh = q;
    mem[p + 30000].hh.rh = saveptr;
    mem[p + 30001].hh = eqtb[q - 1];
    saveptr = p;
  }
  clearsymbol(q, saveptr != -30000);
}


/*:252*/
/*253:*/

Static Void saveinternal(q)
halfword q;
{
  halfword p;

  if (saveptr == -30000)
    return;
  p = getnode(2L);
  mem[p + 30000].hh.UU.lh = q + 2241;
  mem[p + 30000].hh.rh = saveptr;
  mem[p + 30001].int_ = internal[q - 1];
  saveptr = p;
}  /* saveinternal */

<stdin>, line 4993: Note: Using % for possibly-negative arguments [317]


/*:253*/
/*254:*/

Static Void unsave()
{
  halfword q, p;

  while (mem[saveptr + 30000].hh.UU.lh != 0) {
    q = mem[saveptr + 30000].hh.UU.lh;
    if (q > 2241) {
      if (internal[7] > 0) {
	begindiagnostic();
	printnl(383);
	print((long)intname[q - 2242]);
	printchar(61);
	printscaled(mem[saveptr + 30001].int_);
	printchar(125);
	enddiagnostic(false);
      }
      internal[q - 2242] = mem[saveptr + 30001].int_;
    } else {
      if (internal[7] > 0) {
	begindiagnostic();
	printnl(383);
	print((long)hash[q - 1].rh);
	printchar(125);
	enddiagnostic(false);
      }
      clearsymbol(q, false);
      eqtb[q - 1] = mem[saveptr + 30001].hh;
      if (eqtb[q - 1].UU.lh % 83 == 41) {
/* p2c: <stdin>, line 4993:
 * Note: Using % for possibly-negative arguments [317] */
	p = eqtb[q - 1].rh;
	if (p != -30000)
	  mem[p + 30000].hh.UU.U2.b1 = 0;
      }
    }
    p = mem[saveptr + 30000].hh.rh;
    freenode(saveptr, 2);
    saveptr = p;
  }
  p = mem[saveptr + 30000].hh.rh;
  mem[saveptr + 30000].hh.rh = avail;
  avail = saveptr;   /*dynused:=dynused-1;*/
  saveptr = p;
}


/*:254*/
/*264:*/

Static halfword copyknot(p)
halfword p;
{
  halfword q;
  char k;

  q = getnode(7L);
  for (k = 30000; k <= 30006; k++)
    mem[q + k] = mem[p + k];
  return q;
}


/*:264*/
/*265:*/

Static halfword copypath(p)
halfword p;
{
  halfword Result, q, pp, qq;

  q = getnode(7L);
  qq = q;
  pp = p;
  while (true) {
    mem[qq + 30000].hh.UU.U2.b0 = mem[pp + 30000].hh.UU.U2.b0;
    mem[qq + 30000].hh.UU.U2.b1 = mem[pp + 30000].hh.UU.U2.b1;
    mem[qq + 30001].int_ = mem[pp + 30001].int_;
    mem[qq + 30002].int_ = mem[pp + 30002].int_;
    mem[qq + 30003].int_ = mem[pp + 30003].int_;
    mem[qq + 30004].int_ = mem[pp + 30004].int_;
    mem[qq + 30005].int_ = mem[pp + 30005].int_;
    mem[qq + 30006].int_ = mem[pp + 30006].int_;
    if (mem[pp + 30000].hh.rh == p) {
      mem[qq + 30000].hh.rh = q;
      Result = q;
      goto _L10;
    }
    mem[qq + 30000].hh.rh = getnode(7L);
    qq = mem[qq + 30000].hh.rh;
    pp = mem[pp + 30000].hh.rh;
  }
_L10:

  return Result;
}


/*:265*/
/*266:*/

Static halfword htapypoc(p)
halfword p;
{
  halfword Result, q, pp, qq, rr;

  q = getnode(7L);
  qq = q;
  pp = p;
  while (true) {
    mem[qq + 30000].hh.UU.U2.b1 = mem[pp + 30000].hh.UU.U2.b0;
    mem[qq + 30000].hh.UU.U2.b0 = mem[pp + 30000].hh.UU.U2.b1;
    mem[qq + 30001].int_ = mem[pp + 30001].int_;
    mem[qq + 30002].int_ = mem[pp + 30002].int_;
    mem[qq + 30005].int_ = mem[pp + 30003].int_;
    mem[qq + 30006].int_ = mem[pp + 30004].int_;
    mem[qq + 30003].int_ = mem[pp + 30005].int_;
    mem[qq + 30004].int_ = mem[pp + 30006].int_;
    if (mem[pp + 30000].hh.rh == p) {
      mem[q + 30000].hh.rh = qq;
      pathtail = pp;
      Result = q;
      goto _L10;
    }
    rr = getnode(7L);
    mem[rr + 30000].hh.rh = qq;
    qq = rr;
    pp = mem[pp + 30000].hh.rh;
  }
_L10:

  return Result;
}


/*:266*/
/*269:*/
/*284:*/
/*296:*/

Static long curlratio(gamma, atension, btension)
long gamma, atension, btension;
{
  fraction alpha, beta, num, denom, ff;

  alpha = makefraction(65536L, atension);
  beta = makefraction(65536L, btension);
  if (alpha <= beta) {
    ff = makefraction(alpha, beta);
    ff = takefraction(ff, ff);
    gamma = takefraction(gamma, ff);
    beta /= 4096;
    denom = takefraction(gamma, alpha) - beta + 196608L;
    num = takefraction(gamma, 805306368L - alpha) + beta;
  } else {
    ff = makefraction(be, setcontrols, solvechoicesta, alpha);
    ff = takefraction(ff, ff);
    beta = takefraction(beta, ff) / 4096;
    denom = takefraction(gamma, alpha) + ff / 1365 - beta;
    num = takefraction(gamma, 805306368L - alpha) + beta;
  }
  if (num >= denom + denom + denom + denom)
    return 1073741824L;
  else
    return (makefraction(num, denom));
}

<stdin>, line 5118: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5119: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5124: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5124: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5128: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5129: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5131: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5132: Warning: Symbol 'ABS' is not defined [221]


/*:296*/
/*299:*/

Static Void setcontrols(p, q, k)
halfword p, q;
long k;
{
  fraction rr, ss, sine;
  scaled lt, rt;

  lt = abs(mem[q + 30004].int_);
/* p2c: <stdin>, line 5118: Warning: Symbol 'ABS' is not defined [221] */
  rt = abs(mem[p + 30006].int_);
/* p2c: <stdin>, line 5119: Warning: Symbol 'ABS' is not defined [221] */
  rr = velocity(st, ct, sf, cf, rt);
  ss = velocity(sf, cf, st, ct, lt);
  if (mem[p + 30006].int_ < 0 || mem[q + 30004].int_ < 0) {   /*300:*/
    if (st >= 0 && sf >= 0 || st <= 0 && sf <= 0) {   /*:300*/
      sine = takefraction(abs(st), cf) + takefraction(abs(sf), ct);
/* p2c: <stdin>, line 5124: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 5124: Warning: Symbol 'ABS' is not defined [221] */
      if (sine > 0) {
	sine = takefraction(sine, 268500992L);
	if (mem[p + 30006].int_ < 0) {
	  if (abvscd(abs(sf), 268435456L, rr, sine) < 0) {
/* p2c: <stdin>, line 5128: Warning: Symbol 'ABS' is not defined [221] */
	    rr = makefraction(abs(sf), sine);
/* p2c: <stdin>, line 5129: Warning: Symbol 'ABS' is not defined [221] */
	  }
	}
	if (mem[q + 30004].int_ < 0) {
	  if (abvscd(abs(st), 268435456L, ss, sine) < 0) {
/* p2c: <stdin>, line 5131: Warning: Symbol 'ABS' is not defined [221] */
	    ss = makefraction(abs(st), sine);
/* p2c: <stdin>, line 5132: Warning: Symbol 'ABS' is not defined [221] */
	  }
	}
      }
    }
  }
  mem[p + 30005].int_ = mem[p + 30001].int_ + takefraction(
	takefraction(deltax[k], ct) - takefraction(deltay[k], st), rr);
  mem[p + 30006].int_ = mem[p + 30002].int_ + takefraction(
	takefraction(deltay[k], ct) + takefraction(deltax[k], st), rr);
  mem[q + 30003].int_ = mem[q + 30001].int_ - takefraction(
	takefraction(deltax[k], cf) + takefraction(deltay[k], sf), ss);
  mem[q + 30004].int_ = mem[q + 30002].int_ - takefraction(
	takefraction(deltay[k], cf) - takefraction(deltax[k], sf), ss);
  mem[p + 30000].hh.UU.U2.b1 = 1;
  mem[q + 30000].hh.UU.U2.b0 = 1;
}  /* setcontrols */

<stdin>, line 5174: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5186: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5187: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5219: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5220: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5239: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5243: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5244: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5246: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5250: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5251: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5255: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5256: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5304: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5305: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5316: Warning: Symbol 'ABS' is not defined [221]


/*:299*/

Static Void solvechoices(p, q, n)
halfword p, q, n;
{
  short k;
  halfword r, s, t;
  fraction cosine;   /*286:*/
  fraction aa, bb, cc, ff, acc;
  scaled dd, ee, lt, rt;   /*:286*/

  k = 0;
  s = p;
  while (true) {
    t = mem[s + 30000].hh.rh;
    if (k == 0) {   /*285:*/
      switch (mem[s + 30000].hh.UU.U2.b1) {

      case 2:
	if (mem[t + 30000].hh.UU.U2.b0 == 2) {  /*301:*/
	  aa = narg(deltax[0], deltay[0]);
	  nsincos(mem[p + 30005].int_ - aa);
	  ct = ncos;
	  st = nsin;
	  nsincos(mem[q + 30003].int_ - aa);
	  cf = ncos;
	  sf = -nsin;
	  setcontrols(p, q, 0L);
	  goto _L10;
	}
	vv[0] = mem[s + 30005].int_ - narg(deltax[0], deltay[0]);
	if (abs(vv[0]) > 188743680L) {
/* p2c: <stdin>, line 5174: Warning: Symbol 'ABS' is not defined [221] */
	  if (vv[0] > 0)
	    vv[0] -= 377487360L;
	  else
	    vv[0] += 377487360L;
	}
	uu[0] = 0;
	ww[0] = 0;
	break;

      case 3:
	if (mem[t + 30000].hh.UU.U2.b0 == 3) {  /*302:*/
	  mem[p + 30000].hh.UU.U2.b1 = 1;
	  mem[q + 30000].hh.UU.U2.b0 = 1;
	  lt = abs(mem[q + 30004].int_);
/* p2c: <stdin>, line 5186: Warning: Symbol 'ABS' is not defined [221] */
	  rt = abs(mem[p + 30006].int_);
/* p2c: <stdin>, line 5187: Warning: Symbol 'ABS' is not defined [221] */
	  if (rt == 65536L) {
	    if (deltax[0] >= 0)
	      mem[p + 30005].int_ = mem[p + 30001].int_ + (deltax[0] + 1) / 3;
	    else
	      mem[p + 30005].int_ = mem[p + 30001].int_ + (deltax[0] - 1) / 3;
	    if (deltay[0] >= 0)
	      mem[p + 30006].int_ = mem[p + 30002].int_ + (deltay[0] + 1) / 3;
	    else
	      mem[p + 30006].int_ = mem[p + 30002].int_ + (deltay[0] - 1) / 3;
	  } else {
	    ff = makefraction(65536L, rt * 3);
	    mem[p + 30005].int_ = mem[p + 30001].int_ + takefraction(deltax[0], ff);
	    mem[p + 30006].int_ = mem[p + 30002].int_ + takefraction(deltay[0], ff);
	  }
	  if (lt == 65536L) {
	    if (deltax[0] >= 0)
	      mem[q + 30003].int_ = mem[q + 30001].int_ - (deltax[0] + 1) / 3;
	    else
	      mem[q + 30003].int_ = mem[q + 30001].int_ - (deltax[0] - 1) / 3;
	    if (deltay[0] >= 0)
	      mem[q + 30004].int_ = mem[q + 30002].int_ - (deltay[0] + 1) / 3;
	    else
	      mem[q + 30004].int_ = mem[q + 30002].int_ - (deltay[0] - 1) / 3;
	  } else {
	    ff = makefraction(65536L, lt * 3);
	    mem[q + 30003].int_ = mem[q + 30001].int_ - takefraction(deltax[0], ff);
	    mem[q + 30004].int_ = mem[q + 30002].int_ - takefraction(deltay[0], ff);
	  }
	  goto _L10;
	}
	cc = mem[s + 30005].int_;
	lt = abs(mem[t + 30004].int_);
/* p2c: <stdin>, line 5219: Warning: Symbol 'ABS' is not defined [221] */
	rt = abs(mem[s + 30006].int_);
/* p2c: <stdin>, line 5220: Warning: Symbol 'ABS' is not defined [221] */
	if (rt == 65536L && lt == 65536L)
	  uu[0] = makefraction(cc + cc + 65536L, cc + 131072L);
	else
	  uu[0] = curlratio(cc, rt, lt);
	vv[0] = -takefraction(psi[0], uu[0]);
	ww[0] = 0;
	break;

      case 4:
	uu[0] = 0;
	vv[0] = 0;
	ww[0] = 268435456L;
	break;
      }/*:285*/
    } else {
      switch (mem[s + 30000].hh.UU.U2.b0) {   /*:292*/

      case 5:
      case 4:   /*287:*/
	if (abs(mem[r + 30006].int_) == 65536L) {
/* p2c: <stdin>, line 5239: Warning: Symbol 'ABS' is not defined [221] */
	  aa = 134217728L;
	  dd = delta[k] * 2;
	} else {
	  aa = makefraction(65536L, abs(mem[r + 30006].int_) * 3 - 65536L);
/* p2c: <stdin>, line 5243: Warning: Symbol 'ABS' is not defined [221] */
	  dd = takefraction(delta[k],
	      805306368L - makefraction(65536L, abs(mem[r + 30006].int_)));
/* p2c: <stdin>, line 5244: Warning: Symbol 'ABS' is not defined [221] */
	}
	if (abs(mem[t + 30004].int_) == 65536L) {
/* p2c: <stdin>, line 5246: Warning: Symbol 'ABS' is not defined [221] */
	  bb = 134217728L;
	  ee = delta[k - 1] * 2;
	} else {
	  bb = makefraction(65536L, abs(mem[t + 30004].int_) * 3 - 65536L);
/* p2c: <stdin>, line 5250: Warning: Symbol 'ABS' is not defined [221] */
	  ee = takefraction(delta[k - 1],
	      805306368L - makefraction(65536L, abs(mem[t + 30004].int_)));
/* p2c: <stdin>, line 5251: Warning: Symbol 'ABS' is not defined [221] */
	}
	cc = 268435456L - takefraction(uu[k - 1], aa);   /*:288*/
	/*289:*/
	dd = takefraction(dd, cc);
	lt = abs(mem[s + 30004].int_);
/* p2c: <stdin>, line 5255: Warning: Symbol 'ABS' is not defined [221] */
	rt = abs(mem[s + 30006].int_);
/* p2c: <stdin>, line 5256: Warning: Symbol 'ABS' is not defined [221] */
	if (lt, makechoices, smoothmoves, initedges, fixoffset, edgeprep != rt) {
	  if (lt < rt) {
	    ff = makefraction(lt, rt);
	    ff = takefraction(ff, ff);
	    dd = takefraction(dd, ff);
	  } else {
	    ff = makefraction(rt, lt);
	    ff = takefraction(ff, ff);
	    ee = takefraction(ee, ff);
	  }
	}
	ff = makefraction(ee, ee + dd);   /*:289*/
	uu[k] = takefraction(ff, bb);   /*290:*/
	acc = -takefraction(psi[k], uu[k]);
	if (mem[r + 30000].hh.UU.U2.b1 == 3) {
	  ww[k] = 0;
	  vv[k] = acc - takefraction(psi[0], 268435456L - ff);
	} else {   /*:290*/
	  ff = makefraction(268435456L - ff, cc);
	  acc -= takefraction(psi[k - 1], ff);
	  ff = takefraction(ff, aa);
	  vv[k] = acc - takefraction(vv[k - 1], ff);
	  if (ww[k - 1] == 0)
	    ww[k] = 0;
	  else
	    ww[k] = -takefraction(ww[k - 1], ff);
	}
	if (mem[s + 30000].hh.UU.U2.b0 == 5) {  /*291:*/
	  aa = 0;
	  bb = 268435456L;
	  do {
	    k--;
	    if (k == 0)
	      k = n;
	    aa = vv[k] - takefraction(aa, uu[k]);
	    bb = ww[k] - takefraction(bb, uu[k]);
	  } while (k != n);
	  aa = makefraction(aa, 268435456L - bb);
	  theta[n] = aa;
	  vv[0] = aa;
	  for (k = 1; k < n; k++)
	    vv[k] += takefraction(aa, ww[k]);
	  goto _L40;
	}  /*:291*/
	break;
	/*288:*/
	/*:287*/

      case 3:  /*295:*/
	cc = mem[s + 30003].int_;
	lt = abs(mem[s + 30004].int_);
/* p2c: <stdin>, line 5304: Warning: Symbol 'ABS' is not defined [221] */
	rt = abs(mem[r + 30006].int_);
/* p2c: <stdin>, line 5305: Warning: Symbol 'ABS' is not defined [221] */
	if (rt == 65536L && lt == 65536L)
	  ff = makefraction(cc + cc + 65536L, cc + 131072L);
	else
	  ff = curlratio(cc, lt, rt);
	theta[n] = -makefraction(takefraction(vv[n - 1], ff),
				 268435456L - takefraction(ff, uu[n - 1]));
	goto _L40;
	break;
	/*:295*/

      case 2:  /*292:*/
	theta[n] = mem[s + 30003].int_ - narg(deltax[n - 1], deltay[n - 1]);
	if (abs(theta[n]) > 188743680L) {
/* p2c: <stdin>, line 5316: Warning: Symbol 'ABS' is not defined [221] */
	  if (theta[n] > 0)
	    theta[n] -= 377487360L;
	  else
	    theta[n] += 377487360L;
	}
	goto _L40;
	break;
      }
    }
    r = s;
    s = t;
    k++;
  }
_L40:   /*297:*/
  for (k = n - 1; k >= 0; k--)
    theta[k] = vv[k] - takefraction(theta[k + 1], uu[k]);
  s = p;
  k = 0;
  do {
    t = mem[s + 30000].hh.rh;
    nsincos(theta[k]);
    st = nsin;
    ct = ncos;
    nsincos(-psi[k] - theta[k + 1]);
    sf = nsin;
    cf = ncos;
    setcontrols(s, t, (long)k);
    k++;
    s = t;   /*:297*/
  } while (k != n);
_L10: ;


  /*:301*/
  /*293:*/
  /*:293*/
  /*:302*/
  /*294:*/
  /*:294*/
}  /*:284*/


Static Void makechoices(knots)
halfword knots;
{
  halfword h, p, q;   /*280:*/
  short k, n;
  halfword s, t;
  scaled delx, dely;
  fraction sine, cosine;   /*:280*/

  if (aritherror)
    cleararith();
  if (internal[3] > 0)   /*271:*/
    printpath(knots, 393, true);
  p = knots;
  do {
    q = mem[p + 30000].hh.rh;
    if (mem[p + 30001].int_ == mem[q + 30001].int_) {
      if (mem[p + 30002].int_ == mem[q + 30002].int_) {
	if (mem[p + 30000].hh.UU.U2.b1 > 1) {
	  mem[p + 30000].hh.UU.U2.b1 = 1;
	  if (mem[p + 30000].hh.UU.U2.b0 == 4) {
	    mem[p + 30000].hh.UU.U2.b0 = 3;
	    mem[p + 30003].int_ = 65536L;
	  }
	  mem[q + 30000].hh.UU.U2.b0 = 1;
	  if (mem[q + 30000].hh.UU.U2.b1 == 4) {
	    mem[q + 30000].hh.UU.U2.b1 = 3;
	    mem[q + 30005].int_ = 65536L;
	  }
	  mem[p + 30005].int_ = mem[p + 30001].int_;
	  mem[q + 30003].int_ = mem[p + 30001].int_;
	  mem[p + 30006].int_ = mem[p + 30002].int_;
	  mem[q + 30004].int_ = mem[p + 30002].int_;
	}
      }
    }
    p = q;   /*:271*/
  } while (p != knots);   /*272:*/
  h = knots;
  while (true) {
    if (mem[h + 30000].hh.UU.U2.b0 != 4)
      goto _L30;
    if (mem[h + 30000].hh.UU.U2.b1 != 4)
      goto _L30;
    h = mem[h + 30000].hh.rh;
    if (h == knots) {
      mem[h + 30000].hh.UU.U2.b0 = 5;
      goto _L30;
    }
  }
_L30:   /*:272*/
  p = h;   /*273:*/
  do {
    q = mem[p + 30000].hh.rh;
    if (mem[p + 30000].hh.UU.U2.b1 >= 2) {
      while (mem[q + 30000].hh.UU.U2.b0 == 4 &&
	     mem[q + 30000].hh.UU.U2.b1 == 4)
	    /*278:*/
	      q = mem[q + 30000].hh.rh;
      /*281:*/
      k = 0;
      s = p;
      n = pathsize;
      do {
	t = mem[s + 30000].hh.rh;
	deltax[k] = mem[t + 30001].int_ - mem[s + 30001].int_;
	deltay[k] = mem[t + 30002].int_ - mem[s + 30002].int_;
	delta[k] = pythadd(deltax[k], deltay[k]);
	if (k > 0) {
	  sine = makefraction(deltay[k - 1], delta[k - 1]);
	  cosine = makefraction(deltax[k - 1], delta[k - 1]);
	  psi[k - 1] = narg(
	      takefraction(deltax[k], cosine) + takefraction(deltay[k], sine),
	      takefraction(deltay[k], cosine) - takefraction(deltax[k], sine));
	}
	k++;
	s = t;
	if (k == pathsize)
	  overflow(398, (long)pathsize);
	if (s == q)
	  n = k;
      } while (k < n || mem[s + 30000].hh.UU.U2.b0 == 5);
      if (k == n)   /*282:*/
	psi[n - 1] = 0;
      else
	psi[k - 1] = psi[0];   /*:281*/
      if (mem[q + 30000].hh.UU.U2.b0 == 4) {
	delx = mem[q + 30005].int_ - mem[q + 30001].int_;
	dely = mem[q + 30006].int_ - mem[q + 30002].int_;
	if (delx == 0 && dely == 0) {
	  mem[q + 30000].hh.UU.U2.b0 = 3;
	  mem[q + 30003].int_ = 65536L;
	} else {
	  mem[q + 30000].hh.UU.U2.b0 = 2;
	  mem[q + 30003].int_ = narg(delx, dely);
	}
      }
      if (mem[p + 30000].hh.UU.U2.b1 == 4 && mem[p + 30000].hh.UU.U2.b0 == 1)
      {   /*:282*/
	delx = mem[p + 30001].int_ - mem[p + 30003].int_;
	dely = mem[p + 30002].int_ - mem[p + 30004].int_;
	if (delx == 0 && dely == 0) {
	  mem[p + 30000].hh.UU.U2.b1 = 3;
	  mem[p + 30005].int_ = 65536L;
	} else {
	  mem[p + 30000].hh.UU.U2.b1 = 2;
	  mem[p + 30005].int_ = narg(delx, dely);
	}
      }
      /*:278*/
      solvechoices(p, q, n);
    }
    p = q;   /*:273*/
  } while (p != h);
  if (internal[3] > 0)
    printpath(knots, 394, true);
  if (!aritherror) {  /*270:*/
    return;
  }  /*:270*/
  printnl(133);
  print(395L);
  helpptr = 2;
  helpline[1] = 396;
  helpline[0] = 397;
  putgeterror();
  aritherror = false;
}

<stdin>, line 5495: Warning: Symbol 'ABS' is not defined [221]


/*:269*/
/*311:*/

/*-------------------------------------------------------------------
procedure makemoves(xx0, xx1, xx2, xx3, yy0, yy1, yy2, yy3: scaled; xicorr, etacorr: smallnumber);

moved to mf2ps3.p
-------------------------------------------------------------------*/

Static Void smoothmoves(b, t)
long b, t;
{
  short k;
  long a, aa, aaa;

  if (t - b < 3)
    return;
  k = b + 2;
  aa = move[k - 1];
  aaa = move[k - 2];
  do {
    a = move[k];
    if (abs(a - aa) > 1) {   /*322:*/
      if (a > aa) {
	if (aaa >= aa) {
	  if (a >= move[k + 1]) {
	    move[k - 1]++;
	    move[k] = a - 1;
	  }
	}
      } else {   /*:322*/
	if (aaa <= aa) {
	  if (a <= move[k + 1]) {
	    move[k - 1]--;
	    move[k] = a + 1;
	  }
	}
      }
    }
/* p2c: <stdin>, line 5495: Warning: Symbol 'ABS' is not defined [221] */
    k++;
    aaa = aa;
    aa = a;
  } while (k != t);
}


/*:321*/
/*326:*/

Static Void initedges(h)
halfword h;
{
  mem[h + 30000].hh.UU.lh = h;
  mem[h + 30000].hh.rh = h;
  mem[h + 30001].hh.UU.lh = 8191;
  mem[h + 30001].hh.rh = 1;
  mem[h + 30002].hh.UU.lh = 8191;
  mem[h + 30002].hh.rh = 1;
  mem[h + 30003].hh.UU.lh = 4096;
  mem[h + 30003].hh.rh = 0;
  mem[h + 30004].int_ = 0;
  mem[h + 30005].hh.rh = h;
  mem[h + 30005].hh.UU.lh = 0;
}


/*:326*/
/*328:*/

Static Void fixoffset()
{
  halfword p, q;
  long delta;

  delta = (mem[curedges + 30003].hh.UU.lh - 4096) * 8;
  mem[curedges + 30003].hh.UU.lh = 4096;
  q = mem[curedges + 30000].hh.rh;
  while (q != curedges) {
    p = mem[q + 30001].hh.rh;
    while (p != 30000) {
      mem[p + 30000].hh.UU.lh -= delta;
      p = mem[p + 30000].hh.rh;
    }
    p = mem[q + 30001].hh.UU.lh;
    while (p > -29999) {
      mem[p + 30000].hh.UU.lh -= delta;
      p = mem[p + 30000].hh.rh;
    }
    q = mem[q + 30000].hh.rh;
  }
}

<stdin>, line 5567: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 5567: Warning: Symbol 'ABS' is not defined [221]


/*:328*/
/*329:*/

Static Void edgeprep(ml, mr, nl, nr)
long ml, mr, nl, nr;
{
  halfword delta, p, q;

  ml += 4096;
  mr += 4096;
  nl += 4096;
  nr += 4095;
  if (ml < mem[curedges + 30002].hh.UU.lh)
    mem[curedges + 30002].hh.UU.lh = ml;
  if (mr , copyedges, yreflectedges, xreflectedges, yscaleedges, xscaleedges,
negateedges> mem[curedges + 30002].hh.rh)
    mem[curedges + 30002].hh.rh = mr;
  if (abs(mem[curedges + 30002].hh.UU.lh + mem[curedges + 30003].hh.UU.lh - 8192) >=
      4096 ||
      abs(mem[curedges + 30002].hh.rh + mem[curedges + 30003].hh.UU.lh - 8192) >=
      4096) {
/* p2c: <stdin>, line 5567: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 5567: Warning: Symbol 'ABS' is not defined [221] */
    fixoffset();
  }
  if (mem[curedges + 30000].hh.rh == curedges) {
    mem[curedges + 30001].hh.UU.lh = nr + 1;
    mem[curedges + 30001].hh.rh = nr;
  }
  if (nl < mem[curedges + 30001].hh.UU.lh)   /*:330*/
  {  /*330:*/
    delta = mem[curedges + 30001].hh.UU.lh - nl;
    mem[curedges + 30001].hh.UU.lh = nl;
    p = mem[curedges + 30000].hh.rh;
    do {
      q = getnode(2L);
      mem[q + 30001].hh.rh = 30000;
      mem[q + 30001].hh.UU.lh = -29999;
      mem[p + 30000].hh.UU.lh = q;
      mem[q + 30000].hh.rh = p;
      p = q;
      delta--;
    } while (delta != 0);
    mem[p + 30000].hh.UU.lh = curedges;
    mem[curedges + 30000].hh.rh = p;
    if (mem[curedges + 30005].hh.rh == curedges)
      mem[curedges + 30005].hh.UU.lh = nl - 1;
  }
  if (nr <= mem[curedges + 30001].hh.rh) {  /*331:*/
    return;
  }  /*:331*/
  delta = nr - mem[curedges + 30001].hh.rh;
  mem[curedges + 30001].hh.rh = nr;
  p = mem[curedges + 30000].hh.UU.lh;
  do {
    q = getnode(2L);
    mem[q + 30001].hh.rh = 30000;
    mem[q + 30001].hh.UU.lh = -29999;
    mem[p + 30000].hh.rh = q;
    mem[q + 30000].hh.UU.lh = p;
    p = q;
    delta--;
  } while (delta != 0);
  mem[p + 30000].hh.rh = curedges;
  mem[curedges + 30000].hh.UU.lh = p;
  if (mem[curedges + 30005].hh.rh == curedges)
    mem[curedges + 30005].hh.UU.lh = nr + 1;
}


/*:329*/
/*334:*/

Static halfword copyedges(h)
halfword h;
{
  halfword p, r, hh, pp, qq, rr, ss;

  hh = getnode(6L);
  mem[hh + 30001] = mem[h + 30001];
  mem[hh + 30002] = mem[h + 30002];
  mem[hh + 30003] = mem[h + 30003];
  mem[hh + 30004] = mem[h + 30004];
  mem[hh + 30005].hh.UU.lh = mem[hh + 30001].hh.rh + 1;
  mem[hh + 30005].hh.rh = hh;
  p = mem[h + 30000].hh.rh;
  qq = hh;
  while (p != h) {
    pp = getnode(2L);
    mem[qq + 30000].hh.rh = pp;
    mem[pp + 30000].hh.UU.lh = qq;
    /*335:*/
    r = mem[p + 30001].hh.rh;
    rr = pp + 1;
    while (r != 30000) {
      ss = getavail();
      mem[rr + 30000].hh.rh = ss;
      rr = ss;
      mem[rr + 30000].hh.UU.lh = mem[r + 30000].hh.UU.lh;
      r = mem[r + 30000].hh.rh;
    }
    mem[rr + 30000].hh.rh = 30000;
    r = mem[p + 30001].hh.UU.lh;
    rr = 29999;
    while (r > -29999) {
      ss = getavail();
      mem[rr + 30000].hh.rh = ss;
      rr = ss;
      mem[rr + 30000].hh.UU.lh = mem[r + 30000].hh.UU.lh;
      r = mem[r + 30000].hh.rh;
    }
    mem[rr + 30000].hh.rh = r;
    mem[pp + 30001].hh.UU.lh = mem[59999].hh.rh;   /*:335*/
    p = mem[p + 30000].hh.rh;
    qq = pp;
  }
  mem[qq + 30000].hh.rh = hh;
  mem[hh + 30000].hh.UU.lh = qq;
  return hh;
}


/*:334*/
/*336:*/

Static Void yreflectedges()
{
  halfword p, q, r;

  p = mem[curedges + 30001].hh.UU.lh;
  mem[curedges + 30001].hh.UU.lh = 8191 - mem[curedges + 30001].hh.rh;
  mem[curedges + 30001].hh.rh = 8191 - p;
  mem[curedges + 30005].hh.UU.lh = 8191 - mem[curedges + 30005].hh.UU.lh;
  p = mem[curedges + 30000].hh.rh;
  q = curedges;
  do {
    r = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.rh = q;
    mem[q + 30000].hh.UU.lh = p;
    q = p;
    p = r;
  } while (q != curedges);
  mem[curedges + 30004].int_ = 0;
}


/*:336*/
/*337:*/

Static Void xreflectedges()
{
  halfword p, q, r, s;
  long m;

  p = mem[curedges + 30002].hh.UU.lh;
  mem[curedges + 30002].hh.UU.lh = 8192 - mem[curedges + 30002].hh.rh;
  mem[curedges + 30002].hh.rh = 8192 - p;
  m = (mem[curedges + 30003].hh.UU.lh + 4096) * 8 - 65528L;
  mem[curedges + 30003].hh.UU.lh = 4096;
  p = mem[curedges + 30000].hh.rh;   /*339:*/
  do {
    q = mem[p + 30001].hh.rh;
    r = 30000;
    while (q != 30000) {
      s = mem[q + 30000].hh.rh;
      mem[q + 30000].hh.rh = r;
      r = q;
      mem[r + 30000].hh.UU.lh = m - mem[q + 30000].hh.UU.lh;
      q = s;
    }
    mem[p + 30001].hh.rh = r;   /*:339*/
    /*338:*/
    q = mem[p + 30001].hh.UU.lh;
    while (q > -29999) {   /*:338*/
      mem[q + 30000].hh.UU.lh = m - mem[q + 30000].hh.UU.lh;
      q = mem[q + 30000].hh.rh;
    }
    p = mem[p + 30000].hh.rh;
  } while (p != curedges);
  mem[curedges + 30004].int_ = 0;
}  /* xreflectedges */


/*:337*/
/*340:*/

Static Void yscaleedges(s)
long s;
{
  halfword p, q, pp, r, rr, ss;
  long t;

  if (s * (mem[curedges + 30001].hh.rh - 4095) >= 4096 ||
      s * (mem[curedges + 30001].hh.UU.lh - 4096) <= -4096) {
    printnl(133);
    print(402L);
    helpptr = 3;
    helpline[2] = 403;
    helpline[1] = 404;
    helpline[0] = 405;
    putgeterror();
    return;
  }
  mem[curedges + 30001].hh.rh = s * (mem[curedges + 30001].hh.rh - 4095) + 4095;
  mem[curedges + 30001].hh.UU.lh =
    s * (mem[curedges + 30001].hh.UU.lh - 4096) + 4096;
      /*341:*/
  p = curedges;
  do {
    q = p;
    p = mem[p + 30000].hh.rh;
    for (t = 2; t <= s; t++) {   /*:341*/
      pp = getnode(2L);
      mem[q + 30000].hh.rh = pp;
      mem[p + 30000].hh.UU.lh = pp;
      mem[pp + 30000].hh.rh = p;
      mem[pp + 30000].hh.UU.lh = q;
      q = pp;   /*335:*/
      r = mem[p + 30001].hh.rh;
      rr = pp + 1;
      while (r != 30000) {
	ss = getavail();
	mem[rr + 30000].hh.rh = ss;
	rr = ss;
	mem[rr + 30000].hh.UU.lh = mem[r + 30000].hh.UU.lh;
	r = mem[r + 30000].hh.rh;
      }
      mem[rr + 30000].hh.rh = 30000;
      r = mem[p + 30001].hh.UU.lh;
      rr = 29999;
      while (r > -29999) {
	ss = getavail();
	mem[rr + 30000].hh.rh = ss;
	rr = ss;
	mem[rr + 30000].hh.UU.lh = mem[r + 30000].hh.UU.lh;
	r = mem[r + 30000].hh.rh;
      }
      mem[rr + 30000].hh.rh = r;
      mem[pp + 30001].hh.UU.lh = mem[59999].hh.rh;   /*:335*/
    }
  } while (mem[p + 30000].hh.rh != curedges);
  mem[curedges + 30004].int_ = 0;
}  /*:340*/


/*342:*/

Static Void xscaleedges(s)
long s;
{
  halfword p, q;
  unsigned short t;
  char w;
  long delta;

  if (s * (mem[curedges + 30002].hh.rh - 4096) >= 4096 ||
      s * (mem[curedges + 30002].hh.UU.lh - 4096) <= -4096) {
    printnl(133);
    print(402L);
    helpptr = 3;
    helpline[2] = 406;
    helpline[1] = 404;
    helpline[0] = 405;
    putgeterror();
    return;
  }
  if (mem[curedges + 30002].hh.rh == 4096 &&
      mem[curedges + 30002].hh.UU.lh == 4096)
    return;
  mem[curedges + 30002].hh.rh = s * (mem[curedges + 30002].hh.rh - 4096) + 4096;
  mem[curedges + 30002].hh.UU.lh =
    s * (mem[curedges + 30002].hh.UU.lh - 4096) + 4096;
  delta = (4096 - s * mem[curedges + 30003].hh.UU.lh) * 8 - 32768L;
  mem[curedges + 30003].hh.UU.lh = 4096;   /*343:*/
  q = mem[curedges + 30000].hh.rh;
  do {
    p = mem[q + 30001].hh.rh;
    while (p != 30000) {
      t = mem[p + 30000].hh.UU.lh + 32768L;
      w = t & 7;
      mem[p + 30000].hh.UU.lh = (t - w) * s + w + delta;
      p = mem[p + 30000].hh.rh;
    }
    p = mem[q + 30001].hh.UU.lh;
    while (p > -29999) {
      t = mem[p + 30000].hh.UU.lh + 32768L;
      w = t & 7;
      mem[p + 30000].hh.UU.lh = (t - w) * s + w + delta;
      p = mem[p + 30000].hh.rh;
    }
    q = mem[q + 30000].hh.rh;   /*:343*/
  } while (q != curedges);
  mem[curedges + 30004].int_ = 0;
}  /* xscaleedges */


/*:342*/
/*344:*/

Static Void negateedges(h)
halfword h;
{
  halfword p, q, r, s, t, u;

  p = mem[h + 30000].hh.rh;
  while (p != h) {
    q = mem[p + 30001].hh.UU.lh;
    while (q > -29999) {
      mem[q + 30000].hh.UU.lh += 8 - ((mem[q + 30000].hh.UU.lh + 32768L) & 7) * 2;
      q = mem[q + 30000].hh.rh;
    }
    q = mem[p + 30001].hh.rh;
    if (q != 30000) {
      do {
	mem[q + 30000].hh.UU.lh += 8 - ((mem[q + 30000].hh.UU.lh + 32768L) & 7) * 2;
	q = mem[q + 30000].hh.rh;
      } while (q != 30000);   /*345:*/
      u = p + 1;
      q = mem[u + 30000].hh.rh;
      r = q;
      s = mem[r + 30000].hh.rh;
      while (true) {
	if (mem[s + 30000].hh.UU.lh <= mem[r + 30000].hh.UU.lh) {
	  t = s;
	  s = mem[t + 30000].hh.rh;
	  mem[t + 30000].hh.rh = q;
	  q = t;
	  continue;
	}
	mem[u + 30000]., sortedges, culledges, xyswapedges, mergeedgeshh.rh = q;
	if (s == 30000)
	  goto _L30;
	u = r;
	q = s;
	r = q;
	s = mem[r + 30000].hh.rh;
      }
_L30:
      mem[r + 30000].hh.rh = 30000;   /*:345*/
    }
    p = mem[p + 30000].hh.rh;
  }
  mem[h + 30004].int_ = 0;
}


/*:344*/
/*346:*/

Static Void sortedges(h)
halfword h;
{
  halfword k, p, q, r, s;

  r = mem[h + 30001].hh.UU.lh;
  mem[h + 30001].hh.UU.lh = -30000;
  p = mem[r + 30000].hh.rh;
  mem[r + 30000].hh.rh = 30000;
  mem[59999].hh.rh = r;
  while (p > -29999) {
    k = mem[p + 30000].hh.UU.lh;
    q = 29999;
    do {
      r = q;
      q = mem[r + 30000].hh.rh;
    } while (k > mem[q + 30000].hh.UU.lh);
    mem[r + 30000].hh.rh = p;
    r = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.rh = q;
    p = r;
  }  /*347:*/
  r = h + 1;
  q = mem[r + 30000].hh.rh;
  p = mem[59999].hh.rh;
  while (true) {
    k = mem[p + 30000].hh.UU.lh;
    while (k > mem[q + 30000].hh.UU.lh) {
      r = q;
      q = mem[r + 30000].hh.rh;
    }
    mem[r + 30000].hh.rh = p;
    s = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.rh = q;
    if (s == 30000)
      goto _L30;
    r = p;
    p = s;
  }
_L30: ;   /*:347*/

}


/*:346*/
/*348:*/

Static Void culledges(wlo, whi, wout, win)
long wlo, whi, wout, win;
{
  halfword p, q, r, s;
  long w, d, m, mm, ww, prevw;
  halfword n, minn, maxn, mind, maxd;

  mind = 32767;
  maxd = -32768L;
  minn = 32767;
  maxn = -32768L;
  p = mem[curedges + 30000].hh.rh;
  n = mem[curedges + 30001].hh.UU.lh;
  while (p != curedges) {
    if (mem[p + 30001].hh.UU.lh > -29999)
      sortedges(p);
    if (mem[p + 30001].hh.rh != 30000)   /*:349*/
    {  /*349:*/
      r = 29999;
      q = mem[p + 30001].hh.rh;
      ww = 0;
      m = 1000000L;
      prevw = 0;
      while (true) {
	if (q == 30000)
	  mm = 1000000L;
	else {
	  d = mem[q + 30000].hh.UU.lh + 32768L;
	  mm = d / 8;
	  ww += (d & 7) - 4;
	}
	if (mm > m) {  /*350:*/
	  if (w != prevw) {   /*:350*/
	    s = getavail();
	    mem[r + 30000].hh.rh = s;
	    mem[s + 30000].hh.UU.lh = m * 8 + w - prevw - 32764;
	    r = s;
	    prevw = w;
	  }
	  if (q == 30000)
	    goto _L30;
	}
	m = mm;
	if (ww >= wlo) {
	  if (ww <= whi)
	    w = win;
	  else
	    w = wout;
	} else
	  w = wout;
	s = mem[q + 30000].hh.rh;
	mem[q + 30000].hh.rh = avail;
	avail = q;   /*dynused:=dynused-1;*/
	q = s;
      }
_L30:
      mem[r + 30000].hh.rh = 30000;
      mem[p + 30001].hh.rh = mem[59999].hh.rh;
      if (r != 29999) {  /*351:*/
	if (minn == 32767)
	  minn = n;
	maxn = n;
	if (mind > mem[mem[59999].hh.rh + 30000].hh.UU.lh)
	  mind = mem[mem[59999].hh.rh + 30000].hh.UU.lh;
	if (maxd < mem[r + 30000].hh.UU.lh)
	  maxd = mem[r + 30000].hh.UU.lh;
      }  /*:351*/
    }
    p = mem[p + 30000].hh.rh;
    n++;
  }  /*352:*/
  if (minn > maxn) {  /*353:*/
    p = mem[curedges + 30000].hh.rh;
    while (p != curedges) {
      q = mem[p + 30000].hh.rh;
      freenode(p, 2);
      p = q;
    }
    initedges(curedges);
  } else   /*:352*/
  {  /*:353*/
    n = mem[curedges + 30001].hh.UU.lh;
    mem[curedges + 30001].hh.UU.lh = minn;
    while (minn > n) {
      p = mem[curedges + 30000].hh.rh;
      mem[curedges + 30000].hh.rh = mem[p + 30000].hh.rh;
      mem[mem[p + 30000].hh.rh + 30000].hh.UU.lh = curedges;
      freenode(p, 2);
      n++;
    }
    n = mem[curedges + 30001].hh.rh;
    mem[curedges + 30001].hh.rh = maxn;
    mem[curedges + 30005].hh.UU.lh = maxn + 1;
    mem[curedges + 30005].hh.rh = curedges;
    while (maxn < n) {
      p = mem[curedges + 30000].hh.UU.lh;
      mem[curedges + 30000].hh.UU.lh = mem[p + 30000].hh.UU.lh;
      mem[mem[p + 30000].hh.UU.lh + 30000].hh.rh = curedges;
      freenode(p, 2);
      n--;
    }
    mem[curedges + 30002].hh.UU.lh =
      (mind + 32768L) / 8 - mem[curedges + 30003].hh.UU.lh + 4096;
    mem[curedges + 30002].hh.rh =
      (maxd + 32768L) / 8 - mem[curedges + 30003].hh.UU.lh + 4096;
  }
  mem[curedges + 30004].int_ = 0;
}

<stdin>, line 6086: Warning: Symbol 'ABS' is not defined [221]


/*:348*/
/*354:*/

Static Void xyswapedges()
{   /*:363*/
  long mmagic, nmagic;
  halfword p, q, r, s;   /*357:*/
  long mspread;
  short j, jj;
  long m, mm, pd, rd, pm, rm, w, ww, dw;
  /*:357*/
  /*363:*/
  long extras;
  short xw;
  long k;

  /*356:*/
  mspread = mem[curedges + 30002].hh.rh - mem[curedges + 30002].hh.UU.lh;
  if (mspread > movesize)
    overflow(407, (long)movesize);
  for (j = 0; j <= mspread; j++)   /*355:*/
    move[j] = 30000;   /*:356*/
  p = getnode(2L);
  mem[p + 30001].hh.rh = 30000;
  mem[p + 30001].hh.UU.lh = -30000;
  mem[p + 30000].hh.UU.lh = curedges;
  mem[mem[curedges + 30000].hh.rh + 30000].hh.UU.lh = p;
  p = getnode(2L);
  mem[p + 30001].hh.rh = 30000;
  mem[p + 30000].hh.UU.lh = mem[curedges + 30000].hh.UU.lh;   /*:355*/
  /*365:*/
  mmagic = mem[curedges + 30002].hh.UU.lh + mem[curedges + 30003].hh.UU.lh - 4096;
  nmagic = mem[curedges + 30001].hh.rh * 8 - 32756;   /*:365*/
  do {
    q = mem[p + 30000].hh.UU.lh;
    if (mem[q + 30001].hh.UU.lh > -29999)   /*358:*/
      sortedges(q);
    r = mem[p + 30001].hh.rh;
    freenode(p, 2);
    p = r;
    pd = mem[p + 30000].hh.UU.lh + 32768L;
    pm = pd / 8;
    r = mem[q + 30001].hh.rh;
    rd = mem[r + 30000].hh.UU.lh + 32768L;
    rm = rd / 8;
    w = 0;
    while (true) {
      if (pm < rm)
	mm = pm;
      else
	mm = rm;
      if (w != 0) {   /*362:*/
	if (m != mm) {   /*:362*/
	  if (mm - mmagic >= movesize)
	    confusion(377);
	  extras = (abs(w) - 1) / 3;
/* p2c: <stdin>, line 6086: Warning: Symbol 'ABS' is not defined [221] */
	  if (extras > 0) {
	    if (w > 0)
	      xw = 3;
	    else
	      xw = -3;
	    ww = w - extras * xw;
	  } else
	    ww = w;
	  do {
	    j = m - mmagic;
	    for (k = 1; k <= extras; k++) {
	      s = getavail();
	      mem[s + 30000].hh.UU.lh = nmagic + xw;
	      mem[s + 30000].hh.rh = move[j];
	      move[j] = s;
	    }
	    s = getavail();
	    mem[s + 30000].hh.UU.lh = nmagic + ww;
	    mem[s + 30000].hh.rh = move[j];
	    move[j] = s;
	    m++;
	  } while (m != mm);
	}
      }
      if (pd < rd) {
	dw = (pd & 7) - 4;   /*360:*/
	s = mem[p + 30000].hh.rh;
	mem[p + 30000].hh.rh = avail;
	avail = p;   /*dynused:=dynused-1;*/
	p = s;
	pd = mem[p + 30000].hh.UU.lh + 32768L;
	pm = pd / 8;   /*:360*/
      } else {
	if (r == 30000)
	  goto _L30;
	dw = 4 - (rd & 7);   /*359:*/
	r = mem[r + 30000].hh.rh;
	rd = mem[r + 30000].hh.UU.lh + 32768L;
	rm = rd / 8;   /*:359*/
      }
      m = mm;
      w += dw;
    }
_L30:   /*:358*/
    p = q;
    nmagic -= 8;
  } while (mem[p + 30000].hh.UU.lh != curedges);
  freenode(p, 2);   /*364:*/
  move[mspread] = 0;
  j = 0;
  while (move[j] == 30000)
    j++;
  if (j == mspread) {
    initedges(curedges);
    return;
  }
  mm = mem[curedges + 30002].hh.UU.lh;
  mem[curedges + 30002].hh.UU.lh = mem[curedges + 30001].hh.UU.lh;
  mem[curedges + 30002].hh.rh = mem[curedges + 30001].hh.rh + 1;
  mem[curedges + 30003].hh.UU.lh = 4096;
  jj = mspread - 1;
  while (move[jj] == 30000)
    jj--;
  mem[curedges + 30001].hh.UU.lh = j + mm;
  mem[curedges + 30001].hh.rh = jj + mm;
  q = curedges;
  do {
    p = getnode(2L);
    mem[q + 30000].hh.rh = p;
    mem[p + 30000].hh.UU.lh = q;
    mem[p + 30001].hh.rh = move[j];
    mem[p + 30001].hh.UU.lh = -30000;
    j++;
    q = p;
  } while (j <= jj);
  mem[q + 30000].hh.rh = curedges;
  mem[curedges + 30000].hh.UU.lh = q;
  mem[curedges + 30005].hh.UU.lh = mem[curedges + 30001].hh.rh + 1;
  mem[curedges + 30005].hh.rh = curedges;
  mem[curedges + 30004].int_ = 0;
}  /*:364*/


/*:354*/
/*366:*/

Static Void mergeedges(h)
halfword h;
{
  halfword p, q, r, pp, qq, rr;
  long n;
  halfword k;
  long delta;

  if (mem[h + 30000].hh.rh == h)
    return;
  if (mem[h + 30002].hh.UU.lh < mem[curedges + 30002].hh.UU.lh ||
      mem[h + 30002].hh.rh > mem[curedges + 30002].hh.rh ||
      mem[h + 30001].hh.UU.lh < mem[curedges + 30001].hh.UU.lh ||
      mem[h + 30001].hh.rh > mem[curedges + 30001].hh.rh)
    edgeprep(mem[h + 30002].hh.UU.lh - 4096L, mem[h + 30002].hh.rh - 4096L,
	     mem[h + 30001].hh.UU.lh - 4096L, mem[h + 30001].hh.rh - 4095L);
  if (mem[h + 30003].hh.UU.lh != mem[curedges + 30003].hh.UU.lh)   /*:367*/
  {  /*367:*/
    pp = mem[h + 30000].hh.rh;
    d, totalweight, beginedgetracing, traceacorner, endedgetracing,
tracenewedge, lineedges, movetoedgeselta = (mem[curedges + 30003].hh.UU.lh - mem[h + 30003].hh.UU.lh) * 8;
    do {
      qq = mem[pp + 30001].hh.rh;
      while (qq != 30000) {
	mem[qq + 30000].hh.UU.lh += delta;
	qq = mem[qq + 30000].hh.rh;
      }
      qq = mem[pp + 30001].hh.UU.lh;
      while (qq > -29999) {
	mem[qq + 30000].hh.UU.lh += delta;
	qq = mem[qq + 30000].hh.rh;
      }
      pp = mem[pp + 30000].hh.rh;
    } while (pp != h);
  }
  n = mem[curedges + 30001].hh.UU.lh;
  p = mem[curedges + 30000].hh.rh;
  pp = mem[h + 30000].hh.rh;
  while (n < mem[h + 30001].hh.UU.lh) {
    n++;
    p = mem[p + 30000].hh.rh;
  }  /*368:*/
  do {
    qq = mem[pp + 30001].hh.UU.lh;
    if (qq > -29999) {
      if (mem[p + 30001].hh.UU.lh <= -29999)
	mem[p + 30001].hh.UU.lh = qq;
      else {
	while (mem[qq + 30000].hh.rh > -29999)
	  qq = mem[qq + 30000].hh.rh;
	mem[qq + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
	mem[p + 30001].hh.UU.lh = mem[pp + 30001].hh.UU.lh;
      }
    }
    mem[pp + 30001].hh.UU.lh = -30000;
    qq = mem[pp + 30001].hh.rh;
    if (qq != 30000) {
      if (mem[p + 30001].hh.UU.lh == -29999)
	mem[p + 30001].hh.UU.lh = -30000;
      mem[pp + 30001].hh.rh = 30000;
      r = p + 1;
      q = mem[r + 30000].hh.rh;
      if (q == 30000)
	mem[p + 30001].hh.rh = qq;
      else {
	while (true) {
	  k = mem[qq + 30000].hh.UU.lh;
	  while (k > mem[q + 30000].hh.UU.lh) {
	    r = q;
	    q = mem[r + 30000].hh.rh;
	  }
	  mem[r + 30000].hh.rh = qq;
	  rr = mem[qq + 30000].hh.rh;
	  mem[qq + 30000].hh.rh = q;
	  if (rr == 30000)
	    goto _L30;
	  r = qq;
	  qq = rr;
	}
      }
    }
_L30:   /*:368*/
    pp = mem[pp + 30000].hh.rh;
    p = mem[p + 30000].hh.rh;
  } while (pp != h);
}


/*:366*/
/*369:*/

Static long totalweight(h)
halfword h;
{
  halfword p, q;
  long n;
  unsigned short m;

  n = 0;
  p = mem[h + 30000].hh.rh;
  while (p != h) {
    q = mem[p + 30001].hh.rh;
    while (q != 30000)   /*:370*/
    {  /*370:*/
      m = mem[q + 30000].hh.UU.lh + 32768L;
      n += (4 - (m & 7)) * (m / 8);
      q = mem[q + 30000].hh.rh;
    }
    q = mem[p + 30001].hh.UU.lh;
    while (q > -29999)   /*:370*/
    {  /*370:*/
      m = mem[q + 30000].hh.UU.lh + 32768L;
      n += (4 - (m & 7)) * (m / 8);
      q = mem[q + 30000].hh.rh;
    }
    p = mem[p + 30000].hh.rh;
  }
  return n;
}  /*:369*/


/*372:*/

Static Void beginedgetracing()
{
  printdiagnostic(408, 155, true);
  print(409L);
  printint(curwt);
  printchar(41);
  tracex = -4096;
}  /* beginedgetracing */


Static Void traceacorner()
{
  if (fileoffset > maxprintline - 13)
    printnl(155);
  printchar(40);
  printint(tracex);
  printchar(44);
  printint(traceyy);
  printchar(41);
  tracey = traceyy;
}


Static Void endedgetracing()
{
  if (tracex == -4096)
    printnl(410);
  else {
    traceacorner();
    printchar(46);
  }
  enddiagnostic(true);
}


/*:372*/
/*373:*/

Static Void tracenewedge(r, n)
halfword r;
long n;
{
  long d;
  short w;
  long m, n0, n1;

  d = mem[r + 30000].hh.UU.lh + 32768L;
  w = (d & 7) - 4;
  m = d / 8 - mem[curedges + 30003].hh.UU.lh;
  if (w == curwt) {
    n0 = n + 1;
    n1 = n;
  } else {
    n0 = n;
    n1 = n + 1;
  }
  if (m != tracex) {
    if (tracex == -4096) {
      printnl(155);
      traceyy = n0;
    } else if (traceyy != n0)
      printchar(63);
    else
      traceacorner();
    tracex = m;
    traceacorner();
  } else {
    if (n0 != traceyy)
      printchar(33);
    if (n0 < n1 && tracey > traceyy || n0 > n1 && tracey < traceyy)
      traceacorner();
  }
  traceyy = n1;
}


/*:373*/
/*374:*/

Static Void lineedges(x0, y0, x1, y1)
long x0, y0, x1, y1;
{
  long m0, n0, m1, n1;
  scaled delx, dely, yt, tx;
  halfword p, r;
  long base, n;

  n0 = roundunscaled(y0);
  n1 = roundunscaled(y1);
  if (n0 == n1)
    return;
  m0 = roundunscaled(x0);
  m1 = roundunscaled(x1);
  delx = x1 - x0;
  dely = y1 - y0;
  yt = n0 * 65536L - 32768L;
  y0 -= yt;
  y1 -= yt;
  if (n0 < n1) {  /*375:*/
    base = mem[curedges + 30003].hh.UU.lh * 8 - curwt - 32764;
    if (m0 <= m1)   /*377:*/
      edgeprep(m0, m1, n0, n1);
    else
      edgeprep(m1, m0, n0, n1);
    n = mem[curedges + 30005].hh.UU.lh - 4096;
    p = mem[curedges + 30005].hh.rh;
    if (n != n0) {
      if (n < n0) {
	do {
	  n++;
	  p = mem[p + 30000].hh.rh;
	} while (n != n0);
      } else {
	do {
	  n--;
	  p = mem[p + 30000].hh.UU.lh;   /*:377*/
	} while (n != n0);
      }
    }
    y0 = 65536L - y0;
    while (true) {
      r = getavail();
      mem[r + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
      mem[p + 30001].hh.UU.lh = r;
      tx = takefraction(delx, makefraction(y0, dely));
      if (abvscd(delx, y0, dely, tx) < 0)
	tx--;
      mem[r + 30000].hh.UU.lh = roundunscaled(x0 + tx) * 8 + base;
      y1 -= 65536L;
      if (internal[9] > 0)
	tracenewedge(r, n);
      if (y1 < 65536L)
	goto _L30;
      p = mem[p + 30000].hh.rh;
      y0 += 65536L;
      n++;
    }
_L30: ;   /*:375*/

  } else {  /*376:*/
    base = mem[curedges + 30003].hh.UU.lh * 8 + curwt - 32764;
    if (m0 <= m1)
      edgeprep(m0, m1, n1, n0);
    else
      edgeprep(m1, m0, n1, n0);
    n0--;
    /*377:*/
    n = mem[curedges + 30005].hh.UU.lh - 4096;
    p = mem[curedges + 30005].hh.rh;
    if (n != n0) {
      if (n < n0) {
	do {
	  n++;
	  p = mem[p + 30000].hh.rh;
	} while (n != n0);
      } else {
	do {
	  n--;
	  p = mem[p + 30000].hh.UU.lh;   /*:377*/
	} while (n != n0);
      }
    }
    while (true) {
      r = getavail();
      mem[r + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
      mem[p + 30001].hh.UU.lh = r;
      tx = takefraction(delx, makefraction(y0, dely));
      if (abvscd(delx, y0, dely, tx) < 0)
	tx++;
      mem[r + 30000].hh.UU.lh = roundunscaled(x0 - tx) * 8 + base;
      y1 += 65536L;
      if (internal[9] > 0)
	tracenewedge(r, n);
      if (y1 >= 0)
	goto _L31;
      p = mem[p + 30000].hh.UU.lh;
      y0 += 65536L;
      n--;
    }
_L31: ;   /*:376*/

  }
  mem[curedges + 30005].hh.rh = p;
  mem[curedges + 30005].hh.UU.lh = n + 4096;
}  /*:374*/


/*378:*/

Static Void movetoedges(m0, n0, m1, n1)
long m0, n0, m1, n1;
{
  short delta;
  short k;
  halfword p, r;
  long dx, edgeandweight, j, n;   /*sum:integer;*/

  /*sum:=move[0];
  for k:=1 to delta do sum:=sum+abs(move[k]);
  if sum<>m1-m0 then confusion(48);*/
  delta = n1 - n0;
  /*380:*/
  switch (octant) {

  case 1:
    dx = 8;
    edgeprep(m0, m1, n0, n1);
    goto _L60;
    break;

  case 5:
    dx = 8;
    edgeprep(n0, n1, m0, m1);
    goto _L62;
    break;

  case 6:
    dx = -8;
    edgeprep(-n1, -n0, m0, m1);
    n0 = -n0;
    goto _L62;
    break;

  case 2:
    dx = -8;
    edgeprep(-m1, -m0, n0, n1);
    m0 = -m0;
    goto _L60;
    break;

  case 4:
    dx = -8;
    edgeprep(-m1, -m0, -n1, -n0);
    m0 = -m0;
    goto _L61;
    break;

  case 8:
    dx = -8;
    edgeprep(-n1, -n0, -m1, -m0);
    n0 = -n0;
    goto _L63;
    break;

  case 7:
    dx = 8;
    edgeprep(n0, n1, -m1, -m0);
    goto _L63;
    break;

  case 3:
    dx = 8;
    edgeprep(m0, m1, -n1, -n0);
    goto _L61;
    break;
  }/*:380*/
_L60:   /*381:*/
  /*377:*/
  n = mem[curedges + 30005].hh.UU.lh - 4096;
  p = mem[curedges + 30005].hh.rh;
  if (n != n0) {
    if (n < n0) {
      do {
	n++;
	p = mem[p + 30000].hh.rh;
      } while (n != n0);
    } else {
      do {
	n--;
	p = mem[p + 30000].hh.UU.lh;   /*:377*/
      } while (n != n0);
    }
  }
  if (delta > 0) {
    k = 0;
    edgeandweight = (m0 + mem[curedges + 30003].hh.UU.lh) * 8 - curwt - 32764;
    do {
      edgeandweight += dx * move[k];
      r = avail;
      if (r == -30000)
	r = getavail();
      else {
	avail = mem[r + 30000].hh.rh;
	mem[r + 30000].hh.rh = -30000;
      }  /*dynused:=dynused+1;*/
      mem[r + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
      mem[r + 30000].hh.UU.lh = edgeandweight;
      if (internal[9] > 0)
	tracenewedge(r, n);
      mem[p + 30001].hh.UU.lh = r;
      p = mem[p + 30000].hh.rh;
      k++;
      n++;
    } while (k != delta);
  }
  goto _L30;   /*:381*/
_L61:   /*382:*/
  n0 = -n0 - 1;   /*377:*/
  n = mem[curedges + 30005].hh.UU.lh - 4096;
  p = mem[curedges + 30005].hh.rh;
  if (n != n0) {
    if (n < n0) {
      do {
	n++;
	p = mem[p + 30000].hh.rh;
      } while (n != n0);
    } else , skew, abnegate, crossingpoint, printspec, printstrange, removecubic, splitcubic{
      do {
	n--;
	p = mem[p + 30000].hh.UU.lh;   /*:377*/
      } while (n != n0);
    }
  }
  if (delta > 0) {
    k = 0;
    edgeandweight = (m0 + mem[curedges + 30003].hh.UU.lh) * 8 + curwt - 32764;
    do {
      edgeandweight += dx * move[k];
      r = avail;
      if (r == -30000)
	r = getavail();
      else {
	avail = mem[r + 30000].hh.rh;
	mem[r + 30000].hh.rh = -30000;
      }  /*dynused:=dynused+1;*/
      mem[r + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
      mem[r + 30000].hh.UU.lh = edgeandweight;
      if (internal[9] > 0)
	tracenewedge(r, n);
      mem[p + 30001].hh.UU.lh = r;
      p = mem[p + 30000].hh.UU.lh;
      k++;
      n--;
    } while (k != delta);
  }
  goto _L30;   /*:382*/
_L62:   /*383:*/
  edgeandweight = (n0 + mem[curedges + 30003].hh.UU.lh) * 8 - curwt - 32764;
  n0 = m0;
  k = 0;
  /*377:*/
  n = mem[curedges + 30005].hh.UU.lh - 4096;
  p = mem[curedges + 30005].hh.rh;
  if (n != n0) {
    if (n < n0) {
      do {
	n++;
	p = mem[p + 30000].hh.rh;
      } while (n != n0);
    } else {
      do {
	n--;
	p = mem[p + 30000].hh.UU.lh;   /*:377*/
      } while (n != n0);
    }
  }
  do {
    j = move[k];
    while (j > 0) {
      r = avail;
      if (r == -30000)
	r = getavail();
      else {
	avail = mem[r + 30000].hh.rh;
	mem[r + 30000].hh.rh = -30000;
      }  /*dynused:=dynused+1;*/
      mem[r + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
      mem[r + 30000].hh.UU.lh = edgeandweight;
      if (internal[9] > 0)
	tracenewedge(r, n);
      mem[p + 30001].hh.UU.lh = r;
      p = mem[p + 30000].hh.rh;
      j--;
      n++;
    }
    edgeandweight += dx;
    k++;
  } while (k <= delta);
  goto _L30;   /*:383*/
_L63:   /*384:*/
  edgeandweight = (n0 + mem[curedges + 30003].hh.UU.lh) * 8 + curwt - 32764;
  n0 = -m0 - 1;
  k = 0;
  /*377:*/
  n = mem[curedges + 30005].hh.UU.lh - 4096;
  p = mem[curedges + 30005].hh.rh;
  if (n != n0) {
    if (n < n0) {
      do {
	n++;
	p = mem[p + 30000].hh.rh;
      } while (n != n0);
    } else {
      do {
	n--;
	p = mem[p + 30000].hh.UU.lh;   /*:377*/
      } while (n != n0);
    }
  }
  do {
    j = move[k];
    while (j > 0) {
      r = avail;
      if (r == -30000)
	r = getavail();
      else {
	avail = mem[r + 30000].hh.rh;
	mem[r + 30000].hh.rh = -30000;
      }  /*dynused:=dynused+1;*/
      mem[r + 30000].hh.rh = mem[p + 30001].hh.UU.lh;
      mem[r + 30000].hh.UU.lh = edgeandweight;
      if (internal[9] > 0)
	tracenewedge(r, n);
      mem[p + 30001].hh.UU.lh = r;
      p = mem[p + 30000].hh.UU.lh;
      j--;
      n--;
    }
    edgeandweight += dx;
    k++;
  } while (k <= delta);
  goto _L30;   /*:384*/
_L30:
  mem[curedges + 30005].hh.UU.lh = n + 4096;
  mem[curedges + 30005].hh.rh = p;
}


/*:378*/
/*387:*/

Static Void skew(x, y, octant)
long x, y;
smallnumber octant;
{
  switch (octant) {

  case 1:
    curx = x - y;
    cury = y;
    break;

  case 5:
    curx = y - x;
    cury = x;
    break;

  case 6:
    curx = y + x;
    cury = -x;
    break;

  case 2:
    curx = -x - y;
    cury = y;
    break;

  case 4:
    curx = y - x;
    cury = -y;
    break;

  case 8:
    curx = x - y;
    cury = -x;
    break;

  case 7:
    curx = -y - x;
    cury = x;
    break;

  case 3:
    curx = x + y;
    cury = -y;
    break;
  }
}

<stdin>, line 6745: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 6745: Warning: Symbol 'ODD' is not defined [221]


/*:387*/
/*390:*/

Static Void abnegate(x, y, octantbefore, octantafter)
long x, y;
smallnumber octantbefore, octantafter;
{
  if (odd(octantbefore) == odd(octantafter)) {
/* p2c: <stdin>, line 6745: Warning: Symbol 'ODD' is not defined [221] */
/* p2c: <stdin>, line 6745: Warning: Symbol 'ODD' is not defined [221] */
    curx = x;
  } else
    curx = -x;
  if ((octantbefore > 2) == (octantafter > 2))
    cury = y;
  else
    cury = -y;
}  /*:390*/


/*391:*/

Static long crossingpoint(a, b, c)
long a, b, c;
{
  long Result, d, x, xx, x0, x1, x2;

  if (a < 0) {
    Result = 0;
    goto _L10;
  }
  if (c >= 0) {
    if (b >= 0) {
      if (c > 0) {
	Result = 268435457L;
	goto _L10;
      } else if (a == 0 && b == 0) {
	Result = 268435457L;
	goto _L10;
      } else {
	Result = 268435456L;
	goto _L10;
      }
    }
    if (a == 0) {
      Result = 0;
      goto _L10;
    }
  } else if (a == 0) {
    if (b <= 0) {
      Result = 0;
      goto _L10;
    }
  }
  /*392:*/
  d = 1;
  x0 = a;
  x1 = a - b;
  x2 = b - c;
  do {
    x = (x1 + x2) / 2;
    if (x1 - x0 > x0) {
      x2 = x;
      x0 += x0;
      d += d;
    } else {
      xx = x1 + x - x0;
      if (xx > x0) {
	x2 = x;
	x0 += x0;
	d += d;
      } else {
	x0 -= xx;
	if (x <= x0) {
	  if (x + x2 <= x0) {
	    Result = 268435457L;
	    goto _L10;
	  }
	}
	x1 = x;
	d += d + 1;
      }
    }
  } while (d < 268435456L);
  Result = d - 268435456L;   /*:392*/
_L10:

  return Result;
}


/*:391*/
/*394:*/

Static Void printspec(s)
strnumber s;
{
  halfword p, q;
  smallnumber octant;

  printdiagnostic(411, s, true);
  p = curspec;
  octant = mem[p + 30003].int_;
  println();
  unskew(mem[curspec + 30001].int_, mem[curspec + 30002].int_, octant);
  printtwo(curx, cury);
  print(412L);
  while (true) {
    print((long)octantdir[octant - 1]);
    printchar(39);
    while (true) {
      q = mem[p + 30000].hh.rh;
      if (mem[p + 30000].hh.UU.U2.b1 == 0)
	goto _L45;
      /*397:*/
      printnl(423);
      unskew(mem[p + 30005].int_, mem[p + 30006].int_, octant);
      printtwo(curx, cury);
      print(390L);
      unskew(mem[q + 30003].int_, mem[q + 30004].int_, octant);
      printtwo(curx, cury);
      printnl(387);
      unskew(mem[q + 30001].int_, mem[q + 30002].int_, octant);
      printtwo(curx, cury);
      print(424L);
      printint(mem[q + 30000].hh.UU.U2.b0 - 1L);   /*:397*/
      p = q;
    }
_L45:
    if (q == curspec)
      goto _L30;
    p = q;
    octant = mem[p + 30003].int_;
    printnl(413);
  }
_L30:
  printnl(414);
  enddiagnostic(true);
}


/*:394*/
/*398:*/

Static Void printstrange(s)
strnumber s;
{
  halfword p, f, q;
  long t;

  printnl(62);   /*399:*/
  p = curspec;
  t = 128;
  do {
    p = mem[p + 30000].hh.rh;
    if (mem[p + 30000].hh.UU.U2.b0 != 0) {   /*:399*/
      if (mem[p + 30000].hh.UU.U2.b0 < t)
	f = p;
      t = mem[p + 30000].hh.UU.U2.b0;
    }
  } while (p != curspec);   /*400:*/
  p = curspec;
  q = p;
  do {
    p = mem[p + 30000].hh.rh;
    if (mem[p + 30000].hh.UU.U2.b0 == 0)   /*:400*/
      q = p;
  } while (p != f);
  t = 0;
  do {
    if (mem[p + 30000].hh.UU.U2.b0 != 0) {
      if (mem[p + 30000].hh.UU.U2.b0 != t) {
	t = mem[p + 30000].hh.UU.U2.b0;
	printchar(32);
	printint(t - 1);
      }
      if (q != -30000) {  /*401:*/
	if (mem[mem[q + 30000].hh.rh + 30000].hh.UU.U2.b0 == 0) {   /*:401*/
	  print(425L);
	  print((long)octantdir[mem[q + 30003].int_ - 1]);
	  q = mem[q + 30000].hh.rh;
	  while (mem[mem[q + 30000].hh.rh + 30000].hh.UU.U2.b0 == 0) {
	    printchar(32);
	    print((long)octantdir[mem[q + 30003].int_ - 1]);
	    q = mem[q + 30000].hh.rh;
	  }
	  printchar(41);
	}
	printchar(32);
	print((long)octantdir[mem[q + 30003].int_ - 1]);
	q = -30000;
      }
    } else if (q == -30000)
      q = p;
    p = mem[p + 30000].hh.rh;
  } while (p != f);
  printchar(32);
  printint(mem[p + 30000].hh.UU.U2.b0 - 1L);
  if (q != -30000) {   /*401:*/
    if (mem[mem[q + 30000].hh.rh + 30000].hh.UU.U2.b0 == 0) {   /*:401*/
      print(425L);
      print((long)octantdir[mem[q + 30003].int_ - 1]);
      q = mem[q + 30000].hh.rh;
      while (mem[mem[q + 30000].hh.rh + 30000].hh.UU.U2.b0 == 0) {
	printchar(32);
	print((long)octantdir[mem[q + 30003].int_ - 1]);
	q = mem[q + 30000].hh.rh;
      }
      printchar(41);
    }
  }
  printnl(133);
  print((long)s);
}  /* printstrange */


/*:398*/
/*402:*/
/*405:*/

Static Void removecubic(p)
halfword p;
{
  halfword q;

  q = mem[p + 30000].hh.rh;
  mem[p + 30000].hh.UU.U2.b1 = mem[q + 30000].hh.UU.U2.b1;
  mem[p + 30000].hh.rh = mem[q + 30000].hh.rh;
  mem[p + 30001].int_ = mem[q + 30001].int_;
  mem[p + 30002].int_ = mem[q + 30002].int_;
  mem[p + 30005].int_ = mem[q + 30005].int_;
  mem[p + 30006].int_ = mem[q + 30006].int_;
  freenode(q, 7);
}


/*:405*/
/*406:*/
/*410:*/

Static V,
quadrantsubdivideoid splitcubic(p, t, xq, yq)
halfword p;
long t, xq, yq;
{
  scaled v;
  halfword q, r;

  q = mem[p + 30000].hh.rh;
  r = getnode(7L);
  mem[p + 30000].hh.rh = r;
  mem[r + 30000].hh.rh = q;
  mem[r + 30000].hh.UU.U2.b0 = mem[q + 30000].hh.UU.U2.b0;
  mem[r + 30000].hh.UU.U2.b1 = mem[p + 30000].hh.UU.U2.b1;
  v = mem[p + 30005].int_ -
      takefraction(mem[p + 30005].int_ - mem[q + 30003].int_, t);
  mem[p + 30005].int_ = mem[p + 30001].int_ - takefraction(
			  mem[p + 30001].int_ - mem[p + 30005].int_, t);
  mem[q + 30003].int_ -= takefraction(mem[q + 30003].int_ - xq, t);
  mem[r + 30003].int_ =
    mem[p + 30005].int_ - takefraction(mem[p + 30005].int_ - v, t);
  mem[r + 30005].int_ = v - takefraction(v - mem[q + 30003].int_, t);
  mem[r + 30001].int_ = mem[r + 30003].int_ - takefraction(
			  mem[r + 30003].int_ - mem[r + 30005].int_, t);
  v = mem[p + 30006].int_ -
      takefraction(mem[p + 30006].int_ - mem[q + 30004].int_, t);
  mem[p + 30006].int_ = mem[p + 30002].int_ - takefraction(
			  mem[p + 30002].int_ - mem[p + 30006].int_, t);
  mem[q + 30004].int_ -= takefraction(mem[q + 30004].int_ - yq, t);
  mem[r + 30004].int_ =
    mem[p + 30006].int_ - takefraction(mem[p + 30006].int_ - v, t);
  mem[r + 30006].int_ = v - takefraction(v - mem[q + 30004].int_, t);
  mem[r + 30002].int_ = mem[r + 30004].int_ - takefraction(
			  mem[r + 30004].int_ - mem[r + 30006].int_, t);
}  /*:410*/

<stdin>, line 7024: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7025: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7026: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7027: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7028: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7102: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7103: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7104: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7105: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7106: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7177: Warning: Symbol 'ODD' is not defined [221]


Static Void quadrantsubdivide()
{
  halfword p, q, r, s, pp, qq;
  scaled firstx, firsty, del1, del2, del3, del, dmax, destx, desty;
  fraction t;
  boolean constantx;

  p = curspec;
  firstx = mem[curspec + 30001].int_;
  firsty = mem[curspec + 30002].int_;
  do {
_L22:
    q = mem[p + 30000].hh.rh;   /*407:*/
    if (q == curspec) {
      destx = firstx;
      desty = firsty;
    } else {
      destx = mem[q + 30001].int_;
      desty = mem[q + 30002].int_;
    }
    del1 = mem[p + 30005].int_ - mem[p + 30001].int_;
    del2 = mem[q + 30003].int_ - mem[p + 30005].int_;
    del3 = destx - mem[q + 30003].int_;   /*408:*/
    if (del1 != 0)
      del = del1;
    else if (del2 != 0)
      del = del2;
    else
      del = del3;
    if (del != 0) {   /*:408*/
      dmax = abs(del1);
/* p2c: <stdin>, line 7024: Warning: Symbol 'ABS' is not defined [221] */
      if (abs(del2) > dmax) {
/* p2c: <stdin>, line 7025: Warning: Symbol 'ABS' is not defined [221] */
	dmax = abs(del2);
/* p2c: <stdin>, line 7026: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (abs(del3) > dmax) {
/* p2c: <stdin>, line 7027: Warning: Symbol 'ABS' is not defined [221] */
	dmax = abs(del3);
/* p2c: <stdin>, line 7028: Warning: Symbol 'ABS' is not defined [221] */
      }
      while (dmax < 134217728L) {
	dmax += dmax;
	del1 += del1;
	del2 += del2;
	del3 += del3;
      }
    }
    if (del == 0)
      constantx = true;
    else {   /*:407*/
      constantx = false;
      if (del < 0)   /*:409*/
      {  /*409:*/
	mem[p + 30001].int_ = -mem[p + 30001].int_;
	mem[p + 30005].int_ = -mem[p + 30005].int_;
	mem[q + 30003].int_ = -mem[q + 30003].int_;
	del1 = -del1;
	del2 = -del2;
	del3 = -del3;
	destx = -destx;
	mem[p + 30000].hh.UU.U2.b1 = 2;
      }
      t = crossingpoint(del1, del2, del3);
      if (t < 268435456L) {  /*411:*/
	splitcubic(p, t, destx, desty);
	r = mem[p + 30000].hh.rh;
	if (mem[r + 30000].hh.UU.U2.b1 > 1)
	  mem[r + 30000].hh.UU.U2.b1 = 1;
	else
	  mem[r + 30000].hh.UU.U2.b1 = 2;
	if (mem[r + 30001].int_ < mem[p + 30001].int_)
	  mem[r + 30001].int_ = mem[p + 30001].int_;
	mem[r + 30003].int_ = mem[r + 30001].int_;
	mem[r + 30001].int_ = -mem[r + 30001].int_;
	mem[r + 30005].int_ = mem[r + 30001].int_;
	mem[q + 30003].int_ = -mem[q + 30003].int_;
	destx = -destx;
	del2 -= takefraction(del2 - del3, t);
	if (del2 > 0)
	  del2 = 0;
	t = crossingpoint(0L, -del2, -del3);
	if (t < 268435456L) {  /*412:*/
	  splitcubic(r, t, destx, desty);
	  s = mem[r + 30000].hh.rh;
	  if (mem[s + 30001].int_ < destx)
	    mem[s + 30001].int_ = destx;
	  if (mem[s + 30001].int_ < mem[r + 30001].int_)
	    mem[s + 30001].int_ = mem[r + 30001].int_;
	  mem[s + 30000].hh.UU.U2.b1 = mem[p + 30000].hh.UU.U2.b1;
	  mem[s + 30003].int_ = mem[s + 30001].int_;
	  mem[s + 30001].int_ = -mem[s + 30001].int_;
	  mem[s + 30005].int_ = mem[s + 30001].int_;
	  mem[q + 30003].int_ = -mem[q + 30003].int_;
	} else if (mem[r + 30001].int_ > destx)
	  mem[r + 30001].int_ = destx;
      }  /*:411*/
    }
    /*413:*/
    pp = p;
    do {
      qq = mem[pp + 30000].hh.rh;
      abnegate(mem[qq + 30001].int_, mem[qq + 30002].int_,
	       mem[qq + 30000].hh.UU.U2.b1, mem[pp + 30000].hh.UU.U2.b1);
      destx = curx;
      desty = cury;
      del1 = mem[pp + 30006].int_ - mem[pp + 30002].int_;
      del2 = mem[qq + 30004].int_ - mem[pp + 30006].int_;
      del3 = desty - mem[qq + 30004].int_;   /*408:*/
      if (del1 != 0)
	del = del1;
      else if (del2 != 0)
	del = del2;
      else
	del = del3;
      if (del != 0) {   /*:408*/
	dmax = abs(del1);
/* p2c: <stdin>, line 7102: Warning: Symbol 'ABS' is not defined [221] */
	if (abs(del2) > dmax) {
/* p2c: <stdin>, line 7103: Warning: Symbol 'ABS' is not defined [221] */
	  dmax = abs(del2);
/* p2c: <stdin>, line 7104: Warning: Symbol 'ABS' is not defined [221] */
	}
	if (abs(del3) > dmax) {
/* p2c: <stdin>, line 7105: Warning: Symbol 'ABS' is not defined [221] */
	  dmax = abs(del3);
/* p2c: <stdin>, line 7106: Warning: Symbol 'ABS' is not defined [221] */
	}
	while (dmax < 134217728L) {
	  dmax += dmax;
	  del1 += del1;
	  del2 += del2;
	  del3 += del3;
	}
      }
      if (del != 0) {
	if (del < 0)   /*:414*/
	{  /*414:*/
	  mem[pp + 30002].int_ = -mem[pp + 30002].int_;
	  mem[pp + 30006].int_ = -mem[pp + 30006].int_;
	  mem[qq + 30004].int_ = -mem[qq + 30004].int_;
	  del1 = -del1;
	  del2 = -del2;
	  del3 = -del3;
	  desty = -desty;
	  mem[pp + 30000].hh.UU.U2.b1 += 2;
	}
	t = crossingpoint(del1, del2, del3);
	if (t < 268435456L) {  /*415:*/
	  splitcubic(pp, t, destx, desty);
	  r = mem[pp + 30000].hh.rh;
	  if (mem[r + 30000].hh.UU.U2.b1 > 2)
	    mem[r + 30000].hh.UU.U2.b1 -= 2;
	  else
	    mem[r + 30000].hh.UU.U2.b1 += 2;
	  if (mem[r + 30001].int_ > destx)
	    mem[r + 30001].int_ = destx;
	  else if (mem[r + 30001].int_ < mem[pp + 30001].int_)
	    mem[r + 30001].int_ = mem[pp + 30001].int_;
	  if (mem[r + 30002].int_ < mem[pp + 30002].int_)
	    mem[r + 30002].int_ = mem[pp + 30002].int_;
	  mem[r + 30004].int_ = mem[r + 30002].int_;
	  mem[r + 30002].int_ = -mem[r + 30002].int_;
	  mem[r + 30006].int_ = mem[r + 30002].int_;
	  mem[qq + 30004].int_ = -mem[qq + 30004].int_;
	  desty = -desty;
	  del2 -= takefraction(del2 - del3, t);
	  if (del2 > 0)
	    del2 = 0;
	  t = crossingpoint(0L, -del2, -del3);
	  if (t < 268435456L) {  /*416:*/
	    splitcubic(r, t, destx, desty);
	    s = mem[r + 30000].hh.rh;
	    if (mem[s + 30001].int_ > destx)
	      mem[s + 30001].int_ = destx;
	    else if (mem[s + 30001].int_ < mem[r + 30001].int_)
	      mem[s + 30001].int_ = mem[r + 30001].int_;
	    if (mem[s + 30002].int_ < desty)
	      mem[s + 30002].int_ = desty;
	    if (mem[s + 30002].int_ < mem[r + 30002].int_)
	      mem[s + 30002].int_ = mem[r + 30002].int_;
	    mem[s + 30000].hh.UU.U2.b1 = mem[pp + 30000].hh.UU.U2.b1;
	    mem[s + 30004].int_ = mem[s + 30002].int_;
	    mem[s + 30002].int_ = -mem[s + 30002].int_;
	    mem[s + 30006].int_ = mem[s + 30002].int_;
	    mem[qq + 30004].int_ = -mem[qq + 30004].int_;
	  } else if (mem[r + 30002].int_ > desty)
	, octantsubdivide, makesafe, beforeandafter, goodval, compromise, xyround    mem[r + 30002].int_ = desty;
	}  /*:415*/
      } else if (constantx) {
	if (q != p) {
	  removecubic(p);
	  if (curspec != q)
	    goto _L22;
	  else {
	    curspec = p;
	    goto _L10;
	  }
	}
      } else if (~odd(mem[pp + 30000].hh.UU.U2.b1)) {
	mem[pp + 30002].int_ = -mem[pp + 30002].int_;
	mem[pp + 30006].int_ = -mem[pp + 30006].int_;
	mem[qq + 30004].int_ = -mem[qq + 30004].int_;
	del1 = -del1;
	del2 = -del2;
	del3 = -del3;
	desty = -desty;
	mem[pp + 30000].hh.UU.U2.b1 += 2;
      }
      pp = qq;
    } while (pp != q);
    if (constantx)   /*:418*/
    {  /*418:*/
      pp = p;
      do {
	qq = mem[pp + 30000].hh.rh;
	if (mem[pp + 30000].hh.UU.U2.b1 > 2) {
	  mem[pp + 30000].hh.UU.U2.b1++;
	  mem[pp + 30001].int_ = -mem[pp + 30001].int_;
	  mem[pp + 30005].int_ = -mem[pp + 30005].int_;
	  mem[qq + 30003].int_ = -mem[qq + 30003].int_;
	}
	pp = qq;
      } while (pp != q);
    }
    /*:413*/
    p = q;
  } while (p != curspec);
_L10: ;


  /*:412*/
  /*:416*/
  /*417:*/
/* p2c: <stdin>, line 7177: Warning: Symbol 'ODD' is not defined [221] */
  /*414:*/
  /*:414*/
  /*:417*/
}

<stdin>, line 7241: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7242: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7243: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7244: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7245: Warning: Symbol 'ABS' is not defined [221]


/*:406*/
/*419:*/

Static Void octantsubdivide()
{
  halfword p, q, r, s;
  scaled del1, del2, del3, del, dmax, destx, desty;
  fraction t;

  p = curspec;
  do {
    q = mem[p + 30000].hh.rh;
    mem[p + 30001].int_ -= mem[p + 30002].int_;
    mem[p + 30005].int_ -= mem[p + 30006].int_;
    mem[q + 30003].int_ -= mem[q + 30004].int_;   /*420:*/
    /*421:*/
    if (q == curspec) {
      unskew(mem[q + 30001].int_, mem[q + 30002].int_,
	     mem[q + 30000].hh.UU.U2.b1);
      skew(curx, cury, mem[p + 30000].hh.UU.U2.b1);
      destx = curx;
      desty = cury;
    } else {
      abnegate(mem[q + 30001].int_, mem[q + 30002].int_,
	       mem[q + 30000].hh.UU.U2.b1, mem[p + 30000].hh.UU.U2.b1);
      destx = curx - cury;
      desty = cury;
    }
    del1 = mem[p + 30005].int_ - mem[p + 30001].int_;
    del2 = mem[q + 30003].int_ - mem[p + 30005].int_;
    del3 = destx - mem[q + 30003].int_;   /*:421*/
    /*408:*/
    if (del1 != 0)
      del = del1;
    else if (del2 != 0)
      del = del2;
    else
      del = del3;
    if (del != 0) {   /*:408*/
      dmax = abs(del1);
/* p2c: <stdin>, line 7241: Warning: Symbol 'ABS' is not defined [221] */
      if (abs(del2) > dmax) {
/* p2c: <stdin>, line 7242: Warning: Symbol 'ABS' is not defined [221] */
	dmax = abs(del2);
/* p2c: <stdin>, line 7243: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (abs(del3) > dmax) {
/* p2c: <stdin>, line 7244: Warning: Symbol 'ABS' is not defined [221] */
	dmax = abs(del3);
/* p2c: <stdin>, line 7245: Warning: Symbol 'ABS' is not defined [221] */
      }
      while (dmax < 134217728L) {
	dmax += dmax;
	del1 += del1;
	del2 += del2;
	del3 += del3;
      }
    }
    if (del != 0) {   /*:420*/
      if (del < 0)   /*:423*/
      {  /*423:*/
	mem[p + 30002].int_ += mem[p + 30001].int_;
	mem[p + 30001].int_ = -mem[p + 30001].int_;
	mem[p + 30006].int_ += mem[p + 30005].int_;
	mem[p + 30005].int_ = -mem[p + 30005].int_;
	mem[q + 30004].int_ += mem[q + 30003].int_;
	mem[q + 30003].int_ = -mem[q + 30003].int_;
	del1 = -del1;
	del2 = -del2;
	del3 = -del3;
	desty += destx;
	destx = -destx;
	mem[p + 30000].hh.UU.U2.b1 += 4;
      }
      t = crossingpoint(del1, del2, del3);
      if (t < 268435456L) {  /*424:*/
	splitcubic(p, t, destx, desty);
	r = mem[p + 30000].hh.rh;
	if (mem[r + 30000].hh.UU.U2.b1 > 4)
	  mem[r + 30000].hh.UU.U2.b1 -= 4;
	else
	  mem[r + 30000].hh.UU.U2.b1 += 4;
	if (mem[r + 30002].int_ > desty)
	  mem[r + 30002].int_ = desty;
	else if (mem[r + 30002].int_ < mem[p + 30002].int_)
	  mem[r + 30002].int_ = mem[p + 30002].int_;
	if (mem[r + 30001].int_ < mem[p + 30001].int_)
	  mem[r + 30001].int_ = mem[p + 30001].int_;
	mem[r + 30003].int_ = mem[r + 30001].int_;
	mem[r + 30002].int_ += mem[r + 30001].int_;
	mem[r + 30001].int_ = -mem[r + 30001].int_;
	mem[r + 30005].int_ = mem[r + 30001].int_;
	mem[r + 30006].int_ -= mem[r + 30005].int_;
	mem[q + 30004].int_ += mem[q + 30003].int_;
	mem[q + 30003].int_ = -mem[q + 30003].int_;
	desty += destx;
	destx = -destx;
	del2 -= takefraction(del2 - del3, t);
	if (del2 > 0)
	  del2 = 0;
	t = crossingpoint(0L, -del2, -del3);
	if (t < 268435456L) {  /*425:*/
	  splitcubic(r, t, destx, desty);
	  s = mem[r + 30000].hh.rh;
	  if (mem[s + 30002].int_ > desty)
	    mem[s + 30002].int_ = desty;
	  else if (mem[s + 30002].int_ < mem[r + 30002].int_)
	    mem[s + 30002].int_ = mem[r + 30002].int_;
	  if (mem[s + 30001].int_ < destx)
	    mem[s + 30001].int_ = destx;
	  if (mem[s + 30001].int_ < mem[r + 30001].int_)
	    mem[s + 30001].int_ = mem[r + 30001].int_;
	  mem[s + 30000].hh.UU.U2.b1 = mem[p + 30000].hh.UU.U2.b1;
	  mem[s + 30003].int_ = mem[s + 30001].int_;
	  mem[s + 30002].int_ += mem[s + 30001].int_;
	  mem[s + 30001].int_ = -mem[s + 30001].int_;
	  mem[s + 30006].int_ -= mem[s + 30001].int_;
	  mem[s + 30005].int_ = mem[s + 30001].int_;
	  mem[q + 30004].int_ += mem[q + 30003].int_;
	  mem[q + 30003].int_ = -mem[q + 30003].int_;
	} else if (mem[r + 30001].int_ > destx)
	  mem[r + 30001].int_ = destx;   /*:424*/
      }
    }
    p = q;
  } while (p != curspec);

  /*:425*/
}

<stdin>, line 7342: Warning: Symbol 'ABS' is not defined [221]


/*:419*/
/*426:*/

Static Void makesafe()
{
  short k;
  boolean allsafe;
  scaled nexta, deltaa, deltab;
  short FORLIM;

  before[curroundingptr] = before[0];
  nodetoround[curroundingptr] = nodetoround[0];
  do {
    after[curroundingptr] = after[0];
    allsafe = true;
    nexta = after[0];
    FORLIM = curroundingptr;
    for (k = 0; k < FORLIM; k++) {
      deltab = before[k + 1] - before[k];
      if (deltab >= 0)
	deltaa = after[k + 1] - nexta;
      else
	deltaa = nexta - after[k + 1];
      nexta = after[k + 1];
      if ((unsigned long)deltaa > abs(deltab + deltab)) {
/* p2c: <stdin>, line 7342: Warning: Symbol 'ABS' is not defined [221] */
	allsafe = false;
	after[k] = before[k];
	if (k == curroundingptr - 1)
	  after[0] = before[0];
	else
	  after[k + 1] = before[k + 1];
      }
    }
  } while (!allsafe);
}


/*:426*/
/*429:*/

Static Void beforeandafter(b, a, p)
long b, a;
halfword p;
{
  if (curroundingptr == maxroundingptr) {
    if (maxroundingptr < maxwiggle)
      maxroundingptr++;
    else
      overflow(435, (long)maxwiggle);
  }
  after[curroundingptr] = a;
  before[curroundingptr] = b;
  nodetoround[curroundingptr] = p;
  curroundingptr++;
}  /* beforeandafter */

<stdin>, line 7375: Note: Using % for possibly-negative arguments [317]
<stdin>, line 7377: Note: Using % for possibly-negative arguments [317]


/*:429*/
/*431:*/

Static long goodval(b, o)
long b, o;
{
  scaled a;

  a = b + o;
  if (a >= 0) {
    a += -(a % curgran) - o;
/* p2c: <stdin>, line 7375:
 * Note: Using % for possibly-negative arguments [317] */
  } else {
    a += -(a + 1) % curgran - curgran - o + 1;
/* p2c: <stdin>, line 7377:
 * Note: Using % for possibly-negative arguments [317] */
  }
  if (b - a < a + curgran - b)
    return a;
  else
    return (a + curgran);
}


/*:431*/
/*432:*/

Static long compromise(u, v)
long u, v;
{
  return (goodval(u + u, -u - v) / 2);
}

<stdin>, line 7396: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7403: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7403: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7404: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7408: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7408: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7413: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7420: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7435: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7464: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7464: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7476:, diaground Warning: Symbol 'ABS' is not defined [221]


/*:432*/
/*433:*/

Static Void xyround()
{
  halfword p, q;
  scaled b, a, penedge;
  fraction alpha;

  curgran = abs(internal[36]);
/* p2c: <stdin>, line 7396: Warning: Symbol 'ABS' is not defined [221] */
  if (curgran == 0)
    curgran = 65536L;
  p = curspec;
  curroundingptr = 0;
  do {
    q = mem[p + 30000].hh.rh;   /*434:*/
    if (odd(mem[p + 30000].hh.UU.U2.b1) != odd(mem[q + 30000].hh.UU.U2.b1))
    {   /*:434*/
/* p2c: <stdin>, line 7403: Warning: Symbol 'ODD' is not defined [221] */
/* p2c: <stdin>, line 7403: Warning: Symbol 'ODD' is not defined [221] */
      if (odd(mem[q + 30000].hh.UU.U2.b1)) {
/* p2c: <stdin>, line 7404: Warning: Symbol 'ODD' is not defined [221] */
	b = mem[q + 30001].int_;
      } else
	b = -mem[q + 30001].int_;
      if (abs(mem[q + 30001].int_ - mem[q + 30005].int_) < 655 ||
	  abs(mem[q + 30001].int_ + mem[q + 30003].int_) < 655)
      {  /*435:*/
	if (curpen == -29997)
	  penedge = 0;
	else if (curpathtype == 0)
	  penedge = compromise(mem[mem[curpen + 30005].hh.rh + 30002].int_,
			       mem[mem[curpen + 30007].hh.rh + 30002].int_);
	else if (odd(mem[q + 30000].hh.UU.U2.b1)) {
/* p2c: <stdin>, line 7413: Warning: Symbol 'ODD' is not defined [221] */
	  penedge = mem[mem[curpen + 30007].hh.rh + 30002].int_;
	} else
	  penedge = mem[mem[curpen + 30005].hh.rh + 30002].int_;
	a = goodval(b, penedge);
      } else  /*:435*/
	a = b;
/* p2c: <stdin>, line 7408: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 7408: Warning: Symbol 'ABS' is not defined [221] */
      if (abs(a) > maxallowed) {
/* p2c: <stdin>, line 7420: Warning: Symbol 'ABS' is not defined [221] */
	if (a > 0)
	  a = maxallowed;
	else
	  a = -maxallowed;
      }
      beforeandafter(b, a, q);
    }
    p = q;
  } while (p != curspec);
  if (curroundingptr > 0)   /*:436*/
  {  /*436:*/
    makesafe();
    do {
      curroundingptr--;
      if (after[curroundingptr] != before[curroundingptr] ||
	  after[curroundingptr + 1] != before[curroundingptr + 1]) {
	p = nodetoround[curroundingptr];
	if (odd(mem[p + 30000].hh.UU.U2.b1)) {
/* p2c: <stdin>, line 7435: Warning: Symbol 'ODD' is not defined [221] */
	  b = before[curroundingptr];
	  a = after[curroundingptr];
	} else {
	  b = -before[curroundingptr];
	  a = -after[curroundingptr];
	}
	if (before[curroundingptr] == before[curroundingptr + 1])
	  alpha = 268435456L;
	else
	  alpha = makefraction(after[curroundingptr + 1] - after[curroundingptr],
	      before[curroundingptr + 1] - before[curroundingptr]);
	do {
	  mem[p + 30001].int_ = takefraction(alpha, mem[p + 30001].int_ - b) + a;
	  mem[p + 30005].int_ = takefraction(alpha, mem[p + 30005].int_ - b) + a;
	  p = mem[p + 30000].hh.rh;
	  mem[p + 30003].int_ = takefraction(alpha, mem[p + 30003].int_ - b) + a;
	} while (p != nodetoround[curroundingptr + 1]);
      }
    } while (curroundingptr != 0);
  }
  p = curspec;
  curroundingptr = 0;
  do {
    q = mem[p + 30000].hh.rh;   /*437:*/
    if ((mem[p + 30000].hh.UU.U2.b1 > 2) != (mem[q + 30000].hh.UU.U2.b1 > 2))
    {   /*:437*/
      if (mem[q + 30000].hh.UU.U2.b1 <= 2)
	b = mem[q + 30002].int_;
      else
	b = -mem[q + 30002].int_;
      if (abs(mem[q + 30002].int_ - mem[q + 30006].int_) < 655 ||
	  abs(mem[q + 30002].int_ + mem[q + 30004].int_) < 655)
      {  /*438:*/
	if (curpen == -29997)
	  penedge = 0;
	else if (curpathtype == 0)
	  penedge = compromise(mem[mem[curpen + 30002].hh.rh + 30002].int_,
			       mem[mem[curpen + 30001].hh.rh + 30002].int_);
	else if (mem[q + 30000].hh.UU.U2.b1 <= 2)
	  penedge = mem[mem[curpen + 30001].hh.rh + 30002].int_;
	else
	  penedge = mem[mem[curpen + 30002].hh.rh + 30002].int_;
	a = goodval(b, penedge);
      } else  /*:438*/
	a = b;
/* p2c: <stdin>, line 7464: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 7464: Warning: Symbol 'ABS' is not defined [221] */
      if (abs(a) > maxallowed) {
/* p2c: <stdin>, line 7476: Warning: Symbol 'ABS' is not defined [221] */
	if (a > 0)
	  a = maxallowed;
	else
	  a = -maxallowed;
      }
      beforeandafter(b, a, q);
    }
    p = q;
  } while (p != curspec);
  if (curroundingptr <= 0)  /*439:*/
    return;
  makesafe();
  do {
    curroundingptr--;
    if (after[curroundingptr] != before[curroundingptr] ||
	after[curroundingptr + 1] != before[curroundingptr + 1]) {
      p = nodetoround[curroundingptr];
      if (mem[p + 30000].hh.UU.U2.b1 <= 2) {
	b = before[curroundingptr];
	a = after[curroundingptr];
      } else {
	b = -before[curroundingptr];
	a = -after[curroundingptr];
      }
      if (before[curroundingptr] == before[curroundingptr + 1])
	alpha = 268435456L;
      else
	alpha = makefraction(after[curroundingptr + 1] - after[curroundingptr],
	    before[curroundingptr + 1] - before[curroundingptr]);
      do {
	mem[p + 30002].int_ = takefraction(alpha, mem[p + 30002].int_ - b) + a;
	mem[p + 30006].int_ = takefraction(alpha, mem[p + 30006].int_ - b) + a;
	p = mem[p + 30000].hh.rh;
	mem[p + 30004].int_ = takefraction(alpha, mem[p + 30004].int_ - b) + a;
      } while (p != nodetoround[curroundingptr + 1]);
    }
  } while (curroundingptr != 0);   /*:439*/
}

<stdin>, line 7533: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7534: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7534: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7552: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7609: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7618: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7670: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 7679: Warning: Symbol 'ODD' is not defined [221]


/*:433*/
/*440:*/

Static Void diaground()
{
  halfword p, q, pp;
  scaled b, a, bb, aa, d, c, dd, cc, penedge, nexta, firstx, firsty;
  fraction alpha, beta;
  boolean allsafe;
  short k, FORLIM;

  p = curspec;
  curroundingptr = 0;
  do {
    q = mem[p + 30000].hh.rh;   /*441:*/
    if (mem[p + 30000].hh.UU.U2.b1 != mem[q + 30000].hh.UU.U2.b1) {   /*:441*/
      if (mem[q + 30000].hh.UU.U2.b1 > 4)
	b = -mem[q + 30001].int_;
      else
	b = mem[q + 30001].int_;
      if (abs(mem[q + 30000].hh.UU.U2.b1 - mem[p + 30000].hh.UU.U2.b1) == 4) {
/* p2c: <stdin>, line 7533: Warning: Symbol 'ABS' is not defined [221] */
	if (abs(mem[q + 30001].int_ - mem[q + 30005].int_) < 655 ||
	    abs(mem[q + 30001].int_ + mem[q + 30003].int_) < 655)
	{  /*442:*/
	  if (curpen == -29997)
	    penedge = 0;
	  else if (curpathtype == 0) {
	    switch (mem[q + 30000].hh.UU.U2.b1) {

	    case 1:
	    case 5:
	      penedge = compromise(
		  mem[mem[mem[curpen + 30001].hh.rh + 30000].hh.UU.lh + 30001].int_,
		  -mem[mem[mem[curpen + 30004].hh.rh + 30000].hh.UU.lh + 30001].int_);
	      break;

	    case 4:
	    case 8:
	      penedge = -compromise(
		  mem[mem[mem[curpen + 30001].hh.rh + 30000].hh.UU.lh + 30001].
		  int_,
		  -mem[mem[mem[curpen + 30004].hh.rh + 30000].hh.UU.lh + 30001].int_);
/* p2c: <stdin>, line 7706: 
 * Note: Line breaker spent 0.0 seconds, 5000 tries on line 9149 [251] */
	      break;

	    case 6:
	    case 2:
	      penedge =
		compromise(
		  mem[mem[mem[curpen + 30002].hh.rh + 30000].hh.UU.lh + 30001].int_,
		  -mem[mem[mem[curpen + 30003].hh.rh + 30000].hh.UU.lh + 30001].int_);
/* p2c: <stdin>, line 7706: 
 * Note: Line breaker spent 0.0 seconds, 5000 tries on line 9159 [251] */
	      break;

	    case 7:
	    case 3:
	      penedge =
		-compromise(
		  mem[mem[mem[curpen + 30002].hh.rh + 30000].hh.UU.lh + 30001].int_,
		  -mem[mem[mem[curpen + 30003].hh.rh + 30000].hh.UU.lh + 30001].
		   int_);
/* p2c: <stdin>, line 7706: 
 * Note: Line breaker spent 0.0 seconds, 5000 tries on line 9170 [251] */
	      break;
	    }/*:443*/
	  } else if (mem[q + 30000].hh.UU.U2.b1 <= 4)
	    penedge = mem[mem[mem[curpen + mem[q + 30000].hh.UU.U2.b1 + 30000].hh.
			      rh + 30000].hh.UU.lh + 30001].int_;
	  else
	    penedge = -mem[mem[mem[curpen + mem[q + 30000].hh.UU.U2.b1 + 30000].
			       hh.rh + 30000].hh.UU.lh + 30001].int_;
	  if (odd(mem[q + 30000].hh.UU.U2.b1)) {
/* p2c: <stdin>, line 7552: Warning: Symbol 'ODD' is not defined [221] */
	    a = goodval(b, newboundary, makespec, penedge + curgran / 2);
	  } else
	    a = goodval(b - 1, penedge + curgran / 2);
	} else  /*:442*/
	  a = b;
/* p2c: <stdin>, line 7534: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 7534: Warning: Symbol 'ABS' is not defined [221] */
      } else
	a = b;
      beforeandafter(b, a, q);
    }
    p = q;
  } while (p != curspec);
  if (curroundingptr <= 0) {  /*444:*/
    return;
  }  /*:444*/
  p = nodetoround[0];
  firstx = mem[p + 30001].int_;
  firsty = mem[p + 30002].int_;   /*446:*/
  before[curroundingptr] = before[0];
  nodetoround[curroundingptr] = nodetoround[0];
  do {
    after[curroundingptr] = after[0];
    allsafe = true;
    nexta = after[0];
    FORLIM = curroundingptr;
    for (k = 0; k < FORLIM; k++) {   /*:446*/
      a = nexta;
      b = before[k];
      nexta = after[k + 1];
      aa = nexta;
      bb = before[k + 1];
      if (a != b || aa != bb) {
	p = nodetoround[k];
	pp = nodetoround[k + 1];
	/*445:*/
	if (aa == bb) {
	  if (pp == nodetoround[0])
	    unskew(firstx, firsty, mem[pp + 30000].hh.UU.U2.b1);
	  else
	    unskew(mem[pp + 30001].int_, mem[pp + 30002].int_,
		   mem[pp + 30000].hh.UU.U2.b1);
	  skew(curx, cury, mem[p + 30000].hh.UU.U2.b1);
	  bb = curx;
	  aa = bb;
	  dd = cury;
	  cc = dd;
	  if (mem[p + 30000].hh.UU.U2.b1 > 4) {
	    b = -b;
	    a = -a;
	  }
	} else {
	  if (mem[p + 30000].hh.UU.U2.b1 > 4) {
	    bb = -bb;
	    aa = -aa;
	    b = -b;
	    a = -a;
	  }
	  if (pp == nodetoround[0])
	    dd = firsty - bb;
	  else
	    dd = mem[pp + 30002].int_ - bb;
	  if (odd(aa - bb)) {
/* p2c: <stdin>, line 7609: Warning: Symbol 'ODD' is not defined [221] */
	    if (mem[p + 30000].hh.UU.U2.b1 > 4)
	      cc = dd - (aa - bb + 1) / 2;
	    else
	      cc = dd - (aa - bb - 1) / 2;
	  } else
	    cc = dd - (aa - bb) / 2;
	}
	d = mem[p + 30002].int_;
	if (odd(a - b)) {
/* p2c: <stdin>, line 7618: Warning: Symbol 'ODD' is not defined [221] */
	  if (mem[p + 30000].hh.UU.U2.b1 > 4)
	    c = d - (a - b - 1) / 2;
	  else
	    c = d - (a - b + 1) / 2;
	} else
	  c = d - (a - b) / 2;   /*:445*/
	if (aa < a || cc < c || aa - a > (bb - b) * 2 || cc - c > (dd - d) * 2) {
	  allsafe = false;
	  after[k] = before[k];
	  if (k == curroundingptr - 1)
	    after[0] = before[0];
	  else
	    after[k + 1] = before[k + 1];
	}
      }
    }
  } while (!allsafe);
  FORLIM = curroundingptr;
  for (k = 0; k < FORLIM; k++) {
    a = after[k];
    b = before[k];
    aa = after[k + 1];
    bb = before[k + 1];
    if (a != b || aa != bb) {
      p = nodetoround[k];
      pp = nodetoround[k + 1];
      /*445:*/
      if (aa == bb) {
	if (pp == nodetoround[0])
	  unskew(firstx, firsty, mem[pp + 30000].hh.UU.U2.b1);
	else
	  unskew(mem[pp + 30001].int_, mem[pp + 30002].int_,
		 mem[pp + 30000].hh.UU.U2.b1);
	skew(curx, cury, mem[p + 30000].hh.UU.U2.b1);
	bb = curx;
	aa = bb;
	dd = cury;
	cc = dd;
	if (mem[p + 30000].hh.UU.U2.b1 > 4) {
	  b = -b;
	  a = -a;
	}
      } else {
	if (mem[p + 30000].hh.UU.U2.b1 > 4) {
	  bb = -bb;
	  aa = -aa;
	  b = -b;
	  a = -a;
	}
	if (pp == nodetoround[0])
	  dd = firsty - bb;
	else
	  dd = mem[pp + 30002].int_ - bb;
	if (odd(aa - bb)) {
/* p2c: <stdin>, line 7670: Warning: Symbol 'ODD' is not defined [221] */
	  if (mem[p + 30000].hh.UU.U2.b1 > 4)
	    cc = dd - (aa - bb + 1) / 2;
	  else
	    cc = dd - (aa - bb - 1) / 2;
	} else
	  cc = dd - (aa - bb) / 2;
      }
      d = mem[p + 30002].int_;
      if (odd(a - b)) {
/* p2c: <stdin>, line 7679: Warning: Symbol 'ODD' is not defined [221] */
	if (mem[p + 30000].hh.UU.U2.b1 > 4)
	  c = d - (a - b - 1) / 2;
	else
	  c = d - (a - b + 1) / 2;
      } else
	c = d - (a - b) / 2;   /*:445*/
      if (b == bb)
	alpha = 268435456L;
      else
	alpha = makefraction(aa - a, bb - b);
      if (d == dd)
	beta = 268435456L;
      else
	beta = makefraction(cc - c, dd - d);
      do {
	mem[p + 30001].int_ = takefraction(alpha, mem[p + 30001].int_ - b) + a;
	mem[p + 30002].int_ = takefraction(beta, mem[p + 30002].int_ - d) + c;
	mem[p + 30005].int_ = takefraction(alpha, mem[p + 30005].int_ - b) + a;
	mem[p + 30006].int_ = takefraction(beta, mem[p + 30006].int_ - d) + c;
	p = mem[p + 30000].hh.rh;
	mem[p + 30003].int_ = takefraction(alpha, mem[p + 30003].int_ - b) + a;
	mem[p + 30004].int_ = takefraction(beta, mem[p + 30004].int_ - d) + c;
      } while (p != pp);
    }
  }

  /*443:*/
}


/*:440*/
/*451:*/

Static Void newboundary(p, octant)
halfword p;
smallnumber octant;
{
  halfword q, r;

  q = mem[p + 30000].hh.rh;
  r = getnode(7L);
  mem[r + 30000].hh.rh = q;
  mem[p + 30000].hh.rh = r;
  mem[r + 30000].hh.UU.U2.b0 = mem[q + 30000].hh.UU.U2.b0;
  mem[r + 30003].int_ = mem[q + 30003].int_;
  mem[r + 30004].int_ = mem[q + 30004].int_;
  mem[r + 30000].hh.UU.U2.b1 = 0;
  mem[q + 30000].hh.UU.U2.b0 = 0;
  mem[r + 30005].int_ = octant;
  mem[q + 30003].int_ = mem[q + 30000].hh.UU.U2.b1;
  unskew(mem[q + 30001].int_, mem[q + 30002].int_, mem[q + 30000].hh.UU.U2.b1);
  skew(curx, cury, octant);
  mem[r + 30001].int_ = curx;
  mem[r + 30002].int_ = cury;
}  /*:451*/

<stdin>, line 7749: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7756: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7763: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7770: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7777: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7784: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7872: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7873: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7874: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7899: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7900: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7901: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7960: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 7963: Warning: Symbol 'ODD' is not defined [221]


Static halfword makespec(h, safetymargin, tracing)
halfword h;
long safetymargin, tracing;
{
  halfword p, q, r, s;
  long k;
  boolean chopped;   /*453:*/
  smallnumber o1, o2;
  boolean clockwise;
  long dx1, dy1, dx2, dy2, dmax, del;   /*:453*/

  curspec = h;
  if (tracing > 0)
    printpath(curspec, 426, true);
  maxallowed = 268402687L - safetymargin;   /*404:*/
  p = curspec;
  k = 1;
  chopped = false;
  do {
    if (abs(mem[p + 30003].int_) > maxallowed) {
/* p2c: <stdin>, line 7749: Warning: Symbol 'ABS' is not defined [221] */
      chopped = true;
      if (mem[p + 30003].int_ > 0)
	mem[p + 30003].int_ = maxallowed;
      else
	mem[p + 30003].int_ = -maxallowed;
    }
    if (abs(mem[p + 30004].int_) > maxallowed) {
/* p2c: <stdin>, line 7756: Warning: Symbol 'ABS' is not defined [221] */
      chopped = true;
      if (mem[p + 30004].int_ > 0)
	mem[p + 30004].int_ = maxallowed;
      else
	mem[p + 30004].int_ = -maxallowed;
    }
    if (abs(mem[p + 30001].int_) > maxallowed) {
/* p2c: <stdin>, line 7763: Warning: Symbol 'ABS' is not defined [221] */
      chopped = true;
      if (mem[p + 30001].int_ > 0)
	mem[p + 30001].int_ = maxallowed;
      else
	mem[p + 30001].int_ = -maxallowed;
    }
    if (abs(mem[p + 30002].int_) > maxallowed) {
/* p2c: <stdin>, line 7770: Warning: Symbol 'ABS' is not defined [221] */
      chopped = true;
      if (mem[p + 30002].int_ > 0)
	mem[p + 30002].int_ = maxallowed;
      else
	mem[p + 30002].int_ = -maxallowed;
    }
    if (abs(mem[p + 30005].int_) > maxallowed) {
/* p2c: <stdin>, line 7777: Warning: Symbol 'ABS' is not defined [221] */
      chopped = true;
      if (mem[p + 30005].int_ > 0)
	mem[p + 30005].int_ = maxallowed;
      else
	mem[p + 30005].int_ = -maxallowed;
    }
    if (abs(mem[p + 30006].int_) > maxallowed) {
/* p2c: <stdin>, line 7784: Warning: Symbol 'ABS' is not defined [221] */
      chopped = true;
      if (mem[p + 30006].int_ > 0)
	mem[p + 30006].int_ = maxallowed;
      else
	mem[p + 30006].int_ = -maxallowed;
    }
    p = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.UU.U2.b0 = k;
    if (k < 127)
      k++;
    else
      k = 1;
  } while (p != curspec);
  if (chopped) {   /*:404*/
    printnl(133);
    print(430L);
    helpptr = 4;
 , endround, fillspec, dupoffset, makepen   helpline[3] = 431;
    helpline[2] = 432;
    helpline[1] = 433;
    helpline[0] = 434;
    putgeterror();
  }
  quadrantsubdivide();
  if (internal[35] > 0)
    xyround();
  octantsubdivide();
  if (internal[35] > 65536L)   /*447:*/
    diaground();
  p = curspec;
  do {   /*:447*/
_L22:
    q = mem[p + 30000].hh.rh;
    if (p != q) {
      if (mem[p + 30001].int_ == mem[p + 30005].int_) {
	if (mem[p + 30002].int_ == mem[p + 30006].int_) {
	  if (mem[p + 30001].int_ == mem[q + 30003].int_) {
	    if (mem[p + 30002].int_ == mem[q + 30004].int_) {
	      unskew(mem[q + 30001].int_, mem[q + 30002].int_,
		     mem[q + 30000].hh.UU.U2.b1);
	      skew(curx, cury, mem[p + 30000].hh.UU.U2.b1);
	      if (mem[p + 30001].int_ == curx) {
		if (mem[p + 30002].int_ == cury) {
		  removecubic(p);
		  if (q != curspec)
		    goto _L22;
		  curspec = p;
		  q = p;
		}
	      }
	    }
	  }
	}
      }
    }
    p = q;
  } while (p != curspec);
  /*450:*/
  turningnumber = 0;
  p = curspec;
  q = mem[p + 30000].hh.rh;
  do {
    r = mem[q + 30000].hh.rh;
    if (mem[p + 30000].hh.UU.U2.b1 != mem[q + 30000].hh.UU.U2.b1 || q == r)
	/*:452*/
	{  /*452:*/
      newboundary(p, mem[p + 30000].hh.UU.U2.b1);
      s = mem[p + 30000].hh.rh;
      o1 = octantnumber[mem[p + 30000].hh.UU.U2.b1 - 1];
      o2 = octantnumber[mem[q + 30000].hh.UU.U2.b1 - 1];
      switch (o2 - o1) {

      case 1:
      case -7:
      case 7:
      case -1:
	goto _L30;
	break;

      case 2:
      case -6:
	clockwise = false;
	break;

      case 3:
      case -5:
      case 4:
      case -4:
      case 5:
      case -3:   /*454:*/
	dx1 = mem[s + 30001].int_ - mem[s + 30003].int_;
	dy1 = mem[s + 30002].int_ - mem[s + 30004].int_;
	if (dx1 == 0) {
	  if (dy1 == 0) {
	    dx1 = mem[s + 30001].int_ - mem[p + 30005].int_;
	    dy1 = mem[s + 30002].int_ - mem[p + 30006].int_;
	    if (dx1 == 0) {
	      if (dy1 == 0) {
		dx1 = mem[s + 30001].int_ - mem[p + 30001].int_;
		dy1 = mem[s + 30002].int_ - mem[p + 30002].int_;
	      }
	    }
	  }
	}
	dmax = abs(dx1);
/* p2c: <stdin>, line 7872: Warning: Symbol 'ABS' is not defined [221] */
	if (abs(dy1) > dmax) {
/* p2c: <stdin>, line 7873: Warning: Symbol 'ABS' is not defined [221] */
	  dmax = abs(dy1);
/* p2c: <stdin>, line 7874: Warning: Symbol 'ABS' is not defined [221] */
	}
	while (dmax < 268435456L) {
	  dmax += dmax;
	  dx1 += dx1;
	  dy1 += dy1;
	}
	dx2 = mem[q + 30005].int_ - mem[q + 30001].int_;
	dy2 = mem[q + 30006].int_ - mem[q + 30002].int_;
	if (dx2 == 0) {
	  if (dy2 == 0) {
	    dx2 = mem[r + 30003].int_ - mem[q + 30001].int_;
	    dy2 = mem[r + 30004].int_ - mem[q + 30002].int_;
	    if (dx2 == 0) {
	      if (dy2 == 0) {
		if (mem[r + 30000].hh.UU.U2.b1 == 0) {
		  curx = mem[r + 30001].int_;
		  cury = mem[r + 30002].int_;
		} else {
		  unskew(mem[r + 30001].int_, mem[r + 30002].int_,
			 mem[r + 30000].hh.UU.U2.b1);
		  skew(curx, cury, mem[q + 30000].hh.UU.U2.b1);
		}
		dx2 = curx - mem[q + 30001].int_;
		dy2 = cury - mem[q + 30002].int_;
	      }
	    }
	  }
	}
	dmax = abs(dx2);
/* p2c: <stdin>, line 7899: Warning: Symbol 'ABS' is not defined [221] */
	if (abs(dy2) > dmax) {
/* p2c: <stdin>, line 7900: Warning: Symbol 'ABS' is not defined [221] */
	  dmax = abs(dy2);
/* p2c: <stdin>, line 7901: Warning: Symbol 'ABS' is not defined [221] */
	}
	while (dmax < 268435456L) {   /*:457*/
	  dmax += dmax;
	  dx2 += dx2;
	  dy2 += dy2;
	}
	unskew(dx1, dy1, mem[p + 30000].hh.UU.U2.b1);
	del = pythadd(curx, cury);
	dx1 = makefraction(curx, del);
	dy1 = makefraction(cury, del);
	unskew(dx2, dy2, mem[q + 30000].hh.UU.U2.b1);
	del = pythadd(curx, cury);
	dx2 = makefraction(curx, del);
	dy2 = makefraction(cury, del);
	del = takefraction(dx1, dy2) - takefraction(dx2, dy1);
	if (del > 4684844L)
	  clockwise = false;
	else if (del < -4684844L)
	  clockwise = true;
	else
	  clockwise = revturns;
	break;
	/*457:*/
	/*:454*/

      case 6:
      case -2:
	clockwise = true;
	break;

      case 0:
	clockwise = revturns;
	break;
      }/*458:*/
      while (true) {   /*:458*/
	if (clockwise) {
	  if (o1 == 1)
	    o1 = 8;
	  else
	    o1--;
	} else if (o1 == 8)
	  o1 = 1;
	else
	  o1++;
	if (o1 == o2)
	  goto _L30;
	newboundary(s, octantcode[o1 - 1]);
	s = mem[s + 30000].hh.rh;
	mem[s + 30003].int_ = mem[s + 30005].int_;
      }
_L30:
      if (q == r) {
	q = mem[q + 30000].hh.rh;
	r = q;
	p = s;
	mem[s + 30000].hh.rh = q;
	mem[q + 30003].int_ = mem[q + 30005].int_;
	mem[q + 30000].hh.UU.U2.b0 = 0;
	freenode(curspec, 7);
	curspec = q;
      }  /*459:*/
      p = mem[p + 30000].hh.rh;
      do {
	s = mem[p + 30000].hh.rh;
	o1 = octantnumber[mem[p + 30005].int_ - 1];
	o2 = octantnumber[mem[s + 30003].int_ - 1];
	if (abs(o1 - o2) == 1) {
/* p2c: <stdin>, line 7960: Warning: Symbol 'ABS' is not defined [221] */
	  if (o2 < o1)
	    o2 = o1;
	  if (odd(o2)) {
/* p2c: <stdin>, line 7963: Warning: Symbol 'ODD' is not defined [221] */
	    mem[p + 30006].int_ = 0;
	  } else
	    mem[p + 30006].int_ = 1;
	} else {
	  if (o1 == 8)
	    turningnumber++;
	  else
	    turningnumber--;
	  mem[p + 30006].int_ = 0;
	}
	mem[s + 30004].int_ = mem[p + 30006].int_;
	p = s;   /*:459*/
      } while (p != q);
    }
    p = q;
    q = r;
  } while (p != curspec);   /*:450*/
  while (mem[curspec + 30000].hh.UU.U2.b0 != 0)
    curspec = mem[curspec + 30000].hh.rh;
  if (tracing <= 0)
    return curspec;
  if (internal[35] <= 0) {
    printspec(427);
    return curspec;
  }
  if (internal[35] > 65536L)
    printspec(428);
  else
    printspec(429);
  return curspec;
}  /* makespec */


/*:402*/
/*463:*/

Static Void endround(x, y)
long x, y;
{
  y += 32768L - ycorr[octant - 1];
  x += y - xcorr[octant - 1];
  m1 = floorunscaled(x);
  n1 = floorunscaled(y);
  if (x - m1 * 65536L >= y - n1 * 65536L + zcorr[octant - 1])
    d1 = 1;
  else
    d1 = 0;
}  /*:463*/


/*465:*/

Static Void fillspec(h)
halfword h;
{
  halfword p, q, r, s;

  if (internal[9] > 0)
    beginedgetracing();
  p = h;
  /*------------------------------------*/
  print_start(&psfile);   /* Start cycle */
  /*------------------------------------*/
  do {
    octant = mem[p + 30003].int_;   /*466:*/
    q = p;
    while (mem[q + 30000].hh.UU.U2.b1 != 0)
      q = mem[q + 30000].hh.rh;   /*:466*/
    if (q != p) {  /*467:*/
      endround(mem[p + 30001].int_, mem[p + 30002].int_);
      m0 = m1;
      n0 = n1;
      d0 = d1;   /*:467*/
      endround(mem[q + 30001].int_, mem[q + 30002].int_);   /*468:*/
      if (n1 - n0 >= movesize)
	overflow(407, (long)movesize);
      move[0] = d0;
      moveptr = 0;
      r = p;
      do {
	s = mem[r + 30000].hh.rh;
	makemoves(mem[r + 30001].int_, mem[r + 30005].int_,
		  mem[s + 30003].int_, mem[s + 30001].int_,
		  mem[r + 30002].int_ + 32768L, mem[r + 30006].int_ + 32768L,
		  mem[s + 30004].int_ + 32768L, mem[s + 30002].int_ + 32768L,
		  xycorr[octant - 1], ycorr[octant - 1], 465L, octant);
	r = s;
      } while (r != q);
      move[moveptr] -= d1;
      if (internal[34] > 0)   /*:468*/
	smoothmoves(0L, (long)moveptr);
      movetoedges(m0, n0, m1, n1);
    }
    p = mem[q + 30000].hh.rh;
  } while (p != h);
  /*------------------------------------*/
  print_end(&psfile);   /* End cycle */
  /*------------------------------------*/
  tossknotlist(h);
  if (internal[9] > 0)
    endedgetracing();
}


/*:465*/
/*476:*/

Static Void dupoffset(w)
halfword w;
{
  halfword r;

  r = getnode(3L);
  mem[r + 30001].int_ = mem[w + 30001].int_;
  mem[r + 30002].int_ = mem[w + 30002].int_;
  mem[r + 30000].hh.rh = mem[w + 30000].hh.rh;
  mem[mem[w + 30000].hh.rh + 30000].hh.UU.lh = r;
  mem[r + 30000].hh.UU.lh = w;
  mem[w + 30000].hh.rh = r;
}

<stdin>, line 8080: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8084: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8086: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8091: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8092: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8093: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8094: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8156: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 8171: Warning: Symb, trivialknot, makepath, findoffset, splitforoffset, finoffsetprepol 'ODD' is not defined [221]


/*:476*/
/*477:*/

Static halfword makepen(h)
halfword h;
{
  smallnumber o, oo, k;
  halfword p, q, r, s, w, hh;
  long n;
  scaled dx, dy, mc;   /*479:*/

  q = h;
  r = mem[q + 30000].hh.rh;
  mc = abs(mem[h + 30001].int_);
/* p2c: <stdin>, line 8080: Warning: Symbol 'ABS' is not defined [221] */
  if (q == r) {
    hh = h;
    mem[h + 30000].hh.UU.U2.b1 = 0;
    if (mc < abs(mem[h + 30002].int_)) {
/* p2c: <stdin>, line 8084: Warning: Symbol 'ABS' is not defined [221] */
      mc = abs(mem[h + 30002].int_);
/* p2c: <stdin>, line 8086: Warning: Symbol 'ABS' is not defined [221] */
    }
  } else {
    o = 0;
    hh = -30000;
    while (true) {
      s = mem[r + 30000].hh.rh;
      if (mc < abs(mem[r + 30001].int_)) {
/* p2c: <stdin>, line 8091: Warning: Symbol 'ABS' is not defined [221] */
	mc = abs(mem[r + 30001].int_);
/* p2c: <stdin>, line 8092: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (mc < abs(mem[r + 30002].int_)) {
/* p2c: <stdin>, line 8093: Warning: Symbol 'ABS' is not defined [221] */
	mc = abs(mem[r + 30002].int_);
/* p2c: <stdin>, line 8094: Warning: Symbol 'ABS' is not defined [221] */
      }
      dx = mem[r + 30001].int_ - mem[q + 30001].int_;
      dy = mem[r + 30002].int_ - mem[q + 30002].int_;
      if (dx == 0) {
	if (dy == 0)
	  goto _L45;
      }
      if (abvscd(dx, mem[s + 30002].int_ - mem[r + 30002].int_, dy,
		 mem[s + 30001].int_ - mem[r + 30001].int_) < 0)
	    /*480:*/
	      goto _L45;
      if (dx > 0)
	octant = 1;
      else if (dx == 0) {
	if (dy > 0)
	  octant = 1;
	else
	  octant = 2;
      } else {
	dx = -dx;
	octant = 2;
      }
      if (dy < 0) {
	dy = -dy;
	octant += 2;
      } else if (dy == 0) {
	if (octant > 1)
	  octant = 4;
      }
      if (dx < dy)
	octant += 4;   /*:480*/
      mem[q + 30000].hh.UU.U2.b1 = octant;
      oo = octantnumber[octant - 1];
      if (o > oo) {
	if (hh != -30000)
	  goto _L45;
	hh = q;
      }
      o = oo;
      if (q == h && hh != -30000)
	goto _L30;
      q = r;
      r = s;
    }
_L30: ;   /*:479*/

  }
  if (mc >= 268402688L)
    goto _L45;
  p = getnode(10L);
  q = hh;
  mem[p + 30009].int_ = mc;
  mem[p + 30000].hh.UU.lh = -30000;
  if (mem[q + 30000].hh.rh != q)
    mem[p + 30000].hh.rh = -29999;
  for (k = 1; k <= 8; k++)   /*:481*/
  {  /*481:*/
    octant = octantcode[k - 1];
    n = 0;
    h = p + octant;
    while (true) {
      r = getnode(3L);
      skew(mem[q + 30001].int_, mem[q + 30002].int_, octant);
      mem[r + 30001].int_ = curx;
      mem[r + 30002].int_ = cury;
      if (n == 0)
	mem[h + 30000].hh.rh = r;   /*482:*/
      else if (odd(k)) {
/* p2c: <stdin>, line 8156: Warning: Symbol 'ODD' is not defined [221] */
	mem[w + 30000].hh.rh = r;
	mem[r + 30000].hh.UU.lh = w;
      } else {
	mem[w + 30000].hh.UU.lh = r;
	mem[r + 30000].hh.rh = w;
      }
      w = r;
      if (mem[q + 30000].hh.UU.U2.b1 != octant)
	goto _L31;
      q = mem[q + 30000].hh.rh;
      n++;
    }
_L31:   /*483:*/
    r = mem[h + 30000].hh.rh;
    if (odd(k)) {
/* p2c: <stdin>, line 8171: Warning: Symbol 'ODD' is not defined [221] */
      mem[w + 30000].hh.rh = r;
      mem[r + 30000].hh.UU.lh = w;
    } else {
      mem[w + 30000].hh.UU.lh = r;
      mem[r + 30000].hh.rh = w;
      mem[h + 30000].hh.rh = w;
      r = w;
    }
    if (mem[r + 30002].int_ != mem[mem[r + 30000].hh.rh + 30002].int_ ||
	n == 0) {
      dupoffset(r);
      n++;
    }
    r = mem[r + 30000].hh.UU.lh;
    /*:
    483*/
    if (mem[r + 30001].int_ != mem[mem[r + 30000].hh.UU.lh + 30001].int_)
      dupoffset(r);
    else
      n--;
    if (n >= 127)
      overflow(446, 127L);
    mem[h + 30000].hh.UU.lh = n;
  }
  goto _L40;
_L45:
  p = -29997;   /*478:*/
  if (mc >= 268402688L) {
    printnl(133);
    print(440L);
    helpptr = 2;
    helpline[1] = 441;
    helpline[0] = 442;
  } else {
    printnl(133);
    print(443L);
    helpptr = 3;
    helpline[2] = 444;
    helpline[1] = 445;
    helpline[0] = 442;
  }  /*:478*/
  putgeterror();
_L40:
  if (internal[5] > 0)
    printpen(p, 439, true);
  return p;

  /*:482*/
}


/*:477*/
/*484:*/
/*486:*/

Static halfword trivialknot(x, y)
long x, y;
{
  halfword p;

  p = getnode(7L);
  mem[p + 30000].hh.UU.U2.b0 = 1;
  mem[p + 30000].hh.UU.U2.b1 = 1;
  mem[p + 30001].int_ = x;
  mem[p + 30003].int_ = x;
  mem[p + 30005].int_ = x;
  mem[p + 30002].int_ = y;
  mem[p + 30004].int_ = y;
  mem[p + 30006].int_ = y;
  return p;
}  /*:486*/

<stdin>, line 8261: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 8264: Warning: Symbol 'ODD' is not defined [221]


Static halfword makepath(penhead)
halfword penhead;
{
  halfword p;
  char k;
  halfword h;
  long m, n;
  halfword w, ww;

  p = 29999;
  for (k = 1; k <= 8; k++) {
    octant = octantcode[k - 1];
    h = penhead + octant;
    n = mem[h + 30000].hh.UU.lh;
    w = mem[h + 30000].hh.rh;
    if (~odd(k)) {
/* p2c: <stdin>, line 8261: Warning: Symbol 'ODD' is not defined [221] */
      w = mem[w + 30000].hh.UU.lh;
    }
    for (m = 1; m <= n + 1; m++) {
      if (odd(k)) {
/* p2c: <stdin>, line 8264: Warning: Symbol 'ODD' is not defined [221] */
	ww = mem[w + 30000].hh.rh;
      } else
	ww = mem[w + 30000].hh.UU.lh;
      if (mem[ww + 30001].int_ != mem[w + 30001].int_ ||
	  mem[ww + 30002].int_ != mem[w + 30002].int_)
	  /*:485*/
	  {  /*485:*/
	unskew(mem[ww + 30001].int_, mem[ww + 30002].int_, octant);
	mem[p + 30000].hh.rh = trivialknot(curx, cury);
	p = mem[p + 30000].hh.rh;
      }
      w = ww;
    }
  }
  if (p == 29999) {
    w = mem[penhead + 30001].hh.rh;
    p = trivialknot(mem[w + 30001].int_ + mem[w + 30002].int_,
		    mem[w + 30002].int_);
    mem[59999].hh.rh = p;
  }
  mem[p + 30000].hh.rh = mem[59999].hh.rh;
  return (mem[59999].hh.rh);
}

<stdin>, line 8324: Warning: Symbol 'ODD' is not defined [221]


/*:484*/
/*488:*/

Static Void findoffset(x, y, p)
long x, y;
halfword p;
{
  char octant;
  short s;
  long n;
  halfword h, w, ww;   /*489:*/

  if (x > 0)
    octant = 1;
  else if (x == 0) {
    if (y <= 0) {
      if (y == 0) {
	curx = 0;
	cury = 0;
	goto _L10;
      }
      octant = 2;
    } else
      octant = 1;
  } else {
    x = -x;
    if (y == 0)
      octant = 4;
    else
      octant = 2;
  }
  if (y < 0) {
    octant += 2;
    y = -y;
  }
  if (x >= y)
    x -= y;
  else {   /*:489*/
    octant += 4;
    x = y - x;
    y -= x;
  }
  if (odd(octantnumber[octant - 1])) {
/* p2c: <stdin>, line 8324: Warning: Symbol 'ODD' is not defined [221] */
    s = -1;
  } else
    s = 1;
  h = p + octant;
  w = mem[mem[h + 30000].hh.rh + 30000].hh.rh;
  ww = mem[w + 30000].hh.rh;
  n = mem[h + 30000].hh.UU.lh;
  while (n > 1) {
    if (abvscd(x, mem[ww + 30002].int_ - mem[w + 30002].int_, y,
	       mem[ww + 30001].int_ - mem[w + 30001].int_) != s)
      goto _L30;
    w = ww;
    ww = mem[w + 30000].hh.rh;
    n--;
  }
_L30:
  unskew(mem[w + 30001].int_, mem[w + 30002].int_, octant);
_L10: ;

}


/*:488*/
/*491:*/
/*493:*/

Static Void splitforoffset(p, t)
halfword p;
long t;
{
  halfword q, r;

  q = mem[p + 30000].hh.rh;
  splitcubic(p, t, mem[q + 30001].int_, mem[q + 30002].int_);
  r = mem[p + 30000].hh.rh;
  if (mem[r + 30002].int_ < mem[p + 30002].int_)
    mem[r + 30002].int_ = mem[p + 30002].int_;
  else if (mem[r + 30002].int_ > mem[q + 30002].int_)
    mem[r + 30002].int_ = mem[q + 30002].int_;
  if (mem[r + 30001].int_ < mem[p + 30001].int_)
    mem[r + 30001].int_ = mem[p + 30001].int_;
  else if (mem[r + 30001].int_ > mem[q + 30001].int_)
    mem[r + 30001].int_ = mem[q + 30001].int_;
}

<stdin>, line 8388: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8388: Warning: Symbol 'ABS' is not defined [221]


/*:493*/
/*497:*/

Static Void finoffsetprep(p, k, w, x0, x1, x2, y0, y1, y2, rising, n)
halfword p, k, w;
long x0, x1, x2, y0, y1, y2;
boolean rising;
long n;
{
  halfword q, ww;
  scaled du, dv;
  long t0, t1, t2, v;
  fraction t, s;

  while (true) {
    q = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.UU.U2.b1 = k;
    if (rising) {   /*498:*/
      if (k == n)
	goto _L10;
      ww = mem[w + 30000].hh.rh;
    } else if (k == 1)
      goto _L10;
    else
      ww = mem[w + 30000].hh.UU.lh;
    du =, offsetprep, skewlineedges mem[ww + 30001].int_ - mem[w + 30001].int_;
    dv = mem[ww + 30002].int_ - mem[w + 30002].int_;
    if (abs(du) >= abs(dv)) {
/* p2c: <stdin>, line 8388: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 8388: Warning: Symbol 'ABS' is not defined [221] */
      s = makefraction(dv, du);
      t0 = takefraction(x0, s) - y0;
      t1 = takefraction(x1, s) - y1;
      t2 = takefraction(x2, s) - y2;
    } else {   /*:498*/
      s = makefraction(du, dv);
      t0 = x0 - takefraction(y0, s);
      t1 = x1 - takefraction(y1, s);
      t2 = x2 - takefraction(y2, s);
    }
    t = crossingpoint(t0, t1, t2);
    if (t >= 268435456L)   /*499:*/
      goto _L10;
    splitforoffset(p, t);
    mem[p + 30000].hh.UU.U2.b1 = k;
    p = mem[p + 30000].hh.rh;
    v = x0 - takefraction(x0 - x1, t);
    x1 -= takefraction(x1 - x2, t);
    x0 = v - takefraction(v - x1, t);
    v = y0 - takefraction(y0 - y1, t);
    y1 -= takefraction(y1 - y2, t);
    y0 = v - takefraction(v - y1, t);
    t1 -= takefraction(t1 - t2, t);
    if (t1 > 0)
      t1 = 0;
    t = crossingpoint(0L, -t1, -t2);
    if (t < 268435456L) {   /*:499*/
      splitforoffset(p, t);
      mem[mem[p + 30000].hh.rh + 30000].hh.UU.U2.b1 = k;
      v = x1 - takefraction(x1 - x2, t);
      x1 = x0 - takefraction(x0 - x1, t);
      x2 = x1 - takefraction(x1 - v, t);
      v = y1 - takefraction(y1 - y2, t);
      y1 = y0 - takefraction(y0 - y1, t);
      y2 = y1 - takefraction(y1 - v, t);
    }
    if (rising)
      k++;
    else
      k--;
    w = ww;
  }
_L10: ;

}  /*:497*/

<stdin>, line 8468: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8469: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8470: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8471: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8472: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8473: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8474: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8475: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8476: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8477: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8478: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8511: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8511: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8526: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 8526: Warning: Symbol 'ABS' is not defined [221]


Static Void offsetprep(c, h)
halfword c, h;
{
  halfword n, p, q, r, lh, ww, k, w;   /*495:*/
  long x0, x1, x2, y0, y1, y2, t0, t1, t2, du, dv, dx, dy, maxcoef, x0a, x1a,
       x2a, y0a, y1a, y2a;
  fraction t, s;

  /*:495*/
  p = c;
  n = mem[h + 30000].hh.UU.lh;
  lh = mem[h + 30000].hh.rh;
  while (mem[p + 30000].hh.UU.U2.b1 != 0) {
    q = mem[p + 30000].hh.rh;   /*494:*/
    if (n <= 1)
      mem[p + 30000].hh.UU.U2.b1 = 1;
    else {  /*496:*/
      x0 = mem[p + 30005].int_ - mem[p + 30001].int_;
      x2 = mem[q + 30001].int_ - mem[q + 30003].int_;
      x1 = mem[q + 30003].int_ - mem[p + 30005].int_;
      y0 = mem[p + 30006].int_ - mem[p + 30002].int_;
      y2 = mem[q + 30002].int_ - mem[q + 30004].int_;
      y1 = mem[q + 30004].int_ - mem[p + 30006].int_;
      maxcoef = abs(x0);
/* p2c: <stdin>, line 8468: Warning: Symbol 'ABS' is not defined [221] */
      if (abs(x1) > maxcoef) {
/* p2c: <stdin>, line 8469: Warning: Symbol 'ABS' is not defined [221] */
	maxcoef = abs(x1);
/* p2c: <stdin>, line 8470: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (abs(x2) > maxcoef) {
/* p2c: <stdin>, line 8471: Warning: Symbol 'ABS' is not defined [221] */
	maxcoef = abs(x2);
/* p2c: <stdin>, line 8472: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (abs(y0) > maxcoef) {
/* p2c: <stdin>, line 8473: Warning: Symbol 'ABS' is not defined [221] */
	maxcoef = abs(y0);
/* p2c: <stdin>, line 8474: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (abs(y1) > maxcoef) {
/* p2c: <stdin>, line 8475: Warning: Symbol 'ABS' is not defined [221] */
	maxcoef = abs(y1);
/* p2c: <stdin>, line 8476: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (abs(y2) > maxcoef) {
/* p2c: <stdin>, line 8477: Warning: Symbol 'ABS' is not defined [221] */
	maxcoef = abs(y2);
/* p2c: <stdin>, line 8478: Warning: Symbol 'ABS' is not defined [221] */
      }
      if (maxcoef == 0)
	goto _L45;
      while (maxcoef < 268435456L) {   /*:496*/
	maxcoef += maxcoef;
	x0 += x0;
	x1 += x1;
	x2 += x2;
	y0 += y0;
	y1 += y1;
	y2 += y2;
      }
      /*501:*/
      dx = x0;
      dy = y0;
      if (dx == 0) {
	if (dy == 0) {   /*:501*/
	  dx = x1;
	  dy = y1;
	  if (dx == 0) {
	    if (dy == 0) {
	      dx = x2;
	      dy = y2;
	    }
	  }
	}
      }
      if (dx == 0)   /*505:*/
	finoffsetprep(p, n, mem[mem[lh + 30000].hh.UU.lh + 30000].hh.UU.lh,
		      -x0, -x1, -x2, -y0, -y1, -y2, false, (long)n);
      else {  /*502:*/
	k = 1;
	w = mem[lh + 30000].hh.rh;
	while (true) {
	  if (k == n)
	    goto _L30;
	  ww = mem[w + 30000].hh.rh;
	  if (abvscd(dy, abs(mem[ww + 30001].int_ - mem[w + 30001].int_), dx,
		     abs(mem[ww + 30002].int_ - mem[w + 30002].int_)) < 0)
	    goto _L30;
/* p2c: <stdin>, line 8511: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 8511: Warning: Symbol 'ABS' is not defined [221] */
	  k++;
	  w = ww;
	}
_L30:   /*:502*/
	/*503:*/
	if (k == 1)
	  t = 268435457L;
	else {
	  ww = mem[w + 30000].hh.UU.lh;   /*498:*/
	  du = mem[ww + 30001].int_ - mem[w + 30001].int_;
	  dv = mem[ww + 30002].int_ - mem[w + 30002].int_;
	  if (abs(du) >= abs(dv)) {
/* p2c: <stdin>, line 8526: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 8526: Warning: Symbol 'ABS' is not defined [221] */
	    s = makefraction(dv, du);
	    t0 = takefraction(x0, s) - y0;
	    t1 = takefraction(x1, s) - y1;
	    t2 = takefraction(x2, s) - y2;
	  } else {   /*:498*/
	    s = makefraction(du, dv);
	    t0 = x0 - takefraction(y0, s);
	    t1 = x1 - takefraction(y1, s);
	    t2 = x2 - takefraction(y2, s);
	  }
	  t = crossingpoint(-t0, -t1, -t2);
	}
	if (t >= 268435456L)
	  finoffsetprep(p, k, w, x0, x1, x2, y0, y1, y2, true, (long)n);
	else {
	  splitforoffset(p, t);
	  r = mem[p + 30000].hh.rh;
	  x1a = x0 - takefraction(x0 - x1, t);
	  x1 -= takefraction(x1 - x2, t);
	  x2a = x1a - takefraction(x1a - x1, t);
	  y1a = y0 - takefraction(y0 - y1, t);
	  y1 -= takefraction(y1 - y2, t);
	  y2a = y1a - takefraction(y1a - y1, t);
	  finoffsetprep(p, k, w, x0, x1a, x2a, y0, y1a, y2a, true, (long)n);
	  x0 = x2a;
	  y0 = y2a;
	  t1 -= takefraction(t1 - t2, t);
	  if (t1 < 0)
	    t1 = 0;
	  t = crossingpoint(0L, t1, t2);
	  if (t < 268435456L)   /*:504*/
	  {  /*504:*/
	    splitforoffset(r, t);
	    x1a = x1 - takefraction(x1 - x2, t);
	    x1 = x0 - takefraction(x0 - x1, t);
	    x0a = x1 - takefraction(x1 - x1a, t);
	    y1a = y1 - takefraction(y1 - y2, t);
	    y1 = y0 - takefraction(y0 - y1, t);
	    y0a = y1 - takefraction(y1 - y1a, t);
	    finoffsetprep(mem[r + 30000].hh.rh, k, w, x0a, x1a, x2, y0a, y1a,
			  y2, true, (long)n);
	    x2 = x0a;
	    y2 = y0a;
	  }
	  finoffsetprep(r, k - 1, ww, -x0, -x1, -x2, -y0, -y1, -y2, false,
			(long)n);
	}  /*:503*/
      }
      /*:505*/
_L45: ;   /*:494*/

    }  /*492:*/
    do {
      r = mem[p + 30000].hh.rh;
      if (mem[p + 30001].int_ == mem[p + 30005].int_) {
	if (mem[p + 30002].int_ == mem[p + 30006].int_) {
	  if (mem[p + 30001].int_ == mem[r + 30003].int_) {
	    if (mem[p + 30002].int_ == mem[r + 30004].int_) {
	      if (mem[p + 30001].int_ == mem[r + 30001].int_) {
		if (mem[p + 30002].int_ == mem[r + 30002].int_) {
		  removecubic(p);
		  if (r == q)
		    q = p;
		  r = p;
		}
	      }
	    }
	  }
	}
      }
      p = r;   /*:492*/
    } while (p != q);
  }
}  /* offsetprep */


/*:491*/
/*506:*/
/*510:*/

Static Void skewlineedges(p, w, ww)
halfword p, w, ww;
{
  scaled x0, y0, x1, y1;

  if (mem[w + 30001].int_ == mem[ww + 30001].int_ &&
      mem[w + 30002].int_ == mem[ww + 30002].int_)
    return;
  x0 = mem[p + 30001].int_ + mem[w + 30001].int_;
  y0 = mem[p + 30002].int_ + mem[w, dualmoves, fillenvelope + 30002].int_;
  x1 = mem[p + 30001].int_ + mem[ww + 30001].int_;
  y1 = mem[p + 30002].int_ + mem[ww + 30002].int_;
  /*-------------------------------------*/
  sendline(x0, y0, x1, y1, (long)octant, 510L);
  /*-------------------------------------*/
  unskew(x0, y0, octant);
  x0 = curx;
  y0 = cury;
  unskew(x1, y1, octant);
  /*if internal[10]>65536 then begin printnl(451);printtwo(x0,y0);
print(450);printtwo(curx,cury);printnl(155);end;*/
  lineedges(x0, y0, curx, cury);
}


/*:510*/
/*518:*/

Static Void dualmoves(h, p, q)
halfword h, p, q;
{
  halfword r, s;   /*511:*/
  long m, n, mm0, mm1, k;
  halfword w, ww;
  short smoothbot, smoothtop;
  scaled xx, yy, xp, yp, delx, dely, tx, ty;
  long FORLIM;

  /*:511*/
  /*519:*/
  k = mem[h + 30000].hh.UU.lh + 1;
  ww = mem[h + 30000].hh.rh;
  w = mem[ww + 30000].hh.UU.lh;
  mm0 = floorunscaled(
      mem[p + 30001].int_ + mem[w + 30001].int_ - xycorr[octant - 1]);
  mm1 = floorunscaled(
      mem[q + 30001].int_ + mem[ww + 30001].int_ - xycorr[octant - 1]);
  FORLIM = n1 - n0 + 1;
  for (n = 1; n <= FORLIM; n++)
    envmove[n] = mm1;
  envmove[0] = mm0;
  moveptr = 0;
  m = mm0;   /*:519*/
  r = p;
  while (true) {
    if (r == q)
      smoothtop = moveptr;
    while (mem[r + 30000].hh.UU.U2.b1 != k)   /*:521*/
    {  /*521:*/
      xx = mem[r + 30001].int_ + mem[w + 30001].int_;
      yy = mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L;
      /*if internal[10]>65536 then begin printnl(452);printint(k);print(453);
unskew(xx,yy-32768,octant);printtwo(curx,cury);end;*/
      /*------------*/
      my_xx = xx;
      my_yy = yy;
      /*------------*/
      if (mem[r + 30000].hh.UU.U2.b1 < k) {
	k--;
	w = mem[w + 30000].hh.UU.lh;
	xp = mem[r + 30001].int_ + mem[w + 30001].int_;
	yp = mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L;
	if (yp != yy) {  /*522:*/
	  ty = floorscaled(yy - ycorr[octant - 1]);
	  dely = yp - yy;
	  yy -= ty;
	  ty = yp - ycorr[octant - 1] - ty;
	  if (ty >= 65536L) {
	    delx = xp - xx;
	    yy = 65536L - yy;
	    while (true) {
	      if (m < envmove[moveptr])
		envmove[moveptr] = m;
	      tx = takefraction(delx, makefraction(yy, dely));
	      if (abvscd(tx, dely, delx, yy) + xycorr[octant - 1] > 0)
		tx--;
	      m = floorunscaled(xx + tx);
	      ty -= 65536L;
	      moveptr++;
	      if (ty < 65536L)
		goto _L31;
	      yy += 65536L;
	    }
_L31:
	    if (m < envmove[moveptr])
	      envmove[moveptr] = m;
	  }
	}  /*:522*/
      } else {
	k++;
	w = mem[w + 30000].hh.rh;
	xp = mem[r + 30001].int_ + mem[w + 30001].int_;
	yp = mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L;
      }
      /*if internal[10]>65536 then begin print(450);unskew(xp,yp-32768,octant);
printtwo(curx,cury);printnl(155);end;*/
      /*---------------------------------------------------*/
      sendline(my_xx, my_yy - 32768L, xp, yp - 32768L, (long)octant, 521L);
      /*---------------------------------------------------*/
      m = floorunscaled(xp - xycorr[octant - 1]);
      moveptr = floorunscaled(yp - ycorr[octant - 1]) - n0;
      if (m < envmove[moveptr])
	envmove[moveptr] = m;
    }
    if (r == p)
      smoothbot = moveptr;
    if (r == q)
      goto _L30;
    move[moveptr] = 1;
    n = moveptr;
    s = mem[r + 30000].hh.rh;
    makemoves(mem[r + 30001].int_ + mem[w + 30001].int_,
	      mem[r + 30005].int_ + mem[w + 30001].int_,
	      mem[s + 30003].int_ + mem[w + 30001].int_,
	      mem[s + 30001].int_ + mem[w + 30001].int_,
	      mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L,
	      mem[r + 30006].int_ + mem[w + 30002].int_ + 32768L,
	      mem[s + 30004].int_ + mem[w + 30002].int_ + 32768L,
	      mem[s + 30002].int_ + mem[w + 30002].int_ + 32768L,
	      xycorr[octant - 1], ycorr[octant - 1], 518L, octant);
	/*520:*/
    do {
      if (m < envmove[n])
	envmove[n] = m;
      m += move[n] - 1;
      n++;   /*:520*/
    } while (n <= moveptr);
    r = s;
  }
_L30:   /*523:*/
  /*if(m<>mm1)or(moveptr<>n1-n0)then confusion(50);*/
  move[0] = d0 + envmove[1] - mm0;
  FORLIM = moveptr;
  for (n = 1; n <= FORLIM; n++)
    move[n] = envmove[n + 1] - envmove[n] + 1;
  move[moveptr] -= d1;
  if (internal[34] > 0)
    smoothmoves((long)smoothbot, (long)smoothtop);
  movetoedges(m0, n0, m1, n1);
  if (mem[q + 30006].int_ == 1) {
    w = mem[h + 30000].hh.rh;
    skewlineedges(q, w, mem[w + 30000].hh.UU.lh);
  }  /*:523*/
}  /*:518*/

<stdin>, line 8772: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 8790: Warning: Symbol 'ODD' is not defined [221]


Static Void fillenvelope(spechead)
halfword spechead;
{
  halfword p, q, r, s, h, www;   /*511:*/
  long m, n, mm0, mm1, k;
  halfword w, ww;
  short smoothbot, smoothtop;
  scaled xx, yy, xp, yp, delx, dely, tx, ty;   /*:511*/
  long FORLIM;

  if (internal[9] > 0)
    beginedgetracing();
  /*------------------------------------*/
  print_start(&psfile);   /* Start cycle */
  /*------------------------------------*/
  p = spechead;
  do {
    octant = mem[p + 30003].int_;
    h = curpen + octant;   /*466:*/
    q = p;
    while (mem[q + 30000].hh.UU.U2.b1 != 0)   /*508:*/
      q = mem[q + 30000].hh.rh;   /*:466*/
    w = mem[h + 30000].hh.rh;
    if (mem[p + 30004].int_ == 1)
      w = mem[w + 30000].hh.UU.lh;
    /*if internal[10]>65536 then[509:]begin printnl(447);
print(octantdir[octant]);print(425);printint(mem[h].hh.lh);print(448);
if mem[h].hh.lh<>1 then printchar(115);print(449);
unskew(mem[p+1].int+mem[w+1].int,mem[p+2].int+mem[w+2].int,octant);
printtwo(curx,cury);ww:=mem[h].hh.rh;
if mem[q+6].int=1 then ww:=mem[ww].hh.lh;print(450);
unskew(mem[q+1].int+mem[ww+1].int,mem[q+2].int+mem[ww+2].int,octant);
printtwo(curx,cury);end[:509];*/
    ww = mem[h + 30000].hh.rh;
    www = ww;
    if (odd(octantnumber[octant - 1])) {
/* p2c: <stdin>, line 8772: Warning: Symbol 'ODD' is not defined [221] */
      www = mem[www + 30000].hh.UU.lh;
    } else
      ww = mem[ww + 30000].hh.UU.lh;
    if (w != ww)
      skewlineedges(p, w, ww);
    endround(mem[p + 30001].int_ + mem[ww + 30001].int_,
	     mem[p + 30002].int_ + mem[ww + 30002].int_);
    m0 = m1;
    n0 = n1;
    d0 = d1;
    endround(mem[q + 30001].int_ + mem[www + 30001].int_,
	     mem[q + 30002].int_ + mem[www + 30002].int_);
    if (n1 - n0 >= movesize)   /*:508*/
      overflow(407, (long)movesize);
    offsetprep(p, h);
    /*466:*/
    q = p;
    while (mem[q + 30000].hh.UU.U2.b1 != 0)   /*512:*/
      q = mem[q + 30000].hh.rh;   /*:466*/
    if (odd(octantnumber[octant - 1])) {  /*513:*/
      k = 0;
      w = mem[h + 30000].hh.rh;
      ww = mem[w + 30000].hh.UU.lh;
      mm0 = floorunscaled(
	  mem[p + 30001].int_ + mem[w + 30001].int_ - xycorr[octant - 1]);
      mm1 = floorunscaled(
	  mem[q + 30001].int_ + mem[ww + 30001].int_ - xycorr[octant - 1]);
      FORLIM = n1 - n0;
      for (n = 0; n <= FORLIM; n++)
	envmove[n] = mm0;
      envmove[n1 - n0] = mm1;
      moveptr = 0;
      m = mm0;   /*:513*/
      r = p;
      mem[q + 30000].hh.UU.U2.b1 = mem[h + 30000].hh.UU.lh + 1;
      while (true) {
	if (r == q)
	  smoothtop = moveptr;
	while (mem[r + 30000].hh.UU.U2.b1 != k)   /*:515*/
	{  /*515:*/
	  xx = mem[r + 30001].int_ + mem[w + 30001].int_;
	  yy = mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L;
	  /*if internal[10]>65536 then begin printnl(452);printint(k);print(453);
unskew(xx,yy-32768,octant);printtwo(curx,cury);end;*/
	  /*------------*/
	  my_xx = xx;
	  my_yy = yy;
	  /*------------*/
	  if (mem[r + 30000].hh.UU.U2.b1 > k) {
	    k++;
	    w = mem[w + 30000].hh.rh;
	    xp = mem[r + 30001].int_ + mem[w + 30001].int_;
	    yp = mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L;
	    if (yp != yy) {  /*516:*/
	      ty = floorscaled(yy - ycorr[octant - 1]);
	      dely = yp - yy;
	      yy -= ty;
	      ty = yp - ycorr[octant - 1] - ty;
	      if (ty >= 65536L) {
		delx = xp - xx;
		yy = 65536L - yy;
		while (true) {
		  tx = takefraction(delx, makefraction(yy, dely));
		  if (abvscd(tx, dely, delx, yy) + xycorr[octant - 1] > 0)
		    tx--;
		  m = floorunscaled(xx + tx);
		  if (m > envmove[moveptr])
		    envmove[moveptr] = m;
		  ty -= 65536L;
		  if (ty < 65536L)
		    goto _L31;
		  yy += 65536L;
		  moveptr++;
		}
_L31:, makeellipse ;

	      }
	    }  /*:516*/
	  } else {
	    k--;
	    w = mem[w + 30000].hh.UU.lh;
	    xp = mem[r + 30001].int_ + mem[w + 30001].int_;
	    yp = mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L;
	  }
	  /*if internal[10]>65536 then begin print(450);unskew(xp,yp-32768,octant);
printtwo(curx,cury);printnl(155);end;*/
	  /*---------------------------------------------------*/
	  sendline(my_xx, my_yy - 32768L, xp, yp - 32768L, (long)octant, 515L);
	  /*---------------------------------------------------*/
	  m = floorunscaled(xp - xycorr[octant - 1]);
	  moveptr = floorunscaled(yp - ycorr[octant - 1]) - n0;
	  if (m > envmove[moveptr])
	    envmove[moveptr] = m;
	}
	if (r == p)
	  smoothbot = moveptr;
	if (r == q)
	  goto _L30;
	move[moveptr] = 1;
	n = moveptr;
	s = mem[r + 30000].hh.rh;
	makemoves(mem[r + 30001].int_ + mem[w + 30001].int_,
		  mem[r + 30005].int_ + mem[w + 30001].int_,
		  mem[s + 30003].int_ + mem[w + 30001].int_,
		  mem[s + 30001].int_ + mem[w + 30001].int_,
		  mem[r + 30002].int_ + mem[w + 30002].int_ + 32768L,
		  mem[r + 30006].int_ + mem[w + 30002].int_ + 32768L,
		  mem[s + 30004].int_ + mem[w + 30002].int_ + 32768L,
		  mem[s + 30002].int_ + mem[w + 30002].int_ + 32768L,
		  xycorr[octant - 1], ycorr[octant - 1], 512L, octant);
	    /*514:*/
	do {
	  m += move[n] - 1;
	  if (m > envmove[n])
	    envmove[n] = m;
	  n++;   /*:514*/
	} while (n <= moveptr);
	r = s;
      }
_L30:   /*517:*/
      /*if(m<>mm1)or(moveptr<>n1-n0)then confusion(49);*/
      move[0] = d0 + envmove[0] - mm0;
      FORLIM = moveptr;
      for (n = 1; n <= FORLIM; n++)
	move[n] = envmove[n] - envmove[n - 1] + 1;
      move[moveptr] -= d1;
      if (internal[34] > 0)
	smoothmoves((long)smoothbot, (long)smoothtop);
      movetoedges(m0, n0, m1, n1);
      if (mem[q + 30006].int_ == 0) {
	w = mem[h + 30000].hh.rh;
	skewlineedges(q, mem[w + 30000].hh.UU.lh, w);
      }  /*:517*/
    } else
      dualmoves(h, p, q);
/* p2c: <stdin>, line 8790: Warning: Symbol 'ODD' is not defined [221] */
    mem[q + 30000].hh.UU.U2.b1 = 0;   /*:512*/
    p = mem[q + 30000].hh.rh;
  } while (p != spechead);
  /*------------------------------------*/
  print_end(&psfile);   /* End cycle */
  /*------------------------------------*/
  if (internal[9] > 0)
    endedgetracing();
  tossknotlist(spechead);
}  /*:506*/

<stdin>, line 8916: Note: Using % for possibly-negative arguments [317]
<stdin>, line 8919: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 8955: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9005: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9006: Warning: Symbol 'ABS' is not defined [221]


/*527:*/

Static halfword makeellipse(majoraxis, minoraxis, theta)
long majoraxis, minoraxis, theta;
{  /*530:*/
  halfword p, q, r, s, h;
  long alpha, beta, gamma, delta, c, d, u, v;
  boolean symmetric;   /*528:*/

  if (majoraxis == minoraxis || theta % 94371840L == 0) {
/* p2c: <stdin>, line 8916:
 * Note: Using % for possibly-negative arguments [317] */
    symmetric = true;
    alpha = 0;
    if (odd(theta / 94371840L)) {
/* p2c: <stdin>, line 8919: Warning: Symbol 'ODD' is not defined [221] */
      beta = majoraxis;
      gamma = minoraxis;
      nsin = 268435456L;
      ncos = 0;
    } else {
      beta = minoraxis;
      gamma = majoraxis;
    }
  } else {
    symmetric = false;
    nsincos(theta);
    gamma = takefraction(majoraxis, nsin);
    delta = takefraction(minoraxis, ncos);
    beta = pythadd(gamma, delta);
    alpha = takefraction(takefraction(majoraxis, makefraction(gamma, beta)),
			 ncos) - takefraction(
	      takefraction(minoraxis, makefraction(delta, beta)), nsin);
    alpha = (alpha + 32768L) / 65536L;
    gamma = pythadd(takefraction(majoraxis, ncos),
		    takefraction(minoraxis, nsin));
  }
  beta = (beta + 32768L) / 65536L;
  gamma = (gamma + 32768L) / 65536L;   /*:530*/
  p = getnode(7L);
  q = getnode(7L);
  r = getnode(7L);
  if (symmetric)
    s = -30000;
  else
    s = getnode(7L);
  h = p;
  mem[p + 30000].hh.rh = q;
  mem[q + 30000].hh.rh = r;
  mem[r + 30000].hh.rh = s;   /*529:*/
  if (beta == 0)
    beta = 1;
  if (gamma == 0)
    gamma = 1;
  if (gamma <= abs(alpha)) {
/* p2c: <stdin>, line 8955: Warning: Symbol 'ABS' is not defined [221] */
    if (alpha > 0)
      alpha = gamma - 1;
    else
      alpha = 1 - gamma;   /*:529*/
  }
  mem[p + 30001].int_ = -alpha * 32768L;
  mem[p + 30002].int_ = -beta * 32768L;
  mem[q + 30001].int_ = gamma * 32768L;
  mem[q + 30002].int_ = mem[p + 30002].int_;
  mem[r + 30001].int_ = mem[q + 30001].int_;
  mem[p + 30005].int_ = 0;
  mem[q + 30003].int_ = -32768L;
  mem[q + 30005].int_ = 32768L;
  mem[r + 30003].int_ = 0;
  mem[r + 30005].int_ = 0;
  mem[p + 30006].int_ = beta;
  mem[q + 30006].int_ = gamma;
  mem[r + 30006].int_ = beta;
  mem[q + 30004].int_ = gamma + alpha;
  if (symmetric) {   /*531:*/
    mem[r + 30002].int_ = 0;
    mem[r + 30004].int_ = beta;
  } else {   /*:528*/
    mem[r + 30002].int_ = -mem[p + 30002].int_;
    mem[r + 30004].int_ = beta + beta;
    mem[s + 30001].int_ = -mem[p + 30001].int_;
    mem[s + 30002].int_ = mem[r + 30002].int_;
    mem[s + 30003].int_ = 32768L;
    mem[s + 30004].int_ = gamma - alpha;
  }
  while (true) {
    u = mem[p + 30005].int_ + mem[q + 30005].int_;
    v = mem[q + 30003].int_ + mem[r + 30003].int_;
    c = mem[p + 30006].int_ + mem[q + 30006].int_;   /*533:*/
    delta = pythadd(u, v);
    if (majoraxis == minoraxis)
      d = majoraxis;
    else {
      if (theta == 0) {
	alpha = u;
	beta = v;
      } else {
	alpha = takefraction(u, ncos) + takefraction(v, nsin);
	beta = takefraction(v, ncos) - takefraction(u, nsin);
      }
      alpha = makefraction(alpha, delta);
      beta = makefraction(beta, delta);
      d = pythadd(takefraction(majoraxis, alpha),
		  takefraction(minoraxis, beta));
    }
    d = takefraction(d, delta);
    alpha = abs(u);
/* p2c: <stdin>, line 9005: Warning: Symbol 'ABS' is not defined [221] */
    beta = abs(v);
/* p2c: <stdin>, line 9006: Warning: Symbol 'ABS' is not defined [221] */
    if (alpha < beta) {
      delta = alpha;
      alpha = beta;
      beta = delta;
    }
    if (internal[37] != 0)
      d -= takefraction(internal[37], beta + beta);
    d = (d + 4) / 8;
    alpha /= 32768L;
    if (d < alpha)
      d = alpha;   /*:533*/
    delta = c - d;
    if (delta > 0) {   /*532:*/
      if (delta > mem[r + 30004].int_)
	delta = mem[r + 30004].int_;
      if (delta >= mem[q + 30004].int_) {  /*534:*/
	delta = mem[q + 30004].int_;
	mem[p + 30006].int_ = c - delta;
	mem[p + 30005].int_ = u;
	mem[q + 30003].int_ = v;
	mem[q + 30001].int_ -= delta * mem[r + 30003].int_;
	mem[q + 30002].int_ += delta * mem[q + 30005].int_;
	mem[r + 30004].int_ -= delta;
      } else {   /*:534*/
	s = getnode(7L);
	mem[p + 30000].hh.rh = s;
	mem[s + 30000].hh.rh = q;
	mem[s + 30001].int_ = mem[q + 30001].int_ + delta * mem[q + 30003].int_;
	mem[s + 30002].int_ = mem[q + 30002].int_ - delta * mem[p + 30005].int_;
	mem[q + 30001].int_ -= delta * mem[r + 30003].int_;
	mem[q + 30002].int_ += delta * mem[q + 30005].int_;
	mem[s + 30003].int_ = mem[q + 30003].int_;
	mem[s + 30005].int_ = u;
	mem[q + 30003].int_ = v;
	mem[s + 30006].int_ = c - delta;
	mem[s + 30004].int_ = mem[q + 30004].int_ - delta;
	mem[q + 30004].int_ = delta;
	mem[r + 30004].int_ -= delta;
      }  /*:535*/
    } else
      p = q;
    while (true) {
      q = mem[p + 30000].hh.rh;
      if (q == -30000)
	goto _L30;
      if (mem[q + 30004].int_ == 0) {
	mem[p + 30000].hh.rh = mem[q + 30000].hh.rh;
	mem[p + 30006].int_ = mem[q + 30006].int_;
	mem[p + 30005].int_ = mem[q + 30005].int_;
	freenode(q, 7);
	continue;
      }
      r = mem[q + 30000].hh.rh;
      if (r == -30000)
	goto _L30;
      if (mem[r + 30004].int_ != 0)
	goto _L40;
      mem[p + 30000].hh.rh = r;
      freenode(q, 7);
      p = r;
    }
_L40: ;   /*:532*/

  }
_L30:   /*:531*/
  if (symmetric)   /*:536*/
  {  /*536:*/
    s = -30000;
    q = h;
    while (true) {
      r = getnode(7L);
      mem[r + 30000].hh.rh = s;
      s = r;
      mem[s + 30001].int_ = mem[q + 30001].int_;
      mem[s + 30002].int_ = -mem[q + 30002].int_;
      if (q == p)
	g, finddirectiontime, cubicintersectionoto _L31;
      q = mem[q + 30000].hh.rh;
      if (mem[q + 30002].int_ == 0)
	goto _L31;
    }
_L31:
    mem[p + 30000].hh.rh = s;
    beta = -mem[h + 30002].int_;
    while (mem[p + 30002].int_ != beta)
      p = mem[p + 30000].hh.rh;
    q = mem[p + 30000].hh.rh;
  }
  /*537:*/
  if (q != -30000) {
    if (mem[h + 30005].int_ == 0) {
      p = h;
      h = mem[h + 30000].hh.rh;
      freenode(p, 7);
      mem[q + 30001].int_ = -mem[h + 30001].int_;
    }
    p = q;
  } else
    q = p;
  r = mem[h + 30000].hh.rh;
  do {
    s = getnode(7L);
    mem[p + 30000].hh.rh = s;
    p = s;
    mem[p + 30001].int_ = -mem[r + 30001].int_;
    mem[p + 30002].int_ = -mem[r + 30002].int_;
    r = mem[r + 30000].hh.rh;
  } while (r != q);
  mem[p + 30000].hh.rh = h;   /*:537*/
  return h;

  /*535:*/
}

<stdin>, line 9132: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9132: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9133: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9142: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9162: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9163: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9164: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9165: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9166: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9167: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9168: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9169: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9170: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9171: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 9172: Warning: Symbol 'ABS' is not defined [221]


/*:527*/
/*539:*/

Static long finddirectiontime(x, y, h)
long x, y;
halfword h;
{   /*:542*/
  long Result;
  scaled max, n, tt;   /*542:*/
  halfword p, q;
  scaled x1, x2, x3, y1, y2, y3;
  angle theta, phi;
  fraction t;

  /*540:*/
  if (abs(x) < abs(y)) {
/* p2c: <stdin>, line 9132: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 9132: Warning: Symbol 'ABS' is not defined [221] */
    x = makefraction(x, abs(y));
/* p2c: <stdin>, line 9133: Warning: Symbol 'ABS' is not defined [221] */
    if (y > 0)
      y = 268435456L;
    else
      y = -268435456L;
  } else if (x == 0) {
    Result = 0;
    goto _L10;
  } else {
    y = makefraction(y, abs(x));
/* p2c: <stdin>, line 9142: Warning: Symbol 'ABS' is not defined [221] */
    if (x > 0)
      x = 268435456L;
    else
      x = -268435456L;
  }
  n = 0;
  p = h;
  while (true) {
    if (mem[p + 30000].hh.UU.U2.b1 == 0)
      goto _L45;
    q = mem[p + 30000].hh.rh;
    /*541:*/
    tt = 0;   /*543:*/
    x1 = mem[p + 30005].int_ - mem[p + 30001].int_;
    x2 = mem[q + 30003].int_ - mem[p + 30005].int_;
    x3 = mem[q + 30001].int_ - mem[q + 30003].int_;
    y1 = mem[p + 30006].int_ - mem[p + 30002].int_;
    y2 = mem[q + 30004].int_ - mem[p + 30006].int_;
    y3 = mem[q + 30002].int_ - mem[q + 30004].int_;
    max = abs(x1);
/* p2c: <stdin>, line 9162: Warning: Symbol 'ABS' is not defined [221] */
    if (abs(x2) > max) {
/* p2c: <stdin>, line 9163: Warning: Symbol 'ABS' is not defined [221] */
      max = abs(x2);
/* p2c: <stdin>, line 9164: Warning: Symbol 'ABS' is not defined [221] */
    }
    if (abs(x3) > max) {
/* p2c: <stdin>, line 9165: Warning: Symbol 'ABS' is not defined [221] */
      max = abs(x3);
/* p2c: <stdin>, line 9166: Warning: Symbol 'ABS' is not defined [221] */
    }
    if (abs(y1) > max) {
/* p2c: <stdin>, line 9167: Warning: Symbol 'ABS' is not defined [221] */
      max = abs(y1);
/* p2c: <stdin>, line 9168: Warning: Symbol 'ABS' is not defined [221] */
    }
    if (abs(y2) > max) {
/* p2c: <stdin>, line 9169: Warning: Symbol 'ABS' is not defined [221] */
      max = abs(y2);
/* p2c: <stdin>, line 9170: Warning: Symbol 'ABS' is not defined [221] */
    }
    if (abs(y3) > max) {
/* p2c: <stdin>, line 9171: Warning: Symbol 'ABS' is not defined [221] */
      max = abs(y3);
/* p2c: <stdin>, line 9172: Warning: Symbol 'ABS' is not defined [221] */
    }
    if (max == 0)
      goto _L40;
    while (max < 134217728L) {
      max += max;
      x1 += x1;
      x2 += x2;
      x3 += x3;
      y1 += y1;
      y2 += y2;
      y3 += y3;
    }
    t = x1;
    x1 = takefraction(x1, x) + takefraction(y1, y);
    y1 = takefraction(y1, x) - takefraction(t, y);
    t = x2;
    x2 = takefraction(x2, x) + takefraction(y2, y);
    y2 = takefraction(y2, x) - takefraction(t, y);
    t = x3;
    x3 = takefraction(x3, x) + takefraction(y3, y);
    y3 = takefraction(y3, x) - takefraction(t, y);   /*:543*/
    if (y1 == 0) {
      if (x1 >= 0)
	goto _L40;
    }
    if (n > 0) {  /*544:*/
      theta = narg(x1, y1);
      if (theta >= 0) {
	if (phi <= 0) {
	  if (phi >= theta - 188743680L)
	    goto _L40;
	}
      }
      /*:
      544*/
      if (theta <= 0) {
	if (phi >= 0) {
	  if (phi <= theta + 188743680L)
	    goto _L40;
	}
      }
      if (p == h)
	goto _L45;
    }
    if (x3 != 0 || y3 != 0)
      phi = narg(x3, y3);
    /*546:*/
    if (x1 < 0) {
      if (x2 < 0) {
	if (x3 < 0)
	  goto _L30;
      }
    }
    if (abvscd(y1, y3, y2, y2) == 0)   /*:548*/
    {  /*548:*/
      if (abvscd(y1, y2, 0L, 0L) < 0) {
	t = makefraction(y1, y1 - y2);
	x1 -= takefraction(x1 - x2, t);
	x2 -= takefraction(x2 - x3, t);
	if (x1 - takefraction(x1 - x2, t) >= 0) {
	  tt = (t + 2048) / 4096;
	  goto _L40;
	}
      } else if (y3 == 0) {
	if (y1 == 0) {  /*549:*/
	  t = crossingpoint(-x1, -x2, -x3);
	  if (t <= 268435456L) {
	    tt = (t + 2048) / 4096;
	    goto _L40;
	  }
	  if (abvscd(x1, x3, x2, x2) <= 0) {
	    t = makefraction(x1, x1 - x2);
	    tt = (t + 2048) / 4096;
	    goto _L40;
	  }
	} else if (x3 >= 0) {
	  tt = 65536L;
	  goto _L40;
	}
      }
      goto _L30;
    }
    if (y1 <= 0) {
      if (y1 < 0) {
	y1 = -y1;
	y2 = -y2;
	y3 = -y3;
      } else if (y2 > 0) {
	y2 = -y2;
	y3 = -y3;
      }
    }
    t = crossingpoint(y1, y2, y3);
    if (t > 268435456L)
      goto _L30;
    y2 -= takefraction(y2 - y3, t);
    x1 -= takefraction(x1 - x2, t);
    x2 -= takefraction(x2 - x3, t);
    x1 -= takefraction(x1 - x2, t);
    if (x1 >= 0) {
      tt = (t + 2048) / 4096;
      goto _L40;
    }
    if (y2 > 0)
      y2 = 0;
    tt = t;
    t = crossingpoint(0L, -y2, -y3);
    if (t > 268435456L)
      goto _L30;
    x1 -= takefraction(x1 - x2, t);
    x2 -= takefraction(x2 - x3, t);
    if (x1 - takefraction(x1 - x2, t) >= 0) {   /*:547*/
      t = tt - takefraction(tt - 268435456L, t);
      tt = (t + 2048) / 4096;
      goto _L40;
    }
_L30:   /*:546*/
    /*:541*/
    p = q;
    n += 65536L;
  }
_L45:
  Result = -65536L;
  goto _L10;
_L40:
  Result = n + tt;
_L10:

  return Result;

  /*:540*/
  /*:549*/
  /*547:*/
}

<stdin>, line 9793: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 9794: Warning: Symbol 'ODD' is not defined [221]


/*:539*/
/*556:*/

Static Void cubicintersection(p, pp)
halfword p, pp;
{
  halfword q, qq;

  timetogo = 5000;
  maxt = 2;   /*558:*/
  q = mem[p + 30000].hh.rh;
  qq = mem[pp + 30000].hh.rh;
  bisectptr = 20;
  bisectstack[bisectptr - 5] = mem[p + 30005].int_ - mem[p + 30001].int_;
  bisectstack[bisectptr - 4] = mem[q + 30003].int_ - mem[p + 30005].int_;
  bisectstack[bisectptr - 3] = mem[q + 30001].int_ - mem[q + 30003].int_;
  if (bisectstack[bisectptr - 5] < 0) {
    if (bisectstack[bisectptr - 3] >= 0) {
      if (bisectstack[bisectptr - 4] < 0)
	bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
				     bisectstack[bisectptr - 4];
      else
	bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5];
      bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
	  bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
      if (bisectstack[bisectptr - 1] < 0)
	bisectstack[bisectptr - 1] = 0;
    } else {
      bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
	  bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
      if (bisectstack[bisectptr - 2] > bisectstack[bisectptr - 5])
	bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5];
      bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
				   bisectstack[bisectptr - 4];
      if (bisectstack[bisectptr - 1] < 0)
	bisectstack[bisectptr - 1] = 0;
    }
  } else if (bisectstack[bisectptr - 3] <= 0) {
    if (bisectstack[bisectptr - 4] > 0)
      bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
				   bisectstack[bisectptr - 4];
    else
      bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5];
    bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
	bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
    if (bisectstack[bisectptr - 2] > 0)
      bisectstack[bisectptr - 2] = 0;
  } else {
    bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
	bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
    if (bisectstack[bisectptr - 1] < bisectstack[bisectptr - 5])
      bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5];
    bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
				 bisectstack[bisectptr - 4];
    if (bisectstack[bisectptr - 2] > 0)
      bisectstack[bisectptr - 2] = 0;
  }
  bisectstack[bisectptr - 10] = mem[p + 30006].int_ - mem[p + 30002].int_;
  bisectstack[bisectptr - 9] = mem[q + 30004].int_ - mem[p + 30006].int_;
  bisectstack[bisectptr - 8] = mem[q + 30002].int_ - mem[q + 30004].int_;
  if (bisectstack[bisectptr - 10] < 0) {
    if (bisectstack[bisectptr - 8] >= 0) {
      if (bisectstack[bisectptr - 9] < 0)
	bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
				     bisectstack[bisectptr - 9];
      else
	bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10];
      bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
	  bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
      if (bisectstack[bisectptr - 6] < 0)
	bisectstack[bisectptr - 6] = 0;
    } else {
      bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
	  bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
      if (bisectstack[bisectptr - 7] > bisectstack[bisectptr - 10])
	bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10];
      bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
				   bisectstack[bisectptr - 9];
      if (bisectstack[bisectptr - 6] < 0)
	bisectstack[bisectptr - 6] = 0;
    }
  } else if (bisectstack[bisectptr - 8] <= 0) {
    if (bisectstack[bisectptr - 9] > 0)
      bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
				   bisectstack[bisectptr - 9];
    else
      bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10];
    bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
	bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
    if (bisectstack[bisectptr - 7] > 0)
      bisectstack[bisectptr - 7] = 0;
  } else {
    bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
	bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
    if (bisectstack[bisectptr - 6] < bisectstack[bisectptr - 10])
      bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10];
    bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
				 bisectstack[bisectptr - 9];
    if (bisectstack[bisectptr - 7] > 0)
      bisectstack[bisectptr - 7] = 0;
  }
  bisectstack[bisectptr - 15] = mem[pp + 30005].int_ - mem[pp + 30001].int_;
  bisectstack[bisectptr - 14] = mem[qq + 30003].int_ - mem[pp + 30005].int_;
  bisectstack[bisectptr - 13] = mem[qq + 30001].int_ - mem[qq + 30003].int_;
  if (bisectstack[bisectptr - 15] < 0) {
    if (bisectstack[bisectptr - 13] >= 0) {
      if (bisectstack[bisectptr - 14] < 0)
	bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
				      bisectstack[bisectptr - 14];
      else
	bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15];
      bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
	  bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
      if (bisectstack[bisectptr - 11] < 0)
	bisectstack[bisectptr - 11] = 0;
    } else {
      bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
	  bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
      if (bisectstack[bisectptr - 12] > bisectstack[bisectptr - 15])
	bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15];
      bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
				    bisectstack[bisectptr - 14];
      if (bisectstack[bisectptr - 11] < 0)
	bisectstack[bisectptr - 11] = 0;
    }
  } else if (bisectstack[bisectptr - 13] <= 0) {
    if (bisectstack[bisectptr - 14] > 0)
      bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
				    bisectstack[bisectptr - 14];
    else
      bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15];
    bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
	bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
    if (bisectstack[bisectptr - 12] > 0)
      bisectstack[bisectptr - 12] = 0;
  } else {
    bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
	bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
    if (bisectstack[bisectptr - 11] < bisectstack[bisectptr - 15])
      bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15];
    bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
				  bisectstack[bisectptr - 14];
    if (bisectstack[bisectptr - 12] > 0)
      bisectstack[bisectptr - 12] = 0;
  }
  bisectstack[bisectptr - 20] = mem[pp + 30006].int_ - mem[pp + 30002].int_;
  bisectstack[bisectptr - 19] = mem[qq + 30004].int_ - mem[pp + 30006].int_;
  bisectstack[bisectptr - 18] = mem[qq + 30002].int_ - mem[qq + 30004].int_;
  if (bisectstack[bisectptr - 20] < 0) {
    if (bisectstack[bisectptr - 18] >= 0) {
      if (bisectstack[bisectptr - 19] < 0)
	bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
				      bisectstack[bisectptr - 19];
      else
	bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20];
      bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
	  bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
      if (bisectstack[bisectptr - 16] < 0)
	bisectstack[bisectptr - 16] = 0;
    } else {
      bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
	  bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
      if (bisectstack[bisectptr - 17] > bisectstack[bisectptr - 20])
	bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20];
      bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
				    bisectstack[bisectptr - 19];
      if (bisectstack[bisectptr - 16] < 0)
	bisectstack[bisectptr - 16] = 0;
    }
  } else if (bisectstack[bisectptr - 18] <= 0) {
    if (bisectstack[bisectptr - 19] > 0)
      bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
				    bisectstack[bisectptr - 19];
    else
      bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20];
    bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
	bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
    if (bisectstack[bisectptr - 17] > 0)
      bisectstack[bisectptr - 17] = 0;
  } else {
    bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
	bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
    if (bisectstack[bisectptr - 16] < bisectstack[bisectptr - 20])
      bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20];
    bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
				  bisectstack[bisectptr - 19];
    if (bisectstack[bisectptr - 17] > 0)
      bisectstack[bisectptr - 17] = 0;
  }
  delx = mem[p + 30001].int_ - mem[pp + 30001].int_;
  dely = mem[p + 30002].int_ - mem[pp + 30002].int_;
  tol = 0;
  uv = bisectptr;
  xy = bisectptr;
  threel = 0;
  curt = 1;
  curtt = 1;   /*:558*/
  while (true) {
_L22:
    if (delx - tol <= bisectstack[xy - 11] - bisectstack[uv - 2]) {
      if (delx + tol >= bisectstack[xy - 12] - bisectstack[uv - 1]) {
	if (dely - tol <= bisectstack[xy - 16] - bisectstack[uv - 7]) {
	  if (dely + tol >= bisectstack[xy - 17] - bisectstack[uv - 6]) {
	    if (curt >= maxt) {
	      if (maxt == 131072L) {
		curt = (curt + 1) / 2;
		curtt = (curtt + 1) / 2;
		goto _L10;
	      }
	      maxt += maxt;
	      apprt = curt;
	      apprtt = curtt;
	    }  /*559:*/
	    bisectstack[bisectptr] = delx;
	    bisectstack[bisectptr + 1] = dely;
	    bisectstack[bisectptr + 2] = tol;
	    bisectstack[bisectptr + 3] = uv;
	    bisectstack[bisectptr + 4] = xy;
	    bisectptr += 45;
	    curt += curt;
	    curtt += curtt;
	    bisectstack[bisectptr - 25] = bisectstack[uv - 5];
	    bisectstack[bisectptr - 3] = bisectstack[uv - 3];
	    bisectstack[bisectptr - 24] =
	      (bisectstack[bisectptr - 25] + bisectstack[uv - 4]) / 2;
	    bisectstack[bisectptr - 4] =
	      (bisectstack[bisectptr - 3] + bisectstack[uv - 4]) / 2;
	    bisectstack[bisectptr - 23] =
	      (bisectstack[bisectptr - 24] + bisectstack[bisectptr - 4]) / 2;
	    bisectstack[bisectptr - 5] = bisectstack[bisectptr - 23];
	    if (bisectstack[bisectptr - 25] < 0) {
	      if (bisectstack[bisectptr - 23] >= 0) {
		if (bisectstack[bisectptr - 24] < 0)
		  bisectstack[bisectptr - 22] = bisectstack[bisectptr - 25] +
						bisectstack[bisectptr - 24];
		else
		  bisectstack[bisectptr - 22] = bisectstack[bisectptr - 25];
		bisectstack[bisectptr - 21] = bisectstack[bisectptr - 25] +
		    bisectstack[bisectptr - 24] + bisectstack[bisectptr - 23];
		if (bisectstack[bisectptr - 21] < 0)
		  bisectstack[bisectptr - 21] = 0;
	      } else {
		bisectstack[bisectptr - 22] = bisectstack[bisectptr - 25] +
		    bisectstack[bisectptr - 24] + bisectstack[bisectptr - 23];
		if (bisectstack[bisectptr - 22] > bisectstack[bisectptr - 25])
		  bisectstack[bisectptr - 22] = bisectstack[bisectptr - 25];
		bisectstack[bisectptr - 21] = bisectstack[bisectptr - 25] +
					      bisectstack[bisectptr - 24];
		if (bisectstack[bisectptr - 21] < 0)
		  bisectstack[bisectptr - 21] = 0;
	      }
	    } else if (bisectstack[bisectptr - 23] <= 0) {
	      if (bisectstack[bisectptr - 24] > 0)
		bisectstack[bisectptr - 21] = bisectstack[bisectptr - 25] +
					      bisectstack[bisectptr - 24];
	      else
		bisectstack[bisectptr - 21] = bisectstack[bisectptr - 25];
	      bisectstack[bisectptr - 22] = bisectstack[bisectptr - 25] +
		  bisectstack[bisectptr - 24] + bisectstack[bisectptr - 23];
	      if (bisectstack[bisectptr - 22] > 0)
		bisectstack[bisectptr - 22] = 0;
	    } else {
	      bisectstack[bisectptr - 21] = bisectstack[bisectptr - 25] +
		  bisectstack[bisectptr - 24] + bisectstack[bisectptr - 23];
	      if (bisectstack[bisectptr - 21] < bisectstack[bisectptr - 25])
		bisectstack[bisectptr - 21] = bisectstack[bisectptr - 25];
	      bisectstack[bisectptr - 22] = bisectstack[bisectptr - 25] +
					    bisectstack[bisectptr - 24];
	      if (bisectstack[bisectptr - 22] > 0)
		bisectstack[bisectptr - 22] = 0;
	    }
	    if (bisectstack[bisectptr - 5] < 0) {
	      if (bisectstack[bisectptr - 3] >= 0) {
		if (bisectstack[bisectptr - 4] < 0)
		  bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
					       bisectstack[bisectptr - 4];
		else
		  bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5];
		bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
		    bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
		if (bisectstack[bisectptr - 1] < 0)
		  bisectstack[bisectptr - 1] = 0;
	      } else {
		bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
		    bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
		if (bisectstack[bisectptr - 2] > bisectstack[bisectptr - 5])
		  bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5];
		bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
					     bisectstack[bisectptr - 4];
		if (bisectstack[bisectptr - 1] < 0)
		  bisectstack[bisectptr - 1] = 0;
	      }
	    } else if (bisectstack[bisectptr - 3] <= 0) {
	      if (bisectstack[bisectptr - 4] > 0)
		bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
					     bisectstack[bisectptr - 4];
	      else
		bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5];
	      bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
		  bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
	      if (bisectstack[bisectptr - 2] > 0)
		bisectstack[bisectptr - 2] = 0;
	    } else {
	      bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5] +
		  bisectstack[bisectptr - 4] + bisectstack[bisectptr - 3];
	      if (bisectstack[bisectptr - 1] < bisectstack[bisectptr - 5])
		bisectstack[bisectptr - 1] = bisectstack[bisectptr - 5];
	      bisectstack[bisectptr - 2] = bisectstack[bisectptr - 5] +
					   bisectstack[bisectptr - 4];
	      if (bisectstack[bisectptr - 2] > 0)
		bisectstack[bisectptr - 2] = 0;
	    }
	    bisectstack[bisectptr - 30] = bisectstack[uv - 10];
	    bisectstack[bisectptr - 8] = bisectstack[uv - 8];
	    bisectstack[bisectptr - 29] =
	      (bisectstack[bisectptr - 30] + bisectstack[uv - 9]) / 2;
	    bisectstack[bisectptr - 9] =
	      (bisectstack[bisectptr - 8] + bisectstack[uv - 9]) / 2;
	    bisectstack[bisectptr - 28] =
	      (bisectstack[bisectptr - 29] + bisectstack[bisectptr - 9]) / 2;
	    bisectstack[bisectptr - 10] = bisectstack[bisectptr - 28];
	    if (bisectstack[bisectptr - 30] < 0) {
	      if (bisectstack[bisectptr - 28] >= 0) {
		if (bisectstack[bisectptr - 29] < 0)
		  bisectstack[bisectptr - 27] = bisectstack[bisectptr - 30] +
						bisectstack[bisectptr - 29];
		else
		  bisectstack[bisectptr - 27] = bisectstack[bisectptr - 30];
		bisectstack[bisectptr - 26] = bisectstack[bisectptr - 30] +
		    bisectstack[bisectptr - 29] + bisectstack[bisectptr - 28];
		if (bisectstack[bisectptr - 26] < 0)
		  bisectstack[bisectptr - 26] = 0;
	      } else {
		bisectstack[bisectptr - 27] = bisectstack[bisectptr - 30] +
		    bisectstack[bisectptr - 29] + bisectstack[bisectptr - 28];
		if (bisectstack[bisectptr - 27] > bisectstack[bisectptr - 30])
		  bisectstack[bisectptr - 27] = bisectstack[bisectptr - 30];
		bisectstack[bisectptr - 26] = bisectstack[bisectptr - 30] +
					      bisectstack[bisectptr - 29];
		if (bisectstack[bisectptr - 26] < 0)
		  bisectstack[bisectptr - 26] = 0;
	      }
	    } else if (bisectstack[bisectptr - 28] <= 0) {
	      if (bisectstack[bisectptr - 29] > 0)
		bisectstack[bisectptr - 26] = bisectstack[bisectptr - 30] +
					      bisectstack[bisectptr - 29];
	      else
		bisectstack[bisectptr - 26] = bisectstack[bisectptr - 30];
	      bisectstack[bisectptr - 27] = bisectstack[bisectptr - 30] +
		  bisectstack[bisectptr - 29] + bisectstack[bisectptr - 28];
	      if (bisectstack[bisectptr - 27] > 0)
		bisectstack[bisectptr - 27] = 0;
	    } else {
	      bisectstack[bisectptr - 26] = bisectstack[bisectptr - 30] +
		  bisectstack[bisectptr - 29] + bisectstack[bisectptr - 28];
	      if (bisectstack[bisectptr - 26] < bisectstack[bisectptr - 30])
		bisectstack[bisectptr - 26] = bisectstack[bisectptr - 30];
	      bisectstack[bisectptr - 27] = bisectstack[bisectptr - 30] +
					    bisectstack[bisectptr - 29];
	      if (bisectstack[bisectptr - 27] > 0)
		bisectstack[bisectptr - 27] = 0;
	    }
	    if (bisectstack[bisectptr - 10] < 0) {
	      if (bisectstack[bisectptr - 8] >= 0) {
		if (bisectstack[bisectptr - 9] < 0)
		  bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
					       bisectstack[bisectptr - 9];
		else
		  bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10];
		bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
		    bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
		if (bisectstack[bisectptr - 6] < 0)
		  bisectstack[bisectptr - 6] = 0;
	      } else {
		bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
		    bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
		if (bisectstack[bisectptr - 7] > bisectstack[bisectptr - 10])
		  bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10];
		bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
					     bisectstack[bisectptr - 9];
		if (bisectstack[bisectptr - 6] < 0)
		  bisectstack[bisectptr - 6] = 0;
	      }
	    } else if (bisectstack[bisectptr - 8] <= 0) {
	      if (bisectstack[bisectptr - 9] > 0)
		bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
					     bisectstack[bisectptr - 9];
	      else
		bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10];
	      bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
		  bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
	      if (bisectstack[bisectptr - 7] > 0)
		bisectstack[bisectptr - 7] = 0;
	    } else {
	      bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10] +
		  bisectstack[bisectptr - 9] + bisectstack[bisectptr - 8];
	      if (bisectstack[bisectptr - 6] < bisectstack[bisectptr - 10])
		bisectstack[bisectptr - 6] = bisectstack[bisectptr - 10];
	      bisectstack[bisectptr - 7] = bisectstack[bisectptr - 10] +
					   bisectstack[bisectptr - 9];
	      if (bisectstack[bisectptr - 7] > 0)
		bisectstack[bisectptr - 7] = 0;
	    }
	    bisectstack[bisectptr - 35] = bisectstack[xy - 15];
	    bisectstack[bisectptr - 13] = bisectstack[xy - 13];
	    bisectstack[bisectptr - 34] =
	      (bisectstack[bisectptr - 35] + bisectstack[xy - 14]) / 2;
	    bisectstack[bisectptr - 14] =
	      (bisectstack[bisectptr - 13] + bisectstack[xy - 14]) / 2;
	    bisectstack[bisectptr - 33] =
	      (bisectstack[bisectptr - 34] + bisectstack[bisectptr - 14]) / 2;
	    bisectstack[bisectptr - 15] = bisectstack[bisectptr - 33];
	    if (bisectstack[bisectptr - 35] < 0) {
	      if (bisectstack[bisectptr - 33] >= 0) {
		if (bisectstack[bisectptr - 34] < 0)
		  bisectstack[bisectptr - 32] = bisectstack[bisectptr - 35] +
						bisectstack[bisectptr - 34];
		else
		  bisectstack[bisectptr - 32] = bisectstack[bisectptr - 35];
		bisectstack[bisectptr - 31] = bisectstack[bisectptr - 35] +
		    bisectstack[bisectptr - 34] + bisectstack[bisectptr - 33];
		if (bisectstack[bisectptr - 31] < 0)
		  bisectstack[bisectptr - 31] = 0;
	      } else {
		bisectstack[bisectptr - 32] = bisectstack[bisectptr - 35] +
		    bisectstack[bisectptr - 34] + bisectstack[bisectptr - 33];
		if (bisectstack[bisectptr - 32] > bisectstack[bisectptr - 35])
		  bisectstack[bisectptr - 32] = bisectstack[bisectptr - 35];
		bisectstack[bisectptr - 31] = bisectstack[bisectptr - 35] +
					      bisectstack[bisectptr - 34];
		if (bisectstack[bisectptr - 31] < 0)
		  bisectstack[bisectptr - 31] = 0;
	      }
	    } else if (bisectstack[bisectptr - 33] <= 0) {
	      if (bisectstack[bisectptr - 34] > 0)
		bisectstack[bisectptr - 31] = bisectstack[bisectptr - 35] +
					      bisectstack[bisectptr - 34];
	      else
		bisectstack[bisectptr - 31] = bisectstack[bisectptr - 35];
	      bisectstack[bisectptr - 32] = bisectstack[bisectptr - 35] +
		  bisectstack[bisectptr - 34] + bisectstack[bisectptr - 33];
	      if (bisectstack[bisectptr - 32] > 0)
		bisectstack[bisectptr - 32] = 0;
	    } else {
	      bisectstack[bisectptr - 31] = bisectstack[bisectptr - 35] +
		  bisectstack[bisectptr - 34] + bisectstack[bisectptr - 33];
	      if (bisectstack[bisectptr - 31] < bisectstack[bisectptr - 35])
		bisectstack[bisectptr - 31] = bisectstack[bisectptr - 35];
	      bisectstack[bisectptr - 32] = bisectstack[bisectptr - 35] +
					    bisectstack[bisectptr - 34];
	      if (bisectstack[bisectptr - 32] > 0)
		bisectstack[bisectptr - 32] = 0;
	    }
	    if (bisectstack[bisectptr - 15] < 0) {
	      if (bisectstack[bisectptr - 13] >= 0) {
		if (bisectstack[bisectptr - 14] < 0)
		  bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
						bisectstack[bisectptr - 14];
		else
		  bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15];
		bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
		    bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
		if (bisectstack[bisectptr - 11] < 0)
		  bisectstack[bisectptr - 11] = 0;
	      } else {
		bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
		    bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
		if (bisectstack[bisectptr - 12] > bisectstack[bisectptr - 15])
		  bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15];
		bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
					      bisectstack[bisectptr - 14];
		if (bisectstack[bisectptr - 11] < 0)
		  bisectstack[bisectptr - 11] = 0;
	      }
	    } else if (bisectstack[bisectptr - 13] <= 0) {
	      if (bisectstack[bisectptr - 14] > 0)
		bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
					      bisectstack[bisectptr - 14];
	      else
		bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15];
	      bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
		  bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
	      if (bisectstack[bisectptr - 12] > 0)
		bisectstack[bisectptr - 12] = 0;
	    } else {
	      bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15] +
		  bisectstack[bisectptr - 14] + bisectstack[bisectptr - 13];
	      if (bisectstack[bisectptr - 11] < bisectstack[bisectptr - 15])
		bisectstack[bisectptr - 11] = bisectstack[bisectptr - 15];
	      bisectstack[bisectptr - 12] = bisectstack[bisectptr - 15] +
					    bisectstack[bisectptr - 14];
	      if (bisectstack[bisectptr - 12] > 0)
		bisectstack[bisectptr - 12] = 0;
	    }
	    bisectstack[bisectptr - 40] = bisectstack[xy - 20];
	    bisectstack[bisectptr - 18] = bisectstack[xy - 18];
	    bisectstack[bisectptr - 39] =
	      (bisectstack[bisectptr - 40] + bisectstack[xy - 19]) / 2;
	    bisectstack[bisectptr - 19] =
	      (bisectstack[bisectptr - 18] + bisectstack[xy - 19]) / 2;
	    bisectstack[bisectptr - 38] =
	      (bisectstack[bisectptr - 39] + bisectstack[bisectptr - 19]) / 2;
	    bisectstack[bisectptr - 20] = bisectstack[bisectptr - 38];
	    if (bisectstack[bisectptr - 40] < 0) {
	      if (bisectstack[bisectptr - 38] >= 0) {
		if (bisectstack[bisectptr - 39] < 0)
		  bisectstack[bisectptr - 37] = bisectstack[bisectptr - 40] +
						bisectstack[bisectptr - 39];
		else
		  bisectstack[bisectptr - 37] = bisectstack[bisectptr - 40];
		bisectstack[bisectptr - 36] = bisectstack[bisectptr - 40] +
		    bisectstack[bisectptr - 39] + bisectstack[bisectptr - 38];
		if (bisectstack[bisectptr - 36] < 0)
		  bisectstack[bisectptr - 36] = 0;
	      } else {
		bisectstack[bisectptr - 37] = bisectstack[bisectptr - 40] +
		    bisectstack[bisectptr - 39] + bisectstack[bisectptr - 38];
		if (bisectstack[bisectptr - 37] > bisectstack[bisectptr - 40])
		  bisectstack[bisectptr - 37] = bisectstack[bisectptr - 40];
		bisectstack[bisectptr - 36] = bisectstack[bisectptr - 40] +
					      bisectstack[bisectptr - 39];
		if (bisectstack[bisectptr - 36] < 0)
		  bisectstack[bisectptr - 36] = 0;
	      }
	    } else if (bisectstack[bisectptr - 38] <= 0) {
	      if (bisectstack[bisectptr - 39] > 0)
		bisectstack[bisectptr - 36] = bisectstack[bisectptr - 40] +
					      bisectstack[bisectptr - 39];
	      else
		bisectstack[bisectptr - 36] = bisectstack[bisectptr - 40];
	      bisectstack[bisectptr - 37] = bisectstack[bisectptr - 40] +
		  bisectstack[bisectptr - 39] + bisectstack[bisectptr - 38];
	      if (bisectstack[bisectptr - 37] > 0)
		bisectstack[bisectptr - 37] = 0;
	    } else {
	      bisectstack[bisectptr - 36] = bisectstack[bisectptr - 40] +
		  bisectstack[bisectptr - 39] + bisectstack[bisectptr - 38];
	      if (bisectstack[bisectptr - 36] < bisectstack[bisectptr - 40])
		bisectstack[bisectptr - 36] = bisectstack[bisectptr - 40];
	      bisectstack[bisectptr - 37] = bisectstack[bisectptr - 40] +
					    bisectstack[bisectptr - 39];
	      if (bisectstack[bisectptr - 37] > 0)
		bisectstack[bisectptr - 37] = 0;
	    }
	    if (bisectstack[bisectptr - 20] < 0) {
	      if (bisectstack[bisectptr - 18] >= 0) {
		if (bisectstack[bisectptr - 19] < 0)
		  bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
						bisectstack[bisectptr - 19];
		else
		  bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20];
		bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
		    bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
		if (bisectstack[bisectptr - 16] < 0)
		  bisectstack[bisectptr - 16] = 0;
	      } else {
		bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
		    bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
		if (bisectstack[bisectptr - 17] > bisectstack[bisectptr - 20])
		  bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20];
		bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
					      bisectstack[bisectptr - 19];
		if (bisectstack[bisectptr - 16] < 0)
		  bisectstack[bisectptr - 16] = 0;
	      }
	    } else if (bisectstack[bisectptr - 18] <= 0) {
	      if (bisectstack[bisectptr - 19] > 0)
		bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
	, pathintersection, openawindow, dispedges, maxcoef, pplusq				      bisectstack[bisectptr - 19];
	      else
		bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20];
	      bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
		  bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
	      if (bisectstack[bisectptr - 17] > 0)
		bisectstack[bisectptr - 17] = 0;
	    } else {
	      bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20] +
		  bisectstack[bisectptr - 19] + bisectstack[bisectptr - 18];
	      if (bisectstack[bisectptr - 16] < bisectstack[bisectptr - 20])
		bisectstack[bisectptr - 16] = bisectstack[bisectptr - 20];
	      bisectstack[bisectptr - 17] = bisectstack[bisectptr - 20] +
					    bisectstack[bisectptr - 19];
	      if (bisectstack[bisectptr - 17] > 0)
		bisectstack[bisectptr - 17] = 0;
	    }
	    uv = bisectptr - 20;
	    xy = bisectptr - 20;
	    delx += delx;
	    dely += dely;
	    tol += tolstep - threel;
	    tol += tol;
	    threel += tolstep;   /*:559*/
	    goto _L22;
	  }
	}
      }
    }
    if (timetogo <= 0) {
      while (apprt < 65536L) {
	apprt += apprt;
	apprtt += apprtt;
      }
      curt = apprt;
      curtt = apprtt;
      goto _L10;
    }
    timetogo--;
_L45:
    if (odd(curtt)) {
/* p2c: <stdin>, line 9793: Warning: Symbol 'ODD' is not defined [221] */
      if (odd(curt)) {  /*561:*/
	curt /= 2;
	curtt /= 2;
	if (curt == 0)
	  goto _L10;
	bisectptr -= 45;
	threel -= tolstep;
	delx = bisectstack[bisectptr];
	dely = bisectstack[bisectptr + 1];
	tol = bisectstack[bisectptr + 2];
	uv = bisectstack[bisectptr + 3];
	xy = bisectstack[bisectptr + 4];
	goto _L45;
	continue;
      }
/* p2c: <stdin>, line 9794: Warning: Symbol 'ODD' is not defined [221] */
      curt++;
      delx += bisectstack[uv - 5] + bisectstack[uv - 4] + bisectstack[uv - 3];
      dely += bisectstack[uv - 10] + bisectstack[uv - 9] + bisectstack[uv - 8];
      uv += 20;
      curtt--;
      xy -= 20;
      delx += bisectstack[xy - 15] + bisectstack[xy - 14] + bisectstack[xy - 13];
      dely += bisectstack[xy - 20] + bisectstack[xy - 19] + bisectstack[xy - 18];
      continue;
    }
    curtt++;
    tol += threel;
    delx += -bisectstack[xy - 15] - bisectstack[xy - 14] - bisectstack[xy - 13];
    dely += -bisectstack[xy - 20] - bisectstack[xy - 19] - bisectstack[xy - 18];
    xy += 20;
  }
_L10: ;


  /*560:*/
  /*:561*/
  /*:560*/
}


/*:556*/
/*562:*/

Static Void pathintersection(h, hh)
halfword h, hh;
{
  halfword p, pp;
  long n, nn;   /*563:*/

  if (mem[h + 30000].hh.UU.U2.b1 == 0) {
    mem[h + 30005].int_ = mem[h + 30001].int_;
    mem[h + 30003].int_ = mem[h + 30001].int_;
    mem[h + 30006].int_ = mem[h + 30002].int_;
    mem[h + 30004].int_ = mem[h + 30002].int_;
    mem[h + 30000].hh.UU.U2.b1 = 1;
  }
  if (mem[hh + 30000].hh.UU.U2.b1 == 0) {
    mem[hh + 30005].int_ = mem[hh + 30001].int_;
    mem[hh + 30003].int_ = mem[hh + 30001].int_;
    mem[hh + 30006].int_ = mem[hh + 30002].int_;
    mem[hh + 30004].int_ = mem[hh + 30002].int_;
    mem[hh + 30000].hh.UU.U2.b1 = 1;
  }  /*:563*/
  tolstep = 0;
  do {
    n = -65536L;
    p = h;
    do {
      if (mem[p + 30000].hh.UU.U2.b1 != 0) {
	nn = -65536L;
	pp = hh;
	do {
	  if (mem[pp + 30000].hh.UU.U2.b1 != 0) {
	    cubicintersection(p, pp);
	    if (curt > 0) {
	      curt += n;
	      curtt += nn;
	      goto _L10;
	    }
	  }
	  nn += 65536L;
	  pp = mem[pp + 30000].hh.rh;
	} while (pp != hh);
      }
      n += 65536L;
      p = mem[p + 30000].hh.rh;
    } while (p != h);
    tolstep += 3;
  } while (tolstep <= 3);
  curt = -65536L;
  curtt = -65536L;
_L10: ;

}


/*:562*/
/*574:*/

Static Void openawindow(k, r0, c0, r1, c1, x, y)
windownumber k;
long r0, c0, r1, c1, x, y;
{
  long m, n;   /*575:*/

  if (r0 < 0)
    r0 = 0;
  else
    r0 = roundunscaled(r0);
  r1 = roundunscaled(r1);
  if (r1 > screendepth)
    r1 = screendepth;
  if (r1 < r0) {
    if (r0 > screendepth)
      r0 = r1;
    else
      r1 = r0;
  }
  if (c0 < 0)
    c0 = 0;
  else
    c0 = roundunscaled(c0);
  c1 = roundunscaled(c1);
  if (c1 > screenwidth)
    c1 = screenwidth;
  if (c1 < c0) {
    if (c0 > screenwidth)
      c0 = c1;
    else
      c1 = c0;   /*:575*/
  }
  windowopen[k] = true;
  windowtime[k]++;
  leftcol[k] = c0;
  rightcol[k] = c1;
  toprow[k] = r0;
  botrow[k] = r1;   /*576:*/
  m = roundunscaled(x);
  n = roundunscaled(y) - 1;
  mwindow[k] = c0 - m;
  nwindow[k] = r0 + n;   /*:576*/
  if (!screenstarted) {
    screenOK = initscreen();
    screenstarted = true;
  }
  if (screenOK) {
    blankrectangle((int)c0, (int)c1, (int)r0, (int)r1);
    updatescreen();
  }
}  /* openawindow */


/*:574*/
/*577:*/

Static Void dispedges(k)
windownumber k;
{
  halfword p, q;
  boolean alreadythere;
  long r;   /*580:*/
  screencol n;
  long w, ww;
  pixelcolor b;
  long m, mm, d, madjustment, rightedge;
  screencol mincol;   /*:580*/

  if (!screenOK)
    return;
  if (leftcol[k] >= rightcol[k])
    return;
  if (toprow[k] >= botrow[k])
    return;
  alreadythere = false;
  if (mem[curedges + 30003].hh.rh == k) {
    if (mem[curedges + 30004].int_ == windowtime[k])
      alreadythere = true;
  }
  if (!alreadythere)   /*581:*/
    blankrectangle(leftcol[k], rightcol[k], toprow[k], botrow[k]);
  madjustment = mwindow[k] - mem[curedges + 30003].hh.UU.lh;
  rightedge = (rightcol[k] - madjustment) * 8;
  mincol = leftcol[k];   /*:581*/
  p = mem[curedges + 30000].hh.rh;
  r = nwindow[k] - mem[curedges + 30001].hh.UU.lh + 4096;
  while (p != curedges && r >= toprow[k]) {
    if (r < botrow[k]) {  /*578:*/
      if (mem[p + 30001].hh.UU.lh > -29999)
	sortedges(p);
      else if (mem[p + 30001].hh.UU.lh == -29999) {
	if (alreadythere)
	  goto _L30;
      }
      mem[p + 30001].hh.UU.lh = -29999;   /*582:*/
      n = 0;
      ww = 0;
      m = -1;
      w = 0;
      q = mem[p + 30001].hh.rh;
      rowtransition[0] = mincol;
      while (true) {
	if (q == 30000)
	  d = rightedge;
	else
	  d = mem[q + 30000].hh.UU.lh + 32768L;
	mm = d / 8 + madjustment;
	if (mm != m) {  /*583:*/
	  if (w <= 0) {
	    if (ww > 0) {
	      if (m > mincol) {
		if (n == 0) {
		  if (alreadythere) {
		    b = 0;
		    n++;
		  } else
		    b = 1;
		} else
		  n++;
		rowtransition[n] = m;
	      }
	    }
	  } else if (ww <= 0) {
	    if (m > mincol) {   /*:583*/
	      if (n == 0)
		b = 1;
	      n++;
	      rowtransition[n] = m;
	    }
	  }
	  m = mm;
	  w = ww;
	}
	if (d >= rightedge)
	  goto _L40;
	ww += (d & 7) - 4;
	q = mem[q + 30000].hh.rh;
      }
_L40:   /*584:*/
      if (alreadythere || ww > 0) {   /*:582*/
	if (n == 0) {
	  if (ww > 0)
	    b = 1;
	  else
	    b = 0;
	}
	n++;
	rowtransition[n] = rightcol[k];
      } else if (n == 0)
	goto _L30;   /*:584*/
      paintrow((int)r, b, rowtransition, n);
_L30: ;   /*:578*/

    }
    p = mem[p + 30000].hh.rh;
    r--;
  }
  updatescreen();
  windowtime[k]++;
  mem[curedges + 30003].hh.rh = k;
  mem[curedges + 30004].int_ = windowtime[k];
}

<stdin>, line 10044: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10045: Warning: Symbol 'ABS' is not defined [221]


/*:577*/
/*591:*/

Static long maxcoef(p)
halfword p;
{
  fraction x;

  x = 0;
  while (mem[p + 30000].hh.UU.lh != -30000) {
    if (abs(mem[p + 30001].int_) > x) {
/* p2c: <stdin>, line 10044: Warning: Symbol 'ABS' is not defined [221] */
      x = abs(mem[p + 30001].int_);
/* p2c: <stdin>, line 10045: Warning: Symbol 'ABS' is not defined [221] */
    }
    p = mem[p + 30000].hh.rh;
  }
  return x;
}

<stdin>, line 10077: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10080: Warning: Symbol 'ABS' is not defined [221]


/*:591*/
/*597:*/

Static halfword pplusq(p, q, t)
halfword p, q;
smallnumber t;
{
  halfword pp, qq, r, s;
  long threshold, v;

  if (t == 17)
    threshold = 2685;
  else
    threshold = 8;
  r = 29999;
  pp = mem[p + 30000].hh.UU.lh;
  qq = mem[q + 30000].hh.UU.lh;
  while (true) {
    if (pp == qq) {
      if (pp == -30000) {
	goto _L30;   /*598:*/
	continue;
      }
      v = mem[p + 30001].int_ + mem[q + 30001].int_;
      mem[p + 30001].int_ = v;
      s = p;
      p = mem[p + 30000].hh.rh;
      pp = mem[p + 30000].hh.UU.lh;
      if (abs(v) < threshold) {
/* p2c: <stdin>, line 10077: Warning: Symbol 'AB, ptimesv, pwithxbecomingq, newdep, constdependency, singledependency, copydeplist,
lineareq, newringentry, nonlineareqS' is not defined [221] */
	freenode(s, 2);
      } else {
	if (abs(v) >= 626349397L) {
/* p2c: <stdin>, line 10080: Warning: Symbol 'ABS' is not defined [221] */
	  if (watchcoefs) {
	    mem[qq + 30000].hh.UU.U2.b0 = 0;
	    fixneeded = true;
	  }
	}
	mem[r + 30000].hh.rh = s;
	r = s;
      }
      q = mem[q + 30000].hh.rh;
      qq = mem[q + 30000].hh.UU.lh;
      continue;
    }
    if (mem[pp + 30001].int_ >= mem[qq + 30001].int_) {
      mem[r + 30000].hh.rh = p;
      r = p;
      p = mem[p + 30000].hh.rh;
      pp = mem[p + 30000].hh.UU.lh;
      continue;
    }
    s = getnode(2L);
    mem[s + 30000].hh.UU.lh = qq;
    mem[s + 30001].int_ = mem[q + 30001].int_;
    q = mem[q + 30000].hh.rh;
    qq = mem[q + 30000].hh.UU.lh;
    mem[r + 30000].hh.rh = s;
    r = s;
  }
_L30:
  mem[p + 30001].int_ = slowadd(mem[p + 30001].int_, mem[q + 30001].int_);
  mem[r + 30000].hh.rh = p;
  depfinal = p;
  return (mem[59999].hh.rh);

  /*:598*/
}

<stdin>, line 10133: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10138: Warning: Symbol 'ABS' is not defined [221]


/*:597*/
/*599:*/

Static halfword ptimesv(p, v, t0, t1, visscaled)
halfword p;
long v;
smallnumber t0, t1;
boolean visscaled;
{
  halfword r, s;
  long w, threshold;
  boolean scalingdown;

  if (t0 != t1)
    scalingdown = true;
  else
    scalingdown = !visscaled;
  if (t1 == 17)
    threshold = 1342;
  else
    threshold = 4;
  r = 29999;
  while (mem[p + 30000].hh.UU.lh != -30000) {
    if (scalingdown)
      w = takefraction(v, mem[p + 30001].int_);
    else
      w = takescaled(v, mem[p + 30001].int_);
    if (abs(w) <= threshold) {
/* p2c: <stdin>, line 10133: Warning: Symbol 'ABS' is not defined [221] */
      s = mem[p + 30000].hh.rh;
      freenode(p, 2);
      p = s;
      continue;
    }
    if (abs(w) >= 626349397L) {
/* p2c: <stdin>, line 10138: Warning: Symbol 'ABS' is not defined [221] */
      fixneeded = true;
      mem[mem[p + 30000].hh.UU.lh + 30000].hh.UU.U2.b0 = 0;
    }
    mem[r + 30000].hh.rh = p;
    r = p;
    mem[p + 30001].int_ = w;
    p = mem[p + 30000].hh.rh;
  }
  mem[r + 30000].hh.rh = p;
  if (visscaled)
    mem[p + 30001].int_ = takescaled(mem[p + 30001].int_, v);
  else
    mem[p + 30001].int_ = takefraction(mem[p + 30001].int_, v);
  return (mem[59999].hh.rh);
}  /*:599*/


/*601:*/

Static halfword pwithxbecomingq(p, x, q, t)
halfword p, x, q;
smallnumber t;
{
  halfword r, s;
  long v, sx;

  s = p;
  r = 29999;
  sx = mem[x + 30001].int_;
  while (mem[mem[s + 30000].hh.UU.lh + 30001].int_ > sx) {
    r = s;
    s = mem[s + 30000].hh.rh;
  }
  if (mem[s + 30000].hh.UU.lh != x)
    return p;
  else {
    mem[59999].hh.rh = p;
    mem[r + 30000].hh.rh = mem[s + 30000].hh.rh;
    v = mem[s + 30001].int_;
    freenode(s, 2);
    return (pplusfq(mem[59999].hh.rh, v, q, t, 17));
  }
}


/*:601*/
/*606:*/

Static Void newdep(q, p)
halfword q, p;
{
  halfword r;

  mem[q + 30001].hh.rh = p;
  mem[q + 30001].hh.UU.lh = -29987;
  r = mem[13].hh.rh;
  mem[depfinal + 30000].hh.rh = r;
  mem[r + 30001].hh.UU.lh = depfinal;
  mem[13].hh.rh = q;
}


/*:606*/
/*607:*/

Static halfword constdependency(v)
long v;
{
  depfinal = getnode(2L);
  mem[depfinal + 30001].int_ = v;
  mem[depfinal + 30000].hh.UU.lh = -30000;
  return depfinal;
}


/*:607*/
/*608:*/

Static halfword singledependency(p)
halfword p;
{
  halfword q;
  long m;

  m = mem[p + 30001].int_ & 63;
  if (m > 28)
    return (constdependency(0L));
  else {
    q = getnode(2L);
    mem[q + 30001].int_ = twotothe[28 - m];
    mem[q + 30000].hh.UU.lh = p;
    mem[q + 30000].hh.rh = constdependency(0L);
    return q;
  }
}  /*:608*/


/*609:*/

Static halfword copydeplist(p)
halfword p;
{
  halfword q;

  q = getnode(2L);
  depfinal = q;
  while (true) {
    mem[depfinal + 30000].hh.UU.lh = mem[p + 30000].hh.UU.lh;
    mem[depfinal + 30001].int_ = mem[p + 30001].int_;
    if (mem[depfinal + 30000].hh.UU.lh == -30000)
      goto _L30;
    mem[depfinal + 30000].hh.rh = getnode(2L);
    depfinal = mem[depfinal + 30000].hh.rh;
    p = mem[p + 30000].hh.rh;
  }
_L30:
  return q;
}

<stdin>, line 10254: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10254: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10271: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10327: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 10341: Warning: Symbol 'ABS' is not defined [221]


/*:609*/
/*610:*/

Static Void lineareq(p, t)
halfword p;
smallnumber t;
{
  halfword q, r, s, x;
  long n, v;
  halfword prevr, finalnode;
  long w;   /*611:*/

  q = p;
  r = mem[p + 30000].hh.rh;
  v = mem[q + 30001].int_;
  while (mem[r + 30000].hh.UU.lh != -30000) {   /*:611*/
    if (abs(mem[r + 30001].int_) > abs(v)) {
/* p2c: <stdin>, line 10254: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 10254: Warning: Symbol 'ABS' is not defined [221] */
      q = r;
      v = mem[r + 30001].int_;
    }
    r = mem[r + 30000].hh.rh;
  }
  x = mem[q + 30000].hh.UU.lh;
  n = mem[x + 30001].int_ & 63;   /*612:*/
  s = 29999;
  mem[s + 30000].hh.rh = p;
  r = p;
  do {
    if (r == q) {
      mem[s + 30000].hh.rh = mem[r + 30000].hh.rh;
      freenode(r, 2);
    } else {
      w = makefraction(mem[r + 30001].int_, v);
      if (abs(w) <= 1342) {
/* p2c: <stdin>, line 10271: Warning: Symbol 'ABS' is not defined [221] */
	mem[s + 30000].hh.rh = mem[r + 30000].hh.rh;
	freenode(r, 2);
      } else {
	mem[r + 30001].int_ = -w;
	s = r;
      }
    }
    r = mem[s + 30000].hh.rh;
  } while (mem[r + 30000].hh.UU.lh != -30000);
  if (t == 18)
    mem[r + 30001].int_ = -makescaled(mem[r + 30001].int_, v);
  else if (v != -268435456L)
    mem[r + 30001].int_ = -makefraction(mem[r + 30001].int_, v);
  finalnode = r;
  p = mem[59999].hh.rh;   /*:612*/
  if (internal[1] > 0) {   /*613:*/
    if (interesting(x)) {   /*:613*/
      begindiagnostic();
      printnl(462);
      printvariablename(x);
      w = n;
      while (w > 0) {
	print(455L);
	w -= 2;
      }
      printchar(61);
      printdependency(p, 17);
      enddiagnostic(false);
    }
  }
  /*614:*/
  prevr = -29987;
  r = mem[13].hh.rh;
  while (r != -29987) {   /*:614*/
    s = mem[r + 30001].hh.rh;
    q = pwithxbecomingq(s, x, p, mem[r + 30000].hh.UU.U2.b0);
    if (mem[q + 30000].hh.UU.lh == -30000)
      makeknown(r, q);
    else {
      mem[r + 30001].hh.rh = q;
      do {
	q = mem[q + 30000].hh.rh;
      } while (mem[q + 30000].hh.UU.lh != -30000);
      prevr = q;
    }
    r = mem[prevr + 30000].hh.rh;
  }
  /*615:*/
  if (n > 0)   /*:616*/
  {  /*616:*/
    s = 29999;
    mem[59999].hh.rh = p;
    r = p;
    do {
      if (n > 30)
	w = 0;
      else
	w = mem[r + 30001].int_ / twotothe[n];
      if (abs(w) <= 1342 && mem[r + 30000].hh.UU.lh != -30000) {
/* p2c: <stdin>, line 10327: Warning: Symbol 'ABS' is not defined [221] */
	mem[s + 30000].hh.rh = mem[r + 30000].hh.rh;
	freenode(r, 2);
      } else {
	mem[r + 30001].int_ = w;
	s = r;
      }
      r = mem[s + 30000].hh.rh;
    } while (mem[s + 30000].hh.UU.lh != -30000);
    p = mem[59999].hh.rh;
  }
  if (mem[p + 30000].hh.UU.lh == -30000) {
    mem[x + 30000].hh.UU.U2.b0 = 16;
    mem[x + 30001].int_ = mem[p + 30001].int_;
    if (abs(mem[x + 30001].int_) >= 268435456L) {
/* p2c: <stdin>, line 10341: Warning: Symbol 'ABS' is not defined [221] */
      valtoobig(mem[x + 30001].int_);
    }
    freenode(p, 2);
    if (curexp == x) {
      if (curtype == 19) {
	curexp = mem[x + 30001].int_;
	curtype = 16;
	freenode(x, 2);
      }
    }
  } else {   /*:615*/
    mem[x + 30000].hh.UU.U2.b0 = 17;
    depfinal = finalnode;
    newdep(x, p);
    if (curexp == x) {
      if (curtype == 19)
	curtype = 17;
    }
  }
  if (fixneeded)
    fixdependencies();
}


/*:610*/
/*619:*/

Static halfword newringentry(p)
halfword p;
{
  halfword q;

  q = getnode(2L);
  mem[q + 30000].hh.UU.U2.b1 = 11;
  mem[q + 30000].hh.UU.U2.b0 = mem[p + 30000].hh.UU.U2.b0;
  if (mem[p + 30001].int_ == -30000)
    mem[q + 30001].int_ = p;
  else
    mem[q + 30001].int_ = mem[p + 30001].int_;
  mem[p + 30001].int_ = q;
  return q;
}


/*:619*/
/*621:*/

Static Void nonlineareq(v, p, flushp)
long v;
halfword p;
bool, ringmerge, showcmdmod, showcontext, begintokenlist, endtokenlist, encapsulate, install, makeexpcopyean flushp;
{
  smallnumber t;
  halfword q, r;

  t = mem[p + 30000].hh.UU.U2.b0 - 1;
  q = mem[p + 30001].int_;
  if (flushp)
    mem[p + 30000].hh.UU.U2.b0 = 1;
  else
    p = q;
  do {
    r = mem[q + 30001].int_;
    mem[q + 30000].hh.UU.U2.b0 = t;
    switch (t) {

    case 2:
      mem[q + 30001].int_ = v;
      break;

    case 4:
      mem[q + 30001].int_ = v;
      if (strref[v] < 127)
	strref[v]++;
      break;

    case 6:
      mem[q + 30001].int_ = v;
      mem[v + 30000].hh.UU.lh++;
      break;

    case 9:
      mem[q + 30001].int_ = copypath((int)v);
      break;

    case 11:
      mem[q + 30001].int_ = copyedges((int)v);
      break;
    }
    q = r;
  } while (q != p);
}


/*:621*/
/*622:*/

Static Void ringmerge(p, q)
halfword p, q;
{
  halfword r;

  r = mem[p + 30001].int_;
  while (r != p) {
    if (r == q) {  /*623:*/
      printnl(133);
      print(465L);
      helpptr = 2;
      helpline[1] = 466;
      helpline[0] = 467;
      putgeterror();   /*:623*/
      goto _L10;
    }
    r = mem[r + 30001].int_;
  }
  r = mem[p + 30001].int_;
  mem[p + 30001].int_ = mem[q + 30001].int_;
  mem[q + 30001].int_ = r;
_L10: ;

}


/*:622*/
/*626:*/

Static Void showcmdmod(c, m)
long c, m;
{
  begindiagnostic();
  printnl(123);
  printcmdmod(c, m);
  printchar(125);
  enddiagnostic(false);
}

<stdin>, line 10588: Note: Using % for possibly-negative arguments [317]
<stdin>, line 10597: Note: Using % for possibly-negative arguments [317]


/*:626*/
/*635:*/

Static Void showcontext()
{
  char oldsetting;   /*641:*/
  short i;
  long l, m;
  char n;
  long p, q;   /*:641*/
  short FORLIM;
  long FORLIM1;

  fileptr = inputptr;
  inputstack[fileptr] = curinput;
  while (true) {
    curinput = inputstack[fileptr];   /*636:*/
    if (fileptr == inputptr || curinput.indexfield <= 6 ||
	curinput.indexfield != 10 || curinput.locfield != -30000)
    {   /*:636*/
      tally = 0;
      oldsetting = selector;
      if (curinput.indexfield <= 6) {  /*637:*/
	if (curinput.namefield <= 1) {   /*:637*/
	  if (curinput.namefield == 0 && fileptr == 0)
	    printnl(469);
	  else
	    printnl(470);
	} else if (curinput.namefield == 2)
	  printnl(471);
	else {
	  printnl(472);
	  printint(line);
	}
	printchar(32);
	/*644:*/
	l = tally;
	tally = 0;
	selector = 4;
	trickcount = 1000000L;
	if (curinput.limitfield > 0) {
	  FORLIM = curinput.limitfield;
	  for (i = curinput.startfield; i < FORLIM; i++) {
	    if (i == curinput.locfield) {
	      firstcount = tally;
	      trickcount = tally + errorline - halferrorline + 1;
	      if (trickcount < errorline)
		trickcount = errorline;
	    }
	    print((long)buffer[i]);
	  }  /*:644*/
	}
      } else {  /*638:*/
	if ((unsigned)curinput.indexfield < 32 &&
	    ((1L << curinput.indexfield) & 0x1f80) != 0)
	{   /*645:*/
	  switch (curinput.indexfield) {

	  case 7:
	    printnl(473);
	    break;

	  case 8:  /*639:*/
	    printnl(478);
	    p = paramstack[curinput.limitfield];
	    if (p != -30000) {
	      if (mem[p + 30000].hh.rh == -29999)
		printexp((int)p, 0);
	      else
		showtokenlist(p, -30000L, 20L, tally);
	    }
	    print(479L);
	    break;
	    /*:639*/

	  case 9:
	    printnl(474);
	    break;

	  case 10:
	    if (curinput.locfield == -30000)
	      printnl(475);
	    else
	      printnl(476);
	    break;

	  case 11:
	    printnl(477);
	    break;

	  case 12:
	    println();
	    if (curinput.namefield != -30000)   /*640:*/
	      print((long)hash[curinput.namefield - 1].rh);
	    else {   /*:640*/
	      p = paramstack[curinput.limitfield];
	      if (p == -30000)
		showtokenlist((long)paramstack[curinput.limitfield + 1],
			      -30000L, 20L, tally);
	      else {
		q = p;
		while (mem[q + 30000].hh.rh != -30000)
		  q = mem[q + 30000].hh.rh;
		mem[q + 30000].hh.rh = paramstack[curinput.limitfield + 1];
		showtokenlist(p, -30000L, 20L, tally);
		mem[q + 30000].hh.rh = -30000;
	      }
	    }
	    print(368L);
	    break;
	  }
	} else   /*:638*/
	  printnl(63);
	l = tally;
	tally = 0;
	selector = 4;
	trickcount = 1000000L;
	if (curinput.indexfield != 12)
	  showtokenlist((long)curinput.startfield, (long)curinput.locfield,
			100000L, 0L);
	else   /*:645*/
	  showmacro(curinput.startfield, (long)curinput.locfield, 100000L);
      }
      selector = oldsetting;   /*643:*/
      if (trickcount == 1000000L) {
	firstcount = tally;
	trickcount = tally + errorline - halferrorline + 1;
	if (trickcount < errorline)
	  trickcount = errorline;
      }
      if (tally < trickcount)
	m = tally - firstcount;
      else
	m = trickcount - firstcount;
      if (l + firstcount <= halferrorline) {
	p = 0;
	n = l + firstcount;
      } else {
	print(146L);
	p = l + firstcount - halferrorline + 3;
	n = halferrorline;
      }
      FORLIM1 = firstcount;
      for (q = p; q < FORLIM1; q++) {
/* p2c: <stdin>, line 10588:
 * Note: Using % for possibly-negative arguments [317] */
	printchar(trickbuf[q % errorline]);
      }
      println();
      for (q = 1; q <= n; q++)
	printchar(32);
      if (m + n <= errorline)
	p = firstcount + m;
      else
	p = firstcount + errorline - n - 3;
      for (q = firstcount; q < p; q++) {
/* p2c: <stdin>, line 10597:
 * Note: Using % for possibly-negative arguments [317] */
	printchar(trickbuf[q % errorline]);
      }
      if (m + n > errorline)   /*:643*/
	print(146L);
    }
    if (curinput.indexfield <= 6) {
      if (curinput.namefield > 2 || fileptr == 0)
	goto _L30;
    }
    fileptr--;
  }
_L30:
  curinput = inputstack[inputptr];
}  /* showcontext */


/*:635*/
/*649:*/

Static Void begintokenlist(p, t)
halfword p;
quarterword t;
{
  if (inputptr > maxinstack) {
    maxinstack = inputptr;
    if (inputptr == stacksize)
      overflow(480, (long)stacksize);
  }
  inputstack[inputptr] = curinput;
  inputptr++;
  curinput.startfield = p;
  curinput.indexfield = t;
  curinput.limitfield = paramptr;
  curinput.locfield = p;
}


/*:649*/
/*650:*/

Static Void endtokenlist()
{
  halfword p;

  if (curinput.indexfield >= 10) {
    if (curinput.indexfield <= 11) {
      flushtokenlist(curinput.startfield);
      goto _L30;
    }
    deletemacref(curinput.startfield);
  }
  while (paramptr > curinput.limitfield) {
    paramptr--;
    p = paramstack[paramptr];
    if (p != -30000) {
      if (mem[p + 30000].hh.rh == -29999) {
	recyclevalue(p);
	freenode(p, 2);
      } else
	flushtokenlist(p);
    }
  }
_L30:
  inputptr--;
  curinput = inputstack[inputptr];
  if (interrupt != 0)
    pauseforinstructions();
}


/*:650*/
/*651:*/
/*855:*/
/*856:*/

Static Void encapsulate(p)
halfword p;
{
  curexp = getnode(2L);
  mem[curexp + 30000].hh.UU.U2.b0 = curtype;
  mem[curexp + 30000].hh.UU.U2.b1 = 11;
  newdep((int)curexp, p);
}  /* encapsulate */


/*:856*/
/*858:*/

Static Void install(r, q)
halfword r, q;
{
  halfword p;

  if (mem[q + 30000].hh.UU.U2.b0 == 16) {
    mem[r + 30001].int_ = mem[q + 30001].int_;
    mem[r + 30000].hh.UU.U2.b0 = 16;
    return;
  }
  if (mem[q + 30000].hh.UU.U2.b0 != 19) {
    mem[r + 30000].hh.UU.U2.b0 = mem[q + 30000].hh.UU.U2.b0;
    newdep(r, copydeplist(mem[q + 30001].hh.rh));
    return;
  }
  p = singledependency(q);
  if (p != depfinal) {
    mem[r + 30000].hh.UU.U2.b0 = 17;
    newdep(r, p);
    return;
  }
  mem[r + 30000].hh.UU.U2.b0 = 16;
  mem[r + 30001].int_ = 0;
  freenode(p, 2);
}  /*:858*/


Static Void makeexpcopy(p)
halfword p;
{
  halfword q, r, t;

_L20:
  curtype = mem[p + 30000].hh.UU.U2.b0;
  if ((unsigned)curtype >= 32 || ((1L << curtype) & 0xffffeL) == 0) {
    confusion(664);
    return;
  }
  switch (curtype) {

  case 1:
  case 2:
  case 16:
    curexp = mem[p + 30001].int_;
    break;

  case 3:
  case 5:
  case 7:
  case 12:
  case 10:
    curexp = newringentry(p);
    break;

  case 4:
    curexp = mem[p + 30001].int_;
    if (strref[curexp] < 127)
      strref[curexp]++;
    break;

  case 6:
    curexp = mem[p + 30001].int_;
    mem[curexp + 30000].hh.UU.lh++;
    break;

  case 11:
    curexp = copyedges((int)mem[p + 30001].int_);
    break;

  case 9:
  case 8:
    curexp = copypath((int)mem[p + 30001].int_);
    break;

  case 13:
  case 14:  /*857:*/
    if (mem[p + 30001].int_ == -30000)
      initbignode(p);
    , curtok,
backinput, backerror, inserror, beginfilereading, endfilereading,
clearforerrorprompt, checkoutervalidity, getnextt = getnode(2L);
    mem[t + 30000].hh.UU.U2.b1 = 11;
    mem[t + 30000].hh.UU.U2.b0 = curtype;
    initbignode(t);
    q = mem[p + 30001].int_ + bignodesize[curtype - 13];
    r = mem[t + 30001].int_ + bignodesize[curtype - 13];
    do {
      q -= 2;
      r -= 2;
      install(r, q);
    } while (q != mem[p + 30001].int_);
    curexp = t;
    break;
    /*:857*/

  case 17:
  case 18:
    encapsulate(copydeplist(mem[p + 30001].hh.rh));
    break;

  case 15:
    mem[p + 30000].hh.UU.U2.b0 = 19;
    serialno += 64;
    mem[p + 30001].int_ = serialno;
    goto _L20;
    break;

  case 19:
    q = singledependency(p);
    if (q == depfinal) {
      curtype = 16;
      curexp = 0;
      freenode(q, 2);
    } else {
      curtype = 17;
      encapsulate(q);
    }
    break;
  }
}  /*:855*/


Static halfword curtok()
{
  halfword p;
  smallnumber savetype;
  long saveexp;

  if (cursym == 0) {
    if (curcmd == 38) {
      savetype = curtype;
      saveexp = curexp;
      makeexpcopy((int)curmod);
      p = stashcurexp();
      mem[p + 30000].hh.rh = -30000;
      curtype = savetype;
      curexp = saveexp;
      return p;
    }
    p = getnode(2L);
    mem[p + 30001].int_ = curmod;
    mem[p + 30000].hh.UU.U2.b1 = 12;
    if (curcmd == 42)
      mem[p + 30000].hh.UU.U2.b0 = 16;
    else
      mem[p + 30000].hh.UU.U2.b0 = 4;
    return p;
  }
  p = avail;
  if (p == -30000)
    p = getavail();
  else {
    avail = mem[p + 30000].hh.rh;
    mem[p + 30000].hh.rh = -30000;
  }  /*dynused:=dynused+1;*/
  mem[p + 30000].hh.UU.lh = cursym;
  return p;
}


/*:651*/
/*652:*/

Static Void backinput()
{
  halfword p;

  p = curtok();
  while (curinput.indexfield > 6 && curinput.locfield == -30000)
    endtokenlist();
  begintokenlist(p, 10);
}


/*:652*/
/*653:*/

Static Void backerror()
{
  OKtointerrupt = false;
  backinput();
  OKtointerrupt = true;
  error();
}  /* backerror */


Static Void inserror()
{
  OKtointerrupt = false;
  backinput();
  curinput.indexfield = 11;
  OKtointerrupt = true;
  error();
}


/*:653*/
/*654:*/

Static Void beginfilereading()
{
  if (inopen == 6)
    overflow(481, 6L);
  if (first == bufsize)
    overflow(128, (long)bufsize);
  inopen++;
  if (inputptr > maxinstack) {
    maxinstack = inputptr;
    if (inputptr == stacksize)
      overflow(480, (long)stacksize);
  }
  inputstack[inputptr] = curinput;
  inputptr++;
  curinput.indexfield = inopen;
  linestack[curinput.indexfield - 1] = line;
  curinput.startfield = first;
  curinput.namefield = 0;
}


/*:654*/
/*655:*/

Static Void endfilereading()
{
  first = curinput.startfield;
  line = linestack[curinput.indexfield - 1];
  if (curinput.indexfield != inopen)
    confusion(482);
  if (curinput.namefield > 2)
    aclose(&inputfile[curinput.indexfield - 1]);
  inputptr--;
  curinput = inputstack[inputptr];
  inopen--;
}


/*:655*/
/*656:*/

Static Void clearforerrorprompt()
{
  while (curinput.indexfield <= 6 && curinput.namefield == 0 &&
	 inputptr > 0 && curinput.locfield == curinput.limitfield)
    endfilereading();
  println();
}


/*:656*/
/*661:*/

Static boolean checkoutervalidity()
{
  halfword p;

  if (scannerstatus == 0)
    return true;
  else {
    deletionsallowed = false;   /*662:*/
    if (cursym != 0) {   /*:662*/
      p = getavail();
      mem[p + 30000].hh.UU.lh = cursym;
      begintokenlist(p, 10);
    }
    if (scannerstatus > 1) {  /*663:*/
      runaway();
      if (cursym == 0) {
	printnl(133);
	print(488L);
      } else {
	printnl(133);
	print(489L);
      }
      print(490L);
      helpptr = 4;
      helpline[3] = 491;
      helpline[2] = 492;
      helpline[1] = 493;
      helpline[0] = 494;
      switch (scannerstatus) {   /*664:*/

      case 2:
	print(495L);
	helpline[3] = 496;
	cursym = 2235;
	break;

      case 3:
	print(497L);
	helpline[3] = 498;
	if (warninginfo == 0)
	  cursym = 2239;
	else {
	  cursym = 2231;
	  eqtb[2230].rh = warninginfo;
	}
	break;

      case 4:
      case 5:
	print(499L);
	if (scannerstatus == 5)
	  print((long)hash[warninginfo - 1].rh);
	else
	  printvariablename((int)warninginfo);
	cursym = 2237;
	break;

      case 6:
	print(500L);
	print((long)hash[warninginfo - 1].rh);
	print(501L);
	helpline[3] = 502;
	cursym = 2236;
	break;
      }
      /*:664*/
      inserror();
    } else {  /*:663*/
      printnl(133);
      print(483L);
      printint(warninginfo);
      helpptr = 3;
      helpline[2] = 484;
      helpline[1] = 485;
      helpline[0] = 486;
      if (cursym == 0)
	helpline[2] = 487;
      cursym = 2238;
      inserror();
    }
    deletionsallowed = true;
    return false;
  }
}


/*:661*/
/*666:*/

Static Void firmuptheline PV();

<stdin>, line 11035: Warning: Symbol 'FLUSH' is not defined [221]


/*:666*/
/*667:*/

Static Void getnext()
{
  short k;
  ASCIIcode c, class_;
  long n, f;

_L20:
  cursym = 0;
  if (curinput.indexfield <= 6)   /*668:*/
  {  /*669:*/
_L25:
    c = buffer[curinput.locfield];
    curinput.locfield++;
    class_ = charclass[c];
    if ((unsigned)class_ < 32 && ((1L << class_) & 0x1001ffL) != 0) {
      switch (class_) {

      case 0:
	goto _L85;
	break;

      case 1:
	class_ = charclass[buffer[curinput.locfield]];
	if (class_ > 1)
	  goto _L25;
	if (class_ < 1) {
	  n = 0;
	  goto _L86;
	}
	break;

      case 2:
	goto _L25;
	break;

      case 3:  /*679:*/
	if (curinput.namefield > 2) {  /*681:*/
	  line++;
	  first = curinput.startfield;
	  if (!forceeof) {
	    if (inputln(&inputfile[curinput.indexfield - 1], true))
	      firmuptheline();
	    else
	      forceeof = true;
	  }
	  if (forceeof) {
	    printchar(41);
	    forceeof = false;
	    flush(stdout);
/* p2c: <stdin>, line 11035: Warning: Symbol 'FLUSH' is not defined [221] */
	    endfilereading();
	    if (checkoutervalidity())
	      goto _L20;
	    else
	      goto _L20;
	  }
	  buffer[curinput.limitfield] = 37;
	  first = curinput.limitfield + 1;
	  curinput.locfield = curinput.startfield;
	} else   /*:679*/
	{  /*:681*/
	  if (inputptr > 0) {
	    endfilereading();
	    goto _L20;
	  }
	  if (selector < 2)
	    openlogfile();
	  if (interaction > 1) {
	    if (curinput.limitfield == curinput.startfield)
	      printnl(517);
	    println();
	    first = curinput.startfield;
	    print(42L);
	    terminput();
	    curinput.limitfield = last;
	    buffer[curinput.limitfield] = 37;
	    first = curinput.limitfield + 1;
	    curinput.locfield = curinput.startfield;
	  } else
	    fatalerror(518);
	}
	if (interrupt != 0)
	  pauseforinstructions();
	goto _L25;
	break;

      case 4:  /*671:*/
	if (buffer[curinput.locfield] == 34)
	  curmod = 155;
	else {
	  k = curinput.locfield;
	  buffer[curinput.limitfield + 1] = 34;
	  do {
	    curinput.locfield++;
	  } while (buffer[curinput.locfield] != 34);
	  if (curinput.locfield > curinput.limitfield)   /*:672*/
	  {  /*672:*/
	    curinput.locfield = curinput.limitfield;
	    printnl(133);
	    print(510L);
	    helpptr = 3;
	    helpline[2] = 511;
	    helpline[1] = 512;
	    helpline[0] = 513;
	    deletionsallowed = false;
	    error();
	    deletionsallowed = true;
	    goto _L20;
	  }
	  if (curinput.locfield == k + 1)
	    curmod = buffer[k];
	  else {
	    if (poolptr + curinput.locfield - k > maxpoolptr) {
	      if (poolptr + curinput.locfield - k > poolsize)
		overflow(129, (long)(poolsize - initpoolptr));
	      maxpoolptr = poolptr + curinput.locfield - k;
	    }
	    do {
	      strpool[poolptr] = buffer[k];
	      poolptr++;
	      k++;
	    } while (k != curinput.locfield);
	    curmod = makestring();
	  }
	}
	curinput.locfield++;
	curcmd = 39;
	goto _L10;
	break;
	/*:671*/

      case 5:
      case 6:
      case 7:
      case 8:
	k = curinput.locfield - 1;
	goto _L40;
	break;

      case 20:  /*670:*/
	printnl(133);
	print(507L);
	helpptr = 2;
	helpline[1] = 508;
	helpline[0] = 509;
	deletionsallowed = false;
	error();
	deletionsallowed = true;
	goto _L20;
	break;
      }
    }
    k = curinput.locfield - 1;
    while (charclass[buffer[curinput.locfield]] == class_)
      curinput.locfield++;
    goto _L40;
_L85:   /*673:*/
    n = c - 48;
    while (charclass[buffer[curinput.locfield]] == 0) {
      if (n < 4096)
	n = n * 10 + buffer[curinput.loc, firmuptheline, scantoks, getsymbol, getclearsymbol, checkequals, makeopdef,
checkdelimiter, scandeclaredvariable, scandeffield] - 48;
      curinput.locfield++;
    }
    if (buffer[curinput.locfield] == 46) {
      if (charclass[buffer[curinput.locfield + 1]] == 0)
	goto _L30;
    }
    f = 0;
    goto _L87;
_L30:
    curinput.locfield++;   /*:673*/
_L86:   /*674:*/
    k = 0;
    do {
      if (k < 17) {
	dig[k] = buffer[curinput.locfield] - 48;
	k++;
      }
      curinput.locfield++;
    } while (charclass[buffer[curinput.locfield]] == 0);
    f = rounddecimals(k);
    if (f == 65536L) {   /*:674*/
      n++;
      f = 0;
    }
_L87:   /*675:*/
    if (n < 4096)
      curmod = n * 65536L + f;
    else {
      printnl(133);
      print(514L);
      helpptr = 2;
      helpline[1] = 515;
      helpline[0] = 516;
      deletionsallowed = false;
      error();
      deletionsallowed = true;
      curmod = 268435455L;
    }
    curcmd = 42;
    goto _L10;   /*:675*/
_L40:
    cursym = idlookup((long)k, (long)(curinput.locfield - k));
  } else if (curinput.locfield >= himemmin) {
    cursym = mem[curinput.locfield + 30000].hh.UU.lh;
    curinput.locfield = mem[curinput.locfield + 30000].hh.rh;
    if (cursym >= 2242) {
      if (cursym >= 2392) {  /*677:*/
	if (cursym >= 2542)
	  cursym -= 150;
	begintokenlist(paramstack[curinput.limitfield + cursym - 2392], 9);
	goto _L20;
      } else {  /*:677*/
	curcmd = 38;
	curmod = paramstack[curinput.limitfield + cursym - 2242];
	cursym = 0;
	goto _L10;
      }
    }
  } else if (curinput.locfield > -30000) {
    if (mem[curinput.locfield + 30000].hh.UU.U2.b1 == 12) {
      curmod = mem[curinput.locfield + 30001].int_;
      if (mem[curinput.locfield + 30000].hh.UU.U2.b0 == 16)
	curcmd = 42;
      else {
	curcmd = 39;
	if (strref[curmod] < 127)
	  strref[curmod]++;
      }
    } else {
      curmod = curinput.locfield;
      curcmd = 38;
    }
    curinput.locfield = mem[curinput.locfield + 30000].hh.rh;
    goto _L10;
  } else {
    endtokenlist();
    goto _L20;
  }
  curcmd = eqtb[cursym - 1].UU.lh;
  curmod = eqtb[cursym - 1].rh;
  if (curcmd >= 83) {
    if (!checkoutervalidity())
      goto _L20;   /*:668*/
    curcmd -= 83;
  }
_L10: ;


  /*:670*/
  /*:669*/
  /*676:*/
  /*678:*/
  /*:678*/
  /*:676*/
}


/*:667*/
/*682:*/

Static Void firmuptheline()
{
  short k, FORLIM;

  curinput.limitfield = last;
  if (internal[30] <= 0)
    return;
  if (interaction <= 1)
    return;
  println();
  if (curinput.startfield < curinput.limitfield) {
    FORLIM = curinput.limitfield;
    for (k = curinput.startfield; k < FORLIM; k++)
      print((long)buffer[k]);
  }
  first = curinput.limitfield;
  print(519L);
  terminput();
  if (last <= first)
    return;
  FORLIM = last;
  for (k = first; k < FORLIM; k++)
    buffer[k + curinput.startfield - first] = buffer[k];
  curinput.limitfield = curinput.startfield + last - first;
}  /*:682*/


/*685:*/

Static halfword scantoks(terminator, substlist, tailend, suffixcount)
commandcode terminator;
halfword substlist, tailend;
smallnumber suffixcount;
{
  halfword p, q;
  long balance;

  p = 29998;
  balance = 1;
  mem[59998].hh.rh = -30000;
  while (true) {
    getnext();
    if (cursym > 0) {  /*686:*/
      q = substlist;
      while (q != -30000) {
	if (mem[q + 30000].hh.UU.lh == cursym) {
	  cursym = mem[q + 30001].int_;
	  curcmd = 7;
	  goto _L40;
	}
	q = mem[q + 30000].hh.rh;
      }
_L40:   /*:686*/

      if (curcmd == terminator) {   /*687:*/
	if (curmod > 0)
	  balance++;
	else {
	  balance--;
	  if (balance == 0)
	    goto _L30;
	}  /*:687*/
      } else if (curcmd == 61) {
	if (curmod == 0)
	  getnext();
	else if (curmod <= suffixcount)
	  cursym = curmod + 2391;
      }
    }
    mem[p + 30000].hh.rh = curtok();
    p = mem[p + 30000].hh.rh;
  }
_L30:
  mem[p + 30000].hh.rh = tailend;
  flushnodelist(substlist);
  return (mem[59998].hh.rh);

  /*690:*/
  /*:690*/
}


/*:685*/
/*691:*/

Static Void getsymbol()
{
_L20:
  getnext();
  if (cursym != 0 && cursym <= 2229)
    return;
  printnl(133);
  print(531L);
  helpptr = 3;
  helpline[2] = 532;
  helpline[1] = 533;
  helpline[0] = 534;
  if (cursym > 0)
    helpline[2] = 535;
  else if (curcmd == 39) {
    if (strref[curmod] < 127) {
      if (strref[curmod] > 1)
	strref[curmod]--;
      else
	flushstring((int)curmod);
    }
  }
  cursym = 2229;
  inserror();
  goto _L20;
}  /* getsymbol */


/*:691*/
/*692:*/

Static Void getclearsymbol()
{
  getsymbol();
  clearsymbol(cursym, false);
}


/*:692*/
/*693:*/

Static Void checkequals()
{
  if (curcmd == 51)
    return;
  if (curcmd == 77)
    return;
  missingerr(61);
  helpptr = 5;
  helpline[4] = 536;
  helpline[3] = 537;
  helpline[2] = 538;
  helpline[1] = 539;
  helpline[0] = 540;
  backerror();
}


/*:693*/
/*694:*/

Static Void makeopdef()
{
  commandcode m;
  halfword p, q, r;

  m = curmod;
  getsymbol();
  q = getnode(2L);
  mem[q + 30000].hh.UU.lh = cursym;
  mem[q + 30001].int_ = 2242;
  getclearsymbol();
  warninginfo = cursym;
  getsymbol();
  p = getnode(2L);
  mem[p + 30000].hh.UU.lh = cursym;
  mem[p + 30001].int_ = 2243;
  mem[p + 30000].hh.rh = q;
  getnext();
  checkequals();
  scannerstatus = 5;
  q = getavail();
  mem[q + 30000].hh.UU.lh = -30000;
  r = getavail();
  mem[q + 30000].hh.rh = r;
  mem[r + 30000].hh.UU.lh = 0;
  mem[r + 30000].hh.rh = scantoks(16, p, -30000, 0);
  scannerstatus = 0;
  eqtb[warninginfo - 1].UU.lh = m;
  eqtb[warninginfo - 1].rh = q;
  getxnext();
}  /*:694*/


/*697:*/
/*1032:*/

Static Void checkdelimiter(ldelim, rdelim)
halfword ldelim, rdelim;
{
  if (curcmd == 62) {
    if (curmod == ldelim)
      goto _L10;
  }
  if (cursym != rdelim) {
    missingerr(hash[rdelim - 1].rh);
    helpptr = 2;
    helpline[1] = 786;
    helpline[0] = 787;
    backerror();
  } else {
    printnl(133);
    print(788L);
    print((long)hash[rdelim - 1].rh);
    print(789L);
    helpptr = 3;
    helpline[2] = 790;
    helpline[1] = 791;
    helpline[0] = 792;
    error();
  }
_L10: ;

}


/*:1032*/
/*1011:*/

Static halfword scandeclaredvariable()
{
  halfword x, h, t, l;

  getsymbol();
  x = cursym;
  if (curcmd != 41)
    clearsymbol(x, false);
  if (eqtb[x - 1].rh == -30000)
    newroot(x);
  h = getavail();
  mem[h + 30000].hh.UU.lh = x;
  t = h;
  while (true) {
    getxnext();
    if (cursym == 0)
      goto _L30;
    if (curcmd != 41) {
      if (curcmd != 40) {
	if (curcmd != 63)  /*1012:*/
	  goto _L30;
	l = cursym;
	getxnext();
	if (curcmd != 64) {
	  backinput();
	  cursym = l;
	  curcmd = 63;
	  goto _L30;
	}
	cursym = 0;
      }
    }
    mem[t + 30000].hh.rh = getavail();
    t = mem[t + 30000].hh.rh;
    mem[t + 30000].hh.UU.lh = cursym;
  }
_L30:
  return h;

  /*:1012*/
}  /*:1011*/


Static Void scandef()
{
  char m;
  char n;
  uchar k;
  char c;
  halfword r, q, p, base, ldelim, rdelim;

  m = curmod;
  c = 0;
  mem[59998].hh.rh = -30000;
  q = getavail();
  mem[q + 30000].hh.UU.lh = -30000;
  r = -30000;   /*700:*/
  if (m == 1) {
    getclearsymbol();
    warninginfo = cursym;
    getnext();
    scannerstatus = 5;
    n = 0;
    eqtb[warninginfo - 1].UU.lh = 10;
    eqtb[warninginfo - 1].rh = q;
  } else {   /*:700*/
    p = scandeclaredvariable();
    flushvariable(eqtb[mem[p + 30000].hh.UU.lh - 1].rh, mem[p + 30000].hh.rh,
		  true);
    warninginfo = findvariable(p);
    flushlist(p);
    if (warninginfo == -30000)   /*:701*/
    {  /*701:*/
      printnl(133);
      print(547L);
      helpptr = 2;
      helpline[1] = 548;
      helpline[0] = 549;
      error();
      warninginfo = -29979;
    }
    scannerstatus = 4;
    n = 2;
    if (curcmd == 61) {
      if (curmod == 3) {
	n = 3;
	getnext();
      }
    }
    mem[warninginfo + 30000].hh.UU.U2.b0 = n + 20;
    mem[warninginfo + 30001].int_ = q;
  }
  k = n;
  if (curcmd == 31) {   /*703:*/
    do {
      ldelim = cursym;
      rdelim = curmod;
      getnext();
      if (curcmd == 56 && curmod >= 2242)
	base = curmod;
      else {
	printnl(133);
	print(550L);
	helpptr = 1;
	helpline[0] = 551;
	backerror();
	base = 2242;
      }  /*704:*/
      do {
	mem[q + 30000].hh.rh = getavail();
	q = mem[q + 30000].hh.rh;
	mem[q + 30000].hh.UU.lh = base + k;
	getsymbol();
	p = getnode(2L);
	mem[p + 30001].int_ = base + k;
	mem[p + 30000].hh.UU.lh = cursym;
	if (k == 150), printmacroname, printarg,
scantextarg, macrocall
	  overflow(552, 150L);
	k++;
	mem[p + 30000].hh.rh = r;
	r = p;
	getnext();   /*:704*/
      } while (curcmd == 79);
      checkdelimiter(ldelim, rdelim);
      getnext();   /*:703*/
    } while (curcmd == 31);
  }
  if (curcmd == 56)   /*:705*/
  {  /*705:*/
    p = getnode(2L);
    if (curmod < 2242) {
      c = curmod;
      mem[p + 30001].int_ = k + 2242;
    } else {
      mem[p + 30001].int_ = curmod + k;
      if (curmod == 2242)
	c = 4;
      else if (curmod == 2392)
	c = 6;
      else
	c = 7;
    }
    if (k == 150)
      overflow(552, 150L);
    k++;
    getsymbol();
    mem[p + 30000].hh.UU.lh = cursym;
    mem[p + 30000].hh.rh = r;
    r = p;
    getnext();
    if (c == 4) {
      if (curcmd == 69) {
	c = 5;
	p = getnode(2L);
	if (k == 150)
	  overflow(552, 150L);
	mem[p + 30001].int_ = k + 2242;
	getsymbol();
	mem[p + 30000].hh.UU.lh = cursym;
	mem[p + 30000].hh.rh = r;
	r = p;
	getnext();
      }
    }
  }
  checkequals();
  p = getavail();
  mem[p + 30000].hh.UU.lh = c;
  mem[q + 30000].hh.rh = p;   /*698:*/
  if (m == 1)
    mem[p + 30000].hh.rh = scantoks(16, r, -30000, n);
  else {
    q = getavail();
    mem[q + 30000].hh.UU.lh = bgloc;
    mem[p + 30000].hh.rh = q;
    p = getavail();
    mem[p + 30000].hh.UU.lh = egloc;
    mem[q + 30000].hh.rh = scantoks(16, r, p, n);
  }
  if (warninginfo == -29979)   /*:698*/
    flushtokenlist((int)mem[22].int_);
  scannerstatus = 0;
  getxnext();
}


/*:697*/
/*706:*/

Static Void scanprimary PV();

Static Void scansecondary PV();

Static Void scantertiary PV();

Static Void scanexpression PV();

Static Void scansuffix PV();


/*720:*/
/*722:*/

Static Void printmacroname(a, n)
halfword a, n;
{
  halfword p, q;

  if (n != -30000) {
    print((long)hash[n - 1].rh);
    return;
  }
  p = mem[a + 30000].hh.UU.lh;
  if (p == -30000) {
    print((long)hash[mem[mem[mem[a + 30000].hh.rh + 30000].hh.UU.lh + 30000].
		     hh.UU.lh - 1].rh);
    return;
  }
  q = p;
  while (mem[q + 30000].hh.rh != -30000)
    q = mem[q + 30000].hh.rh;
  mem[q + 30000].hh.rh = mem[mem[a + 30000].hh.rh + 30000].hh.UU.lh;
  showtokenlist((long)p, -30000L, 1000L, 0L);
  mem[q + 30000].hh.rh = -30000;
}


/*:722*/
/*723:*/

Static Void printarg(q, n, b)
halfword q;
long n;
halfword b;
{
  if (mem[q + 30000].hh.rh == -29999)
    printnl(365);
  else if (b < 2542 && b != 7)
    printnl(366);
  else
    printnl(367);
  printint(n);
  print(568L);
  if (mem[q + 30000].hh.rh == -29999)
    printexp(q, 1);
  else
    showtokenlist((long)q, -30000L, 1000L, 0L);
}


/*:723*/
/*730:*/

Static Void scantextarg(ldelim, rdelim)
halfword ldelim, rdelim;
{
  long balance;
  halfword p;

  warninginfo = ldelim;
  scannerstatus = 3;
  p = 29998;
  balance = 1;
  mem[59998].hh.rh = -30000;
  while (true) {
    getnext();
    if (ldelim == 0) {  /*732:*/
      if (curcmd > 79) {
	if (balance == 1)
	  goto _L30;
	if (curcmd == 81)
	  balance--;
      } else if (curcmd == 32)
	balance++;
    } else {   /*:732*/
      if (curcmd == 62) {
	if (curmod == ldelim) {
	  balance--;
	  if (balance == 0)
	    goto _L30;
	}
      } else if (curcmd == 31) {
	if (curmod == rdelim)
	  balance++;
      }
    }
    mem[p + 30000].hh.rh = curtok();
    p = mem[p + 30000].hh.rh;
  }
_L30:
  curexp = mem[59998].hh.rh;
  curtype = 20;
  scannerstatus = 0;

  /*731:*/
  /*:731*/
}  /*:730*/


Static Void macrocall(defref, arglist, macroname)
halfword defref, arglist, macroname;
{
  halfword r, p, q;
  long n;
  halfword ldelim, rdelim, tail;

  r = mem[defref + 30000].hh.rh;
  mem[defref + 30000].hh.UU.lh++;
  if (arglist == -30000)
    n = 0;   /*724:*/
  else {   /*:724*/
    n = 1;
    tail = arglist;
    while (mem[tail + 30000].hh.rh != -30000) {
      n++;
      tail = mem[tail + 30000].hh.rh;
    }
  }
  if (internal[8] > 0)   /*:721*/
  {  /*721:*/
    begindiagnostic();
    println();
    printmacroname(arglist, macroname);
    if (n == 3)
      print(530L);
    showmacro(defref, -30000L, 100000L);
    if (arglist != -30000) {
      n = 0;
      p = arglist;
      do {
	q = mem[p + 30000].hh.UU.lh;
	printarg(q, n, 0);
	n++;
	p = mem[p + 30000].hh.rh;
      } while (p != -30000);
    }
    enddiagnostic(false);
  }
  /*725:*/
  curcmd = 80;
  while (mem[r + 30000].hh.UU.lh >= 2242) {  /*726:*/
    if (curcmd != 79) {
      getxnext();
      if (curcmd != 31) {
	printnl(133);
	print(574L);
	printmacroname(arglist, macroname);
	helpptr = 3;
	helpline[2] = 575;
	helpline[1] = 576;
	helpline[0] = 577;
	if (mem[r + 30000].hh.UU.lh >= 2392) {
	  curexp = -30000;
	  curtype = 20;
	} else {
	  curexp = 0;
	  curtype = 16;
	}
	backerror();
	curcmd = 62;
	goto _L40;
      }
      ldelim = cursym;
      rdelim = curmod;
    }  /*729:*/
    if (mem[r + 30000].hh.UU.lh >= 2542)
      scantextarg(ldelim, rdelim);
    else {   /*:729*/
      getxnext();
      if (mem[r + 30000].hh.UU.lh >= 2392)
	scansuffix();
      else
	scanexpression();
    }
    if (curcmd != 79) {   /*727:*/
      if (curcmd != 62 || curmod != ldelim) {
	if (mem[mem[r + 30000].hh.rh + 30000].hh.UU.lh >= 2242) {
	  missingerr(44);
	  helpptr = 3;
	  helpline[2] = 578;
	  helpline[1] = 579;
	  helpline[0] = 573;
	  backerror();
	  curcmd = 79;
	} else {   /*:727*/
	  missingerr(hash[rdelim - 1].rh);
	  helpptr = 2;
	  helpline[1] = 580;
	  helpline[0] = 573;
	  backerror();
	}
      }
    }
_L40:   /*728:*/
    p = getavail();
    if (curtype == 20)
      mem[p + 30000].hh.UU.lh = curexp;
    else
      mem[p + 30000].hh.UU.lh = stashcurexp();
    if (internal[8] > 0) {
      begindiagnostic();
      printarg(mem[p + 30000].hh.UU.lh, n, mem[r + 30000].hh.UU.lh);
      enddiagnostic(false);
    }
    if (arglist == -30000)
      arglist = p;
    else
      mem[tail + 30000].hh.rh = p;
    tail = p;
    n++;   /*:728*/
    /*:726*/
    r = mem[r + 30000].hh.rh;
  }
  if (curcmd == 79) {
    printnl(133);
    print(569L);
    printmacroname(arglist, macroname);
    printchar(59);
    printnl(570);
    print((long)hash[rdelim - 1].rh);
    print(170L);
    helpptr = 3;
    helpline[2] = 571;
    helpline[1] = 572;
    helpline[0] = 573;
    error();
  }
  if (mem[r + 30000].hh.UU.lh != 0)   /*:733*/
  {  /*733:*/
    if (mem[r + 30000].hh.UU.lh < 7) {
      getxnext();
      if (mem[r + 30000].hh.UU.lh != 6) {
	if (curcmd == 51 || curcmd == 77)
	  getxnext();
      }
    }
    switch (mem[r + 30000].hh.UU.lh) {

    case 1:
      scanprimary();
      break;

    case 2:
      scansecondary();
      break;

    case 3:
      scantertiary();
      break;

    case 4:
      scanexpression();
      break;

    case 5:  /*734:*/
      scanexpression();
      p = getavail();
      mem[p + 30000].hh.UU.lh = stashcurexp();
      if (internal[8] > 0) {
	begindiagnostic();
	printarg(mem[p + 30000].hh.UU.lh, n, 0);
	enddiagnostic(false);
      }
      if (arglist == -30000)
	arglist = p;
      else
	mem[tail + 30000].hh.rh = p;
      tail = p;
      n++;
      if (curcmd != 69) {
	missingerr(347);
	print(581L);
	printmacroname(arglist, macroname);
	helpptr = 1;
	helpline[0] = 582;
	backerror();
      }
      getxnext();
      scanprimary();
      break;
      /*:734*/

    case 6:  /*735:*/
      if (curcmd != 31)
	ldelim = -30000;
      else {
	ldelim = cursym;
	rdelim = curmod;
	getxnext();
      }
      scansuffix();
      if (ldelim != -30000) {
	if (curcmd != 62 || curmod != ldelim) {
	  missingerr(hash[rdelim - 1].rh);
	  helpptr = 2;
	  helpline[1] = 580;
	  helpline[0] = 573;
	  backerror();
	}
	getxnext();
      }
      break;
      /*:735*/

    case 7:
      scantextarg(0, 0);
      break;
    }
    backinput();   /*728:*/
    p = getavail();
    if (curtype == 20)
      mem[p + 30000].hh.UU.lh = curexp;
    else
      mem[p + 30000].hh.UU.lh = stashcurexp();
    if (internal[8] > 0) {
      begindiagnostic();
      printarg(mem[p + 30000].hh.UU.lh, n, mem[r + 30000].hh.UU.lh);
      enddiagnostic(false);
    }
    if (arglist == -30000)
      arglist = p;
    else
      mem[tail + 30000].hh.rh = p;
    tail = p;
    n++;   /*:728*/
  }
  r = mem[r + 30000].hh.rh;   /*:725*/
  /*736:*/
  while (curinput.indexfield > 6 && curinput.locfield == -30000)
    endtokenlist();
  if (paramptr , expand, getxnext, stackargument, passtext,
changeiflimit, checkcolon, conditional, badfor, beginiteration+ n > maxparamstack) {
    maxparamstack = paramptr + n;
    if (maxparamstack > 150)
      overflow(552, 150L);
  }
  begintokenlist(defref, 12);
  curinput.namefield = macroname;
  curinput.locfield = r;
  if (n <= 0) {
    return;
  }  /*:736*/
  p = arglist;
  do {
    paramstack[paramptr] = mem[p + 30000].hh.UU.lh;
    paramptr++;
    p = mem[p + 30000].hh.rh;
  } while (p != -30000);
  flushlist(arglist);
}  /*:720*/


Static Void getboolean PV();

Static Void passtext PV();

Static Void conditional PV();

Static Void startinput PV();

Static Void beginiteration PV();

Static Void resumeiteration PV();

Static Void stopiteration PV();


/*:706*/
/*707:*/

Static Void expand()
{
  halfword p;
  long k;
  poolpointer j;

  if (internal[6] > 65536L) {
    if (curcmd != 10)
      showcmdmod((long)curcmd, curmod);
  }
  switch (curcmd) {

  case 1:
    conditional();
    break;

  case 2:   /*751:*/
    if (curmod > iflimit) {
      if (iflimit == 1) {
	missingerr(58);
	backinput();
	cursym = 2234;
	inserror();
      } else {
	printnl(133);
	print(589L);
	printcmdmod(2L, curmod);
	helpptr = 1;
	helpline[0] = 590;
	error();
      }
    } else {   /*:751*/
      while (curmod != 2)
	passtext();
      /*745:*/
      p = condptr;
      ifline = mem[p + 30001].int_;
      curif = mem[p + 30000].hh.UU.U2.b1;
      iflimit = mem[p + 30000].hh.UU.U2.b0;
      condptr = mem[p + 30000].hh.rh;
      freenode(p, 2);   /*:745*/
    }
    break;

  case 3:   /*711:*/
    if (curmod > 0)
      forceeof = true;
    else  /*:711*/
      startinput();
    break;

  case 4:
    if (curmod == 0) {  /*708:*/
      printnl(133);
      print(553L);
      helpptr = 2;
      helpline[1] = 554;
      helpline[0] = 555;
      error();
    } else  /*:708*/
      beginiteration();
    break;

  case 5:  /*712:*/
    while (curinput.indexfield > 6 && curinput.locfield == -30000)
      endtokenlist();
    if (loopptr == -30000) {
      printnl(133);
      print(557L);
      helpptr = 2;
      helpline[1] = 558;
      helpline[0] = 559;
      error();
    } else
      resumeiteration();
    break;
    /*:712*/

  case 6:  /*713:*/
    getboolean();
    if (internal[6] > 65536L)
      showcmdmod(33L, curexp);
    if (curexp == 30) {
      if (loopptr == -30000) {
	printnl(133);
	print(560L);
	helpptr = 1;
	helpline[0] = 561;
	if (curcmd == 80)
	  error();
	else
	  backerror();
      } else {  /*714:*/
	p = -30000;
	do {
	  if (curinput.indexfield <= 6)
	    endfilereading();
	  else {
	    if (curinput.indexfield <= 8)
	      p = curinput.startfield;
	    endtokenlist();
	  }
	} while (p == -30000);
	if (p != mem[loopptr + 30000].hh.UU.lh)
	  fatalerror(564);
	stopiteration();
      }  /*:714*/
    } else if (curcmd != 80) {
      missingerr(59);
      helpptr = 2;
      helpline[1] = 562;
      helpline[0] = 563;
      backerror();
    }
    break;
    /*:713*/

  case 7:
    /* blank case */
    break;

  case 9:  /*715:*/
    getnext();
    p = curtok();
    getnext();
    if (curcmd < 11)
      expand();
    else
      backinput();
    begintokenlist(p, 10);
    break;
    /*:715*/

  case 8:  /*716:*/
    getxnext();
    scanprimary();
    if (curtype != 4) {
      disperr(-30000, 565);
      helpptr = 2;
      helpline[1] = 566;
      helpline[0] = 567;
      putgetflusherror(0L);
    } else {
      backinput();
      if (strstart[curexp + 1] - strstart[curexp] > 0) {  /*717:*/
	beginfilereading();
	curinput.namefield = 2;
	k = first + strstart[curexp + 1] - strstart[curexp];
	if (k >= maxbufstack) {
	  if (k >= bufsize) {
	    maxbufstack = bufsize;
	    overflow(128, (long)bufsize);
	  }
	  maxbufstack = k + 1;
	}
	j = strstart[curexp];
	curinput.limitfield = k;
	while (first < curinput.limitfield) {
	  buffer[first] = strpool[j];
	  j++;
	  first++;
	}
	buffer[curinput.limitfield] = 37;
	first = curinput.limitfield + 1;
	curinput.locfield = curinput.startfield;
	flushcurexp(0L);
      }  /*:717*/
    }
    break;
    /*:716*/

  case 10:
    macrocall((int)curmod, -30000, cursym);
    break;
  }
}


/*:707*/
/*718:*/

Static Void getxnext()
{
  halfword saveexp;

  getnext();
  if (curcmd >= 11)
    return;
  saveexp = stashcurexp();
  do {
    if (curcmd == 10)
      macrocall((int)curmod, -30000, cursym);
    else
      expand();
    getnext();
  } while (curcmd < 11);
  unstashcurexp(saveexp);
}


/*:718*/
/*737:*/

Static Void stackargument(p)
halfword p;
{
  if (paramptr == maxparamstack) {
    maxparamstack++;
    if (maxparamstack > 150)
      overflow(552, 150L);
  }
  paramstack[paramptr] = p;
  paramptr++;
}


/*:737*/
/*742:*/

Static Void passtext()
{
  long l;

  scannerstatus = 1;
  l = 0;
  warninginfo = line;
  while (true) {
    getnext();
    if (curcmd <= 2) {
      if (curcmd < 2)
	l++;
      else {
	if (l == 0)
	  goto _L30;
	if (curmod == 2)
	  l--;
      }  /*743:*/
      continue;
    }
    if (curcmd == 39) {
      if (strref[curmod] < 127) {
	if (strref[curmod] > 1)
	  strref[curmod]--;
	else
	  flushstring((int)curmod);
      }
    }  /*:743*/
  }
_L30:
  scannerstatus = 0;
}


/*:742*/
/*746:*/

Static Void changeiflimit(l, p)
smallnumber l;
halfword p;
{
  halfword q;

  if (p == condptr)
    iflimit = l;
  else {
    q = condptr;
    while (true) {
      if (q == -30000)
	confusion(583);
      if (mem[q + 30000].hh.rh == p) {
	mem[q + 30000].hh.UU.U2.b0 = l;
	goto _L10;
      }
      q = mem[q + 30000].hh.rh;
    }
  }
_L10: ;

}


/*:746*/
/*747:*/

Static Void checkcolon()
{
  if (curcmd == 78)
    return;
  missingerr(58);
  helpptr = 2;
  helpline[1] = 586;
  helpline[0] = 563;
  backerror();
}


/*:747*/
/*748:*/

Static Void conditional()
{
  halfword savecondptr;
  char newiflimit;
  halfword p;   /*744:*/

  p = getnode(2L);
  mem[p + 30000].hh.rh = condptr;
  mem[p + 30000].hh.UU.U2.b0 = iflimit;
  mem[p + 30000].hh.UU.U2.b1 = curif;
  mem[p + 30001].int_ = ifline;
  condptr = p;
  iflimit = 1;
  ifline = line;
  curif = 1;   /*:744*/
  savecondptr = condptr;
_L21:
  getboolean();
  newiflimit = 4;
  if (internal[6] > 65536L)   /*:750*/
  {  /*750:*/
    begindiagnostic();
    if (curexp == 30)
      print(587L);
    else
      print(588L);
    enddiagnostic(false);
  }
_L40:
  checkcolon();
  if (curexp == 30) {
    changeiflimit(newiflimit, savecondptr);
    goto _L10;
  }  /*749:*/
  while (true) {   /*:749*/
    passtext();
    if (condptr == savecondptr) {
      goto _L30;
      continue;
    }
    if (curmod != 2) {  /*745:*/
      continue;
    }  /*:745*/
    p = condptr;
    ifline = mem[p + 30001].int_;
    curif = mem[p + 30000].hh.UU.U2.b1;
    iflimit = mem[p + 30000].hh.UU.U2.b0;
    condptr = mem[p + 30000].hh.rh;
    freenode(p, 2);
  }
_L30:
  curif = curmod;
  ifline = line;
  if (curmod != 2) {  /*745:*/
    if (curmod == 4)   /*:745*/
      goto _L21;
    else {
      curexp = 30;
      newiflimit = 2;
      getxnext();
      goto _L40;
    }
  }
  p = condptr;
  ifline = mem[p + 30001].int_;
  curif = mem[p + 30000].hh.UU.U2.b1;
  iflimit = mem[p + 30000].hh.UU.U2.b0;
  condptr = mem[p + 30000].hh.rh;
  freenode(p, 2);
_L10: ;

}


/*:748*/
/*754:*/

Static Void badfor(s)
strnumber s;
{
  disperr(-30000, 591);
  print((long)s);
  print(177L);
  helpptr = 4;
  helpline[3] = 592;
  helpline[2] = 593;
  helpline[1] = 594;
  helpline[0] = 179;
  putgetflusherror(0L);
}


/*:754*/
/*755:*/

Static Void beginiteration()
{
  halfword m, n, p, q, s, pp;

  m = curmod;
  n = cursym;
  s = getnode(2L);
  if (m == 1) {
    mem[s + 30001].hh.UU.lh = -29999;
    p = -30000;
    getxnext();
    goto _L40;
  }
  getsymbol();
  p = getnode(2L);
  mem[p + 30000].hh.UU.lh = cursym;
  mem[p + 30001].int_ = m;
  getxnext();
  if (curcmd != 51 && curcmd != 77) {
    missingerr(61);
    helpptr = 3;
    helpline[2] = 595;
    helpline[1] = 538;
    helpline[0] = 596;
    backerror();
  }
  /*764:*/
  mem[s + 30001].hh.UU.lh = -30000;
  q = s + 1;
  mem[q + 30000].hh.rh = -30000;
  do {
    getxnext();
    if (m != 2242)
      scansuffix();
    else {
      if (curcmd >= 78) {
	if (curcmd <= 79)
	  goto _L22;
      }
      scanexpression();
      if (curcmd == 74) {
	if (q == s + 1)   /*:765*/
	{  /*765:*/
	  if (curtype !,
resumeiteration, stopiteration, beginname, morename, endname, packfilename,
packbufferedname, makenamestring, amakenamestring, bmakenamestring,
wmakenamestring, scanfilename, packjobname, promptfilename, openlogfile= 16)
	    badfor(602);
	  pp = getnode(4L);
	  mem[pp + 30001].int_ = curexp;
	  getxnext();
	  scanexpression();
	  if (curtype != 16)
	    badfor(603);
	  mem[pp + 30002].int_ = curexp;
	  if (curcmd != 75) {
	    missingerr(357);
	    helpptr = 2;
	    helpline[1] = 604;
	    helpline[0] = 605;
	    backerror();
	  }
	  getxnext();
	  scanexpression();
	  if (curtype != 16)
	    badfor(606);
	  mem[pp + 30003].int_ = curexp;
	  mem[s + 30001].hh.UU.lh = pp;
	  goto _L30;
	}
      }
      curexp = stashcurexp();
    }
    mem[q + 30000].hh.rh = getavail();
    q = mem[q + 30000].hh.rh;
    mem[q + 30000].hh.UU.lh = curexp;
    curtype = 1;
_L22: ;

  } while (curcmd == 79);
_L30:   /*:764*/
_L40:   /*756:*/
  if (curcmd != 78) {   /*:756*/
    missingerr(58);
    helpptr = 3;
    helpline[2] = 597;
    helpline[1] = 598;
    helpline[0] = 599;
    backerror();
  }
  /*758:*/
  q = getavail();
  mem[q + 30000].hh.UU.lh = 2230;
  scannerstatus = 6;
  warninginfo = n;
  mem[s + 30000].hh.UU.lh = scantoks(4, p, q, 0);
  scannerstatus = 0;
  mem[s + 30000].hh.rh = loopptr;
  loopptr = s;   /*:758*/
  resumeiteration();
}


/*:755*/
/*760:*/

Static Void resumeiteration()
{
  halfword p, q;

  p = mem[loopptr + 30001].hh.UU.lh;
  if (p > -29999) {
    curexp = mem[p + 30001].int_;   /*761:*/
    if (mem[p + 30002].int_ > 0 && curexp > mem[p + 30003].int_ ||
	mem[p + 30002].int_ < 0 && curexp < mem[p + 30003].int_)
	  /*:761*/
	    goto _L45;
    curtype = 16;
    q = stashcurexp();
    mem[p + 30001].int_ = curexp + mem[p + 30002].int_;
  } else if (p < -29999) {
    p = mem[loopptr + 30001].hh.rh;
    if (p == -30000)
      goto _L45;
    mem[loopptr + 30001].hh.rh = mem[p + 30000].hh.rh;
    q = mem[p + 30000].hh.UU.lh;
    mem[p + 30000].hh.rh = avail;
    avail = p;   /*dynused:=dynused-1;*/
  } else {
    begintokenlist(mem[loopptr + 30000].hh.UU.lh, 7);
    goto _L10;
  }
  begintokenlist(mem[loopptr + 30000].hh.UU.lh, 8);
  stackargument(q);
  if (internal[6] > 65536L)   /*:762*/
  {  /*762:*/
    begindiagnostic();
    printnl(601);
    if (q != -30000 && mem[q + 30000].hh.rh == -29999)
      printexp(q, 1);
    else
      showtokenlist((long)q, -30000L, 50L, 0L);
    printchar(125);
    enddiagnostic(false);
  }
  goto _L10;
_L45:
  stopiteration();
_L10: ;

}


/*:760*/
/*763:*/

Static Void stopiteration()
{
  halfword p, q;

  p = mem[loopptr + 30001].hh.UU.lh;
  if (p > -29999)
    freenode(p, 4);
  else if (p < -29999) {
    q = mem[loopptr + 30001].hh.rh;
    while (q != -30000) {
      p = mem[q + 30000].hh.UU.lh;
      if (p != -30000) {
	if (mem[p + 30000].hh.rh == -29999) {
	  recyclevalue(p);
	  freenode(p, 2);
	} else
	  flushtokenlist(p);
      }
      p = q;
      q = mem[q + 30000].hh.rh;
      mem[p + 30000].hh.rh = avail;
      avail = p;   /*dynused:=dynused-1;*/
    }
  }
  p = loopptr;
  loopptr = mem[p + 30000].hh.rh;
  flushtokenlist(mem[p + 30000].hh.UU.lh);
  freenode(p, 2);
}


/*:763*/
/*770:*/

Static Void beginname()
{
  areadelimiter = 0;
  extdelimiter = 0;
}


/*:770*/
/*771:*/

Static boolean morename(c)
ASCIIcode c;
{
  if (c == 32 || c == 9)
    return false;
  else {
    if (c == 47) {
      areadelimiter = poolptr;
      extdelimiter = 0;
    } else if (c == 46 && extdelimiter == 0)
      extdelimiter = poolptr;
    if (poolptr + 1 > maxpoolptr) {
      if (poolptr + 1 > poolsize)
	overflow(129, (long)(poolsize - initpoolptr));
      maxpoolptr = poolptr + 1;
    }
    strpool[poolptr] = c;
    poolptr++;
    return true;
  }
}  /* morename */


/*:771*/
/*772:*/

Static Void endname()
{
  if (strptr + 3 > maxstrptr) {
    if (strptr + 3 > maxstrings)
      overflow(130, (long)(maxstrings - initstrptr));
    maxstrptr = strptr + 3;
  }
  if (areadelimiter == 0)
    curarea = 155;
  else {
    curarea = strptr;
    strptr++;
    strstart[strptr] = areadelimiter + 1;
  }
  if (extdelimiter == 0) {
    curext = 155;
    curname = makestring();
    return;
  }
  curname = strptr;
  strptr++;
  strstart[strptr] = extdelimiter;
  curext = makestring();
}


/*:772*/
/*774:*/

Static Void packfilename(n, a, e)
strnumber n, a, e;
{
  long k;
  ASCIIcode c;
  poolpointer j, FORLIM;

  k = 0;
  FORLIM = strstart[a + 1];
  for (j = strstart[a]; j < FORLIM; j++) {
    c = strpool[j];
    k++;
    if (k <= filenamesize)
      nameoffile[k - 1] = xchr[c];
  }
  FORLIM = strstart[n + 1];
  for (j = strstart[n]; j < FORLIM; j++) {
    c = strpool[j];
    k++;
    if (k <= filenamesize)
      nameoffile[k - 1] = xchr[c];
  }
  FORLIM = strstart[e + 1];
  for (j = strstart[e]; j < FORLIM; j++) {
    c = strpool[j];
    k++;
    if (k <= filenamesize)
      nameoffile[k - 1] = xchr[c];
  }
  if (k <= filenamesize)
    namelength = k;
  else
    namelength = filenamesize;
  for (k = namelength; k < filenamesize; k++)
    nameoffile[k] = ' ';
}  /*:774*/


/*778:*/

Static Void packbufferedname(n, a, b)
smallnumber n;
long a, b;
{
  long k;
  ASCIIcode c;
  long j;

  if (n + b - a + 6 > filenamesize)
    b = a + filenamesize - n - 6;
  k = 0;
  for (j = 0; j < n; j++) {
    c = xord[MFbasedefault[j]];
    k++;
    if (k <= filenamesize)
      nameoffile[k - 1] = xchr[c];
  }
  for (j = a; j <= b; j++) {
    c = buffer[j];
    k++;
    if (k <= filenamesize)
      nameoffile[k - 1] = xchr[c];
  }
  for (j = 5; j <= 9; j++) {
    c = xord[MFbasedefault[j]];
    k++;
    if (k <= filenamesize)
      nameoffile[k - 1] = xchr[c];
  }
  if (k <= filenamesize)
    namelength = k;
  else
    namelength = filenamesize;
  for (k = namelength; k < filenamesize; k++)
    nameoffile[k] = ' ';
}  /*:778*/


/*780:*/

Static strnumber makenamestring()
{
  short k, kstart, FORLIM;

  k = 1;
  while (k < filenamesize && xord[realnameoffile[k - 1]] != 32)
    k++;
  namelength = k - 1;
  if (poolptr + namelength > poolsize || strptr == maxstrings)
    return 63;
  else {
    if (xord[realnameoffile[0]] == 46 && xord[realnameoffile[1]] == 47)
      kstart = 3;
    else
      kstart = 1;
    FORLIM = namelength;
    for (k = kstart - 1; k < FORLIM; k++) {
      strpool[poolptr] = xord[realnameoffile[k]];
      poolptr++;
    }
    return (makestring());
  }
}


Static strnumber amakenamestring(f)
FILE **f;
{
  return (makenamestring());
}  /* amakenamestring */


Static strnumber bmakenamestring(f)
bytefile *f;
{
  bgetname(f, realnameoffile);
  return (makenamestring());
}  /* bmakenamestring */


Static strnumber wmakenamestring(f)
FILE **f;
{
  return (makenamestring());
}


/*:780*/
/*781:*/

Static Void scanfilename()
{
  beginname();
  while (buffer[curinput.locfield] == 32 || buffer[curinput.locfield] == 9)
    curinput.locfield++;
  while (true) {
    if (buffer[curinput.locfield] == 59 || buffer[curinput.locfield] == 37)
      goto _L30;
    if (!morename(buffer[curinput.locfield]))
      goto _L30;
    curinput.locfield++;
  }
_L30:
  endname();
}


/*:781*/
/*784:*/

Static Void packjobname(s)
strnumber s;
{
  curarea = 155;
  curext = s;
  curname = jobname;
  packfilename(curname, curarea, curext);
}


/*:784*/
/*786:*/

Static Void promptfilename(s, e)
strnumber s, e;
{
  short k;

  if (s == 607) {
    printnl(133);
    print(608L);
  } else {
    printnl(133);
    print(609L);
  }
  printfilename((long)curname, (long)curarea, (long)curext);
  print(610L);
  if (e == 611)
    showcontext();
  printnl(612);
  print((long)s);
  if (interaction < 2)
    fatalerror(613);
  print(614L);
  terminput();
  /*787:*/
  beginname();
  k = first;
  while ((buffer[k] == 32 || buffer[k] == 9) && k < last)
    k++;
  while (true) {
    if (k == last)
      goto _L30;
    if (!morename(buffer[k]))
      goto _L30;
    k++;
  }
_L30:
  endname();   /*:787*/
  if (curext == 155)
    curext = e;
  packfilename(curname, curarea, curext);
}  /* promptfilename */

<stdin>, line 12867: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 12875: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 12882: Note: Using % for possibly-negative arguments [317]


/*:786*/
/*788:*/

Static Void openlogfile()
{
  char oldsetting;
  short k;
  short l;
  long m;
  Char months[36];

  oldsetting = selector;
  if (jobname == 0)
    jobname = 6, startinput, badexp, stashin, backexpr, badsubscript, obliterated, binarymac,
materializepen, knownpair, newknot, scandirection15;
  packjobname(616);
  while (!aopenout(&logfile))   /*:789*/
  {  /*789:*/
    if (interaction < 2) {
      printnl(133);
      print(609L);
      printfilename((long)curname, (long)curarea, (long)curext);
      print(610L);
      jobname = 0;
      history = 3;
      jumpout();
    }
    promptfilename(618, 616);
  }
  logname = amakenamestring(&logfile);
  selector = 2;   /*790:*/
  write(logfile, "This is METAFONT, Version 1.0 for Berkeley UNIX");
/* p2c: <stdin>, line 12867: Warning: Symbol 'WRITE' is not defined [221] */
  print((long)baseident);
  print(619L);
  printint(roundunscaled(internal[15]));
  printchar(32);
  memcpy(months, "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC", 36L);
  m = roundunscaled(internal[14]);
  for (k = m * 3 - 3; k < m * 3; k++) {
    write(logfile, months[k]);
/* p2c: <stdin>, line 12875: Warning: Symbol 'WRITE' is not defined [221] */
  }
  printchar(32);
  printint(roundunscaled(internal[13]));
  printchar(32);
  m = roundunscaled(internal[16]);
  printdd(m / 60);
  printchar(58);
/* p2c: <stdin>, line 12882:
 * Note: Using % for possibly-negative arguments [317] */
  printdd(m % 60);   /*:790*/
  inputstack[inputptr] = curinput;
  printnl(617);
  l = inputstack[0].limitfield - 1;
  for (k = 1; k <= l; k++)
    print((long)buffer[k]);
  println();
  selector = oldsetting + 2;
}

<stdin>, line 12944: Warning: Symbol 'FLUSH' is not defined [221]


/*:788*/
/*793:*/

Static Void startinput()
{   /*795:*/
  while (curinput.indexfield > 6 && curinput.locfield == -30000)
    endtokenlist();
  if (curinput.indexfield > 6) {
    printnl(133);
    print(621L);
    helpptr = 3;
    helpline[2] = 622;
    helpline[1] = 623;
    helpline[0] = 624;
    error();
  }
  if (curinput.indexfield <= 6)
    scanfilename();
  else {   /*:795*/
    curname = 155;
    curext = 155;
    curarea = 155;
  }
  if (curext == 155)
    curext = 611;
  packfilename(curname, curarea, curext);
  while (true) {
    beginfilereading();
    if (aopenin(&inputfile[curinput.indexfield - 1], 6L))
      goto _L30;
    endfilereading();
    promptfilename(607, 611);
  }
_L30:
  curinput.namefield = amakenamestring(&inputfile[curinput.indexfield - 1]);
  strref[curname] = 127;
  if (jobname == 0) {
    jobname = curname;
    openlogfile();
  }
  if (termoffset + strstart[curinput.namefield + 1] -
      strstart[curinput.namefield] > maxprintline - 2)
    println();
  else if (termoffset > 0 || fileoffset > 0)
    printchar(32);
  printchar(40);
  print((long)curinput.namefield);
  flush(stdout);   /*794:*/
/* p2c: <stdin>, line 12944: Warning: Symbol 'FLUSH' is not defined [221] */
  inputln(&inputfile[curinput.indexfield - 1], false);
  firmuptheline();
  buffer[curinput.limitfield] = 37;
  first = curinput.limitfield + 1;
  curinput.locfield = curinput.startfield;
  line = 1;   /*:794*/
}


/*:793*/
/*824:*/

Static Void badexp(s)
strnumber s;
{
  char saveflag;

  printnl(133);
  print((long)s);
  print(634L);
  printcmdmod((long)curcmd, curmod);
  printchar(39);
  helpptr = 4;
  helpline[3] = 635;
  helpline[2] = 636;
  helpline[1] = 637;
  helpline[0] = 638;
  backinput();
  cursym = 0;
  curcmd = 42;
  curmod = 0;
  inserror();
  saveflag = varflag;
  varflag = 0;
  getxnext();
  varflag = saveflag;
}


/*:824*/
/*827:*/

Static Void stashin(p)
halfword p;
{
  halfword q;

  mem[p + 30000].hh.UU.U2.b0 = curtype;
  /*
  829:*/
  if (curtype == 16)
    mem[p + 30001].int_ = curexp;
  else {
    if (curtype == 19) {
      q = singledependency((int)curexp);
      if (q == depfinal) {
	mem[p + 30000].hh.UU.U2.b0 = 16;
	mem[p + 30001].int_ = 0;
	freenode(q, 2);
      } else {
	mem[p + 30000].hh.UU.U2.b0 = 17;
	newdep(p, q);
      }
      recyclevalue((int)curexp);
    } else {  /*:829*/
      mem[p + 30001] = mem[curexp + 30001];
      mem[mem[p + 30001].hh.UU.lh + 30000].hh.rh = p;
    }
    freenode((int)curexp, 2);
  }
  curtype = 1;
}  /* stashin */


/*:827*/
/*848:*/

Static Void backexpr()
{
  halfword p;

  p = stashcurexp();
  mem[p + 30000].hh.rh = -30000;
  begintokenlist(p, 10);
}


/*:848*/
/*849:*/

Static Void badsubscript()
{
  disperr(-30000, 650);
  helpptr = 3;
  helpline[2] = 651;
  helpline[1] = 652;
  helpline[0] = 653;
  flusherror(0L);
}


/*:849*/
/*851:*/

Static Void obliterated(q)
halfword q;
{
  printnl(133);
  print(654L);
  showtokenlist((long)q, -30000L, 1000L, 0L);
  print(655L);
  helpptr = 5;
  helpline[4] = 656;
  helpline[3] = 657;
  helpline[2] = 658;
  helpline[1] = 659;
  helpline[0] = 660;
}


/*:851*/
/*863:*/

Static Void binarymac(p, c, n)
halfword p, c, n;
{
  halfword q, r;

  q = getavail();
  r = getavail();
  mem[q + 30000].hh.rh = r;
  mem[q + 30000].hh.UU.lh = p;
  mem[r + 30000].hh.UU.lh = stashcurexp();
  macrocall(c, q, n);
}

<stdin>, line 13107: Warning: Symbol 'ABS' is not defined [221]


/*:863*/
/*865:*/

Static Void materializepen()
{
  scaled aminusb, aplusb, majoraxis, minoraxis;
  angle theta;
  halfword p, q;

  q = curexp;
  if (mem[q + 30000].hh.UU.U2.b0 == 0) {
    printnl(133);
    print(670L);
    helpptr = 2;
    helpline[1] = 671;
    helpline[0] = 442;
    putgeterror();
    curexp = -29997;
    goto _L50;
  }
  if (mem[q + 30000].hh.UU.U2.b0 == 4)   /*:866*/
  {  /*866:*/
    tx = mem[q + 30001].int_;
    ty = mem[q + 30002].int_;
    txx = mem[q + 30003].int_ - tx;
    tyx = mem[q + 30004].int_ - ty;
    txy = mem[q + 30005].int_ - tx;
    tyy = mem[q + 30006].int_ - ty;
    aminusb = pythadd(txx - tyy, tyx + txy);
    aplusb = pythadd(txx + tyy, tyx - txy);
    majoraxis = (aminusb + aplusb) / 2;
    minoraxis = abs(aplusb - aminusb) / 2;
/* p2c: <stdin>, line 13107: Warning: Symbol 'ABS' is not defined [221] */
    if (majoraxis == minoraxis)
      theta = 0;
    else
      theta = (narg(txx - tyy, tyx + txy) + narg(txx + tyy, tyx - txy)) / 2;
    freenode(q, 7);
    q = makeellipse(majoraxis, minoraxis, theta);
    if (tx != 0 || ty != 0) {  /*867:*/
      p = q;
      do {
	mem[p + 30001].int_ += tx;
	mem[p + 30002].int_ += ty;
	p = mem[p + 30000].hh.rh;
      } while (p != q);   /*:867*/
    }
  }
  curexp = makepen(q);
_L50:
  tossknotlist(q);
  curtype = 6;
}  /*:865*/


/*871:*/
/*872:*/

Static Void knownpair()
{
  halfword p;

  if (curtype != 14) {
    disperr(-30000, 673);
    helpptr = 5;
    helpline[4] = 674;
    helpline[3] = 675;
    helpline[2] = 676;
    helpline[1] = 677;
    helpline[0] = 678;
    putgetflusherror(0L);
    curx = 0;
    cury = 0;
    return;
  }
  p = mem[curexp + 30001].int_;   /*873:*/
  if (mem[p + 30000].hh.UU.U2.b0 == 16)
    curx = mem[p + 30001].int_;
  else {
    disperr(p, 679);
    helpptr = 5;
    helpline[4] = 680;
    helpline[3] = 675;
    helpline[2] = 676;
    helpline[1] = 677;
    helpline[0] = 678;
    putgeterror();
    recyclevalue(p);
    curx = 0;
  }
  if (mem[p + 30002].hh.UU.U2.b0 == 16)
    cury = mem[p + 30003].int_;
  else {   /*:873*/
    disperr(p + 2, 681);
    helpptr = 5;
    helpline[4] = 682;
    helpline[3] = 675;
    helpline[2] = 676;
    helpline[1] = 677;
    helpline[0] = 678;
    putgeterror();
    recyclevalue(p + 2);
    cury = 0;
  }
  flushcurexp(0L);
}  /*:872*/


Static halfword newknot()
{
  halfword q;

  q = getnode(7L);
  mem[q + 30000].hh.UU.U2.b0 = 0;
  mem[q + 30000].hh.UU.U2.b1 = 0;
  mem[q + 30000].hh.rh = q;
  knownpair();
  mem[q + 30001].int_ = curx;
  mem[q + 30002].int_ = cury;
  return q;
}


/*:871*/
/*875:*/

Static smallnumber scandirection()
{
  char t;
  scaled x;

  getxnext();
  if (curcmd == 60) {  /*876:*/
    getxnext();
    scanexpression();
    if (curtype != 16 || curexp < 0) {
      disperr(-30000, 685);
      helpptr = 1;
      helpline[0] = 686;
      putgetflusherror(65536L);
    }
    t = 3;
  } else {   /*:876*/
    scanexpression();
    if (curtype > 14) {  /*878:*/
      if (curtype != 16) {
	disperr(-30000, 679);
	helpptr = 5;
	helpline[4] = 680;
	helpline[3] = 675;
	helpline[2] = 676;
	helpline[1] = 677;
	helpline[0] = 678;
	putgetflusherror(0L);
      }
      x = curexp;
      if (curcmd != 79) {
	missingerr(44);
	helpptr = 2;
	helpline[1] = 687;
	helpline[0] = 688;
	backerror();
      }
      getxnext();
      scanexpression();
      if (curtype , donullary, nicepair, printknownorunknownt,
badunary, negatedeplist, pairtopath, takepart, strtonum, pathlength, testknown,
dounary!= 16) {
	disperr(-30000, 681);
	helpptr = 5;
	helpline[4] = 682;
	helpline[3] = 675;
	helpline[2] = 676;
	helpline[1] = 677;
	helpline[0] = 678;
	putgetflusherror(0L);
      }
      cury = curexp;
      curx = x;
    } else  /*:878*/
      knownpair();
    if (curx == 0 && cury == 0)
      t = 4;
    else {
      t = 2;
      curexp = narg(curx, cury);
    }
  }
  if (curcmd != 65) {
    missingerr(125);
    helpptr = 3;
    helpline[2] = 683;
    helpline[1] = 684;
    helpline[0] = 563;
    backerror();
  }
  getxnext();
  return t;

  /*877:*/
  /*:877*/
}


/*:875*/
/*895:*/

Static Void donullary(c)
quarterword c;
{
  long k, FORLIM;

  if (aritherror)
    cleararith();
  if (internal[6] > 131072L)
    showcmdmod(33L, (long)c);
  switch (c) {   /*:897*/

  case 30:
  case 31:
    curtype = 2;
    curexp = c;
    break;

  case 32:
    curtype = 11;
    curexp = getnode(6L);
    initedges((int)curexp);
    break;

  case 33:
    curtype = 6;
    curexp = -29997;
    break;

  case 37:
    curtype = 16;
    curexp = normrand();
    break;

  case 36:  /*896:*/
    curtype = 8;
    curexp = getnode(7L);
    mem[curexp + 30000].hh.UU.U2.b0 = 4;
    mem[curexp + 30000].hh.UU.U2.b1 = 4;
    mem[curexp + 30000].hh.rh = curexp;
    mem[curexp + 30001].int_ = 0;
    mem[curexp + 30002].int_ = 0;
    mem[curexp + 30003].int_ = 65536L;
    mem[curexp + 30004].int_ = 0;
    mem[curexp + 30005].int_ = 0;
    mem[curexp + 30006].int_ = 65536L;
    break;
    /*:896*/

  case 34:
    if (jobname == 0)
      openlogfile();
    curtype = 4;
    curexp = jobname;
    break;

  case 35:  /*897:*/
    if (interaction <= 1)
      fatalerror(699);
    beginfilereading();
    curinput.namefield = 1;
    print(155L);
    terminput();
    if (poolptr + last - curinput.startfield > maxpoolptr) {
      if (poolptr + last - curinput.startfield > poolsize)
	overflow(129, (long)(poolsize - initpoolptr));
      maxpoolptr = poolptr + last - curinput.startfield;
    }
    FORLIM = last;
    for (k = curinput.startfield; k < FORLIM; k++) {
      strpool[poolptr] = buffer[k];
      poolptr++;
    }
    endfilereading();
    curtype = 4;
    curexp = makestring();
    break;
  }
  if (aritherror)
    cleararith();
}


/*:895*/
/*898:*/
/*899:*/

Static boolean nicepair(p, t)
long p;
quarterword t;
{
  boolean Result;

  if (t == 14) {
    p = mem[p + 30001].int_;
    if (mem[p + 30000].hh.UU.U2.b0 == 16) {
      if (mem[p + 30002].hh.UU.U2.b0 == 16) {
	Result = true;
	goto _L10;
      }
    }
  }
  Result = false;
_L10:

  return Result;
}


/*:899*/
/*900:*/

Static Void printknownorunknownt(t, v)
smallnumber t;
long v;
{
  printchar(40);
  if (t < 17) {
    if (t != 14)
      printtype(t);
    else if (nicepair(v, 14))
      print(207L);
    else
      print(700L);
  } else
    print(701L);
  printchar(41);
}


/*:900*/
/*901:*/

Static Void badunary(c)
quarterword c;
{
  disperr(-30000, 702);
  printop(c);
  printknownorunknownt(curtype, curexp);
  helpptr = 3;
  helpline[2] = 703;
  helpline[1] = 704;
  helpline[0] = 705;
  putgeterror();
}


/*:901*/
/*904:*/

Static Void negatedeplist(p)
halfword p;
{
  while (true) {
    mem[p + 30001].int_ = -mem[p + 30001].int_;
    if (mem[p + 30000].hh.UU.lh == -30000)
      goto _L10;
    p = mem[p + 30000].hh.rh;
  }
_L10: ;

}  /*:904*/


/*908:*/

Static Void pairtopath()
{
  curexp = newknot();
  curtype = 9;
}  /*:908*/


/*910:*/

Static Void takepart(c)
quarterword c;
{
  halfword p;

  p = mem[curexp + 30001].int_;
  mem[18].int_ = p;
  mem[17].hh.UU.U2.b0 = curtype;
  mem[p + 30000].hh.rh = -29983;
  freenode((int)curexp, 2);
  makeexpcopy(p + (c - 53) * 2);
  recyclevalue(-29983);
}


/*:910*/
/*913:*/

Static Void strtonum(c)
quarterword c;
{
  long n;
  ASCIIcode m;
  poolpointer k;
  char b;
  boolean badchar;
  poolpointer FORLIM;

  if (c == 49) {
    if (strstart[curexp + 1] - strstart[curexp] == 0)
      n = -1;
    else
      n = strpool[strstart[curexp]];
  } else {
    if (c == 47)
      b = 8;
    else
      b = 16;
    n = 0;
    badchar = false;
    FORLIM = strstart[curexp + 1];
    for (k = strstart[curexp]; k < FORLIM; k++) {
      m = strpool[k];
      if (m >= 48 && m <= 57)
	m -= 48;
      else if (m >= 65 && m <= 70)
	m -= 55;
      else if (m >= 97 && m <= 102)
	m -= 87;
      else {
	badchar = true;
	m = 0;
      }
      if (m >= b) {
	badchar = true;
	m = 0;
      }
      if (n < 32768L / b)
	n = n * b + m;
      else
	n = 32767;
    }  /*914:*/
    if (badchar) {
      disperr(-30000, 707);
      if (c == 47) {
	helpptr = 1;
	helpline[0] = 708;
      } else {
	helpptr = 1;
	helpline[0] = 709;
      }
      putgeterror();
    }
    if (n > 4095) {
      printnl(133);
      print(710L);
      printint(n);
      printchar(41);
      helpptr = 1;
      helpline[0] = 711;
      putgeterror();
    }  /*:914*/
  }
  flushcurexp(n * 65536L);
}  /* strtonum */


/*:913*/
/*916:*/

Static long pathlength()
{
  scaled n;
  halfword p;

  p = curexp;
  if (mem[p + 30000].hh.UU.U2.b0 == 0)
    n = -65536L;
  else
    n = 0;
  do {
    p = mem[p + 30000].hh.rh;
    n += 65536L;
  } while (p != curexp);
  return n;
}  /* pathlength */


/*:916*/
/*919:*/

Static Void testknown(c)
quarterword c;
{
  char b;
  halfword p, q;

  b = 31;
  if ((unsigned)curtype < 32 && ((1L << curtype) & 0x16b56L) != 0) {
    switch (curtype) {

    case 1:
    case 2:
    case 4:
    case 6:
    case 8:
    case 9:
    case 11:
    case 16:
      b = 30;
      break;

    case 13:
    case 14:
      p = mem[curexp + 30001].int_;
      q = p + bignodesize[curtype - 13];
      do {
	q -= 2;
	if (mem[q + 30000].hh.UU.U2.b0 != 16)
	  goto _L30;
      } while (q != p);
      b = 30;
_L30: ;

      break;
    }
  }
  if (c == 39)
    flushcurexp((long)b);
  else
    flushcurexp(61L - b);
  curtype = 2;
}  /*:919*/

<stdin>, line 13654: Note: Using % for possibly-negative arguments [317]
<stdin>, line 13666: Warning: Symbol 'ODD' is not defined [221]
<stdin>, line 13752: Warning: Symbol 'ABS' is not defined [221]


Static Void dounary(c)
quarterword c;
{
  halfword p, q;
  long x;

  if (aritherror)
    cleararith();
  if (internal[6] > 131072L)   /*:902*/
  {  /*902:*/
    begindiagnostic();
    printnl(123);
    printop(c);
    printchar(40);
    printexp(-30000, 0);
    print(706L);
    enddiagnostic(false);
  }
  switch (c) {   /*:921*/

  case 69:
    if (curtype < 14) {
      if (curtype != 11)
	badunary(69);
    }
    break;

  case 70:   /*903:*/
    if ((unsigned)curtype < 32 && ((1L << curtype) & 0xf4800L) != 0) {
      switch (curtype) {

      case 14:
      case 19:
	q = curexp;
	makeexpcopy(q);
	if (curtype == 17)
	  negatedeplist(mem[curexp + 30001].hh.rh);
	else if (curtype == 14) {
	  p = mem[curexp + 30001].int_;
	  if (mem[p + 30000].hh.UU.U2.b0 == 16)
	    mem[p + 30001].int_ = -mem[p + 30001].int_;
	  else
	    negatedeplist(mem[p + 30001].hh.rh);
	  if (mem[p + 30002].hh.UU.U2.b0 == 16)
	    mem[p + 30003].int_ = -mem[p + 30003].int_;
	  else
	    negatedeplist(mem[p + 30003].hh.rh);
	}
	recyclevalue(q);
	freenode(q, 2);
	break;

      case 17:
      case 18:
	negatedeplist(mem[curexp + 30001].hh.rh);
	break;

      case 16:
	curexp = -curexp;
	break;

      case 11:
	negateedges((int)curexp);
	break;
      }
    } else   /*:903*/
      badunary(70);
    break;
    /*905:*/

  case 41:   /*:905*/
    if (curtype != 2)
      badunary(41);
    else
      curexp = 61 - curexp;
    break;
    /*906:*/

  case 59:
  case 60:
  case 61:
  case 62:
  case 63:
  case 64:
  case 65:
  case 38:
  case 66:   /*:906*/
    if (curtype != 16)
      badunary(c);
    else {
      switch (c) {   /*:1181*/

      case 59:
	curexp = squarert(curexp);
	break;

      case 60:
	curexp = mexp(curexp);
	break;

      case 61:
	curexp = mlog(curexp);
	break;

      case 62:
      case 63:
/* p2c: <stdin>, line 13654:
 * Note: Using % for possibly-negative arguments [317] */
	nsincos(curexp % 23592960L * 16);
	if (c == 62)
	  curexp = roundfraction(nsin);
	else
	  curexp = roundfraction(ncos);
	break;

      case 64:
	curexp = floorscaled(curexp);
	break;

      case 65:
	curexp = unifrand(curexp);
	break;

      case 38:
	if (odd(, badbinary, tarnished, depfinish, addorsubtract, depmultroundunscaled(curexp))) {
/* p2c: <stdin>, line 13666: Warning: Symbol 'ODD' is not defined [221] */
	  curexp = 30;
	} else
	  curexp = 31;
	curtype = 2;
	break;

      case 66:  /*1181:*/
	curexp = roundunscaled(curexp) & 255;
	if (curexp < 0)
	  curexp += 256;
	if (charexists[curexp])
	  curexp = 30;
	else
	  curexp = 31;
	curtype = 2;
	break;
      }
    }
    break;
    /*907:*/

  case 67:   /*:907*/
    if (nicepair(curexp, curtype)) {
      p = mem[curexp + 30001].int_;
      x = narg(mem[p + 30001].int_, mem[p + 30003].int_);
      if (x >= 0)
	flushcurexp((x + 8) / 16);
      else
	flushcurexp(-((8 - x) / 16));
    } else
      badunary(67);
    break;
    /*909:*/

  case 53:
  case 54:
    if (curtype <= 14 && curtype >= 13)
      takepart(c);
    else
      badunary(c);
    break;

  case 55:
  case 56:
  case 57:
  case 58:   /*:909*/
    if (curtype == 13)
      takepart(c);
    else
      badunary(c);
    break;
    /*912:*/

  case 50:
    if (curtype != 16)
      badunary(50);
    else {
      curexp = roundunscaled(curexp) & 127;
      curtype = 4;
      if (curexp < 0)
	curexp += 128;
      if (strstart[curexp + 1] - strstart[curexp] != 1) {
	if (poolptr + 1 > maxpoolptr) {
	  if (poolptr + 1 > poolsize)
	    overflow(129, (long)(poolsize - initpoolptr));
	  maxpoolptr = poolptr + 1;
	}
	strpool[poolptr] = curexp;
	poolptr++;
	curexp = makestring();
      }
    }
    break;

  case 42:
    if (curtype != 16)
      badunary(42);
    else {
      oldsetting = selector;
      selector = 5;
      printscaled(curexp);
      curexp = makestring();
      selector = oldsetting;
      curtype = 4;
    }
    break;

  case 47:
  case 48:
  case 49:
    if (curtype != 4)
      badunary(c);
    else
      strtonum(c);
    break;

  /*:912*/
  /*915:*/
  case 51:   /*:915*/
    if (curtype == 4)
      flushcurexp((strstart[curexp + 1] - strstart[curexp]) * 65536L);
    else if (curtype == 9)
      flushcurexp(pathlength());
    else if (curtype == 16) {
      curexp = abs(curexp);
/* p2c: <stdin>, line 13752: Warning: Symbol 'ABS' is not defined [221] */
    } else if (nicepair(curexp, curtype))
      flushcurexp(pythadd(mem[mem[curexp + 30001].int_ + 30001].int_,
			  mem[mem[curexp + 30001].int_ + 30003].int_));
    else
      badunary(c);
    break;
    /*917:*/

  case 52:   /*:917*/
    if (curtype == 14)
      flushcurexp(0L);
    else if (curtype != 9)
      badunary(52);
    else if (mem[curexp + 30000].hh.UU.U2.b0 == 0)
      flushcurexp(0L);
    else {
      curpen = -29997;
      curpathtype = 1;
      curexp = makespec((int)curexp, -1879080960L, 0L);
      flushcurexp(turningnumber * 65536L);
    }
    break;
    /*918:*/

  case 2:
    if (curtype >= 2 && curtype <= 3)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 4:
    if (curtype >= 4 && curtype <= 5)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 6:
    if (curtype >= 6 && curtype <= 8)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 9:
    if (curtype >= 9 && curtype <= 10)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 11:
    if (curtype >= 11 && curtype <= 12)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 13:
  case 14:
    if (curtype == c)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 15:
    if (curtype >= 16 && curtype <= 19)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;

  case 39:
  case 40:   /*:918*/
    testknown(c);
    break;
    /*920:*/

  case 68:   /*:920*/
    if (curtype != 9)
      flushcurexp(31L);
    else if (mem[curexp + 30000].hh.UU.U2.b0 != 0)
      flushcurexp(30L);
    else
      flushcurexp(31L);
    curtype = 2;
    break;
    /*921:*/

  case 45:
    if (curtype == 14)
      pairtopath();
    if (curtype == 9)
      curtype = 8;
    else
      badunary(45);
    break;

  case 44:
    if (curtype == 8)
      materializepen();
    if (curtype != 6)
      badunary(44);
    else {
      flushcurexp((long)makepath((int)curexp));
      curtype = 9;
    }
    break;

  case 46:
    if (curtype != 11)
      badunary(46);
    else
      flushcurexp(totalweight((int)curexp));
    break;

  case 43:
    if (curtype == 9) {
      p = htapypoc((int)curexp);
      if (mem[p + 30000].hh.UU.U2.b1 == 0)
	p = mem[p + 30000].hh.rh;
      tossknotlist((int)curexp);
      curexp = p;
    } else if (curtype == 14)
      pairtopath();
    else
      badunary(43);
    break;
  }
  if (aritherror)
    cleararith();
}


/*:898*/
/*922:*/
/*923:*/

Static Void badbinary(p, c)
halfword p;
quarterword c;
{
  disperr(p, 155);
  disperr(-30000, 702);
  if (c >= 94)
    printop(c);
  printknownorunknownt(mem[p + 30000].hh.UU.U2.b0, (long)p);
  if (c >= 94)
    print(347L);
  else
    printop(c);
  printknownorunknownt(curtype, curexp);
  helpptr = 3;
  helpline[2] = 703;
  helpline[1] = 712;
  helpline[0] = 713;
  putgeterror();
}


/*:923*/
/*928:*/

Static halfword tarnished(p)
halfword p;
{
  halfword Result, q, r;

  q = mem[p + 30001].int_;
  r = q + bignodesize[mem[p + 30000].hh.UU.U2.b0 - 13];
  do {
    r -= 2;
    if (mem[r + 30000].hh.UU.U2.b0 == 19) {
      Result = -29999;
      goto _L10;
    }
  } while (r != q);
  Result = -30000;
_L10:

  return Result;
}


/*:928*/
/*930:*/
/*935:*/

Static Void depfinish(v, q, t)
halfword v, q;
smallnumber t;
{
  halfword p;
  scaled vv;

  if (q == -30000)
    p = curexp;
  else
    p = q;
  mem[p + 30001].hh.rh = v;
  mem[p + 30000].hh.UU.U2.b0 = t;
  if (mem[v + 30000].hh.UU.lh == -30000) {
    vv = mem[v + 30001].int_;
    if (q == -30000)
      flushcurexp(vv);
    else {
      recyclevalue(p);
      mem[q + 30000].hh.UU.U2.b0 = 16;
      mem[q + 30001].int_ = vv;
    }
  } else if (q == -30000)
    curtype = t;
  if (fixneeded)
    fixdependencies();
}  /*:935*/


Static Void addorsubtract(p, q, c)
halfword p, q;
quarterword c;
{
  smallnumber s, t;
  halfword r;
  long v;

  if (q == -30000) {
    t = curtype;
    if (t < 17)
      v = curexp;
    else
      v = mem[curexp + 30001].hh.rh;
  } else {
    t = mem[q + 30000].hh.UU.U2.b0;
    if (t < 17)
      v = mem[q + 30001].int_;
    else
      v = mem[q + 30001].hh.rh;
  }
  if (t == 16) {
    if (c == 70)
      v = -v;
    if (mem[p + 30000].hh.UU.U2.b0 == 16) {
      v = slowadd(mem[p + 30001].int_, v);
      if (q == -30000)
	curexp = v;
      else
	mem[q + 30001].int_ = v;
      goto _L10;
    }  /*931:*/
    r = mem[p + 30001].hh.rh;
    while (mem[r + 30000].hh.UU.lh != -30000)
      r = mem[r + 30000].hh.rh;
    mem[r + 30001].int_ = slowadd(mem[r + 30001].int_, v);
    if (q == -30000) {
      q = getnode(2L);
      curexp = q;
      curtype = mem[p + 30000].hh.UU.U2.b0;
      mem[q + 30000].hh.UU.U2.b1 = 11;
    }
    mem[q + 30001].hh.rh = mem[p + 30001].hh.rh;
    mem[q + 30000].hh.UU.U2.b0 = mem[p + 30000].hh.UU.U2.b0;
    mem[q + 30001].hh.UU.lh = mem[p + 30001].hh.UU.lh;
    mem[mem[p + 30001].hh.UU.lh + 30000].hh.rh = q;
    mem[p + 30000].hh.UU.U2.b0 = 16;
  } else {  /*:931*/
    if (c == 70)   /*932:*/
      negatedeplist((int)v);
    if (mem[p + 30000].hh.UU.U2.b0 == 16) {  /*933:*/
      while (mem[v + 30000].hh.UU.lh != -30000)
	v = mem[v + 30000].hh.rh;
      mem[v + 30001].int_ = slowadd(mem[p + 30001].int_, mem[v + 30001].int_);
    } else {  /*:933*/
      s = mem[p + 30000].hh.UU.U2.b0;
      r = mem[p + 30001].hh.rh;
      if (t == 17) {
	if (s == 17) {
	  if (maxcoef(r) + maxcoef((int)v) < 626349397L) {
	    v = pplusq((int)v, r, 17);
	    goto _L30;
	  }
	}
	t = 18;
	v = poverv((int)v, 65536L, 17, 18);
      }
      if (s == 18)
	v = pplusq((int)v, r, 18);
      else
	v = pplusfq((int)v, 65536L, r, 18, 17);
_L30:   /*934:*/
      if (q != -30000)
	depfinish((int)v, q, t);
      else {
	curtype = t;
	depfinish((int)v, -30000, t);
      }  /*:934*/
    }  /*:932*/
  }
_L10: ;

}

<stdin>, line 14054: Warning: Symbol 'ABS' is not defined [221]


/*:930*/
/*943:*/

Static Void depmult(p, v, visscaled)
halfword p;
lon, hardtimes, depdiv, setuptrans, setupknowntrans, trans, pathtrans, edgestransg v;
boolean visscaled;
{
  halfword q;
  smallnumber s, t;

  if (p == -30000)
    q = curexp;
  else if (mem[p + 30000].hh.UU.U2.b0 != 16)
    q = p;
  else {
    if (visscaled)
      mem[p + 30001].int_ = takescaled(mem[p + 30001].int_, v);
    else
      mem[p + 30001].int_ = takefraction(mem[p + 30001].int_, v);
    goto _L10;
  }
  t = mem[q + 30000].hh.UU.U2.b0;
  q = mem[q + 30001].hh.rh;
  s = t;
  if (t == 17) {
    if (visscaled) {
      if (abvscd(maxcoef(q), abs(v), 626349396L, 65536L) >= 0) {
/* p2c: <stdin>, line 14054: Warning: Symbol 'ABS' is not defined [221] */
	t = 18;
      }
    }
  }
  q = ptimesv(q, v, s, t, visscaled);
  depfinish(q, p, t);
_L10: ;

}


/*:943*/
/*946:*/

Static Void hardtimes(p)
halfword p;
{
  halfword q, r;
  scaled u, v;

  if (mem[p + 30000].hh.UU.U2.b0 == 14) {
    q = stashcurexp();
    unstashcurexp(p);
    p = q;
  }
  r = mem[curexp + 30001].int_;
  u = mem[r + 30001].int_;
  v = mem[r + 30003].int_;   /*947:*/
  mem[r + 30002].hh.UU.U2.b0 = mem[p + 30000].hh.UU.U2.b0;
  newdep(r + 2, copydeplist(mem[p + 30001].hh.rh));
  mem[r + 30000].hh.UU.U2.b0 = mem[p + 30000].hh.UU.U2.b0;
  mem[r + 30001] = mem[p + 30001];
  mem[mem[p + 30001].hh.UU.lh + 30000].hh.rh = r;   /*:947*/
  freenode(p, 2);
  depmult(r, u, true);
  depmult(r + 2, v, true);
}

<stdin>, line 14105: Warning: Symbol 'ABS' is not defined [221]


/*:946*/
/*949:*/

Static Void depdiv(p, v)
halfword p;
long v;
{
  halfword q;
  smallnumber s, t;

  if (p == -30000)
    q = curexp;
  else if (mem[p + 30000].hh.UU.U2.b0 != 16)
    q = p;
  else {
    mem[p + 30001].int_ = makescaled(mem[p + 30001].int_, v);
    goto _L10;
  }
  t = mem[q + 30000].hh.UU.U2.b0;
  q = mem[q + 30001].hh.rh;
  s = t;
  if (t == 17) {
    if (abvscd(maxcoef(q), 65536L, 626349396L, abs(v)) >= 0) {
/* p2c: <stdin>, line 14105: Warning: Symbol 'ABS' is not defined [221] */
      t = 18;
    }
  }
  q = poverv(q, v, s, t);
  depfinish(q, p, t);
_L10: ;

}

<stdin>, line 14127: Note: Using % for possibly-negative arguments [317]


/*:949*/
/*953:*/

Static Void setuptrans(c)
quarterword c;
{
  halfword p, q, r;

  if (c != 88 || curtype != 13)   /*:955*/
  {  /*955:*/
    p = stashcurexp();
    curexp = idtransform();
    curtype = 13;
    q = mem[curexp + 30001].int_;
    switch (c) {   /*957:*/

    case 84:
      if (mem[p + 30000].hh.UU.U2.b0 == 16)   /*:958*/
      {  /*958:*/
/* p2c: <stdin>, line 14127:
 * Note: Using % for possibly-negative arguments [317] */
	nsincos(mem[p + 30001].int_ % 23592960L * 16);
	mem[q + 30005].int_ = roundfraction(ncos);
	mem[q + 30009].int_ = roundfraction(nsin);
	mem[q + 30007].int_ = -mem[q + 30009].int_;
	mem[q + 30011].int_ = mem[q + 30005].int_;
	goto _L30;
      }
      break;

    case 85:
      if (mem[p + 30000].hh.UU.U2.b0 > 14) {
	install(q + 6, p);
	goto _L30;
      }
      break;

    case 86:
      if (mem[p + 30000].hh.UU.U2.b0 > 14) {
	install(q + 4, p);
	install(q + 10, p);
	goto _L30;
      }
      break;

    case 87:
      if (mem[p + 30000].hh.UU.U2.b0 == 14) {
	r = mem[p + 30001].int_;
	install(q, r);
	install(q + 2, r + 2);
	goto _L30;
      }
      break;

    case 89:
      if (mem[p + 30000].hh.UU.U2.b0 > 14) {
	install(q + 4, p);
	goto _L30;
      }
      break;

    case 90:
      if (mem[p + 30000].hh.UU.U2.b0 > 14) {
	install(q + 10, p);
	goto _L30;
      }
      break;

    case 91:
      if (mem[p + 30000].hh.UU.U2.b0 == 14)   /*:959*/
      {  /*959:*/
	r = mem[p + 30001].int_;
	install(q + 4, r);
	install(q + 10, r);
	install(q + 8, r + 2);
	if (mem[r + 30002].hh.UU.U2.b0 == 16)
	  mem[r + 30003].int_ = -mem[r + 30003].int_;
	else
	  negatedeplist(mem[r + 30003].hh.rh);
	install(q + 6, r + 2);
	goto _L30;
      }
      break;

    case 88:
      break;

    }
    /*:957*/
    disperr(p, 722);
    helpptr = 3;
    helpline[2] = 723;
    helpline[1] = 724;
    helpline[0] = 405;
    putgeterror();
_L30:
    recyclevalue(p);
    freenode(p, 2);
  }
  /*956:*/
  q = mem[curexp + 30001].int_;
  r = q + 12;
  do {
    r -= 2;
    if (mem[r + 30000].hh.UU.U2.b0 != 16)
      goto _L10;
  } while (r != q);
  txx = mem[q + 30005].int_;
  txy = mem[q + 30007].int_;
  tyx = mem[q + 30009].int_;
  tyy = mem[q + 30011].int_;
  tx = mem[q + 30001].int_;
  ty = mem[q + 30003].int_;   /*:956*/
  flushcurexp(0L);
_L10: ;

}


/*:953*/
/*960:*/

Static Void setupknowntrans(c)
quarterword c;
{
  setuptrans(c);
  if (curtype == 16)
    return;
  disperr(-30000, 725);
  helpptr = 3;
  helpline[2] = 726;
  helpline[1] = 727;
  helpline[0] = 405;
  putgetflusherror(0L);
  txx = 65536L;
  txy = 0;
  tyx = 0;
  tyy = 65536L;
  tx = 0;
  ty = 0;
}


/*:960*/
/*961:*/

Static Void trans(p, q)
halfword p, q;
{
  scaled v;

  v = takescaled(mem[p + 30000].int_, txx) + takescaled(mem[q + 30000].int_,
							txy) + tx;
  mem[q + 30000].int_ = takescaled(mem[p + 30000].int_, tyx) +
			takescaled(mem[q + 30000].int_, tyy) + ty;
  mem[p + 30000].int_ = v;
}


/*:961*/
/*962:*/

Static Void pathtrans(p, c)
halfword p;
quarterword c;
{
  halfword q;

  setupknowntrans(c);
  unstashcurexp(p);
  if (curtype == 6) {
    if (mem[curexp + 30009].int_ == 0) {
      if (tx == 0) {
	if (ty == 0)
	  goto _L10;
      }
    }
    flushcurexp((long)makepath((int)curexp));
    curtype = 8;
  }
  q = curexp;
  do {
    if (mem[q + 30000].hh.UU.U2.b0 != 0)
      trans(q + 3, q + 4);
    trans(q + 1, q + 2);
    if (mem[q + 30000].hh.UU.U2.b1 != 0)
      trans(q + 5, q + 6);
    q = mem[q + 30000].hh.rh;
  } while (q != curexp);
_L10: ;

}

<stdin>, line 14278: Note: Using % for possibly-negative arguments [317]
<stdin>, line 14279: Note: Using % for possibly-negative arguments [317]
<stdin>, line 14290: Note: Using % for possibly-negative arguments [317]
<stdin>, line 14291: Note: Using % for possibly-negative arguments [317]
<stdin>, line 14311: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 14311: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 14327: Warning: Symbol 'ABS' is not defined [221]


/*:962*/
/*963:*/

Static Void edgestrans(p, c)
halfword p;
quarterword c;
{
  setupknowntrans(c);
  unstashcurexp(p);
  curedges = curexp;
  if (mem[curedges + 30000].hh.rh == curedges)
    goto _L10;
  if (txx == 0) {
    if (tyy == 0) {
      if (txy % 65536L == 0) {
/* p2c: <stdin>, line 14278:
 * Note: Using % for possibly-negative arguments [317] */
	if (tyx % 65536L == 0) {
/* p2c: <stdin>, line 14279:
 * Note: Using % for possibly-negative arguments [317] */
	  xyswapedges();
	  txx = txy;
	  tyy = tyx;
	  txy = 0;
	  tyx = 0;
	  if (mem[curedges + 30000].hh.rh == curedges)
	    goto _L10;
	}
      }
    }
  }
  if (txy == 0) {
    if (tyx == 0) {
      if (txy % 65536L == 0) {
/* p2c: <stdin>, line 14290:
 * Note: Using % for possibly-negative arguments [317] */
	if (tyy % 65536L == 0)   /*:964*/
	{  /*964:*/
	  if (txx == 0 || tyy == 0) {
	    tossedges(curedges);
	    curexp = getnode(6L);
	    initedges((int)curexp);
	  } else {
	    if (txx < 0) {
	      xreflectedges();
	      txx = -txx;
	    }
	    if (tyy < 0) {
	      yreflectedges();
	      tyy = -tyy;
	    }
	    if (txx != 65536L)
	      xscaleedges(txx / 65536L);
	    if (tyy != 65536L)   /*965:*/
	      yscaleedges(tyy / 65536L);
	    tx = roundunscaled(tx);
	    ty = roundunscaled(ty);
	    if (mem[curedges + 30002].hh.UU.lh + tx <= 0 ||
		mem[curedges + 30002].hh.rh + tx >= 8192 ||
		mem[curedges + 30001].hh.UU.lh + ty <= 0 ||
		mem[curedges + 30001].hh.rh + ty >= 8191 || abs(tx) >= 4096 ||
		abs(ty) >= 4096) {
	      printnl(133);
	      print(731L);
	      helpptr = 3;
	      helpline[2] = 732;
	      helpline[1] = 404;
	      helpline[0] = 405;
	      putgeterror();
	    } else {
	      if (tx != 0) {
		if (abs(mem[curedges + 30003].hh.UU.lh - tx - 4096) >= 4096) {
/* p2c: <stdin>, line 14327: Warning: Symbol 'ABS' is not defined [221] */
		  fixoffset();
		}
		mem[curedges + 30002].hh.UU.lh += tx;
		mem[curedges + 30002].hh.rh += tx;
		mem[curedges + 30003].hh.UU.lh -= tx;
		mem[curedges + 30004].int_ = 0;
	      }
	      if (ty != 0) {
		mem[curedges + 30001].hh.UU.lh += ty;
		mem[curedges + 30001].hh.rh += ty;
		mem[curedges + 30005].hh.UU.lh +, bilin1, addmultdep, bilin2, bilin3, bigtrans, cat, chopstring, choppath= ty;
		mem[curedges + 30004].int_ = 0;
	      }
	    }  /*:965*/
	  }
	  goto _L10;
	}
/* p2c: <stdin>, line 14291:
 * Note: Using % for possibly-negative arguments [317] */
      }
    }
  }
  printnl(133);
  print(728L);
  helpptr = 3;
  helpline[2] = 729;
  helpline[1] = 730;
  helpline[0] = 405;
  putgeterror();
_L10: ;


/* p2c: <stdin>, line 14311: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 14311: Warning: Symbol 'ABS' is not defined [221] */
}


/*:963*/
/*966:*/
/*968:*/

Static Void bilin1(p, t, q, u, delta)
halfword p;
long t;
halfword q;
long u, delta;
{
  halfword r;

  if (t != 65536L)
    depmult(p, t, true);
  if (u != 0) {
    if (mem[q + 30000].hh.UU.U2.b0 == 16)
      delta += takescaled(mem[q + 30001].int_, u);
    else {  /*969:*/
      if (mem[p + 30000].hh.UU.U2.b0 != 18) {   /*:969*/
	if (mem[p + 30000].hh.UU.U2.b0 == 16)
	  newdep(p, constdependency(mem[p + 30001].int_));
	else
	  mem[p + 30001].hh.rh = ptimesv(mem[p + 30001].hh.rh, 65536L, 17, 18,
					 true);
	mem[p + 30000].hh.UU.U2.b0 = 18;
      }
      mem[p + 30001].hh.rh = pplusfq(mem[p + 30001].hh.rh, u,
	  mem[q + 30001].hh.rh, 18, mem[q + 30000].hh.UU.U2.b0);
    }
  }
  if (mem[p + 30000].hh.UU.U2.b0 == 16)
    mem[p + 30001].int_ += delta;
  else {
    r = mem[p + 30001].hh.rh;
    while (mem[r + 30000].hh.UU.lh != -30000)
      r = mem[r + 30000].hh.rh;
    delta += mem[r + 30001].int_;
    if (r != mem[p + 30001].hh.rh)
      mem[r + 30001].int_ = delta;
    else {
      recyclevalue(p);
      mem[p + 30000].hh.UU.U2.b0 = 16;
      mem[p + 30001].int_ = delta;
    }
  }
  if (fixneeded)
    fixdependencies();
}


/*:968*/
/*971:*/

Static Void addmultdep(p, v, r)
halfword p;
long v;
halfword r;
{
  if (mem[r + 30000].hh.UU.U2.b0 == 16) {
    mem[depfinal + 30001].int_ += takescaled(mem[r + 30001].int_, v);
    return;
  }
  mem[p + 30001].hh.rh = pplusfq(mem[p + 30001].hh.rh, v,
      mem[r + 30001].hh.rh, 18, mem[r + 30000].hh.UU.U2.b0);
  if (fixneeded)
    fixdependencies();
}


/*:971*/
/*972:*/

Static Void bilin2(p, t, v, u, q)
halfword p, t;
long v;
halfword u, q;
{
  scaled vv;

  vv = mem[p + 30001].int_;
  mem[p + 30000].hh.UU.U2.b0 = 18;
  newdep(p, constdependency(0L));
  if (vv != 0)
    addmultdep(p, vv, t);
  if (v != 0)
    addmultdep(p, v, u);
  if (q != -30000)
    addmultdep(p, 65536L, q);
  if (mem[p + 30001].hh.rh != depfinal)
    return;
  vv = mem[depfinal + 30001].int_;
  recyclevalue(p);
  mem[p + 30000].hh.UU.U2.b0 = 16;
  mem[p + 30001].int_ = vv;
}


/*:972*/
/*974:*/

Static Void bilin3(p, t, v, u, delta)
halfword p;
long t, v, u, delta;
{
  if (t != 65536L)
    delta += takescaled(mem[p + 30001].int_, t);
  else
    delta += mem[p + 30001].int_;
  if (u != 0)
    mem[p + 30001].int_ = delta + takescaled(v, u);
  else
    mem[p + 30001].int_ = delta;
}  /*:974*/


Static Void bigtrans(p, c)
halfword p;
quarterword c;
{
  halfword q, r, pp, qq;
  smallnumber s;

  s = bignodesize[mem[p + 30000].hh.UU.U2.b0 - 13];
  q = mem[p + 30001].int_;
  r = q + s;
  do {
    r -= 2;
    if (mem[r + 30000].hh.UU.U2.b0 != 16) {  /*967:*/
      setupknowntrans(c);
      makeexpcopy(p);
      r = mem[curexp + 30001].int_;
      if (curtype == 13) {
	bilin1(r + 10, tyy, q + 6, tyx, 0L);
	bilin1(r + 8, tyy, q + 4, tyx, 0L);
	bilin1(r + 6, txx, q + 10, txy, 0L);
	bilin1(r + 4, txx, q + 8, txy, 0L);
      }
      bilin1(r + 2, tyy, q, tyx, ty);
      bilin1(r, txx, q + 2, txy, tx);
      goto _L10;
    }  /*:967*/
  } while (r != q);   /*970:*/
  setuptrans(c);
  if (curtype == 16) {  /*973:*/
    makeexpcopy(p);
    r = mem[curexp + 30001].int_;
    if (curtype == 13) {
      bilin3(r + 10, tyy, mem[q + 30007].int_, tyx, 0L);
      bilin3(r + 8, tyy, mem[q + 30005].int_, tyx, 0L);
      bilin3(r + 6, txx, mem[q + 30011].int_, txy, 0L);
      bilin3(r + 4, txx, mem[q + 30009].int_, txy, 0L);
    }
    bilin3(r + 2, tyy, mem[q + 30001].int_, tyx, ty);
    bilin3(r, txx, mem[q + 30003].int_, txy, tx);
  } else {  /*:973*/
    pp = stashcurexp();
    qq = mem[pp + 30001].int_;
    makeexpcopy(p);
    r = mem[curexp + 30001].int_;
    if (curtype == 13) {
      bilin2(r + 10, qq + 10, mem[q + 30007].int_, qq + 8, -30000);
      bilin2(r + 8, qq + 10, mem[q + 30005].int_, qq + 8, -30000);
      bilin2(r + 6, qq + 4, mem[q + 30011].int_, qq + 6, -30000);
      bilin2(r + 4, qq + 4, mem[q + 30009].int_, qq + 6, -30000);
    }
    bilin2(r + 2, qq + 10, mem[q + 30001].int_, qq + 8, qq + 2);
    bilin2(r, qq + 4, mem[q + 30003].int_, qq + 6, qq);
    recyclevalue(pp);
    freenode(pp, 2);
  }
  /*:970*/
_L10: ;

}


/*:966*/
/*976:*/

Static Void cat(p)
halfword p;
{
  strnumber a, b;
  poolpointer k, FORLIM;

  a = mem[p + 30001].int_;
  b = curexp;
  if (poolptr + strstart[a + 1] - strstart[a] + strstart[b + 1] - strstart[b] >
      maxpoolptr) {
    if (poolptr + strstart[a + 1] - strstart[a] + strstart[b + 1] - strstart[b] >
	poolsize)
      overflow(129, (long)(poolsize - initpoolptr));
    maxpoolptr = poolptr + strstart[a + 1] - strstart[a] +
		 strstart[b + 1] - strstart[b];
  }
  FORLIM = strstart[a + 1];
  for (k = strstart[a]; k < FORLIM; k++) {
    strpool[poolptr] = strpool[k];
    poolptr++;
  }
  FORLIM = strstart[b + 1];
  for (k = strstart[b]; k < FORLIM; k++) {
    strpool[poolptr] = strpool[k];
    poolptr++;
  }
  curexp = makestring();
  if (strref[b] >= 127)
    return;
  if (strref[b] > 1)
    strref[b]--;
  else
    flushstring(b);
}


/*:976*/
/*977:*/

Static Void chopstring(p)
halfword p;
{
  long a, b, l, k;
  strnumber s;
  boolean reversed;
  long FORLIM;

  a = roundunscaled(mem[p + 30001].int_);
  b = roundunscaled(mem[p + 30003].int_);
  if (a <= b)
    reversed = false;
  else {
    reversed = true;
    k = a;
    a = b;
    b = k;
  }
  s = curexp;
  l = strstart[s + 1] - strstart[s];
  if (a < 0) {
    a = 0;
    if (b < 0)
      b = 0;
  }
  if (b > l) {
    b = l;
    if (a > l)
      a = l;
  }
  if (poolptr + b - a > maxpoolptr) {
    if (poolptr + b - a > poolsize)
      overflow(129, (long)(poolsize - initpoolptr));
    maxpoolptr = poolptr + b - a;
  }
  if (reversed) {
    FORLIM = strstart[s] + a;
    for (k = strstart[s] + b - 1; k >= FORLIM; k--) {
      strpool[poolptr] = strpool[k];
      poolptr++;
    }
  } else {
    FORLIM = strstart[s] + b;
    for (k = strstart[s] + a; k < FORLIM; k++) {
      strpool[poolptr] = strpool[k];
      poolptr++;
    }
  }
  curexp = makestring();
  if (strref[s] >= 127)
    return;
  if (strref[s] > 1)
    strref[s]--;
  else
    flushstring(s);
}


/*:977*/
/*978:*/

Static Void choppath(p)
halfword p;
{
  halfword q, pp, qq, rr, ss;
  scaled a, b, k, l;
  boolean reversed;

  l = pathlength();
  a = mem[p + 30001].int_;
  b = mem[p + 30003].int_;
  if (a <= b)
    reversed = false;
  else {
    reversed = true;
    k = a;
    a = b;
    b = k;
  }  /*979:*/
  if (a < 0) {
    if (mem[curexp + 30000].hh.UU.U2.b0 == 0) {
      a = 0;
      if (b < 0)
	b = 0;
    } else {
      do {
	a += l;
	b += l;
      } while (a < 0);
    }
  }
  if (b > l) {
    if (mem[curexp + 30000].hh.UU.U2.b0 == 0) {
      b = l;
      if (a > l)
	a = l;
    } else {
      while (a >= l) {   /*:979*/
	a -= l;
	b -= l;
      }
    }
  }
  q = curexp;
  while (a >= 65536L) {
    q = mem[q + 30000].hh.rh;
    a -= 65536L;
    b -= 65536L;
  }
  if (b == a) {  /*981:*/
    if (a > 0) {
      qq = mem[q + 30000].hh.rh;
      splitcubic(q, a * 4096, mem[qq + 30001].int_, mem[qq + 30002].int_);
      q = mem[q + 30000].hh.rh;
    }
    pp = copyknot(q);
    qq = pp;
  } else {   /*:981*/
    pp = copyknot(q);
    qq = pp;
    do {
      q = mem[q + 30000].hh.rh;
      rr = qq;
      qq = copyknot(q);
      mem[rr + 30000].hh.rh = qq;
      b -= 65536L;
    } while (b > 0);
    if (a > 0) {
      ss = pp;
      pp = mem[pp + 30000].hh.rh;
      splitcubic(ss, a * 4096, mem[pp + 30001].int_, mem[pp + 30002].int_);
      pp = mem[ss + 30000].hh.rh;
      freenode(ss, 7);
      if (rr == ss) {
	b = makescaled(b, 65536L - a);
	rr = pp;
      }
    }
    if (b < 0) {
      splitcubic(rr, (b + 65536L) * 4096, mem[qq + 30001].int_,
		 mem[qq + 30002].int_);
      freenode(qq, 7);,
pairvalue, setupoffset, setupdirectiontime, findpoint, dobinary
      qq = mem[rr + 30000].hh.rh;
    }
  }
  mem[pp + 30000].hh.UU.U2.b0 = 0;
  mem[qq + 30000].hh.UU.U2.b1 = 0;
  mem[qq + 30000].hh.rh = pp;
  tossknotlist((int)curexp);
  if (reversed) {
    curexp = mem[htapypoc(pp) + 30000].hh.rh;
    tossknotlist(pp);
  } else
    curexp = pp;

  /*980:*/
  /*:980*/
}


/*:978*/
/*982:*/

Static Void pairvalue(x, y)
long x, y;
{
  halfword p;

  p = getnode(2L);
  flushcurexp((long)p);
  curtype = 14;
  mem[p + 30000].hh.UU.U2.b0 = 14;
  mem[p + 30000].hh.UU.U2.b1 = 11;
  initbignode(p);
  p = mem[p + 30001].int_;
  mem[p + 30000].hh.UU.U2.b0 = 16;
  mem[p + 30001].int_ = x;
  mem[p + 30002].hh.UU.U2.b0 = 16;
  mem[p + 30003].int_ = y;
}  /* pairvalue */


/*:982*/
/*984:*/

Static Void setupoffset(p)
halfword p;
{
  findoffset(mem[p + 30001].int_, mem[p + 30003].int_, (int)curexp);
  pairvalue(curx, cury);
}


Static Void setupdirectiontime(p)
halfword p;
{
  flushcurexp(finddirectiontime(mem[p + 30001].int_, mem[p + 30003].int_,
				(int)curexp));
}

<stdin>, line 14736: Note: Using % for possibly-negative arguments [317]
<stdin>, line 14741: Note: Using % for possibly-negative arguments [317]


/*:984*/
/*985:*/

Static Void findpoint(v, c)
long v;
quarterword c;
{
  halfword p, q;
  scaled n, vv;

  vv = v;
  p = curexp;
  if (mem[p + 30000].hh.UU.U2.b0 == 0)
    n = -65536L;
  else
    n = 0;
  do {
    p = mem[p + 30000].hh.rh;
    n += 65536L;
  } while (p != curexp);
  if (n == 0)
    v = 0;
  else if (v < 0) {
    if (mem[p + 30000].hh.UU.U2.b0 == 0)
      v = 0;
    else {
      v = n - (-v - 1) % n - 1;
/* p2c: <stdin>, line 14736:
 * Note: Using % for possibly-negative arguments [317] */
    }
  } else if (v > n) {
    if (mem[p + 30000].hh.UU.U2.b0 == 0)
      v = n;
    else {
      v %= n;
/* p2c: <stdin>, line 14741:
 * Note: Using % for possibly-negative arguments [317] */
    }
  }
  p = curexp;
  while (v >= 65536L) {
    p = mem[p + 30000].hh.rh;
    v -= 65536L;
  }
  if (v != 0)   /*:986*/
  {  /*986:*/
    q = mem[p + 30000].hh.rh;
    splitcubic(p, v * 4096, mem[q + 30001].int_, mem[q + 30002].int_);
    p = mem[p + 30000].hh.rh;
  }
  /*987:*/
  switch (c) {

  case 97:
    pairvalue(mem[p + 30001].int_, mem[p + 30002].int_);
    break;

  case 98:
    if (mem[p + 30000].hh.UU.U2.b0 == 0)
      pairvalue(mem[p + 30001].int_, mem[p + 30002].int_);
    else
      pairvalue(mem[p + 30003].int_, mem[p + 30004].int_);
    break;

  case 99:
    if (mem[p + 30000].hh.UU.U2.b1 == 0)
      pairvalue(mem[p + 30001].int_, mem[p + 30002].int_);
    else
      pairvalue(mem[p + 30005].int_, mem[p + 30006].int_);
    break;
  }/*:987*/
}  /*:985*/


Static Void dobinary(p, c)
halfword p;
quarterword c;
{
  halfword q, r, rr, oldp, oldexp;
  long v;

  if (aritherror)
    cleararith();
  if (internal[6] > 131072L)   /*:924*/
  {  /*924:*/
    begindiagnostic();
    printnl(714);
    printexp(p, 0);
    printchar(41);
    printop(c);
    printchar(40);
    printexp(-30000, 0);
    print(706L);
    enddiagnostic(false);
  }
  /*926:*/
  if ((unsigned)mem[p + 30000].hh.UU.U2.b0 < 32 &&
      ((1L << mem[p + 30000].hh.UU.U2.b0) & 0x86000L) != 0) {
    switch (mem[p + 30000].hh.UU.U2.b0) {

    case 13:
    case 14:
      oldp = tarnished(p);
      break;

    case 19:
      oldp = -29999;
      break;
    }
  } else
    oldp = -30000;
  if (oldp != -30000) {
    q = stashcurexp();
    oldp = p;
    makeexpcopy(oldp);
    p = stashcurexp();
    unstashcurexp(q);
  }  /*:926*/
  /*927:*/
  if ((unsigned)curtype < 32 && ((1L << curtype) & 0x86000L) != 0) {
    switch (curtype) {

    case 13:
    case 14:
      oldexp = tarnished((int)curexp);
      break;

    case 19:
      oldexp = -29999;
      break;
    }
  } else
    oldexp = -30000;
  if (oldexp != -30000) {   /*:927*/
    oldexp = curexp;
    makeexpcopy(oldexp);
  }
  switch (c) {   /*:988*/

  case 69:
  case 70:   /*929:*/
    if (curtype < 14 || mem[p + 30000].hh.UU.U2.b0 < 14) {
      if (curtype == 11 && mem[p + 30000].hh.UU.U2.b0 == 11) {
	if (c == 70)
	  negateedges((int)curexp);
	curedges = curexp;
	mergeedges((int)mem[p + 30001].int_);
      } else
	badbinary(p, c);
    } else if (curtype == 14) {
      if (mem[p + 30000].hh.UU.U2.b0 != 14)
	badbinary(p, c);
      else {
	q = mem[p + 30001].int_;
	r = mem[curexp + 30001].int_;
	addorsubtract(q, r, c);
	addorsubtract(q + 2, r + 2, c);
      }
    } else if (mem[p + 30000].hh.UU.U2.b0 == 14)
      badbinary(p, c);
    else
      addorsubtract(p, -30000, c);
    break;
    /*936:*/

  case 77:
  case 78:
  case 79:
  case 80:
  case 81:
  case 82:   /*:936*/
    if (curtype > 14 && mem[p + 30000].hh.UU.U2.b0 > 14)
      addorsubtract(p, -30000, 70);
    else if (curtype != mem[p + 30000].hh.UU.U2.b0) {
      badbinary(p, c);
      goto _L30;
    } else if (curtype == 4)
      flushcurexp(strvsstr((int)mem[p + 30001].int_, (int)curexp));
    else if (curtype == 5 || curtype == 3) {
      q = mem[curexp + 30001].int_;
      while (q != curexp && q != p)
	q = mem[q + 30001].int_;
      if (q == p)
	flushcurexp(0L);
    } else if (curtype == 14 || curtype == 13) {
      q = mem[p + 30001].int_;
      r = mem[curexp + 30001].int_;
      rr = r + bignodesize[curtype - 13] - 2;
      while (true) {
	addorsubtract(q, r, 70);
	if (mem[r + 30000].hh.UU.U2.b0 != 16)
	  goto _L31;
	if (mem[r + 30001].int_ != 0)
	  goto _L31;
	if (r == rr)
	  goto _L31;
	q += 2;
	r += 2;
      }
_L31:
      takepart((int)((r - mem[curexp + 30001].int_) / 2 + 53));
    } else if (curtype == 2)
      flushcurexp(curexp - mem[p + 30001].int_);
    else {
      badbinary(p, c);
      goto _L30;
    }
    if (curtype != 16) {
      if (curtype < 16) {
	disperr(p, 155);
	helpptr = 1;
	helpline[0] = 715;
      } else {
	helpptr = 2;
	helpline[1] = 716;
	helpline[0] = 717;
      }
      disperr(-30000, 718);
      putgetflusherror(31L);
    } else {
      switch (c) {

      case 77:
	if (curexp < 0)
	  curexp = 30;
	else
	  curexp = 31;
	break;

      case 78:
	if (curexp <= 0)
	  curexp = 30;
	else
	  curexp = 31;
	break;

      case 79:
	if (curexp > 0)
	  curexp = 30;
	else
	  curexp = 31;
	break;

      case 80:
	if (curexp >= 0)
	  curexp = 30;
	else
	  curexp = 31;
	break;

      case 81:
	if (curexp == 0)
	  curexp = 30;
	else
	  curexp = 31;
	break;

      case 82:
	if (curexp != 0)
	  curexp = 30;
	else
	  curexp = 31;
	break;
      }
    }
    curtype = 2;   /*:937*/
_L30: ;

    break;
    /*940:*/

  case 76:
  case 75:   /*:940*/
    if (mem[p + 30000].hh.UU.U2.b0 != 2 || curtype != 2)
      badbinary(p, c);
    else if (mem[p + 30001].int_ == c - 45)
      curexp = mem[p + 30001].int_;
    break;
    /*941:*/

  case 71:   /*:941*/
    if (curtype < 14 || mem[p + 30000].hh.UU.U2.b0 < 14)
      badbinary(p, 71);
    else if (curtype == 16 || mem[p + 30000].hh.UU.U2.b0 == 16) {
      if (mem[p + 30000].hh.UU.U2.b0 == 16) {
	v = mem[p + 30001].int_;
	freenode(p, 2);
      } else {
	v = curexp;
	unstashcurexp(p);
      }
      if (curtype == 16)
	curexp = takescaled(curexp, v);
      else if (curtype == 14) {
	p = mem[curexp + 30001].int_;
	depmult(p, v, true);
	depmult(p + 2, v, true);
      } else
	depmult(-30000, v, true);
      goto _L10;
    } else if ((nicepair((long)p, mem[p + 30000].hh.UU.U2.b0) && curtype > 14) |
	       (nicepair(curexp, curtype) && mem[p + 30000].hh.UU.U2.b0 > 14)) {
      hardtimes(p);
      goto _L10;
    } else
      badbinary(p, 71);
    break;
    /*948:*/

  case 72:   /*:948*/
    if (curtype == 16 && mem[p + 30000].hh.UU.U2.b0 >= 14) {
      v = curexp;
      unstashcurexp(p);
      if (v == 0) {  /*950:*/
	disperr(-30000, 648);
	helpptr = 2;
	helpline[1] = 720;
	helpline[0] = 721;
	putgeterror();
      } else {  /*:950*/
	if (curtype == 16)
	  curexp = makescaled(curexp, v);
	else if (curtype == 14) {
	  p = mem[curexp + 30001].int_;
	  depdiv(p, v);
	  depdiv(p + 2, v);
	} else
	  depdiv(-30000, v);
      }
      goto _L10;
    }
    badbinary(p, 72);
    break;
    /*951:*/

  case 73:
  case 74:   /*:951*/
    if (curtype == 16 && mem[p + 30000].hh.UU.U2.b0 == 16) {
      if (c == 73)
	curexp = pythadd(mem[p + 30001].int_, curexp);
      else
	curexp = pythsub(me, fracmult, gfswap, gffour, gftwo, gfthree, gfpaint, gfstring, gfboc, initgfm[p + 30001].int_, curexp);
    } else
      badbinary(p, c);
    break;
    /*952:*/

  case 84:
  case 85:
  case 86:
  case 87:
  case 88:
  case 89:
  case 90:
  case 91:   /*:952*/
    if (mem[p + 30000].hh.UU.U2.b0 == 9 || mem[p + 30000].hh.UU.U2.b0 == 8 ||
	mem[p + 30000].hh.UU.U2.b0 == 6) {
      pathtrans(p, c);
      goto _L10;
    }
    if (mem[p + 30000].hh.UU.U2.b0 == 14 || mem[p + 30000].hh.UU.U2.b0 == 13)
      bigtrans(p, c);
    else if (mem[p + 30000].hh.UU.U2.b0 == 11) {
      edgestrans(p, c);
      goto _L10;
    } else
      badbinary(p, c);
    break;
    /*975:*/

  case 83:
    if (curtype == 4 && mem[p + 30000].hh.UU.U2.b0 == 4)
      cat(p);
    else
      badbinary(p, 83);
    break;

  case 94:
    if (nicepair((long)p, mem[p + 30000].hh.UU.U2.b0) && curtype == 4)
      chopstring((int)mem[p + 30001].int_);
    else
      badbinary(p, 94);
    break;

  case 95:   /*:975*/
    if (curtype == 14)
      pairtopath();
    if (nicepair((long)p, mem[p + 30000].hh.UU.U2.b0) && curtype == 9)
      choppath((int)mem[p + 30001].int_);
    else
      badbinary(p, 95);
    break;
    /*983:*/

  case 97:
  case 98:
  case 99:
    if (curtype == 14)
      pairtopath();
    if (curtype == 9 && mem[p + 30000].hh.UU.U2.b0 == 16)
      findpoint(mem[p + 30001].int_, c);
    else
      badbinary(p, c);
    break;

  case 100:
    if (curtype == 8)
      materializepen();
    if ((curtype == 6) & nicepair((long)p, mem[p + 30000].hh.UU.U2.b0))
      setupoffset((int)mem[p + 30001].int_);
    else
      badbinary(p, 100);
    break;

  case 96:   /*:983*/
    if (curtype == 14)
      pairtopath();
    if ((curtype == 9) & nicepair((long)p, mem[p + 30000].hh.UU.U2.b0))
      setupdirectiontime((int)mem[p + 30001].int_);
    else
      badbinary(p, 96);
    break;
    /*988:*/

  case 92:
    if (mem[p + 30000].hh.UU.U2.b0 == 14) {
      q = stashcurexp();
      unstashcurexp(p);
      pairtopath();
      p = stashcurexp();
      unstashcurexp(q);
    }
    if (curtype == 14)
      pairtopath();
    if (curtype == 9 && mem[p + 30000].hh.UU.U2.b0 == 9) {
      pathintersection((int)mem[p + 30001].int_, (int)curexp);
      pairvalue(curt, curtt);
    } else
      badbinary(p, 92);
    break;
  }
  recyclevalue(p);
  freenode(p, 2);
_L10:
  if (aritherror)   /*925:*/
    cleararith();
  if (oldp != -30000) {
    recyclevalue(oldp);
    freenode(oldp, 2);
  }
  if (oldexp != -30000) {
    recyclevalue(oldexp);
    freenode(oldexp, 2);
  }  /*:925*/

  /*:929*/
  /*938:*/
  /*:938*/
  /*939:*/
  /*:939*/
  /*937:*/
  /*942:*/
  /*:942*/
}


/*:922*/
/*944:*/

Static Void fracmult(n, d)
long n, d;
{
  halfword p, oldexp;
  fraction v;

  if (internal[6] > 131072L)   /*:945*/
  {  /*945:*/
    begindiagnostic();
    printnl(714);
    printscaled(n);
    printchar(47);
    printscaled(d);
    print(719L);
    printexp(-30000, 0);
    print(706L);
    enddiagnostic(false);
  }
  if ((unsigned)curtype < 32 && ((1L << curtype) & 0x86000L) != 0) {
    switch (curtype) {

    case 13:
    case 14:
      oldexp = tarnished((int)curexp);
      break;

    case 19:
      oldexp = -29999;
      break;
    }
  } else
    oldexp = -30000;
  if (oldexp != -30000) {
    oldexp = curexp;
    makeexpcopy(oldexp);
  }
  v = makefraction(n, d);
  if (curtype == 16)
    curexp = takefraction(curexp, v);
  else if (curtype == 14) {
    p = mem[curexp + 30001].int_;
    depmult(p, v, false);
    depmult(p + 2, v, false);
  } else
    depmult(-30000, v, false);
  if (oldexp != -30000) {
    recyclevalue(oldexp);
    freenode(oldexp, 2);
  }
}


/*:944*/
/*989:*/
/*1155:*/

Static Void gfswap()
{
  if (gflimit != gfbufsize) {
    bwritebuf(&gffile, gfbuf, (long)halfbuf, gfbufsize - 1L);
    gflimit = gfbufsize;
    return;
  }
  bwritebuf(&gffile, gfbuf, 0L, halfbuf - 1L);
  gflimit = halfbuf;
  gfoffset += gfbufsize;
  gfptr = 0;
}

<stdin>, line 15168: Note: Using % for possibly-negative arguments [317]
<stdin>, line 15175: Note: Using % for possibly-negative arguments [317]


/*:1155*/
/*1157:*/

Static Void gffour(x)
long x;
{
  if (x >= 0) {
    gfbuf[gfptr] = x / 16777216L;
    gfptr++;
    if (gfptr == gflimit)
      gfswap();
  } else {
    x += 1073741824L;
    x += 1073741824L;
    gfbuf[gfptr] = x / 16777216L + 128;
    gfptr++;
    if (gfptr == gflimit)
      gfswap();
  }
  x %= 16777216L;
/* p2c: <stdin>, line 15168:
 * Note: Using % for possibly-negative arguments [317] */
  gfbuf[gfptr] = x / 65536L;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  x %= 65536L;
/* p2c: <stdin>, line 15175:
 * Note: Using % for possibly-negative arguments [317] */
  gfbuf[gfptr] = x / 256;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gfbuf[gfptr] = x & 255;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
}


/*:1157*/
/*1158:*/

Static Void gftwo(x)
long x;
{
  gfbuf[gfptr] = x / 256;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gfbuf[gfptr] = x & 255;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
}

<stdin>, line 15215: Note: Using % for possibly-negative arguments [317]


Static Void gfthree(x)
long x;
{
  gfbuf[gfptr] = x / 65536L;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gfbuf[gfptr] = x % 65536L / 256;
/* p2c: <stdin>, line 15215:
 * Note: Using % for possibly-negative arguments [317] */
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gfbuf[gfptr] = x & 255;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
}


/*:1158*/
/*1159:*/

Static Void gfpaint(d)
long d;
{
  if (d < 64) {
    gfbuf[gfptr] = d;
    gfptr++;
    if (gfptr == gflimit)
      gfswap();
    return;
  }
  if (d < 256) {
    gfbuf[gfptr] = 64;
    gfptr++;
    if (gfptr == gflimit)
      gfswap();
    gfbuf[gfptr] = d;
    gfptr++;
    if (gfptr == gflimit)
      gfswap();
    return;
  }
  gfbuf[gfptr] = 65;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gftwo(d);
}  /*:1159*/


/*1160:*/

Static Void gfstring(s, t)
strnumber s, t;
{
  poolpointer k;
  long l;
  poolpointer FORLIM;

  if (s != 0) {
    l = strstart[s + 1] - strstart[s];
    if (t != 0)
      l += strstart[t + 1] - strstart[t];
    if (l <= 255) {
      gfbuf[gfptr] = 239;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      gfbuf[gfptr] = l;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
    } else {
      gfbuf[gfptr] = 241;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      gfthree(l);
    }
    FORLIM = strstart[s + 1];
    for (k = strstart[s]; k < FORLIM; k++) {
      gfbuf[gfptr] = strpool[k];
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
    }
  }
  if (t == 0)
    return;
  FORLIM = strstart[t + 1];
  for (k = strstart[t]; k < FORLIM; k++) {
    gfbuf[gfptr] = strpool[k];
    gfptr++;
    if (gfptr == gflimit)
      gfswap();
  }
}  /*:1160*/


/*1161:*/

Static Void gfboc(minm, maxm, minn, maxn)
long minm, maxm, minn, maxn;
{
  if (minm < gfminm)
    gfminm = minm;
  if (maxn > gfmaxn)
    gfmaxn = maxn;
  if (bocp == -1) {
    if (bocc >= 0) {
      if (bocc < 256) {
	if (maxm - minm >= 0) {
	  if (maxm - minm < 256) {
	    if (maxm >= 0) {
	      if (maxm < 256) {
		if (maxn - minn >= 0) {
		  if (maxn - minn < 256) {
		    if (maxn >= 0) {
		      if (maxn < 256) {
			gfbuf[gfptr] = 68;
			gfptr++;
			if (gfptr == gflimit)
			  gfswap();
			gfbuf[gfptr] = bocc;
			gfptr++;
			if (gfptr == gflimit)
			  gfswap();
			gfbuf[gfptr] = maxm - minm;
			gfptr++;
			if (gfptr == gflimit)
			  gfswap();
			gfbuf[gfptr] = maxm;
			gfptr++;
			if (gfptr == gflimit)
			  gfswap();
			gfbuf[gfptr] = maxn - minn;
			gfptr++;
			if (gfptr == gflimit)
			  gfswap();
			gfbuf[gfptr] = maxn;
			gfptr++;
			if (gfptr == gflimit)
			  gfswap();
			goto _L10;
		      }
		    }
		  }
		}
	      }
	    }
	  }
	}
      }
    }
  }
  gfbuf[gfptr] = 67;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gffour(bocc);
  gffour(bocp);
  gffour(minm);
  gffour(maxm);
  gffour(minn);
  gffour(maxn);
_L10: ;

}

<stdin>, line 15434: Note: Using % for possibly-negative arguments [317]


/*:1161*/
/*1163:*/

Static Void initgf()
{
  eightbits k;
  long t;
  short TEMP;

  gfminm = 4096;
  gfmaxm = -4096;
  gfminn = 4096;
  gfmaxn = -4096;
  for (TEMP = 0; TEMP <= 255; TEMP++) {
 , shipout, tryeq, makeeq   k = TEMP;   /*1164:*/
    charptr[k] = -1;
  }
  if (internal[26] <= 0)
    gfext = 908;
  else {   /*:1164*/
    oldsetting = selector;
    selector = 5;
    printchar(46);
    printint(makescaled(internal[26], 59429463L));
    print(909L);
    gfext = makestring();
    selector = oldsetting;
  }
  if (jobname == 0)
    openlogfile();
  packjobname(gfext);
  while (!bopenout(&gffile, nameoffile))
    promptfilename(620, gfext);
  outputfilename = bmakenamestring(&gffile);
  gfbuf[gfptr] = 247;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gfbuf[gfptr] = 131;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  oldsetting = selector;
  selector = 5;
  print(907L);
  printint(roundunscaled(internal[13]));
  printchar(46);
  printdd(roundunscaled(internal[14]));
  printchar(46);
  printdd(roundunscaled(internal[15]));
  printchar(58);
  t = roundunscaled(internal[16]);
  printdd(t / 60);
/* p2c: <stdin>, line 15434:
 * Note: Using % for possibly-negative arguments [317] */
  printdd(t % 60);
  selector = oldsetting;
  gfbuf[gfptr] = poolptr - strstart[strptr];
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  strstart[strptr + 1] = poolptr;
  gfstring(0, strptr);
  poolptr = strstart[strptr];
  gfprevptr = gfoffset + gfptr;
}

<stdin>, line 15477: Warning: Symbol 'FLUSH' is not defined [221]
<stdin>, line 15620: Warning: Symbol 'FLUSH' is not defined [221]


/*:1163*/
/*1165:*/

Static Void shipout(c)
eightbits c;
{
  long f, prevm, m, mm, prevn, n;
  halfword p, q;
  long prevw, w, ww, d, delta, curminm, xoff, yoff;

  if (outputfilename == 0)
    initgf();
  f = roundunscaled(internal[18]);
  xoff = roundunscaled(internal[28]);
  yoff = roundunscaled(internal[29]);
  if (termoffset > maxprintline - 9)
    println();
  else if (termoffset > 0 || fileoffset > 0)
    printchar(32);
  printchar(91);
  printint((long)c);
  if (f != 0) {
    printchar(46);
    printint(f);
  }
  flush(stdout);
/* p2c: <stdin>, line 15477: Warning: Symbol 'FLUSH' is not defined [221] */
  bocc = f * 256 + c;
  bocp = charptr[c];
  charptr[c] = gfprevptr;
  if (internal[33] > 0)   /*:1166*/
  {  /*1166:*/
    if (xoff != 0) {
      gfstring(308, 0);
      gfbuf[gfptr] = 243;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      gffour(xoff * 65536L);
    }
    if (yoff != 0) {
      gfstring(309, 0);
      gfbuf[gfptr] = 243;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      gffour(yoff * 65536L);
    }
  }
  /*1167:*/
  prevn = 4096;
  p = mem[curedges + 30000].hh.UU.lh;
  n = mem[curedges + 30001].hh.rh - 4096;
  while (p != curedges) {  /*1169:*/
    if (mem[p + 30001].hh.UU.lh > -29999)
      sortedges(p);
    q = mem[p + 30001].hh.rh;
    w = 0;
    prevm = -268435456L;
    ww = 0;
    prevw = 0;
    m = prevm;
    do {
      if (q == 30000)
	mm = 268435456L;
      else {
	d = mem[q + 30000].hh.UU.lh + 32768L;
	mm = d / 8;
	ww += (d & 7) - 4;
      }
      if (mm != m) {
	if (prevw <= 0) {
	  if (w > 0) {  /*1170:*/
	    if (prevm == -268435456L) {  /*1172:*/
	      if (prevn == 4096) {
		gfboc(mem[curedges + 30002].hh.UU.lh + xoff - 4096,
		      mem[curedges + 30002].hh.rh + xoff - 4096,
		      mem[curedges + 30001].hh.UU.lh + yoff - 4096, n + yoff);
		curminm = mem[curedges + 30002].hh.UU.lh +
			  mem[curedges + 30003].hh.UU.lh - 4096;
	      } else if (prevn > n + 1) {
		delta = prevn - n - 1;
		if (delta < 256) {
		  if (delta == 0) {
		    gfbuf[gfptr] = 70;
		    gfptr++;
		    if (gfptr == gflimit)
		      gfswap();
		  } else {
		    gfbuf[gfptr] = 71;
		    gfptr++;
		    if (gfptr == gflimit)
		      gfswap();
		    gfbuf[gfptr] = delta;
		    gfptr++;
		    if (gfptr == gflimit)
		      gfswap();
		  }
		} else {
		  gfbuf[gfptr] = 72;
		  gfptr++;
		  if (gfptr == gflimit)
		    gfswap();
		  gftwo(delta);
		}
	      } else {
		delta = m - curminm;
		if (delta <= 164) {
		  gfbuf[gfptr] = delta + 74;
		  gfptr++;
		  if (gfptr == gflimit)
		    gfswap();
		  goto _L30;
		}
		gfbuf[gfptr] = 70;
		gfptr++;
		if (gfptr == gflimit)
		  gfswap();
	      }
	      gfpaint(m - curminm);
_L30:
	      prevn = n;
	    } else  /*:1172*/
	      gfpaint(m - prevm);
	    prevm = m;
	    prevw = w;
	  }  /*:1170*/
	} else if (w <= 0) {
	  gfpaint(m - prevm);
	  prevm = m;
	  prevw = w;
	}
	m = mm;
      }
      w = ww;
      q = mem[q + 30000].hh.rh;
    } while (mm != 268435456L);
    if (w != 0)
      printnl(911);
    if (prevm - mem[curedges + 30003].hh.UU.lh + xoff > gfmaxm)
      gfmaxm = prevm - mem[curedges + 30003].hh.UU.lh + xoff;   /*:1169*/
    p = mem[p + 30000].hh.UU.lh;
    n--;
  }
  if (prevn == 4096) {  /*1168:*/
    gfboc(0L, 0L, 0L, 0L);
    if (gfmaxm < 0)
      gfmaxm = 0;
    if (gfminn > 0)
      gfminn = 0;
  } else if (prevn + yoff < gfminn)
    gfminn = prevn + yoff;   /*:1167*/
  gfbuf[gfptr] = 69;
  gfptr++;
  if (gfptr == gflimit)
    gfswap();
  gfprevptr = gfoffset + gfptr;
  totalchars++;
  printchar(93);
  flush(stdout);
/* p2c: <stdin>, line 15620: Warning: Symbol 'FLUSH' is not defined [221] */
  if (internal[10] > 0)
    printedges(910, true, xoff, yoff);

  /*1174:*/
  /*:1174*/
  /*1173:*/
  /*:1173*/
  /*1171:*/
  /*:1171*/
  /*:1168*/
}  /* shipout */

<stdin>, line 15712: Warning: Symbol 'ABS' is not defined [221]


/*:1165*/
/*995:*/
/*1006:*/

Static Void tryeq(l, r)
halfword l, r;
{
  halfword p;
  char t;
  halfword q, pp;
  char tt;
  boolean copied;   /*1007:*/

  t = mem[l + 30000].hh.UU.U2.b0;
  if (t == 16) {
    t = 17;
    p = constdependency(-mem[l + 30001].int_);
    q = p;
  } else if (t == 19) {
    t = 17;
    p = singledependency(l);
    mem[p + 30001].int_ = -mem[p + 30001].int_;
    q = depfinal;
  } else {
    p = mem[l + 30001].hh.rh;
    q = p;
    while (true) {
      mem[q + 30001].int_ = -mem[q + 30001].int_;
      if (mem[q + 30000].hh.UU.lh == -30000)
	goto _L30;
      q = mem[q + 30000].hh.rh;
    }
_L30:
    mem[mem[l + 30001].hh.UU.lh + 30000].hh.rh = mem[q + 30000].hh.rh;
    mem[mem[q + 30000].hh.rh + 30001].hh.UU.lh = mem[l + 30001].hh.UU.lh;
    mem[l + 30000].hh.UU.U2.b0 = 16;
  }
  /*1009:*/
  if (r == -30000) {
    if (curtype == 16) {
      mem[q + 30001].int_ += curexp;
      goto _L31;
    }
    tt = curtype;
    if (tt == 19)
      pp = singledependency((int)curexp);
    else
      pp = mem[curexp + 30001].hh.rh;
  } else if (mem[r + 30000].hh.UU.U2.b0 == 16) {
    mem[q + 30001].int_ += mem[r + 30001].int_;
    goto _L31;
  } else {
    tt = mem[r + 30000].hh.UU.U2.b0;
    if (tt == 19)
      pp = singledependency(r);
    else
      pp = mem[r + 30001].hh.rh;
  }
  if (tt != 19)
    copied = false;
  else {
    copied = true;
    tt = 17;
  }  /*1010:*/
  watchcoefs = false;
  if (t == tt)
    p = pplusq(p, pp, t);
  else if (t == 18)
    p = pplusfq(p, 65536L, pp, 18, 17);
  else {
    q = p;
    while (mem[q + 30000].hh.UU.lh != -30000) {
      mem[q + 30001].int_ = roundfraction(mem[q + 30001].int_);
      q = mem[q + 30000].hh.rh;
    }
    t = 18;
    p = pplusq(p, pp, t);
  }
  watchcoefs = true;
  /*:1010*/
  if (copied)
    flushnodelist(pp);
_L31:   /*:1009*/
  if (mem[p + 30000].hh.UU.lh == -30000) {  /*1008:*/
    if (abs(mem[p + 30001].int_) > 64) {
      printnl(133);
      print(761L);
      print(763L);
      printscaled(mem[p + 30001].int_);
      printchar(41);
      helpptr = 2;
      helpline[1] = 762;
      helpline[0] = 760;
      putgeterror();
    } else if (r == -30000) {
      printnl(133);
      print(465L);
      helpptr = 2;
      helpline[1] = 466;
      helpline[0] = 467;
      putgeterror();
    }
    freenode(p, 2);
    return;
  }
  lineareq(p, t);
  if (r != -30000)
    return;
  if (curtype == 16)
    return;
  if (mem[curexp + 30000].hh.UU.U2.b0 != 16)
    return;
  pp = curexp;
  curexp = mem[curexp + 30001].int_;
  curtype = 16;
  freenode(pp, 2);

  /*:1007*/
/* p2c: <stdin>, line 15712: Warning: Symbol 'ABS' is not defined [221] */
  /*623:*/
  /*:623*/
  /*:1008*/
}


/*:1006*/
/*1001:*/

Static Void makeeq(lhs)
halfword lhs;
{
  smallnumber t;
  long v;
  halfword p, q;

_L20:
  t = mem[lhs + 30000].hh.UU.U2.b0;
  if (t <= 14)
    v = mem[lhs + 30001].int_;
  switch (t) {   /*1003:*/

  case 2:
  case 4:
  case, doequation, doassignment, dotypedeclaration, dorandomseed,
doprotection, defdelims, dointerim, dolet, donewinternal, doshow, disptoken 6:
  case 9:
  case 11:
    if (curtype == t + 1) {
      nonlineareq(v, (int)curexp, false);
      goto _L30;
    }
    if (curtype == t)   /*:1004*/
    {  /*1004:*/
      if (curtype <= 4) {
	if (curtype == 4) {   /*623:*/
	  if (strvsstr((int)v, (int)curexp) != 0)
	    goto _L45;
	} else if (v != curexp)
	  goto _L45;
	printnl(133);
	print(465L);
	helpptr = 2;
	helpline[1] = 466;
	helpline[0] = 467;
	putgeterror();   /*:623*/
	goto _L30;
      }
      printnl(133);
      print(758L);
      helpptr = 2;
      helpline[1] = 759;
      helpline[0] = 760;
      putgeterror();
      goto _L30;
_L45:
      printnl(133);
      print(761L);
      helpptr = 2;
      helpline[1] = 762;
      helpline[0] = 760;
      putgeterror();
      goto _L30;
    }
    break;

  case 3:
  case 5:
  case 7:
  case 12:
  case 10:
    if (curtype == t - 1) {
      nonlineareq(curexp, lhs, true);
      goto _L30;
    }
    if (curtype == t) {
      ringmerge(lhs, (int)curexp);
      goto _L30;
    }
    if (curtype == 14) {
      if (t == 10) {
	pairtopath();
	goto _L20;
      }
    }
    break;

  case 13:
  case 14:
    if (curtype == t)   /*:1005*/
    {  /*1005:*/
      p = v + bignodesize[t - 13];
      q = mem[curexp + 30001].int_ + bignodesize[t - 13];
      do {
	p -= 2;
	q -= 2;
	tryeq(p, q);
      } while (p != v);
      goto _L30;
    }
    break;

  case 16:
  case 17:
  case 18:
  case 19:
    if (curtype >= 16) {
      tryeq(lhs, -30000);
      goto _L30;
    }
    break;

  case 1:
    break;

  }
  /*:1003*/
  /*1002:*/
  disperr(lhs, 155);
  disperr(-30000, 755);
  if (mem[lhs + 30000].hh.UU.U2.b0 <= 14)
    printtype(mem[lhs + 30000].hh.UU.U2.b0);
  else
    print(211L);
  printchar(61);
  if (curtype <= 14)
    printtype(curtype);
  else
    print(211L);
  printchar(41);
  helpptr = 2;
  helpline[1] = 756;
  helpline[0] = 757;   /*:1002*/
  putgeterror();
_L30:
  if (aritherror)
    cleararith();
  recyclevalue(lhs);
  freenode(lhs, 2);
}  /*:1001*/


Static Void doassignment PV();


Static Void doequation()
{
  halfword lhs, p;

  lhs = stashcurexp();
  getxnext();
  varflag = 77;
  scanexpression();
  if (curcmd == 51)
    doequation();
  else if (curcmd == 77)
    doassignment();
  if (internal[6] > 131072L)   /*:997*/
  {  /*997:*/
    begindiagnostic();
    printnl(714);
    printexp(lhs, 0);
    print(750L);
    printexp(-30000, 0);
    print(706L);
    enddiagnostic(false);
  }
  if (curtype == 10) {
    if (mem[lhs + 30000].hh.UU.U2.b0 == 14) {
      p = stashcurexp();
      unstashcurexp(lhs);
      lhs = p;
    }
  }
  makeeq(lhs);
}


/*:995*/
/*996:*/

Static Void doassignment()
{
  halfword lhs, p, q;

  if (curtype != 20) {
    disperr(-30000, 747);
    helpptr = 2;
    helpline[1] = 748;
    helpline[0] = 749;
    error();
    doequation();
    return;
  }
  lhs = curexp;
  curtype = 1;
  getxnext();
  varflag = 77;
  scanexpression();
  if (curcmd == 51)
    doequation();
  else if (curcmd == 77)
    doassignment();
  if (internal[6] > 131072L)   /*:998*/
  {  /*998:*/
    begindiagnostic();
    printnl(123);
    if (mem[lhs + 30000].hh.UU.lh > 2241)
      print((long)intname[mem[lhs + 30000].hh.UU.lh - 2242]);
    else
      showtokenlist((long)lhs, -30000L, 1000L, 0L);
    print(329L);
    printexp(-30000, 0);
    printchar(125);
    enddiagnostic(false);
  }
  if (mem[lhs + 30000].hh.UU.lh > 2241) {   /*999:*/
    if (curtype == 16)
      internal[mem[lhs + 30000].hh.UU.lh - 2242] = curexp;
    else {   /*:999*/
      disperr(-30000, 751);
      print((long)intname[mem[lhs + 30000].hh.UU.lh - 2242]);
      print(752L);
      helpptr = 2;
      helpline[1] = 753;
      helpline[0] = 754;
      putgeterror();
    }
  } else {   /*:1000*/
    p = findvariable(lhs);
    if (p != -30000) {
      q = stashcurexp();
      curtype = undtype(p);
      recyclevalue(p);
      mem[p + 30000].hh.UU.U2.b0 = curtype;
      mem[p + 30001].int_ = -30000;
      makeexpcopy(p);
      p = stashcurexp();
      unstashcurexp(q);
      makeeq(p);
    } else {
      obliterated(lhs);
      putgeterror();
    }
  }
  flushnodelist(lhs);

  /*1000:*/
}


/*:996*/
/*1015:*/

Static Void dotypedeclaration()
{
  smallnumber t;
  halfword p, q;

  if (curmod >= 13)
    t = curmod;
  else
    t = curmod + 1;
  do {
    p = scandeclaredvariable();
    flushvariable(eqtb[mem[p + 30000].hh.UU.lh - 1].rh, mem[p + 30000].hh.rh,
		  false);
    q = findvariable(p);
    if (q != -30000) {
      mem[q + 30000].hh.UU.U2.b0 = t;
      mem[q + 30001].int_ = -30000;
    } else {
      printnl(133);
      print(764L);
      helpptr = 2;
      helpline[1] = 765;
      helpline[0] = 766;
      putgeterror();
    }
    flushlist(p);
    if (curcmd < 79) {  /*1016:*/
      printnl(133);
      print(767L);
      helpptr = 5;
      helpline[4] = 768;
      helpline[3] = 769;
      helpline[2] = 770;
      helpline[1] = 771;
      helpline[0] = 772;
      if (curcmd == 42)
	helpline[2] = 773;
      putgeterror();
      scannerstatus = 2;
      do {
	getnext();   /*743:*/
	if (curcmd == 39) {
	  if (strref[curmod] < 127) {
	    if (strref[curmod] > 1)
	      strref[curmod]--;
	    else
	      flushstring((int)curmod);
	  }
	}  /*:743*/
      } while (curcmd < 79);
      scannerstatus = 0;
    }  /*:1016*/
  } while (curcmd <= 79);   /* dotypedeclaration */
}


/*:1015*/
/*1021:*/

Static Void dorandomseed()
{
  getxnext();
  if (curcmd != 77) {
    missingerr(329);
    helpptr = 1;
    helpline[0] = 778;
    backerror();
  }
  getxnext();
  scanexpression();
  if (curtype != 16) {
    disperr(-30000, 779);
    helpptr = 2;
    helpline[1] = 780;
    helpline[0] = 781;
    putgetflusherror(0L);
    return;
  }
  initrandoms(curexp);
  if (selector < 2)
    return;
  oldsetting = selector;
  selector = 2;
  printnl(782);
  printscaled(curexp);
  printchar(125);
  printnl(155);
  selector = oldsetting;

  /*1022:*/
  /*:1022*/
}


/*:1021*/
/*1029:*/

Static Void doprotection()
{
  char m;
  halfword t;

  m = curmod;
  do {
    getsymbol();
    t = eqtb[cursym - 1].UU.lh;
    if (m == 0) {
      if (t >= 83)
	eqtb[cursym - 1].UU.lh = t - 83;
    } else if (t < 83)
      eqtb[cursym - 1].UU.lh = t + 83;
    getxnext();
  } while (curcmd == 79);
}


/*:1029*/
/*1031:*/

Static Void defdelims()
{
  halfword ldelim, rdelim;

  getclearsymbol();
  ldelim = cursym;
  getclearsymbol();
  rdelim = cursym;
  eqtb[ldelim - 1].UU.lh = 31;
  eqtb[ldelim - 1].rh = rdelim;
  eqtb[rdelim - 1].UU.lh = 62;
  eqtb[rdelim - 1].rh = ldelim;
  getxnext();
}


/*:1031*/
/*1034:*/

Static Void dostatement PV();


Static Void dointerim()
{
  getxnext();
  if (curcmd != 40) {
    printnl(133);
    print(788L);
    if (cursym == 0)
      print(793L);
    else
      print((long)hash[cursym - 1].rh);
    print(794L);
    helpptr = 1;
    helpline[0] = 795;
    backerror();
  } else {
    saveinternal((int)curmod);
    backinput();
  }
  dostatement();
}  /* dointerim */


/*:1034*/
/*1035:*/

Static Void dolet()
{
  halfword l;

  getsymbol();
  l = cursym;
  getxnext();
  if (curcmd != 51) {
    if (curcmd != 77) {
      missingerr(61);
      helpptr = 3;
      helpline[2] = 796;
      helpline[1] = 538;
      helpline[0] = 797;
      backerror();
    }
  }
  getsymbol();
  if (curcmd == 10 || curcmd == 49 || curcmd == 44 || curcmd == 53) {
    switch (curcmd) {

    case 10:
    case 53:
    case 44:
    case 49:
      mem[curmod + 30000].hh.UU.lh++;
      break;
    }
  }
  clearsymbol(l, false);
  eqtb[l - 1].UU.lh = curcmd;
  if (curcmd == 41)
    eqtb[l - 1].rh = -30000;
  else
    eqtb[l - 1].rh = curmod;
  getxnext();
}


/*:1035*/
/*1036:*/

Static Void donewinternal()
{
  do {
    if (intptr == maxinternal)
      overflow(798, (long)maxinternal);
    getclearsymbol();
    intptr++;
    eqtb[cursym - 1].UU.lh = 40;
    eqtb[cursym - 1].rh = intptr;
    intname[intptr - 1] = hash[cursym - 1].rh;
    internal[intptr - 1] = 0;
    getxnext();
  } while (curcmd == 79);
}


/*:1036*/
/*1040:*/

Static Void doshow()
{
  do {
    getxnext();
    scanexpression();
    printnl(629);
    printexp(-30000, 2);
    flushcurexp(0L);
  } while (curcmd == 79);
}


/*:1040*/
/*1041:*/

Static Void disptoken(,
doshowtoken, doshowstats, dispvar, doshowvar, doshowdependencies,
doshowwhatever, scanwith, findedgesvar, doaddto)
{
  printnl(804);
  if (cursym == 0) {  /*1042:*/
    if (curcmd == 42) {
      printscaled(curmod);
      return;
    }
    if (curcmd == 38) {
      gpointer = curmod;
      printcapsule();
      return;
    }
    printchar(34);
    print(curmod);
    printchar(34);
    if (strref[curmod] >= 127)
      return;
    if (strref[curmod] > 1)
      strref[curmod]--;
    else
      flushstring((int)curmod);
    return;
  }
  print((long)hash[cursym - 1].rh);
  printchar(61);
  if (eqtb[cursym - 1].UU.lh >= 83)
    print(805L);
  printcmdmod((long)curcmd, curmod);
  if (curcmd == 10) {
    println();
    showmacro((int)curmod, -30000L, 100000L);
  }

  /*:1042*/
}


/*:1041*/
/*1044:*/

Static Void doshowtoken()
{
  do {
    getnext();
    disptoken();
    getxnext();
  } while (curcmd == 79);
}


/*:1044*/
/*1045:*/

Static Void doshowstats()
{
  /*printint(varused);printchar(38);printint(dynused);
  if false then*/
  printnl(814);
  print(228L);
  print(425L);
  printint(himemmin - lomemmax - 1L);
  print(815L);
  println();
  printnl(816);
  printint((long)(strptr - initstrptr));
  printchar(38);
  printint((long)(poolptr - initpoolptr));
  print(425L);
  printint((long)(maxstrings - maxstrptr));
  printchar(38);
  printint((long)(poolsize - maxpoolptr));
  print(815L);
  println();
  getxnext();
}  /*:1045*/


/*1046:*/

Static Void dispvar(p)
halfword p;
{
  halfword q;
  char n;

  if (mem[p + 30000].hh.UU.U2.b0 == 21) {  /*1047:*/
    q = mem[p + 30001].hh.UU.lh;
    do {
      dispvar(q);
      q = mem[q + 30000].hh.rh;
    } while (q != -29983);
    q = mem[p + 30001].hh.rh;
    while (mem[q + 30000].hh.UU.U2.b1 == 3) {
      dispvar(q);
      q = mem[q + 30000].hh.rh;
    }
    return;
  }
  if (mem[p + 30000].hh.UU.U2.b0 >= 22) {   /*:1047*/
    printnl(155);
    printvariablename(p);
    if (mem[p + 30000].hh.UU.U2.b0 > 22)
      print(530L);
    print(817L);
    if (fileoffset >= maxprintline - 20)
      n = 5;
    else
      n = maxprintline - fileoffset - 15;
    showmacro((int)mem[p + 30001].int_, -30000L, (long)n);
    return;
  }
  /*1048:*/
  if (mem[p + 30000].hh.UU.U2.b0 == 0)  /*:1048*/
    return;
  printnl(155);
  printvariablename(p);
  printchar(61);
  printexp(p, 0);
}


/*:1046*/
/*1049:*/

Static Void doshowvar()
{
  do {
    getnext();
    if (cursym > 0) {
      if (cursym <= 2241) {
	if (curcmd == 41) {
	  if (curmod != -30000) {
	    dispvar((int)curmod);
	    goto _L30;
	  }
	}
      }
    }
    disptoken();
_L30:
    getxnext();
  } while (curcmd == 79);
}


/*:1049*/
/*1050:*/

Static Void doshowdependencies()
{
  halfword p;

  p = mem[13].hh.rh;
  while (p != -29987) {
    if (interesting(p)) {
      printnl(155);
      printvariablename(p);
      if (mem[p + 30000].hh.UU.U2.b0 == 17)
	printchar(61);
      else
	print(632L);
      printdependency(mem[p + 30001].hh.rh, mem[p + 30000].hh.UU.U2.b0);
    }
    p = mem[p + 30001].hh.rh;
    while (mem[p + 30000].hh.UU.lh != -30000)
      p = mem[p + 30000].hh.rh;
    p = mem[p + 30000].hh.rh;
  }
  getxnext();
}


/*:1050*/
/*1051:*/

Static Void doshowwhatever()
{
  switch (curmod) {

  case 0:
    doshowtoken();
    break;

  case 1:
    doshowstats();
    break;

  case 2:
    doshow();
    break;

  case 3:
    doshowvar();
    break;

  case 4:
    doshowdependencies();
    break;
  }
  if (internal[31] <= 0)
    return;
  printnl(133);
  print(818L);
  if (interaction < 3) {
    helpptr = 0;
    errorcount--;
  } else {
    helpptr = 1;
    helpline[0] = 819;
  }
  if (curcmd == 80)
    error();
  else
    putgeterror();
}

<stdin>, line 16424: Warning: Symbol 'ABS' is not defined [221]


/*:1051*/
/*1054:*/

Static boolean scanwith()
{
  smallnumber t;
  boolean result;

  t = curmod;
  curtype = 1;
  getxnext();
  scanexpression();
  result = false;
  if (curtype != t) {  /*1055:*/
    disperr(-30000, 827);
    helpptr = 2;
    helpline[1] = 828;
    helpline[0] = 829;
    if (t == 6)
      helpline[1] = 830;
    putgetflusherror(0L);
    return result;
  }
  if (curtype == 6) {   /*:1055*/
    result = true;   /*1056:*/
    return result;
  }
  curexp = roundunscaled(curexp);
  if (abs(curexp) < 4 && curexp != 0) {
/* p2c: <stdin>, line 16424: Warning: Symbol 'ABS' is not defined [221] */
    result = true;
    return result;
  }
  printnl(133);
  print(831L);
  helpptr = 1;
  helpline[0] = 829;
  putgetflusherror(0L);
  return result;

  /*:1056*/
}


/*:1054*/
/*1057:*/

Static Void findedgesvar(t)
halfword t;
{
  halfword p;

  p = findvariable(t);
  curedges = -30000;
  if (p == -30000) {
    obliterated(t);
    putgeterror();
  } else if (mem[p + 30000].hh.UU.U2.b0 != 11) {
    printnl(133);
    print(654L);
    showtokenlist((long)t, -30000L, 1000L, 0L);
    print(832L);
    printtype(mem[p + 30000].hh.UU.U2.b0);
    printchar(41);
    helpptr = 2;
    helpline[1] = 833;
    helpline[0] = 834;
    putgeterror();
  } else
    curedges = mem[p + 30001].int_;
  flushnodelist(t);
}


/*:1057*/
/*1059:*/

Static Void doaddto()
{
  halfword lhs, rhs;
  long w;
  halfword p, q;

  getxnext();
  varflag = 68;
  scanprimary();
  if (curtype != 20) {  /*1060:*/
    disperr(-30000, 835);
    helpptr = 4;
    helpline[3] = 836;
    helpline[2] = 837;
    helpline[1] = 838;
    helpline[0] = 834;
    putgetflusherror(0L);
    return;
  }
  lhs = curexp;
  curpathtype = curmod;
  curtype = 1;
  getxnext();
  scanexpression();
  if (curpathtype == 2) {  /*1061:*/
    findedgesvar(lhs);
    if (curedges == -30000) {
      flushcurexp(0L);
      return;
    }
    if (curtype == 11) {
      mergeedges((int)curexp);
      flushcurexp(0L);
      return;
    }
    disperr(-30000, 839);
    helpptr = 2;
    helpline[1] = 840;
    helpline[0] = 834;
    putgetflusherror(0L);
    return;
  }
  if (curtype == 14)
    pairtopath();
  if (curtype != 9) {
    disperr(-30000, 839);
    helpptr = 2;
    helpline[1] = 841;
    helpline[0] = 834;
    putgetflusherror(0L);
    flushtokenlist(lhs);
    return;
  }
  rhs = curexp;
  w = 1;
  curpen = -29997;
  /*
  1063:*/
  while (curcmd == 66) {   /*1064:*/
    if (!scanwith())
      continue;
    if (curtype == 16)
      w = curexp;
    else {   /*:1063*/
      if (mem[curpen + 30000].hh.UU.lh == -30000)
	tosspen(curpen);
      else
	mem[curpen + 30000].hh.UU.lh--;
      curpen = curexp;
    }
  }
  findedgesvar(lhs);
  if (curedges == -30000)
    tossknotlist(rhs);
  else {
    lhs = -30000;
    if (mem[rhs + 30000].hh.UU.U2.b0 == 0) {
      if (curpathtype != 0) {   /*1065:*/
	printnl(133);
	print(842L);
	helpptr = 2;
	helpline[1] = 843;
	helpline[0] = 834;
	putgeterror();
	tossknotlist(rhs);
	goto _L45;
      }
      if (mem[rhs + 30000].hh.rh == rhs) {  /*1066:*/
	mem[rhs + 30005].int_ = mem[rhs + 30001].int_;
	mem[rhs + 30006].int_ = mem[rhs + 30002].int_;
	mem[rhs + 30003].int_ = mem[rhs + 30001].int_;
	mem[rhs + 30004].int_ = mem[rhs + 30002].int_;
	mem[rhs + 30000].hh.UU.U2.b0 = 1;
	mem[rhs + 30000].hh.UU.U2.b1 = 1;
      } else   /*:1065*/
      {  /*:1066*/
	p = htapypoc(rhs);
	q = mem[p + 30000].hh.rh;
	mem[pathtail + 30005].int_ = mem[q + 30005].int_;
	mem[pathtail + 30006].int_ = mem[q + 30006].int_;
	mem[pathtail + 30000].hh.UU.U2.b1 = mem[q + 30000].hh.UU.U2.b1;
	mem[pathtail + 30000].hh.rh = mem[q + 30000].hh.rh;
	freenode(q, 7);
	mem[p + 30005].int_ = mem[rhs + 30005].int_;
	mem[p + 30006].int_ = mem[rhs + 30006].int_;
	mem[p + 30000].hh.UU.U2.b1 = mem[rhs + 30000].hh.UU.U2.b1;
	mem[p + 30000].hh.rh = mem[rhs + 30000].hh.rh;
	freenode(rhs, 7);
	rhs = p;
      }
    } else if (curpathtype == 0)
      lhs = htapypoc(rhs);
    curwt = w;
    rhs = makespec(rhs, mem[curpen + 30009].int_, internal[4]);   /*1068:*/
    if (turningnumber <= 0) {
      if (curpathtype != 0) {
	if (internal[38] > 0) {
	  if (turningnumber < 0 && mem[curpen + 30000].hh.rh == -30000)
	    curwt = -curwt;
	  else {
	    if (turningnumber == 0) {
	      if (internal[38] <= 65536L &&
		  mem[curpen + 30000].hh.rh == -30000)
		goto _L30;
	      printstrange(844);
	    } else
	      printstrange(845);
	    helpptr = 3;
	    helpline[2] = 846;
	    helpline[1] = 847;
	    helpline[0] = 848;
	    putgeterror();
	  }
	}
      }
    }
_L30:   , tfmcheck, doshipout, dodisplay, getpair, doopenwindow, docull, domessage, getcode,
settag, dotfmcommand/*:1068*/
    if (mem[curpen + 30009].int_ == 0)
      fillspec(rhs);
    else
      fillenvelope(rhs);
    if (lhs != -30000) {
      revturns = true;
      lhs = makespec(lhs, mem[curpen + 30009].int_, internal[4]);
      revturns = false;
      if (mem[curpen + 30009].int_ == 0)
	fillspec(lhs);
      else
	fillenvelope(lhs);
    }
_L45: ;   /*:1064*/

  }
  if (mem[curpen + 30000].hh.UU.lh == -30000)
    tosspen(curpen);
  else
    mem[curpen + 30000].hh.UU.lh--;

  /*:1060*/
  /*:1061*/
  /*1062:*/
  /*1067:*/
  /*:1067*/
  /*:1062*/
}

<stdin>, line 16647: Warning: Symbol 'ABS' is not defined [221]


/*:1059*/
/*1070:*/
/*1098:*/

Static long tfmcheck(m)
smallnumber m;
{
  if (abs(internal[m - 1]) >= 134217728L) {
    printnl(133);
    print(865L);
    print((long)intname[m - 1]);
    print(866L);
    helpptr = 1;
    helpline[0] = 867;
    putgeterror();
    if (internal[m - 1] > 0)
      return 134217727L;
    else
      return -134217727L;
  } else
    return (internal[m - 1]);

/* p2c: <stdin>, line 16647: Warning: Symbol 'ABS' is not defined [221] */
}  /*:1098*/


Static Void doshipout()
{
  long c;

  getxnext();
  varflag = 80;
  scanexpression();
  /*1060:
  */
  if (curtype != 20) {
    if (curtype != 11) {
      disperr(-30000, 835);
      helpptr = 4;
      helpline[3] = 836;
      helpline[2] = 837;
      helpline[1] = 838;
      helpline[0] = 834;
      putgetflusherror(0L);   /*:1060*/
      goto _L10;
    }
    curedges = curexp;
  } else {
    findedgesvar((int)curexp);
    curtype = 1;
  }
  if (curedges != -30000) {
    c = roundunscaled(internal[17]) & 255;
    if (c < 0)   /*1099:*/
      c += 256;
    if (c < bc)
      bc = c;
    if (c > ec)
      ec = c;
    charexists[c] = true;
    gfdx[c] = internal[23];
    gfdy[c] = internal[24];
    tfmwidth[c] = tfmcheck(20);
    tfmheight[c] = tfmcheck(21);
    tfmdepth[c] = tfmcheck(22);
    tfmitalcorr[c] = tfmcheck(23);   /*:1099*/
    if (internal[33] >= 0)
      shipout((int)c);
  }
  flushcurexp(0L);
_L10: ;

}  /*:1070*/


/*1071:*/

Static Void dodisplay()
{
  halfword e;

  getxnext();
  varflag = 73;
  scanprimary();
  if (curtype != 20) {  /*1060:*/
    disperr(-30000, 835);
    helpptr = 4;
    helpline[3] = 836;
    helpline[2] = 837;
    helpline[1] = 838;
    helpline[0] = 834;
    putgetflusherror(0L);
  } else {  /*:1060*/
    e = curexp;
    curtype = 1;
    getxnext();
    scanexpression();
    if (curtype != 16)
      goto _L50;
    curexp = roundunscaled(curexp);
    if (curexp < 0)
      goto _L45;
    if (curexp > 15)
      goto _L45;
    if (!windowopen[curexp])
      goto _L45;
    findedgesvar(e);
    if (curedges != -30000)
      dispedges((int)curexp);
    goto _L10;
_L45:
    curexp *= 65536L;
_L50:
    disperr(-30000, 849);
    helpptr = 1;
    helpline[0] = 850;
    putgetflusherror(0L);
    flushtokenlist(e);
  }
_L10: ;

}  /* dodisplay */


/*:1071*/
/*1072:*/

Static boolean getpair(c)
commandcode c;
{
  halfword p;
  boolean b;

  if (curcmd != c)
    return false;
  else {
    getxnext();
    scanexpression();
    if (nicepair(curexp, curtype)) {
      p = mem[curexp + 30001].int_;
      curx = mem[p + 30001].int_;
      cury = mem[p + 30003].int_;
      b = true;
    } else
      b = false;
    flushcurexp(0L);
    return b;
  }
}


/*:1072*/
/*1073:*/

Static Void doopenwindow()
{
  long k;
  scaled r0, c0, r1, c1;

  getxnext();
  scanexpression();
  if (curtype != 16)
    goto _L45;
  k = roundunscaled(curexp);
  if (k < 0)
    goto _L45;
  if (k > 15)
    goto _L45;
  if (!getpair(70))
    goto _L45;
  r0 = curx;
  c0 = cury;
  if (!getpair(71))
    goto _L45;
  r1 = curx;
  c1 = cury;
  if (!getpair(72))
    goto _L45;
  openawindow((int)k, r0, c0, r1, c1, curx, cury);
  goto _L10;
_L45:
  printnl(133);
  print(851L);
  helpptr = 2;
  helpline[1] = 852;
  helpline[0] = 853;
  putgeterror();
_L10: ;

}


/*:1073*/
/*1074:*/

Static Void docull()
{
  halfword e;
  char keeping;
  long w, win, wout;

  w = 1;
  getxnext();
  varflag = 67;
  scanprimary();
  if (curtype != 20) {  /*1060:*/
    disperr(-30000, 835);
    helpptr = 4;
    helpline[3] = 836;
    helpline[2] = 837;
    helpline[1] = 838;
    helpline[0] = 834;
    putgetflusherror(0L);
  } else {  /*:1060*/
    e = curexp;
    curtype = 1;
    keeping = curmod;
    if (!getpair(67))
      goto _L45;
    while (curcmd == 66 && curmod == 16) {   /*1075:*/
      if (scanwith())
	w = curexp;
    }
    if (curx > cury)
      goto _L45;
    if (keeping == 0) {
      if (curx > 0 || cury < 0)
	goto _L45;
      wout = w;
      win = 0;
    } else {   /*:1075*/
      if (curx <= 0 && cury >= 0)
	goto _L45;
      wout = 0;
      win = w;
    }
    findedgesvar(e);
    if (curedges != -30000)
      culledges(floorunscaled(curx + 65535L), floorunscaled(cury), wout, win);
    goto _L10;
_L45:
    printnl(133);
    print(854L);
    helpptr = 1;
    helpline[0] = 855;
    putgeterror();
    flushtokenlist(e);
  }
_L10: ;

}


/*:1074*/
/*1082:*/

Static Void domessage()
{
  char m;

  m = curmod;
  getxnext();
  scanexpression();
  if (curtype != 4) {
    disperr(-30000, 565);
    helpptr = 1;
    helpline[0] = 859;
    putgeterror();
  } else {
    switch (m) {   /*:1083*/

    case 0:
      printnl(155);
      slowprint(curexp);
      break;

    case 1:  /*1086:*/
      printnl(133);
      print(155L);
      slowprint(curexp);
      if (errhelp != 0)
	useerrhelp = true;
      else if (longhelpseen) {
	helpptr = 1;
	helpline[0] = 860;
      } else {
	if (interaction < 3)
	  longhelpseen = true;
	helpptr = 4;
	helpline[3] = 861;
	helpline[2] = 862;
	helpline[1] = 863;
	helpline[0] = 864;
      }
      putgeterror();
      useerrhelp = false;
      break;
      /*:1086*/

    case 2:  /*1083:*/
      if (errhelp != 0) {
	if (strref[errhelp] < 127) {
	  if (strref[errhelp] > 1)
	    strref[errhelp]--;
	  else
	    flushstring(errhelp);
	}
      }
      if (strstart[curexp + 1] - strstart[curexp] == 0)
	errhelp = 0;
      else {
	errhelp = curexp;
	if (strref[errhelp] < 127)
	  strref[errhelp]++;
      }
      break;
    }
  }
  flushcurexp(0L);
}


/*:1082*/
/*1103:*/

Static eightbits getcode()
{
  long c;

  getxnext();
  scanexpression();
  if (curtype == 16) {
    c = roundunscaled(curexp);
    if (c >= 0) {
      if (c < 256)
	goto _L40;
    }
  } else if (curtype == 4) {
    if (strstart[curexp + 1] - strstart[curexp] == 1) {
      c = strpool[strstart[curexp]];
      goto _L40;
    }
  }
  disperr(-30000, 873);
  helpptr = 2;
  helpline[1] = 874;
  helpline[0] = 875;
  putgetflusherror(0L);
  c = 0;
_L40:
  return c;
}


/*:1103*/
/*1104:*/

Static Void settag(c, t, r)
eightbits c;
smallnumber t;
eightbits r;
{
  if (chartag[c] == 0) {
    chartag[c] = t;
    charremainder[c] = r;
    return;
  }
  printnl(133);
  print(876L);
  if (c > 32 && c < 128)
    print((long)c);
  else {
    print(877L);
    printint((long)c);
  }
  print(878L);
  switch (chartag[c]) {

  case 1:
    print(879L);
    break;

  case 2:
    print(880L);
    break;

  case 3:
    print(870L);
    break;
  }
  helpptr = 2;
  helpline[1] = 881;
  helpline[0] = 834;
  putgeterror();

  /*1105:*/
  /*:1105*/
}


/*:1104*/
/*1106:*/

Static Void dotfmcommand()
{
  eightbits c, cc;
  short k;
  long j;

  switch (curmod) {

  case 0:  /*1107:*/
    c = getcode();
    while (curcmd == 78) {
      cc = getcode();
      settag(c, 2, cc);
      c = cc;
    }
    break;
    /*:1107*/

  case 1:  /*1108:*/
_L22:
    c = getcode();
    if (curcmd == 78)   /*:1111*/
    {  /*1111:*/
      if (nl < 256)
	settag(c, 1, nl);
      else {
	printnl(133);
	print(891L);
	helpptr = 1;
	helpline[0] = 892;
	error();
      }
      goto _L22;
    }
    if (curcmd == 76) {  /*1112:*/
      ligkern[nl].b1 = c - 128;
      ligkern[nl].b2 = curmod - 128;
      ligkern[nl].b0 = -128;
      if (curmod == 0)
	ligkern[nl].b3 = getcode() - 128;
      else {   /*:1112*/
	getxnext();
	scanexpression();
	if (curtype != 16) {
	  disperr(-30000, 893);
	  helpptr = 2;
	  helpline[1] = 894;
	  helpline[0] = 179;
	  putgetflusherror(0L);
	}
	kern[nk] = curexp;
	k = 0;
	while (kern[k] != curexp)
	  k++;
	if (k == nk) {
	  if (nk == 256)
	    overf, dospecial, dostatementlow(890, 256L);
	  nk++;
	}
	ligkern[nl].b3 = k - 128;
      }
      if (nl == ligtablesize)
	overflow(886, (long)ligtablesize);
      nl++;
      if (curcmd == 79)
	goto _L22;
    } else {
      printnl(133);
      print(887L);
      helpptr = 1;
      helpline[0] = 888;
      backerror();
    }
    if (nl > 0)
      ligkern[nl - 1].b0 = 0;
    break;
    /*:1108*/

  case 2:  /*1113:*/
    if (ne == 256)
      overflow(870, 256L);
    c = getcode();
    settag(c, 3, ne);
    if (curcmd != 78) {
      missingerr(58);
      helpptr = 1;
      helpline[0] = 895;
      backerror();
    }
    exten[ne].b0 = getcode() - 128;
    if (curcmd != 79) {
      missingerr(44);
      helpptr = 1;
      helpline[0] = 895;
      backerror();
    }
    exten[ne].b1 = getcode() - 128;
    if (curcmd != 79) {
      missingerr(44);
      helpptr = 1;
      helpline[0] = 895;
      backerror();
    }
    exten[ne].b2 = getcode() - 128;
    if (curcmd != 79) {
      missingerr(44);
      helpptr = 1;
      helpline[0] = 895;
      backerror();
    }
    exten[ne].b3 = getcode() - 128;
    ne++;
    break;
    /*:1113*/

  case 3:
  case 4:
    c = curmod;
    getxnext();
    scanexpression();
    if (curtype != 16 || curexp < 32768L) {
      disperr(-30000, 882);
      helpptr = 2;
      helpline[1] = 883;
      helpline[0] = 884;
      putgeterror();
    } else {
      j = roundunscaled(curexp);
      if (curcmd != 78) {
	missingerr(58);
	helpptr = 1;
	helpline[0] = 885;
	backerror();
      }
      if (c == 3) {   /*1114:*/
	do {
	  if (j > headersize)
	    overflow(871, (long)headersize);
	  headerbyte[j - 1] = getcode();
	  j++;   /*:1114*/
	  /*1115:*/
	} while (curcmd == 79);
      } else {
	do {
	  if (j > maxfontdimen)
	    overflow(872, (long)maxfontdimen);
	  while (j > np) {
	    np++;
	    param[np - 1] = 0;
	  }
	  getxnext();
	  scanexpression();
	  if (curtype != 16) {
	    disperr(-30000, 896);
	    helpptr = 1;
	    helpline[0] = 179;
	    putgetflusherror(0L);
	  }
	  param[j - 1] = curexp;
	  j++;   /*:1115*/
	} while (curcmd == 79);
      }
    }
    break;
  }
}


/*:1106*/
/*1177:*/

Static Void dospecial()
{
  smallnumber m;

  m = curmod;
  getxnext();
  scanexpression();
  if (internal[33] >= 0) {
    if (curtype != m) {  /*1178:*/
      disperr(-30000, 914);
      helpptr = 1;
      helpline[0] = 915;
      putgeterror();
    } else {  /*:1178*/
      if (outputfilename == 0)
	initgf();
      if (m == 4)
	gfstring((int)curexp, 0);
      else {
	gfbuf[gfptr] = 243;
	gfptr++;
	if (gfptr == gflimit)
	  gfswap();
	gffour(curexp);
      }
    }
  }
  flushcurexp(0L);
}

<stdin>, line 17375: Warning: Symbol 'FLUSH' is not defined [221]


/*:1177*/
/*1186:*/
/*procedure storebasefile;var k:integer;
p,q:halfword;x:integer;w:fourquarters;begin[1200:]selector:=5;
print(925);print(jobname);printchar(32);
printint(roundunscaled(internal[14])mod 100);printchar(46);
printint(roundunscaled(internal[15]));printchar(46);
printint(roundunscaled(internal[16]));printchar(41);
if interaction=0 then selector:=2 else selector:=3;
begin if poolptr+1>maxpoolptr then begin if poolptr+1>poolsize then
overflow(129,poolsize-initpoolptr);maxpoolptr:=poolptr+1;end;end;
baseident:=makestring;strref[baseident]:=127;packjobname(926);
while not wopenout(basefile)do promptfilename(927,926);printnl(928);
print(wmakenamestring(basefile));flushstring(strptr-1);
printnl(baseident)[:1200];[1190:]begin basefile^.int:=503742536;
put(basefile);end;begin basefile^.int:=-30000;put(basefile);end;
begin basefile^.int:=30000;put(basefile);end;begin basefile^.int:=2100;
put(basefile);end;begin basefile^.int:=1777;put(basefile);end;
begin basefile^.int:=6;put(basefile);end[:1190];
[1192:]begin basefile^.int:=poolptr;put(basefile);end;
begin basefile^.int:=strptr;put(basefile);end;
for k:=0 to strptr do begin basefile^.int:=strstart[k];put(basefile);
end;k:=0;while k+4<poolptr do begin w.b0:=strpool[k];w.b1:=strpool[k+1];
w.b2:=strpool[k+2];w.b3:=strpool[k+3];begin basefile^.qqqq:=w;
put(basefile);end;k:=k+4;end;k:=poolptr-4;w.b0:=strpool[k];
w.b1:=strpool[k+1];w.b2:=strpool[k+2];w.b3:=strpool[k+3];
begin basefile^.qqqq:=w;put(basefile);end;println;printint(strptr);
print(922);printint(poolptr)[:1192];[1194:]sortavail;varused:=0;
begin basefile^.int:=lomemmax;put(basefile);end;
begin basefile^.int:=rover;put(basefile);end;p:=-30000;q:=rover;x:=0;
repeat for k:=p to q+1 do begin basefile^:=mem[k];put(basefile);end;
x:=x+q+2-p;varused:=varused+q-p;p:=q+mem[q].hh.lh;q:=mem[q+1].hh.rh;
until q=rover;varused:=varused+lomemmax-p;dynused:=memend+1-himemmin;
for k:=p to lomemmax do begin basefile^:=mem[k];put(basefile);end;
x:=x+lomemmax+1-p;begin basefile^.int:=himemmin;put(basefile);end;
begin basefile^.int:=avail;put(basefile);end;
for k:=himemmin to memend do begin basefile^:=mem[k];put(basefile);end;
x:=x+memend+1-himemmin;p:=avail;
while p<>-30000 do begin dynused:=dynused-1;p:=mem[p].hh.rh;end;
begin basefile^.int:=varused;put(basefile);end;
begin basefile^.int:=dynused;put(basefile);end;println;printint(x);
print(923);printint(varused);printchar(38);printint(dynused)[:1194];
[1196:]begin basefile^.int:=hashused;put(basefile);end;
stcount:=2228-hashused;
for p:=1 to hashused do if hash[p].rh<>0 then begin begin basefile^.int
:=p;put(basefile);end;begin basefile^.hh:=hash[p];put(basefile);end;
begin basefile^.hh:=eqtb[p];put(basefile);end;stcount:=stcount+1;end;
for p:=hashused+1 to 2241 do begin begin basefile^.hh:=hash[p];
put(basefile);end;begin basefile^.hh:=eqtb[p];put(basefile);end;end;
begin basefile^.int:=stcount;put(basefile);end;println;
printint(stcount);print(924)[:1196];[1198:]begin basefile^.int:=intptr;
put(basefile);end;
for k:=1 to intptr do begin begin basefile^.int:=internal[k];
put(basefile);end;begin basefile^.int:=intname[k];put(basefile);end;end;
begin basefile^.int:=startsym;put(basefile);end;
begin basefile^.int:=interaction;put(basefile);end;
begin basefile^.int:=baseident;put(basefile);end;
begin basefile^.int:=bgloc;put(basefile);end;begin basefile^.int:=egloc;
put(basefile);end;begin basefile^.int:=serialno;put(basefile);end;
begin basefile^.int:=69069;put(basefile);end;internal[12]:=0[:1198];
[1201:]wclose(basefile)[:1201];end;*/
/*:1186*/

Static Void dostatement()
{
  curtype = 1;
  getxnext();
  if (curcmd > 43) {  /*990:*/
    if (curcmd < 80) {
      printnl(133);
      print(733L);
      printcmdmod((long)curcmd, curmod);
      printchar(39);
      helpptr = 5;
      helpline[4] = 734;
      helpline[3] = 735;
      helpline[2] = 736;
      helpline[1] = 737;
      helpline[0] = 738;
      backerror();
      getxnext();
    }
  } else if (curcmd > 30) {
    varflag = 77;
    scanexpression();
    if (curcmd < 81) {
      if (curcmd == 51)
	doequation();
      else if (curcmd == 77)
	doassignment();
      else if (curtype == 4) {
	if (internal[0] > 0) {
	  printnl(155);
	  slowprint(curexp);
	  /*---------------------*/
	  auxprintnl(155);
	  auxslowprint(curexp);
	  /*---------------------*/
	  flush(stdout);
/* p2c: <stdin>, line 17375: Warning: Symbol 'FLUSH' is not defined [221] */
	}
	if (internal[33] > 0) {  /*1179:*/
	  if (outputfilename == 0)
	    initgf();
	  gfstring(916, (int)curexp);
	}  /*:1179*/
      } else if (curtype != 1) {
	disperr(-30000, 743);
	helpptr = 3;
	helpline[2] = 744;
	helpline[1] = 745;
	helpline[0] = 746;
	putgeterror();
      }
      flushcurexp(0L);
      curtype = 1;
    }
  } else {
    if (internal[6] > 0)
      showcmdmod((long)curcmd, curmod);
    switch (curcmd) {   /*:1175*/

    case 30:
      dotypedeclaration();
      break;

    case 16:   /*1020:*/
      if (curmod > 2)
	makeopdef();
      else if (curmod > 0)
	scandef();
      break;

    case 24:   /*:1020*/
      dorandomseed();
      break;
      /*1023:*/

    case 23:   /*:1023*/
      println();
      interaction = curmod;   /*70:*/
      if (interaction == 0)
	selector = 0;
      else
	selector = 1;   /*:70*/
      if (jobname != 0)
	selector += 2;
      getxnext();
      break;
      /*1026:*/

    case 21:   /*:1026*/
      doprotection();
      break;
      /*1030:*/

    case 27:   /*:1030*/
      defdelims();
      break;
      /*1033:*/

  , maincontrol, sortin, mincover, threshold, skimp, tfmwarning, fixdesignsize,
dimenout, fixchecksum, tfmqqqq, openbasefile, loadbasefile  case 12:
      do {
	getsymbol();
	savevariable(cursym);
	getxnext();
      } while (curcmd == 79);
      break;

    case 13:
      dointerim();
      break;

    case 14:
      dolet();
      break;

    case 15:   /*:1033*/
      donewinternal();
      break;
      /*1039:*/

    case 22:
      doshowwhatever();
      break;

    /*:1039*/
    /*1058:*/
    case 18:   /*:1058*/
      doaddto();
      break;
      /*1069:*/

    case 17:
      doshipout();
      break;

    case 11:
      dodisplay();
      break;

    case 28:
      doopenwindow();
      break;

    case 19:   /*:1069*/
      docull();
      break;
      /*1076:*/

    case 26:   /*:1076*/
      getsymbol();
      startsym = cursym;
      getxnext();
      break;
      /*1081:*/

    case 25:   /*:1081*/
      domessage();
      break;
      /*1100:*/

    case 20:   /*:1100*/
      dotfmcommand();
      break;
      /*1175:*/

    case 29:
      dospecial();
      break;
    }
    curtype = 1;
  }
  if (curcmd < 80)   /*:991*/
  {  /*991:*/
    printnl(133);
    print(739L);
    helpptr = 6;
    helpline[5] = 740;
    helpline[4] = 741;
    helpline[3] = 742;
    helpline[2] = 736;
    helpline[1] = 737;
    helpline[0] = 738;
    backerror();
    scannerstatus = 2;
    do {
      getnext();   /*743:*/
      if (curcmd == 39) {
	if (strref[curmod] < 127) {
	  if (strref[curmod] > 1)
	    strref[curmod]--;
	  else
	    flushstring((int)curmod);
	}
      }  /*:743*/
    } while (curcmd <= 79);
    scannerstatus = 0;
  }
  errorcount = 0;

  /*:990*/
  /*993:*/
  /*994:*/
  /*:994*/
  /*:993*/
  /*992:*/
  /*:992*/
}  /*:989*/


/*1017:*/

Static Void maincontrol()
{
  do {
    dostatement();
    if (curcmd == 81) {
      printnl(133);
      print(774L);
      helpptr = 2;
      helpline[1] = 775;
      helpline[0] = 555;
      flusherror(0L);
    }
  } while (curcmd != 82);
}


/*:1017*/
/*1117:*/

Static halfword sortin(v)
long v;
{
  halfword p, q, r;

  p = 29999;
  while (true) {
    q = mem[p + 30000].hh.rh;
    if (v <= mem[q + 30001].int_)
      goto _L40;
    p = q;
  }
_L40:
  if (v >= mem[q + 30001].int_)
    return (mem[p + 30000].hh.rh);
  r = getnode(2L);
  mem[r + 30001].int_ = v;
  mem[r + 30000].hh.rh = q;
  mem[p + 30000].hh.rh = r;
  return (mem[p + 30000].hh.rh);
}  /*:1117*/


/*1118:*/

Static long mincover(d)
long d;
{
  halfword p;
  scaled l;
  long m;

  m = 0;
  p = mem[59999].hh.rh;
  perturbation = 2147483647L;
  while (p != -29981) {
    m++;
    l = mem[p + 30001].int_;
    do {
      p = mem[p + 30000].hh.rh;
    } while (mem[p + 30001].int_ <= l + d);
    if (mem[p + 30001].int_ - l < perturbation)
      perturbation = mem[p + 30001].int_ - l;
  }
  return m;
}


/*:1118*/
/*1120:*/

Static long threshold(m)
long m;
{
  scaled d;

  if (mincover(0L) <= m)
    return 0;
  else {
    do {
      d = perturbation;
    } while (mincover(d + d) > m);
    while (mincover(d) > m)
      d = perturbation;
    return d;
  }
}  /*:1120*/


/*1121:*/

Static long skimp(m)
long m;
{
  scaled d, l, v;
  halfword p, q, r;

  d = threshold(m);
  perturbation = 0;
  q = 29999;
  m = 0;
  p = mem[59999].hh.rh;
  while (p != -29981) {
    m++;
    l = mem[p + 30001].int_;
    mem[p + 30000].hh.UU.lh = m;
    if (mem[mem[p + 30000].hh.rh + 30001].int_ <= l + d)   /*:1122*/
    {  /*1122:*/
      do {
	p = mem[p + 30000].hh.rh;
	mem[p + 30000].hh.UU.lh = m;
      } while (mem[mem[p + 30000].hh.rh + 30001].int_ <= l + d);
      v = (l + mem[p + 30001].int_) / 2;
      if (mem[p + 30001].int_ - v > perturbation)
	perturbation = mem[p + 30001].int_ - v;
      r = q;
      do {
	r = mem[r + 30000].hh.rh;
	mem[r + 30001].int_ = v;
      } while (r != p);
      mem[q + 30000].hh.rh = p;
    }
    q = p;
    p = mem[p + 30000].hh.rh;
  }
  return m;
}


/*:1121*/
/*1123:*/

Static Void tfmwarning(m)
smallnumber m;
{
  printnl(897);
  print((long)intname[m - 1]);
  print(898L);
  printscaled(perturbation);
  print(899L);
}  /* tfmwarning */


/*:1123*/
/*1128:*/

Static Void fixdesignsize()
{
  scaled d;

  d = internal[25];
  if (d < 65536L || d >= 134217728L) {
    if (d != 0)
      printnl(900);
    d = 8388608L;
    internal[25] = d;
  }
  if (headerbyte[4] < 0) {
    if (headerbyte[5] < 0) {
      if (headerbyte[6] < 0) {
	if (headerbyte[7] < 0) {
	  headerbyte[4] = d / 1048576L;
	  headerbyte[5] = (d / 4096) & 255;
	  headerbyte[6] = (d / 16) & 255;
	  headerbyte[7] = (d & 15) * 16;
	}
      }
    }
  }
  maxtfmdimen = internal[25] * 16 - internal[25] / 2097152L;
  if (maxtfmdimen >= 134217728L)
    maxtfmdimen = 134217727L;
}

<stdin>, line 17656: Warning: Symbol 'ABS' is not defined [221]


/*:1128*/
/*1129:*/

Static long dimenout(x)
long x;
{
  if (abs(x) <= maxtfmdimen) {
    x = makescaled(x * 16, internal[25]);
    return x;
  }
/* p2c: <stdin>, line 17656: Warning: Symbol 'ABS' is not defined [221] */
  tfmchanged++;
  if (x > 0)
    x = 16777215L;
  else
    x = -16777215L;
  return x;
}

<stdin>, line 17687: Note: Using % for possibly-negative arguments [317]
<stdin>, line 17688: Note: Using % for possibly-negative arguments [317]
<stdin>, line 17689: Note: Using % for possibly-negative arguments [317]
<stdin>, line 17691: Note: Using % for possibly-negative arguments [317]


/*:1129*/
/*1131:*/

Static Void fixchecksum()
{
  eightbits k, b1, b2, b3, b4;
  long x;
  eightbits FORLIM;

  if (headerbyte[0] < 0) {
    if (headerbyte[1] < 0) {
      if (headerbyte[2] < 0) {
	if (headerbyte[3] < 0) {  /*1132:*/
	  b1 = bc;
	  b2 = ec;
	  b3 = bc;
	  b4 = ec;
	  tfmchanged = 0;
	  FORLIM = ec;
	  for (k = bc; k <= FORLIM; k++) {
	    if (charexists[k]) {   /*:1132*/
	      x = dimenout(mem[tfmwidth[k] + 30001].int_) + (k + 4) * 4194304L;
	      b1 = (b1 + b1 + x) % 255;
/* p2c: <stdin>, line 17687:
 * Note: Using % for possibly-negative arguments [317] */
	      b2 = (b2 + b2 + x) % 253;
/* p2c: <stdin>, line 17688:
 * Note: Using % for possibly-negative arguments [317] */
	      b3 = (b3 + b3 + x) % 251;
/* p2c: <stdin>, line 17689:
 * Note: Using % for possibly-negative arguments [317] */
	      b4 = (b4 + b4 + x) % 247;
/* p2c: <stdin>, line 17691:
 * Note: Using % for possibly-negative arguments [317] */
	    }
	  }
	  headerbyte[0] = b1;
	  headerbyte[1] = b2;
	  headerbyte[2] = b3;
	  headerbyte[3] = b4;
	  goto _L10;
	}
      }
    }
  }
  for (k = 0; k <= 3; k++) {
    if (headerbyte[k] < 0)
      headerbyte[k] = 0;
  }
_L10: ;

}  /*:1131*/


/*1133:*/

Static Void tfmqqqq(x)
fourquarters x;
{
  bwritebyte(&tfmfile, x.b0 + 128L);
  bwritebyte(&tfmfile, x.b1 + 128L);
  bwritebyte(&tfmfile, x.b2 + 128L);
  bwritebyte(&tfmfile, x.b3 + 128L);
}  /*:1133*/

<stdin>, line 17732: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 17734: Warning: Symbol 'FLUSH' is not defined [221]
<stdin>, line 17737: Warning: Symbol 'WRITELN' is not defined [221]


/*1187:*/
/*779:*/

Static boolean openbasefile()
{
  boolean Result;
  short j;

  j = curinput.locfield;
  if (buffer[curinput.locfield] == 38) {
    curinput.locfield++;
    j = curinput.locfield;
    buffer[last] = 32;
    while (buffer[j] != 32)
      j++;
    packbufferedname(0, (long)curinput.locfield, j - 1L);
    if (wopenin(&basefile))
      goto _L40;
    writeln(stdout, "Sorry, I can't find that base;", " will try PLAIN.");
/* p2c: <stdin>, line 17732:
 * Warning: Symbol 'WRITELN' is not defined [221] */
    flush(stdout);
/* p2c: <stdin>, line 17734: Warning: Symbol 'FLUSH' is not defined [221] */
  }
  packbufferedname(5, 1L, 0L);
  if (!wopenin(&basefile)) {
    writeln(stdout, "I can't find the PLAIN base file!");
/* p2c: <stdin>, line 17737:
 * Warning: Symbol 'WRITELN' is not defined [221] */
    Result = false;
    goto _L10;
  }
_L40:
  curinput.locfield = j;
  Result = true;
_L10:

  return Result;
}  /*:779*/

<stdin>, line 17757: Note: Discovered too late that basefile should be buffered [143]
<stdin>, line 17761: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17767: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17773: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17779: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17785: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17793: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17799: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 17806: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17812: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 17820: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17833: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17844: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17853: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17863: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17876: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17885: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17890: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17900: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17910: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17914: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17918: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17923: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17935: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17944: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17948: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17954: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17958: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17963: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17968: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17978: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17983: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 17994: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18004: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18014: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18024: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18034: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18043: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18047: Warning: Symbol 'GET' is not defined [221]
<stdin>, line 18050: Warning: Symbol 'EOF' is not defined [221]
<stdin>, line 18056: Warning: Symbol 'WRITELN' is not defined [221]


Static boolean loadbasefile()
{
  boolean Result;
  long k;
  halfword p, q;
  long x;
  fourquarters w;   /*1191:*/
  long FORLIM;

  x = GETFBUF(basefile, memoryword).int_;
/* p2c: <stdin>, line 17757:
 * Note: Discovered too late that basefile should be buffered [143] */
  if (x != 503742536L)
    goto _L6666;
  get(basefile);
/* p2c: <stdin>, line 17761: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x != -30000)
    goto _L6666;
  get(basefile);
/* p2c: <stdin>, line 17767: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x != 30000)
    goto _L6666;
  get(basefile);
/* p2c: <stdin>, line 17773: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x != 2100)
    goto _L6666;
  get(basefile);
/* p2c: <stdin>, line 17779: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x != 1777)
    goto _L6666;
  get(basefile);
/* p2c: <stdin>, line 17785: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x != 6)
    goto _L6666;   /*:1191*/
  /*1193:*/
  get(basefile);
/* p2c: <stdin>, line 17793: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < 0)
    goto _L6666;
  if (x > poolsize) {
    writeln(stdout, "---! Must increase the ", "string pool size");
/* p2c: <stdin>, line 17799:
 * Warning: Symbol 'WRITELN' is not defined [221] */
    goto _L6666;
  }
  poolptr = x;
  get(basefile);
/* p2c: <stdin>, line 17806: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < 0)
    goto _L6666;
  if (x > maxstrings) {
    writeln(stdout, "---! Must increase the ", "max strings");
/* p2c: <stdin>, line 17812:
 * Warning: Symbol 'WRITELN' is not defined [221] */
    goto _L6666;
  }
  strptr = x;
  FORLIM = strptr;
  for (k = 0; k <= FORLIM; k++) {
    get(basefile);
/* p2c: <stdin>, line 17820: Warning: Symbol 'GET' is not defined [221] */
    x = GETFBUF(basefile, memoryword).int_;
    if ((unsigned long)x > poolptr)
      goto _L6666;
    strstart[k] = x;
    strref[k] = 127;
  }
  k = 0;
  while (k + 4 < poolptr) {
    get(basefile);
/* p2c: <stdin>, line 17833: Warning: Symbol 'GET' is not defined [221] */
    w = GETFBUF(basefile, memoryword).qqqq;
    strpool[k] = w.b0;
    strpool[k + 1] = w.b1;
    strpool[k + 2] = w.b2;
    strpool[k + 3] = w.b3;
    k += 4;
  }
  k = poolptr - 4;
  get(basefile);
/* p2c: <stdin>, line 17844: Warning: Symbol 'GET' is not defined [221] */
  w = GETFBUF(basefile, memoryword).qqqq;
  strpool[k] = w.b0;
  strpool[k + 1] = w.b1;
  strpool[k + 2] = w.b2;
  strpool[k + 3] = w.b3;   /*:1193*/
  /*1195:*/
  get(basefile);
/* p2c: <stdin>, line 17853: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < -28978 || x > 29997)
    goto _L6666;
  lomemmax = x;
  get(basefile);
/* p2c: <stdin>, line 17863: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < -29977 || x > lomemmax)
    goto _L6666;
  rover = x;
  p = -30000;
  q = rover;
  x = 0;
  do {
    for (k = p + 30000; k <= q + 30001; k++) {
      get(basefile);
/* p2c: <stdin>, line 17876: Warning: Symbol 'GET' is not defined [221] */
      mem[k] = GETFBUF(basefile, memoryword);
    }
    p = q + mem[q + 30000].hh.UU.lh;
    if (p > lomemmax ||
	q >= mem[q + 30001].hh.rh && mem[q + 30001].hh.rh != rover)
      goto _L6666;
    q = mem[q + 30001].hh.rh;
  } while (q != rover);
  FORLIM = lomemmax + 30000;
  for (k = p + 30000; k <= FORLIM; k++) {
    get(basefile);
/* p2c: <stdin>, line 17885: Warning: Symbol 'GET' is not defined [221] */
    mem[k] = GETFBUF(basefile, memoryword);
  }
  get(basefile);
/* p2c: <stdin>, line 17890: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x <= lomemmax || x > 29998)
    goto _L6666;
  himemmin = x;
  get(basefile);
/* p2c: <stdin>, line 17900: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < -30000 || x > 30000)
    goto _L6666;
  avail = x;
  memend = 30000;
  FORLIM = memend + 30000;
  for (k = himemmin + 30000; k <= FORLIM; k++) {
    get(basefile);
/* p2c: <stdin>, line 17910: Warning: Symbol 'GET' is not defined [221] */
    mem[k] = GETFBUF(basefile, memoryword);
  }
  get(basefile);
/* p2c: <stdin>, line 17914: Warning: Symbol 'GET' is not defined [221] */
  varused = GETFBUF(basefile, memoryword).int_;
  get(basefile);
/* p2c: <stdin>, line 17918: Warning: Symbol 'GET' is not defined [221] */
  dynused = GETFBUF(basefile, memoryword).int_;   /*:1195*/
  /*1197:*/
  get(basefile);
/* p2c: <stdin>, line 17923: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < 1 || x > 2229)
    goto _L6666;
  hashused = x;
  p = 0;
  do {
    get(basefile);
/* p2c: <stdin>, line 17935: Warning: Symbol 'GET' is not defined [221] */
    x = GETFBUF(basefile, memoryword).int_;
    if (x <= p || x > hashused)
      goto _L6666;
    p = x;
    get(basefile);
/* p2c: <stdin>, line 17944: Warning: Symbol 'GET' is not defined [221] */
    hash[p - 1] = GETFBUF(basefile, memoryword).hh;
    get(basefile);
/* p2c: <stdin>, line 17948: Warning: Symbol 'GET' is not defined [221] */
    eqtb[p - 1] = GETFBUF(basefile, memoryword).hh;
  } while (p != hashused);
  for (p = hashused; p <= 2240; p++) {
    get(basefile);
/* p2c: <stdin>, line 17954: Warning: Symbol 'GET' is not defined [221] */
    hash[p] = GETFBUF(basefile, memoryword).hh;
    get(basefile);
/* p2c: <stdin>, line 17958: Warning: Symbol 'GET' is not defined [221] */
    eqtb[p] = GETFBUF(basefile, memoryword).hh;
  }
  get(basefile);
/* p2c: <stdin>, line 17963: Warning: Symbol 'GET' is not defined [221] */
 , scanprimary stcount = GETFBUF(basefile, memoryword).int_;   /*:1197*/
  /*1199:*/
  get(basefile);
/* p2c: <stdin>, line 17968: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < 40 || x > maxinternal)
    goto _L6666;
  intptr = x;
  FORLIM = intptr;
  for (k = 0; k < FORLIM; k++) {
    get(basefile);
/* p2c: <stdin>, line 17978: Warning: Symbol 'GET' is not defined [221] */
    internal[k] = GETFBUF(basefile, memoryword).int_;
    get(basefile);
/* p2c: <stdin>, line 17983: Warning: Symbol 'GET' is not defined [221] */
    x = GETFBUF(basefile, memoryword).int_;
    if ((unsigned long)x > strptr)
      goto _L6666;
    intname[k] = x;
  }
  get(basefile);
/* p2c: <stdin>, line 17994: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if ((unsigned long)x > 2229)
    goto _L6666;
  startsym = x;
  get(basefile);
/* p2c: <stdin>, line 18004: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if ((unsigned long)x > 3)
    goto _L6666;
  interaction = x;
  get(basefile);
/* p2c: <stdin>, line 18014: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if ((unsigned long)x > strptr)
    goto _L6666;
  baseident = x;
  get(basefile);
/* p2c: <stdin>, line 18024: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < 1 || x > 2241)
    goto _L6666;
  bgloc = x;
  get(basefile);
/* p2c: <stdin>, line 18034: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if (x < 1 || x > 2241)
    goto _L6666;
  egloc = x;
  get(basefile);
/* p2c: <stdin>, line 18043: Warning: Symbol 'GET' is not defined [221] */
  serialno = GETFBUF(basefile, memoryword).int_;
  get(basefile);
/* p2c: <stdin>, line 18047: Warning: Symbol 'GET' is not defined [221] */
  x = GETFBUF(basefile, memoryword).int_;
  if ((x != 69069L) | eof(basefile)) {
/* p2c: <stdin>, line 18050: Warning: Symbol 'EOF' is not defined [221] */
    goto _L6666;   /*:1199*/
  }
  Result = true;
  goto _L10;
_L6666:
  writeln(stdout, "(Fatal base file error; I'm stymied)");
/* p2c: <stdin>, line 18056:
 * Warning: Symbol 'WRITELN' is not defined [221] */
  Result = false;
_L10:

  return Result;
}

<stdin>, line 18214: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 18214: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 18307: Note: Using % for possibly-negative arguments [317]


/*:1187*/
/*1202:*/
/*823:*/

Static Void scanprimary()
{
  halfword p, q, r;
  quarterword c;
  char myvarflag;
  halfword ldelim, rdelim;   /*831:*/
  long groupline;
  /*:831*/
  /*836:*/
  scaled num, denom;
  /*:836*/
  /*843:*/
  halfword prehead, posthead, tail;
  smallnumber tt;
  halfword t, macroref;   /*:843*/

  myvarflag = varflag;
  varflag = 0;
_L20:
  if (aritherror)   /*825:*/
    cleararith();
  /*if panicking then checkmem(false);*/
  if (interrupt != 0) {
    if (OKtointerrupt) {   /*:825*/
      backinput();
      if (interrupt != 0)
	pauseforinstructions();
      getxnext();
    }
  }
  if (curcmd != 30 && curcmd != 31 && curcmd != 41 && curcmd != 38 &&
      curcmd != 40 && curcmd != 35 && curcmd != 37 && curcmd != 43 &&
      curcmd != 36 && curcmd != 34 && curcmd != 33 && curcmd != 42 &&
      curcmd != 39 && curcmd != 32) {
    badexp(633);
    goto _L20;
  }
  switch (curcmd) {

  case 31:  /*826:*/
    ldelim = cursym;
    rdelim = curmod;
    getxnext();
    scanexpression();
    if (curcmd == 79 && curtype >= 16) {  /*830:*/
      p = getnode(2L);
      mem[p + 30000].hh.UU.U2.b0 = 14;
      mem[p + 30000].hh.UU.U2.b1 = 11;
      initbignode(p);
      q = mem[p + 30001].int_;
      stashin(q);
      getxnext();
      scanexpression();
      if (curtype < 16) {
	disperr(-30000, 639);
	helpptr = 4;
	helpline[3] = 640;
	helpline[2] = 641;
	helpline[1] = 642;
	helpline[0] = 643;
	putgetflusherror(0L);
      }
      stashin(q + 2);
      checkdelimiter(ldelim, rdelim);
      curtype = 14;
      curexp = p;
    } else  /*:830*/
      checkdelimiter(ldelim, rdelim);
    break;
    /*:826*/

  case 32:  /*832:*/
    groupline = line;
    if (internal[6] > 0)
      showcmdmod((long)curcmd, curmod);
    p = getavail();
    mem[p + 30000].hh.UU.lh = 0;
    mem[p + 30000].hh.rh = saveptr;
    saveptr = p;
    do {
      dostatement();
    } while (curcmd == 80);
    if (curcmd != 81) {
      printnl(133);
      print(644L);
      printint(groupline);
      print(645L);
      helpptr = 2;
      helpline[1] = 646;
      helpline[0] = 647;
      backerror();
      curcmd = 81;
    }
    unsave();
    if (internal[6] > 0)
      showcmdmod((long)curcmd, curmod);
    break;
    /*:832*/

  case 39:  /*833:*/
    curtype = 4;
    curexp = curmod;
    break;
    /*:833*/

  case 42:  /*837:*/
    curexp = curmod;
    curtype = 16;
    getxnext();
    if (curcmd != 54) {
      num = 0;
      denom = 0;
    } else {
      getxnext();
      if (curcmd != 42) {
	backinput();
	curcmd = 54;
	curmod = 72;
	cursym = 2233;
	goto _L30;
      }
      num = curexp;
      denom = curmod;
      if (denom == 0) {  /*838:*/
	printnl(133);
	print(648L);
	helpptr = 1;
	helpline[0] = 649;
	error();
      } else  /*:838*/
	curexp = makescaled(num, denom);
      if (aritherror)
	cleararith();
      getxnext();
    }
    if (curcmd >= 30) {
      if (curcmd < 42) {
	p = stashcurexp();
	scanprimary();
	if (abs(num) >= abs(denom) || curtype < 14) {
/* p2c: <stdin>, line 18214: Warning: Symbol 'ABS' is not defined [221] */
/* p2c: <stdin>, line 18214: Warning: Symbol 'ABS' is not defined [221] */
	  dobinary(p, 71);
	} else {
	  fracmult(num, denom);
	  freenode(p, 2);
	}
      }
    }
    goto _L30;
    break;
    /*:837*/

  case 33:   /*834:*/
    donullary((int)curmod);
    break;
    /*:834*/

  case 34:
  case 30:
  case 36:
  case 43:  /*835:*/
    c = curmod;
    getxnext();
    scanprimary();
    dounary(c);
    goto _L30;
    break;
    /*:835*/

  case 37:  /*839:*/
    c = curmod;
    getxnext();
    scanexpression();
    if (curcmd != 69) {
      missingerr(347);
      print(581L);
      printcmdmod(37L, (long)c);
      helpptr = 1;
      helpline[0] = 582;
      backerror();
    }
    p = stashcurexp();
    getxnext();
    scanprimary();
    dobinary(p, c);
    goto _L30;
    break;
    /*:839*/

  case 35:  /*840:*/
    getxnext();
    scansuffix();
    oldsetting = selector;
    selector = 5;
    showtokenlist(curexp, -30000L, 100000L, 0L);
    flushtokenlist((int)curexp);
    curexp = makestring();
    selector = oldsetting;
    curtype = 4;
    goto _L30;
    break;
    /*:840*/

  case 40:  /*841:*/
    q = curmod;
    if (myvarflag == 77) {
      getxnext();
      if (curcmd == 77) {
	curexp = getavail();
	mem[curexp + 30000].hh.UU.lh = q + 2241;
	curtype = 20;
	goto _L30;
      }
      backinput();
    }
    curtype = 16;
    curexp = internal[q - 1];
    break;
    /*:841*/

  case 38:
    makeexpcopy((int)curmod);
    break;

  case 41:  /*844:*/
    prehead = avail;
    if (prehead == -30000)
      prehead = getavail();
    else {
      avail = mem[prehead + 30000].hh.rh;
      mem[prehead + 30000].hh.rh = -30000;
    }  /*dynused:=dynused+1;*/
    tail = prehead;
    posthead = -30000;
    tt = 1;
    while (true) {
      t = curtok();
      mem[tail + 30000].hh.rh = t;
      if (tt != 0) {  /*850:*/
	p = mem[prehead + 30000].hh.rh;
	q = mem[p + 30000].hh.UU.lh;
	tt = 0;
	if (eqtb[q - 1].UU.lh % 83 == 41) {
/* p2c: <stdin>, line 18307:
 * Note: Using % for possibly-negative arguments [317] */
	  q = eqtb[q - 1].rh;
	  if (q == -30000)
	    goto _L32;
	  while (true) {
	    p = mem[p + 30000].hh.rh;
	    if (p == -30000) {
	      tt = mem[q + 30000].hh.UU.U2.b0;
	      goto _L32;
	    }
	    if (mem[q + 30000].hh.UU.U2.b0 != 21)
	      goto _L32;
	    q = mem[mem[q + 30001].hh.UU.lh + 30000].hh.rh;
	    if (p >= himemmin) {
	      do {
		q = mem[q + 30000].hh.rh;
	      } while (mem[q + 30002].hh.UU.lh < mem[p + 30000].hh.UU.lh);
	      if (mem[q + 30002].hh.UU.lh > mem[p + 30000].hh.UU.lh)
		goto _L32;
	    }
	  }
	}
_L32:   /*:850*/

	if (tt >= 22) {  /*845:*/
	  me, scansuffix, scansecondary, scantertiary, scanexpressionm[tail + 30000].hh.rh = -30000;
	  if (tt <= 22) {
	    p = getavail();
	    mem[prehead + 30000].hh.UU.lh = mem[prehead + 30000].hh.rh;
	    mem[prehead + 30000].hh.rh = p;
	    mem[p + 30000].hh.UU.lh = t;
	    macrocall((int)mem[q + 30001].int_, prehead, -30000);
	    getxnext();
	    goto _L20;
	  }
	  posthead = getavail();
	  tail = posthead;
	  mem[tail + 30000].hh.rh = t;
	  tt = 0;
	  macroref = mem[q + 30001].int_;
	  mem[macroref + 30000].hh.UU.lh++;
	}  /*:845*/
      }
      getxnext();
      tail = t;
      if (curcmd == 63)   /*:846*/
      {  /*846:*/
	getxnext();
	scanexpression();
	if (curcmd != 64) {  /*847:*/
	  backinput();
	  backexpr();
	  curcmd = 63;
	  curmod = 0;
	  cursym = 2232;
	} else {  /*:847*/
	  if (curtype != 16)
	    badsubscript();
	  curcmd = 42;
	  curmod = curexp;
	  cursym = 0;
	}
      }
      if (curcmd > 42)
	goto _L31;
      if (curcmd < 40)
	goto _L31;
    }
_L31:   /*852:*/
    if (posthead != -30000)   /*:854*/
    {  /*854:*/
      backinput();
      p = getavail();
      q = mem[posthead + 30000].hh.rh;
      mem[prehead + 30000].hh.UU.lh = mem[prehead + 30000].hh.rh;
      mem[prehead + 30000].hh.rh = posthead;
      mem[posthead + 30000].hh.UU.lh = q;
      mem[posthead + 30000].hh.rh = p;
      mem[p + 30000].hh.UU.lh = mem[q + 30000].hh.rh;
      mem[q + 30000].hh.rh = -30000;
      macrocall(macroref, prehead, -30000);
      mem[macroref + 30000].hh.UU.lh--;
      getxnext();
      goto _L20;
    }
    q = mem[prehead + 30000].hh.rh;
    mem[prehead + 30000].hh.rh = avail;
    avail = prehead;
    /*dynused:=dynused-1;*/
    if (curcmd == myvarflag) {
      curtype = 20;
      curexp = q;
      goto _L30;
    }
    p = findvariable(q);
    if (p != -30000)
      makeexpcopy(p);
    else {
      obliterated(q);
      helpline[2] = 661;
      helpline[1] = 662;
      helpline[0] = 663;
      putgetflusherror(0L);
    }
    flushnodelist(q);
    goto _L30;   /*:852*/
    break;
  }
  getxnext();
_L30:
  if (curcmd != 63)
    return;
  if (curtype < 16) {  /*859:*/
    return;
  }  /*:859*/
  p = stashcurexp();
  getxnext();
  scanexpression();
  if (curcmd != 79) {  /*847:*/
    backinput();
    backexpr();
    curcmd = 63;
    curmod = 0;
    cursym = 2232;   /*:847*/
    unstashcurexp(p);
    return;
  }
  q = stashcurexp();
  getxnext();
  scanexpression();
  if (curcmd != 64) {
    missingerr(93);
    helpptr = 3;
    helpline[2] = 665;
    helpline[1] = 666;
    helpline[0] = 563;
    backerror();
  }
  r = stashcurexp();
  makeexpcopy(q);
  dobinary(r, 70);
  dobinary(p, 71);
  dobinary(q, 69);
  getxnext();

  /*853:*/
  /*:853*/
  /*:844*/
}


/*:823*/
/*860:*/

Static Void scansuffix()
{
  halfword h, t, p;

  h = getavail();
  t = h;
  while (true) {
    if (curcmd == 63)   /*:861*/
    {  /*861:*/
      getxnext();
      scanexpression();
      if (curtype != 16)
	badsubscript();
      if (curcmd != 64) {
	missingerr(93);
	helpptr = 3;
	helpline[2] = 667;
	helpline[1] = 666;
	helpline[0] = 563;
	backerror();
      }
      curcmd = 42;
      curmod = curexp;
    }
    if (curcmd == 42)
      p = newnumtok(curmod);
    else if (curcmd == 41 || curcmd == 40) {
      p = getavail();
      mem[p + 30000].hh.UU.lh = cursym;
    } else
      goto _L30;
    mem[t + 30000].hh.rh = p;
    t = p;
    getxnext();
  }
_L30:
  curexp = mem[h + 30000].hh.rh;
  mem[h + 30000].hh.rh = avail;
  avail = h;   /*dynused:=dynused-1;*/
  curtype = 20;
}


/*:860*/
/*862:*/

Static Void scansecondary()
{
  halfword p, c, d, macname;

_L20:
  if (curcmd < 30 || curcmd > 43)
    badexp(668);
  scanprimary();
_L22:
  if (curcmd > 55)
    return;
  if (curcmd < 52)
    return;
  p = stashcurexp();
  c = curmod;
  d = curcmd;
  if (d == 53) {
    macname = cursym;
    mem[c + 30000].hh.UU.lh++;
  }
  getxnext();
  scanprimary();
  if (d == 53) {
    backinput();
    binarymac(p, c, macname);
    mem[c + 30000].hh.UU.lh--;
    getxnext();
    goto _L20;
  }
  dobinary(p, c);
  goto _L22;
}  /*:862*/


/*864:*/

Static Void scantertiary()
{
  halfword p, c, d, macname;

_L20:
  if (curcmd < 30 || curcmd > 43)
    badexp(669);
  scansecondary();
  if (curtype == 8)
    materializepen();
_L22:
  if (curcmd > 45)
    return;
  if (curcmd < 43)
    return;
  p = stashcurexp();
  c = curmod;
  d = curcmd;
  if (d == 44) {
    macname = cursym;
    mem[c + 30000].hh.UU.lh++;
  }
  getxnext();
  scansecondary();
  if (d == 44) {
    backinput();
    binarymac(p, c, macname);
    mem[c + 30000].hh.UU.lh--;
    getxnext();
    goto _L20;
  }
  dobinary(p, c);
  goto _L22;
}  /*:864*/


/*868:*/

Static Void scanexpression()
{
  halfword p, q, r, pp, qq, c, d;
  char myvarflag;
  halfword macname;
  boolean cyclehit;
  scaled x, y;
  char t;

  myvarflag = varflag;
_L20:
  if (curcmd < 30 || curcmd > 43)
    badexp(672);
  scantertiary();
_L22:
  if (curcmd <= 51) {
    if (curcmd >= 46) {
      if (curcmd != 51 || myvarflag != 77) {
	p = stashcurexp();
	c = curmod;
	d = curcmd;
	if (d == 49) {
	  macname = cursym;
	  mem[c + 30000].hh.UU.lh++;
	}
	if (d < 48 || (d == 48 && (mem[p + 30000].hh.UU.U2.b0 == 14 ||
				   mem[p + 30000].hh.UU.U2.b0 == 9)))
	{  /*869:*/
	  cyclehit = false;   /*870:*/
	  unstashcurexp(p);
	  if (curtype == 14)
	    p = newknot();
	  else if (curtype == 9)
	    p = curexp;
	  else
	    goto _L10;
	  q = p;
	  while (mem[q + 30000].hh.rh != p)
	    q = mem[q + 30000].hh.rh;
	  if (mem[p + 30000].hh.UU.U2.b0 != 0) {
	    r = copyknot(p);
	    mem[q + 30000].hh.rh = r;
	    q = r;
	  }
	  mem[p + 30000].hh.UU.U2.b0 = 4;
	  mem[q + 30000].hh.UU.U2.b1 = 4;   /*:870*/
_L25:   /*874:*/
	  if (curcmd == 46)   /*:879*/
	  {  /*879:*/
	    t = scandirection();
	    if (t != 4) {
	      mem[q + 30000].hh.UU.U2.b1 = t;
	      mem[q + 30005].int_ = curexp;
	      if (mem[q + 30000].hh.UU.U2.b0 == 4) {
		mem[q + 30000].hh.UU.U2.b0 = t;
		mem[q + 30003].int_ = curexp;
	      }
	    }
	  }
	  d = curcmd;
	  if (d == 47) {  /*881:*/
	    getxnext();
	    if (curcmd == 58) {  /*882:*/
	      getxnext();
	      y = curcmd;
	      if (curcmd == 59)
		getxnext();
	      scanprimary();   /*883:*/
	      if (curtype != 16 || curexp < 49152L) {   /*:883*/
		disperr(-30000, 690);
		helpptr = 1;
		helpline[0] = 691;
		putgetflusherror(65536L);
	      }
	      if (y == 59)
		curexp = -curexp;
	      mem[q + 30006].int_ = curexp;
	      if (curcmd == 52) {
		getxnext();
		y = curcmd;
		if (curcmd == 59)
		  getxnext();
		scanprimary();   /*883:*/
		if (curtype != 16 || curexp < 49152L) {   /*:883*/
		  disperr(-30000, 690);
		  helpptr = 1;
		  helpline[0] = 691;
		  putgetflusherror(65536L);
		}
		if (y == 59)
		  curexp = -curexp;
	      }
	      y = curexp;
	    } else if (curcmd == 57) {
	      mem[q + 30000].hh.UU.U2.b1 = 1;
	      t = 1;
	      getxnext();
	      scanprimary();
	      knownpair();
	      mem[q + 30005].int_ = curx;
	      mem[q + 30006].int_ = cury;
	      if (curcmd != 52) {
		x = mem[q + 30005].int_;
		y = mem[q + 30006].int_;
	      } else {
		getxnext();
		scanprimary();
		knownpair();
		x = curx;
		y = cury;
	      }
	    } else {
	      mem[q + 30006].int_ = 65536L;
	      y = 65536L;
	      backinput();
	      goto _L30;
	    }
	    if (curcmd != 47) {
	      missingerr(279);
	      helpptr = 1;
	      helpline[0] = 689;
	      backerror();
	    }
_L30: ;   /*:881*/

	  } else if (d != 48)
	    goto _L26;
	  getxnext();
	  if (curcmd == 46) {  /*880:*/
	    t = scandirection();
	    if (mem[q + 30000].hh.UU.U2.b1 != 1)
	      x = curexp;
	    else
	      t = 1;
	  } else if (mem[q + 30000].hh.UU.U2.b1 != 1) {
	    t = 4;
	    x = 0;
	  }
	  if (curcmd == 36) {  /*886:*/
	    cyclehit = true;
	    getxnext();
	    pp = p;
	    qq = p;
	    if (d == 48) {
	      if (p == q) {
		d = 47;
		mem[q + 30006].int_ = 65536L;
		y = 65536L;
	      }
	    }
	  } else {  /*:886*/
	    scantertiary();   /*885:*/
	    if (curtype != 9)
	      pp = newknot();
	    else
	      pp = curexp;
	    qq = pp;
	    while (mem[qq + 30000].hh.rh != pp)
	      qq = mem[qq + 30000].hh.rh;
	    if (mem[pp + 30000].hh.UU.U2.b0 != 0) {
	      r = copyknot(pp);
	      mem[qq + 30000].hh.rh = r;
	      qq = r;
	    }
	, getboolean,
printcapsule, tokenrecycle, closefilesandtermina    mem[pp + 30000].hh.UU.U2.b0 = 4;
	    mem[qq + 30000].hh.UU.U2.b1 = 4;   /*:885*/
	  }  /*887:*/
	  if (d == 48) {
	    if (mem[q + 30001].int_ != mem[pp + 30001].int_ ||
		mem[q + 30002].int_ != mem[pp + 30002].int_) {
	      printnl(133);
	      print(692L);
	      helpptr = 3;
	      helpline[2] = 693;
	      helpline[1] = 694;
	      helpline[0] = 695;
	      putgeterror();
	      d = 47;
	      mem[q + 30006].int_ = 65536L;
	      y = 65536L;
	    }
	  }
	  /*889:*/
	  if (mem[pp + 30000].hh.UU.U2.b1 == 4) {
	    if (t == 3 || t == 2) {   /*:889*/
	      mem[pp + 30000].hh.UU.U2.b1 = t;
	      mem[pp + 30005].int_ = x;
	    }
	  }
	  if (d == 48) {  /*890:*/
	    if (mem[q + 30000].hh.UU.U2.b0 == 4) {
	      if (mem[q + 30000].hh.UU.U2.b1 == 4) {
		mem[q + 30000].hh.UU.U2.b0 = 3;
		mem[q + 30003].int_ = 65536L;
	      }
	    }
	    if (mem[pp + 30000].hh.UU.U2.b1 == 4) {
	      if (t == 4) {
		mem[pp + 30000].hh.UU.U2.b1 = 3;
		mem[pp + 30005].int_ = 65536L;
	      }
	    }
	    mem[q + 30000].hh.UU.U2.b1 = mem[pp + 30000].hh.UU.U2.b1;
	    mem[q + 30000].hh.rh = mem[pp + 30000].hh.rh;
	    mem[q + 30005].int_ = mem[pp + 30005].int_;
	    mem[q + 30006].int_ = mem[pp + 30006].int_;
	    freenode(pp, 7);
	    if (qq == pp)
	      qq = q;
	  } else {   /*:890*/
	    if (mem[q + 30000].hh.UU.U2.b1 == 4) {
	      if (mem[q + 30000].hh.UU.U2.b0 == 3 ||
		  mem[q + 30000].hh.UU.U2.b0 == 2)
	      {   /*:888*/
		mem[q + 30000].hh.UU.U2.b1 = mem[q + 30000].hh.UU.U2.b0;
		mem[q + 30005].int_ = mem[q + 30003].int_;
	      }
	    }
	    mem[q + 30000].hh.rh = pp;
	    mem[pp + 30004].int_ = y;
	    if (t != 4) {
	      mem[pp + 30003].int_ = x;
	      mem[pp + 30000].hh.UU.U2.b0 = t;
	    }
	  }
	  q = qq;   /*:887*/
	  if (curcmd >= 46) {
	    if (curcmd <= 48) {
	      if (!cyclehit)
		goto _L25;
	    }
	  }
_L26:   /*891:*/
	  if (cyclehit) {
	    if (d == 48)
	      p = q;
	  } else {
	    mem[p + 30000].hh.UU.U2.b0 = 0;
	    if (mem[p + 30000].hh.UU.U2.b1 == 4) {
	      mem[p + 30000].hh.UU.U2.b1 = 3;
	      mem[p + 30005].int_ = 65536L;
	    }
	    mem[q + 30000].hh.UU.U2.b1 = 0;
	    if (mem[q + 30000].hh.UU.U2.b0 == 4) {
	      mem[q + 30000].hh.UU.U2.b0 = 3;
	      mem[q + 30003].int_ = 65536L;
	    }
	    mem[q + 30000].hh.rh = p;
	  }
	  makechoices(p);
	  curtype = 9;
	  curexp = p;   /*:891*/
	} else {  /*:869*/
	  getxnext();
	  scantertiary();
	  if (d == 49) {
	    backinput();
	    binarymac(p, c, macname);
	    mem[c + 30000].hh.UU.lh--;
	    getxnext();
	    goto _L20;
	  }
	  dobinary(p, c);
	}
	goto _L22;
      }
    }
  }
_L10: ;


  /*:882*/
  /*884:*/
  /*:884*/
  /*:880*/
  /*:874*/
  /*888:*/
}


/*:868*/
/*892:*/

Static Void getboolean()
{
  getxnext();
  scanexpression();
  if (curtype == 2)
    return;
  disperr(-30000, 696);
  helpptr = 2;
  helpline[1] = 697;
  helpline[0] = 698;
  putgetflusherror(31L);
  curtype = 2;
}


/*:892*/
/*224:*/

Static Void printcapsule()
{
  printchar(40);
  printexp(gpointer, 0);
  printchar(41);
}


Static Void tokenrecycle()
{
  recyclevalue(gpointer);
}

<stdin>, line 19028: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 19119: Warning: Symbol 'ABS' is not defined [221]
<stdin>, line 19170: Warning: Symbol 'WRITELN' is not defined [221]


/*:224*/
/*1205:*/

Static Void closefilesandtermina()
{
  long k, lh;
  halfword p;
  scaled x;
  long FORLIM;

  /*if internal[12]>0 then[1208:]if jobname>0 then begin writeln(
  logfile,' ');
  writeln(logfile,'Here is how much of METAFONT''s memory',' you used:');
  write(logfile,' ',maxstrptr-initstrptr:1,' string');
  if maxstrptr<>initstrptr+1 then write(logfile,'s');
  writeln(logfile,' out of ',maxstrings-initstrptr:1);
  writeln(logfile,' ',maxpoolptr-initpoolptr:1,
  ' string characters out of ',poolsize-initpoolptr:1);
  writeln(logfile,' ',lomemmax+30000+memend-himemmin+2:1,
  ' words of memory out of ',memend+30001:1);
  writeln(logfile,' ',stcount:1,' symbolic tokens out of ',2100:1);
  writeln(logfile,' ',maxinstack:1,'i,',intptr:1,'n,',maxroundingptr:1,
  'r,',maxparamstack:1,'p,',maxbufstack+1:1,'b stack positions out of ',
  stacksize:1,'i,',maxinternal:1,'n,',maxwiggle:1,'r,',150:1,'p,',bufsize:
  1,'b');end[:1208];*/
  /*1206:*/
  if (gfprevptr > 0 || internal[32] > 0)   /*:1206*/
  {  /*1207:*/
    rover = -29977;
    mem[rover + 30000].hh.rh = 32767;
    lomemmax = himemmin - 1;
    if (lomemmax - rover > 32767)
      lomemmax = rover + 32767;
    mem[rover + 30000].hh.UU.lh = lomemmax - rover;
    mem[rover + 30001].hh.UU.lh = rover;
    mem[rover + 30001].hh.rh = rover;
    mem[lomemmax + 30000].hh.rh = -30000;
    mem[lomemmax + 30000].hh.UU.lh = -30000;   /*:1207*/
    /*1124:*/
    mem[59999].hh.rh = -29981;
    FORLIM = ec;
    for (k = bc; k <= FORLIM; k++) {
      if (charexists[k])
	tfmwidth[k] = sortin(tfmwidth[k]);
    }
    nw = skimp(255L) + 1;
    dimenhead[0] = mem[59999].hh.rh;
    if (perturbation >= 4096)   /*:1124*/
      tfmwarning(20);
    fixdesignsize();
    fixchecksum();
    if (internal[32] > 0) {  /*1126:*/
      mem[59999].hh.rh = -29981;
      FORLIM = ec;
      for (k = bc; k <= FORLIM; k++) {
	if (charexists[k]) {
	  if (tfmheight[k] == 0)
	    tfmheight[k] = -29985;
	  else
	    tfmheight[k] = sortin(tfmheight[k]);
	}
      }
      nh = skimp(15L) + 1;
      dimenhead[1] = mem[59999].hh.rh;
      if (perturbation >= 4096)
	tfmwarning(21);
      mem[59999].hh.rh = -29981;
      FORLIM = ec;
      for (k = bc; k <= FORLIM; k++) {
	if (charexists[k]) {
	  if (tfmdepth[k] == 0)
	    tfmdepth[k] = -29985;
	  else
	    tfmdepth[k] = sortin(tfmdepth[k]);
	}
      }
      nd = skimp(15L) + 1;
      dimenhead[2] = mem[59999].hh.rh;
      if (perturbation >= 4096)
	tfmwarning(22);
      mem[59999].hh.rh = -29981;
      FORLIM = ec;
      for (k = bc; k <= FORLIM; k++) {
	if (charexists[k]) {
	  if (tfmitalcorr[k] == 0)
	    tfmitalcorr[k] = -29985;
	  else
	    tfmitalcorr[k] = sortin(tfmitalcorr[k]);
	}
      }
      ni = skimp(63L) + 1;
      dimenhead[3] = mem[59999].hh.rh;
      if (perturbation >= 4096)   /*:1126*/
	tfmwarning(23);
      /*1134:*/
      if (jobname == 0)
	openlogfile();
      packjobname(901);
      while (!bopenout(&tfmfile, nameoffile))
	promptfilename(902, 901);
      metricfilename = bmakenamestring(&tfmfile);   /*1135:*/
      k = headersize;
      while (headerbyte[k - 1] < 0)
	k--;
      lh = (k + 3) / 4;
      if (bc > ec)
	bc = 1;
      bwrite2bytes(&tfmfile,
		   lh + ec - bc + nw + nh + nd + ni + nl + nk + ne + np + 7);
      bwrite2bytes(&tfmfile, lh);
      bwrite2bytes(&tfmfile, (long)bc);
      bwrite2bytes(&tfmfile, (long)ec);
      bwrite2bytes(&tfmfile, (long)nw);
      bwrite2bytes(&tfmfile, (long)nh);
      bwrite2bytes(&tfmfile, (long)nd);
      bwrite2bytes(&tfmfile, (long)ni);
      bwrite2bytes(&tfmfile, (long)nl);
      bwrite2bytes(&tfmfile, (long)nk);
      bwrite2bytes(&tfmfile, (long)ne);
      bwrite2bytes(&tfmfile, (long)np);
      for (k = 0; k < lh * 4; k++) {   /*:1135*/
	if (headerbyte[k] < 0)
	  headerbyte[k] = 0;
	bwritebyte(&tfmfile, (long)headerbyte[k]);
      }
      /*1137:*/
      FORLIM = ec;
      for (k = bc; k <= FORLIM; k++) {   /*1138:*/
	if (!charexists[k])
	  bwrite4bytes(&tfmfile, 0L);
	else {   /*:1137*/
	  bwritebyte(&tfmfile, (long)mem[tfmwidth[k] + 30000].hh.UU.lh);
	  bwritebyte(&tfmfile, mem[tfmheight[k] + 30000].hh.UU.lh * 16L +
			       mem[tfmdepth[k] + 30000].hh.UU.lh);
	  bwritebyte(&tfmfile,
		     mem[tfmitalcorr[k] + 30000].hh.UU.lh * 4L + chartag[k]);
	  bwritebyte(&tfmfile, (long)charremainder[k]);
	}
      }
      tfmchanged = 0;
      for (k = 0; k <= 3; k++) {   /*:1138*/
	bwrite4bytes(&tfmfile, 0L);
	p = dimenhead[k];
	while (p != -29981) {
	  bwrite4bytes(&tfmfile, dimenout(mem[p + 30001].int_));
	  p = mem[p + 30000].hh.rh;
	}
      }
      /*1139:*/
      FORLIM = nl;
      for (k = 0; k < FORLIM; k++)
	tfmqqqq(ligkern[k]);
      FORLIM = nk;
      for (k = 0; k < FORLIM; k++)   /*:1139*/
	bwrite4bytes(&tfmfile, dimenout(kern[k]));
      FORLIM = ne;
      /*1140:*/
      for (k = 0; k < FORLIM; k++)   /*:1140*/
	tfmqqqq(exten[k]);
      /*1141:*/
      FORLIM = np;
      for (k = 1; k <= , finalcleanup, MFFORLIM; k++) {
	if (k == 1) {
	  if (abs(param[0]) < 134217728L) {
/* p2c: <stdin>, line 19028: Warning: Symbol 'ABS' is not defined [221] */
	    bwrite4bytes(&tfmfile, param[0] * 16);
	  } else {
	    tfmchanged++;
	    if (param[0] > 0)
	      bwrite4bytes(&tfmfile, 2147483647L);
	    else
	      bwrite4bytes(&tfmfile, -2147483647L);
	  }
	} else
	  bwrite4bytes(&tfmfile, dimenout(param[k - 1]));
      }
      if (tfmchanged > 0) {   /*:1141*/
	if (tfmchanged == 1)
	  printnl(904);
	else {
	  printnl(40);
	  printint(tfmchanged);
	  print(905L);
	}
	print(906L);
      }
      /*if internal[12]>0 then[1136:]begin writeln(logfile,' ');
writeln(logfile,'(You used ',nw:1,'w,',nh:1,'h,',nd:1,'d,',ni:1,'i,',nl:
1,'l,',nk:1,'k,',ne:1,'e,',np:1,'p metric file positions');
writeln(logfile,'  out of ','256w,16h,16d,64i,',ligtablesize:1,
'l,256k,256e,',maxfontdimen:1,'p)');end[:1136];*/
      printnl(903);
      print((long)metricfilename);   /*:1134*/
      bclose(&tfmfile);
    }
    if (gfprevptr > 0) {  /*1182:*/
      gfbuf[gfptr] = 248;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      gffour(gfprevptr);
      gfprevptr = gfoffset + gfptr - 5;
      gffour(internal[25] * 16);
      for (k = 0; k <= 3; k++) {
	gfbuf[gfptr] = headerbyte[k];
	gfptr++;
	if (gfptr == gflimit)
	  gfswap();
      }
      gffour(internal[26]);
      gffour(internal[27]);
      gffour(gfminm);
      gffour(gfmaxm);
      gffour(gfminn);
      gffour(gfmaxn);
      for (k = 0; k <= 255; k++) {
	if (charexists[k]) {
	  x = gfdx[k] / 65536L;
	  if (gfdy[k] == 0 && (unsigned long)x < 256 && gfdx[k] == x * 65536L) {
	    gfbuf[gfptr] = 246;
	    gfptr++;
	    if (gfptr == gflimit)
	      gfswap();
	    gfbuf[gfptr] = k;
	    gfptr++;
	    if (gfptr == gflimit)
	      gfswap();
	    gfbuf[gfptr] = x;
	    gfptr++;
	    if (gfptr == gflimit)
	      gfswap();
	  } else {
	    gfbuf[gfptr] = 245;
	    gfptr++;
	    if (gfptr == gflimit)
	      gfswap();
	    gfbuf[gfptr] = k;
	    gfptr++;
	    if (gfptr == gflimit)
	      gfswap();
	    gffour(gfdx[k]);
	    gffour(gfdy[k]);
	  }
	  x = mem[tfmwidth[k] + 30001].int_;
	  if (abs(x) > maxtfmdimen) {
/* p2c: <stdin>, line 19119: Warning: Symbol 'ABS' is not defined [221] */
	    if (x > 0)
	      x = 16777215L;
	    else
	      x = -16777215L;
	  } else
	    x = makescaled(x * 16, internal[25]);
	  gffour(x);
	  gffour(charptr[k]);
	}
      }
      gfbuf[gfptr] = 249;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      gffour(gfprevptr);
      gfbuf[gfptr] = 131;
      gfptr++;
      if (gfptr == gflimit)
	gfswap();
      k = ((gfbufsize - gfptr) & 3) + 4;
      while (k > 0) {
	gfbuf[gfptr] = 223;
	gfptr++;
	if (gfptr == gflimit)
	  gfswap();
	k--;
      }  /*1156:*/
      if (gflimit == halfbuf)
	bwritebuf(&gffile, gfbuf, (long)halfbuf, gfbufsize - 1L);
      if (gfptr > 0)   /*:1156*/
	bwritebuf(&gffile, gfbuf, 0L, gfptr - 1L);
      printnl(917);
      print((long)outputfilename);
      print(425L);
      printint(totalchars);
      print(918L);
      if (totalchars != 1)
	printchar(115);
      print(919L);
      printint(gfoffset + gfptr);
      print(920L);
      bclose(&gffile);
    }  /*:1182*/
  }
  if (jobname > 0) {
    writeln(logfile);
/* p2c: <stdin>, line 19170:
 * Warning: Symbol 'WRITELN' is not defined [221] */
    aclose(&logfile);
    selector -= 2;
    if (selector == 1) {
      printnl(929);
      print((long)logname);
      printchar(46);
    }
  }
  println();
  if (editnamestart != 0 && interaction > 0)
    calledit(&strpool[editnamestart], editnamelength, editline);
}


/*:1205*/
/*1209:*/

Static Void finalcleanup()
{
  smallnumber c;

  c = curmod;
  if (jobname == 0)
    openlogfile();
  while (condptr != -30000) {
    printnl(930);
    printcmdmod(2L, (long)curif);
    if (ifline != 0) {
      print(931L);
      printint(ifline);
    }
    print(932L);
    ifline = mem[condptr + 30001].int_;
    curif = mem[condptr + 30000].hh.UU.U2.b1;
    condptr = mem[condptr + 30000].hh.rh;
  }
  if (history != 0) {
    if (history == 1 || interaction < 3) {
      if (selector == 3) {
	selector = 1;
	printnl(933);
	selector = 3;
      }
    }
  }
  if (c == 1) {  /*storebasefile;goto 10;*/
    printnl(934);
    goto _L10;
  }
_L10: ;

}


/*:1209*/
/*1210:*/
/*procedure initprim;begin[192:]primitive(280,40,1);
primitive(281,40,2);primitive(282,40,3);primitive(283,40,4);
primitive(284,40,5);primitive(285,40,6);primitive(286,40,7);
primitive(287,40,8);primitive(288,40,9);primitive(289,40,10);
primitive(290,40,11);primitive(291,40,12);primitive(292,40,13);
primitive(293,40,14);primitive(294,40,15);primitive(295,40,16);
primitive(296,40,17);primitive(297,40,18);primitive(298,40,19);
primitive(299,40,20);primitive(300,40,21);primitive(301,40,22);
primitive(302,40,23);primitive(303,40,24);primitive(304,40,25);
primitive(305,40,26);primitive(306,40,27);primitive(307,40,28);
primitive(308,40,29);primitive(309,40,30);primitive(310,40,31);
primitive(311,40,32);primitive(312,40,33);primitive(313,40,34);
primitive(314,40,35);primitive(315,40,36);primitive(316,40,37);
primitive(317,40,38);primitive(318,40,39);primitive(319,40,40);
[:192][211:]primitive(279,47,0);primitive(91,63,0);
eqtb[2232]:=eqtb[cursym];primitive(93,64,0);primitive(125,65,0);
primitive(123,46,0);primitive(58,78,0);eqtb[2234]:=eqtb[cursym];
primitive(329,77,0);primitive(44,79,0);primitive(59,80,0);
eqtb[2235]:=eqtb[cursym];primitive(92,7,0);primitive(330,18,0);
primitive(331,72,0);primitive(332,59,0);primitive(333,32,0);
bgloc:=cursym;primitive(334,57,0);primitive(335,19,0);
primitive(336,60,0);primitive(337,27,0);primitive(338,11,0);
primitive(323,81,0);eqtb[2239]:=eqtb[cursym];egloc:=cursym;
primitive(339,26,0);primitive(340,6,0);primitive(341,9,0);
primitive(342,70,0);primitive(343,73,0);primitive(344,13,0);
primitive(345,14,0);primitive(346,15,0);primitive(347,69,0);
primitive(348,28,0);primitive(349,24,0);primitive(350,12,0);
primitive(351,8,0);primitive(352,17,0);primitive(353,74,0);
primitive(354,35,0);primitive(355,58,0);primitive(356,71,0);
primitive(357,75,0);[:211][683:]primitive(520,16,1);primitive(521,16,2);
primitive(522,16,53);primitive(523,16,44);primitive(524,16,49);
primitive(324,16,0);eqtb[2237]:=eqtb[cursym];primitive(525,4,2242);
primitive(526,4,2392);primitive(527,4,1);primitive(325,4,0);
eqtb[2236]:=eqtb[cursym];[:683][688:]primitive(528,61,0);
primitive(529,61,1);primitive(64,61,2);primitive(530,61,3);
[:688][695:]primitive(541,56,2242);primitive(542,56,2392);
primitive(543,56,2542);primitive(544,56,1);primitive(545,56,2);
primitive(546,56,3);[:695][709:]primitive(556,3,0);primitive(482,3,1);
[:709][740:]primitive(583,1,1);primitive(322,2,2);
eqtb[2238]:=eqtb[cursym];primitive(584,2,3);primitive(585,2,4);
[:740][893:]primitive(218,33,30);primitive(219,33,31);
primitive(220,33,32);primitive(221,33,33);primitive(222,33,34);
primitive(223,33,35);primitive(224,33,36);primitive(225,33,37);
primitive(226,34,38);primitive(227,34,39);primitive(228,34,40);
primitive(229,34,41);primitive(230,34,42);primitive(231,34,43);
primitive(232,34,44);primitive(233,34,45);primitive(234,34,46);
primitive(235,34,47);primitive(236,34,48);primitive(237,34,49);
primitive(238,34,50);primitive(239,34,51);primitive(240,34,52);
primitive(241,34,53);primitive(242,34,54);primitive(243,34,55);
primitive(244,34,56);primitive(245,34,57);primitive(246,34,58);
primitive(247,34,59);primitive(248,34,60);primitive(249,34,61);
primitive(250,34,62);primitive(251,34,63);primitive(252,34,64);
primitive(253,34,65);primitive(254,34,66);primitive(255,34,67);
primitive(256,36,68);primitive(43,43,69);primitive(45,43,70);
primitive(42,55,71);primitive(47,54,72);eqtb[2233]:=eqtb[cursym];
primitive(257,45,73);primitive(181,45,74);primitive(259,52,76);
primitive(258,45,75);primitive(60,50,77);primitive(260,50,78);
primitive(62,50,79);primitive(261,50,80);primitive(61,51,81);
primitive(262,50,82);primitive(272,37,94);primitive(273,37,95);
primitive(274,37,96);primitive(275,37,97);primitive(276,37,98);
primitive(277,37,99);primitive(278,37,100);primitive(38,48,83);
primitive(263,55,84);primitive(264,55,85);primitive(265,55,86);
primitive(266,55,87);primitive(267,55,88);primitive(268,55,89);
primitive(269,55,90);primitive(270,55,91);primitive(271,45,92);
[:893][1013:]primitive(211,30,15);primitive(197,30,4);
primitive(195,30,2);primitive(202,30,9);primitive(199,30,6);
primitive(204,30,11);primitive(206,30,13);primitive(207,30,14);
[:1013][1018:]primitive(776,82,0);primitive(777,82,1);
[:1018][1024:]primitive(143,23,0);primitive(144,23,1);
primitive(145,23,2);primitive(783,23,3);
[:1024][1027:]primitive(784,21,0);primitive(785,21,1);
[:1027][1037:]primitive(799,22,0);primitive(800,22,1);
primitive(801,22,2);primitive(802,22,3);primitive(803,22,4);
[:1037][1052:]primitive(820,68,1);primitive(821,68,0);
primitive(822,68,2);primitive(823,66,6);primitive(824,66,16);
primitive(825,67,0);primitive(826,67,1);
[:1052][1079:]primitive(856,25,0);primitive(857,25,1);
primitive(858,25,2);[:1079][1101:]primitive(868,20,0);
primitive(869,20,1);primitive(870,20,2);primitive(871,20,3);
primitive(872,20,4);[:1101][1109:]primitive(889,76,0);
primitive(890,76,128);[:1109][1176:]primitive(912,29,4);
primitive(913,29,16);[:1176];end;procedure inittab;var k:integer;
begin[176:]rover:=-29977;mem[rover].hh.rh:=32767;mem[rover].hh.lh:=1000;
mem[rover+1].hh.lh:=rover;mem[rover+1].hh.rh:=rover;
lomemmax:=rover+1000;mem[lomemmax].hh.rh:=-30000;
mem[lomemmax].hh.lh:=-30000;
for k:=29998 to 30000 do mem[k]:=mem[lomemmax];avail:=-30000;
memend:=30000;himemmin:=29998;varused:=23;dynused:=-1;
[:176][193:]intname[1]:=280;intname[2]:=281;intname[3]:=282;
intname[4]:=283;intname[5]:=284;intname[6]:=285;intname[7]:=286;
intname[8]:=287;intname[9]:=288;intname[10]:=289;intname[11]:=290;
intname[12]:=291;intname[13]:=292;intname[14]:=293;intname[15]:=294;
intname[16]:=295;intname[17]:=296;intname[18]:=297;intname[19]:=298;
intname[20]:=299;intname[21]:=300;intname[22]:=301;intname[23]:=302;
intname[24]:=303;intname[25]:=304;intname[26]:=305;intname[27]:=306;
intname[28]:=307;intname[29]:=308;intname[30]:=309;intname[31]:=310;
intname[32]:=311;intname[33]:=312;intname[34]:=313;intname[35]:=314;
intname[36]:=315;intname[37]:=316;intname[38]:=317;intname[39]:=318;
intname[40]:=319;[:193][203:]hashused:=2229;stcount:=0;
hash[2240].rh:=321;hash[2238].rh:=322;hash[2239].rh:=323;
hash[2237].rh:=324;hash[2236].rh:=325;hash[2235].rh:=59;
hash[2234].rh:=58;hash[2233].rh:=47;hash[2232].rh:=91;hash[2231].rh:=41;
hash[2229].rh:=326;eqtb[2231].lh:=62;
[:203][229:]mem[-29981].hh.lh:=2242;mem[-29981].hh.rh:=-30000;
[:229][324:]mem[30000].hh.lh:=32767;
[:324][475:]mem[-29997].hh.lh:=-30000;mem[-29997].hh.rh:=-30000;
mem[-29996].hh.lh:=1;mem[-29996].hh.rh:=-30000;
for k:=-29995 to-29989 do mem[k]:=mem[-29996];mem[-29988].int:=0;
mem[-30000].hh.rh:=-30000;mem[-30000].hh.lh:=-30000;mem[-29999].int:=0;
mem[-29998].int:=0;[:475][587:]serialno:=0;mem[-29987].hh.rh:=-29987;
mem[-29986].hh.lh:=-29987;mem[-29987].hh.lh:=-30000;
mem[-29986].hh.rh:=-30000;[:587][702:]mem[-29979].hh.b1:=0;
mem[-29979].hh.rh:=2240;eqtb[2240].rh:=-29979;eqtb[2240].lh:=41;
[:702][759:]eqtb[2230].lh:=88;hash[2230].rh:=600;
[:759][911:]mem[-29983].hh.b1:=11;
[:911][1116:]mem[-29980].int:=1073741824;
[:1116][1127:]mem[-29984].int:=0;mem[-29985].hh.lh:=0;
[:1127][1185:]baseident:=921;[:1185]end;*/
/*:1210*/
/*1212:*/
/*procedure debughelp;label 888,10;var k,l,m,n:integer;
begin while true do begin;printnl(935);flush(output);read(input,m);
if m<0 then goto 10 else if m=0 then begin goto 888;
888:m:=0;
['BREAKPOINT']
end else begin read(input,n);case m of[1213:]1:printword(mem[n]);
2:printint(mem[n].hh.lh);3:printint(mem[n].hh.rh);
4:begin printint(eqtb[n].lh);printchar(58);printint(eqtb[n].rh);end;
5:printvariablename(n);6:printint(internal[n]);7:doshowdependencies;
9:showtokenlist(n,-30000,100000,0);10:print(n);11:checkmem(n>0);
12:searchmem(n);13:begin read(input,l);printcmdmod(n,l);end;
14:for k:=0 to n do print(buffer[k]);15:panicking:=not panicking;
[:1213]others:print(63)end;end;end;10:end;*/
/*:1212*/
/*:1202*/
/*1204:*/

<stdin>, line 19405: Warning: Expected a ')', found a colon [227]
<stdin>, line 19405: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 19417: Warning: Symbol 'WRITE' is not defined [221]
<stdin>, line 19419: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 19420: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 19424: Warning: Symbol 'WRITELN' is not defined [221]
<stdin>, line 19428: Warning: Symbol 'FLUSH' is not defined [221]
<stdin>, line 19498: Note: Array of files inputfile should be initialized [257]

main(argc, argv)
int argc;
Char *argv[];
{
  PASCAL_MAIN(argc, argv);
  if (setjmp(_JL9998))
    goto _L9998;
  basefile = NULL;
  g = NULL;
/* p2c: <stdin>:
 * Note: Array of files inputfile should be initialized [257] */
  psfile = NULL;
  logfile = NULL;
  poolfile = NULL;
  /*-----------------------------------*/
  init_ps(&psfile);
  /*-----------------------------------*/
  history = 3;
  setpaths();
  if (readyalready == 314159L)   /*14:*/
    goto _L1;
  bad = 0;
  if (halferrorline < 30 || halferrorline > errorline - 15)
    bad = 1;
  if (maxprintline < 60)
    bad = 2;
  if ((gfbufsize & 7) != 0)
    bad = 3;
  if (false)
    bad = 4;
  if (false)
    bad = 5;
  if ((headersize & 3) != 0)   /*:14*/
    bad = 6;
  /*154:*/
  /*if memmax<>30000 then bad:=10;*/
  if (memmax < 30000)
    bad = 10;
  if (false)
    bad = 11;
  if (false)
    bad = 12;
  if (false)
    bad = 13;
  if (memmax >= 32767)
    bad = 14;
  if (maxstrings > 32767)
    bad = 15;
  if (bufsize > 32767)
    bad = 16;
  if (false)   /*:154*/
    bad = 17;
  /*204:*/
  if (maxinternal > 30526)   /*:204*/
    bad = 21;
  /*214:*/
  if (false)   /*:214*/
    bad = 22;
  /*310:*/
  if (165 > bistacksize)   /*:310*/
    bad = 31;
  /*553:*/
  if (785 > bistacksize)   /*:553*/
    bad = 32;
  /*777:*/
  if (10 > filenamesize)   /*:777*/
    bad = 41;
  if (bad > 0) {
    writeln(stdout, "Ouch---my internal constants have been clobbered!",
	    "---case ", bad);
/* p2c: <stdin>, line 19405: Warning: Expected a ')', found a colon [227] */
/* p2c: <stdin>, line 19405:
 * Warning: Symbol 'WRITELN' is not defined [221] */
    /*if not getstringsstarted then goto 9999;
    inittab;initprim;*/
    goto _L9999;
  }
  initialize();
  readyalready = 314159L;
_L1:   /*55:*/
  selector = 1;
  tally = 0;
  termoffset = 0;
  fileoffset = 0;   /*:55*/
  /*61:*/
  write(stdout, "This is METAFONT, Version 1.0 for Berkeley UNIX");
/* p2c: <stdin>, line 19417: Warning: Symbol 'WRITE' is not defined [221] */
  /*-----------------------------------------------------------------*/
  writeln(stdout);
/* p2c: <stdin>, line 19419:
 * Warning: Symbol 'WRITELN' is not defined [221] */
  writeln(stdout, "*** embedded METAFONT to PostScript Compiler ***");
/* p2c: <stdin>, line 19420:
 * Warning: Symbol 'WRITELN' is not defined [221] */
  /*-----------------------------------------------------------------*/
  if (baseident == 0) {
    writeln(stdout, " (no base preloaded)");
/* p2c: <stdin>, line 19424:
 * Warning: Symbol 'WRITELN' is not defined [221] */
  } else {
    print((long)baseident);
    println();
  }
  flush(stdout);   /*:61*/
/* p2c: <stdin>, line 19428: Warning: Symbol 'FLUSH' is not defined [221] */
  /*783:*/
  jobname = 0;   /*:783*/
  /*792:*/
  outputfilename = 0;   /*:792*/
  /*1211:*/
  /*657:*/
  inputptr = 0;
  maxinstack = 0;
  inopen = 0;
  maxbufstack = 0;
  paramptr = 0;
  maxparamstack = 0;
  first = 1;
  curinput.startfield = 1;
  curinput.indexfield = 0;
  line = 0;
  curinput.namefield = 0;
  forceeof = false;
  if (!initterminal())
    goto _L9999;
  curinput.limitfield = last;
  first = last + 1;   /*:657*/
  /*660:*/
  scannerstatus = 0;   /*:660*/
  if (baseident == 0 || buffer[curinput.locfield] == 38) {
    if (baseident != 0)
      initialize();
    if (!openbasefile())
      goto _L9999;
    if (!loadbasefile()) {
      wclose(&basefile);
      goto _L9999;
    }
    wclose(&basefile);
    while (curinput.locfield < curinput.limitfield &&
	   buffer[curinput.locfield] == 32)
      curinput.locfield++;
  }
  buffer[curinput.limitfield] = 37;
  fixdateandtime();
  initrandoms(internal[16] / 65536L + internal[15]);   /*70:*/
  if (interaction == 
Translation completed.
0)
    selector = 0;
  else
    selector = 1;   /*:70*/
  if (curinput.locfield < curinput.limitfield) {   /*:1211*/
    if (buffer[curinput.locfield] != 92)
      startinput();
  }
  initstrptr = strptr;
  initpoolptr = poolptr;
  maxstrptr = strptr;
  maxpoolptr = poolptr;
  history = 0;
  if (startsym > 0) {
    cursym = startsym;
    backinput();
  }
  maincontrol();
  finalcleanup();
_L9998:
  closefilesandtermina();
_L9999:
  readyalready = 0;
  /*---------------------------------*/
  tini_ps(&g);
  /*---------------------------------*/
  if (history != 0 && history != 1)
    exit_(1L);
  else
    exit_(0L);
  if (poolfile != NULL)
    fclose(poolfile);
  if (logfile != NULL)
    fclose(logfile);
  if (psfile != NULL)
    fclose(psfile);
  if (g != NULL)
    fclose(g);
  if (basefile != NULL)
    fclose(basefile);
  exit(EXIT_SUCCESS);
}  /*:1204*/


Time elapsed = 1.552425 seconds.
