/* Generated with C2C (Cedar To C)*/
/* Copyright (C) 1993 by Xerox Corporation.  All rights reserved. */
/* time: October 29, 1993 1:10:07 pm PDT */
/* C2C version: April 20, 1993 (sun4) */
/* ref-counting: off */
/* file: CIIHalftoneDeviceImpl, module: CIIHalftoneDeviceImpl */ 
/* switches: bcfhklnouw */ 
#include <cedar/InstallationSupport.h>
#include <cedar/CedarExtra.h>
static char versionStamp[] = "@(#)mob←version [4047781374,1164815472] CIIHalftoneDeviceImpl";
typedef unsigned word, *ptr;
typedef unsigned char byte, *bPt;
typedef unsigned short half, *hPt;
typedef word (*fPt)();
typedef struct {word f0, f1, f2, f3;} W4;
typedef W4 *W4Pt;
typedef struct {word f0, f1, f2;} W3;
typedef W3 *W3Pt;
typedef struct {word f0, f1, f2, f3, f4, f5, f6, f7;} W8;
typedef struct {W8 f; word r;} W9;
typedef struct {W8 f; W3 r;} W11;
typedef W9 *W9Pt;
typedef struct {word f0, f1;} W2;
static float fc1 = 0.48;
static float fc2 = 45.0;
static float fc3 = 75.0;
static float fc4 = 105.0;
static float fc5 = 90.0;
#define SOURCE(p, l) /* source p, l */
#define BCK(idx, lim) ( ((unsigned) idx) >= ((unsigned) lim) ? (XR←RaiseBoundsFault()) : (idx) )
static float fc35 = 0.05;
static float fc42 = 5.656;
#define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i )
static float fc54 = 1.0;
static void NoName←Q1068();
static void CIIHalftoneDeviceImpl←P0();
static word MakeHalftoneProperties←P60();
static word SetSeparationSingle←P120();
static word NoName←Q1128();
static word SetOutputBuffersSingle←P180();
static word NoName←Q1188();
static word CreateHandleFromRasters←P240();
static word NoName←Q1248();
extern word CII←BWHalftoneDeviceSetup();
extern word CII←CMYKHalftoneDeviceSetup();
extern word CII←CMYKHalftoneSeparationDeviceSetup();
static void NoName←Q1308();
static void NoName←Q1368();
static void NoName←Q1428();
static struct {unsigned f; char r[44];} string6 = {2752556, "\260\006\005\146\151\162\163\164\257\300\236\211\262\021\300\215\235\324\340\101\034\005\004\162\145\163\164\214\257\300\236\211\262\021\300\215\235\324\340\101\034\261\000"};
static struct {unsigned f; char r[4];} string7 = {131074, "\004)\000"};
static struct {unsigned f; char r[16];} string8 = {851984, "\257\300\000\246\143\260\300\265\077\145\155\101\240\000\000"};
static struct {unsigned f; char r[4];} string9 = {196611, "\004\177\377"};
static struct {unsigned f; char r[16];} string10 = {851984, "\257\300\361\104\075\376\300\105\155\254\160\100\200\000\000"};
static struct {unsigned f; char r[4];} string11 = {65540, "\251\000\000"};
static struct {unsigned f; char r[4];} string12 = {131076, "\216\251\000"};
static struct {unsigned f; char r[4];} string13 = {65537, "\001\000\000"};
static struct {unsigned f; char r[16];} string14 = {851984, "\257\300\241\011\366\176\300\127\130\105\301\101\334\000\000"};
static struct {unsigned f; char r[4];} string15 = {131074, "\003\004\000"};
static struct {unsigned f; char r[16];} string16 = {851984, "\257\300\207\334\320\152\300\253\325\361\210\100\200\000\000"};
static struct {unsigned f; char r[8];} string17 = {327688, "Print\000\000"};
static struct {unsigned f; char r[16];} string18 = {851984, "\257\300\361\104\075\376\300\105\155\254\160\100\164\000\000"};
static struct {unsigned f; char r[4];} string19 = {131074, "\003\026\000"};
static struct {unsigned f; char r[16];} string20 = {851984, "\257\300\074\026\324\154\300\201\167\130\113\100\150\000\000"};
static struct {unsigned f; char r[16];} string21 = {851984, "\257\300\000\246\143\260\300\265\077\145\155\100\150\000\000"};
static struct {unsigned f; char r[16];} string22 = {851984, "\257\300\074\177\166\242\300\203\113\217\044\100\150\000\000"};
static struct {unsigned f; char r[16];} string23 = {851984, "\257\300\361\072\110\004\300\054\212\055\367\100\150\000\000"};
static struct {unsigned f; char r[16];} string24 = {851984, "\257\300\151\316\011\300\300\225\037\327\014\100\150\000\000"};
static struct {unsigned f; char r[16];} string25 = {851984, "\257\300\045\370\116\014\300\270\323\074\131\100\150\000\000"};
static struct {unsigned f; char r[16];} string26 = {851984, "\257\300\342\102\054\110\300\232\020\205\150\100\150\000\000"};
static struct {unsigned f; char r[16];} string27 = {851984, "\257\300\350\311\135\367\300\362\215\374\250\100\150\000\000"};
static struct {unsigned f; char r[16];} string28 = {851984, "\257\300\136\344\215\017\300\051\016\154\236\100\150\000\000"};
static struct {unsigned f; char r[16];} string29 = {851984, "\257\300\207\001\021\231\300\362\156\044\006\100\150\000\000"};
static struct {unsigned f; char r[16];} string30 = {851984, "\257\300\067\246\211\216\300\354\224\134\067\100\150\000\000"};
static struct {unsigned f; char r[16];} string31 = {851984, "\257\300\121\117\377\026\300\315\013\026\004\100\150\000\000"};
static struct {unsigned f; char r[16];} string32 = {851984, "\257\300\166\344\362\325\300\124\127\204\375\100\150\000\000"};
static struct {unsigned f; char r[16];} string33 = {851984, "\257\300\275\320\070\317\300\004\110\363\366\100\150\000\000"};
static struct {
   word f0[53]; 
   } globalframe = {
   {0}
   };

