/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation.  All rights reserved. */
/* time: February 27, 1992 5:32:31 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: MonitoredQueueImpl, module: MonitoredQueueImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [4270235943,2854451115] MonitoredQueueImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef struct {word f0, f1, f2, f3, f4, f5, f6;} W7;
typedef word (*fPt)();
typedef struct {word f0, f1, f2, f3, f4, f5;} W6;
typedef struct {word f0, f1, f2, f3, f4;} W5;
#define SOURCE(p, l) /* source p, l */
static void NoName←Q624();
static void MonitoredQueueImpl←P0();
static word Create←P60();
static void Add←P120();
static void AddToSet←P180();
static void AddIt←P240();
static word NoName←Q684();
static word Remove←P300();
static word NoName←Q744();
static void Close←P360();
static word NoName←Q804();
static void Reset←P420();
static word NoName←Q864();
static void NoName←Q924();
static void NoName←Q984();
static void NoName←Q1044();
static void NoName←Q1104();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\376\206\241\047\300\252\043\167\253\100\200\000\000"};
static struct {unsigned f; char r[4];} string2 = {196611, "\004@p"};
static struct {unsigned f; char r[20];} string3 = {1179668, "\260\006\005\146\151\162\163\164\217\005\004\162\145\163\164\214\217\261\000"};
static struct {unsigned f; char r[4];} string4 = {131074, "\004\003\000"};
static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\376\206\241\047\300\252\043\167\253\100\164\000\000"};
static struct {unsigned f; char r[16];} string6 = {851984, "\257\300\237\211\044\154\300\046\105\033\126\100\150\000\000"};
static struct {unsigned f; char r[24];} string7 = {1441816, "\211\012\011\121\165\145\165\145\102\157\144\171\300\237\211\044\154\300\046\105\033\126\000"};
static struct {
   word f0[8]; 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[2]; 
   } globalframe = {
   {0}, (word) Reset←P420, 0, (word) Close←P360, 
   0, (word) Remove←P300, 0, (word) AddIt←P240, 
   0, (word) AddToSet←P180, 0, (word) Add←P120, 
   0, (word) Create←P60, 0, (word) MonitoredQueueImpl←P0, 
   {0}
   };

static void NoName←Q624()
   {
   register ptr gf←c053 =  (ptr) &globalframe;
   word var←c4736;
   (* (( (ptr) gf←c053)+4) ) = (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2);
   (* (( (ptr) gf←c053)+5) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string4);
   (void) XR←DeclareGlobalFrame((word) "MonitoredQueueImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string5)), (word) (
         ( (bPt) gf←c053)+88)/* var←c4544 */ );
   var←c4736 = (word) XR←ExportInterface((word) "MonitoredQueue", (word) XR←GetTypeIndexS((word) (&string6)), 9);
   (* (( (ptr) gf←c053)+24)/* var←c4704 */  ) = var←c4736;
   (void) XR←ExportType((word) "QueueBody", (word) XR←GetTypeIndexS((word) (&string7)), (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2)
      );
   (void) XR←ExportProcS(var←c4736, (word) (( (bPt) gf←c053)+80)/* var←c4512 */ , 67109120);
   (void) XR←ExportProcS(var←c4736, (word) (( (bPt) gf←c053)+72)/* var←c4480 */ , 524802);
   (void) XR←ExportProcS(var←c4736, (word) (( (bPt) gf←c053)+64)/* var←c4448 */ , 525058);
   (void) XR←ExportVar(var←c4736, 4, (word) (( (bPt) gf←c053)+24));
   (void) XR←ExportVar(var←c4736, 5, (word) (( (bPt) gf←c053)+28));
   (void) XR←ExportProcS(var←c4736, (word) (( (bPt) gf←c053)+48)/* var←c4384 */ , 67372545);
   (void) XR←ExportProcS(var←c4736, (word) (( (bPt) gf←c053)+40)/* var←c4352 */ , 263937);
   (void) XR←ExportProcS(var←c4736, (word) (( (bPt) gf←c053)+32)/* var←c4320 */ , 264193);
   }

static void MonitoredQueueImpl←P0(formal←c015, formal←c014)
   word formal←c015;
   word formal←c014;
   {
   /* MonitoredQueueImpl: */ 
   }

