/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation.  All rights reserved. */
/* time: February 27, 1992 5:58:09 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: TEditTouchupImpl, module: TEditTouchupImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [3838666685,2393063922] TEditTouchupImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef word (*fPt)();
typedef struct {word f0, f1;} W2;
typedef struct {word f0, f1, f2, f3;} W4;
#define SOURCE(p, l) /* source p, l */
static void NoName←Q828();
static void TEditTouchupImpl←P0();
static void RefreshOver←P60();
static word NoName←Q888();
static word LockAfterScroll←P120();
static word LockAfterRefresh←P180();
static word LockAfter←P240();
static void UnlockAfterRefresh←P300();
static void Refresh←P360();
static void ScrollToEndOfDoc←P420();
static void ScrollToEndOfSel←P480();
static void NoName←Q948();
static word NoName←Q1008();
static struct {unsigned f; char r[4];} string1 = {131076, "\216\251\000"};
static struct {unsigned f; char r[4];} string2 = {65537, "\001\000\000"};
static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\302\136\246\312\300\076\314\360\376\100\164\000\000"};
static struct {unsigned f; char r[4];} string4 = {196611, "\004A\377"};
static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\343\357\262\137\300\144\166\356\317\100\164\000\000"};
static struct {unsigned f; char r[16];} string6 = {851981, "\006\005\000\001\004\001\054\001\070\001\100\114\001\000\000"};
static struct {unsigned f; char r[16];} string7 = {917520, "\216\257\300\363\223\326\161\300\017\164\046\072\104\350\000"};
static struct {unsigned f; char r[20];} string8 = {1048596, "LockAfterRefresh\000\000\000"};
static struct {unsigned f; char r[8];} string9 = {458760, "Refresh"};
static struct {unsigned f; char r[8];} string10 = {393224, "Update\000"};
static struct {unsigned f; char r[16];} string11 = {851984, "\257\300\344\315\147\275\300\216\243\101\362\100\164\000\000"};
static struct {unsigned f; char r[16];} string12 = {851981, "\006\004\040\001\044\001\100\110\001\100\150\004\007\000\000"};
static struct {unsigned f; char r[16];} string13 = {851984, "\257\300\212\210\334\132\300\036\362\033\164\100\150\000\000"};
static struct {unsigned f; char r[16];} string14 = {851984, "\257\300\237\211\044\154\300\046\105\033\126\100\150\000\000"};
static struct {unsigned f; char r[16];} string15 = {851984, "\257\300\240\236\274\315\300\111\163\325\023\100\150\000\000"};
static struct {unsigned f; char r[16];} string16 = {851984, "\257\300\343\357\262\137\300\144\166\356\317\100\150\000\000"};
static struct {unsigned f; char r[16];} string17 = {851984, "\257\300\312\253\314\243\300\267\126\271\104\100\150\000\000"};
static struct {unsigned f; char r[16];} string18 = {851984, "\257\300\071\221\120\257\300\230\321\322\204\100\150\000\000"};
static struct {unsigned f; char r[16];} string19 = {851984, "\257\300\174\107\267\236\300\027\127\205\140\100\150\000\000"};
static struct {
   word f0[29]; word f29; word f30; word f31; 
   word f32; word f33; word f34; word f35; 
   word f36; word f37; word f38; word f39; 
   word f40; word f41; word f42; word f43; 
   word f44; word f45; word f46[7]; 
   } globalframe = {
   {0}, (word) ScrollToEndOfSel←P480, 0, (word) ScrollToEndOfDoc←P420, 
   0, (word) Refresh←P360, 0, (word) UnlockAfterRefresh←P300, 
   0, (word) LockAfter←P240, 0, (word) LockAfterRefresh←P180, 
   0, (word) LockAfterScroll←P120, 0, (word) RefreshOver←P60, 
   0, (word) TEditTouchupImpl←P0, {0}
   };

