/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1993 by Xerox Corporation.  All rights reserved. */
/* time: January 26, 1993 8:43:13 pm PST */
/* C2C version: October 7, 1992 (native) */
/* ref-counting: off */
/* file: UnixSysCallsImpl, module: UnixSysCallsImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
#include <sys/mman.h>
static char versionStamp[] = "@(#)mob←version [3903818339,1514255853] UnixSysCallsImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef word (*fPt)();
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef struct {word f0, f1, f2, f3, f4, f5, f6;} W7;
typedef struct {W8 f; W7 r;} W15;
typedef struct {word f0, f1;} W2;
typedef W2 *W2Pt;
#define SOURCE(p, l) /* source p, l */
static void NoName←Q1008();
static void UnixSysCallsImpl←P0();
static word Close←P60();
static word FSync←P120();
static word GetDEnts←P180();
static word GetDTableSize←P240();
static word GetDTableSize1←P300();
static word GetTimeOfDay←P360();
static word LSeek←P420();
static word MMap←P480();
static word MUnmap←P540();
static word Open←P600();
static word Read←P660();
static word FStat←P720();
static word Unlink←P780();
static word Write←P840();
static void AssignStat←P900();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\350\257\212\143\300\132\101\265\355\100\164\000\000"};
static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\011\071\113\334\300\244\027\111\067\100\150\000\000"};
static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\211\056\077\074\300\127\047\310\242\100\150\000\000"};
static struct {unsigned f; char r[16];} string4 = {851984, "\257\300\061\347\231\302\300\102\104\205\246\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[3]; 
   } globalframe = {
   {0}, (word) AssignStat←P900, 0, (word) Write←P840, 
   0, (word) Unlink←P780, 0, (word) FStat←P720, 
   0, (word) Read←P660, 0, (word) Open←P600, 
   0, (word) MUnmap←P540, 0, (word) MMap←P480, 
   0, (word) LSeek←P420, 0, (word) GetTimeOfDay←P360, 
   0, (word) GetDTableSize1←P300, 0, (word) GetDTableSize←P240, 
   0, (word) GetDEnts←P180, 0, (word) FSync←P120, 
   0, (word) Close←P60, 0, (word) UnixSysCallsImpl←P0, 
   {0}
   };
#define CONSTRUCT←MMAP←FLAGS(shared, private, fixed) ( ((word)(shared))*((word)(MAP←SHARED)) + ((word)(private))*((word)(MAP←PRIVATE)) + ((word)(fixed))*((word)(MAP←FIXED)))

static void NoName←Q1008()
   {
   register ptr gf←c073 =  (ptr) &globalframe;
   word var←c12036;
   (void) XR←DeclareGlobalFrame((word) "UnixSysCallsImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string1)), (word) (
         ( (bPt) gf←c073)+136)/* var←c11428 */ );
   var←c12036 = (word) XR←ImportInterface((word) "ProcessorFace", (word) XR←GetTypeIndexS((word) (&string2)), 5);
   (* (( (ptr) gf←c073)+36)/* var←c11844 */  ) = var←c12036;
   (void) XR←ImportProcS(var←c12036, 67109120);
   var←c12036 = (word) XR←ExportInterface((word) "UnixSysCalls", (word) XR←GetTypeIndexS((word) (&string3)), 77);
   (* (( (ptr) gf←c073)+37)/* var←c12068 */  ) = var←c12036;
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+128)/* var←c11396 */ , 67372289);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+120)/* var←c11364 */ , 67373313);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+112)/* var←c11332 */ , 67897859);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+104)/* var←c11300 */ , 67111936);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+88)/* var←c11236 */ , 67640066);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+80)/* var←c11204 */ , 67904515);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+72)/* var←c11172 */ , 68691974);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+64)/* var←c11140 */ , 67643650);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+56)/* var←c11108 */ , 67906563);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+48)/* var←c11076 */ , 67907587);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+40)/* var←c11044 */ , 67650050);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+32)/* var←c11012 */ , 67389697);
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+24)/* var←c10980 */ , 67914499);
   var←c12036 = (word) XR←ExportInterface((word) "UnixSysCallExtensions", (word) XR←GetTypeIndexS((word) (&string4)), 1);
   (* (( (ptr) gf←c073)+37)/* var←c12068 */  ) = var←c12036;
   (void) XR←ExportProcS(var←c12036, (word) (( (bPt) gf←c073)+96)/* var←c11268 */ , 67371009);
   }

static void UnixSysCallsImpl←P0(formal←c021, formal←c020)
   word formal←c021;
   word formal←c020;
   {
   /* UnixSysCallsImpl: */ 
   }

