/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation.  All rights reserved. */
/* time: February 24, 1992 7:58:37 pm PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: CBitmapReaderImpl, module: CBitmapReaderImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [1490841206,658824436] CBitmapReaderImpl";
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;} W6;
typedef struct {word f0, f1;} W2;
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef W2 *W2Pt;
typedef struct {word f0, f1, f2, f3;} W4;
#define SOURCE(p, l) /* source p, l */
#define IOP2(op, x, y)  ( (word) ((x) op (y)) )
static void NoName←Q552();
static void CBitmapReaderImpl←P0();
static void Err←P60();
static word ScanNum←P120();
static word Hex←P240();
static void FromStream←P180();
static word NoName←Q612();
static void NoName←Q672();
static struct {unsigned f; char r[44];} string1 = {2818092, "\216\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"};
static struct {unsigned f; char r[4];} string2 = {65537, "\001\000\000"};
static struct {unsigned f; char r[16];} string3 = {917520, "\216\257\300\363\223\326\161\300\017\164\046\072\104\350\000"};
static struct {unsigned f; char r[8];} string4 = {393224, "←width\000"};
static struct {unsigned f; char r[16];} string5 = {983056, "width not found"};
static struct {unsigned f; char r[8];} string6 = {458760, "←height"};
static struct {unsigned f; char r[20];} string7 = {1048596, "height not found\000\000\000"};
static struct {unsigned f; char r[8];} string8 = {393224, "←x←hot\000"};
static struct {unsigned f; char r[8];} string9 = {393224, "←y←hot\000"};
static struct {unsigned f; char r[20];} string10 = {1179668, "hottspot not found\000"};
static struct {unsigned f; char r[8];} string11 = {393224, "format\000"};
static struct {unsigned f; char r[16];} string12 = {851984, "\257\300\130\334\156\166\300\047\104\334\364\100\164\000\000"};
static struct {unsigned f; char r[8];} string13 = {393222, "\006\001$\004@\377\000"};
static struct {unsigned f; char r[16];} string14 = {851984, "\257\300\255\053\300\023\300\142\135\315\105\100\150\000\000"};
static struct {unsigned f; char r[16];} string15 = {851984, "\257\300\213\226\301\143\300\072\355\320\373\100\150\000\000"};
static struct {unsigned f; char r[16];} string16 = {851984, "\257\300\015\277\004\146\300\034\367\146\045\100\164\000\000"};
static struct {unsigned f; char r[16];} string17 = {851984, "\257\300\363\223\326\161\300\017\164\046\072\100\150\000\000"};
static struct {unsigned f; char r[16];} string18 = {851984, "\257\300\237\145\317\332\300\336\102\337\137\100\150\000\000"};
static struct {
   word f0[18]; word f18; word f19; word f20; 
   word f21; word f22; word f23; word f24; 
   word f25[6]; 
   } globalframe = {
   {0}, (word) FromStream←P180, 0, (word) ScanNum←P120, 
   0, (word) Err←P60, 0, (word) CBitmapReaderImpl←P0, 
   {0}
   };