static void NoName←Q1068()
   {
   register ptr gf←c0116 =  (ptr) &globalframe;
   word var←c20780;
   (* (( (ptr) gf←c0116)+4)/* defaultDotShape←v3476 */  ) = (*  (ptr) &fc1 );
   (* (( (ptr) gf←c0116)+5) ) = (*  (ptr) &fc2 );
   (* (( (ptr) gf←c0116)+6) ) = (*  (ptr) &fc3 );
   (* (( (ptr) gf←c0116)+7) ) = (*  (ptr) &fc4 );
   (* (( (ptr) gf←c0116)+8) ) = (*  (ptr) &fc5 );
   (* (( (ptr) gf←c0116)+37) ) = ( ((word)  (fPt) CIIHalftoneDeviceImpl←P0) );
   (* (( (ptr) gf←c0116)+35) ) = ( ((word)  (fPt) MakeHalftoneProperties←P60) );
   (* (( (ptr) gf←c0116)+33) ) = ( ((word)  (fPt) SetSeparationSingle←P120) );
   (* (( (ptr) gf←c0116)+31) ) = ( ((word)  (fPt) SetOutputBuffersSingle←P180) );
   (* (( (ptr) gf←c0116)+29) ) = ( ((word)  (fPt) CreateHandleFromRasters←P240) );
   (* (( (ptr) gf←c0116)+27) ) = ( ((word)  (fPt) CII←BWHalftoneDeviceSetup) );
   (* (( (ptr) gf←c0116)+25) ) = ( ((word)  (fPt) CII←CMYKHalftoneDeviceSetup) );
   (* (( (ptr) gf←c0116)+23) ) = ( ((word)  (fPt) CII←CMYKHalftoneSeparationDeviceSetup) );
   (* (( (ptr) gf←c0116)+9) ) = (word) XR←GetTypeIndex((word) &string6, 0, (word) &string7);
   (* (( (ptr) gf←c0116)+12) ) = (word) XR←GetTypeIndex((word) &string8, 0, (word) &string9);
   (* (( (ptr) gf←c0116)+13) ) = (word) XR←GetTypeIndexS((word) (&string10));
   (* (( (ptr) gf←c0116)+14) ) = (word) XR←GetTypeIndexS((word) (&string11));
   (* (( (ptr) gf←c0116)+15) ) = (word) XR←GetTypeIndex((word) &string12, 0, (word) &string13);
   (* (( (ptr) gf←c0116)+17) ) = (word) XR←GetTypeIndex((word) &string14, 0, (word) &string15);
   (* (( (ptr) gf←c0116)+18) ) = (word) XR←GetTypeIndexS((word) (&string16));
   (*  (ptr) (( (bPt) gf←c0116)+88) ) = (word) XR←GetRefLiteral((* (( (ptr) gf←c0116)+15) ), (word) &string17);
   (void) XR←DeclareGlobalFrame((word) "CIIHalftoneDeviceImpl", &globalframe, (word) XR←GetTypeIndex((word) &string18, 0, (word) &string19)
      , (word) (( (bPt) gf←c0116)+148)/* var←c19436 */ );
   var←c20780 = (word) XR←ImportInterface((word) "CII", (word) XR←GetTypeIndexS((word) (&string20)), 69);
   (* (( (ptr) gf←c0116)+45)/* var←c19820 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 68436741);
   (void) XR←ImportProcS(var←c20780, 69222920);
   (void) XR←ImportProcS(var←c20780, 68436997);
   (void) XR←ImportProcS(var←c20780, 67911683);
   (void) XR←ImportProcS(var←c20780, 67649794);
   var←c20780 = (word) XR←ImportInterface((word) "CIIPrivate", (word) XR←GetTypeIndexS((word) (&string21)), 13);
   (* (( (ptr) gf←c0116)+44)/* var←c19724 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 68421381);
   (void) XR←ImportProcS(var←c20780, 68158980);
   (void) XR←ImportProcS(var←c20780, 68158724);
   (void) XR←ImportProcS(var←c20780, 68158468);
   (void) XR←ImportProcS(var←c20780, 67896067);
   (void) XR←ImportProcS(var←c20780, 68683782);
   (void) XR←ImportProcS(var←c20780, 264705);
   (void) XR←ImportProcS(var←c20780, 67636226);
   var←c20780 = (word) XR←ImportInterface((word) "Imager", (word) XR←GetTypeIndexS((word) (&string22)), 84);
   (* (( (ptr) gf←c0116)+49)/* var←c20236 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 67383553);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerBrick", (word) XR←GetTypeIndexS((word) (&string23)), 4);
   (* (( (ptr) gf←c0116)+39)/* var←c19468 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 203424264);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerDeviceInterchange", (word) XR←GetTypeIndexS((word) (&string24)), 2);
   (* (( (ptr) gf←c0116)+52)/* var←c20556 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 262401);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerError", (word) XR←GetTypeIndexS((word) (&string25)), 3);
   (* (( (ptr) gf←c0116)+40)/* var←c19532 */  ) = var←c20780;
   var←c20780 = (word) XR←ImportInterface((word) "ImagerFourColorContext", (word) XR←GetTypeIndexS((word) (&string26)), 2);
   (* (( (ptr) gf←c0116)+47)/* var←c20140 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 70516744);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerManhattan", (word) XR←GetTypeIndexS((word) (&string27)), 24);
   (* (( (ptr) gf←c0116)+51)/* var←c20396 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 68158209);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerPrintContext", (word) XR←GetTypeIndexS((word) (&string28)), 5);
   (* (( (ptr) gf←c0116)+46)/* var←c20012 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 525058);
   (void) XR←ImportProcS(var←c20780, 525314);
   (void) XR←ImportProcS(var←c20780, 69992713);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerPrintDevice", (word) XR←GetTypeIndexS((word) (&string29)), 5);
   (* (( (ptr) gf←c0116)+42)/* var←c19628 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 67634178);
   (void) XR←ImportProcS(var←c20780, 67371265);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerRaster", (word) XR←GetTypeIndexS((word) (&string30)), 13);
   (* (( (ptr) gf←c0116)+48)/* var←c20172 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 67373569);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerTransformation", (word) XR←GetTypeIndexS((word) (&string31)), 55);
   (* (( (ptr) gf←c0116)+50)/* var←c20300 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 67371777);
   var←c20780 = (word) XR←ImportInterface((word) "ImagerPrintColor", (word) XR←GetTypeIndexS((word) (&string32)), 4);
   (* (( (ptr) gf←c0116)+43)/* var←c19660 */  ) = var←c20780;
   (void) XR←ImportProcS(var←c20780, 524546);
   var←c20780 = (word) XR←ImportInterface((word) "RuntimeError", (word) XR←GetTypeIndexS((word) (&string33)), 27);
   (* (( (ptr) gf←c0116)+41)/* var←c19596 */  ) = var←c20780;
   }