static word Close←P60(fd←v3052)
   word fd←v3052;
   {
   word var←c3096;
   /* Close: */ 
SOURCE(247, 139)
SOURCE(367, 19)
   return((word) XR←Close(fd←v3052));
   }

static word FSync←P120(fd←v3156)
   word fd←v3156;
   {
   word var←c3200;
   /* FSync: */ 
SOURCE(396, 139)
SOURCE(516, 19)
   return((word) XR←FSync(fd←v3156));
   }

static word GetDEnts←P180(fd←v3260, buf←v3288, nBytes←v3316)
   word fd←v3260;
   word buf←v3288;
   word nBytes←v3316;
   {
   word var←c3360;
   /* GetDEnts: */ 
SOURCE(541, 244)
SOURCE(750, 35)
   return((word) XR←GetDEnts(fd←v3260, buf←v3288, nBytes←v3316));
   }

static word GetDTableSize←P240()
   {
   word var←c3420;
   /* GetDTableSize: */ 
SOURCE(792, 151)
SOURCE(918, 25)
   return((word) XR←GetDTableSize());
   }

static word GetDTableSize1←P300(kind←v3480)
   word kind←v3480;
   {
   word var←c3524;
   /* GetDTableSize1: */ 
SOURCE(949, 199)
SOURCE(1113, 35)
   return((word) XR←GetDTableSize1(kind←v3480));
   }

static word GetTimeOfDay←P360(tp←v3584, tzp←v3612)
   word tp←v3584;
   word tzp←v3612;
   {
   word var←c3656;
   /* GetTimeOfDay: */ 
SOURCE(1159, 250)
SOURCE(1378, 31)
   return((word) XR←GetTimeOfDay(tp←v3584, tzp←v3612));
   }

static word LSeek←P420(d←v3716, offset←v3744, whence←v3772)
   word d←v3716;
   word offset←v3744;
   word whence←v3772;
   {
   word var←c3816;
   /* LSeek: */ 
SOURCE(1416, 210)
SOURCE(1592, 34)
   return((word) XR←LSeek(d←v3716, offset←v3744, whence←v3772));
   }

static word MMap←P480(addr←v3876, nbytes←v3904, prot←v3932, flags←v3960, d←v3988, offset←v4016)
   word addr←v3876;
   word nbytes←v3904;
   word prot←v3932;
   word flags←v3960;
   word d←v3988;
   word offset←v4016;
   {
   word var←c4060;
   word var←c11716;
   /* MMap: */ 
SOURCE(1632, 840)
SOURCE(2305, 167)
   var←c11716 = (word) CONSTRUCT←MMAP←FLAGS((flags←v3960 & 1), (((unsigned)flags←v3960 << 30) >> 31), (((unsigned)flags←v3960 << 28) >> 31))
   ;
   if (((word) XR←MMap(addr←v3876, nbytes←v3904, prot←v3932, var←c11716, d←v3988, offset←v4016) == addr←v3876)) {
      return(0);
      }
   else {
      return( (word) -1);
      };
   }

static word MUnmap←P540(addr←v4120, nbytes←v4148)
   word addr←v4120;
   word nbytes←v4148;
   {
   word var←c4192;
   /* MUnmap: */ 
SOURCE(2478, 198)
SOURCE(2646, 30)
   return((word) XR←MUnmap(addr←v4120, nbytes←v4148));
   }

static word Open←P600(path←v4252, flags←v4280, mode←v4308)
   word path←v4252;
   word flags←v4280;
   word mode←v4308;
   {
   word var←c4352;
   /* Open: */ 
SOURCE(2684, 222)
SOURCE(2873, 33)
   return((word) XR←Open(path←v4252, flags←v4280, mode←v4308));
   }

static word Read←P660(d←v4412, buf←v4440, nBytes←v4468)
   word d←v4412;
   word buf←v4440;
   word nBytes←v4468;
   {
   word var←c4512;
   /* Read: */ 
SOURCE(2913, 225)
SOURCE(3108, 30)
   return((word) XR←Read(d←v4412, buf←v4440, nBytes←v4468));
   }

