/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation.  All rights reserved. */
/* time: February 21, 1992 9:03:53 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: RealConvertImpl, module: RealConvertImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
#define XRM←BITAND(x, y) (((word)(x)) & ((word)(y)))
#define XRM←BITOR(x, y) (((word)(x)) | ((word)(y)))
static char versionStamp[] = "@(#)mob←version [1996942531,2646172190] RealConvertImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
#define SOURCE(p, l) /* source p, l */
#define INEG(x)  ( (word) ( - ((int) (word) (x)) ) )
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
static void NoName←Q348();
static void RealConvertImpl←P0();
static word BcplToIeee←P180();
static word IeeeToBcpl←P240();
static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\167\006\354\303\300\235\271\142\036\100\164\000\000"};
static struct {unsigned f; char r[16];} string2 = {851984, "\257\300\262\175\173\150\300\222\117\017\211\100\150\000\000"};
static struct {
   word f0[5]; word f5; word f6; word f7; 
   word f8; word f9; word f10[2]; 
   } globalframe = {
   {0}, (word) IeeeToBcpl←P240, 0, (word) BcplToIeee←P180, 
   0, (word) RealConvertImpl←P0, {0}
   };

static void NoName←Q348()
   {
   register ptr gf←c029 =  (ptr) &globalframe;
   word var←c5984;
   (void) XR←DeclareGlobalFrame((word) "RealConvertImpl", &globalframe, (word) XR←GetTypeIndexS((word) (&string1)), (word) (
         ( (bPt) gf←c029)+36)/* var←c5632 */ );
   var←c5984 = (word) XR←ExportInterface((word) "RealConvert", (word) XR←GetTypeIndexS((word) (&string2)), 3);
   (* (( (ptr) gf←c029)+11)/* var←c5952 */  ) = var←c5984;
   (void) XR←ExportVar(var←c5984, 0, (word) (( (bPt) gf←c029)+16)/* var←c5536 */ );
   (void) XR←ExportProcS(var←c5984, (word) (( (bPt) gf←c029)+28)/* var←c5600 */ , 67371265);
   (void) XR←ExportProcS(var←c5984, (word) (( (bPt) gf←c029)+20)/* var←c5568 */ , 67371521);
   }

static void RealConvertImpl←P0(formal←c08, formal←c07)
   word formal←c08;
   word formal←c07;
   {
   /* RealConvertImpl: */ 
   }

