/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1992 by Xerox Corporation.  All rights reserved. */
/* time: March 10, 1992 11:59:10 am PST */
/* C2C version: October 16, 1990 (native) */
/* ref-counting: off */
/* file: AISIOImpl, module: AISIOImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [3014783417,3483348990] AISIOImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef word (*fPt)();
typedef struct {word f0, f1, f2;} W3;
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef struct {W8 f; W8 r;} W16;
typedef struct {W16 f; W16 r;} W32;
typedef struct {W32 f; W32 r;} W64;
typedef struct {word f0, f1, f2, f3, f4, f5, f6;} W7;
typedef struct {W64 f; W7 r;} W71;
typedef struct {word f0, f1;} W2;
typedef struct {word f0, f1, f2, f3;} W4;
typedef W4 *W4Pt;
typedef struct {word f0, f1, f2, f3, f4;} W5;
typedef W5 *W5Pt;
typedef W2 *W2Pt;
typedef W3 *W3Pt;
typedef W8 *W8Pt;
typedef W7 *W7Pt;
#define SOURCE(p, l) /* source p, l */
#define IOP2(op, x, y)  ( (word) ((x) op (y)) )
#define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i )
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
#define MIN(cast, x, y)  ( ( cast x) < ( cast y) ? (x) : (y) )
#define MAX(cast, x, y)  ( ( cast x) > ( cast y) ? (x) : (y) )
static void NoName←Q2316();
static void AISIOImpl←P0();
static word IOrd←P60();
static word COrd←P120();
static word Card←P180();
static void Assert←P240();
static void ReadBytes←P360();
static word ReadInfo←P420();
static word p←P1200();
static word Read←P480();
static void WriteBytes←P540();
static void Write←P600();
static void WritePartHeader←P1356();
static word NewSampleMap←P660();
static word ReadSample←P720();
static void WriteSample←P780();
static void ReadLine←P840();
static void WriteLine←P900();
static struct {unsigned f; char r[16];} string1 = {917520, "\216\257\300\363\223\326\161\300\017\164\046\072\104\350\000"};
static struct {unsigned f; char r[4];} string2 = {65537, "\001\000\000"};
static struct {unsigned f; char r[48];} string3 = {2883632, "\260\006\005\146\151\162\163\164\216\257\300\363\223\326\161\300\017\164\046\072\104\350\005\004\162\145\163\164\214\216\257\300\363\223\326\161\300\017\164\046\072\104\350\261\000\000\000"};
static struct {unsigned f; char r[4];} string4 = {131074, "\004\003\000"};
static struct {unsigned f; char r[16];} string5 = {851984, "\257\300\150\223\370\056\300\265\120\000\347\100\164\000\000"};
static struct {unsigned f; char r[4];} string6 = {196611, "\004@~"};
static struct {unsigned f; char r[16];} string7 = {851984, "\257\300\071\045\144\167\300\145\377\112\006\100\310\000\000"};
static struct {unsigned f; char r[16];} string8 = {851984, "\257\300\071\045\144\167\300\145\377\112\006\100\274\000\000"};
static struct {unsigned f; char r[16];} string9 = {851984, "\257\300\071\045\144\167\300\145\377\112\006\100\230\000\000"};
static struct {unsigned f; char r[16];} string10 = {851984, "\257\300\071\045\144\167\300\145\377\112\006\100\260\000\000"};
static struct {unsigned f; char r[16];} string11 = {786448, "raster first\000\000\000"};
static struct {unsigned f; char r[8];} string12 = {262152, "stop\000\000\000"};
static struct {unsigned f; char r[8];} string13 = {393224, "raster\000"};
static struct {unsigned f; char r[16];} string14 = {917520, "byteSizeCoding\000"};
static struct {unsigned f; char r[8];} string15 = {327688, "scans\000\000"};
static struct {unsigned f; char r[20];} string16 = {1114132, "scanLinesPerBlock\000\000"};
static struct {unsigned f; char r[12];} string17 = {720908, "part length"};
static struct {unsigned f; char r[24];} string18 = {1507352, "Unknown AIS coding type"};
static struct {unsigned f; char r[16];} string19 = {851984, "rasterSection\000\000"};
static struct {unsigned f; char r[12];} string20 = {589836, "placement\000\000"};
static struct {unsigned f; char r[8];} string21 = {327688, "place\000\000"};
static struct {unsigned f; char r[8];} string22 = {393224, "header\000"};
static struct {unsigned f; char r[20];} string23 = {1048596, "bad AIS password\000\000\000"};
static struct {unsigned f; char r[8];} string24 = {458760, "comment"};
static struct {unsigned f; char r[4];} string25 = {65540, ")\000\000"};
static struct {unsigned f; char r[16];} string26 = {917520, "Bug in FromAIS\000"};
static struct {unsigned f; char r[44];} string27 = {2621484, "AIS file has unimplemented scanDirection\000\000\000"};
static struct {unsigned f; char r[32];} string28 = {1835040, "AIS file has no raster part.\000\000\000"};
static struct {unsigned f; char r[20];} string29 = {1048596, "no pixels in map\000\000\000"};
static struct {unsigned f; char r[40];} string30 = {2359336, "AIS file structure is inconsistent (\000\000\000"};
static struct {unsigned f; char r[16];} string31 = {851984, "\257\300\263\261\361\271\300\317\237\257\376\100\164\000\000"};
static struct {unsigned f; char r[12];} string32 = {589833, "\006\001\100\120\010\000\004\024\001\000\000"};
static struct {unsigned f; char r[16];} string33 = {851984, "\257\300\213\226\301\143\300\072\355\320\373\100\150\000\000"};
static struct {unsigned f; char r[16];} string34 = {851984, "\257\300\015\277\004\146\300\034\367\146\045\100\164\000\000"};
static struct {unsigned f; char r[16];} string35 = {851984, "\257\300\141\260\110\353\300\162\250\066\353\100\150\000\000"};
static struct {unsigned f; char r[16];} string36 = {851984, "\257\300\363\223\326\161\300\017\164\046\072\100\150\000\000"};
static struct {unsigned f; char r[16];} string37 = {851984, "\257\300\150\223\370\056\300\265\120\000\347\100\150\000\000"};
static struct {
   word f0[41]; 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; word f54; word f55; 
   word f56; word f57; word f58; word f59; 
   word f60; word f61; word f62; word f63; 
   word f64; word f65; word f66; word f67; 
   word f68; word f69; word f70; word f71; 
   word f72[13]; 
   } globalframe = {
   {0}, (word) WriteLine←P900, 0, (word) ReadLine←P840, 
   0, (word) WriteSample←P780, 0, (word) ReadSample←P720, 
   0, (word) NewSampleMap←P660, 0, (word) Write←P600, 
   0, (word) WriteBytes←P540, 0, (word) Read←P480, 
   0, (word) ReadInfo←P420, 0, (word) ReadBytes←P360, 
   0, (word) Assert←P240, 0, (word) Card←P180, 
   0, (word) COrd←P120, 0, (word) IOrd←P60, 
   0, (word) AISIOImpl←P0, 0, 2147483647, 
   {0}
   };

