/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation.  All rights reserved. */
/* time: February 27, 1992 5:55:10 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: TEditBufferedInputImpl, module: TEditBufferedInputImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [4040248180,1506538764] TEditBufferedInputImpl";
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, f4;} W5;
typedef struct {word f0, f1, f2, f3;} W4;
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef struct {W8 f; W4 r;} W12;
#define SOURCE(p, l) /* source p, l */
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
static void NoName←Q732();
static void TEditBufferedInputImpl←P0();
static void BufferedInsertChar←P60();
static word NoName←Q792();
static void BufferedInsertText←P120();
static void WaitForInsertToFinish←P180();
static word NoName←Q852();
static void BufferedInputInsertionProcess←P240();
static word NoName←Q912();
static void WaitForCharsToArrive←P504();
static word NoName←Q972();
static void ProcessCharsInBuffer←P564();
static word NoName←Q1032();
static void NoteInsertionDone←P624();
static word NoName←Q1092();
static word MakeEdits←P300();
static void NoName←Q1152();
static void NoName←Q1212();
static void NoName←Q1272();
static void NoName←Q1332();
static void NoName←Q1392();
static void NoName←Q1452();
static word NoName←Q1512();
static struct {unsigned f; char r[44];} string1 = {2752556, "\260\007\006\154\145\156\147\164\150\210\241\000\200\177\377\005\004\164\145\170\164\254\206\012\011\155\141\170\114\145\156\147\164\150\210\241\000\200\177\377\243\261\000"};
static struct {unsigned f; char r[16];} string2 = {917520, "\216\257\300\363\223\326\161\300\017\164\046\072\104\350\000"};
static struct {unsigned f; char r[4];} string3 = {65537, "\001\000\000"};
static struct {unsigned f; char r[24];} string4 = {1441816, "TEditBufferedInputImpl\000"};
static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\360\321\113\164\300\131\313\365\014\100\164\000\000"};
static struct {unsigned f; char r[12];} string6 = {720907, "\006\003\100\130\001\100\134\001\100\240\001"};
static struct {unsigned f; char r[16];} string7 = {851984, "\257\300\240\236\274\315\300\111\163\325\023\100\150\000\000"};
static struct {unsigned f; char r[16];} string8 = {851984, "\257\300\363\223\326\161\300\017\164\046\072\100\150\000\000"};
static struct {unsigned f; char r[16];} string9 = {851984, "\257\300\261\010\310\246\300\337\340\027\051\100\150\000\000"};
static struct {unsigned f; char r[16];} string10 = {851984, "\257\300\013\141\323\354\300\341\005\243\127\100\150\000\000"};
static struct {unsigned f; char r[12];} string11 = {1413833833, "tInputOps"};
static struct {unsigned f; char r[16];} string12 = {851984, "\257\300\146\107\314\260\300\352\117\305\000\100\150\000\000"};
static struct {unsigned f; char r[16];} string13 = {851984, "\257\300\241\200\031\316\300\154\273\372\020\100\150\000\000"};
static struct {unsigned f; char r[16];} string14 = {851984, "\257\300\071\221\120\257\300\230\321\322\204\100\150\000\000"};
static struct {unsigned f; char r[16];} string15 = {851984, "\257\300\343\112\327\166\300\041\341\335\211\100\150\000\000"};
static struct {
   word f0[21]; word f21; word f22[19]; word f41; 
   word f42; word f43; word f44; word f45; 
   word f46; word f47; word f48; word f49; 
   word f50; word f51; word f52[10]; 
   } globalframe = {
   {0}, 32, {0}, (word) MakeEdits←P300, 
   0, (word) BufferedInputInsertionProcess←P240, 0, (word) WaitForInsertToFinish←P180, 
   0, (word) BufferedInsertText←P120, 0, (word) BufferedInsertChar←P60, 
   0, (word) TEditBufferedInputImpl←P0, {0}
   };