static word BcplToIeee←P180(a←v3164)
   word a←v3164;
   {
   word b←v3208;
   word fl←v3340;
   word frac←v3368;
   word exp←v3396;
   word var←c5728;
   /* BcplToIeee: */ 
SOURCE(882, 848)
SOURCE(955, 55)
   fl←v3340 = ((a←v3164 << 16) + (a←v3164 >> 16));
SOURCE(1044, 93)
   if ((int)fl←v3340<0) {
SOURCE(1062, 59)
      fl←v3340 = INEG(fl←v3340);
SOURCE(1123, 14)
      fl←v3340 = (fl←v3340 & 2147483647) | (((1)) << 31);
      };
SOURCE(1142, 12)
   exp←v3396 = (((unsigned)fl←v3340 << 1) >> 24);
SOURCE(1156, 31)
   frac←v3368 = fl←v3340;
SOURCE(1189, 46)
   {
      word idx3;
      frac←v3368 = (frac←v3368 & 65535) | (((
               idx3 = (word) XRM←BITAND(((unsigned)frac←v3368 >> 16), 127),
               BCK(idx3, 65536)
               )) << 16);
      };
SOURCE(1237, 41)
   if ((frac←v3368 == 0)) {
SOURCE(1257, 21)
      return(0);
      };
SOURCE(1280, 83)
   lab←L100002: ;
   if (((word) XRM←BITAND(((unsigned)frac←v3368 >> 16), 128) == 0)) {
      }
   else {
      goto lab←L100000;
      };
SOURCE(1323, 13)
   exp←v3396 = (exp←v3396 - 1);
SOURCE(1338, 25)
   frac←v3368 = (frac←v3368 + frac←v3368);
   goto lab←L100002;
   lab←L100000: ;
SOURCE(1395, 30)
   exp←v3396 = (exp←v3396 - 1);
SOURCE(1427, 114)
   {
      word var←c5664;
      var←c5664 = exp←v3396;
      if (( (int)var←c5664 <  (int)1)) {
SOURCE(1468, 55)
         {
            register word noName←c5696;
            noName←c5696 = exp←v3396;
            if (( (int)noName←c5696 >  (int)0)) {
               goto lab←L100003;
               };
            lab←L100006: ;
SOURCE(1504, 19)
            frac←v3368 = (frac←v3368 >> 1);
            if (( (int)noName←c5696 >=  (int)0)) {
               goto lab←L100003;
               };
            noName←c5696 = (noName←c5696 + 1);
            goto lab←L100006;
            lab←L100003: ;
            };
SOURCE(1534, 7)
         exp←v3396 = 0;
         }
      else {
         if ( ( ( (int)var←c5664 >=  (int)1) ? ( (int)var←c5664 <=  (int)254) : 0 ) ) {
            }
         else {
SOURCE(1608, 5)
            (void) XR←RaiseUnnamedError();
            };
         };
      };
SOURCE(1615, 73)
   {
      word idx4;
      {
         word var←c5760;
         var←c5760 = (word) XRM←BITAND(((unsigned)frac←v3368 >> 16), 127);
         var←c5728 = (word) Basics←BITSHIFT(var←c5760, 16);
         };
      fl←v3340 = (fl←v3340 & 4286578688) | (( (((unsigned)(
            idx4 = (word) XRM←BITOR(var←c5728, ( (((unsigned)frac←v3368 << 16) >> 16) )),
            BCK(idx4, 8388608)
            ) << 9) >> 9) ));
      };
SOURCE(1690, 12)
   fl←v3340 = (fl←v3340 & 2155872255) | (((BCK(exp←v3396, 256))) << 23);
SOURCE(1704, 26)
   return(fl←v3340);
   }