static void NoName←Q828()
   {
   register ptr gf←c066 =  (ptr) &globalframe;
   word var←c12760;
   (* (( (ptr) gf←c066)+19) ) = (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2);
   (* (( (ptr) gf←c066)+20) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string4);
   (* (( (ptr) gf←c066)+22) ) = (word) XR←GetTypeIndex((word) &string5, 0, (word) &string6);
   (* (( (ptr) gf←c066)+25) ) = (word) XR←GetTypeIndex((word) &string7, 0, (word) &string2);
   (*  (ptr) (( (bPt) gf←c066)+104) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c066)+25) ), (word) &string8);
   (*  (ptr) (( (bPt) gf←c066)+108) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c066)+19) ), (word) &string9);
   (*  (ptr) (( (bPt) gf←c066)+112) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c066)+19) ), (word) &string10);
   (void) XR←DeclareGlobalFrame((word) "TEditTouchupImpl", &globalframe, (word) XR←GetTypeIndex((word) &string11, 0, (word) &string12)
      , (word) (( (bPt) gf←c066)+180)/* var←c12280 */ );
   var←c12760 = (word) XR←ImportInterface((word) "CedarProcess", (word) XR←GetTypeIndexS((word) (&string13)), 10);
   (* (( (ptr) gf←c066)+50)/* var←c12568 */  ) = var←c12760;
   (void) XR←ImportProcS(var←c12760, 262145);
   var←c12760 = (word) XR←ImportInterface((word) "MonitoredQueue", (word) XR←GetTypeIndexS((word) (&string14)), 9);
   (* (( (ptr) gf←c066)+47)/* var←c12312 */  ) = var←c12760;
   (void) XR←ImportProcS(var←c12760, 67372545);
   (void) XR←ImportProcS(var←c12760, 67109120);
   var←c12760 = (word) XR←ImportInterface((word) "Process", (word) XR←GetTypeIndexS((word) (&string15)), 22);
   (* (( (ptr) gf←c066)+48)/* var←c12376 */  ) = var←c12760;
   (void) XR←ImportProcS(var←c12760, 526081);
   (void) XR←ImportProcS(var←c12760, 67371521);
   (void) XR←ImportProcS(var←c12760, 525570);
   var←c12760 = (word) XR←ImportInterface((word) "TEditDocument", (word) XR←GetTypeIndexS((word) (&string16)), 6);
   (* (( (ptr) gf←c066)+49)/* var←c12504 */  ) = var←c12760;
   (void) XR←ImportProcS(var←c12760, 67372289);
   (void) XR←ImportProcS(var←c12760, 262657);
   (void) XR←ImportProcS(var←c12760, 68157700);
   var←c12760 = (word) XR←ImportInterface((word) "ViewerForkers", (word) XR←GetTypeIndexS((word) (&string17)), 2);
   (* (( (ptr) gf←c066)+51)/* var←c12664 */  ) = var←c12760;
   (void) XR←ImportProcS(var←c12760, 1310725);
   var←c12760 = (word) XR←ExportInterface((word) "TEditRefresh", (word) XR←GetTypeIndexS((word) (&string18)), 3);
   (* (( (ptr) gf←c066)+52)/* var←c12792 */  ) = var←c12760;
   (void) XR←ExportVar(var←c12760, 0, (word) (( (bPt) gf←c066)+72)/* dirtyDocs←v3112 */ );
   (void) XR←ExportProcS(var←c12760, (word) (( (bPt) gf←c066)+124)/* var←c12056 */ , 524546);
   (void) XR←ExportProcS(var←c12760, (word) (( (bPt) gf←c066)+116)/* var←c12024 */ , 786947);
   var←c12760 = (word) XR←ExportInterface((word) "TEditTouchup", (word) XR←GetTypeIndexS((word) (&string19)), 6);
   (* (( (ptr) gf←c066)+52)/* var←c12792 */  ) = var←c12760;
   (void) XR←ExportVar(var←c12760, 0, (word) (( (bPt) gf←c066)+32)/* fullUpdate←v2832 */ );
   (void) XR←ExportVar(var←c12760, 1, (word) (( (bPt) gf←c066)+36)/* refresh←v2860 */ );
   (void) XR←ExportProcS(var←c12760, (word) (( (bPt) gf←c066)+172)/* var←c12248 */ , 512);
   (void) XR←ExportProcS(var←c12760, (word) (( (bPt) gf←c066)+156)/* var←c12184 */ , 67633922);
   (void) XR←ExportProcS(var←c12760, (word) (( (bPt) gf←c066)+164)/* var←c12216 */ , 67634178);
   (void) XR←ExportProcS(var←c12760, (word) (( (bPt) gf←c066)+140)/* var←c12120 */ , 263425);
   }

