

#include "BUILTIN.h"

#include "Nat.h"

#include "Char.h"
extern OBJ __ASeq_6;
extern OBJ _ASeq_51(OBJ,OBJ);extern OBJ __ASeq_51;
extern OBJ _ACom_23(OBJ);extern OBJ __ACom_23;
extern OBJ _ACom_47(OBJ,OBJ);extern OBJ __ACom_47;
extern OBJ __AFile_9;
extern OBJ __AFile_10;
extern OBJ __AFile_11;
extern OBJ _AFile_12(OBJ,OBJ);extern OBJ __AFile_12;
extern OBJ _AFile_14(OBJ);extern OBJ __AFile_14;
extern OBJ _AFile_15(OBJ);extern OBJ __AFile_15;
extern OBJ _AFile_19(OBJ);extern OBJ __AFile_19;
extern OBJ _AFile_20(OBJ,OBJ);extern OBJ __AFile_20;
extern OBJ _AFile_21(OBJ,OBJ);extern OBJ __AFile_21;
extern OBJ _AFile_22(OBJ,OBJ);extern OBJ __AFile_22;
extern OBJ _AFile_23(OBJ);extern OBJ __AFile_23;
extern OBJ _AFile_25(OBJ,OBJ);extern OBJ __AFile_25;
extern OBJ _AFile_26(OBJ,OBJ);extern OBJ __AFile_26;
extern OBJ _AFile_27(OBJ,OBJ);extern OBJ __AFile_27;
extern OBJ _AFile_28(OBJ,OBJ);extern OBJ __AFile_28;
extern OBJ _AFile_29(OBJ,OBJ);extern OBJ __AFile_29;

#include "Int.h"
extern OBJ _AComCompose_5(OBJ,OBJ);extern OBJ __AComCompose_5;
extern OBJ _AComCompose_6(OBJ,OBJ);extern OBJ __AComCompose_6;
extern OBJ __AComAction_1;
extern OBJ _AComSeqMap_3(OBJ,OBJ);extern OBJ __AComSeqMap_3;
OBJ __AStream_3; /* stdIn */
OBJ __AStream_4; /* stdOut */
OBJ __AStream_5; /* stdErr */
extern OBJ _AStream_6(OBJ);OBJ __AStream_6; /* open */
extern OBJ _AStream_7(OBJ);OBJ __AStream_7; /* close */
extern OBJ _AStream_8(OBJ);OBJ __AStream_8; /* read */
extern OBJ _AStream_9(OBJ,OBJ);OBJ __AStream_9; /* read,1 */
extern OBJ _AStream_10(OBJ,OBJ);OBJ __AStream_10; /* read,2 */
extern OBJ _AStream_11(OBJ);OBJ __AStream_11; /* readLine */
extern OBJ _AStream_12(OBJ);OBJ __AStream_12; /* readLines */
extern OBJ _AStream_13(OBJ);OBJ __AStream_13; /* load */
extern OBJ _AStream_14(OBJ);OBJ __AStream_14; /* look */
extern OBJ _AStream_15(OBJ);OBJ __AStream_15; /* eos? */
extern OBJ _AStream_16(OBJ);OBJ __AStream_16; /* create */
extern OBJ _AStream_17(OBJ);OBJ __AStream_17; /* append */
extern OBJ _AStream_18(OBJ);OBJ __AStream_18; /* close,1 */
extern OBJ _AStream_19(OBJ,OBJ);OBJ __AStream_19; /* write */
extern OBJ _AStream_20(OBJ,OBJ);OBJ __AStream_20; /* write,1 */
extern OBJ _AStream_21(OBJ,OBJ);OBJ __AStream_21; /* write,2 */
extern OBJ _AStream_22(OBJ,OBJ);OBJ __AStream_22; /* writeLine */
extern OBJ _AStream_23(OBJ,OBJ);OBJ __AStream_23; /* writeLine,1 */
extern OBJ _AStream_24(OBJ,OBJ);OBJ __AStream_24; /* writeLines */
extern OBJ _AStream_25(OBJ,OBJ);OBJ __AStream_25; /* store */
extern OBJ _AStream_26(OBJ);OBJ __AStream_26; /* abs */
extern OBJ _AStream_27(OBJ);OBJ __AStream_27; /* rep */
extern OBJ _AStream_28(OBJ);OBJ __AStream_28; /* abs,1 */
extern OBJ _AStream_29(OBJ);OBJ __AStream_29; /* rep,1 */
extern OBJ _AStream_31(OBJ);OBJ __AStream_31; /* abs? */
extern OBJ _AStream_34(OBJ);OBJ __AStream_34; /* abs?,1 */
extern OBJ _AStream_36(OBJ,OBJ);OBJ __AStream_36; /* readLines,1 */
OBJ __AStream_37; /* open'37 */
extern OBJ _AStream_38(OBJ);OBJ __AStream_38; /* open'38 */
extern OBJ _AStream_39(OBJ,OBJ,OBJ);OBJ __AStream_39; /* readLines,1'39 */
extern OBJ _AStream_40(OBJ,OBJ,OBJ);OBJ __AStream_40; /* readLines,1'40 */
extern OBJ _AStream_41(OBJ,OBJ);OBJ __AStream_41; /* load'41 */
extern OBJ _AStream_42(OBJ,OBJ);OBJ __AStream_42; /* load'42 */
extern OBJ _AStream_43(OBJ);OBJ __AStream_43; /* load'43 */
extern OBJ _AStream_44(OBJ,OBJ);OBJ __AStream_44; /* look'44 */
OBJ __AStream_45; /* create'45 */
extern OBJ _AStream_46(OBJ);OBJ __AStream_46; /* create'46 */
OBJ __AStream_47; /* append'47 */
extern OBJ _AStream_48(OBJ);OBJ __AStream_48; /* append'48 */
extern OBJ _AStream_49(OBJ,OBJ);OBJ __AStream_49; /* writeLines'49 */
extern OBJ _AStream_50(OBJ,OBJ);OBJ __AStream_50; /* store'50 */
extern OBJ _AStream_51(OBJ,OBJ);OBJ __AStream_51; /* store'51 */