static void NoName←Q2316()
   {
   register ptr gf←c0191 =  (ptr) &globalframe;
   word var←c26624;
   (* (( (ptr) gf←c0191)+6) ) = (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2);
   (* (( (ptr) gf←c0191)+8) ) = (word) XR←GetTypeIndex((word) &string3, 0, (word) &string4);
   (* (( (ptr) gf←c0191)+9) ) = (word) XR←GetTypeIndex((word) &string5, 0, (word) &string6);
   (* (( (ptr) gf←c0191)+16) ) = (word) XR←GetTypeIndexS((word) (&string7));
   (* (( (ptr) gf←c0191)+17) ) = (word) XR←GetTypeIndexS((word) (&string8));
   (* (( (ptr) gf←c0191)+18) ) = (word) XR←GetTypeIndexS((word) (&string9));
   (* (( (ptr) gf←c0191)+19) ) = (word) XR←GetTypeIndexS((word) (&string10));
   (*  (ptr) (( (bPt) gf←c0191)+80) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string11);
   (*  (ptr) (( (bPt) gf←c0191)+84) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string12);
   (*  (ptr) (( (bPt) gf←c0191)+88) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string13);
   (*  (ptr) (( (bPt) gf←c0191)+92) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string14);
   (*  (ptr) (( (bPt) gf←c0191)+96) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string15);
   (*  (ptr) (( (bPt) gf←c0191)+100) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string16);
   (*  (ptr) (( (bPt) gf←c0191)+104) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string17);
   (*  (ptr) (( (bPt) gf←c0191)+108) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string18);
   (*  (ptr) (( (bPt) gf←c0191)+112) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string19);
   (*  (ptr) (( (bPt) gf←c0191)+116) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string20);
   (*  (ptr) (( (bPt) gf←c0191)+120) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string21);
   (*  (ptr) (( (bPt) gf←c0191)+124) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string22);
   (*  (ptr) (( (bPt) gf←c0191)+128) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string23);
   (*  (ptr) (( (bPt) gf←c0191)+132) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string24);
   (*  (ptr) (( (bPt) gf←c0191)+136) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string25);
   (*  (ptr) (( (bPt) gf←c0191)+140) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string26);
   (*  (ptr) (( (bPt) gf←c0191)+144) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string27);
   (*  (ptr) (( (bPt) gf←c0191)+148) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string28);
   (*  (ptr) (( (bPt) gf←c0191)+152) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string29);
   (*  (ptr) (( (bPt) gf←c0191)+156) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0191)+6) ), (word) &string30);
   (void) XR←DeclareGlobalFrame((word) "AISIOImpl", &globalframe, (word) XR←GetTypeIndex((word) &string31, 0, (word) &string32)
      , (word) (( (bPt) gf←c0191)+276)/* var←c24160 */ );
   var←c26624 = (word) XR←ImportInterface((word) "ImagerSample", (word) XR←GetTypeIndexS((word) (&string33)), 60);
   (* (( (ptr) gf←c0191)+83)/* var←c25504 */  ) = var←c26624;
   (void) XR←ImportProcS(var←c26624, 2370311);
   (void) XR←ImportProcS(var←c26624, 2107398);
   (void) XR←ImportProcS(var←c26624, 1320708);
   (void) XR←ImportProcS(var←c26624, 67905026);
   (void) XR←ImportProcS(var←c26624, 2370822);
   (void) XR←ImportProcS(var←c26624, 68685571);
   var←c26624 = (word) XR←ImportInterface((word) "IO", (word) XR←GetTypeIndexS((word) (&string34)), 103);
   (* (( (ptr) gf←c0191)+81)/* var←c24512 */  ) = var←c26624;
   (void) XR←ImportProcS(var←c26624, 1053698);
   (void) XR←ImportProcS(var←c26624, 530434);
   (void) XR←ImportProcS(var←c26624, 530946);
   (void) XR←ImportProcS(var←c26624, 67377409);
   (void) XR←ImportProcS(var←c26624, 68160002);
   var←c26624 = (word) XR←ImportInterface((word) "PFS", (word) XR←GetTypeIndexS((word) (&string35)), 40);
   (* (( (ptr) gf←c0191)+82)/* var←c24608 */  ) = var←c26624;
   (void) XR←ImportProcS(var←c26624, 67371265);
   (void) XR←ImportProcS(var←c26624, 71312136);
   var←c26624 = (word) XR←ImportInterface((word) "Rope", (word) XR←GetTypeIndexS((word) (&string36)), 43);
   (* (( (ptr) gf←c0191)+80)/* var←c24448 */  ) = var←c26624;
   (void) XR←ImportProcS(var←c26624, 67902211);
   (void) XR←ImportProcS(var←c26624, 68419845);
   var←c26624 = (word) XR←ExportInterface((word) "AISIO", (word) XR←GetTypeIndexS((word) (&string37)), 9);
   (* (( (ptr) gf←c0191)+84)/* var←c26656 */  ) = var←c26624;
   (void) XR←ExportVar(var←c26624, 0, (word) (( (bPt) gf←c0191)+160)/* var←c23680 */ );
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+228)/* var←c23968 */ , 67371265);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+220)/* var←c23936 */ , 67633666);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+204)/* var←c23872 */ , 1311493);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+196)/* var←c23840 */ , 67896323);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+188)/* var←c23808 */ , 67896579);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+180)/* var←c23776 */ , 1050116);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+172)/* var←c23744 */ , 788227);
   (void) XR←ExportProcS(var←c26624, (word) (( (bPt) gf←c0191)+164)/* var←c23712 */ , 788483);
   }

static void AISIOImpl←P0(formal←c029, formal←c028)
   word formal←c029;
   word formal←c028;
   {
   register ptr gf←c26688 =  (ptr) &globalframe;
   /* AISIOImpl: */ 
SOURCE(70, 11818)
   /* moved to installation proc */ 
SOURCE(827, 30)
   (* (( (ptr) gf←c26688)+4)/* defaultLinesPerBlock←v3140 */  ) = 16;
   }

static word IOrd←P60(h←v3728)
   word h←v3728;
   {
   word var←c3772;
   /* IOrd: */ 
SOURCE(902, 81)
SOURCE(955, 28)
   {
      word var←c24320;
      {
         word temp←v10584;
         temp←v10584 = ( (((unsigned)h←v3728 << 16) >> 16) );
         var←c24320 =  (int) ( short )( (((unsigned)temp←v10584 << 16) >> 16) );
         };
      return(var←c24320);
      };
   }

static word COrd←P120(h←v3832)
   word h←v3832;
   {
   word var←c3876;
   /* COrd: */ 
SOURCE(986, 84)
SOURCE(1041, 29)
   return(h←v3832);
   }

static word Card←P180(h←v3936)
   word h←v3936;
   {
   word var←c3980;
   /* Card: */ 
SOURCE(1073, 84)
SOURCE(1128, 29)
   return(h←v3936);
   }

static void Assert←P240(title←v4040, assertion←v4068)
   word title←v4040;
   word assertion←v4068;
   {
   register ptr gf←c26720 =  (ptr) &globalframe;
   /* Assert: */ 
SOURCE(1160, 137)
SOURCE(1208, 89)
   if ((0 == assertion←v4068)) {
SOURCE(1230, 67)
      {
         word var←c24416;
         {
            word pd38;
            pd38 = (* (( (ptr) (* (( (ptr) gf←c26720)+80)/* var←c24448 */  ))+5) );
            var←c24416 = (word) ( *( (fPt) ((*  (ptr) pd38 ))))((* (( (ptr) gf←c26720)+39) ), title←v4040, (* (( (ptr) gf←c26720)+34)
                ), 0, 0, pd38);
            };
         {
            word var←c041;
            var←c041 = var←c24416;
            (void) XR←RaiseError((word) (( (bPt) gf←c26720)+160)/* var←c23680 */ , (word) &var←c041);
            };
         };
      };
   }