static void TEditTouchupImpl←P0(formal←c033, formal←c026)
   word formal←c033;
   word formal←c026;
   {
   register ptr gf←c12824 =  (ptr) &globalframe;
   /* TEditTouchupImpl: */ 
SOURCE(381, 2348)
SOURCE(533, 36)
   (* (( (ptr) gf←c12824)+8)/* fullUpdate←v2832 */  ) = (* (( (ptr) gf←c12824)+28) );
SOURCE(571, 34)
   (* (( (ptr) gf←c12824)+9)/* refresh←v2860 */  ) = (* (( (ptr) gf←c12824)+27) );
SOURCE(1543, 61)
   {
      word pd20;
      pd20 = (* (( (ptr) (* (( (ptr) gf←c12824)+47)/* var←c12312 */  ))+5) );
      (* (( (ptr) gf←c12824)+18)/* dirtyDocs←v3112 */  ) = (word) ( *( (fPt) ((*  (ptr) pd20 ))))(pd20);
      };
SOURCE(2636, 93)
SOURCE(2638, 57)
   {
      word var←c12344;
      {
         word pd21;
         pd21 = (* (( (ptr) (* (( (ptr) gf←c12824)+48)/* var←c12376 */  ))+6) );
         var←c12344 = (word) ( *( (fPt) ((*  (ptr) pd21 ))))(50, pd21);
         };
      {
         word pd22;
         pd22 = (* (( (ptr) (* (( (ptr) gf←c12824)+48)/* var←c12376 */  ))+9) );
         (void) ( *( (fPt) ((*  (ptr) pd22 ))))((word) (( (bPt) gf←c12824)+44)/* refreshOver←v3056 */ , var←c12344, pd22);
         };
      };
SOURCE(2697, 30)
   {
      W2 var←c12408;
      {
         W2 var←c030;
         word var←c029;
         var←c029 = XR←ExtensionAlloc(4);
         {
            word tmpAddr23;
            tmpAddr23 = (word) var←c029;
            (*  (ptr) tmpAddr23 ) = ( ((word)  (fPt) NoName←Q1008) );
            (* (( (ptr) tmpAddr23) + 1) ) = 0;
            (* (( (ptr) tmpAddr23) + 2) ) = (word) (( (bPt) gf←c12824)+132)/* var←c12088 */ ;
            (* (( (ptr) tmpAddr23) + 3) ) = 0;
            };
         (void) XR←Fork((word) &var←c030, var←c029);
         var←c12408 = var←c030;
         };
      {
         word pd24;
         pd24 = (* (( (ptr) (* (( (ptr) gf←c12824)+48)/* var←c12376 */  ))+11) );
         (void) ( *( (fPt) ((*  (ptr) pd24 ))))(var←c12408, pd24);
         };
      };
   }

static void RefreshOver←P60()
   {
   W4 var←c12856;
   register ptr gf←c12888 =  (ptr) &globalframe;
   /* RefreshOver: */ 
SOURCE(608, 80)
   (void) (XR←MonitorEntry((word) (( (bPt) gf←c12888)+16)/* LOCK←v2804 */ ));
SOURCE(643, 45)
   {
      word var←c077;
      var←c077 = (word) &var←c12856;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q888) ), ( ((word)  (fPt) NoName←Q948) ), var←c077);
      };
SOURCE(608, 80)
   (void) (XR←MonitorExit((word) (( (bPt) gf←c12888)+16)/* LOCK←v2804 */ ));
   return;
   }

static word NoName←Q888(formal←c070)
   word formal←c070;
   {
   register ptr gf←c069 =  (ptr) &globalframe;
SOURCE(666, 22)
   (void) (XR←Broadcast((word) (( (bPt) gf←c069)+44)/* refreshOver←v3056 */ ));
   return(0);
   }

static word LockAfterScroll←P120(tdd←v3320, who←v3348)
   word tdd←v3320;
   word who←v3348;
   {
   word ok←v3392;
   /* LockAfterScroll: */ 
SOURCE(692, 141)
SOURCE(799, 34)
   return((word) LockAfter←P240(tdd←v3320, who←v3348, 1));
   }

static word LockAfterRefresh←P180(tdd←v3452, who←v3480)
   word tdd←v3452;
   word who←v3480;
   {
   word ok←v3524;
   /* LockAfterRefresh: */ 
SOURCE(839, 143)
SOURCE(947, 35)
   return((word) LockAfter←P240(tdd←v3452, who←v3480, 0));
   }