static void NoName←Q732()
   {
   register ptr gf←c099 =  (ptr) &globalframe;
   word var←c13524;
   (* (( (ptr) gf←c099)+36) ) = (word) XR←GetTypeIndexS((word) (&string1));
   (* (( (ptr) gf←c099)+39) ) = (word) XR←GetTypeIndex((word) &string2, 0, (word) &string3);
   (*  (ptr) (( (bPt) gf←c099)+160) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c099)+39) ), (word) &string4);
   (void) XR←DeclareGlobalFrame((word) "TEditBufferedInputImpl", &globalframe, (word) XR←GetTypeIndex((word) &string5, 0, (word) &string6)
      , (word) (( (bPt) gf←c099)+204)/* var←c12692 */ );
   var←c13524 = (word) XR←ImportInterface((word) "Process", (word) XR←GetTypeIndexS((word) (&string7)), 22);
   (* (( (ptr) gf←c099)+53)/* var←c12852 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 264449);
   (void) XR←ImportProcS(var←c13524, 526081);
   (void) XR←ImportProcS(var←c13524, 67371521);
   (void) XR←ImportProcS(var←c13524, 525570);
   var←c13524 = (word) XR←ImportInterface((word) "Rope", (word) XR←GetTypeIndexS((word) (&string8)), 43);
   (* (( (ptr) gf←c099)+54)/* var←c12980 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 67634434);
   (void) XR←ImportProcS(var←c13524, 67373569);
   (void) XR←ImportProcS(var←c13524, 67903235);
   (void) XR←ImportProcS(var←c13524, 67633666);
   var←c13524 = (word) XR←ImportInterface((word) "TextEdit", (word) XR←GetTypeIndexS((word) (&string9)), 39);
   (* (( (ptr) gf←c099)+59)/* var←c13396 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 136585481);
   var←c13524 = (word) XR←ImportInterface((word) "TEditInput", (word) XR←GetTypeIndexS((word) (&string10)), 44);
   (* (( (ptr) gf←c099)+58)/* var←c13364 */  ) = var←c13524;
   var←c13524 = (word) XR←ImportInterface((word) &string11, (word) XR←GetTypeIndexS((word) (&string12)), 66);
   (* (( (ptr) gf←c099)+56)/* var←c13236 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 67379713);
   var←c13524 = (word) XR←ImportInterface((word) "TEditLocks", (word) XR←GetTypeIndexS((word) (&string13)), 7);
   (* (( (ptr) gf←c099)+57)/* var←c13268 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 262913);
   (void) XR←ImportProcS(var←c13524, 67895299);
   var←c13524 = (word) XR←ImportInterface((word) "TEditRefresh", (word) XR←GetTypeIndexS((word) (&string14)), 3);
   (* (( (ptr) gf←c099)+60)/* var←c13492 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 786947);
   var←c13524 = (word) XR←ImportInterface((word) "TEditSelection", (word) XR←GetTypeIndexS((word) (&string15)), 68);
   (* (( (ptr) gf←c099)+55)/* var←c13204 */  ) = var←c13524;
   (void) XR←ImportProcS(var←c13524, 797186);
   (void) XR←ImportProcS(var←c13524, 526338);
   (void) XR←ImportProcS(var←c13524, 134495233);
   (void) XR←ImportProcS(var←c13524, 67114496);
   (void) XR←ImportProcS(var←c13524, 266753);
   (void) XR←ImportProcS(var←c13524, 67386113);
   (void) XR←ImportProcS(var←c13524, 528642);
   (void) XR←ImportProcS(var←c13524, 67110400);
   var←c13524 = (word) XR←ExportInterface((word) &string11, (word) XR←GetTypeIndexS((word) (&string12)), 66);
   (* (( (ptr) gf←c099)+61)/* var←c13556 */  ) = var←c13524;
   (void) XR←ExportProcS(var←c13524, (word) (( (bPt) gf←c099)+196)/* var←c12660 */ , 263425);
   (void) XR←ExportProcS(var←c13524, (word) (( (bPt) gf←c099)+188)/* var←c12628 */ , 263681);
   (void) XR←ExportProcS(var←c13524, (word) (( (bPt) gf←c099)+180)/* var←c12596 */ , 1792);
   }

static void TEditBufferedInputImpl←P0(formal←c040, formal←c029)
   word formal←c040;
   word formal←c029;
   {
   register ptr gf←c13588 =  (ptr) &globalframe;
   /* TEditBufferedInputImpl: */ 
SOURCE(492, 4532)
   /* moved to installation proc */ 
SOURCE(1134, 47)
   {
      word var←c12724;
      word var←c12756;
      word var←c12788;
      {
         word idx16;
         var←c12724 = (
            idx16 = (* (( (ptr) gf←c13588)+21)/* bufferMaxlen←v3000 */  ),
            BCK(idx16, 32768)
            );
         };
      var←c12756 = (((var←c12724 + 3) >> 2) << 2);
      var←c12788 = XR←NewObject((4 + var←c12756), (* (( (ptr) gf←c13588)+36) ));
      (* (( (hPt) var←c12788)+1) ) = var←c12724;
      (* (( (ptr) gf←c13588)+22)/* inputBuffer←v3028 */  ) = var←c12788;
      };
SOURCE(4817, 207)
SOURCE(4819, 83)
   {
      word var←c12820;
      {
         word pd17;
         pd17 = (* (( (ptr) (* (( (ptr) gf←c13588)+53)/* var←c12852 */  ))+6) );
         var←c12820 = (word) ( *( (fPt) ((*  (ptr) pd17 ))))(500, pd17);
         };
      {
         word pd18;
         pd18 = (* (( (ptr) (* (( (ptr) gf←c13588)+53)/* var←c12852 */  ))+9) );
         (void) ( *( (fPt) ((*  (ptr) pd18 ))))((word) (( (bPt) gf←c13588)+96)/* untilTimesOutInALittleWhile←v3084 */ , var←c12820, pd18)
         ;
         };
      };
SOURCE(4904, 57)
   {
      word var←c12884;
      {
         word pd19;
         pd19 = (* (( (ptr) (* (( (ptr) gf←c13588)+53)/* var←c12852 */  ))+6) );
         var←c12884 = (word) ( *( (fPt) ((*  (ptr) pd19 ))))(50, pd19);
         };
      {
         word pd20;
         pd20 = (* (( (ptr) (* (( (ptr) gf←c13588)+53)/* var←c12852 */  ))+9) );
         (void) ( *( (fPt) ((*  (ptr) pd20 ))))((word) (( (bPt) gf←c13588)+120)/* bufferClear←v3112 */ , var←c12884, pd20);
         };
      };
SOURCE(4970, 52)
   {
      W2 var←c12916;
      {
         W2 var←c037;
         word var←c036;
         var←c036 = XR←ExtensionAlloc(4);
         {
            word tmpAddr21;
            tmpAddr21 = (word) var←c036;
            (*  (ptr) tmpAddr21 ) = ( ((word)  (fPt) NoName←Q1512) );
            (* (( (ptr) tmpAddr21) + 1) ) = 0;
            (* (( (ptr) tmpAddr21) + 2) ) = (word) (( (bPt) gf←c13588)+172)/* var←c12564 */ ;
            (* (( (ptr) tmpAddr21) + 3) ) = 0;
            };
         (void) XR←Fork((word) &var←c037, var←c036);
         var←c12916 = var←c037;
         };
      {
         word pd22;
         pd22 = (* (( (ptr) (* (( (ptr) gf←c13588)+53)/* var←c12852 */  ))+11) );
         (void) ( *( (fPt) ((*  (ptr) pd22 ))))(var←c12916, pd22);
         };
      };
   }