static void CIIHalftoneDeviceImpl←P0(formal←c035, formal←c034)
   word formal←c035;
   word formal←c034;
   {
   /* CIIHalftoneDeviceImpl: */ 
SOURCE(296, 6229)
   /* moved to installation proc */ 
SOURCE(1132, 117)
   /* moved to installation proc */ 
   /* moved to installation proc */ 
   /* moved to installation proc */ 
   /* moved to installation proc */ 
   }

static word MakeHalftoneProperties←P60(logicalDevice←v3904, pixelsPerHalftoneDot←v3932, toners←v3960)
   word logicalDevice←v3904;
   word pixelsPerHalftoneDot←v3932;
   word toners←v3960;
   {
   register ptr gf←c20812 =  (ptr) &globalframe;
   word h←v4004;
   W4 angle←v4828;
   /* MakeHalftoneProperties: */ 
SOURCE(1252, 563)
SOURCE(1252, 563)
   h←v4004 = 0;
SOURCE(1438, 73)
   angle←v4828 = (*  (W4Pt) (( (ptr) gf←c20812)+5)/* defaultScreenAngle←v3504 */  );
SOURCE(1513, 302)
   {
      register word t←v4908 = 0;
      lab←L100003: ;
SOURCE(1575, 240)
      if (((word) toners←v3960 >> (31 - (word) (t←v4908 + 16))) & 1) {
SOURCE(1593, 224)
         {
            word angle←v4952;
            W3 brick←v4980;
SOURCE(1595, 35)
            angle←v4952 = (* ((( (ptr) gf←c20812)+5)/* defaultScreenAngle←v3504 */ +BCK(t←v4908, 4)) );
SOURCE(1632, 133)
            {
               word pd34;
               pd34 = (* (( (ptr) (* (( (ptr) gf←c20812)+39)/* var←c19468 */  ))+6) );
               (void) ( *( (fPt) ((*  (ptr) pd34 ))))((word) &brick←v4980, pixelsPerHalftoneDot←v3932, angle←v4952, (* (( (ptr) gf←c20812)+4)
                  /* defaultDotShape←v3476 */  ), (*  (ptr) &fc35 ), 16
                  , 255, 0, 0, pd34);
               };
SOURCE(1767, 48)
            {
               word var←c19500;
               var←c19500 = XR←NewObject(24, (* (( (ptr) gf←c20812)+9) ));
               (* (( (ptr) var←c19500)+1) ) = t←v4908;
               (*  (W3Pt) (( (ptr) var←c19500)+2) ) = brick←v4980;
               (* (( (ptr) var←c19500)+5) ) = h←v4004;
               h←v4004 = var←c19500;
               };
            };
         };
      if ((t←v4908 >= 3)) {
         goto lab←L100000;
         };
      t←v4908 = (t←v4908 + 1);
      goto lab←L100003;
      lab←L100000: ;
      };
SOURCE(1252, 563)
   return(h←v4004);
   }

static word SetSeparationSingle←P120(formal←c0139, formal←c0140)
   word formal←c0139;
   word formal←c0140;
   {
   W8 var←c20844;
   /* declaration of h←v4064 skipped */ 
   /* declaration of toner←v4092 skipped */ 
   /* declaration of var←c01 skipped */ 
   /* declaration of res←v4136 skipped */ 
   var←c20844.f4/* h←v4064 */  = formal←c0139;
   var←c20844.f5/* toner←v4092 */  = formal←c0140;
   /* SetSeparationSingle: */ 
SOURCE(1833, 601)
SOURCE(1833, 601)
   var←c20844.f7/* res←v4136 */  = 0;
SOURCE(1921, 513)
SOURCE(1921, 513)
   {
      word var←c02;
      {
         word var←c0130;
         var←c0130 = (word) &var←c20844;
         var←c02 = (word) XR←Enable(( ((word)  (fPt) NoName←Q1128) ), ( ((word)  (fPt) NoName←Q1428) ), var←c0130);
         };
      if ((var←c02 == 2)) {
         /* removed tail goto */ 
         }
      else {
         if ((var←c02 == 1)) {
            goto lab←L02;
            };
         };
      };
SOURCE(1833, 601)
   return(var←c20844.f7/* res←v4136 */ );
   lab←L02: ;
   return(var←c20844.f6/* var←c01 */ );
   }

