/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1993 by Xerox Corporation.  All rights reserved. */
/* time: January 26, 1993 3:06:00 pm PST */
/* C2C version: October 7, 1992 (native) */
/* ref-counting: off */
/* file: ProcessImpl, module: ProcessImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [2217094625,2023560745] ProcessImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef struct {word f0, f1;} W2;
typedef W2 *W2Pt;
#define SOURCE(p, l) /* source p, l */
#define MAX(cast, x, y)  ( ( cast x) > ( cast y) ? (x) : (y) )
static void NoName←Q1380();
static void ProcessImpl←P0();
static void InitializeMonitor←P60();
static void InitializeCondition←P120();
static word MsecToTicks←P180();
static word SecondsToTicks←P240();
static word TicksToMsec←P300();
static void SetTimeout←P360();
static void DisableTimeout←P420();
static void Detach←P480();
static void GetCurrent←P540();
static void SetPriority←P600();
static word GetPriority←P660();
static void Abort←P720();
static void CancelAbort←P780();
static word AbortPending←P840();
static void CheckForAbort←P900();
static void DisableAborts←P960();
static void EnableAborts←P1020();
static void Pause←P1080();
static void PauseMsec←P1140();
static void Yield←P1200();
static void ValidateProcess←P1260();
extern void XR←Wait();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\204\046\055\341\300\170\235\026\051\100\164\000\000"};
static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\275\320\070\317\300\004\110\363\366\100\150\000\000"};
static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\240\236\274\315\300\111\163\325\023\100\150\000\000"};
static struct {
   word f0[4]; word f4; word f5; word f6; 
   word f7; word f8; word f9; word f10; 
   word f11; word f12; word f13; word f14; 
   word f15; word f16; word f17; word f18; 
   word f19; word f20; word f21; word f22; 
   word f23; word f24; word f25; word f26; 
   word f27; word f28; 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; 
   word f47; word f48; word f49; word f50; 
   word f51; word f52; word f53[3]; 
   } globalframe = {
   {0}, (word) 1, 0, (word) 1, 
   0, (word) XR←Wait, 0, (word) ValidateProcess←P1260, 
   0, (word) Yield←P1200, 0, (word) PauseMsec←P1140, 
   0, (word) Pause←P1080, 0, (word) EnableAborts←P1020, 
   0, (word) DisableAborts←P960, 0, (word) CheckForAbort←P900, 
   0, (word) AbortPending←P840, 0, (word) CancelAbort←P780, 
   0, (word) Abort←P720, 0, (word) GetPriority←P660, 
   0, (word) SetPriority←P600, 0, (word) GetCurrent←P540, 
   0, (word) Detach←P480, 0, (word) DisableTimeout←P420, 
   0, (word) SetTimeout←P360, 0, (word) TicksToMsec←P300, 
   0, (word) SecondsToTicks←P240, 0, (word) MsecToTicks←P180, 
   0, (word) InitializeCondition←P120, 0, (word) InitializeMonitor←P60, 
   0, (word) ProcessImpl←P0, {0}
   };

static void NoName←Q1380()
   {
   register ptr gf←c066 =  (ptr) &globalframe;
   word var←c9316;
   (void) XR←DeclareGlobalFrame((word) "ProcessImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string1)), (word) (( (bPt) gf←c066)+208)
      /* var←c9124 */ );
   var←c9316 = (word) XR←ImportInterface((word) "RuntimeError", (word) XR←GetTypeIndexS((word) (&string2)), 27);
   (* (( (ptr) gf←c066)+54)/* var←c9156 */  ) = var←c9316;
   var←c9316 = (word) XR←ExportInterface((word) "Process", (word) XR←GetTypeIndexS((word) (&string3)), 22);
   (* (( (ptr) gf←c066)+55)/* var←c9348 */  ) = var←c9316;
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+200)/* var←c9092 */ , 262145);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+192)/* var←c9060 */ , 524546);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+184)/* var←c9028 */ , 67371521);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+176)/* var←c8996 */ , 67371777);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+168)/* var←c8964 */ , 67372033);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+160)/* var←c8932 */ , 525570);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+152)/* var←c8900 */ , 263681);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+144)/* var←c8868 */ , 526081);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+136)/* var←c8836 */ , 134219776);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+128)/* var←c8804 */ , 264449);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+120)/* var←c8772 */ , 67111424);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+112)/* var←c8740 */ , 527105);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+104)/* var←c8708 */ , 527361);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+96)/* var←c8676 */ , 67112192);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+88)/* var←c8644 */ , 3584);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+80)/* var←c8612 */ , 265985);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+72)/* var←c8580 */ , 266241);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+64)/* var←c8548 */ , 266497);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+56)/* var←c8516 */ , 266753);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+48)/* var←c8484 */ , 4864);
   (void) XR←ExportProcS(var←c9316, (word) (( (bPt) gf←c066)+40)/* var←c8452 */ , 529409);
   (void) XR←ExportVar(var←c9316, 21, (word) (( (bPt) gf←c066)+20)/* InvalidProcess←v3252 */ );
   }