static void BufferedInsertChar←P60(formal←c0146)
   word formal←c0146;
   {
   W5 var←c13620;
   /* declaration of char←v3500 skipped */ 
   register ptr gf←c13652 =  (ptr) &globalframe;
   var←c13620.f4/* char←v3500 */  = formal←c0146;
   /* BufferedInsertChar: */ 
SOURCE(1277, 565)
   (void) (XR←MonitorEntry((word) (( (bPt) gf←c13652)+16)/* LOCK←v2888 */ ));
SOURCE(1332, 510)
   {
      word var←c0128;
      var←c0128 = (word) &var←c13620;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q792) ), ( ((word)  (fPt) NoName←Q1452) ), var←c0128);
      };
SOURCE(1277, 565)
   (void) (XR←MonitorExit((word) (( (bPt) gf←c13652)+16)/* LOCK←v2888 */ ));
   return;
   }

static word NoName←Q792(formal←c0103)
   word formal←c0103;
   {
   register ptr gf←c0102 =  (ptr) &globalframe;
SOURCE(1371, 18)
   {
      word count←v3780 = 0;
SOURCE(1391, 229)
      lab←L100004: ;
      if (((*  (hPt) (* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  ) ) >= (* (( (ptr) gf←c0102)+21)/* bufferMaxlen←v3000 */  ))) {
         }
      else {
         goto lab←L100002;
         };
SOURCE(1450, 144)
      count←v3780 = (count←v3780 + 1);
      if (( (int)count←v3780 >  (int)10)) {
SOURCE(1505, 65)
         {
            word var←c12948;
            {
               word pd23;
               pd23 = (* (( (ptr) (* (( (ptr) gf←c0102)+54)/* var←c12980 */  ))+35) );
               var←c12948 = (word) ( *( (fPt) ((*  (ptr) pd23 ))))((* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  ), 0, 32767, pd23);
               };
            {
               word pd24;
               pd24 = (* (( (ptr) (* (( (ptr) gf←c0102)+54)/* var←c12980 */  ))+6) );
               (* (( (ptr) gf←c0102)+23)/* inputRope←v3056 */  ) = (word) ( *( (fPt) ((*  (ptr) pd24 ))))((* (( (ptr) gf←c0102)+23)/* inputRope←v3056 */  ), var←c12948, pd24)
               ;
               };
            };
SOURCE(1572, 22)
         (*  (hPt) (* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  ) ) = 0;
SOURCE(1596, 5)
         goto lab←L100003;
         };
SOURCE(1604, 16)
      (void) (XR←Wait((word) (( (bPt) gf←c0102)+16)/* LOCK←v2888 */ , (word) (( (bPt) gf←c0102)+120)/* bufferClear←v3112 */ ));
      goto lab←L100004;
      lab←L100002: ;
      lab←L100003: ;
SOURCE(1690, 38)
      {
         word var←c13012;
         var←c13012 = (* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  );
         {
            word idx25;
            word limit26;
            (* ((( (bPt) var←c13012)+4)+(
                  idx25 = (word) (*  (hPt) (* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  ) ),
                  limit26 = (word) (* (( (hPt) var←c13012)+1) ),
                  BCK(idx25, limit26)
                  )) ) = (* (( (bPt) formal←c0103)+19) );
            };
         };
SOURCE(1730, 43)
      {
         word idx27;
         (*  (hPt) (* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  ) ) = (
            idx27 = (word) ((*  (hPt) (* (( (ptr) gf←c0102)+22)/* inputBuffer←v3028 */  ) ) + 1),
            BCK(idx27, 32768)
            );
         };
SOURCE(1775, 67)
      if (((* (( (ptr) gf←c0102)+8)/* state←v2916 */  ) == 0)) {
SOURCE(1796, 20)
         (* (( (ptr) gf←c0102)+8)/* state←v2916 */  ) = 1;
SOURCE(1818, 24)
         (void) (XR←Notify((word) (( (bPt) gf←c0102)+36)/* bufferingStarted←v2944 */ ));
         };
      };
   return(0);
   }