static void NoName←Q552()
   {
   register ptr gf←c059 =  (ptr) &globalframe;
   word var←c10884;
   (* (( (ptr) gf←c059)+5) ) = (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2);
   (* (( (ptr) gf←c059)+8) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string2);
   (*  (ptr) (( (bPt) gf←c059)+36) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+8) ), (word) &string4);
   (*  (ptr) (( (bPt) gf←c059)+40) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+5) ), (word) &string5);
   (*  (ptr) (( (bPt) gf←c059)+44) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+8) ), (word) &string6);
   (*  (ptr) (( (bPt) gf←c059)+48) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+5) ), (word) &string7);
   (*  (ptr) (( (bPt) gf←c059)+52) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+8) ), (word) &string8);
   (*  (ptr) (( (bPt) gf←c059)+56) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+8) ), (word) &string9);
   (*  (ptr) (( (bPt) gf←c059)+60) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+5) ), (word) &string10);
   (*  (ptr) (( (bPt) gf←c059)+64) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c059)+5) ), (word) &string11);
   (void) XR←DeclareGlobalFrame((word) "CBitmapReaderImpl", &globalframe, (word) XR←GetTypeIndex((word) &string12, 0, (word) &string13)
      , (word) (( (bPt) gf←c059)+96)/* var←c10404 */ );
   var←c10884 = (word) XR←ImportInterface((word) "Convert", (word) XR←GetTypeIndexS((word) (&string14)), 73);
   (* (( (ptr) gf←c059)+28)/* var←c10564 */  ) = var←c10884;
   (void) XR←ImportProcS(var←c10884, 67634690);
   var←c10884 = (word) XR←ImportInterface((word) "ImagerSample", (word) XR←GetTypeIndexS((word) (&string15)), 60);
   (* (( (ptr) gf←c059)+29)/* var←c10756 */  ) = var←c10884;
   (void) XR←ImportProcS(var←c10884, 1320708);
   (void) XR←ImportProcS(var←c10884, 273409);
   (void) XR←ImportProcS(var←c10884, 68685571);
   var←c10884 = (word) XR←ImportInterface((word) "IO", (word) XR←GetTypeIndexS((word) (&string16)), 103);
   (* (( (ptr) gf←c059)+27)/* var←c10532 */  ) = var←c10884;
   (void) XR←ImportProcS(var←c10884, 67393281);
   (void) XR←ImportProcS(var←c10884, 67372801);
   var←c10884 = (word) XR←ImportInterface((word) "Rope", (word) XR←GetTypeIndexS((word) (&string17)), 43);
   (* (( (ptr) gf←c059)+26)/* var←c10468 */  ) = var←c10884;
   (void) XR←ImportProcS(var←c10884, 67898627);
   (void) XR←ImportProcS(var←c10884, 68159492);
   (void) XR←ImportProcS(var←c10884, 67903235);
   var←c10884 = (word) XR←ExportInterface((word) "CBitmapReader", (word) XR←GetTypeIndexS((word) (&string18)), 2);
   (* (( (ptr) gf←c059)+30)/* var←c10916 */  ) = var←c10884;
   (void) XR←ExportVar(var←c10884, 0, (word) (( (bPt) gf←c059)+68)/* var←c10276 */ );
   (void) XR←ExportProcS(var←c10884, (word) (( (bPt) gf←c059)+72)/* var←c10308 */ , 201588993);
   }

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

static void Err←P60(rt←v2932)
   word rt←v2932;
   {
   register ptr gf←c10948 =  (ptr) &globalframe;
   /* Err: */ 
SOURCE(231, 63)
SOURCE(260, 34)
   {
      word var←c10436;
      {
         word pd19;
         pd19 = (* (( (ptr) (* (( (ptr) gf←c10948)+26)/* var←c10468 */  ))+35) );
         var←c10436 = (word) ( *( (fPt) ((*  (ptr) pd19 ))))(rt←v2932, 0, 32767, pd19);
         };
      {
         word var←c018;
         var←c018 = var←c10436;
         (void) XR←RaiseError((word) (( (bPt) gf←c10948)+68)/* var←c10276 */ , (word) &var←c018);
         };
      };
   }

static word ScanNum←P120(stream←v3004)
   word stream←v3004;
   {
   W6 var←c10980;
   register ptr gf←c11012 =  (ptr) &globalframe;
   word val←v3048;
   /* declaration of var←c10500 skipped */ 
   word low←v3236;
   word high←v3264;
   word ch←v3292;
   /* ScanNum: */ 
SOURCE(298, 379)
   {
      word tmpAddr20;
      tmpAddr20 = (word) (( (ptr) &var←c10980)+4)/* var←c10500 */ ;
      (*  (ptr) tmpAddr20 ) = ( ((word)  (fPt) Hex←P240) );
      (* (( (ptr) tmpAddr20) + 1) ) = 1;
      };
SOURCE(539, 29)
   {
      word pd21;
      pd21 = (* (( (ptr) (* (( (ptr) gf←c11012)+27)/* var←c10532 */  ))+11) );
      ch←v3292 = (word) ( *( (fPt) ((*  (ptr) pd21 ))))(stream←v3004, pd21);
      };
SOURCE(570, 46)
   lab←L100002: ;
   if ((ch←v3292 != 120)) {
      }
   else {
      goto lab←L100000;
      };
SOURCE(585, 31)
   {
      word pd22;
      pd22 = (* (( (ptr) (* (( (ptr) gf←c11012)+27)/* var←c10532 */  ))+11) );
      ch←v3292 = (word) ( *( (fPt) ((*  (ptr) pd22 ))))(stream←v3004, pd22);
      };
   goto lab←L100002;
   lab←L100000: ;
SOURCE(618, 18)
   high←v3264 = (word) Hex←P240(stream←v3004, (word) (( (bPt) &var←c10980)+16)/* var←c10500 */ );
SOURCE(638, 17)
   low←v3236 = (word) Hex←P240(stream←v3004, (word) (( (bPt) &var←c10980)+16)/* var←c10500 */ );
SOURCE(657, 20)
   return((IOP2( * ,  (int)high←v3264,  (int)16) + low←v3236));
   }

