-- file: TexOps3Impl.mesa
-- Pascal-to-Mesa translator output, translated at September 27, 1985 10:21:37 am PDT


DIRECTORY
  PascalBasic,
  TexTypes,
  TexInteraction,
  TexMemory,
  TexSymbols,
  TexScan,
  TexOps,
  TexBuildPage,
  TexMath,
  TexRest,
  TexSysdepInline;

TexOps3Impl: PROGRAM IMPORTS PascalBasic, TexTypes, TexInteraction, TexMemory, TexSymbols, TexOps, TexBuildPage, TexRest, TexSysdepInline EXPORTS TexOps = PUBLIC
BEGIN OPEN PascalBasic, TexTypes, TexInteraction, TexMemory, TexSymbols, TexScan, TexOps, TexBuildPage, TexMath, TexRest, TexSysdepInline;

 FinAlign: PROCEDURE = 
BEGIN P, Q, R, S, U, V:Halfword;T, W:Scaled;O:Scaled;
N:Halfword;RuleSave:Scaled; FinAlignInner: PROCEDURE = 
BEGIN--805:
Q←Mem[CurList.HeadField]↑.Hh.Rh;
WHILE Q#0 DO BEGIN IF Mem[Q]↑.Hh.B0=13  THEN--807:
BEGIN IF CurList.ModeField=-1  THEN BEGIN Mem[Q]↑.Hh.B0←0;
Mem[Q+1]↑.Int←Mem[P+1]↑.Int; END  ELSE BEGIN Mem[Q]↑.Hh.B0←1;
Mem[Q+3]↑.Int←Mem[P+3]↑.Int; END;Mem[Q+5]↑.Hh.B1←Mem[P+5]↑.Hh.B1;
Mem[Q+5]↑.Hh.B0←Mem[P+5]↑.Hh.B0;Mem[Q+6]↑.Gr←Mem[P+6]↑.Gr;Mem[Q+4]↑.Int←O;
R←Mem[Mem[Q+5]↑.Hh.Rh]↑.Hh.Rh;S←Mem[Mem[P+5]↑.Hh.Rh]↑.Hh.Rh;DO--808:
N←Mem[R]↑.Hh.B1;T←Mem[S+1]↑.Int;W←T;U←64996;WHILE  INT[N]>0 DO BEGIN N← INT[N]-1;
--809:--S←Mem[S]↑.Hh.Rh;V←Mem[S+1]↑.Hh.Lh;Mem[U]↑.Hh.Rh←NewGlue[V];
U←Mem[U]↑.Hh.Rh;Mem[U]↑.Hh.B1←12;T←T+Mem[V+1]↑.Int;
IF Mem[P+5]↑.Hh.B0=1  THEN BEGIN IF Mem[V]↑.Hh.B0=Mem[P+5]↑.Hh.B1  THEN T←
T+PascalROUND[Mem[P+6]↑.Gr*PascalFLOAT[Mem[V+2]↑.Int]];
 END  ELSE IF Mem[P+5]↑.Hh.B0=2  THEN BEGIN IF Mem[V]↑.Hh.B1=Mem[P+5]↑.Hh.B1
 THEN T←T-PascalROUND[Mem[P+6]↑.Gr*PascalFLOAT[Mem[V+3]↑.Int]]; END;S←Mem[S]↑.Hh.Rh;
Mem[U]↑.Hh.Rh←NewNullBox[];U←Mem[U]↑.Hh.Rh;T←T+Mem[S+1]↑.Int;
IF CurList.ModeField=-1  THEN Mem[U+1]↑.Int←Mem[S+1]↑.Int  ELSE BEGIN Mem
[U]↑.Hh.B0←1;Mem[U+3]↑.Int←Mem[S+1]↑.Int; END--:809--; END ENDLOOP ;
IF CurList.ModeField=-1  THEN--810:--BEGIN Mem[R+3]↑.Int←Mem[Q+3]↑.Int;
Mem[R+2]↑.Int←Mem[Q+2]↑.Int;
IF T=Mem[R+1]↑.Int  THEN BEGIN Mem[R+5]↑.Hh.B0←0;Mem[R+5]↑.Hh.B1←0;
Mem[R+6]↑.Gr←0.0;
 END  ELSE IF T>Mem[R+1]↑.Int  THEN BEGIN Mem[R+5]↑.Hh.B0←1;