static void BufferedInsertText←P120(text←v3560)
   word text←v3560;
   {
   register ptr gf←c13684 =  (ptr) &globalframe;
   /* BufferedInsertText: */ 
SOURCE(1849, 133)
SOURCE(1903, 79)
   {
      register word n←v3824 = 0;
      register word noName←c13044;
      {
         word pd28;
         pd28 = (* (( (ptr) (* (( (ptr) gf←c13684)+54)/* var←c12980 */  ))+14) );
         noName←c13044 = (word) ( *( (fPt) ((*  (ptr) pd28 ))))(text←v3560, pd28);
         };
      if (( (int)n←v3824 >=  (int)noName←c13044)) {
         goto lab←L100005;
         };
      lab←L100008: ;
SOURCE(1943, 39)
      {
         word var←c13076;
         {
            word pd29;
            pd29 = (* (( (ptr) (* (( (ptr) gf←c13684)+54)/* var←c12980 */  ))+9) );
            var←c13076 = (word) ( *( (fPt) ((*  (ptr) pd29 ))))(text←v3560, n←v3824, pd29);
            };
         (void) BufferedInsertChar←P60(var←c13076);
         };
      n←v3824 = (n←v3824 + 1);
      if (( (int)n←v3824 <  (int)noName←c13044)) {
         goto lab←L100008;
         };
      lab←L100005: ;
      };
   }

static void WaitForInsertToFinish←P180()
   {
   W4 var←c13716;
   register ptr gf←c13748 =  (ptr) &globalframe;
   /* WaitForInsertToFinish: */ 
SOURCE(1997, 122)
   (void) (XR←MonitorEntry((word) (( (bPt) gf←c13748)+16)/* LOCK←v2888 */ ));
SOURCE(2042, 77)
   {
      word var←c0129;
      var←c0129 = (word) &var←c13716;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q852) ), ( ((word)  (fPt) NoName←Q1392) ), var←c0129);
      };
SOURCE(1997, 122)
   (void) (XR←MonitorExit((word) (( (bPt) gf←c13748)+16)/* LOCK←v2888 */ ));
   return;
   }

static word NoName←Q852(formal←c0107)
   word formal←c0107;
   {
   register ptr gf←c0106 =  (ptr) &globalframe;
SOURCE(2081, 38)
   lab←L100013: ;
   if (((* (( (ptr) gf←c0106)+8)/* state←v2916 */  ) != 0)) {
      }
   else {
      goto lab←L100011;
      };
SOURCE(2101, 18)
   (void) (XR←Wait((word) (( (bPt) gf←c0106)+16)/* LOCK←v2888 */ , (word) (( (bPt) gf←c0106)+60)/* insertionDone←v2972 */ ));
   goto lab←L100013;
   lab←L100011: ;
   return(0);
   }

