

#include "BUILTIN.h"
extern OBJ _ACom_23(OBJ);extern OBJ __ACom_23;
extern OBJ __AInterOpal_316;
extern OBJ __AOption_5;
extern OBJ __AVoid_2;

#include "Nat.h"
extern OBJ _AComCompose_3(OBJ,OBJ);extern OBJ __AComCompose_3;
extern OBJ _AComCompose_5(OBJ,OBJ);extern OBJ __AComCompose_5;
extern OBJ _ABinStream_6(OBJ,OBJ,OBJ);extern OBJ __ABinStream_6;
extern OBJ _ABinStream_8(OBJ,OBJ);extern OBJ __ABinStream_8;
extern OBJ __AStream_4;

#include "Denotation.h"

#include "Char.h"
extern OBJ _AFile_28(OBJ,OBJ);extern OBJ __AFile_28;

#include "Int.h"
extern OBJ _AInterOpalIO_1(OBJ,OBJ);OBJ __AInterOpalIO_1; /* readInterOpal */
extern OBJ _AInterOpalIO_2(OBJ,OBJ,OBJ);OBJ __AInterOpalIO_2; /* writeInterOpal */
OBJ __AInterOpalIO_3; /* readInterOpal'3 */
extern OBJ _AInterOpalIO_4(OBJ);OBJ __AInterOpalIO_4; /* readInterOpal'4 */
extern OBJ _AInterOpalIO_5(OBJ);OBJ __AInterOpalIO_5; /* readInterOpal'5 */
extern OBJ _AInterOpalIO_6(OBJ);OBJ __AInterOpalIO_6; /* readInterOpal'6 */
extern OBJ _AInterOpalIO_7(OBJ,OBJ);OBJ __AInterOpalIO_7; /* readInterOpal'7 */
extern OBJ _AInterOpalIO_8(OBJ,OBJ,OBJ);OBJ __AInterOpalIO_8; /* writeInterOpal'8 */
OBJ __AInterOpalIO_9; /* writeInterOpal'9 */
extern OBJ _AInterOpalIO_10(OBJ);OBJ __AInterOpalIO_10; /* writeInterOpal'10 */

extern OBJ _AInterOpalIO_1(OBJ x1,OBJ x2) /* readInterOpal */
{OBJ r;
 {OBJ x4;OBJ x5;
  if(ISTGPRM(x1,1)){
   CPPRD(x2,1);
   CPPRD(__AInterOpalIO_3,1);
   CPCLS(__AInterOpalIO_7,1);
   {OBJ x3;
    ADenotation_4(__AInterOpalIO_3,x2,x3);
    x4=_AFile_28(__AStream_4,x3);}
  }else{
   CPCLS(__AInterOpalIO_4,1);
   CPCLS(__AInterOpalIO_7,1);
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AInterOpalIO_4,1))(__AInterOpalIO_4,__ABUILTIN_20);}
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AInterOpalIO_7,1))(__AInterOpalIO_7,x2);
  r=_AComCompose_5(x4,x5);}
 return r;}

extern OBJ _AInterOpalIO_2(OBJ x1,OBJ x2,OBJ x3) /* writeInterOpal */
{OBJ r;
 CPCLS(__AInterOpalIO_8,1);
 CPPRD(x2,1);
 {OBJ x4;OBJ x6;
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AInterOpalIO_8,2))(__AInterOpalIO_8,x2,x3);
  if(ISTGPRM(x1,1)){
   CPPRD(__AInterOpalIO_9,1);
   {OBJ x5;
    ADenotation_4(__AInterOpalIO_9,x2,x5);
    x6=_AFile_28(__AStream_4,x5);}
  }else{
   FRPRD(x2,1);
   CPCLS(__AInterOpalIO_10,1);
   x6=(*(OBJ(*)(OBJ,OBJ))METHOD(__AInterOpalIO_10,1))(__AInterOpalIO_10,__ABUILTIN_20);}
  r=_AComCompose_5(x6,x4);}
 return r;}

extern OBJ _AInterOpalIO_4(OBJ x1) /* readInterOpal'4 */
{OBJ r;
 r=_ACom_23(__AVoid_2);
 return r;}

extern OBJ _AInterOpalIO_5(OBJ x1) /* readInterOpal'5 */
{OBJ r;
 r=_ACom_23(__AOption_5);
 return r;}