static word Create←P60()
   {
   register ptr gf←c4768 =  (ptr) &globalframe;
   word queue←v3124;
   /* Create: */ 
SOURCE(345, 71)
SOURCE(345, 71)
   queue←v3124 = 0;
SOURCE(389, 27)
   return(XR←NewObject(56, (* (( (ptr) gf←c4768)+4) )));
   }

static void Add←P120(item←v3184, queue←v3212)
   word item←v3184;
   word queue←v3212;
   {
   /* Add: */ 
SOURCE(422, 74)
SOURCE(470, 26)
   (void) AddIt←P240(item←v3184, queue←v3212, 0);
   }

static void AddToSet←P180(item←v3284, queue←v3312)
   word item←v3284;
   word queue←v3312;
   {
   /* AddToSet: */ 
SOURCE(500, 78)
SOURCE(553, 25)
   (void) AddIt←P240(item←v3284, queue←v3312, 1);
   }

static void AddIt←P240(formal←c073, formal←c074, formal←c075)
   word formal←c073;
   word formal←c074;
   word formal←c075;
   {
   W7 var←c4800;
   /* declaration of item←v3384 skipped */ 
   /* declaration of queue←v3412 skipped */ 
   /* declaration of toSet←v3440 skipped */ 
   var←c4800.f4/* item←v3384 */  = formal←c073;
   var←c4800.f5/* queue←v3412 */  = formal←c074;
   var←c4800.f6/* toSet←v3440 */  = formal←c075;
   /* AddIt: */ 
SOURCE(582, 511)
   (void) (XR←MonitorEntry(var←c4800.f5/* queue←v3412 */ ));
SOURCE(656, 437)
   {
      word var←c01;
      {
         word var←c061;
         var←c061 = (word) &var←c4800;
         var←c01 = (word) XR←Enable(( ((word)  (fPt) NoName←Q684) ), ( ((word)  (fPt) NoName←Q1104) ), var←c061);
         };
      if ((var←c01 == 1)) {
         goto lab←L02;
         };
      };
SOURCE(582, 511)
   (void) (XR←MonitorExit(var←c4800.f5/* queue←v3412 */ ));
   return;
   lab←L02: ;
   return;
   }

static word NoName←Q684(formal←c056)
   word formal←c056;
   {
   register ptr gf←c055 =  (ptr) &globalframe;
SOURCE(679, 5)
   {
      word new←v3716 = 0;
SOURCE(701, 32)
      if ((0 != (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+7) ))) {
SOURCE(716, 17)
         (void) XR←RaiseError((word) (( (bPt) gf←c055)+24), 0);
         };
SOURCE(735, 145)
      if ((0 != (* (( (ptr) formal←c056)+6) ))) {
SOURCE(785, 95)
         {
            register word list←v3856;
            list←v3856 = (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+4) );
            lab←L100005: ;
            if ((list←v3856 != 0)) {
               }
            else {
               goto lab←L100002;
               };
SOURCE(848, 32)
            if (((*  (ptr) list←v3856 ) == (* (( (ptr) formal←c056)+4) ))) {
SOURCE(874, 6)
               (void) (XR←MonitorExit(* (( (ptr) formal←c056)+5) ));
               return(1);
               };
            list←v3856 = (* (( (ptr) list←v3856)+1) );
            goto lab←L100005;
            lab←L100002: ;
            };
         };
SOURCE(911, 107)
      if (((* (( (ptr) (* (( (ptr) formal←c056)+5) ))+6) ) != 0)) {
SOURCE(932, 10)
         new←v3716 = (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+6) );
SOURCE(944, 16)
         (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+6) ) = (* (( (ptr) (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+6) ))+1) );
SOURCE(962, 14)
         (* (( (ptr) new←v3716)+1) ) = 0;
SOURCE(978, 17)
         (*  (ptr) new←v3716 ) = (* (( (ptr) formal←c056)+4) );
         }
      else {
SOURCE(1002, 16)
         {
            word var←c4640;
            word var←c4672;
            var←c4640 = XR←NewObject(8, (* (( (ptr) gf←c055)+5) ));
            var←c4672 = var←c4640;
            (*  (ptr) var←c4672 ) = (* (( (ptr) formal←c056)+4) );
            new←v3716 = var←c4640;
            };
         };