extern OBJ _AStream_6(OBJ x1) /* open */
{OBJ r;
 CPPRD(__AStream_37,1);
 CPCLS(__AStream_38,1);
 {OBJ x2;
  x2=_AFile_12(x1,__AStream_37);
  r=_AComCompose_5(x2,__AStream_38);}
 return r;}

extern OBJ _AStream_7(OBJ x1) /* close */
{OBJ r;
 r=_AFile_14(x1);
 return r;}

extern OBJ _AStream_8(OBJ x1) /* read */
{OBJ r;
 r=_AFile_19(x1);
 return r;}

extern OBJ _AStream_9(OBJ x1,OBJ x2) /* read,1 */
{OBJ r;
 r=_AFile_21(x1,x2);
 return r;}

extern OBJ _AStream_10(OBJ x1,OBJ x2) /* read,2 */
{OBJ r;
 r=_AFile_22(x1,x2);
 return r;}

extern OBJ _AStream_11(OBJ x1) /* readLine */
{OBJ r;
 r=_AFile_23(x1);
 return r;}

extern OBJ _AStream_12(OBJ x1) /* readLines */
{OBJ r;
 r=_AStream_36(x1,__ASeq_6);
 return r;}

extern OBJ _AStream_13(OBJ x1) /* load */
{OBJ r;
 CPPRD(__AStream_37,1);
 CPCLS(__AStream_38,1);
 CPCLS(__AStream_43,1);
 {OBJ x2;OBJ x3;
  x2=_AFile_12(x1,__AStream_37);
  x3=_AComCompose_5(x2,__AStream_38);
  r=_AComCompose_5(x3,__AStream_43);}
 return r;}

extern OBJ _AStream_14(OBJ x1) /* look */
{OBJ r;
 CPCLS(__AStream_44,1);
 {OBJ x2;OBJ x3;
  x2=_AFile_19(x1);
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__AStream_44,1))(__AStream_44,x1);
  r=_AComCompose_5(x2,x3);}
 return r;}

extern OBJ _AStream_15(OBJ x1) /* eos? */
{OBJ r;
 r=_AFile_15(x1);
 return r;}

extern OBJ _AStream_16(OBJ x1) /* create */
{OBJ r;
 CPPRD(__AStream_45,1);
 CPCLS(__AStream_46,1);
 {OBJ x2;
  x2=_AFile_12(x1,__AStream_45);
  r=_AComCompose_5(x2,__AStream_46);}
 return r;}

extern OBJ _AStream_17(OBJ x1) /* append */
{OBJ r;
 CPPRD(__AStream_47,1);
 CPCLS(__AStream_48,1);
 {OBJ x2;
  x2=_AFile_12(x1,__AStream_47);
  r=_AComCompose_5(x2,__AStream_48);}
 return r;}

extern OBJ _AStream_18(OBJ x1) /* close,1 */
{OBJ r;
 r=_AFile_14(x1);
 return r;}

extern OBJ _AStream_19(OBJ x1,OBJ x2) /* write */
{OBJ r;
 r=_AFile_25(x1,x2);
 return r;}

extern OBJ _AStream_20(OBJ x1,OBJ x2) /* write,1 */
{OBJ r;
 r=_AFile_26(x1,x2);
 return r;}