static word FStat←P720(fd←v4572, buf←v4600)
   word fd←v4572;
   word buf←v4600;
   {
   register ptr gf←c12100 =  (ptr) &globalframe;
   word var←c4644;
   /* FStat: */ 
SOURCE(3153, 443)
SOURCE(3427, 169)
   {
      word var←c11876;
      {
         word pd5;
         pd5 = (* (( (ptr) (* (( (ptr) gf←c12100)+36)/* var←c11844 */  ))+5) );
         var←c11876 = (word) ( *( (fPt) ((*  (ptr) pd5 ))))(pd5);
         };
      if ((var←c11876 == 1)) {
SOURCE(3480, 25)
         return((word) XR←FStat(fd←v4572, buf←v4600));
         }
      else {
         if ((var←c11876 == 0)) {
SOURCE(3515, 83)
            {
               W15 buf3←v8092;
               word res←v8120;
SOURCE(3517, 11)
               XR←FillWords(&buf3←v8092, 15, 0);
SOURCE(3530, 29)
               res←v8120 = (word) XR←FStat(fd←v4572, (word) &buf3←v8092);
SOURCE(3561, 22)
               (void) AssignStat←P900(buf←v4600, (word) &buf3←v8092);
SOURCE(3585, 11)
               return(res←v8120);
               };
            }
         else {
SOURCE(3611, 5)
            (void) XR←RaiseUnnamedError();
            };
         };
      };
   }

static word Unlink←P780(path←v4704)
   word path←v4704;
   {
   word var←c4748;
   /* Unlink: */ 
SOURCE(3625, 159)
SOURCE(3762, 22)
   return((word) XR←Unlink(path←v4704));
   }

static word Write←P840(d←v4808, buf←v4836, nBytes←v4864)
   word d←v4808;
   word buf←v4836;
   word nBytes←v4864;
   {
   word var←c4908;
   /* Write: */ 
SOURCE(3793, 203)
SOURCE(3965, 31)
   return((word) XR←Write(d←v4808, buf←v4836, nBytes←v4864));
   }

static void AssignStat←P900(s4←v5508, s3←v5536)
   word s4←v5508;
   word s3←v5536;
   {
   /* AssignStat: */ 
SOURCE(4719, 432)
SOURCE(4804, 15)
   (*  (hPt) s4←v5508 ) = (*  (hPt) s3←v5536 );
SOURCE(4821, 15)
   (* (( (ptr) s4←v5508)+1) ) = XR←ExtractField((word) s3←v5536, 16, 32);
SOURCE(4838, 17)
   (* (( (hPt) s4←v5508)+4) ) = (* (( (hPt) s3←v5536)+3) );
SOURCE(4857, 19)
   (* (( (hPt) s4←v5508)+5) ) = (* (( (hPt) s3←v5536)+4) );
SOURCE(4878, 15)
   (* (( (hPt) s4←v5508)+6) ) = (* (( (hPt) s3←v5536)+5) );
SOURCE(4895, 15)
   (* (( (hPt) s4←v5508)+7) ) = (* (( (hPt) s3←v5536)+6) );
SOURCE(4912, 17)
   (* (( (hPt) s4←v5508)+8) ) = (* (( (hPt) s3←v5536)+7) );
SOURCE(4931, 17)
   (* (( (ptr) s4←v5508)+5) ) = (* (( (ptr) s3←v5536)+4) );
SOURCE(4950, 19)
   (* (( (ptr) s4←v5508)+6) ) = (* (( (ptr) s3←v5536)+5) );
SOURCE(4971, 21)
   (* (( (ptr) s4←v5508)+7) ) = (* (( (ptr) s3←v5536)+6) );
SOURCE(4994, 19)
   (* (( (ptr) s4←v5508)+8) ) = (* (( (ptr) s3←v5536)+7) );
SOURCE(5015, 21)
   (* (( (ptr) s4←v5508)+9) ) = (* (( (ptr) s3←v5536)+8) );
SOURCE(5038, 19)
   (* (( (ptr) s4←v5508)+10) ) = (* (( (ptr) s3←v5536)+9) );
SOURCE(5059, 21)
   (* (( (ptr) s4←v5508)+11) ) = (* (( (ptr) s3←v5536)+10) );
SOURCE(5082, 23)
   (* (( (ptr) s4←v5508)+12) ) = (* (( (ptr) s3←v5536)+11) );
SOURCE(5107, 21)
   (* (( (ptr) s4←v5508)+13) ) = (* (( (ptr) s3←v5536)+12) );
SOURCE(5130, 21)
   (*  (W2Pt) (( (ptr) s4←v5508)+14) ) = (*  (W2Pt) (( (ptr) s3←v5536)+13) );
   }

/* file: UnixSysCallsImpl, module: UnixSysCallsImpl, compiled at: January 26, 1993 8:43:12 pm PST */ 
extern void XR←install←UnixSysCallsImpl() {
   NoName←Q1008();
   }
extern void XR←run←UnixSysCallsImpl() { XR←Start(&globalframe); }