static void ReadBytes←P360(stream←v4232, base←v4260, bytes←v4288)
   word stream←v4232;
   word base←v4260;
   word bytes←v4288;
   {
   register ptr gf←c26752 =  (ptr) &globalframe;
   word actualBytes←v5664;
   /* ReadBytes: */ 
SOURCE(1425, 226)
SOURCE(1511, 82)
   {
      W3 var←c24480;
      var←c24480.f0 = base←v4260;
      var←c24480.f1 = 0;
      var←c24480.f2 = bytes←v4288;
      {
         word pd39;
         pd39 = (* (( (ptr) (* (( (ptr) gf←c26752)+81)/* var←c24512 */  ))+14) );
         actualBytes←v5664 = (word) ( *( (fPt) ((*  (ptr) pd39 ))))(stream←v4232, var←c24480, pd39);
         };
      };
SOURCE(1595, 56)
   if (( (int)actualBytes←v5664 !=  (int)bytes←v4288)) {
SOURCE(1623, 28)
      {
         word var←c047;
         var←c047 = stream←v4232;
         (void) XR←RaiseError((* (( (ptr) (* (( (ptr) gf←c26752)+81)/* var←c24512 */  ))+4) ), (word) &var←c047);
         };
      };
   }

static word ReadInfo←P420(name←v4360)
   word name←v4360;
   {
   W71 var←c26784;
   register ptr gf←c26816 =  (ptr) &globalframe;
   word info←v4404;
   /* declaration of var←c24544 skipped */ 
   word in←v5708;
   word header←v5736;
   word partHeader←v5764;
   W3 raster←v5792;
   W2 uca←v5820;
   W2 placement←v5848;
   W8 photometry←v5876;
   /* declaration of comment←v5904 skipped */ 
   /* ReadInfo: */ 
SOURCE(1675, 4436)
   {
      word tmpAddr40;
      tmpAddr40 = (word) (( (ptr) &var←c26784)+4)/* var←c24544 */ ;
      (*  (ptr) tmpAddr40 ) = ( ((word)  (fPt) p←P1200) );
      (* (( (ptr) tmpAddr40) + 1) ) = 1;
      };
SOURCE(1675, 4436)
   info←v4404 = 0;
SOURCE(1735, 60)
   {
      word var←c24576;
      {
         word pd41;
         pd41 = (* (( (ptr) (* (( (ptr) gf←c26816)+82)/* var←c24608 */  ))+5) );
         var←c24576 = (word) ( *( (fPt) ((*  (ptr) pd41 ))))(name←v4360, pd41);
         };
      {
         W2 var←c24640;
         var←c24640.f0 = 4096;
         var←c24640.f1 = 2;
         {
            word pd42;
            pd42 = (* (( (ptr) (* (( (ptr) gf←c26816)+82)/* var←c24608 */  ))+39) );
            in←v5708 = (word) ( *( (fPt) ((*  (ptr) pd42 ))))(var←c24576, 0, (*  (W4Pt) (( (ptr) gf←c26816)+71)/* var←c24224 */  ), 0, 0, (*  (W5Pt) (
                  ( (ptr) gf←c26816)+75)/* var←c24288 */  )
               , 1, var←c24640, pd42);
            };
         };
      };
SOURCE(2540, 39)
   XR←FillWords(&photometry←v5876, 8, 0);
   photometry←v5876.f5 =  (word) -1;
   photometry←v5876.f6 =  (word) -1;
SOURCE(2845, 25)
   info←v4404 = XR←NewObject(28, (* (( (ptr) gf←c26816)+9) ));
SOURCE(2880, 62)
SOURCE(2881, 61)
   (void) ReadBytes←P360(in←v5708, (word) &header←v5736, 4);
SOURCE(2945, 81)
   if (((*  (hPt) &header←v5736 ) != 33962)) {
SOURCE(3001, 25)
      {
         word var←c061;
         var←c061 = (* (( (ptr) gf←c26816)+32) );
         (void) XR←RaiseError((word) (( (bPt) gf←c26816)+160)/* var←c23680 */ , (word) &var←c061);
         };
      };
SOURCE(3028, 105)
   {
      word var←c24736;
      if (((word) COrd←P120(( (((unsigned)header←v5736 << 16) >> 16) )) > 0)) {
         var←c24736 = (((word) COrd←P120(( (((unsigned)header←v5736 << 16) >> 16) )) & 01777) == 0);
         }
      else {
         var←c24736 = 0;
         };
      (void) Assert←P240((* (( (ptr) gf←c26816)+31) ), var←c24736);
      };
SOURCE(3135, 59)
   {
      word var←c24768;
      {
         word var←c24800;
         word aisWords←v23600;
         aisWords←v23600 = (word) COrd←P120(( (((unsigned)header←v5736 << 16) >> 16) ));
SOURCE(1367, 52)
         var←c24800 = IOP2( * ,  (int)2,  (int)aisWords←v23600);
         var←c24768 = var←c24800;
         };
      (*  (ptr) info←v4404 ) = var←c24768;
      };
SOURCE(3196, 2892)
   {
      register word firstPart←v6844;
      firstPart←v6844 = 1;
      lab←L100005: ;
      {
         word startIndex←v6888;
         word stopIndex←v6916;
SOURCE(3233, 44)
         {
            word pd43;
            pd43 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
            startIndex←v6888 = (word) ( *( (fPt) ((*  (ptr) pd43 ))))(in←v5708, pd43);
            };
         stopIndex←v6916 = startIndex←v6888;
SOURCE(3287, 61)
SOURCE(3288, 60)
         (void) ReadBytes←P360(in←v5708, (word) &partHeader←v5764, 2);
SOURCE(3351, 87)
         {
            word var←c24832;
            word aisWords←v23552;
            aisWords←v23552 = (((((unsigned)partHeader←v5764 << 6) >> 30) << 8) + (* (( (bPt) &partHeader←v5764)+1) ));
SOURCE(1367, 52)
            var←c24832 = IOP2( * ,  (int)2,  (int)aisWords←v23552);
            stopIndex←v6916 = (startIndex←v6888 + var←c24832);
            };
SOURCE(3440, 55)
         (void) Assert←P240((* (( (ptr) gf←c26816)+28) ), ( (int)stopIndex←v6916 <=  (int)(*  (ptr) info←v4404 )));
SOURCE(3497, 2502)
         {
            word var←c24864;
            var←c24864 = ((unsigned)partHeader←v5764 >> 26);
            switch (var←c24864) {
               case 0: 
SOURCE(3536, 78)
                  {
                     word tc44;
                     if (((((unsigned)partHeader←v5764 << 6) >> 30) == 0)) {
                        tc44 =  (word) ((* (( (bPt) &partHeader←v5764)+1) ) == 0);
                        }
                     else {
                        tc44 =  (word) 0;
                        };
                     (void) Assert←P240((* (( (ptr) gf←c26816)+26) ), tc44);
                     };
SOURCE(3616, 4)
                  goto lab←L100003;
               case 1: 
SOURCE(3686, 33)
                  (void) Assert←P240((* (( (ptr) gf←c26816)+20) ), firstPart←v6844);
SOURCE(3758, 57)
SOURCE(3759, 56)
                  (void) ReadBytes←P360(in←v5708, (word) &raster←v5792, 10);
SOURCE(3818, 44)
                  {
                     word var←c24896;
                     {
                        word pd45;
                        pd45 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
                        var←c24896 = ( (int)(word) ( *( (fPt) ((*  (ptr) pd45 ))))(in←v5708, pd45) <=  (int)stopIndex←v6916);
                        };
                     (void) Assert←P240((* (( (ptr) gf←c26816)+21) ), var←c24896);
                     };
SOURCE(3864, 113)
                  {
                     word var←c24928;
                     {
                        word tc46;
                        if (((word) COrd←P120((*  (hPt) &raster←v5792 )) > 0)) {
                           tc46 =  (word) ((word) COrd←P120((* (( (hPt) &raster←v5792)+1) )) > 0);
                           }
                        else {
                           tc46 =  (word) 0;
                           };
                        if (tc46) {
                           var←c24928 = ((word) COrd←P120((* (( (hPt) &raster←v5792)+3) )) > 0);
                           }
                        else {
                           var←c24928 = 0;
                           };
                        };
                     (void) Assert←P240((* (( (ptr) gf←c26816)+22) ), var←c24928);
                     };
SOURCE(3979, 737)
                  {
                     word var←c24960;
                     var←c24960 = (* (( (bPt) &raster←v5792)+9) );
                     if ((var←c24960 == 1)) {
SOURCE(4018, 652)
                        {
                           word byteSizeCoding←v6960;
SOURCE(4020, 47)
                           {
/*1*/   word pd47;
/*1*/   pd47 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
/*1*/   byteSizeCoding←v6960 = (stopIndex←v6916 - (word) ( *( (fPt) ((*  (ptr) pd47 ))))(in←v5708, pd47));
/*1*/   };
SOURCE(4069, 75)
                           (void) Assert←P240((* (( (ptr) gf←c26816)+23) ), ( (int)byteSizeCoding←v6960 <=  (int)8));
SOURCE(4154, 36)
SOURCE(4155, 35)
                           (void) ReadBytes←P360(in←v5708, (word) &uca←v5820, byteSizeCoding←v6960);
SOURCE(4193, 64)
                           if (((word) COrd←P120((*  (hPt) &uca←v5820 )) == 0)) {
SOURCE(4231, 26)
/*1*/   (* (( (bPt) &uca←v5820)+1) ) = 1;
/*1*/   };
SOURCE(4269, 185)
                           {
/*1*/   word var←c24992;
/*1*/   {
/*1*/      word var←c25024;
/*1*/      word aisWords←v23504;
/*1*/      word var←c0206;
/*1*/      aisWords←v23504 = (word) COrd←P120((* (( (hPt) &uca←v5820)+1) ));
SOURCE(1367, 52)
/*1*/      var←c25024 = IOP2( * ,  (int)2,  (int)aisWords←v23504);
/*1*/      var←c0206 = IOP2( * ,  (int)8,  (int)var←c25024);
/*1*/      var←c24992 = ( (int)IOP2( * ,  (int)IOP2( * ,  (int)(word) COrd←P120((*  (hPt) &uca←v5820 )),  (int)(word) COrd←P120((* (
/*1*/                  ( (hPt) &raster←v5792)+3) ))),  (int)(word) COrd←P120((* (( (hPt) &raster←v5792)+1) ))) <=  (int)var←c0206);
/*1*/      };
/*1*/   (void) Assert←P240((* (( (ptr) gf←c26816)+24) ), var←c24992);
/*1*/   };
SOURCE(4456, 174)
                           if (( (int)byteSizeCoding←v6960 <  (int)8)) {
SOURCE(4515, 72)
/*1*/   (void) Assert←P240((* (( (ptr) gf←c26816)+25) ), ((* (( (hPt) &uca←v5820)+2) ) == 65535));
SOURCE(4589, 41)
/*1*/   (* (( (hPt) &uca←v5820)+3) ) = 65535;
/*1*/   };
SOURCE(4635, 33)
                           {
/*1*/   word var←c25056;
/*1*/   var←c25056 = XR←NewObject(8, (* (( (ptr) gf←c26816)+19) ));
/*1*/   (*  (W2Pt) var←c25056 ) = uca←v5820;
/*1*/   (* (( (ptr) info←v4404)+2) ) = var←c25056;
/*1*/   };
                           };
                        }
                     else {
SOURCE(4684, 32)
                        {
                           word var←c080;
                           var←c080 = (* (( (ptr) gf←c26816)+27) );
                           (void) XR←RaiseError((word) (( (bPt) gf←c26816)+160)/* var←c23680 */ , (word) &var←c080);
                           };
                        };
                     };
SOURCE(4718, 40)
                  {
                     word var←c25088;
                     var←c25088 = XR←NewObject(12, (* (( (ptr) gf←c26816)+18) ));
                     (*  (W3Pt) var←c25088 ) = raster←v5792;
                     (* (( (ptr) info←v4404)+1) ) = var←c25088;
                     };
                  break;
               case 2: 
SOURCE(4786, 63)
SOURCE(4787, 62)
                  (void) ReadBytes←P360(in←v5708, (word) &placement←v5848, 8);
SOURCE(4852, 48)
                  {
                     word var←c25120;
                     {
                        word pd48;
                        pd48 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
                        var←c25120 = ( (int)(word) ( *( (fPt) ((*  (ptr) pd48 ))))(in←v5708, pd48) ==  (int)stopIndex←v6916);
                        };
                     (void) Assert←P240((* (( (ptr) gf←c26816)+29) ), var←c25120);
                     };
SOURCE(4902, 226)
                  {
                     word tc49;
                     word tc50;
                     word tc51;
                     if (( (int)(word) IOrd←P60((*  (hPt) &placement←v5848 )) ==  (int) (word) -1)) {
                        tc51 =  (word) ( (int)(word) IOrd←P60((* (( (hPt) &placement←v5848)+1) )) ==  (int) (word) -1);
                        }
                     else {
                        tc51 =  (word) 0;
                        };
                     if (tc51) {
                        tc50 =  (word) ( (int)(word) IOrd←P60((* (( (hPt) &placement←v5848)+2) )) ==  (int) (word) -1);
                        }
                     else {
                        tc50 =  (word) 0;
                        };
                     if (tc50) {
                        tc49 =  (word) ( (int)(word) IOrd←P60((* (( (hPt) &placement←v5848)+3) )) ==  (int) (word) -1);
                        }
                     else {
                        tc49 =  (word) 0;
                        };
                     if (tc49) {
                        }
                     else {
SOURCE(5053, 75)
                        {
                           word var←c25152;
                           if (( (int)(word) IOrd←P60((* (( (hPt) &placement←v5848)+2) )) >  (int)0)) {
/*1*/   var←c25152 = ( (int)(word) IOrd←P60((* (( (hPt) &placement←v5848)+3) )) >  (int)0);
/*1*/   }
                           else {
/*1*/   var←c25152 = 0;
/*1*/   };
                           (void) Assert←P240((* (( (ptr) gf←c26816)+30) ), var←c25152);
                           };
                        };
                     };
SOURCE(5130, 49)
                  {
                     word var←c25184;
                     var←c25184 = XR←NewObject(8, (* (( (ptr) gf←c26816)+17) ));
                     (*  (W2Pt) var←c25184 ) = placement←v5848;
                     (* (( (ptr) info←v4404)+3) ) = var←c25184;
                     };
                  break;
               case 3: 
SOURCE(5208, 65)
SOURCE(5209, 64)
                  (void) ReadBytes←P360(in←v5708, (word) &photometry←v5876, 30);
SOURCE(5276, 44)
                  {
                     word var←c25216;
                     {
                        word pd52;
                        pd52 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
                        var←c25216 = ( (int)(word) ( *( (fPt) ((*  (ptr) pd52 ))))(in←v5708, pd52) <=  (int)stopIndex←v6916);
                        };
                     (void) Assert←P240((* (( (ptr) gf←c26816)+21) ), var←c25216);
                     };
SOURCE(5322, 26)
                  {
                     word pd53;
                     pd53 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+30) );
                     (void) ( *( (fPt) ((*  (ptr) pd53 ))))(in←v5708, stopIndex←v6916, pd53);
                     };
SOURCE(5378, 52)
                  {
                     word var←c25248;
                     var←c25248 = XR←NewObject(32, (* (( (ptr) gf←c26816)+16) ));
                     (*  (W8Pt) var←c25248 ) = photometry←v5876;
                     (* (( (ptr) info←v4404)+4) ) = var←c25248;
                     };
                  break;
               case 4: 
SOURCE(5446, 513)
                  {
                     word byteSizeComment←v7004;
                     word length←v7032 = 0;
SOURCE(5448, 48)
                     {
                        word pd54;
                        pd54 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
                        byteSizeComment←v7004 = (stopIndex←v6916 - (word) ( *( (fPt) ((*  (ptr) pd54 ))))(in←v5708, pd54));
                        };
SOURCE(5553, 76)
                     (void) Assert←P240((* (( (ptr) gf←c26816)+33) ),  ( ( (int)byteSizeComment←v7004 >=  (int)1) ? ( (int)byteSizeComment←v7004 <=  (int)256) : 0 ) )
                     ;
SOURCE(5639, 41)
SOURCE(5640, 40)
                     (void) ReadBytes←P360(in←v5708, (word) (( (bPt) &var←c26784)+24)/* comment←v5904 */ , byteSizeComment←v7004);
SOURCE(5683, 26)
                     length←v7032 = (* (( (bPt) &var←c26784)+24) );
SOURCE(5711, 51)
                     (void) Assert←P240((* (( (ptr) gf←c26816)+33) ), ( (int)byteSizeComment←v7004 >=  (int)SGNCK((length←v7032 + 1))));
SOURCE(5764, 192)
                     {
                        /* declaration of i←v7076 skipped */ 
                        word rope←v7132;
SOURCE(5798, 10)
                        (* (( (ptr) &var←c26784)+70)/* i←v7076 */  ) = 0;
SOURCE(5865, 45)
                        {
                           word pd55;
                           pd55 = (* (( (ptr) (* (( (ptr) gf←c26816)+80)/* var←c24448 */  ))+31) );
                           rope←v7132 = (word) ( *( (fPt) ((*  (ptr) pd55 ))))(length←v7032, (word) (( (bPt) &var←c26784)+16)/* var←c24544 */ , 2147483647, pd55)
                           ;
                           };
SOURCE(5913, 41)
                        {
                           word var←c25280;
                           var←c25280 = XR←NewObject(8, (* (( (ptr) gf←c26816)+8) ));
                           (*  (ptr) var←c25280 ) = rope←v7132;
                           (* (( (ptr) var←c25280)+1) ) = (* (( (ptr) info←v4404)+5) );
                           (* (( (ptr) info←v4404)+5) ) = var←c25280;
                           };
                        };
                     };
                  break;
               default: 
SOURCE(5973, 26)
                  {
                     word pd56;
                     pd56 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+30) );
                     (void) ( *( (fPt) ((*  (ptr) pd56 ))))(in←v5708, stopIndex←v6916, pd56);
                     };
                  break;
               };
            };