static word NoName←Q1128(formal←c0119)
   word formal←c0119;
   {
   register ptr gf←c0118 =  (ptr) &globalframe;
SOURCE(2119, 47)
   {
      word state←v5024;
      word deviceColorData←v5052;
SOURCE(2119, 47)
      state←v5024 = XR←Narrow((*  (ptr) (* (( (ptr) formal←c0119)+4) ) ), (* (( (ptr) gf←c0118)+12) ));
SOURCE(2168, 96)
      {
         word pd36;
         pd36 = (* (( (ptr) (* (( (ptr) gf←c0118)+42)/* var←c19628 */  ))+5) );
         deviceColorData←v5052 = (word) ( *( (fPt) ((*  (ptr) pd36 ))))((* ((( (ptr) state←v5024)+1)) ), pd36);
         };
SOURCE(2266, 48)
      if ((deviceColorData←v5052 == 0)) {
SOURCE(2296, 18)
         (* (( (ptr) formal←c0119)+6) ) = 1070;
         return(1);
         };
SOURCE(2316, 52)
      if (((* (( (ptr) formal←c0119)+5) ) > 3)) {
SOURCE(2353, 15)
         (* (( (ptr) formal←c0119)+6) ) = 1001;
         return(1);
         };
SOURCE(2370, 64)
      {
         word pd37;
         word idx38;
         pd37 = (* (( (ptr) (* (( (ptr) gf←c0118)+43)/* var←c19660 */  ))+5) );
         (void) ( *( (fPt) ((*  (ptr) pd37 ))))(deviceColorData←v5052, (
               idx38 = (* (( (ptr) formal←c0119)+5) ),
               BCK(idx38, 16)
               ), pd37);
         };
      };
   return(0);
   }

static word SetOutputBuffersSingle←P180(formal←c0141, formal←c0142, formal←c0143)
   word formal←c0141;
   word formal←c0142;
   word formal←c0143;
   {
   W9 var←c20876;
   /* declaration of h←v4196 skipped */ 
   /* declaration of nBuffers←v4224 skipped */ 
   /* declaration of outputBuffers←v4252 skipped */ 
   /* declaration of var←c03 skipped */ 
   /* declaration of res←v4344 skipped */ 
   (* (( (ptr) &var←c20876)+4)/* h←v4196 */  ) = formal←c0141;
   (* (( (ptr) &var←c20876)+5)/* nBuffers←v4224 */  ) = formal←c0142;
   (* (( (ptr) &var←c20876)+6)/* outputBuffers←v4252 */  ) = formal←c0143;
   /* SetOutputBuffersSingle: */ 
SOURCE(2440, 657)
SOURCE(2440, 657)
   (* (( (ptr) &var←c20876)+8)/* res←v4344 */  ) = 0;
SOURCE(2587, 510)
SOURCE(2587, 510)
   {
      word var←c04;
      {
         word var←c0131;
         var←c0131 = (word) &var←c20876;
         var←c04 = (word) XR←Enable(( ((word)  (fPt) NoName←Q1188) ), ( ((word)  (fPt) NoName←Q1368) ), var←c0131);
         };
      if ((var←c04 == 3)) {
         /* removed tail goto */ 
         }
      else {
         if ((var←c04 == 1)) {
            goto lab←L04;
            };
         };
      };
SOURCE(2440, 657)
   return((* (( (ptr) &var←c20876)+8)/* res←v4344 */  ));
   lab←L04: ;
   return((* (( (ptr) &var←c20876)+7)/* var←c03 */  ));
   }

static word NoName←Q1188(formal←c0121)
   word formal←c0121;
   {
   register ptr gf←c0120 =  (ptr) &globalframe;
SOURCE(2785, 312)
   if (( (int)(* (( (ptr) formal←c0121)+5) ) !=  (int)1)) {
SOURCE(2806, 48)
      (* (( (ptr) formal←c0121)+7) ) = 1065;
      return(1);
      }
   else {
SOURCE(2854, 248)
      {
         word state←v5108;
         word map←v5136;
SOURCE(2856, 47)
         state←v5108 = XR←Narrow((*  (ptr) (* (( (ptr) formal←c0121)+4) ) ), (* (( (ptr) gf←c0120)+12) ));
SOURCE(2905, 75)
         {
            word pd39;
            pd39 = (* (( (ptr) (* (( (ptr) gf←c0120)+44)/* var←c19724 */  ))+16) );
            map←v5136 = (word) ( *( (fPt) ((*  (ptr) pd39 ))))((* (( (ptr) formal←c0121)+6) ), 0, pd39);
            };
SOURCE(2982, 115)
         {
            word pd40;
            pd40 = (* (( (ptr) (* (( (ptr) gf←c0120)+42)/* var←c19628 */  ))+8) );
            if ((0 != (word) ( *( (fPt) ((*  (ptr) pd40 ))))((* (( (ptr) state←v5108)+1) ), map←v5136, pd40))) {
SOURCE(3064, 33)
               {
                  word pd41;
                  pd41 = (* (( (ptr) (* (( (ptr) gf←c0120)+44)/* var←c19724 */  ))+14) );
                  (void) ( *( (fPt) ((*  (ptr) pd41 ))))(state←v5108, pd41);
                  };
               };
            };
         };
      };
   return(0);
   }