static void BufferedInputInsertionProcess←P240()
   {
   W12 var←c13780;
   register ptr gf←c13812 =  (ptr) &globalframe;
   /* declaration of var←c13108 skipped */ 
   /* declaration of var←c13140 skipped */ 
   /* declaration of var←c13172 skipped */ 
   /* declaration of tSel←v3868 skipped */ 
   /* BufferedInputInsertionProcess: */ 
SOURCE(2134, 1657)
   {
      word tmpAddr30;
      tmpAddr30 = (word) (( (ptr) &var←c13780)+4)/* var←c13108 */ ;
      (*  (ptr) tmpAddr30 ) = ( ((word)  (fPt) NoteInsertionDone←P624) );
      (* (( (ptr) tmpAddr30) + 1) ) = 1;
      };
   {
      word tmpAddr31;
      tmpAddr31 = (word) (( (ptr) &var←c13780)+6)/* var←c13140 */ ;
      (*  (ptr) tmpAddr31 ) = ( ((word)  (fPt) ProcessCharsInBuffer←P564) );
      (* (( (ptr) tmpAddr31) + 1) ) = 1;
      };
   {
      word tmpAddr32;
      tmpAddr32 = (word) (( (ptr) &var←c13780)+8)/* var←c13172 */ ;
      (*  (ptr) tmpAddr32 ) = ( ((word)  (fPt) WaitForCharsToArrive←P504) );
      (* (( (ptr) tmpAddr32) + 1) ) = 1;
      };
SOURCE(2174, 54)
   {
      word pd33;
      pd33 = (* (( (ptr) (* (( (ptr) gf←c13812)+55)/* var←c13204 */  ))+10) );
      (* (( (ptr) &var←c13780)+10)/* tSel←v3868 */  ) = (word) ( *( (fPt) ((*  (ptr) pd33 ))))(pd33);
      };
SOURCE(2263, 47)
   {
      word pd34;
      pd34 = (* (( (ptr) (* (( (ptr) gf←c13812)+53)/* var←c12852 */  ))+13) );
      (void) ( *( (fPt) ((*  (ptr) pd34 ))))(3, pd34);
      };
SOURCE(2319, 1472)
   lab←L100016: ;
SOURCE(2319, 1472)
   {
      word editsOK←v3912 = 0;
      /* declaration of root←v3940 skipped */ 
      word rootLocked←v3968 = 0;
SOURCE(2394, 24)
      (* (( (ptr) &var←c13780)+11)/* root←v3940 */  ) = 0;
SOURCE(3317, 22)
      (void) WaitForCharsToArrive←P504((word) ((( (bPt) &var←c13780)+32)/* var←c13172 */ ));
SOURCE(3341, 57)
      {
         word pd35;
         pd35 = (* (( (ptr) (* (( (ptr) gf←c13812)+55)/* var←c13204 */  ))+21) );
         (void) ( *( (fPt) ((*  (ptr) pd35 ))))(0, (* (( (ptr) gf←c13812)+40) ), pd35);
         };
SOURCE(3400, 58)
      {
         word pd36;
         pd36 = (* (( (ptr) (* (( (ptr) gf←c13812)+56)/* var←c13236 */  ))+38) );
         editsOK←v3912 = (word) ( *( (fPt) ((*  (ptr) pd36 ))))((*  (ptr) ((* (( (ptr) (* (( (ptr) gf←c13812)+55)/* var←c13204 */  ))+4)
             )) ), pd36);
         };
SOURCE(3479, 72)
      if ((0 != editsOK←v3912)) {
SOURCE(3495, 56)
         {
            word pd37;
            pd37 = (* (( (ptr) (* (( (ptr) gf←c13812)+55)/* var←c13204 */  ))+63) );
            (* (( (ptr) &var←c13780)+11)/* root←v3940 */  ) = (word) ( *( (fPt) ((*  (ptr) pd37 ))))((*  (ptr) ((* (( (ptr) (* (( (ptr) gf←c13812)+55)
                  /* var←c13204 */  ))+4) )) ), pd37);
            };
         };
SOURCE(3553, 90)
      if (((* (( (ptr) &var←c13780)+11)/* root←v3940 */  ) != 0)) {
SOURCE(3572, 52)
         {
            word var←c13300;
            word pd38;
            pd38 = (* (( (ptr) (* (( (ptr) gf←c13812)+57)/* var←c13268 */  ))+4) );
            var←c13300 = (word) ( *( (fPt) ((*  (ptr) pd38 ))))((* (( (ptr) &var←c13780)+11)/* root←v3940 */  ), (* (( (ptr) gf←c13812)+40)
                ), 1, pd38);
            };
SOURCE(3626, 17)
         rootLocked←v3968 = 1;
         };
SOURCE(3648, 34)
SOURCE(3648, 34)
      {
         word var←c01;
         {
            word var←c0130;
            var←c0130 = (word) &var←c13780;
            var←c01 = (word) XR←Enable(( ((word)  (fPt) NoName←Q912) ), ( ((word)  (fPt) NoName←Q1332) ), var←c0130);
            };
         /* removed trivial cond node */ 
         };
SOURCE(3693, 33)
      {
         word pd39;
         pd39 = (* (( (ptr) (* (( (ptr) gf←c13812)+55)/* var←c13204 */  ))+22) );
         (void) ( *( (fPt) ((*  (ptr) pd39 ))))(0, pd39);
         };
SOURCE(3728, 42)
      if ((0 != rootLocked←v3968)) {
SOURCE(3747, 23)
         {
            word pd40;
            pd40 = (* (( (ptr) (* (( (ptr) gf←c13812)+57)/* var←c13268 */  ))+7) );
            (void) ( *( (fPt) ((*  (ptr) pd40 ))))((* ((( (ptr) &var←c13780)+11)/* root←v3940 */ ) ), pd40);
            };
         };
SOURCE(3772, 19)
      (void) NoteInsertionDone←P624((word) ((( (bPt) &var←c13780)+16)/* var←c13108 */ ));
      };
   goto lab←L100016;
   }

static word NoName←Q912(formal←c0109)
   word formal←c0109;
   {
SOURCE(3648, 34)
   (void) ProcessCharsInBuffer←P564((word) ((( (bPt) formal←c0109)+24)));
   return(0);
   }

static void WaitForCharsToArrive←P504(formal←c13908)
   word formal←c13908;
   {
   W4 var←c13844;
   register ptr gf←c13876 =  (ptr) &globalframe;
   formal←c13908 = (formal←c13908 - 32);
   var←c13844.f0 = formal←c13908;
   /* WaitForCharsToArrive: */ 
SOURCE(2532, 35)
   (void) (XR←MonitorEntry((word) (( (bPt) gf←c13876)+16)/* LOCK←v2888 */ ));
SOURCE(2569, 105)
   {
      word var←c0131;
      var←c0131 = (word) &var←c13844;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q972) ), ( ((word)  (fPt) NoName←Q1272) ), var←c0131);
      };