SOURCE(6029, 59)
         {
            word pd57;
            pd57 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+29) );
            if (( (int)(word) ( *( (fPt) ((*  (ptr) pd57 ))))(in←v5708, pd57) !=  (int)stopIndex←v6916)) {
SOURCE(6065, 23)
               {
                  word var←c092;
                  var←c092 = (* (( (ptr) gf←c26816)+35) );
                  (void) XR←RaiseError((word) (( (bPt) gf←c26816)+160)/* var←c23680 */ , (word) &var←c092);
                  };
               };
            };
         };
      firstPart←v6844 = 0;
      goto lab←L100005;
      lab←L100003: ;
      };
SOURCE(6099, 12)
   {
      word pd58;
      pd58 = (* (( (ptr) (* (( (ptr) gf←c26816)+81)/* var←c24512 */  ))+28) );
      (void) ( *( (fPt) ((*  (ptr) pd58 ))))(in←v5708, 0, pd58);
      };
SOURCE(1675, 4436)
   return(info←v4404);
   }

static word p←P1200(formal←c26848)
   word formal←c26848;
   {
   word var←c7208;
   formal←c26848 = (formal←c26848 - 16);
   /* p: */ 
SOURCE(5810, 17)
SOURCE(5836, 26)
   {
      word var←c0208;
      {
         word var←c0207;
         {
            word idx59;
            (* (( (ptr) formal←c26848)+70) ) = ((* (( (ptr) formal←c26848)+70) ) + 1);
            var←c0207 = (var←c0207 & 4294967040) | ((word) (* ((( (bPt) formal←c26848)+24)+(
                     idx59 = (* (( (ptr) formal←c26848)+70) ),
                     BCK(idx59, 256)
                     )) ));
            };
         var←c0208 = (var←c0207 & 0377);
         };
      return(var←c0208);
      };
   }