SOURCE(1020, 47)
      if (((* (( (ptr) (* (( (ptr) formal←c056)+5) ))+5) ) == 0)) {
SOURCE(1036, 17)
         (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+4) ) = new←v3716;
         }
      else {
SOURCE(1053, 14)
         (* (( (ptr) (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+5) ))+1) ) = new←v3716;
         };
SOURCE(1069, 9)
      (* (( (ptr) (* (( (ptr) formal←c056)+5) ))+5) ) = new←v3716;
SOURCE(1080, 13)
      (void) (XR←Notify((word) (( (bPt) (* (( (ptr) formal←c056)+5) ))+32)));
      };
   return(0);
   }

static word Remove←P300(formal←c076)
   word formal←c076;
   {
   W6 var←c4832;
   /* declaration of queue←v3512 skipped */ 
   /* declaration of item←v3556 skipped */ 
   var←c4832.f4/* queue←v3512 */  = formal←c076;
   /* Remove: */ 
SOURCE(1099, 447)
   (void) (XR←MonitorEntry(var←c4832.f4/* queue←v3512 */ ));
SOURCE(1099, 447)
   var←c4832.f5/* item←v3556 */  = 0;
SOURCE(1177, 369)
   {
      word var←c062;
      var←c062 = (word) &var←c4832;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q744) ), ( ((word)  (fPt) NoName←Q1044) ), var←c062);
      };
SOURCE(1099, 447)
   (void) (XR←MonitorExit(var←c4832.f4/* queue←v3512 */ ));
   return(var←c4832.f5/* item←v3556 */ );
   }

static word NoName←Q744(formal←c058)
   word formal←c058;
   {
   register ptr gf←c057 =  (ptr) &globalframe;
SOURCE(1200, 9)
   {
      word current←v3996 = 0;
SOURCE(1226, 42)
      lab←L100010: ;
      if ( ( (0 == (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+7) )) ? ((* (( (ptr) (* (( (ptr) formal←c058)+4) ))+4) ) == 0) : 0 ) ) {
         }
      else {
         goto lab←L100008;
         };
SOURCE(1257, 11)
      (void) (XR←Wait((* (( (ptr) formal←c058)+4) ), (word) (( (bPt) (* (( (ptr) formal←c058)+4) ))+32)));
      goto lab←L100010;
      lab←L100008: ;
SOURCE(1279, 48)
      current←v3996 = (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+4) );
      if ((current←v3996 == 0)) {
SOURCE(1311, 16)
         (void) XR←RaiseError((word) (( (bPt) gf←c057)+28), 0);
         };
SOURCE(1329, 20)
      (* (( (ptr) formal←c058)+5) ) = (*  (ptr) current←v3996 );
SOURCE(1351, 19)
      (*  (ptr) current←v3996 ) = 0;
SOURCE(1372, 20)
      (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+4) ) = (* (( (ptr) current←v3996)+1) );
SOURCE(1394, 19)
      (* (( (ptr) current←v3996)+1) ) = (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+6) );
SOURCE(1415, 14)
      (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+6) ) = current←v3996;
SOURCE(1431, 115)
      if (((* (( (ptr) (* (( (ptr) formal←c058)+4) ))+4) ) == 0)) {
SOURCE(1453, 9)
         (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+5) ) = 0;
SOURCE(1491, 55)
         if ((0 != (* (( (ptr) (* (( (ptr) formal←c058)+4) ))+7) ))) {
SOURCE(1506, 40)
            (void) (XR←Broadcast((word) (( (bPt) (* (( (ptr) formal←c058)+4) ))+32)));
            };
         };
      };
   return(0);
   }

static void Close←P360(formal←c077)
   word formal←c077;
   {
   W5 var←c4864;
   /* declaration of queue←v3628 skipped */ 
   var←c4864.f4/* queue←v3628 */  = formal←c077;
   /* Close: */ 
SOURCE(1551, 146)
   (void) (XR←MonitorEntry(var←c4864.f4/* queue←v3628 */ ));
SOURCE(1604, 93)
   {
      word var←c063;
      var←c063 = (word) &var←c4864;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q804) ), ( ((word)  (fPt) NoName←Q984) ), var←c063);
      };
SOURCE(1551, 146)
   (void) (XR←MonitorExit(var←c4864.f4/* queue←v3628 */ ));
   return;
   }

