

#include "BUILTIN.h"
extern OBJ _ACom_47(OBJ,OBJ);extern OBJ __ACom_47;
extern OBJ _AFile_21(OBJ,OBJ);extern OBJ __AFile_21;
extern OBJ _AFile_26(OBJ,OBJ);extern OBJ __AFile_26;

#include "Char.h"

#include "Nat.h"

#include "Int.h"
extern OBJ _AString_47(OBJ,OBJ);extern OBJ __AString_47;
extern OBJ _AString_49(OBJ);extern OBJ __AString_49;
extern OBJ __ASeq_6;

#include "Denotation.h"
extern OBJ _AStringConv_1(OBJ);extern OBJ __AStringConv_1;
extern OBJ _AComCompose_5(OBJ,OBJ);extern OBJ __AComCompose_5;
extern OBJ _AComCompose_6(OBJ,OBJ);extern OBJ __AComCompose_6;
extern OBJ _AEQUALITY_2(OBJ,OBJ);extern OBJ __AEQUALITY_2;

#include "BinFile.h"

#define __ABinFile_AtagMismatches_L13 __ABinFile_13
extern OBJ __ABinFile_AtagMismatches_L13;

#define __ABinFile_AtagMismatches_L14 __ABinFile_14
extern OBJ __ABinFile_AtagMismatches_L14;

#define __ABinFile_AtagMismatches_L15 __ABinFile_15
extern OBJ __ABinFile_AtagMismatches_L15;

#define __ABinFile_Aread_L16 __ABinFile_16
#define _ABinFile_Aread_L16 _ABinFile_16
#define ABinFile_16 ABinFile_Aread_L16
extern OBJ __ABinFile_Aread_L16;
extern OBJ _ABinFile_Aread_L16(OBJ,OBJ,OBJ);

#define __ABinFile_AtagMismatches__L17 __ABinFile_17
extern OBJ __ABinFile_AtagMismatches__L17;
extern OBJ _ABinFile_Awrite(OBJ,OBJ,OBJ);OBJ __ABinFile_Awrite; /* write */
extern OBJ _ABinFile_Aread(OBJ,OBJ);OBJ __ABinFile_Aread; /* read */
extern OBJ _ABinFile_AtagMismatches_(OBJ);OBJ __ABinFile_AtagMismatches_; /* tagMismatches? */
extern OBJ _ABinFile_AinvalidFormat_(OBJ);OBJ __ABinFile_AinvalidFormat_; /* invalidFormat? */
extern OBJ _ABinFile_AcannotLinkFun_(OBJ);OBJ __ABinFile_AcannotLinkFun_; /* cannotLinkFun? */
OBJ __ABinFile_AinternalTag; /* internalTag */
extern OBJ _ABinFile_AtagMismatches(OBJ,OBJ);OBJ __ABinFile_AtagMismatches; /* tagMismatches */
OBJ __ABinFile_AinvalidFormat; /* invalidFormat */
OBJ __ABinFile_AlinkErrorPrefix; /* linkErrorPrefix */
extern OBJ _ABinFile_AwriteData(OBJ,OBJ,OBJ);OBJ __ABinFile_AwriteData; /* writeData */
extern OBJ _ABinFile_AreadData(OBJ,OBJ);OBJ __ABinFile_AreadData; /* readData */
OBJ __ABinFile_AtagMismatches_L13; /* tagMismatches'13 */
OBJ __ABinFile_AtagMismatches_L14; /* tagMismatches'14 */
OBJ __ABinFile_AtagMismatches_L15; /* tagMismatches'15 */
extern OBJ _ABinFile_Aread_L16(OBJ,OBJ,OBJ);OBJ __ABinFile_Aread_L16; /* read'16 */
OBJ __ABinFile_AtagMismatches__L17; /* tagMismatches?'17 */
OBJ __ABinFile_AinvalidFormat_L18; /* invalidFormat'18 */

#include "BinFile.hc.c"

extern OBJ _ABinFile_Awrite(OBJ x1,OBJ x2,OBJ x3) /* write */
{OBJ r;
 CPPRD(__ABinFile_AinternalTag,1);
 CPCLS(__ABinFile_AwriteData,1);
 {OBJ x4;OBJ x5;OBJ x6;OBJ x7;
  ADenotation_4(x2,__ABinFile_AinternalTag,x4);
  x5=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABinFile_AwriteData,2))(__ABinFile_AwriteData,x1,x3);
  x6=_AFile_26(x1,x4);
  PRD(2,0,x7);FLD(x7,1)=x5;FLD(x7,2)=__ASeq_6;
  r=_AComCompose_6(x6,x7);}
 return r;}

extern OBJ _ABinFile_Aread(OBJ x1,OBJ x2) /* read */
{OBJ r;
 CPPRD(__ABinFile_AinternalTag,1);
 CPCLS(__ABinFile_Aread_L16,1);
 {OBJ x3;OBJ x4;OBJ x5;OBJ x6;
  ADenotation_4(x2,__ABinFile_AinternalTag,x3);
  CPPRD(x3,1);
  ADenotation_15(x3,x4);
  x5=_AFile_21(x1,x4);
  x6=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABinFile_Aread_L16,2))(__ABinFile_Aread_L16,x1,x3);
  r=_AComCompose_5(x5,x6);}
 return r;}

