

#include "BUILTIN.h"
extern OBJ _ACom_23(OBJ);extern OBJ __ACom_23;
extern OBJ _ACom_24(OBJ);extern OBJ __ACom_24;
extern OBJ _ACom_47(OBJ,OBJ);extern OBJ __ACom_47;
extern OBJ __AOption_5;

#include "Nat.h"
extern OBJ __ASeq_6;
extern OBJ _AComCompose_3(OBJ,OBJ);extern OBJ __AComCompose_3;
extern OBJ _AComCompose_5(OBJ,OBJ);extern OBJ __AComCompose_5;
extern OBJ _AFile_31(OBJ);extern OBJ __AFile_31;
extern OBJ _ABinFile_2(OBJ,OBJ,OBJ);extern OBJ __ABinFile_2;
extern OBJ _ABinFile_3(OBJ,OBJ);extern OBJ __ABinFile_3;

#include "Denotation.h"

#include "Char.h"

#include "Int.h"

#include "ProcessConnect.h"

#define __AProcessConnect_Aread_L32 __AProcessConnect_32
#define _AProcessConnect_Aread_L32 _AProcessConnect_32
#define AProcessConnect_32 AProcessConnect_Aread_L32
extern OBJ __AProcessConnect_Aread_L32;
extern OBJ _AProcessConnect_Aread_L32(OBJ);

#define __AProcessConnect_Aread_L33 __AProcessConnect_33
#define _AProcessConnect_Aread_L33 _AProcessConnect_33
#define AProcessConnect_33 AProcessConnect_Aread_L33
extern OBJ __AProcessConnect_Aread_L33;
extern OBJ _AProcessConnect_Aread_L33(OBJ);

#define __AProcessConnect_Aread_L34 __AProcessConnect_34
#define _AProcessConnect_Aread_L34 _AProcessConnect_34
#define AProcessConnect_34 AProcessConnect_Aread_L34
extern OBJ __AProcessConnect_Aread_L34;
extern OBJ _AProcessConnect_Aread_L34(OBJ,OBJ);

#define __AProcessConnect_Aread__L35 __AProcessConnect_35
#define _AProcessConnect_Aread__L35 _AProcessConnect_35
#define AProcessConnect_35 AProcessConnect_Aread__L35
extern OBJ __AProcessConnect_Aread__L35;
extern OBJ _AProcessConnect_Aread__L35(OBJ);

#define __AProcessConnect_Aread__L36 __AProcessConnect_36
#define _AProcessConnect_Aread__L36 _AProcessConnect_36
#define AProcessConnect_36 AProcessConnect_Aread__L36
extern OBJ __AProcessConnect_Aread__L36;
extern OBJ _AProcessConnect_Aread__L36(OBJ);

#define __AProcessConnect_Aread__L37 __AProcessConnect_37
#define _AProcessConnect_Aread__L37 _AProcessConnect_37
#define AProcessConnect_37 AProcessConnect_Aread__L37
extern OBJ __AProcessConnect_Aread__L37;
extern OBJ _AProcessConnect_Aread__L37(OBJ,OBJ);

#define __AProcessConnect_Awrite_L38 __AProcessConnect_38
#define _AProcessConnect_Awrite_L38 _AProcessConnect_38
#define AProcessConnect_38 AProcessConnect_Awrite_L38
extern OBJ __AProcessConnect_Awrite_L38;
extern OBJ _AProcessConnect_Awrite_L38(OBJ,OBJ);

#define __AProcessConnect_Awrite_L39 __AProcessConnect_39
#define _AProcessConnect_Awrite_L39 _AProcessConnect_39
#define AProcessConnect_39 AProcessConnect_Awrite_L39
extern OBJ __AProcessConnect_Awrite_L39;
extern OBJ _AProcessConnect_Awrite_L39(OBJ,OBJ,OBJ);

#define __AProcessConnect_Aopen_L28 __AProcessConnect_28
extern OBJ __AProcessConnect_Aopen_L28;

#define __AProcessConnect_Aopen_L29 __AProcessConnect_29
extern OBJ __AProcessConnect_Aopen_L29;

#define __AProcessConnect_Aread_L30 __AProcessConnect_30
extern OBJ __AProcessConnect_Aread_L30;