static void ProcessImpl←P0(formal←c032, formal←c031)
   word formal←c032;
   word formal←c031;
   {
   register ptr gf←c9380 =  (ptr) &globalframe;
   /* ProcessImpl: */ 
SOURCE(34, 4352)
   /* moved to installation proc */ 
SOURCE(3925, 30)
   (* (( (ptr) gf←c9380)+5)/* InvalidProcess←v3252 */  ) = (* (( (ptr) (* (( (ptr) gf←c9380)+54)/* var←c9156 */  ))+30) );
   /* moved to installation proc */ 
   }

static void InitializeMonitor←P60(monitor←v3472)
   word monitor←v3472;
   {
   /* InitializeMonitor: */ 
SOURCE(205, 162)
SOURCE(354, 13)
   (void) XR←InitializeMonitor(monitor←v3472);
   }

static void InitializeCondition←P120(condition←v3532, ticks←v3560)
   word condition←v3532;
   word ticks←v3560;
   {
   /* InitializeCondition: */ 
SOURCE(373, 211)
SOURCE(562, 22)
   (void) XR←InitializeCondition(condition←v3532, ticks←v3560);
   }

static word MsecToTicks←P180(ms←v3620)
   word ms←v3620;
   {
   word ticks←v3664;
   /* MsecToTicks: */ 
SOURCE(695, 174)
SOURCE(853, 16)
   ticks←v3664 = (word) XR←MsecToTicks(ms←v3620);
SOURCE(695, 174)
   return(ticks←v3664);
   }

static word SecondsToTicks←P240(seconds←v3724)
   word seconds←v3724;
   {
   word ticks←v3768;
   /* SecondsToTicks: */ 
SOURCE(875, 107)
SOURCE(949, 33)
   return((word) MsecToTicks←P180(((word) seconds←v3724 * 1000)));
   }

static word TicksToMsec←P300(ticks←v3828)
   word ticks←v3828;
   {
   word ms←v3872;
   /* TicksToMsec: */ 
SOURCE(988, 174)
SOURCE(1146, 16)
   ms←v3872 = (word) XR←TicksToMsec(ticks←v3828);
SOURCE(988, 174)
   return(ms←v3872);
   }

static void SetTimeout←P360(condition←v3932, ticks←v3960)
   word condition←v3932;
   word ticks←v3960;
   {
   register ptr gf←c9412 =  (ptr) &globalframe;
   /* SetTimeout: */ 
SOURCE(1192, 225)
SOURCE(1363, 30)
   {
      word x4;
      ticks←v3960 = (x4 = (* (( (ptr) gf←c9412)+4)/* minTimeout←v2748 */  ),
         MAX( (unsigned) , ticks←v3960, x4));
      };
SOURCE(1395, 22)
   (void) XR←SetTimeout(condition←v3932, ticks←v3960);
   }

static void DisableTimeout←P420(condition←v4020)
   word condition←v4020;
   {
   /* DisableTimeout: */ 
SOURCE(1423, 166)
SOURCE(1574, 15)
   (void) XR←DisableTimeout(condition←v4020);
   }

static void Detach←P480(p←v4080)
   W2 p←v4080;
   {
   register ptr gf←c9444 =  (ptr) &globalframe;
   /* Detach: */ 
SOURCE(1595, 174)
SOURCE(1727, 42)
   if (( (int)(word) XR←DetachCT((word) (&p←v4080)) !=  (int)0)) {
SOURCE(1746, 23)
      {
         W2 var←c046;
         var←c046 = p←v4080;
         (void) XR←RaiseError((* (( (ptr) gf←c9444)+5)/* InvalidProcess←v3252 */  ), (word) &var←c046);
         };
      };
   }

static void GetCurrent←P540(formal←c048)
   word formal←c048;
   {
   W2 p←v4156;
   /* GetCurrent: */ 
SOURCE(1775, 141)
SOURCE(1775, 141)
   (*  (ptr) (word) &p←v4156 ) = 0;
   (* (( (ptr) (word) &p←v4156) + 1) ) = 0;
SOURCE(1907, 9)
   (void) XR←GetCurrent((word) (&p←v4156));
   /* removed tail goto */ 
   (*  (W2Pt) formal←c048 ) = p←v4156;
   return;
   }

static void SetPriority←P600(p←v4232)
   word p←v4232;
   {
   /* SetPriority: */ 
SOURCE(1956, 117)
SOURCE(2066, 7)
   (void) XR←SetPriority(p←v4232);
   }

static word GetPriority←P660()
   {
   word var←c4292;
   /* GetPriority: */ 
SOURCE(2079, 138)
SOURCE(2202, 15)
   return((word) XR←GetPriority());
   }