SOURCE(2532, 35)
   (void) (XR←MonitorExit((word) (( (bPt) gf←c13876)+16)/* LOCK←v2888 */ ));
   return;
   }

static word NoName←Q972(formal←c0113)
   word formal←c0113;
   {
   register ptr gf←c0112 =  (ptr) &globalframe;
SOURCE(2592, 49)
   lab←L100025: ;
   if (((* (( (ptr) gf←c0112)+8)/* state←v2916 */  ) != 1)) {
      }
   else {
      goto lab←L100023;
      };
SOURCE(2620, 21)
   (void) (XR←Wait((word) (( (bPt) gf←c0112)+16)/* LOCK←v2888 */ , (word) (( (bPt) gf←c0112)+36)/* bufferingStarted←v2944 */ )
   );
   goto lab←L100025;
   lab←L100023: ;
SOURCE(2652, 22)
   (* (( (ptr) gf←c0112)+8)/* state←v2916 */  ) = 2;
   return(0);
   }

static void ProcessCharsInBuffer←P564(formal←c14004)
   word formal←c14004;
   {
   W4 var←c13940;
   register ptr gf←c13972 =  (ptr) &globalframe;
   formal←c14004 = (formal←c14004 - 24);
   var←c13940.f0 = formal←c14004;
   /* ProcessCharsInBuffer: */ 
SOURCE(2679, 35)
   (void) (XR←MonitorEntry((word) (( (bPt) gf←c13972)+16)/* LOCK←v2888 */ ));
SOURCE(2716, 376)
   {
      word var←c0132;
      var←c0132 = (word) &var←c13940;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q1032) ), ( ((word)  (fPt) NoName←Q1212) ), var←c0132);
      };
SOURCE(2679, 35)
   (void) (XR←MonitorExit((word) (( (bPt) gf←c13972)+16)/* LOCK←v2888 */ ));
   return;
   }

static word NoName←Q1032(formal←c0117)
   word formal←c0117;
   {
   register ptr gf←c0116 =  (ptr) &globalframe;
SOURCE(2757, 23)
   (* (( (ptr) gf←c0116)+8)/* state←v2916 */  ) = 3;
SOURCE(2782, 283)
   if (((* (( (ptr) (*  (ptr) formal←c0117 ))+11) ) != 0)) {
SOURCE(2799, 143)
      {
         word caretVisible←v4144;
SOURCE(2836, 50)
         {
            word pd41;
            pd41 = (* (( (ptr) (* (( (ptr) gf←c0116)+55)/* var←c13204 */  ))+26) );
            caretVisible←v4144 = (word) ( *( (fPt) ((*  (ptr) pd41 ))))(pd41);
            };
SOURCE(2888, 52)
         lab←L100030: ;
         if ((word) MakeEdits←P300((* (( (ptr) (*  (ptr) formal←c0117 ))+11) ), (* (( (ptr) (*  (ptr) formal←c0117 ))+10) ), caretVisible←v4144)
         ) {
            }
         else {
            goto lab←L100028;
            };
         goto lab←L100030;
         lab←L100028: ;
         };
      }
   else {
SOURCE(3003, 22)
      (*  (hPt) (* (( (ptr) gf←c0116)+22)/* inputBuffer←v3028 */  ) ) = 0;
SOURCE(3027, 15)
      (* (( (ptr) gf←c0116)+23)/* inputRope←v3056 */  ) = 0;
SOURCE(3044, 21)
      (void) (XR←Broadcast((word) (( (bPt) gf←c0116)+120)/* bufferClear←v3112 */ ));
      };
SOURCE(3070, 22)
   (* (( (ptr) gf←c0116)+8)/* state←v2916 */  ) = 4;
   return(0);
   }

static void NoteInsertionDone←P624(formal←c14100)
   word formal←c14100;
   {
   W4 var←c14036;
   register ptr gf←c14068 =  (ptr) &globalframe;
   formal←c14100 = (formal←c14100 - 16);
   var←c14036.f0 = formal←c14100;
   /* NoteInsertionDone: */ 
SOURCE(3097, 32)
   (void) (XR←MonitorEntry((word) (( (bPt) gf←c14068)+16)/* LOCK←v2888 */ ));
SOURCE(3131, 141)
   {
      word var←c0133;
      var←c0133 = (word) &var←c14036;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q1092) ), ( ((word)  (fPt) NoName←Q1152) ), var←c0133);
      };
SOURCE(3097, 32)
   (void) (XR←MonitorExit((word) (( (bPt) gf←c14068)+16)/* LOCK←v2888 */ ));
   return;
   }