#define __AProcessConnect_Aread_L31 __AProcessConnect_31
extern OBJ __AProcessConnect_Aread_L31;
OBJ __AProcessConnect_Aserver; /* server */
extern OBJ _AProcessConnect_Aserver_(OBJ);OBJ __AProcessConnect_Aserver_; /* server? */
OBJ __AProcessConnect_Aclient; /* client */
extern OBJ _AProcessConnect_Aclient_(OBJ);OBJ __AProcessConnect_Aclient_; /* client? */
extern OBJ _AProcessConnect_Aopen(OBJ,OBJ);OBJ __AProcessConnect_Aopen; /* open */
extern OBJ _AProcessConnect_Aclose(OBJ);OBJ __AProcessConnect_Aclose; /* close */
extern OBJ _AProcessConnect_Aincoming_(OBJ);OBJ __AProcessConnect_Aincoming_; /* incoming? */
extern OBJ _AProcessConnect_Aread(OBJ);OBJ __AProcessConnect_Aread; /* read */
extern OBJ _AProcessConnect_Aread_(OBJ);OBJ __AProcessConnect_Aread_; /* read? */
extern OBJ _AProcessConnect_Awrite(OBJ,OBJ);OBJ __AProcessConnect_Awrite; /* write */
extern OBJ _AProcessConnect_AinFile(OBJ);OBJ __AProcessConnect_AinFile; /* inFile */
extern OBJ _AProcessConnect_AoutFile(OBJ);OBJ __AProcessConnect_AoutFile; /* outFile */
OBJ __AProcessConnect_AinKey; /* inKey */
OBJ __AProcessConnect_AoutKey; /* outKey */
extern OBJ _AProcessConnect_AcOpen(OBJ,OBJ,OBJ,OBJ);OBJ __AProcessConnect_AcOpen; /* cOpen */
extern OBJ _AProcessConnect_AcClose(OBJ,OBJ);OBJ __AProcessConnect_AcClose; /* cClose */
extern OBJ _AProcessConnect_AcIncoming_(OBJ,OBJ);OBJ __AProcessConnect_AcIncoming_; /* cIncoming? */
extern OBJ _AProcessConnect_AcWaitForRead(OBJ,OBJ);OBJ __AProcessConnect_AcWaitForRead; /* cWaitForRead */
extern OBJ _AProcessConnect_AcWaitForWrite(OBJ,OBJ);OBJ __AProcessConnect_AcWaitForWrite; /* cWaitForWrite */
OBJ __AProcessConnect_Aopen_L28; /* open'28 */
OBJ __AProcessConnect_Aopen_L29; /* open'29 */
OBJ __AProcessConnect_Aread_L30; /* read'30 */
OBJ __AProcessConnect_Aread_L31; /* read'31 */
extern OBJ _AProcessConnect_Aread_L32(OBJ);OBJ __AProcessConnect_Aread_L32; /* read'32 */
extern OBJ _AProcessConnect_Aread_L33(OBJ);OBJ __AProcessConnect_Aread_L33; /* read'33 */
extern OBJ _AProcessConnect_Aread_L34(OBJ,OBJ);OBJ __AProcessConnect_Aread_L34; /* read'34 */
extern OBJ _AProcessConnect_Aread__L35(OBJ);OBJ __AProcessConnect_Aread__L35; /* read?'35 */
extern OBJ _AProcessConnect_Aread__L36(OBJ);OBJ __AProcessConnect_Aread__L36; /* read?'36 */
extern OBJ _AProcessConnect_Aread__L37(OBJ,OBJ);OBJ __AProcessConnect_Aread__L37; /* read?'37 */
extern OBJ _AProcessConnect_Awrite_L38(OBJ,OBJ);OBJ __AProcessConnect_Awrite_L38; /* write'38 */
extern OBJ _AProcessConnect_Awrite_L39(OBJ,OBJ,OBJ);OBJ __AProcessConnect_Awrite_L39; /* write'39 */

#include "ProcessConnect.hc.c"

extern OBJ _AProcessConnect_Aserver_(OBJ x1) /* server? */
{OBJ r;
 if(ISTGPRM(x1,1)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AProcessConnect_Aclient_(OBJ x1) /* client? */
{OBJ r;
 if(ISTGPRM(x1,0)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AProcessConnect_Aopen(OBJ x1,OBJ x2) /* open */
{OBJ r;
 CPPRD(__AProcessConnect_Aopen_L28,1);
 CPPRD(__AProcessConnect_Aopen_L29,1);
 CPPRD(x1,1);
 {OBJ x4;OBJ x5;
  ADenotation_4(x1,__AProcessConnect_Aopen_L28,x4);
  ADenotation_4(x1,__AProcessConnect_Aopen_L29,x5);
  if(ISTGPRM(x2,1)){
   CPCLS(__AProcessConnect_AcOpen,1);
   {OBJ x8;
    x8=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AProcessConnect_AcOpen,3))(__AProcessConnect_AcOpen,x4,x5,__ABUILTIN_3);
    PRD(2,0,r);FLD(r,1)=x8;FLD(r,2)=__ASeq_6;}
  }else{
   CPCLS(__AProcessConnect_AcOpen,1);
   {OBJ x9;
    x9=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AProcessConnect_AcOpen,3))(__AProcessConnect_AcOpen,x5,x4,__ABUILTIN_5);
    PRD(2,0,r);FLD(r,1)=x9;FLD(r,2)=__ASeq_6;}}}
 return r;}