extern OBJ _AStream_21(OBJ x1,OBJ x2) /* write,2 */
{OBJ r;
 r=_AFile_27(x1,x2);
 return r;}

extern OBJ _AStream_22(OBJ x1,OBJ x2) /* writeLine */
{OBJ r;
 r=_AFile_28(x1,x2);
 return r;}

extern OBJ _AStream_23(OBJ x1,OBJ x2) /* writeLine,1 */
{OBJ r;
 r=_AFile_29(x1,x2);
 return r;}

extern OBJ _AStream_24(OBJ x1,OBJ x2) /* writeLines */
{OBJ r;
 CPCLS(__AStream_49,1);
 CPPRD(__AComAction_1,1);
 {OBJ x3;OBJ x4;
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__AStream_49,1))(__AStream_49,x1);
  x4=_AComSeqMap_3(x3,x2);
  r=_AComCompose_6(x4,__AComAction_1);}
 return r;}

extern OBJ _AStream_25(OBJ x1,OBJ x2) /* store */
{OBJ r;
 CPPRD(__AStream_45,1);
 CPCLS(__AStream_46,1);
 CPCLS(__AStream_51,1);
 {OBJ x3;OBJ x4;OBJ x5;
  x3=_AFile_12(x1,__AStream_45);
  x4=_AComCompose_5(x3,__AStream_46);
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AStream_51,1))(__AStream_51,x2);
  r=_AComCompose_5(x4,x5);}
 return r;}

extern OBJ _AStream_26(OBJ x1) /* abs */
{OBJ r;
 r=x1;
 return r;}

extern OBJ _AStream_27(OBJ x1) /* rep */
{OBJ r;
 r=x1;
 return r;}

extern OBJ _AStream_28(OBJ x1) /* abs,1 */
{OBJ r;
 r=x1;
 return r;}

extern OBJ _AStream_29(OBJ x1) /* rep,1 */
{OBJ r;
 r=x1;
 return r;}

extern OBJ _AStream_31(OBJ x1) /* abs? */
{OBJ r;
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AStream_34(OBJ x1) /* abs?,1 */
{OBJ r;
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AStream_36(OBJ x1,OBJ x2) /* readLines,1 */
{OBJ r;
 CPCLS(__AStream_40,1);
 {OBJ x3;OBJ x4;
  x3=_AFile_15(x1);
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AStream_40,2))(__AStream_40,x1,x2);
  r=_AComCompose_5(x3,x4);}
 return r;}

extern OBJ _AStream_38(OBJ x1) /* open'38 */
{OBJ r;
 CPCLS(__ACom_47,1);
 {OBJ x2;OBJ x3;
  PRDF(1,0,x2);FLD(x2,1)=x1;
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x2);
  PRD(2,0,r);FLD(r,1)=x3;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AStream_39(OBJ x1,OBJ x2,OBJ x3) /* readLines,1'39 */
{OBJ r;
 {OBJ x4;
  PRD1(2,x4);FLD1(x4,1)=x3;FLD1(x4,2)=x2;
  r=_AStream_36(x1,x4);}
 return r;}

extern OBJ _AStream_40(OBJ x1,OBJ x2,OBJ x3) /* readLines,1'40 */
{OBJ r;
 if(ISTGPRM(x3,1)){
  CPCLS(__ACom_47,1);
  {OBJ x4;OBJ x5;OBJ x6;
   x4=_ASeq_51(x2,__ASeq_6);
   PRD(1,0,x5);FLD(x5,1)=x4;
   x6=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x5);
   PRD(2,0,r);FLD(r,1)=x6;FLD(r,2)=__ASeq_6;}
 }else{
  CPCLS(__AStream_39,1);
  {OBJ x7;OBJ x8;
   x7=_AFile_23(x1);
   x8=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AStream_39,2))(__AStream_39,x1,x2);
   r=_AComCompose_5(x7,x8);}}
 return r;}

extern OBJ _AStream_41(OBJ x1,OBJ x2) /* load'41 */
{OBJ r;
 r=_ACom_23(x1);
 return r;}

extern OBJ _AStream_42(OBJ x1,OBJ x2) /* load'42 */
{OBJ r;
 CPCLS(__AStream_41,1);
 {OBJ x3;OBJ x4;
  x3=_AFile_14(x1);
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AStream_41,1))(__AStream_41,x2);
  r=_AComCompose_5(x3,x4);}
 return r;}

extern OBJ _AStream_43(OBJ x1) /* load'43 */
{OBJ r;
 CPCLS(__AStream_42,1);
 {OBJ x2;OBJ x3;
  x2=_AStream_36(x1,__ASeq_6);
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__AStream_42,1))(__AStream_42,x1);
  r=_AComCompose_5(x2,x3);}
 return r;}