static word NoName←Q804(formal←c059)
   word formal←c059;
   {
SOURCE(1627, 13)
   (* (( (ptr) (* (( (ptr) formal←c059)+4) ))+7) ) = 1;
SOURCE(1642, 55)
   (void) (XR←Broadcast((word) (( (bPt) (* (( (ptr) formal←c059)+4) ))+32)));
   return(0);
   }

static void Reset←P420(formal←c078)
   word formal←c078;
   {
   W5 var←c4896;
   /* declaration of queue←v3688 skipped */ 
   var←c4896.f4/* queue←v3688 */  = formal←c078;
   /* Reset: */ 
SOURCE(1701, 145)
   (void) (XR←MonitorEntry(var←c4896.f4/* queue←v3688 */ ));
SOURCE(1754, 92)
   {
      word var←c064;
      var←c064 = (word) &var←c4896;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q864) ), ( ((word)  (fPt) NoName←Q924) ), var←c064);
      };
SOURCE(1701, 145)
   (void) (XR←MonitorExit(var←c4896.f4/* queue←v3688 */ ));
   return;
   }

static word NoName←Q864(formal←c060)
   word formal←c060;
   {
SOURCE(1777, 43)
   lab←L100017: ;
   if ((0 == (* (( (ptr) (* (( (ptr) formal←c060)+4) ))+7) )) || ((* (( (ptr) (* (( (ptr) formal←c060)+4) ))+4) ) != 0)) {
      }
   else {
      goto lab←L100015;
      };
SOURCE(1809, 11)
   (void) (XR←Wait((* (( (ptr) formal←c060)+4) ), (word) (( (bPt) (* (( (ptr) formal←c060)+4) ))+32)));
   goto lab←L100017;
   lab←L100015: ;
SOURCE(1831, 15)
   (* (( (ptr) (* (( (ptr) formal←c060)+4) ))+7) ) = 0;
   return(0);
   }

static void NoName←Q924(formal←c037, formal←c200012, formal←c200013, formal←c200014, formal←c200015)
   word formal←c037;
   word formal←c200012;
   word formal←c200013;
   word formal←c200014;
   word formal←c200015;
   {
   if ((formal←c200013 == XR←Unwind)) {
      (void) (XR←MonitorExit(* (( (ptr) formal←c200012)+4) ));
      };
   (*  (ptr) formal←c037 ) = 0;
   (* (( (ptr) formal←c037)+1) ) = 0;
   return;
   }

static void NoName←Q984(formal←c042, formal←c200008, formal←c200009, formal←c200010, formal←c200011)
   word formal←c042;
   word formal←c200008;
   word formal←c200009;
   word formal←c200010;
   word formal←c200011;
   {
   if ((formal←c200009 == XR←Unwind)) {
      (void) (XR←MonitorExit(* (( (ptr) formal←c200008)+4) ));
      };
   (*  (ptr) formal←c042 ) = 0;
   (* (( (ptr) formal←c042)+1) ) = 0;
   return;
   }

static void NoName←Q1044(formal←c047, formal←c200004, formal←c200005, formal←c200006, formal←c200007)
   word formal←c047;
   word formal←c200004;
   word formal←c200005;
   word formal←c200006;
   word formal←c200007;
   {
   if ((formal←c200005 == XR←Unwind)) {
      (void) (XR←MonitorExit(* (( (ptr) formal←c200004)+4) ));
      };
   (*  (ptr) formal←c047 ) = 0;
   (* (( (ptr) formal←c047)+1) ) = 0;
   return;
   }

static void NoName←Q1104(formal←c052, formal←c200000, formal←c200001, formal←c200002, formal←c200003)
   word formal←c052;
   word formal←c200000;
   word formal←c200001;
   word formal←c200002;
   word formal←c200003;
   {
   if ((formal←c200001 == XR←Unwind)) {
      (void) (XR←MonitorExit(* (( (ptr) formal←c200000)+5) ));
      };
   (*  (ptr) formal←c052 ) = 0;
   (* (( (ptr) formal←c052)+1) ) = 0;
   return;
   }

/* file: MonitoredQueueImpl, module: MonitoredQueueImpl, compiled at: February 27, 1992 5:32:31 pm PST */ 
extern void XR←install←MonitoredQueueImpl() {
   NoName←Q624();
   }
extern void XR←run←MonitoredQueueImpl() { XR←Start(&globalframe); }