extern OBJ _AProcessConnect_Aclose(OBJ x1) /* close */
{OBJ r;
 CPCLS(__AProcessConnect_AcClose,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_AcClose,1))(__AProcessConnect_AcClose,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AProcessConnect_Aincoming_(OBJ x1) /* incoming? */
{OBJ r;
 CPCLS(__AProcessConnect_AcIncoming_,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_AcIncoming_,1))(__AProcessConnect_AcIncoming_,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AProcessConnect_Aread(OBJ x1) /* read */
{OBJ r;
 CPCLS(__AProcessConnect_AcWaitForRead,1);
 CPCLS(__AProcessConnect_Aread_L34,1);
 COPY(x1,1);
 {OBJ x2;OBJ x3;OBJ x4;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_AcWaitForRead,1))(__AProcessConnect_AcWaitForRead,x1);
  PRD(2,0,x3);FLD(x3,1)=x2;FLD(x3,2)=__ASeq_6;
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_Aread_L34,1))(__AProcessConnect_Aread_L34,x1);
  r=_AComCompose_5(x3,x4);}
 return r;}

extern OBJ _AProcessConnect_Aread_(OBJ x1) /* read? */
{OBJ r;
 CPCLS(__AProcessConnect_AcIncoming_,1);
 CPCLS(__AProcessConnect_Aread__L37,1);
 COPY(x1,1);
 {OBJ x2;OBJ x3;OBJ x4;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_AcIncoming_,1))(__AProcessConnect_AcIncoming_,x1);
  PRD(2,0,x3);FLD(x3,1)=x2;FLD(x3,2)=__ASeq_6;
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_Aread__L37,1))(__AProcessConnect_Aread__L37,x1);
  r=_AComCompose_5(x3,x4);}
 return r;}

extern OBJ _AProcessConnect_Awrite(OBJ x1,OBJ x2) /* write */
{OBJ r;
 CPCLS(__AProcessConnect_AcWaitForWrite,1);
 CPCLS(__AProcessConnect_Awrite_L39,1);
 COPY(x1,1);
 {OBJ x3;OBJ x4;OBJ x5;
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_AcWaitForWrite,1))(__AProcessConnect_AcWaitForWrite,x1);
  PRD(2,0,x4);FLD(x4,1)=x3;FLD(x4,2)=__ASeq_6;
  x5=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AProcessConnect_Awrite_L39,2))(__AProcessConnect_Awrite_L39,x1,x2);
  r=_AComCompose_5(x4,x5);}
 return r;}

extern OBJ _AProcessConnect_Aread_L32(OBJ x1) /* read'32 */
{OBJ r;
 CPPRD(__AProcessConnect_Aread_L31,1);
 r=_ACom_24(__AProcessConnect_Aread_L31);
 return r;}

extern OBJ _AProcessConnect_Aread_L33(OBJ x1) /* read'33 */
{OBJ r;
 if(ISTGPRD(x1,0)){
  CPCLS(__ACom_47,1);
  {OBJ x13;
   x13=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x1);
   PRD(2,0,r);FLD(r,1)=x13;FLD(r,2)=__ASeq_6;}
 }else{
  {OBJ x14=FLD(x1,1);
   CPPRD(x14,1);
   CPPRD(__AProcessConnect_Aread_L30,1);
   CPCLS(__ABUILTIN_2,1);
   {OBJ x15;
    x15=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABUILTIN_2,2))(__ABUILTIN_2,__AProcessConnect_Aread_L30,x14);
    if(ISPRM(x15)&&(ISTGPRM(x15,1))){
     if(EXPRD(x1,1)){
      FRPRD(FLD(x1,1),1);DSPRDF(x1);
     }else{
      DCPRD(x1,1);}
     CPCLS(__AProcessConnect_Aread_L32,1);
     r=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_Aread_L32,1))(__AProcessConnect_Aread_L32,__ABUILTIN_20);
    }else{
     FREE(x15,1);
     CPCLS(__ACom_47,1);
     {OBJ x16;
      x16=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x1);
      PRD(2,0,r);FLD(r,1)=x16;FLD(r,2)=__ASeq_6;}}}}}
 return r;}

extern OBJ _AProcessConnect_Aread_L34(OBJ x1,OBJ x2) /* read'34 */
{OBJ r;
 CPPRD(__AProcessConnect_AinKey,1);
 CPCLS(__AProcessConnect_Aread_L33,1);
 {OBJ x3;OBJ x4;
  AProcessConnect_AinFile(x1,x3);
  x4=_ABinFile_3(x3,__AProcessConnect_AinKey);
  r=_AComCompose_3(x4,__AProcessConnect_Aread_L33);}
 return r;}