static word CreateHandleFromRasters←P240(formal←c0144, formal←c0145, formal←c0146, formal←c0147, formal←c0148)
   word formal←c0144;
   word formal←c0145;
   word formal←c0146;
   word formal←c0147;
   word formal←c0148;
   {
   W11 var←c20908;
   /* declaration of s←v4404 skipped */ 
   /* declaration of logicalDevice←v4432 skipped */ 
   /* declaration of nRasters←v4460 skipped */ 
   /* declaration of rasters←v4488 skipped */ 
   /* declaration of handleResult←v4516 skipped */ 
   /* declaration of var←c05 skipped */ 
   /* declaration of res←v4620 skipped */ 
   (* (( (ptr) &var←c20908)+4)/* s←v4404 */  ) = formal←c0144;
   (* (( (ptr) &var←c20908)+5)/* logicalDevice←v4432 */  ) = formal←c0145;
   (* (( (ptr) &var←c20908)+6)/* nRasters←v4460 */  ) = formal←c0146;
   (* (( (ptr) &var←c20908)+7)/* rasters←v4488 */  ) = formal←c0147;
   (* (( (ptr) &var←c20908)+8)/* handleResult←v4516 */  ) = formal←c0148;
   /* CreateHandleFromRasters: */ 
SOURCE(3109, 2536)
SOURCE(3109, 2536)
   (* (( (ptr) &var←c20908)+10)/* res←v4620 */  ) = 0;
SOURCE(3332, 2313)
SOURCE(3332, 2313)
   {
      word var←c06;
      {
         word var←c0132;
         var←c0132 = (word) &var←c20908;
         var←c06 = (word) XR←Enable(( ((word)  (fPt) NoName←Q1248) ), ( ((word)  (fPt) NoName←Q1308) ), var←c0132);
         };
      if ((var←c06 == 4)) {
         /* removed tail goto */ 
         }
      else {
         if ((var←c06 == 1)) {
            goto lab←L06;
            };
         };
      };
SOURCE(3109, 2536)
   return((* (( (ptr) &var←c20908)+10)/* res←v4620 */  ));
   lab←L06: ;
   return((* (( (ptr) &var←c20908)+9)/* var←c05 */  ));
   }