static word LockAfter←P240(tdd←v3584, who←v3612, scroll←v3640)
   word tdd←v3584;
   word who←v3612;
   word scroll←v3640;
   {
   register ptr gf←c12920 =  (ptr) &globalframe;
   word ok←v3684;
   /* LockAfter: */ 
SOURCE(988, 345)
SOURCE(988, 345)
   ok←v3684 = 1;
SOURCE(1103, 55)
   {
      word var←c12536;
      word pd25;
      pd25 = (* (( (ptr) (* (( (ptr) gf←c12920)+49)/* var←c12504 */  ))+5) );
      var←c12536 = (word) ( *( (fPt) ((*  (ptr) pd25 ))))(tdd←v3584, (* (( (ptr) gf←c12920)+26) ), 0, 0, pd25);
      };
   if ((0 == (* (( (ptr) tdd←v3584)+9) ))) {
SOURCE(1194, 9)
      ok←v3684 = 1;
      }
   else {
      if ((0 != (* (( (ptr) gf←c12920)+10)/* alwaysOK←v3000 */  ))) {
SOURCE(1217, 9)
         ok←v3684 = 1;
         }
      else {
         if ((0 == scroll←v3640) || ((* (( (ptr) tdd←v3584)+17) ) == 0)) {
SOURCE(1259, 10)
            ok←v3684 = 0;
            }
         else {
SOURCE(1282, 9)
            ok←v3684 = 1;
            };
         };
      };
SOURCE(1293, 40)
   if ((0 == ok←v3684)) {
SOURCE(1308, 25)
      {
         word pd26;
         pd26 = (* (( (ptr) (* (( (ptr) gf←c12920)+49)/* var←c12504 */  ))+6) );
         (void) ( *( (fPt) ((*  (ptr) pd26 ))))(tdd←v3584, pd26);
         };
      };
SOURCE(988, 345)
   return(ok←v3684);
   }

static void UnlockAfterRefresh←P300(tdd←v3744)
   word tdd←v3744;
   {
   register ptr gf←c12952 =  (ptr) &globalframe;
   /* UnlockAfterRefresh: */ 
SOURCE(1364, 116)
SOURCE(1439, 41)
   if ((tdd←v3744 != 0)) {
SOURCE(1455, 25)
      {
         word pd27;
         pd27 = (* (( (ptr) (* (( (ptr) gf←c12952)+49)/* var←c12504 */  ))+6) );
         (void) ( *( (fPt) ((*  (ptr) pd27 ))))(tdd←v3744, pd27);
         };
      };
   }

static void Refresh←P360()
   {
   register ptr gf←c12984 =  (ptr) &globalframe;
   /* Refresh: */ 
SOURCE(1607, 471)
SOURCE(1625, 32)
   {
      word pd28;
      pd28 = (* (( (ptr) (* (( (ptr) gf←c12984)+50)/* var←c12568 */  ))+4) );
      (void) ( *( (fPt) ((*  (ptr) pd28 ))))(2, pd28);
      };
SOURCE(1659, 419)
   lab←L100004: ;
SOURCE(1662, 416)
   {
      word var←c12600;
      {
         word pd29;
         pd29 = (* (( (ptr) (* (( (ptr) gf←c12984)+47)/* var←c12312 */  ))+10) );
         var←c12600 = (word) ( *( (fPt) ((*  (ptr) pd29 ))))((* ((( (ptr) gf←c12984)+18)/* dirtyDocs←v3112 */ ) ), pd29);
         };
      if ((var←c12600 == 0)) {
         goto lab←L100005;
         };
      if (((* (( (ptr) gf←c12984)+20) ) == XR←GetReferentType(var←c12600))) {
         {
            word doc←v3992;
            doc←v3992 = var←c12600;
SOURCE(1733, 369)
            {
               word viewer←v4036;
SOURCE(1735, 66)
               {
                  word pd30;
                  pd30 = (* (( (ptr) (* (( (ptr) gf←c12984)+49)/* var←c12504 */  ))+9) );
                  viewer←v4036 = (word) ( *( (fPt) ((*  (ptr) pd30 ))))(doc←v3992, pd30);
                  };
SOURCE(1803, 275)
               if ((viewer←v4036 != 0)) {
SOURCE(1824, 254)
                  {
                     word var←c12632;
                     var←c12632 = (* (( (ptr) viewer←v4036)+26) );
                     if ((var←c12632 == 0)) {
                        goto lab←L100006;
                        };
                     if (((* (( (ptr) gf←c12984)+22) ) == XR←GetReferentType(var←c12632))) {
                        {
                           word tdd←v4080;
                           tdd←v4080 = var←c12632;
SOURCE(1893, 185)
                           {
/*1*/   register word v←v4124;
/*1*/   v←v4124 = viewer←v4036;
/*1*/   lab←L100010: ;
/*1*/   if ((v←v4124 != 0)) {
/*1*/      }
/*1*/   else {
/*1*/      goto lab←L100007;
/*1*/      };
SOURCE(1955, 97)
/*1*/   if ( ( ( ! ((* (( (bPt) v←v4124)+76) ) & 020)) ?  ! ((* (( (bPt) v←v4124)+77) ) & 0100) : 0 ) ) {
SOURCE(1996, 56)
/*1*/      {
/*1*/         word pd31;
/*1*/         pd31 = (* (( (ptr) (* (( (ptr) gf←c12984)+51)/* var←c12664 */  ))+4) );
/*1*/         (void) ( *( (fPt) ((*  (ptr) pd31 ))))(v←v4124, 1, 0, (* (( (ptr) gf←c12984)+9)/* refresh←v2860 */  ), 1, pd31);
/*1*/         };
/*1*/      };
SOURCE(2054, 24)
/*1*/   if (((* (( (ptr) v←v4124)+21) ) == viewer←v4036)) {
SOURCE(2078, 4)
/*1*/      goto lab←L100008;
/*1*/      };
/*1*/   v←v4124 = (* (( (ptr) v←v4124)+21) );
/*1*/   goto lab←L100010;
/*1*/   lab←L100007: ;
/*1*/   lab←L100008: ;
/*1*/   };
                           };
                        }
                     else {
                        lab←L100006: ;
                        };
                     };
                  };
               };
            };
         }
      else {
         lab←L100005: ;
         };
      };
   goto lab←L100004;
   }