static word IeeeToBcpl←P240(a←v3268)
   word a←v3268;
   {
   register ptr gf←c6016 =  (ptr) &globalframe;
   word var←c3312;
   word fl←v3440;
   word sign←v3468;
   word frac←v3496;
   word exp←v3524;
   word var←c5888;
   /* IeeeToBcpl: */ 
SOURCE(1736, 1244)
SOURCE(1806, 50)
   fl←v3440 = a←v3268;
SOURCE(1858, 20)
   sign←v3468 = ((int)fl←v3440<0);
SOURCE(1898, 21)
   exp←v3524 = (((unsigned)fl←v3440 << 1) >> 24);
SOURCE(1921, 84)
   {
      word tc5;
      if (((((unsigned)fl←v3440 << 1) >> 24) == 255)) {
         tc5 =  (word) (( (((unsigned)fl←v3440 << 9) >> 9) ) != 0);
         }
      else {
         tc5 =  (word) 0;
         };
      if (tc5) {
SOURCE(1990, 15)
         (void) XR←RaiseError((word) (( (bPt) gf←c6016)+16)/* var←c5536 */ , 0);
         };
      };
SOURCE(2007, 15)
   fl←v3440 = (fl←v3440 & 2147483647) | (((0)) << 31);
SOURCE(2024, 31)
   frac←v3496 = fl←v3440;
SOURCE(2057, 31)
   if ((frac←v3496 == 0)) {
SOURCE(2077, 11)
      return(0);
      };
SOURCE(2090, 46)
   {
      word idx6;
      frac←v3496 = (frac←v3496 & 65535) | (((
               idx6 = (word) XRM←BITAND(((unsigned)frac←v3496 >> 16), 127),
               BCK(idx6, 65536)
               )) << 16);
      };
SOURCE(2138, 641)
   {
      word var←c5792;
      var←c5792 = exp←v3524;
      if (( (int)var←c5792 <  (int)1)) {
SOURCE(2179, 13)
         exp←v3524 = (exp←v3524 + 1);
SOURCE(2194, 77)
         lab←L100009: ;
         if (((word) XRM←BITAND(((unsigned)frac←v3496 >> 16), 128) == 0)) {
            }
         else {
            goto lab←L100007;
            };
SOURCE(2237, 13)
         exp←v3524 = (exp←v3524 - 1);
SOURCE(2252, 19)
         frac←v3496 = (frac←v3496 << 1);
         goto lab←L100009;
         lab←L100007: ;
SOURCE(2282, 19)
         frac←v3496 = (frac←v3496 >> 1);
SOURCE(2303, 30)
         exp←v3524 = (exp←v3524 + 2);
SOURCE(2350, 51)
         lab←L100012: ;
         if (( (int)exp←v3524 <  (int)0)) {
            }
         else {
            goto lab←L100010;
            };
SOURCE(2367, 13)
         exp←v3524 = (exp←v3524 + 1);
SOURCE(2382, 19)
         frac←v3496 = (frac←v3496 >> 1);
         goto lab←L100012;
         lab←L100010: ;
         }
      else {
SOURCE(2428, 33)
         {
            word idx7;
            frac←v3496 = (frac←v3496 & 65535) | (((
                     idx7 = (word) (((unsigned)frac←v3496 >> 16) + 128),
                     BCK(idx7, 65536)
                     )) << 16);
            };
SOURCE(2463, 69)
         {
            word tc8;
            if (((word) XRM←BITAND(( (((unsigned)frac←v3496 << 16) >> 16) ), 1) != 0)) {
               tc8 =  (word) ((word) XRM←BITAND(( (((unsigned)frac←v3496 << 16) >> 16) ), 2) != 0);
               }
            else {
               tc8 =  (word) 0;
               };
            if (tc8) {
SOURCE(2511, 21)
               frac←v3496 = (frac←v3496 + 1);
               };
            };
SOURCE(2534, 19)
         frac←v3496 = (frac←v3496 >> 1);
SOURCE(2555, 30)
         exp←v3524 = (exp←v3524 + 2);
SOURCE(2587, 74)
         if (((word) XRM←BITAND(((unsigned)frac←v3496 >> 16), 128) != 0)) {
SOURCE(2627, 13)
            exp←v3524 = (exp←v3524 + 1);
SOURCE(2642, 19)
            frac←v3496 = (frac←v3496 >> 1);
            };
SOURCE(2666, 113)
         if (( (int)exp←v3524 >  (int)255)) {
SOURCE(2685, 94)
            {
               word var←c5824;
               {
                  word n←v5488;
                  n←v5488 =  ( ((int)fl←v3440<0) ? 2147483648 : 2147483647 ) ;
SOURCE(843, 33)
                  var←c5824 = ((n←v5488 << 16) + (n←v5488 >> 16));
                  };
               return(var←c5824);
               };
            };
         };
      };
SOURCE(2784, 73)
   {
      word idx9;
      {
         word var←c5920;
         var←c5920 = (word) XRM←BITAND(((unsigned)frac←v3496 >> 16), 127);
         var←c5888 = (word) Basics←BITSHIFT(var←c5920, 16);
         };
      fl←v3440 = (fl←v3440 & 4286578688) | (( (((unsigned)(
            idx9 = (word) XRM←BITOR(var←c5888, ( (((unsigned)frac←v3496 << 16) >> 16) )),
            BCK(idx9, 8388608)
            ) << 9) >> 9) ));
      };
SOURCE(2859, 12)
   fl←v3440 = (fl←v3440 & 2155872255) | (((BCK(exp←v3524, 256))) << 23);
SOURCE(2873, 63)
   if ((0 != sign←v3468)) {
SOURCE(2886, 50)
      fl←v3440 = INEG(fl←v3440);
      };
SOURCE(2938, 42)
   return(((fl←v3440 << 16) + (fl←v3440 >> 16)));
   }

/* file: RealConvertImpl, module: RealConvertImpl, compiled at: February 21, 1992 9:03:53 pm PST */ 
extern void XR←install←RealConvertImpl() {
   NoName←Q348();
   }
extern void XR←run←RealConvertImpl() { XR←Start(&globalframe); }