static word Hex←P240(stream←v3368, formal←c11076)
   word stream←v3368;
   word formal←c11076;
   {
   register ptr gf←c11044 =  (ptr) &globalframe;
   word i←v3412;
   word ch←v3440;
   formal←c11076 = (formal←c11076 - 16);
   /* Hex: */ 
SOURCE(355, 165)
SOURCE(406, 29)
   {
      word pd23;
      pd23 = (* (( (ptr) (* (( (ptr) gf←c11044)+27)/* var←c10532 */  ))+11) );
      ch←v3440 = (word) ( *( (fPt) ((*  (ptr) pd23 ))))(stream←v3368, pd23);
      };
SOURCE(437, 83)
   if (((ch←v3440 - 48) <= 9)) {
SOURCE(462, 30)
      return((ch←v3440 - 48));
      }
   else {
SOURCE(492, 28)
      return(((ch←v3440 - 97) + 10));
      };
   }

static void FromStream←P180(formal←c031, formal←c072)
   word formal←c031;
   word formal←c072;
   {
   W8 var←c11108;
   /* declaration of stream←v3108 skipped */ 
   /* declaration of sm←v3152 skipped */ 
   /* declaration of hotSpot←v3180 skipped */ 
   var←c11108.f4/* stream←v3108 */  = formal←c072;
   /* FromStream: */ 
SOURCE(683, 1384)
SOURCE(683, 1384)
   var←c11108.f5/* sm←v3152 */  = 0;
SOURCE(683, 1384)
   var←c11108.f6 = 0;
   var←c11108.f7 = 0;
SOURCE(810, 1257)
   {
      word var←c067;
      var←c067 = (word) &var←c11108;
       (void) (word) XR←Enable(( ((word)  (fPt) NoName←Q612) ), ( ((word)  (fPt) NoName←Q672) ), var←c067);
      };
   /* removed tail goto */ 
   (*  (ptr) formal←c031 ) = var←c11108.f5/* sm←v3152 */ ;
   (*  (W2Pt) (( (ptr) formal←c031)+1) ) = (*  (W2Pt) (( (ptr) &var←c11108)+6)/* hotSpot←v3180 */  );
   return;
   }

static word NoName←Q612(formal←c065)
   word formal←c065;
   {
   register ptr gf←c064 =  (ptr) &globalframe;
SOURCE(881, 15)
   {
      word line←v3484 = 0;
      word pos←v3512;
      word width←v3540;
      word height←v3568;
SOURCE(928, 29)
      {
         word pd24;
         pd24 = (* (( (ptr) (* (( (ptr) gf←c064)+27)/* var←c10532 */  ))+91) );
         line←v3484 = (word) ( *( (fPt) ((*  (ptr) pd24 ))))((* ((( (ptr) formal←c065)+4)) ), pd24);
         };
SOURCE(959, 39)
      {
         word pd25;
         pd25 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+12) );
         pos←v3512 = (word) ( *( (fPt) ((*  (ptr) pd25 ))))(line←v3484, (* (( (ptr) gf←c064)+9) ), 2147483647, 1, pd25);
         };
SOURCE(1000, 36)
      if (( (int)pos←v3512 <  (int)0)) {
SOURCE(1014, 22)
         (void) Err←P60((* ((( (ptr) gf←c064)+10)) ));
         };
SOURCE(1039, 53)
      {
         word var←c10596;
         {
            word pd26;
            pd26 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+17) );
            var←c10596 = (word) ( *( (fPt) ((*  (ptr) pd26 ))))(line←v3484, (pos←v3512 + 6), 2147483647, pd26);
            };
         {
            word pd27;
            pd27 = (* (( (ptr) (* (( (ptr) gf←c064)+28)/* var←c10564 */  ))+10) );
            width←v3540 = (word) ( *( (fPt) ((*  (ptr) pd27 ))))(var←c10596, 8, pd27);
            };
         };
SOURCE(1094, 29)
      {
         word pd28;
         pd28 = (* (( (ptr) (* (( (ptr) gf←c064)+27)/* var←c10532 */  ))+91) );
         line←v3484 = (word) ( *( (fPt) ((*  (ptr) pd28 ))))((* ((( (ptr) formal←c065)+4)) ), pd28);
         };
SOURCE(1125, 40)
      {
         word pd29;
         pd29 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+12) );
         pos←v3512 = (word) ( *( (fPt) ((*  (ptr) pd29 ))))(line←v3484, (* (( (ptr) gf←c064)+11) ), 2147483647, 1, pd29);
         };