static void ScrollToEndOfDoc←P420(viewer←v3820, glitch←v3848)
   word viewer←v3820;
   word glitch←v3848;
   {
   register ptr gf←c13016 =  (ptr) &globalframe;
   /* ScrollToEndOfDoc: */ 
SOURCE(2127, 198)
SOURCE(2206, 119)
   {
      word var←c12696;
      var←c12696 = (* (( (ptr) viewer←v3820)+26) );
      if ((var←c12696 == 0)) {
         goto lab←L100011;
         };
      if (((* (( (ptr) gf←c13016)+22) ) == XR←GetReferentType(var←c12696))) {
         {
            word tdd←v4168;
            tdd←v4168 = var←c12696;
SOURCE(2277, 21)
            (* (( (ptr) tdd←v4168)+17) ) = 1;
SOURCE(2300, 25)
            (* (( (ptr) tdd←v4168)+3) ) = glitch←v3848;
            };
         }
      else {
         lab←L100011: ;
         };
      };
   }

static void ScrollToEndOfSel←P480(viewer←v3908, glitch←v3936, id←v3964)
   word viewer←v3908;
   word glitch←v3936;
   word id←v3964;
   {
   register ptr gf←c13048 =  (ptr) &globalframe;
   /* ScrollToEndOfSel: */ 
SOURCE(2343, 267)
SOURCE(2463, 147)
   {
      word var←c12728;
      var←c12728 = (* (( (ptr) viewer←v3908)+26) );
      if ((var←c12728 == 0)) {
         goto lab←L100012;
         };
      if (((* (( (ptr) gf←c13048)+22) ) == XR←GetReferentType(var←c12728))) {
         {
            word tdd←v4212;
            tdd←v4212 = var←c12728;
SOURCE(2534, 21)
            (* (( (ptr) tdd←v4212)+17) ) = 2;
SOURCE(2557, 25)
            (* (( (ptr) tdd←v4212)+3) ) = glitch←v3936;
SOURCE(2584, 26)
            (* (( (ptr) tdd←v4212)+4) ) = id←v3964;
            };
         }
      else {
         lab←L100012: ;
         };
      };
   }

static void NoName←Q948(formal←c065, formal←c200000, formal←c200001, formal←c200002, formal←c200003)
   word formal←c065;
   word formal←c200000;
   word formal←c200001;
   word formal←c200002;
   word formal←c200003;
   {
   register ptr gf←c076 =  (ptr) &globalframe;
   if ((formal←c200001 == XR←Unwind)) {
      (void) (XR←MonitorExit((word) (( (bPt) gf←c076)+16)/* LOCK←v2804 */ ));
      };
   (*  (ptr) formal←c065 ) = 0;
   (* (( (ptr) formal←c065)+1) ) = 0;
   return;
   }

static word NoName←Q1008(formal←c031)
   word formal←c031;
   {
   word var←c032;
   /* intermediary proc for a FORK, nArgs: 0, nRets: 0 */ 
   var←c032 = (* (( (ptr) formal←c031)+2) );
   formal←c031 = XR←ExtensionFree(formal←c031);
   (void) ( *( (fPt) ((*  (ptr) var←c032 ))))(var←c032);
   return(0);
   }

/* file: TEditTouchupImpl, module: TEditTouchupImpl, compiled at: February 27, 1992 5:58:08 pm PST */ 
extern void XR←install←TEditTouchupImpl() {
   NoName←Q828();
   }
extern void XR←run←TEditTouchupImpl() { XR←Start(&globalframe); }