static word Read←P480(name←v4464, info←v4492)
   word name←v4464;
   word info←v4492;
   {
   register ptr gf←c26880 =  (ptr) &globalframe;
   word map←v4536;
   word i←v7236;
   word in←v7264;
   /* Read: */ 
SOURCE(6117, 1609)
SOURCE(6117, 1609)
   map←v4536 = 0;
SOURCE(6201, 24)
   i←v7236 = (word) ReadInfo←P420(name←v4464);
SOURCE(6227, 60)
   {
      word var←c25312;
      {
         word pd60;
         pd60 = (* (( (ptr) (* (( (ptr) gf←c26880)+82)/* var←c24608 */  ))+5) );
         var←c25312 = (word) ( *( (fPt) ((*  (ptr) pd60 ))))(name←v4464, pd60);
         };
      {
         W2 var←c25344;
         var←c25344.f0 = 4096;
         var←c25344.f1 = 2;
         {
            word pd61;
            pd61 = (* (( (ptr) (* (( (ptr) gf←c26880)+82)/* var←c24608 */  ))+39) );
            in←v7264 = (word) ( *( (fPt) ((*  (ptr) pd61 ))))(var←c25312, 0, (*  (W4Pt) (( (ptr) gf←c26880)+71)/* var←c24224 */  ), 0, 0, (*  (W5Pt) (
                  ( (ptr) gf←c26880)+75)/* var←c24288 */  )
               , 1, var←c25344, pd61);
            };
         };
      };
SOURCE(6289, 29)
   if ((info←v4492 != 0)) {
SOURCE(6308, 10)
      (*  (W7Pt) info←v4492 ) = (*  (W7Pt) i←v7236 );
      };
SOURCE(6320, 1392)
   if ( ( ((* (( (ptr) i←v7236)+1) ) != 0) ? ((* (( (ptr) i←v7236)+2) ) != 0) : 0 ) ) {
SOURCE(6359, 1309)
      {
         word samplesPerPixel←v7308;
         W2 size←v7336;
         word bytesPerLine←v7364;
         word bytesPadding←v7392;
         word linesPerBlock←v7420;
         word bytesPerBlock←v7448;
         word buf←v7476;
         word base←v7504;
SOURCE(6361, 53)
         samplesPerPixel←v7308 = (word) COrd←P120((* (( (hPt) (* (( (ptr) i←v7236)+1) ))+3) ));
SOURCE(6416, 78)
         size←v7336.f0 = (word) COrd←P120((*  (hPt) (* (( (ptr) i←v7236)+1) ) ));
         size←v7336.f1 = (word) COrd←P120((* (( (hPt) (* (( (ptr) i←v7236)+1) ))+1) ));
SOURCE(6496, 66)
         {
            word aisWords←v23456;
            aisWords←v23456 = (word) COrd←P120((* (( (hPt) (* (( (ptr) i←v7236)+2) ))+1) ));
SOURCE(1367, 52)
            bytesPerLine←v7364 = IOP2( * ,  (int)2,  (int)aisWords←v23456);
            };
SOURCE(6564, 124)
         if (((* (( (hPt) (* (( (ptr) i←v7236)+2) ))+2) ) == 65535)) {
            bytesPadding←v7392 = 0;
            }
         else {
            {
               word var←c25440;
               word aisWords←v23408;
               aisWords←v23408 = (word) COrd←P120((* (( (hPt) (* (( (ptr) i←v7236)+2) ))+3) ));
SOURCE(1367, 52)
               var←c25440 = IOP2( * ,  (int)2,  (int)aisWords←v23408);
               bytesPadding←v7392 = var←c25440;
               };
            };
SOURCE(6690, 141)
         {
            word tc62;
            word x63;
            word x64;
            if (((* (( (hPt) (* (( (ptr) i←v7236)+2) ))+2) ) == 65535)) {
               tc62 =  (word) (x63 = (* (( (ptr) gf←c26880)+4)/* defaultLinesPerBlock←v3140 */  ),
                  x64 = size←v7336.f0,
                  MIN((int)(word), x63, x64));
               }
            else {
               tc62 =  (word) COrd←P120((* (( (hPt) (* (( (ptr) i←v7236)+2) ))+2) ));
               };
            linesPerBlock←v7420 = tc62;
            };
SOURCE(6833, 60)
         bytesPerBlock←v7448 = (IOP2( * ,  (int)bytesPerLine←v7364,  (int)linesPerBlock←v7420) + bytesPadding←v7392);
SOURCE(6895, 218)
         {
            W4 var←c25472;
            var←c25472.f0 = 0;
            var←c25472.f1 = 0;
            var←c25472.f2 = linesPerBlock←v7420;
            var←c25472.f3 = IOP2( * ,  (int)samplesPerPixel←v7308,  (int)size←v7336.f1);
            {
               word pd65;
               pd65 = (* (( (ptr) (* (( (ptr) gf←c26880)+83)/* var←c25504 */  ))+19) );
               buf←v7476 = (word) ( *( (fPt) ((*  (ptr) pd65 ))))(var←c25472, 8, IOP2( * ,  (int)8,  (int)bytesPerLine←v7364), pd65);
               };
            };
SOURCE(7115, 59)
         base←v7504 = (* (( (ptr) buf←v7476)+8) );
SOURCE(7176, 187)
         {
            word var←c25536;
            {
               word idx66;
               var←c25536 = (
                  idx66 = (word) COrd←P120((*  (hPt) (* (( (ptr) i←v7236)+2) ) )),
                  BCK(idx66, 33)
                  );
               };
            {
               W4 var←c25568;
               var←c25568.f0 = 0;
               var←c25568.f1 = 0;
               var←c25568.f2 = size←v7336.f0;
               var←c25568.f3 = IOP2( * ,  (int)samplesPerPixel←v7308,  (int)size←v7336.f1);
               {
                  word pd67;
                  pd67 = (* (( (ptr) (* (( (ptr) gf←c26880)+83)/* var←c25504 */  ))+19) );
                  map←v4536 = (word) ( *( (fPt) ((*  (ptr) pd67 ))))(var←c25568, var←c25536, IOP2( * ,  (int)8,  (int)bytesPerLine←v7364), pd67)
                  ;
                  };
               };
            };
SOURCE(7365, 118)
         {
            word var←c25600;
            var←c25600 = (word) COrd←P120((* (( (hPt) (* (( (ptr) i←v7236)+1) ))+2) ));
            switch (var←c25600) {
               case 0: case 3: case 8: 
                  break;
               default: 
SOURCE(7434, 49)
                  {
                     word var←c0116;
                     var←c0116 = (* (( (ptr) gf←c26880)+36) );
                     (void) XR←RaiseError((word) (( (bPt) gf←c26880)+160)/* var←c23680 */ , (word) &var←c0116);
                     };
                  break;
               };
            };
SOURCE(7485, 31)
         {
            word pd68;
            pd68 = (* (( (ptr) (* (( (ptr) gf←c26880)+81)/* var←c24512 */  ))+30) );
            (void) ( *( (fPt) ((*  (ptr) pd68 ))))(in←v7264, (*  (ptr) i←v7236 ), pd68);
            };
SOURCE(7518, 139)
         {
            register word s←v7560 = 0;
            register word noName←c25632;
            {
               word idx69;
               noName←c25632 = (
                  idx69 = (word) size←v7336.f0,
                  SGNCK(idx69)
                  );
               };
            if ((s←v7560 >= noName←c25632)) {
               goto lab←L100010;
               };
            lab←L100013: ;
SOURCE(7555, 34)
SOURCE(7556, 33)
            (void) ReadBytes←P360(in←v7264, base←v7504, bytesPerLine←v7364);
SOURCE(7592, 65)
            {
               W2 var←c25664;
               W2 var←c25696;
               W2 var←c25728;
               var←c25664.f0 = s←v7560;
               var←c25664.f1 = 0;
               var←c25696.f0 = 0;
               var←c25696.f1 = 0;
               var←c25728.f0 = 1;
               var←c25728.f1 = size←v7336.f1;
               {
                  word pd70;
                  pd70 = (* (( (ptr) (* (( (ptr) gf←c26880)+83)/* var←c25504 */  ))+49) );
                  (void) ( *( (fPt) ((*  (ptr) pd70 ))))(map←v4536, buf←v7476, var←c25664, var←c25696, var←c25728, 0, pd70);
                  };
               };
            s←v7560 = (s←v7560 + 1);
            if ((s←v7560 < noName←c25632)) {
               goto lab←L100013;
               };
            lab←L100010: ;
            };
         };
      }
   else {
SOURCE(7675, 37)
      {
         word var←c0122;
         var←c0122 = (* (( (ptr) gf←c26880)+37) );
         (void) XR←RaiseError((word) (( (bPt) gf←c26880)+160)/* var←c23680 */ , (word) &var←c0122);
         };
      };
SOURCE(7714, 12)
   {
      word pd71;
      pd71 = (* (( (ptr) (* (( (ptr) gf←c26880)+81)/* var←c24512 */  ))+28) );
      (void) ( *( (fPt) ((*  (ptr) pd71 ))))(in←v7264, 0, pd71);
      };
SOURCE(6117, 1609)
   return(map←v4536);
   }