static void Abort←P720(p←v4352)
   W2 p←v4352;
   {
   register ptr gf←c9476 =  (ptr) &globalframe;
   /* Abort: */ 
SOURCE(2221, 173)
SOURCE(2352, 42)
   if (( (int)(word) XR←AbortCT((word) (&p←v4352)) !=  (int)0)) {
SOURCE(2371, 23)
      {
         W2 var←c052;
         var←c052 = p←v4352;
         (void) XR←RaiseError((* (( (ptr) gf←c9476)+5)/* InvalidProcess←v3252 */  ), (word) &var←c052);
         };
      };
   }

static void CancelAbort←P780(p←v4428)
   W2 p←v4428;
   {
   register ptr gf←c9508 =  (ptr) &globalframe;
   /* CancelAbort: */ 
SOURCE(2400, 183)
SOURCE(2541, 42)
   if (( (int)(word) XR←CancelAbort((word) (&p←v4428)) !=  (int)0)) {
SOURCE(2560, 23)
      {
         W2 var←c054;
         var←c054 = p←v4428;
         (void) XR←RaiseError((* (( (ptr) gf←c9508)+5)/* InvalidProcess←v3252 */  ), (word) &var←c054);
         };
      };
   }

static word AbortPending←P840()
   {
   word abortPending←v4504;
   /* AbortPending: */ 
SOURCE(2589, 166)
SOURCE(2740, 15)
   return((word) XR←AbortPending());
   }

static void CheckForAbort←P900()
   {
   /* CheckForAbort: */ 
SOURCE(2763, 270)
SOURCE(2972, 61)
   if ((0 != (word) XR←AbortPending())) {
SOURCE(2997, 21)
      {
         word var←c9284;
         var←c9284 = (word) XR←CancelAbort(0);
         };
SOURCE(3020, 13)
      (void) XR←RaiseError(XR←Aborted, 0);
      };
   }

static void DisableAborts←P960(pCondition←v4580)
   word pCondition←v4580;
   {
   /* DisableAborts: */ 
SOURCE(3041, 167)
SOURCE(3192, 16)
   (void) XR←DisableAborts(pCondition←v4580);
   }

static void EnableAborts←P1020(pCondition←v4640)
   word pCondition←v4640;
   {
   /* EnableAborts: */ 
SOURCE(3214, 165)
SOURCE(3363, 16)
   (void) XR←EnableAborts(pCondition←v4640);
   }

static void Pause←P1080(ticks←v4700)
   word ticks←v4700;
   {
   /* Pause: */ 
SOURCE(3385, 163)
SOURCE(3511, 37)
   if (( (int)(word) XR←PauseAbortable(ticks←v4700) !=  (int)0)) {
SOURCE(3535, 13)
      (void) XR←RaiseError(XR←Aborted, 0);
      };
   }

static void PauseMsec←P1140(ms←v4760)
   word ms←v4760;
   {
   word ticks←v7600;
   /* PauseMsec: */ 
SOURCE(3554, 91)
SOURCE(3600, 30)
   ticks←v7600 = (word) MsecToTicks←P180(ms←v4760);
SOURCE(3632, 13)
   (void) Pause←P1080(ticks←v7600);
   }

static void Yield←P1200()
   {
   /* Yield: */ 
SOURCE(3649, 79)
SOURCE(3722, 6)
   (void) XR←Yield();
   }

static void ValidateProcess←P1260(p←v4836)
   W2 p←v4836;
   {
   register ptr gf←c9540 =  (ptr) &globalframe;
   /* ValidateProcess: */ 
SOURCE(3733, 186)
SOURCE(3877, 42)
   if (( (int)(word) XR←ValidateCT((word) (&p←v4836)) !=  (int)0)) {
SOURCE(3896, 23)
      {
         W2 var←c063;
         var←c063 = p←v4836;
         (void) XR←RaiseError((* (( (ptr) gf←c9540)+5)/* InvalidProcess←v3252 */  ), (word) &var←c063);
         };
      };
   }

extern void XR←Wait(lock←v5160, cond←v5188)
   word lock←v5160;
   word cond←v5188;
   {
   register ptr gf←c9572 =  (ptr) &globalframe;
   /* XRWait: */ 
SOURCE(4201, 108)
SOURCE(4249, 60)
   if (( (int)(word) XR←WaitCV(cond←v5188, lock←v5160) !=  (int)0)) {
SOURCE(4282, 27)
      (void) XR←RaiseError((* (( (ptr) (* (( (ptr) gf←c9572)+54)/* var←c9156 */  ))+4) ), 0);
      };
   }

/* file: ProcessImpl, module: ProcessImpl, compiled at: January 26, 1993 3:05:59 pm PST */ 
extern void XR←install←ProcessImpl() {
   NoName←Q1380();
   }
extern void XR←run←ProcessImpl() { XR←Start(&globalframe); }