static word NoName←Q1092(formal←c0121)
   word formal←c0121;
   {
   register ptr gf←c0120 =  (ptr) &globalframe;
SOURCE(3154, 118)
   {
      word tc42;
      if (((* (( (ptr) gf←c0120)+23)/* inputRope←v3056 */  ) == 0)) {
         tc42 =  (word) ((*  (hPt) (* (( (ptr) gf←c0120)+22)/* inputBuffer←v3028 */  ) ) == 0);
         }
      else {
         tc42 =  (word) 0;
         };
      if (tc42) {
SOURCE(3203, 12)
         (* (( (ptr) gf←c0120)+8)/* state←v2916 */  ) = 0;
SOURCE(3217, 23)
         (void) (XR←Broadcast((word) (( (bPt) gf←c0120)+60)/* insertionDone←v2972 */ ));
         }
      else {
SOURCE(3251, 21)
         (* (( (ptr) gf←c0120)+8)/* state←v2916 */  ) = 1;
         };
      };
   return(0);
   }

static word MakeEdits←P300(root←v3652, tSel←v3680, caretVisible←v3708)
   word root←v3652;
   word tSel←v3680;
   word caretVisible←v3708;
   {
   register ptr gf←c14132 =  (ptr) &globalframe;
   word var←c3752;
   W2 pos←v4188;
   /* MakeEdits: */ 
SOURCE(3806, 997)
SOURCE(3922, 75)
   {
      word pd43;
      pd43 = (* (( (ptr) (* (( (ptr) gf←c14132)+55)/* var←c13204 */  ))+64) );
      (void) ( *( (fPt) ((*  (ptr) pd43 ))))((word) &pos←v4188, (*  (ptr) (* (( (ptr) (* (( (ptr) gf←c14132)+55)/* var←c13204 */  ))+4)
          ) ), pd43);
      };
SOURCE(3999, 90)
   {
      word tc45;
      if ((root←v3652 == 0)) { goto then044;};
      if ((pos←v4188.f0 == 0)) { goto then044;};
      if (((* (( (ptr) gf←c14132)+23)/* inputRope←v3056 */  ) == 0)) {
         tc45 =  (word) ((*  (hPt) (* (( (ptr) gf←c14132)+22)/* inputBuffer←v3028 */  ) ) == 0);
         }
      else {
         tc45 =  (word) 0;
         };
      if (tc45) {
         then044: ;
SOURCE(4076, 13)
         return(0);
         };
      };
SOURCE(4091, 60)
   {
      word pd46;
      pd46 = (* (( (ptr) (* (( (ptr) gf←c14132)+55)/* var←c13204 */  ))+12) );
      (void) ( *( (fPt) ((*  (ptr) pd46 ))))((*  (ptr) (* (( (ptr) (* (( (ptr) gf←c14132)+55)/* var←c13204 */  ))+4) ) ), tSel←v3680, pd46)
      ;
      };
SOURCE(4153, 171)
   {
      W2 var←c13428;
      {
         word var←c13332;
         {
            word pd47;
            pd47 = (* (( (ptr) (* (( (ptr) gf←c14132)+54)/* var←c12980 */  ))+35) );
            var←c13332 = (word) ( *( (fPt) ((*  (ptr) pd47 ))))((* (( (ptr) gf←c14132)+22)/* inputBuffer←v3028 */  ), 0, 32767, pd47)
            ;
            };
         {
            word pd48;
            pd48 = (* (( (ptr) (* (( (ptr) gf←c14132)+59)/* var←c13396 */  ))+37) );
            (void) ( *( (fPt) ((*  (ptr) pd48 ))))((word) &var←c13428, root←v3652, pos←v4188.f0, pos←v4188.f1, 0, var←c13332
               , (* (( (ptr) tSel←v3680)+25) ), 0, 0, (*  (ptr) (* (( (ptr) (* (( (ptr) gf←c14132)+58)/* var←c13364 */  ))+6) ) ), pd48)
            ;
            };
         };
      };
SOURCE(4326, 173)
   if (((* (( (ptr) gf←c14132)+23)/* inputRope←v3056 */  ) != 0)) {
SOURCE(4348, 151)
      {
         W2 var←c13460;
         {
            word pd49;
            pd49 = (* (( (ptr) (* (( (ptr) gf←c14132)+59)/* var←c13396 */  ))+37) );
            (void) ( *( (fPt) ((*  (ptr) pd49 ))))((word) &var←c13460, root←v3652, pos←v4188.f0, pos←v4188.f1, 0, (* (( (ptr) gf←c14132)+23)
               /* inputRope←v3056 */  )
               , (* (( (ptr) tSel←v3680)+25) ), 0, 0, (*  (ptr) (* (( (ptr) (* (( (ptr) gf←c14132)+58)/* var←c13364 */  ))+6) ) ), pd49)
            ;
            };
         };
      };
SOURCE(4501, 63)
   {
      word pd50;
      pd50 = (* (( (ptr) (* (( (ptr) gf←c14132)+54)/* var←c12980 */  ))+14) );
      pos←v4188.f1 = ((pos←v4188.f1 + (*  (hPt) (* (( (ptr) gf←c14132)+22)/* inputBuffer←v3028 */  ) )) + (word) ( *( (fPt) ((*  (ptr) pd50 ))
      ))((* ((( (ptr) gf←c14132)+23)/* inputRope←v3056 */ ) ), pd50));
      };
SOURCE(4566, 44)
   {
      word pd51;
      pd51 = (* (( (ptr) (* (( (ptr) gf←c14132)+55)/* var←c13204 */  ))+46) );
      (void) ( *( (fPt) ((*  (ptr) pd51 ))))(tSel←v3680, pos←v4188, pd51);
      };
SOURCE(4651, 71)
   if ((0 != caretVisible←v3708)) {
SOURCE(4674, 48)
      {
         word pd52;
         pd52 = (* (( (ptr) (* (( (ptr) gf←c14132)+60)/* var←c13492 */  ))+6) );
         (void) ( *( (fPt) ((*  (ptr) pd52 ))))((*  (ptr) tSel←v3680 ), 1, 0, pd52);
         };
      };
SOURCE(4727, 22)
   (*  (hPt) (* (( (ptr) gf←c14132)+22)/* inputBuffer←v3028 */  ) ) = 0;
SOURCE(4751, 15)
   (* (( (ptr) gf←c14132)+23)/* inputRope←v3056 */  ) = 0;
SOURCE(4768, 21)
   (void) (XR←Broadcast((word) (( (bPt) gf←c14132)+120)/* bufferClear←v3112 */ ));
SOURCE(4791, 12)
   return(1);
   }