static void WriteBytes←P540(out←v4596, base←v4624, bytes←v4652)
   word out←v4596;
   word base←v4624;
   word bytes←v4652;
   {
   register ptr gf←c26912 =  (ptr) &globalframe;
   /* WriteBytes: */ 
SOURCE(7731, 147)
SOURCE(7818, 60)
   {
      W3 var←c25760;
      var←c25760.f0 = base←v4624;
      var←c25760.f1 = 0;
      var←c25760.f2 = bytes←v4652;
      {
         word pd72;
         pd72 = (* (( (ptr) (* (( (ptr) gf←c26912)+81)/* var←c24512 */  ))+24) );
         (void) ( *( (fPt) ((*  (ptr) pd72 ))))(out←v4596, var←c25760, pd72);
         };
      };
   }

static void Write←P600(name←v4724, map←v4752, placement←v4780, photometry←v4808, comments←v4836)
   word name←v4724;
   word map←v4752;
   word placement←v4780;
   word photometry←v4808;
   word comments←v4836;
   {
   W7 var←c26944;
   register ptr gf←c26976 =  (ptr) &globalframe;
   /* declaration of var←c25792 skipped */ 
   word wordsHeader←v7632 = 2048;
   /* declaration of out←v7660 skipped */ 
   word header←v7688;
   W3 raster←v7716;
   W2 uca←v7744;
   W4 box←v7772;
   W2 size←v7800;
   word bpp←v7828;
   word aisWordsPerLine←v7856;
   word buf←v7884;
   word base←v7912;
   /* Write: */ 
SOURCE(7884, 3096)
   {
      word tmpAddr73;
      tmpAddr73 = (word) (( (ptr) &var←c26944)+4)/* var←c25792 */ ;
      (*  (ptr) tmpAddr73 ) = ( ((word)  (fPt) WritePartHeader←P1356) );
      (* (( (ptr) tmpAddr73) + 1) ) = 1;
      };
SOURCE(8536, 62)
   {
      word var←c25824;
      {
         word pd74;
         pd74 = (* (( (ptr) (* (( (ptr) gf←c26976)+82)/* var←c24608 */  ))+5) );
         var←c25824 = (word) ( *( (fPt) ((*  (ptr) pd74 ))))(name←v4724, pd74);
         };
      {
         W2 var←c25856;
         var←c25856.f0 = 4096;
         var←c25856.f1 = 2;
         {
            word pd75;
            pd75 = (* (( (ptr) (* (( (ptr) gf←c26976)+82)/* var←c24608 */  ))+39) );
            var←c26944.f6/* out←v7660 */  = (word) ( *( (fPt) ((*  (ptr) pd75 ))))(var←c25824, 1, (*  (W4Pt) (( (ptr) gf←c26976)+71)/* var←c24224 */  ), 0, 0, (*  (W5Pt) (
                  ( (ptr) gf←c26976)+75)/* var←c24288 */  )
               , 1, var←c25856, pd75);
            };
         };
      };
SOURCE(9040, 48)
   box←v7772 = (*  (W4Pt) map←v4752 );
SOURCE(9090, 50)
   {
      W4 b←v21908;
      b←v21908 = (*  (W4Pt) map←v4752 );
      size←v7800.f0 = (b←v21908.f2 - b←v21908.f0);
      size←v7800.f1 = (b←v21908.f3 - b←v21908.f1);
      };
SOURCE(9142, 76)
   {
      word x76;
      bpp←v7828 = (x76 = (* (( (ptr) map←v4752)+5) ),
         MAX( (unsigned) , 1, x76));
      };
SOURCE(9220, 41)
   aisWordsPerLine←v7856 = IOP2( / ,  (int)(IOP2( * ,  (int)size←v7800.f1,  (int)bpp←v7828) + 15),  (int)16);
SOURCE(9263, 73)
   {
      W4 var←c25952;
      var←c25952.f0 = 0;
      var←c25952.f1 = 0;
      var←c25952.f2 = 1;
      var←c25952.f3 = size←v7800.f1;
      {
         word pd77;
         pd77 = (* (( (ptr) (* (( (ptr) gf←c26976)+83)/* var←c25504 */  ))+19) );
         buf←v7884 = (word) ( *( (fPt) ((*  (ptr) pd77 ))))(var←c25952, bpp←v7828, 0, pd77);
         };
      };
SOURCE(9338, 59)
   base←v7912 = (* (( (ptr) buf←v7884)+8) );
SOURCE(9399, 57)
   {
      word x78;
      word x79;
      if (( (int)(x78 = size←v7800.f1,
         x79 = size←v7800.f0,
         MIN((int)(word), x78, x79)) ==  (int)0)) {
SOURCE(9431, 25)
         {
            word var←c0148;
            var←c0148 = (* (( (ptr) gf←c26976)+38) );
            (void) XR←RaiseError((word) (( (bPt) gf←c26976)+160)/* var←c23680 */ , (word) &var←c0148);
            };
         };
      };
SOURCE(9458, 59)
   header←v7688 = (( (((unsigned)(word) Card←P180(BCK(wordsHeader←v7632, 65536)) << 16) >> 16) ) + 2225733632);
SOURCE(9519, 84)
   {
      word var←c26016;
      word var←c26048;
      word var←c26080;
      word var←c26112;
      {
         word idx80;
         var←c26016 = (word) Card←P180((
               idx80 = (word) size←v7800.f0,
               BCK(idx80, 65536)
               ));
         };
      {
         word idx81;
         var←c26048 = (word) Card←P180((
               idx81 = (word) size←v7800.f1,
               BCK(idx81, 65536)
               ));
         };
      var←c26080 = (word) Card←P180(3);
      var←c26112 = (word) Card←P180(1);
      raster←v7716.f0 = ((var←c26016 << 16) + ( (((unsigned)var←c26048 << 16) >> 16) ));
      raster←v7716.f1 = ((var←c26080 << 16) + ( (((unsigned)var←c26112 << 16) >> 16) ));
      raster←v7716.f2 = 131071;
      };
SOURCE(9605, 80)
   {
      word var←c26144;
      word var←c26176;
      var←c26144 = (word) Card←P180(bpp←v7828);
      var←c26176 = (word) Card←P180(BCK(aisWordsPerLine←v7856, 65536));
      uca←v7744.f0 = ((var←c26144 << 16) + ( (((unsigned)var←c26176 << 16) >> 16) ));
      uca←v7744.f1 =  (word) -1;
      };
SOURCE(9695, 64)
SOURCE(9696, 63)
   (void) WriteBytes←P540(var←c26944.f6/* out←v7660 */ , (word) &header←v7688, 4);
SOURCE(9762, 89)
   (void) WritePartHeader←P1356(1, 18, (word) (( (bPt) &var←c26944)+16)/* var←c25792 */ );
SOURCE(9861, 59)
SOURCE(9862, 58)
   (void) WriteBytes←P540(var←c26944.f6/* out←v7660 */ , (word) &raster←v7716, 10);
SOURCE(9931, 55)
SOURCE(9932, 54)
   (void) WriteBytes←P540(var←c26944.f6/* out←v7660 */ , (word) &uca←v7744, 8);
SOURCE(9989, 339)
   if ((placement←v4780 != 0)) {
SOURCE(10013, 318)
      {
         W2 part←v8440;
SOURCE(10174, 19)
         part←v8440 = (*  (W2Pt) placement←v4780 );
SOURCE(10195, 63)
         (void) WritePartHeader←P1356(2, 8, (word) (( (bPt) &var←c26944)+16)/* var←c25792 */ );
SOURCE(10268, 60)
SOURCE(10269, 59)
         (void) WriteBytes←P540(var←c26944.f6/* out←v7660 */ , (word) &part←v8440, 8);
         };
      };
SOURCE(10334, 345)
   if ((photometry←v4808 != 0)) {
SOURCE(10359, 323)
      {
         W8 part←v8612;
SOURCE(10361, 33)
         XR←FillWords(&part←v8612, 8, 0);
         part←v8612.f5 =  (word) -1;
         part←v8612.f6 =  (word) -1;
SOURCE(10521, 20)
         part←v8612 = (*  (W8Pt) photometry←v4808 );
SOURCE(10543, 65)
         (void) WritePartHeader←P1356(3, 30, (word) (( (bPt) &var←c26944)+16)/* var←c25792 */ );
SOURCE(10618, 61)
SOURCE(10619, 60)
         (void) WriteBytes←P540(var←c26944.f6/* out←v7660 */ , (word) &part←v8612, 30);
         };
      };
SOURCE(10685, 23)
   if ((comments←v4836 != 0)) {
      };
SOURCE(10719, 23)
   (void) WritePartHeader←P1356(0, 0, (word) (( (bPt) &var←c26944)+16)/* var←c25792 */ );
SOURCE(10758, 31)
   {
      word pd82;
      pd82 = (* (( (ptr) (* (( (ptr) gf←c26976)+81)/* var←c24512 */  ))+30) );
      (void) ( *( (fPt) ((*  (ptr) pd82 ))))(var←c26944.f6/* out←v7660 */ , IOP2( * ,  (int)2,  (int)wordsHeader←v7632), pd82);
      };
SOURCE(10791, 164)
   {
      register word s←v8784;
      register word noName←c26240;
      {
         word idx83;
         s←v8784 = (
            idx83 = (word) box←v7772.f0,
            SGNCK(idx83)
            );
         };
      {
         word idx84;
         noName←c26240 = (
            idx84 = (word) box←v7772.f2,
            SGNCK(idx84)
            );
         };
      if ((s←v8784 >= noName←c26240)) {
         goto lab←L100015;
         };
      lab←L100018: ;
SOURCE(10831, 73)
      {
         W2 var←c26272;
         W2 var←c26304;
         W2 var←c26336;
         var←c26272.f0 = 0;
         var←c26272.f1 = 0;
         var←c26304.f0 = s←v8784;
         var←c26304.f1 = box←v7772.f1;
         var←c26336.f0 = 1;
         var←c26336.f1 = size←v7800.f1;
         {
            word pd85;
            pd85 = (* (( (ptr) (* (( (ptr) gf←c26976)+83)/* var←c25504 */  ))+49) );
            (void) ( *( (fPt) ((*  (ptr) pd85 ))))(buf←v7884, map←v4752, var←c26272, var←c26304, var←c26336, 0, pd85);
            };
         };
SOURCE(10914, 41)
SOURCE(10915, 40)
      (void) WriteBytes←P540(var←c26944.f6/* out←v7660 */ , base←v7912, IOP2( * ,  (int)aisWordsPerLine←v7856,  (int)2));
      s←v8784 = (s←v8784 + 1);
      if ((s←v8784 < noName←c26240)) {
         goto lab←L100018;
         };
      lab←L100015: ;
      };
SOURCE(10967, 13)
   {
      word pd86;
      pd86 = (* (( (ptr) (* (( (ptr) gf←c26976)+81)/* var←c24512 */  ))+28) );
      (void) ( *( (fPt) ((*  (ptr) pd86 ))))(var←c26944.f6/* out←v7660 */ , 0, pd86);
      };
   }