extern OBJ _ABinFile_AtagMismatches_(OBJ x1) /* tagMismatches? */
{OBJ r;
 if(ISTGPRD(x1,0)){
  if(EXPRD(x1,1)){
   FREE(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_3;
 }else{
  {OBJ x13=FLD(x1,1);
   if(EXPRD(x1,1)){
    DSPRDF(x1);
   }else{
    CPPRD(x13,1);
    FRPRD(x1,1);}
   CPPRD(__ABinFile_AtagMismatches__L17,1);
   CPCLS(__ABUILTIN_2,1);
   r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABUILTIN_2,2))(__ABUILTIN_2,__ABinFile_AtagMismatches__L17,x13);}}
 return r;}

extern OBJ _ABinFile_AinvalidFormat_(OBJ x1) /* invalidFormat? */
{OBJ r;
 CPPRD(__ABinFile_AinvalidFormat,1);
 r=_AEQUALITY_2(x1,__ABinFile_AinvalidFormat);
 return r;}

extern OBJ _ABinFile_AcannotLinkFun_(OBJ x1) /* cannotLinkFun? */
{OBJ r;
 {OBJ x5;
  if(ISTGPRD(x1,1)){
   {OBJ x2=FLD(x1,1);
    if(EXPRD(x1,1)){
     x5=x2;
     DSPRDF(x1);
    }else{
     CPPRD(x2,1);
     x5=x2;
     FRPRD(x1,1);}
    CPPRD(__ABinFile_AlinkErrorPrefix,1);
    CPCLS(__ABUILTIN_2,1);}
  }else{
   HLT("Com at <unknown> : undefined selection error\'Com:ans->denotation");}
  r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABUILTIN_2,2))(__ABUILTIN_2,__ABinFile_AlinkErrorPrefix,x5);}
 return r;}

extern OBJ _ABinFile_AtagMismatches(OBJ x1,OBJ x2) /* tagMismatches */
{OBJ r;
 CPPRD(__ABinFile_AtagMismatches_L13,1);
 CPPRD(__ABinFile_AtagMismatches_L14,1);
 CPPRD(__ABinFile_AtagMismatches_L15,1);
 {OBJ x3;OBJ x4;OBJ x5;
  ADenotation_4(x2,__ABinFile_AtagMismatches_L13,x3);
  ADenotation_4(__ABinFile_AtagMismatches_L14,x3,x4);
  ADenotation_4(x1,x4,x5);
  PRD(1,1,r);
  ADenotation_4(__ABinFile_AtagMismatches_L15,x5,FLD(r,1));}
 return r;}

extern OBJ _ABinFile_Aread_L16(OBJ x1,OBJ x2,OBJ x3) /* read'16 */
{OBJ r;
 CPPRD(x2,1);
 COPY(x3,1);
 {OBJ x4;OBJ x5;
  x4=_AString_49(x2);
  x5=_AString_47(x3,x4);
  if(ISTGPRM(x5,1)){
   FRPRD(x2,1);
   FREE(x3,1);
   CPCLS(__ABinFile_AreadData,1);
   {OBJ x6;
    x6=(*(OBJ(*)(OBJ,OBJ))METHOD(__ABinFile_AreadData,1))(__ABinFile_AreadData,x1);
    PRD(2,0,r);FLD(r,1)=x6;FLD(r,2)=__ASeq_6;}
  }else{
   CPCLS(__ACom_47,1);
   {OBJ x7;OBJ x8;OBJ x9;
    x7=_AStringConv_1(x3);
    ABinFile_AtagMismatches(x7,x2,x8);
    x9=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_47,1))(__ACom_47,x8);
    PRD(2,0,r);FLD(r,1)=x9;FLD(r,2)=__ASeq_6;}}}
 return r;}


init_ABinFile()
{
 static int visited=0; if(visited) return; visited=1;
 init_AVoid();
 init_ACom();
 init_AFile();
 init_AChar();
 init_ANat();
 init_AInt();
 init_AString();
 init_ASeq();
 init_AOption();
 init_ADenotation();
 init_AStringConv();
 init_AComCompose();
 init_AEQUALITY();
 init_ASeqMap();
 init_AStringMapSeq();
 DEN("binary IO file format invalid",__ABinFile_18);
 DEN("binary IO tag mismatches",__ABinFile_17);
 CLS(3,_ABinFile_16,__ABinFile_16);
 DEN("binary IO tag mismatches, found \'",__ABinFile_15);
 DEN("\', expected \'",__ABinFile_14);
 DEN("\'",__ABinFile_13);
 CLS(2,_ABinFile_12,__ABinFile_12);
 CLS(3,_ABinFile_11,__ABinFile_11);
 DEN("cannot runtime-link `",__ABinFile_10);
 CLS(2,_ABinFile_8,__ABinFile_8);
 DEN("-25/10/94",__ABinFile_7);
 CLS(1,_ABinFile_6,__ABinFile_6);
 CLS(1,_ABinFile_5,__ABinFile_5);
 CLS(1,_ABinFile_4,__ABinFile_4);
 CLS(2,_ABinFile_3,__ABinFile_3);
 CLS(3,_ABinFile_2,__ABinFile_2);
 init_const_ABinFile();
 /* __ABinFile_AinvalidFormat */
 CPPRD(__ABinFile_AinvalidFormat_L18,1);
 PRD(1,1,__ABinFile_AinvalidFormat);FLD(__ABinFile_AinvalidFormat,1)=__ABinFile_AinvalidFormat_L18;}