SOURCE(1167, 37)
      if (( (int)pos←v3512 <  (int)0)) {
SOURCE(1181, 23)
         (void) Err←P60((* ((( (ptr) gf←c064)+12)) ));
         };
SOURCE(1207, 54)
      {
         word var←c10628;
         {
            word pd30;
            pd30 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+17) );
            var←c10628 = (word) ( *( (fPt) ((*  (ptr) pd30 ))))(line←v3484, (pos←v3512 + 7), 2147483647, pd30);
            };
         {
            word pd31;
            pd31 = (* (( (ptr) (* (( (ptr) gf←c064)+28)/* var←c10564 */  ))+10) );
            height←v3568 = (word) ( *( (fPt) ((*  (ptr) pd31 ))))(var←c10628, 8, pd31);
            };
         };
SOURCE(1263, 29)
      {
         word pd32;
         pd32 = (* (( (ptr) (* (( (ptr) gf←c064)+27)/* var←c10532 */  ))+91) );
         line←v3484 = (word) ( *( (fPt) ((*  (ptr) pd32 ))))((* ((( (ptr) formal←c065)+4)) ), pd32);
         };
SOURCE(1294, 39)
      {
         word pd33;
         pd33 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+12) );
         pos←v3512 = (word) ( *( (fPt) ((*  (ptr) pd33 ))))(line←v3484, (* (( (ptr) gf←c064)+13) ), 2147483647, 1, pd33);
         };
SOURCE(1335, 278)
      if (( (int)pos←v3512 >=  (int)0)) {
SOURCE(1352, 57)
         {
            word var←c10660;
            {
               word pd34;
               pd34 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+17) );
               var←c10660 = (word) ( *( (fPt) ((*  (ptr) pd34 ))))(line←v3484, (pos←v3512 + 6), 2147483647, pd34);
               };
            {
               word pd35;
               pd35 = (* (( (ptr) (* (( (ptr) gf←c064)+28)/* var←c10564 */  ))+10) );
               (* (( (ptr) formal←c065)+7) ) = (word) ( *( (fPt) ((*  (ptr) pd35 ))))(var←c10660, 8, pd35);
               };
            };
SOURCE(1411, 29)
         {
            word pd36;
            pd36 = (* (( (ptr) (* (( (ptr) gf←c064)+27)/* var←c10532 */  ))+91) );
            line←v3484 = (word) ( *( (fPt) ((*  (ptr) pd36 ))))((* ((( (ptr) formal←c065)+4)) ), pd36);
            };
SOURCE(1442, 39)
         {
            word pd37;
            pd37 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+12) );
            pos←v3512 = (word) ( *( (fPt) ((*  (ptr) pd37 ))))(line←v3484, (* (( (ptr) gf←c064)+14) ), 2147483647, 1, pd37);
            };
SOURCE(1483, 39)
         if (( (int)pos←v3512 <  (int)0)) {
SOURCE(1497, 25)
            (void) Err←P60((* ((( (ptr) gf←c064)+15)) ));
            };
SOURCE(1525, 57)
         {
            word var←c10692;
            {
               word pd38;
               pd38 = (* (( (ptr) (* (( (ptr) gf←c064)+26)/* var←c10468 */  ))+17) );
               var←c10692 = (word) ( *( (fPt) ((*  (ptr) pd38 ))))(line←v3484, (pos←v3512 + 6), 2147483647, pd38);
               };
            {
               word pd39;
               pd39 = (* (( (ptr) (* (( (ptr) gf←c064)+28)/* var←c10564 */  ))+10) );
               (* (( (ptr) formal←c065)+6) ) = (word) ( *( (fPt) ((*  (ptr) pd39 ))))(var←c10692, 8, pd39);
               };
            };
SOURCE(1584, 29)
         {
            word pd40;
            pd40 = (* (( (ptr) (* (( (ptr) gf←c064)+27)/* var←c10532 */  ))+91) );
            line←v3484 = (word) ( *( (fPt) ((*  (ptr) pd40 ))))((* ((( (ptr) formal←c065)+4)) ), pd40);
            };
         };
SOURCE(1618, 113)
      {
         W4 var←c10724;
         var←c10724.f0 = 0;
         var←c10724.f1 = 0;
         var←c10724.f2 = height←v3568;
         var←c10724.f3 = width←v3540;
         {
            word pd41;
            pd41 = (* (( (ptr) (* (( (ptr) gf←c064)+29)/* var←c10756 */  ))+19) );
            (* (( (ptr) formal←c065)+5) ) = (word) ( *( (fPt) ((*  (ptr) pd41 ))))(var←c10724, 1, IOP2( * ,  (int)IOP2( / ,  (int)(width←v3540 + 
                     63),  (int)64),  (int)64), pd41);
            };
         };