static void WritePartHeader←P1356(type←v7988, nBytesInPart←v8016, formal←c27008)
   word type←v7988;
   word nBytesInPart←v8016;
   word formal←c27008;
   {
   word nWordsTotal←v8828;
   word part←v8856;
   formal←c27008 = (formal←c27008 - 16);
   /* WritePartHeader: */ 
SOURCE(8038, 467)
SOURCE(8114, 68)
   nWordsTotal←v8828 = IOP2( / ,  (int)(nBytesInPart←v8016 + 2),  (int)2);
SOURCE(8327, 53)
   {
      word idx87;
      word idx88;
      (*  (hPt) &part←v8856 ) = (((((type←v7988 & 077) << 2) + (
         idx87 = (word) IOP2( / ,  (int)nWordsTotal←v8828,  (int)256),
         BCK(idx87, 4)
         )) << 8) + (
         idx88 = (word) IOP2( % ,  (int)nWordsTotal←v8828,  (int)256),
         BCK(idx88, 256)
         ));
      };
SOURCE(8382, 56)
   if ((type←v7988 == 0)) {
SOURCE(8401, 37)
      (* (( (bPt) &part←v8856)+1) ) = 0;
      part←v8856 = (part←v8856 & 4244635647) | (((0)) << 24);
      };
SOURCE(8448, 57)
SOURCE(8449, 56)
   (void) WriteBytes←P540((* (( (ptr) formal←c27008)+6) ), (word) &part←v8856, 2);
   }