extern OBJ _AProcessConnect_Aread__L35(OBJ x1) /* read?'35 */
{OBJ r;
 {OBJ x2;
  PRD1(1,x2);FLD1(x2,1)=x1;
  r=_ACom_23(x2);}
 return r;}

extern OBJ _AProcessConnect_Aread__L36(OBJ x1) /* read?'36 */
{OBJ r;
 r=_ACom_23(__AOption_5);
 return r;}

extern OBJ _AProcessConnect_Aread__L37(OBJ x1,OBJ x2) /* read?'37 */
{OBJ r;
 if(ISTGPRM(x2,1)){
  CPPRD(__AProcessConnect_AinKey,1);
  CPCLS(__AProcessConnect_Aread__L35,1);
  {OBJ x3;OBJ x4;
   AProcessConnect_AinFile(x1,x3);
   x4=_ABinFile_3(x3,__AProcessConnect_AinKey);
   r=_AComCompose_5(x4,__AProcessConnect_Aread__L35);}
 }else{
  FREE(x1,1);
  CPCLS(__AProcessConnect_Aread__L36,1);
  r=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_Aread__L36,1))(__AProcessConnect_Aread__L36,__ABUILTIN_20);}
 return r;}

extern OBJ _AProcessConnect_Awrite_L38(OBJ x1,OBJ x2) /* write'38 */
{OBJ r;
 r=_AFile_31(x1);
 return r;}

extern OBJ _AProcessConnect_Awrite_L39(OBJ x1,OBJ x2,OBJ x3) /* write'39 */
{OBJ r;
 CPPRD(__AProcessConnect_AoutKey,1);
 CPCLS(__AProcessConnect_Awrite_L38,1);
 {OBJ x4;OBJ x5;OBJ x6;
  AProcessConnect_AoutFile(x1,x4);
  x5=_ABinFile_2(x4,__AProcessConnect_AoutKey,x2);
  x6=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcessConnect_Awrite_L38,1))(__AProcessConnect_Awrite_L38,x4);
  r=_AComCompose_5(x5,x6);}
 return r;}



init_AProcessConnect()
{
 static int visited=0; if(visited) return; visited=1;
 init_ACom();
 init_AVoid();
 init_AOption();
 init_ANat();
 init_ASeq();
 init_AEQUALITY();
 init_AComCompose();
 init_AFile();
 init_ABinFile();
 init_ADenotation();
 init_AUnixFailures();
 init_AChar();
 init_AInt();
 init_AString();
 init_ASeqMap();
 DEN("connection lost",__AProcessConnect_31);
 DEN("binary IO tag mismatches, found \'\'",__AProcessConnect_30);
 DEN(".out",__AProcessConnect_29);
 DEN(".in",__AProcessConnect_28);
 CLS(2,_AProcessConnect_27,__AProcessConnect_27);
 CLS(2,_AProcessConnect_26,__AProcessConnect_26);
 CLS(2,_AProcessConnect_25,__AProcessConnect_25);
 CLS(2,_AProcessConnect_24,__AProcessConnect_24);
 CLS(4,_AProcessConnect_23,__AProcessConnect_23);
 DEN("pconn-in-289",__AProcessConnect_22);
 DEN("pconn-in-289",__AProcessConnect_21);
 CLS(1,_AProcessConnect_20,__AProcessConnect_20);
 CLS(1,_AProcessConnect_19,__AProcessConnect_19);
 CLS(2,_AProcessConnect_14,__AProcessConnect_14);
 CLS(1,_AProcessConnect_13,__AProcessConnect_13);
 CLS(1,_AProcessConnect_12,__AProcessConnect_12);
 CLS(1,_AProcessConnect_11,__AProcessConnect_11);
 CLS(1,_AProcessConnect_10,__AProcessConnect_10);
 CLS(2,_AProcessConnect_9,__AProcessConnect_9);
 CLS(3,_AProcessConnect_39,__AProcessConnect_39);
 CLS(2,_AProcessConnect_38,__AProcessConnect_38);
 CLS(2,_AProcessConnect_37,__AProcessConnect_37);
 CLS(1,_AProcessConnect_5,__AProcessConnect_5);
 LCLS(1,_AProcessConnect_36,__AProcessConnect_36);
 CLS(1,_AProcessConnect_35,__AProcessConnect_35);
 CLS(1,_AProcessConnect_3,__AProcessConnect_3);
 CLS(2,_AProcessConnect_34,__AProcessConnect_34);
 CLS(1,_AProcessConnect_33,__AProcessConnect_33);
 LCLS(1,_AProcessConnect_32,__AProcessConnect_32);
 init_const_AProcessConnect();
 /* __AProcessConnect_Aserver */
 PRM(1,__AProcessConnect_Aserver);
 /* __AProcessConnect_Aclient */
 PRM(0,__AProcessConnect_Aclient);}