static word NoName←Q1248(formal←c0123)
   word formal←c0123;
   {
   register ptr gf←c0122 =  (ptr) &globalframe;
SOURCE(3530, 40)
   {
      word shd←v5192;
      word data←v5220;
      W4 sm←v5248;
SOURCE(3530, 40)
      shd←v5192 = (*  (ptr) (* (( (ptr) formal←c0123)+4) ) );
SOURCE(3572, 41)
      data←v5220 = XR←Narrow((*  (ptr) shd←v5192 ), (* (( (ptr) gf←c0122)+13) ));
SOURCE(3615, 59)
      XR←FillWords(&sm←v5248, 4, 0);
SOURCE(3676, 1969)
      if (((* (( (ptr) formal←c0123)+6) ) != (*  (ptr) data←v5220 ))) {
SOURCE(3709, 25)
         (* (( (ptr) formal←c0123)+9) ) = 1065;
         return(1);
         }
      else {
SOURCE(3734, 1916)
         {
            word setSeparation←v5340;
            word setOutputBuffers←v5368;
            word context←v5396 = 0;
            word halftoneProperties←v5424;
SOURCE(3736, 63)
            setSeparation←v5340 = (* (( (ptr) (* (( (ptr) gf←c0122)+45)/* var←c19820 */  ))+69) );
SOURCE(3801, 72)
            setOutputBuffers←v5368 = (* (( (ptr) (* (( (ptr) gf←c0122)+45)/* var←c19820 */  ))+68) );
SOURCE(3906, 109)
            halftoneProperties←v5424 = (word) MakeHalftoneProperties←P60((* (( (ptr) formal←c0123)+5) ), (*  (ptr) &fc42 ),  (unsigned) (* (
                  ( (hPt) data←v5220)+3) ));
SOURCE(4017, 78)
            {
               register word i←v5468 = 0;
               register word noName←c19852;
               noName←c19852 = (* (( (ptr) formal←c0123)+6) );
               if ((i←v5468 >= noName←c19852)) {
                  goto lab←L100019;
                  };
               lab←L100022: ;
SOURCE(4048, 47)
               {
                  word var←c19884;
                  {
                     word pd43;
                     pd43 = (* (( (ptr) (* (( (ptr) gf←c0122)+44)/* var←c19724 */  ))+16) );
                     var←c19884 = (word) ( *( (fPt) ((*  (ptr) pd43 ))))((word) (( (W9Pt) (* (( (ptr) formal←c0123)+7) ))+i←v5468), 0, pd43);
                     };
                  (* (( (ptr) &sm←v5248)+BCK(i←v5468, 4)) ) = var←c19884;
                  };
               i←v5468 = (i←v5468 + 1);
               if ((i←v5468 < noName←c19852)) {
                  goto lab←L100022;
                  };
               lab←L100019: ;
               };
SOURCE(4106, 811)
            {
               word var←c19916;
               var←c19916 = (* (( (ptr) formal←c0123)+6) );
               if ((var←c19916 == 1)) {
SOURCE(4134, 257)
                  {
                     W2 var←c19948;
                     W2 var←c19980;
                     {
                        word idx44;
                        var←c19948.f0 = (
                           idx44 = (* (( (ptr) shd←v5192)+1) ),
                           SGNCK(idx44)
                           );
                        };
                     {
                        word idx45;
                        var←c19948.f1 = (
                           idx45 = (* (( (ptr) shd←v5192)+2) ),
                           SGNCK(idx45)
                           );
                        };
                     var←c19980.f0 = (* (( (ptr) shd←v5192)+4) );
                     var←c19980.f1 = (* (( (ptr) shd←v5192)+5) );
                     {
                        word pd46;
                        pd46 = (* (( (ptr) (* (( (ptr) gf←c0122)+46)/* var←c20012 */  ))+5) );
                        context←v5396 = (word) ( *( (fPt) ((*  (ptr) pd46 ))))(var←c19948,  (unsigned) ((* (( (bPt) shd←v5192)+15) ) & 017), var←c19980, (* (
/*1*/   ( (ptr) formal←c0123)+5) ), halftoneProperties←v5424, 0
                           , 0, (* (( (ptr) gf←c0122)+22) ), 0, pd46);
                        };
                     };
SOURCE(4393, 49)
                  {
                     word pd47;
                     pd47 = (* (( (ptr) (* (( (ptr) gf←c0122)+46)/* var←c20012 */  ))+8) );
                     (void) ( *( (fPt) ((*  (ptr) pd47 ))))(context←v5396, 0, pd47);
                     };
SOURCE(4444, 44)
                  {
                     word pd48;
                     pd48 = (* (( (ptr) (* (( (ptr) gf←c0122)+46)/* var←c20012 */  ))+7) );
                     (void) ( *( (fPt) ((*  (ptr) pd48 ))))(context←v5396, sm←v5248.f0, pd48);
                     };
SOURCE(4490, 35)
                  setSeparation←v5340 = (word) (( (bPt) gf←c0122)+132)/* var←c19372 */ ;
SOURCE(4527, 41)
                  setOutputBuffers←v5368 = (word) (( (bPt) gf←c0122)+124)/* var←c19340 */ ;
                  }
               else {
                  if ((var←c19916 == 4)) {
SOURCE(4580, 337)
                     {
                        W2 var←c20044;
                        W2 var←c20076;
                        W4 var←c20108;
                        {
                           word idx49;
                           var←c20044.f0 = (
/*1*/   idx49 = (* (( (ptr) shd←v5192)+1) ),
/*1*/   SGNCK(idx49)
/*1*/   );
                           };
                        {
                           word idx50;
                           var←c20044.f1 = (
/*1*/   idx50 = (* (( (ptr) shd←v5192)+2) ),
/*1*/   SGNCK(idx50)
/*1*/   );
                           };
                        var←c20076.f0 = (* (( (ptr) shd←v5192)+4) );
                        var←c20076.f1 = (* (( (ptr) shd←v5192)+5) );
                        var←c20108.f0 = sm←v5248.f0;
                        var←c20108.f1 = sm←v5248.f1;
                        var←c20108.f2 = sm←v5248.f2;
                        var←c20108.f3 = sm←v5248.f3;
                        {
                           word pd51;
                           pd51 = (* (( (ptr) (* (( (ptr) gf←c0122)+47)/* var←c20140 */  ))+4) );
                           context←v5396 = (word) ( *( (fPt) ((*  (ptr) pd51 ))))(var←c20044,  (unsigned) ((* (( (bPt) shd←v5192)+15) ) & 017), var←c20076, (* (
/*1*/      ( (ptr) formal←c0123)+5) ), halftoneProperties←v5424, 0
/*1*/   , 0, var←c20108, pd51);
                           };
                        };
                     }
                  else {
SOURCE(4933, 5)
                     (void) XR←RaiseUnnamedError();
                     };
                  };
               };
SOURCE(4940, 707)
            {
               word iState←v5512;
               word device←v5540;
               word state←v5568;
SOURCE(4942, 92)
               {
                  word pd52;
                  pd52 = (* (( (ptr) (* (( (ptr) gf←c0122)+48)/* var←c20172 */  ))+14) );
                  iState←v5512 = (word) ( *( (fPt) ((*  (ptr) pd52 ))))(context←v5396, pd52);
                  };
SOURCE(5036, 43)
               device←v5540 = (*  (ptr) iState←v5512 );
SOURCE(5081, 375)
               {
                  word var←c20204;
                  word var←c20268;
                  word var←c20332;
                  word var←c20460;
                  word var←c20524;
                  {
                     word pd53;
                     pd53 = (* (( (ptr) (* (( (ptr) gf←c0122)+49)/* var←c20236 */  ))+53) );
                     var←c20204 = (word) ( *( (fPt) ((*  (ptr) pd53 ))))((*  (ptr) (&fc54) ), pd53);
                     };
                  {
                     word pd55;
                     pd55 = (* (( (ptr) (* (( (ptr) gf←c0122)+50)/* var←c20300 */  ))+7) );
                     var←c20268 = (word) ( *( (fPt) ((*  (ptr) pd55 ))))((*  (ptr) (&fc54) ), pd55);
                     };
                  {
                     word var←c20364;
                     word var←c20428;
                     {
                        word pd56;
                        pd56 = (* (( (ptr) (* (( (ptr) gf←c0122)+51)/* var←c20396 */  ))+7) );
                        var←c20364 = (word) ( *( (fPt) ((*  (ptr) pd56 ))))((*  (W4Pt) ((( (ptr) (* (( (ptr) device←v5540)+6) ))+1)) ), pd56);
                        };
                     var←c20428 = XR←NewObject(20, (* (( (ptr) gf←c0122)+17) ));
                     (*  (W4Pt) var←c20428 ) = (*  (W4Pt) (( (ptr) (* (( (ptr) device←v5540)+6) ))+1) );
                     (* (( (ptr) var←c20428)+4) ) = var←c20364;
                     var←c20332 = var←c20428;
                     };
                  var←c20460 = XR←NewObject(20, (* (( (ptr) gf←c0122)+18) ));
                  var←c20524 = XR←NewObject(56, (* (( (ptr) gf←c0122)+12) ));
                  (* (( (ptr) var←c20524)+1) ) = (*  (ptr) iState←v5512 );
                  (* (( (ptr) var←c20524)+4) ) = var←c20204;
                  (* (( (ptr) var←c20524)+6) ) = var←c20268;
                  (* (( (ptr) var←c20524)+7) ) = var←c20332;
                  (* (( (ptr) var←c20524)+11) ) = var←c20460;
                  state←v5568 = var←c20524;
                  };
SOURCE(5458, 19)
               (*  (ptr) iState←v5512 ) = 0;
SOURCE(5479, 55)
               {
                  word pd57;
                  pd57 = (* (( (ptr) (* (( (ptr) gf←c0122)+52)/* var←c20556 */  ))+5) );
                  (void) ( *( (fPt) ((*  (ptr) pd57 ))))(iState←v5512, pd57);
                  };
SOURCE(5536, 109)
               {
                  word pd58;
                  pd58 = (* (( (ptr) (* (( (ptr) gf←c0122)+45)/* var←c19820 */  ))+72) );
                  (*  (ptr) (* (( (ptr) formal←c0123)+8) ) ) = (word) ( *( (fPt) ((*  (ptr) pd58 ))))(state←v5568, setOutputBuffers←v5368, setSeparation←v5340, (* (
                        ( (ptr) (* (( (ptr) gf←c0122)+45)/* var←c19820 */  ))+70) ), (* (( (ptr) (* (( (ptr) gf←c0122)+45)/* var←c19820 */  ))+71)
                      ), pd58);
                  };
               };
            };
         };
      };
   return(0);
   }