extern OBJ _AInterOpalIO_6(OBJ x1) /* readInterOpal'6 */
{OBJ r;
 if(ISTGPRD(x1,0)){
  {OBJ x10=FLD(x1,1);
   if(EXPRD(x1,1)){
    DSPRDF(x1);
   }else{
    CPPRD(x10,1);
    FRPRD(x1,1);}
   {OBJ x11;
    PRD1(1,x11);FLD1(x11,1)=x10;
    r=_ACom_23(x11);}}
 }else{
  if(EXPRD(x1,1)){
   FRPRD(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  CPCLS(__AInterOpalIO_5,1);
  r=(*(OBJ(*)(OBJ,OBJ))METHOD(__AInterOpalIO_5,1))(__AInterOpalIO_5,__ABUILTIN_20);}
 return r;}

extern OBJ _AInterOpalIO_7(OBJ x1,OBJ x2) /* readInterOpal'7 */
{OBJ r;
 CPCLS(__AInterOpalIO_6,1);
 CPPRD(__AInterOpal_316,1);
 {OBJ x3;
  x3=_ABinStream_8(x1,__AInterOpal_316);
  r=_AComCompose_3(x3,__AInterOpalIO_6);}
 return r;}

extern OBJ _AInterOpalIO_8(OBJ x1,OBJ x2,OBJ x3) /* writeInterOpal'8 */
{OBJ r;
 CPPRD(__AInterOpal_316,1);
 r=_ABinStream_6(x1,__AInterOpal_316,x2);
 return r;}

extern OBJ _AInterOpalIO_10(OBJ x1) /* writeInterOpal'10 */
{OBJ r;
 r=_ACom_23(__AVoid_2);
 return r;}

static OBJ _mt_3_0_2(OBJ t,OBJ t1,OBJ t2) 
{OBJ r;
 DPCLS(t,r);
 INCCLS(r,0,2);
 FLDCLS(r,1)=t1;
 FLDCLS(r,2)=t2;
 return r;}

static OBJ _mt_3_2_1(OBJ t,OBJ t1) 
{OBJ r;
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  COPY(FLDCLS(t,1),1);
  COPY(FLDCLS(t,2),1);
  DCCLS(t,1);}
 r=(*(OBJ(*)(OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),t1);
 return r;}
static OBJ _mt_3_2_1_l(OBJ t,OBJ t1) 
{OBJ r;
 r=(*(OBJ(*)(OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),t1);
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  DCCLS(t,1);
  FLDCLS(t,1)=NIL;FLDCLS(t,2)=NIL;
  COPY(r,1);LZYCLS(t,r);}
 return r;}

init_AInterOpalIO()
{
 static int visited=0; if(visited) return; visited=1;
 init_ACom();
 init_AInterOpal();
 init_AOption();
 init_AVoid();
 init_AMap();
 init_ANat();
 init_ASeq();
 init_ADyn();
 init_ASet();
 init_APair();
 init_AComCompose();
 init_ABinStream();
 init_AStream();
 init_ADenotation();
 init_AChar();
 init_AString();
 init_AFile();
 init_AInt();
 init_ASeqMap();
 init_ASetByBST();
 init_ABSTree();
 init_ATree();
 init_ABinFile();
 LCLS(1,_AInterOpalIO_10,__AInterOpalIO_10);
 DEN("writing ",__AInterOpalIO_9);
 CLS(3,_AInterOpalIO_8,__AInterOpalIO_8);
 CLS(2,_AInterOpalIO_7,__AInterOpalIO_7);
 CLS(1,_AInterOpalIO_6,__AInterOpalIO_6);
 LCLS(1,_AInterOpalIO_5,__AInterOpalIO_5);
 LCLS(1,_AInterOpalIO_4,__AInterOpalIO_4);
 DEN("reading ",__AInterOpalIO_3);
 CLS(3,_AInterOpalIO_2,__AInterOpalIO_2);
 CLS(2,_AInterOpalIO_1,__AInterOpalIO_1);
 MTH(3,0,2,_mt_3_0_2);LZYMTH(3,0,2,_mt_3_0_2);
 MTH(3,2,1,_mt_3_2_1);LZYMTH(3,2,1,_mt_3_2_1_l);}