IF Mem[R+6]↑.Int=0  THEN Mem[R+6]↑.Gr←0.0  ELSE Mem[R+6]↑.Gr←PascalFLOAT[(T-Mem[R+1]↑.
Int)]/PascalFLOAT[Mem[R+6]↑.Int]; END  ELSE BEGIN Mem[R+5]↑.Hh.B1←Mem[R+5]↑.Hh.B0;
Mem[R+5]↑.Hh.B0←2;
IF Mem[R+4]↑.Int=0  THEN Mem[R+6]↑.Gr←0.0  ELSE IF(Mem[R+5]↑.Hh.B1=0)AND (Mem
[R+1]↑.Int-T>Mem[R+4]↑.Int) THEN Mem[R+6]↑.Gr←1.0  ELSE Mem[R+6]↑.Gr←PascalFLOAT[(Mem[R
+1]↑.Int-T)]/PascalFLOAT[Mem[R+4]↑.Int]; END;Mem[R+1]↑.Int←W;Mem[R]↑.Hh.B0←0; END--:810
 ELSE--811:--BEGIN Mem[R+1]↑.Int←Mem[Q+1]↑.Int;
IF T=Mem[R+3]↑.Int  THEN BEGIN Mem[R+5]↑.Hh.B0←0;Mem[R+5]↑.Hh.B1←0;
Mem[R+6]↑.Gr←0.0;
 END  ELSE IF T>Mem[R+3]↑.Int  THEN BEGIN Mem[R+5]↑.Hh.B0←1;
IF Mem[R+6]↑.Int=0  THEN Mem[R+6]↑.Gr←0.0  ELSE Mem[R+6]↑.Gr←PascalFLOAT[(T-Mem[R+3]↑.
Int)]/PascalFLOAT[Mem[R+6]↑.Int]; END  ELSE BEGIN Mem[R+5]↑.Hh.B1←Mem[R+5]↑.Hh.B0;
Mem[R+5]↑.Hh.B0←2;
IF Mem[R+4]↑.Int=0  THEN Mem[R+6]↑.Gr←0.0  ELSE IF(Mem[R+5]↑.Hh.B1=0)AND (Mem
[R+3]↑.Int-T>Mem[R+4]↑.Int) THEN Mem[R+6]↑.Gr←1.0  ELSE Mem[R+6]↑.Gr←PascalFLOAT[(Mem[R
+3]↑.Int-T)]/PascalFLOAT[Mem[R+4]↑.Int]; END;Mem[R+3]↑.Int←W;Mem[R]↑.Hh.B0←1; END--:811--;
Mem[R+4]↑.Int←0;IF U#64996  THEN BEGIN Mem[U]↑.Hh.Rh←Mem[R]↑.Hh.Rh;
Mem[R]↑.Hh.Rh←Mem[64996]↑.Hh.Rh;R←U; END--:808--;
R←Mem[Mem[R]↑.Hh.Rh]↑.Hh.Rh;S←Mem[Mem[S]↑.Hh.Rh]↑.Hh.Rh; IF R=0 THEN EXIT; ENDLOOP;
 END--:807-- ELSE IF Mem[Q]↑.Hh.B0=2  THEN--806:
BEGIN IF(Mem[Q+1]↑.Int=-1073741824) THEN Mem[Q+1]↑.Int←Mem[P+1]↑.Int;
IF(Mem[Q+3]↑.Int=-1073741824) THEN Mem[Q+3]↑.Int←Mem[P+3]↑.Int;
IF(Mem[Q+2]↑.Int=-1073741824) THEN Mem[Q+2]↑.Int←Mem[P+2]↑.Int; END--:806--;
Q←Mem[Q]↑.Hh.Rh; END--:805-- ENDLOOP ; END; IF CurGroup#6  THEN Confusion[774];
Unsave[];IF CurGroup#6  THEN Confusion[775];Unsave[];
IF Nest↑[NestPtr-1].ModeField=201  THEN O←Eqtb↑[5216].Int  ELSE O←0;
--801:--Q←Mem[Mem[64992]↑.Hh.Rh]↑.Hh.Rh;DO FlushList[Mem[Q+3]↑.Int];
FlushList[Mem[Q+2]↑.Int];P←Mem[Mem[Q]↑.Hh.Rh]↑.Hh.Rh;
IF Mem[Q+1]↑.Int=-1073741824  THEN--802:--BEGIN Mem[Q+1]↑.Int←0;
R←Mem[Q]↑.Hh.Rh;S←Mem[R+1]↑.Hh.Lh;
IF S#0  THEN BEGIN Mem[0]↑.Hh.Rh←Mem[0]↑.Hh.Rh+1;DeleteGlueRef[S];
Mem[R+1]↑.Hh.Lh←0; END; END--:802--;IF Mem[Q]↑.Hh.Lh#64991  THEN--803:
BEGIN T←Mem[Q+1]↑.Int+Mem[Mem[Mem[Q]↑.Hh.Rh+1]↑.Hh.Lh+1]↑.Int;
R←Mem[Q]↑.Hh.Lh;S←64991;Mem[S]↑.Hh.Lh←P;N←1;
DO Mem[R+1]↑.Int←Mem[R+1]↑.Int-T;U←Mem[R]↑.Hh.Lh;
WHILE  INT[Mem[R]↑.Hh.Rh]>N DO BEGIN S←Mem[S]↑.Hh.Lh;
N←Mem[Mem[S]↑.Hh.Lh]↑.Hh.Rh+1; END ENDLOOP ;
IF  INT[Mem[R]↑.Hh.Rh]<N  THEN BEGIN Mem[R]↑.Hh.Lh←Mem[S]↑.Hh.Lh;Mem[S]↑.Hh.Lh←R;
Mem[R]↑.Hh.Rh← INT[Mem[R]↑.Hh.Rh]-1;S←R;
 END  ELSE BEGIN IF Mem[R+1]↑.Int>Mem[Mem[S]↑.Hh.Lh+1]↑.Int  THEN Mem[Mem[S]↑.
Hh.Lh+1]↑.Int←Mem[R+1]↑.Int;FreeNode[R,2]; END;R←U; IF R=64991 THEN EXIT; ENDLOOP;
 END--:803--;Mem[Q]↑.Hh.B0←13;Mem[Q]↑.Hh.B1←0;Mem[Q+3]↑.Int←0;