static word NewSampleMap←P660(scanCount←v4980, scanLength←v5008, bitsPerPixel←v5036)
   word scanCount←v4980;
   word scanLength←v5008;
   word bitsPerPixel←v5036;
   {
   register ptr gf←c27040 =  (ptr) &globalframe;
   word map←v5100;
   /* NewSampleMap: */ 
SOURCE(10985, 253)
SOURCE(10985, 253)
   map←v5100 = 0;
SOURCE(11110, 128)
   {
      W4 var←c26400;
      var←c26400.f0 = 0;
      var←c26400.f1 = 0;
      var←c26400.f2 = SGNCK(scanCount←v4980);
      var←c26400.f3 = SGNCK(scanLength←v5008);
      {
         word pd89;
         pd89 = (* (( (ptr) (* (( (ptr) gf←c27040)+83)/* var←c25504 */  ))+19) );
         map←v5100 = (word) ( *( (fPt) ((*  (ptr) pd89 ))))(var←c26400, bitsPerPixel←v5036, 0, pd89);
         };
      };
SOURCE(10985, 253)
   return(map←v5100);
   }

static word ReadSample←P720(map←v5160, line←v5188, pixel←v5216)
   word map←v5160;
   word line←v5188;
   word pixel←v5216;
   {
   register ptr gf←c27072 =  (ptr) &globalframe;
   word value←v5260;
   /* ReadSample: */ 
SOURCE(11244, 156)
SOURCE(11338, 62)
   {
      W2 var←c26432;
      var←c26432.f0 = SGNCK(line←v5188);
      var←c26432.f1 = SGNCK(pixel←v5216);
      {
         word pd90;
         pd90 = (* (( (ptr) (* (( (ptr) gf←c27072)+83)/* var←c25504 */  ))+42) );
         value←v5260 = (word) ( *( (fPt) ((*  (ptr) pd90 ))))(map←v5160, var←c26432, pd90);
         };
      };
SOURCE(11244, 156)
   return(value←v5260);
   }

static void WriteSample←P780(map←v5320, value←v5348, line←v5376, pixel←v5404)
   word map←v5320;
   word value←v5348;
   word line←v5376;
   word pixel←v5404;
   {
   register ptr gf←c27104 =  (ptr) &globalframe;
   /* WriteSample: */ 
SOURCE(11405, 154)
SOURCE(11491, 68)
   {
      W2 var←c26464;
      var←c26464.f0 = SGNCK(line←v5376);
      var←c26464.f1 = SGNCK(pixel←v5404);
      {
         word pd91;
         pd91 = (* (( (ptr) (* (( (ptr) gf←c27104)+83)/* var←c25504 */  ))+43) );
         (void) ( *( (fPt) ((*  (ptr) pd91 ))))(map←v5320, var←c26464, value←v5348, 0, pd91);
         };
      };
   }

static void ReadLine←P840(map←v5464, buffer←v5492, line←v5520)
   word map←v5464;
   word buffer←v5492;
   word line←v5520;
   {
   register ptr gf←c27136 =  (ptr) &globalframe;
   /* ReadLine: */ 
SOURCE(11565, 158)
SOURCE(11646, 77)
   {
      W2 var←c26496;
      W2 var←c26528;
      var←c26496.f0 = SGNCK(line←v5520);
      var←c26496.f1 = 0;
      var←c26528.f0 = 0;
      var←c26528.f1 = 1;
      {
         word pd92;
         pd92 = (* (( (ptr) (* (( (ptr) gf←c27136)+83)/* var←c25504 */  ))+44) );
         (void) ( *( (fPt) ((*  (ptr) pd92 ))))(map←v5464, var←c26496, var←c26528, buffer←v5492, 0, 2147483647, pd92);
         };
      };
   }

static void WriteLine←P900(map←v5580, buffer←v5608, line←v5636)
   word map←v5580;
   word buffer←v5608;
   word line←v5636;
   {
   register ptr gf←c27168 =  (ptr) &globalframe;
   /* WriteLine: */ 
SOURCE(11729, 159)
SOURCE(11811, 77)
   {
      W2 var←c26560;
      W2 var←c26592;
      var←c26560.f0 = SGNCK(line←v5636);
      var←c26560.f1 = 0;
      var←c26592.f0 = 0;
      var←c26592.f1 = 1;
      {
         word pd93;
         pd93 = (* (( (ptr) (* (( (ptr) gf←c27168)+83)/* var←c25504 */  ))+47) );
         (void) ( *( (fPt) ((*  (ptr) pd93 ))))(map←v5580, var←c26560, var←c26592, buffer←v5608, 0, 2147483647
            , 0, pd93);
         };
      };
   }

/* file: AISIOImpl, module: AISIOImpl, compiled at: March 10, 1992 11:59:09 am PST */ 
extern void XR←install←AISIOImpl() {
   NoName←Q2316();
   }
extern void XR←run←AISIOImpl() { XR←Start(&globalframe); }