extern word CII←BWHalftoneDeviceSetup()
   {
   register ptr gf←c20940 =  (ptr) &globalframe;
   word var←c4680;
   word data←v5624;
   /* BWHalftoneDeviceSetup: */ 
SOURCE(5658, 248)
SOURCE(5723, 81)
   data←v5624 = XR←NewObject(8, (* (( (ptr) gf←c20940)+13) ));
   (*  (ptr) data←v5624 ) = 1;
   (* (( (ptr) data←v5624)+1) ) = 32768;
SOURCE(5806, 100)
   {
      word pd59;
      pd59 = (* (( (ptr) (* (( (ptr) gf←c20940)+44)/* var←c19724 */  ))+12) );
      return((word) ( *( (fPt) ((*  (ptr) pd59 ))))(data←v5624, (* (( (ptr) (* (( (ptr) gf←c20940)+44)/* var←c19724 */  ))+7) ), (* (
            ( (ptr) (* (( (ptr) gf←c20940)+44)/* var←c19724 */  ))+8) ), (* (( (ptr) (* (( (ptr) gf←c20940)+44)/* var←c19724 */  ))+9)
          ), (* (( (ptr) (* (( (ptr) gf←c20940)+44)/* var←c19724 */  ))+10) ), (word) (( (bPt) gf←c20940)+116)/* var←c19308 */ , pd59)
      );
      };
   }

extern word CII←CMYKHalftoneDeviceSetup()
   {
   register ptr gf←c20972 =  (ptr) &globalframe;
   word var←c4740;
   word data←v5680;
   /* CMYKHalftoneDeviceSetup: */ 
SOURCE(5910, 291)
SOURCE(5977, 122)
   data←v5680 = XR←NewObject(8, (* (( (ptr) gf←c20972)+13) ));
   (*  (ptr) data←v5680 ) = 4;
   (* (( (ptr) data←v5680)+1) ) = 61440;
SOURCE(6101, 100)
   {
      word pd60;
      pd60 = (* (( (ptr) (* (( (ptr) gf←c20972)+44)/* var←c19724 */  ))+12) );
      return((word) ( *( (fPt) ((*  (ptr) pd60 ))))(data←v5680, (* (( (ptr) (* (( (ptr) gf←c20972)+44)/* var←c19724 */  ))+7) ), (* (
            ( (ptr) (* (( (ptr) gf←c20972)+44)/* var←c19724 */  ))+8) ), (* (( (ptr) (* (( (ptr) gf←c20972)+44)/* var←c19724 */  ))+9)
          ), (* (( (ptr) (* (( (ptr) gf←c20972)+44)/* var←c19724 */  ))+10) ), (word) (( (bPt) gf←c20972)+116)/* var←c19308 */ , pd60)
      );
      };
   }

extern word CII←CMYKHalftoneSeparationDeviceSetup()
   {
   register ptr gf←c21004 =  (ptr) &globalframe;
   word var←c4800;
   word data←v5736;
   /* CMYKHalftoneSeparationDeviceSetup: */ 
SOURCE(6205, 301)
SOURCE(6282, 122)
   data←v5736 = XR←NewObject(8, (* (( (ptr) gf←c21004)+13) ));
   (*  (ptr) data←v5736 ) = 1;
   (* (( (ptr) data←v5736)+1) ) = 61440;
SOURCE(6406, 100)
   {
      word pd61;
      pd61 = (* (( (ptr) (* (( (ptr) gf←c21004)+44)/* var←c19724 */  ))+12) );
      return((word) ( *( (fPt) ((*  (ptr) pd61 ))))(data←v5736, (* (( (ptr) (* (( (ptr) gf←c21004)+44)/* var←c19724 */  ))+7) ), (* (
            ( (ptr) (* (( (ptr) gf←c21004)+44)/* var←c19724 */  ))+8) ), (* (( (ptr) (* (( (ptr) gf←c21004)+44)/* var←c19724 */  ))+9)
          ), (* (( (ptr) (* (( (ptr) gf←c21004)+44)/* var←c19724 */  ))+10) ), (word) (( (bPt) gf←c21004)+116)/* var←c19308 */ , pd61)
      );
      };
   }