Mem[Q+2]↑.Int←0;Mem[Q+5]↑.Hh.B1←0;Mem[Q+5]↑.Hh.B0←0;Mem[Q+6]↑.Int←0;
Mem[Q+4]↑.Int←0;Q←P; IF Q=0--:801-- THEN EXIT; ENDLOOP;--804:--SavePtr←SavePtr-2;
PackBeginLine←-CurList.MlField;
IF CurList.ModeField=-1  THEN BEGIN RuleSave←Eqtb↑[5217].Int;
Eqtb↑[5217].Int←0;
P←Hpack[Mem[64992]↑.Hh.Rh,SaveStack↑[SavePtr+1].Int,SaveStack↑[SavePtr
+0].Int];Eqtb↑[5217].Int←RuleSave;
 END  ELSE BEGIN Q←Mem[Mem[64992]↑.Hh.Rh]↑.Hh.Rh;
DO Mem[Q+3]↑.Int←Mem[Q+1]↑.Int;Mem[Q+1]↑.Int←0;
Q←Mem[Mem[Q]↑.Hh.Rh]↑.Hh.Rh; IF Q=0 THEN EXIT; ENDLOOP;
P←Vpackage[Mem[64992]↑.Hh.Rh,SaveStack↑[SavePtr+1].Int,SaveStack↑
[SavePtr+0].Int,1073741823];Q←Mem[Mem[64992]↑.Hh.Rh]↑.Hh.Rh;
DO Mem[Q+1]↑.Int←Mem[Q+3]↑.Int;Mem[Q+3]↑.Int←0;
Q←Mem[Mem[Q]↑.Hh.Rh]↑.Hh.Rh; IF Q=0 THEN EXIT; ENDLOOP; END;PackBeginLine←0--:804--;
FinAlignInner[];FlushNodeList[P];PopAlignment[];--812:
T←CurList.AuxField;P←Mem[CurList.HeadField]↑.Hh.Rh;
Q←CurList.TailField;PopNest[];IF CurList.ModeField=201  THEN--1206:
BEGIN DoAssignments[];IF CurCmd#3  THEN--1207:
BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];Print[1023]; END;
BEGIN HelpPtr←2;HelpLine↑[1]←753;HelpLine↑[0]←754; END;BackError[];
 END--:1207-- ELSE--1197:--BEGIN GetXToken[];
IF CurCmd#3  THEN BEGIN BEGIN IF Interaction=3  THEN NULL;PrintNl[134];
Print[1019]; END;BEGIN HelpPtr←2;HelpLine↑[1]←1020;HelpLine↑[0]←1021;
 END;BackError[]; END; END--:1197--;PopNest[];
BEGIN Mem[CurList.TailField]↑.Hh.Rh←NewPenalty[Eqtb↑[4778].Int];
CurList.TailField←Mem[CurList.TailField]↑.Hh.Rh; END;
BEGIN Mem[CurList.TailField]↑.Hh.Rh←NewParamGlue[3];
CurList.TailField←Mem[CurList.TailField]↑.Hh.Rh; END;
Mem[CurList.TailField]↑.Hh.Rh←P;IF P#0  THEN CurList.TailField←Q;
BEGIN Mem[CurList.TailField]↑.Hh.Rh←NewPenalty[Eqtb↑[4779].Int];
CurList.TailField←Mem[CurList.TailField]↑.Hh.Rh; END;
BEGIN Mem[CurList.TailField]↑.Hh.Rh←NewParamGlue[4];
CurList.TailField←Mem[CurList.TailField]↑.Hh.Rh; END;
CurList.AuxField←T;ResumeAfterDisplay[]; END--:1206
 ELSE BEGIN CurList.AuxField←T;Mem[CurList.TailField]↑.Hh.Rh←P;
IF P#0  THEN CurList.TailField←Q;
IF CurList.ModeField=1  THEN BuildPage[]; END--:812--; END;--785:

END.