extern OBJ _AStream_44(OBJ x1,OBJ x2) /* look'44 */
{OBJ r;
 CPCLS(__ACom_47,1);
 {OBJ x3;OBJ x4;OBJ x5;OBJ x6;
  x3=_AFile_20(x1,x2);
  PRDF(1,0,x4);FLD(x4,1)=x2;
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x4);
  PRD(2,0,x6);FLD(x6,1)=x5;FLD(x6,2)=__ASeq_6;
  r=_AComCompose_6(x3,x6);}
 return r;}

extern OBJ _AStream_46(OBJ x1) /* create'46 */
{OBJ r;
 CPCLS(__ACom_47,1);
 {OBJ x2;OBJ x3;
  PRDF(1,0,x2);FLD(x2,1)=x1;
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x2);
  PRD(2,0,r);FLD(r,1)=x3;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AStream_48(OBJ x1) /* append'48 */
{OBJ r;
 CPCLS(__ACom_47,1);
 {OBJ x2;OBJ x3;
  PRDF(1,0,x2);FLD(x2,1)=x1;
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x2);
  PRD(2,0,r);FLD(r,1)=x3;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AStream_49(OBJ x1,OBJ x2) /* writeLines'49 */
{OBJ r;
 r=_AFile_29(x1,x2);
 return r;}

extern OBJ _AStream_50(OBJ x1,OBJ x2) /* store'50 */
{OBJ r;
 r=_AFile_14(x1);
 return r;}

extern OBJ _AStream_51(OBJ x1,OBJ x2) /* store'51 */
{OBJ r;
 CPCLS(__AStream_50,1);
 {OBJ x3;OBJ x4;
  x3=_AStream_24(x2,x1);
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AStream_50,1))(__AStream_50,x2);
  r=_AComCompose_5(x3,x4);}
 return r;}




init_AStream()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_AVoid();
 init_AChar();
 init_AString();
 init_ASeq();
 init_ACom();
 init_AFile();
 init_AInt();
 init_AOption();
 init_AComCompose();
 init_AComAction();
 init_AComSeqMap();
 init_ASeqMap();
 CLS(1,_AStream_31,__AStream_31);
 CLS(1,_AStream_29,__AStream_29);
 CLS(1,_AStream_28,__AStream_28);
 CLS(1,_AStream_27,__AStream_27);
 CLS(1,_AStream_26,__AStream_26);
 CLS(2,_AStream_25,__AStream_25);
 CLS(2,_AStream_24,__AStream_24);
 CLS(2,_AStream_23,__AStream_23);
 CLS(2,_AStream_22,__AStream_22);
 CLS(2,_AStream_21,__AStream_21);
 CLS(2,_AStream_20,__AStream_20);
 CLS(2,_AStream_51,__AStream_51);
 CLS(2,_AStream_19,__AStream_19);
 CLS(2,_AStream_50,__AStream_50);
 CLS(1,_AStream_18,__AStream_18);
 CLS(2,_AStream_49,__AStream_49);
 CLS(1,_AStream_17,__AStream_17);
 CLS(1,_AStream_48,__AStream_48);
 CLS(1,_AStream_16,__AStream_16);
 DEN("a",__AStream_47);
 CLS(1,_AStream_15,__AStream_15);
 CLS(1,_AStream_46,__AStream_46);
 CLS(1,_AStream_14,__AStream_14);
 DEN("w",__AStream_45);
 CLS(1,_AStream_13,__AStream_13);
 CLS(2,_AStream_44,__AStream_44);
 CLS(1,_AStream_12,__AStream_12);
 CLS(1,_AStream_43,__AStream_43);
 CLS(1,_AStream_11,__AStream_11);
 CLS(2,_AStream_42,__AStream_42);
 CLS(2,_AStream_10,__AStream_10);
 CLS(2,_AStream_41,__AStream_41);
 CLS(2,_AStream_9,__AStream_9);
 CLS(3,_AStream_40,__AStream_40);
 CLS(1,_AStream_8,__AStream_8);
 CLS(3,_AStream_39,__AStream_39);
 CLS(1,_AStream_7,__AStream_7);
 CLS(1,_AStream_38,__AStream_38);
 CLS(1,_AStream_6,__AStream_6);
 DEN("r",__AStream_37);
 CLS(2,_AStream_36,__AStream_36);
 CLS(1,_AStream_34,__AStream_34);
 __AStream_3=__AFile_9;
 __AStream_4=__AFile_10;
 __AStream_5=__AFile_11;}