static void NoName←Q1308(formal←c0101, formal←c200008, formal←c200009, formal←c200010, formal←c200011)
   word formal←c0101;
   word formal←c200008;
   word formal←c200009;
   word formal←c200010;
   word formal←c200011;
   {
   register ptr gf←c0127 =  (ptr) &globalframe;
   if ((formal←c200009 == (* (( (ptr) (* (( (ptr) gf←c0127)+40)/* var←c19532 */  ))+4) ))) {
      {
         W3 error←v11604;
         error←v11604 = (*  (W3Pt) formal←c200011 );
SOURCE(3364, 38)
         {
            word code←v19068;
            code←v19068 = error←v11604.f0;
            if ((code←v19068 == 0)) {
               (* (( (ptr) formal←c200008)+10) ) = 0;
               }
            else {
               (* (( (ptr) formal←c200008)+10) ) = (code←v19068 + 1000);
               };
            };
SOURCE(3404, 9)
         (*  (ptr) formal←c0101 ) = 2;
         (* (( (ptr) formal←c0101)+1) ) = 4;
         return;
         };
      }
   else {
      if ((formal←c200009 == (* (( (ptr) (* (( (ptr) gf←c0127)+41)/* var←c19596 */  ))+8) ))) {
SOURCE(3446, 12)
         (* (( (ptr) formal←c200008)+10) ) = 1001;
SOURCE(3460, 9)
         (*  (ptr) formal←c0101 ) = 2;
         (* (( (ptr) formal←c0101)+1) ) = 4;
         return;
         }
      else {
         if ((formal←c200009 == (* (( (ptr) (* (( (ptr) gf←c0127)+41)/* var←c19596 */  ))+14) ))) {
SOURCE(3499, 14)
            (* (( (ptr) formal←c200008)+10) ) = 1004;
SOURCE(3515, 9)
            (*  (ptr) formal←c0101 ) = 2;
            (* (( (ptr) formal←c0101)+1) ) = 4;
            return;
            };
         };
      };
   (*  (ptr) formal←c0101 ) = 0;
   (* (( (ptr) formal←c0101)+1) ) = 0;
   return;
   }

static void NoName←Q1368(formal←c0108, formal←c200004, formal←c200005, formal←c200006, formal←c200007)
   word formal←c0108;
   word formal←c200004;
   word formal←c200005;
   word formal←c200006;
   word formal←c200007;
   {
   register ptr gf←c0128 =  (ptr) &globalframe;
   if ((formal←c200005 == (* (( (ptr) (* (( (ptr) gf←c0128)+40)/* var←c19532 */  ))+4) ))) {
      {
         W3 error←v11068;
         error←v11068 = (*  (W3Pt) formal←c200007 );
SOURCE(2619, 38)
         {
            word code←v19116;
            code←v19116 = error←v11068.f0;
            if ((code←v19116 == 0)) {
               (* (( (ptr) formal←c200004)+8) ) = 0;
               }
            else {
               (* (( (ptr) formal←c200004)+8) ) = (code←v19116 + 1000);
               };
            };
SOURCE(2659, 9)
         (*  (ptr) formal←c0108 ) = 2;
         (* (( (ptr) formal←c0108)+1) ) = 3;
         return;
         };
      }
   else {
      if ((formal←c200005 == (* (( (ptr) (* (( (ptr) gf←c0128)+41)/* var←c19596 */  ))+8) ))) {
SOURCE(2701, 12)
         (* (( (ptr) formal←c200004)+8) ) = 1001;
SOURCE(2715, 9)
         (*  (ptr) formal←c0108 ) = 2;
         (* (( (ptr) formal←c0108)+1) ) = 3;
         return;
         }
      else {
         if ((formal←c200005 == (* (( (ptr) (* (( (ptr) gf←c0128)+41)/* var←c19596 */  ))+14) ))) {
SOURCE(2754, 14)
            (* (( (ptr) formal←c200004)+8) ) = 1004;
SOURCE(2770, 9)
            (*  (ptr) formal←c0108 ) = 2;
            (* (( (ptr) formal←c0108)+1) ) = 3;
            return;
            };
         };
      };
   (*  (ptr) formal←c0108 ) = 0;
   (* (( (ptr) formal←c0108)+1) ) = 0;
   return;
   }

static void NoName←Q1428(formal←c0115, formal←c200000, formal←c200001, formal←c200002, formal←c200003)
   word formal←c0115;
   word formal←c200000;
   word formal←c200001;
   word formal←c200002;
   word formal←c200003;
   {
   register ptr gf←c0129 =  (ptr) &globalframe;
   if ((formal←c200001 == (* (( (ptr) (* (( (ptr) gf←c0129)+40)/* var←c19532 */  ))+4) ))) {
      {
         W3 error←v8572;
         error←v8572 = (*  (W3Pt) formal←c200003 );
SOURCE(1953, 38)
         {
            word code←v19164;
            code←v19164 = error←v8572.f0;
            if ((code←v19164 == 0)) {
               (* (( (ptr) formal←c200000)+7) ) = 0;
               }
            else {
               (* (( (ptr) formal←c200000)+7) ) = (code←v19164 + 1000);
               };
            };
SOURCE(1993, 9)
         (*  (ptr) formal←c0115 ) = 2;
         (* (( (ptr) formal←c0115)+1) ) = 2;
         return;
         };
      }
   else {
      if ((formal←c200001 == (* (( (ptr) (* (( (ptr) gf←c0129)+41)/* var←c19596 */  ))+8) ))) {
SOURCE(2035, 12)
         (* (( (ptr) formal←c200000)+7) ) = 1001;
SOURCE(2049, 9)
         (*  (ptr) formal←c0115 ) = 2;
         (* (( (ptr) formal←c0115)+1) ) = 2;
         return;
         }
      else {
         if ((formal←c200001 == (* (( (ptr) (* (( (ptr) gf←c0129)+41)/* var←c19596 */  ))+14) ))) {
SOURCE(2088, 14)
            (* (( (ptr) formal←c200000)+7) ) = 1004;
SOURCE(2104, 9)
            (*  (ptr) formal←c0115 ) = 2;
            (* (( (ptr) formal←c0115)+1) ) = 2;
            return;
            };
         };
      };
   (*  (ptr) formal←c0115 ) = 0;
   (* (( (ptr) formal←c0115)+1) ) = 0;
   return;
   }

/* file: CIIHalftoneDeviceImpl, module: CIIHalftoneDeviceImpl, compiled at: October 29, 1993 1:10:07 pm PDT */ 
extern void XR←install←CIIHalftoneDeviceImpl() {
   NoName←Q1068();
   }
extern void XR←run←CIIHalftoneDeviceImpl() { XR←Start(&globalframe); }