static void NoName←Q1152(formal←c073, formal←c200020, formal←c200021, formal←c200022, formal←c200023)
   word formal←c073;
   word formal←c200020;
   word formal←c200021;
   word formal←c200022;
   word formal←c200023;
   {
   register ptr gf←c0123 =  (ptr) &globalframe;
   if ((formal←c200021 == XR←Unwind)) {
      (void) (XR←MonitorExit((word) (( (bPt) gf←c0123)+16)/* LOCK←v2888 */ ));
      };
   (*  (ptr) formal←c073 ) = 0;
   (* (( (ptr) formal←c073)+1) ) = 0;
   return;
   }

static void NoName←Q1212(formal←c078, formal←c200016, formal←c200017, formal←c200018, formal←c200019)
   word formal←c078;
   word formal←c200016;
   word formal←c200017;
   word formal←c200018;
   word formal←c200019;
   {
   register ptr gf←c0124 =  (ptr) &globalframe;
   if ((formal←c200017 == XR←Unwind)) {
SOURCE(2733, 22)
      (* (( (ptr) gf←c0124)+8)/* state←v2916 */  ) = 4;
      (void) (XR←MonitorExit((word) (( (bPt) gf←c0124)+16)/* LOCK←v2888 */ ));
      };
   (*  (ptr) formal←c078 ) = 0;
   (* (( (ptr) formal←c078)+1) ) = 0;
   return;
   }

static void NoName←Q1272(formal←c083, formal←c200012, formal←c200013, formal←c200014, formal←c200015)
   word formal←c083;
   word formal←c200012;
   word formal←c200013;
   word formal←c200014;
   word formal←c200015;
   {
   register ptr gf←c0125 =  (ptr) &globalframe;
   if ((formal←c200013 == XR←Unwind)) {
      (void) (XR←MonitorExit((word) (( (bPt) gf←c0125)+16)/* LOCK←v2888 */ ));
      };
   (*  (ptr) formal←c083 ) = 0;
   (* (( (ptr) formal←c083)+1) ) = 0;
   return;
   }

static void NoName←Q1332(formal←c088, formal←c200008, formal←c200009, formal←c200010, formal←c200011)
   word formal←c088;
   word formal←c200008;
   word formal←c200009;
   word formal←c200010;
   word formal←c200011;
   {
   if ((formal←c200009 == XR←Aborted)) {
SOURCE(3682, 9)
      (*  (ptr) formal←c088 ) = 2;
      (* (( (ptr) formal←c088)+1) ) = 2;
      return;
      };
   (*  (ptr) formal←c088 ) = 0;
   (* (( (ptr) formal←c088)+1) ) = 0;
   return;
   }

static void NoName←Q1392(formal←c093, formal←c200004, formal←c200005, formal←c200006, formal←c200007)
   word formal←c093;
   word formal←c200004;
   word formal←c200005;
   word formal←c200006;
   word formal←c200007;
   {
   register ptr gf←c0126 =  (ptr) &globalframe;
   if ((formal←c200005 == XR←Unwind)) {
      (void) (XR←MonitorExit((word) (( (bPt) gf←c0126)+16)/* LOCK←v2888 */ ));
      };
   (*  (ptr) formal←c093 ) = 0;
   (* (( (ptr) formal←c093)+1) ) = 0;
   return;
   }

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

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

/* file: TEditBufferedInputImpl, module: TEditBufferedInputImpl, compiled at: February 27, 1992 5:55:09 pm PST */ 
extern void XR←install←TEditBufferedInputImpl() {
   NoName←Q732();
   }
extern void XR←run←TEditBufferedInputImpl() { XR←Start(&globalframe); }