SOURCE(1755, 22)
      {
         word pd42;
         pd42 = (* (( (ptr) (* (( (ptr) gf←c064)+29)/* var←c10756 */  ))+48) );
         (void) ( *( (fPt) ((*  (ptr) pd42 ))))((* ((( (ptr) formal←c065)+5)) ), pd42);
         };
SOURCE(1779, 288)
      {
         register word s←v3612 = 0;
         register word noName←c10788;
         noName←c10788 = height←v3568;
         if (( (int)s←v3612 >=  (int)noName←c10788)) {
            goto lab←L100006;
            };
         lab←L100009: ;
         {
            word nextNum←v3656;
            word availablebits←v3684 = 0;
SOURCE(1846, 221)
            {
               register word f←v3728 = 0;
               register word noName←c10820;
               noName←c10820 = width←v3540;
               if (( (int)f←v3728 >=  (int)noName←c10820)) {
                  goto lab←L100010;
                  };
               lab←L100013: ;
SOURCE(1874, 71)
               if (( (int)availablebits←v3684 <=  (int)0)) {
SOURCE(1901, 25)
                  nextNum←v3656 = (word) ScanNum←P120((* ((( (ptr) formal←c065)+4)) ));
SOURCE(1928, 17)
                  availablebits←v3684 = 8;
                  };
SOURCE(1950, 63)
               if (( (int)IOP2( % ,  (int)nextNum←v3656,  (int)2) !=  (int)0)) {
SOURCE(1976, 37)
                  {
                     W2 var←c10852;
                     var←c10852.f0 = s←v3612;
                     var←c10852.f1 = f←v3728;
                     {
                        word pd43;
                        pd43 = (* (( (ptr) (* (( (ptr) gf←c064)+29)/* var←c10756 */  ))+43) );
                        (void) ( *( (fPt) ((*  (ptr) pd43 ))))((* (( (ptr) formal←c065)+5) ), var←c10852, 1, 0, pd43);
                        };
                     };
                  };
SOURCE(2015, 19)
               nextNum←v3656 = IOP2( / ,  (int)nextNum←v3656,  (int)2);
SOURCE(2036, 31)
               availablebits←v3684 = (availablebits←v3684 - 1);
               f←v3728 = (f←v3728 + 1);
               if (( (int)f←v3728 <  (int)noName←c10820)) {
                  goto lab←L100013;
                  };
               lab←L100010: ;
               };
            };
         s←v3612 = (s←v3612 + 1);
         if (( (int)s←v3612 <  (int)noName←c10788)) {
            goto lab←L100009;
            };
         lab←L100006: ;
         };
      };
   return(0);
   }

static void NoName←Q672(formal←c058, formal←c200000, formal←c200001, formal←c200002, formal←c200003)
   word formal←c058;
   word formal←c200000;
   word formal←c200001;
   word formal←c200002;
   word formal←c200003;
   {
   register ptr gf←c066 =  (ptr) &globalframe;
   if ((formal←c200001 == (* (( (ptr) (* (( (ptr) gf←c066)+28)/* var←c10564 */  ))+7) ))) {
      {
         word reason←v5316;
         word index←v5344;
         reason←v5316 = (*  (ptr) formal←c200003 );
         index←v5344 = (* (( (ptr) formal←c200003)+1) );
SOURCE(836, 13)
         (void) Err←P60((* ((( (ptr) gf←c066)+16)) ));
         };
      }
   else {
      if ((formal←c200001 == (* (( (ptr) (* (( (ptr) gf←c066)+27)/* var←c10532 */  ))+5) ))) {
         {
            word ec←v5844;
            word stream←v5872;
            word details←v5900;
            word msg←v5928;
            ec←v5844 = (*  (ptr) formal←c200003 );
            stream←v5872 = (* (( (ptr) formal←c200003)+1) );
            details←v5900 = (* (( (ptr) formal←c200003)+2) );
            msg←v5928 = (* (( (ptr) formal←c200003)+3) );
SOURCE(863, 13)
            (void) Err←P60((* ((( (ptr) gf←c066)+16)) ));
            };
         };
      };
   (*  (ptr) formal←c058 ) = 0;
   (* (( (ptr) formal←c058)+1) ) = 0;
   return;
   }

/* file: CBitmapReaderImpl, module: CBitmapReaderImpl, compiled at: February 24, 1992 7:58:35 pm PST */ 
extern void XR←install←CBitmapReaderImpl() {
   NoName←Q552();
   }
extern void XR←run←CBitmapReaderImpl() { XR←Start(&globalframe); }