

#include "BUILTIN.h"
extern OBJ __ATree_7;
extern OBJ __ASeq_6;
extern OBJ _AString_2(OBJ,OBJ);extern OBJ __AString_2;

#include "Nat.h"

#include "Char.h"
extern OBJ _ATreeConv_2(OBJ,OBJ);extern OBJ __ATreeConv_2;
extern OBJ _ATreeConv_3(OBJ,OBJ);extern OBJ __ATreeConv_3;
extern OBJ _ATreeConv_4(OBJ,OBJ);extern OBJ __ATreeConv_4;
extern OBJ _ATreeConv_5(OBJ,OBJ);extern OBJ __ATreeConv_5;
extern OBJ _ATreeConv_9(OBJ);extern OBJ __ATreeConv_9;
extern OBJ _ATreeConv_38(OBJ,OBJ);extern OBJ __ATreeConv_38;
extern OBJ _ATreeConv_39(OBJ,OBJ);extern OBJ __ATreeConv_39;
extern OBJ _ATreeConv_40(OBJ,OBJ);extern OBJ __ATreeConv_40;

#include "Denotation.h"
extern OBJ __APrintableChar_50;

#include "Int.h"
extern OBJ _AHeapConv_3(OBJ,OBJ,OBJ);OBJ __AHeapConv_3; /* ` */
extern OBJ _AHeapConv_4(OBJ,OBJ,OBJ);OBJ __AHeapConv_4; /* `,1 */
extern OBJ _AHeapConv_5(OBJ,OBJ,OBJ);OBJ __AHeapConv_5; /* graphic */
extern OBJ _AHeapConv_6(OBJ,OBJ,OBJ);OBJ __AHeapConv_6; /* graphic,1 */
extern OBJ _AHeapConv_7(OBJ,OBJ);OBJ __AHeapConv_7; /* asSeqIn */
extern OBJ _AHeapConv_8(OBJ,OBJ);OBJ __AHeapConv_8; /* asSeqPre */
extern OBJ _AHeapConv_9(OBJ,OBJ);OBJ __AHeapConv_9; /* asSeqPost */
extern OBJ _AHeapConv_10(OBJ,OBJ);OBJ __AHeapConv_10; /* asSeqBreadth */
extern OBJ _AHeapConv_11(OBJ,OBJ);OBJ __AHeapConv_11; /* asHeap */
extern OBJ _AHeapConv_12(OBJ,OBJ);OBJ __AHeapConv_12; /* asTree */
extern OBJ _AHeapConv_13(OBJ,OBJ);OBJ __AHeapConv_13; /* asHeap,1 */
extern OBJ _AHeapConv_14(OBJ,OBJ,OBJ,OBJ);OBJ __AHeapConv_14; /* sift */
extern OBJ _AHeapConv_15(OBJ,OBJ,OBJ);OBJ __AHeapConv_15; /* <= */
OBJ __AHeapConv_16; /* `'16 */

extern OBJ _AHeapConv_3(OBJ x1,OBJ x2,OBJ x3) /* ` */
{OBJ r;
 CPPRD(__AHeapConv_16,1);
 FRCLS(x1,1);
 {OBJ x4;
  x4=_ATreeConv_2(x2,x3);
  ADenotation_4(__AHeapConv_16,x4,r);}
 return r;}

extern OBJ _AHeapConv_4(OBJ x1,OBJ x2,OBJ x3) /* `,1 */
{OBJ r;
 FRCLS(x1,1);
 {OBJ x4;
  x4=_ATreeConv_3(x2,x3);
  r=_AString_2(__APrintableChar_50,x4);}
 return r;}

extern OBJ _AHeapConv_5(OBJ x1,OBJ x2,OBJ x3) /* graphic */
{OBJ r;
 FRCLS(x1,1);
 r=_ATreeConv_4(x2,x3);
 return r;}

extern OBJ _AHeapConv_6(OBJ x1,OBJ x2,OBJ x3) /* graphic,1 */
{OBJ r;
 FRCLS(x1,1);
 r=_ATreeConv_5(x2,x3);
 return r;}

extern OBJ _AHeapConv_7(OBJ x1,OBJ x2) /* asSeqIn */
{OBJ r;
 FRCLS(x1,1);
 r=_ATreeConv_38(x2,__ASeq_6);
 return r;}

extern OBJ _AHeapConv_8(OBJ x1,OBJ x2) /* asSeqPre */
{OBJ r;
 FRCLS(x1,1);
 r=_ATreeConv_39(x2,__ASeq_6);
 return r;}

extern OBJ _AHeapConv_9(OBJ x1,OBJ x2) /* asSeqPost */
{OBJ r;
 FRCLS(x1,1);
 r=_ATreeConv_40(x2,__ASeq_6);
 return r;}

extern OBJ _AHeapConv_10(OBJ x1,OBJ x2) /* asSeqBreadth */
{OBJ r;
 FRCLS(x1,1);
 r=_ATreeConv_9(x2);
 return r;}

extern OBJ _AHeapConv_11(OBJ x1,OBJ x2) /* asHeap */
{OBJ r;
 r=_AHeapConv_13(x1,x2);
 return r;}

extern OBJ _AHeapConv_12(OBJ x1,OBJ x2) /* asTree */
{OBJ r;
 FRCLS(x1,1);
 r=x2;
 return r;}

extern OBJ _AHeapConv_13(OBJ x1,OBJ x2) /* asHeap,1 */
{OBJ r;
 if(ISPRM(x2)){
  FRCLS(x1,1);
  r=__ATree_7;
 }else{
  {OBJ x67=FLD1(x2,1);OBJ x68=FLD1(x2,2);OBJ x69=FLD1(x2,3);FLAG x_x2=EXPRD(x2,1);
   if(x_x2){
   }else{
    COPY(x67,1);COPY(x68,1);COPY(x69,1);}
   if(ISPRM(x68)){
    if(ISPRM(x69)){
     FRCLS(x1,1);
     if(x_x2){
      RSOME(x2,r);FLD1(r,2)=__ATree_7;FLD1(r,3)=__ATree_7;
     }else{
      FRPRD(x2,1);PRD1(3,r);FLD1(r,1)=x67;FLD1(r,2)=__ATree_7;FLD1(r,3)=__ATree_7;}
    }else{
     if(x_x2){
      DSPRDF(x2);
     }else{
      FRPRD(x2,1);}
     CPCLS(x1,1);
     {OBJ x74;
      x74=_AHeapConv_13(x1,x69);
      r=_AHeapConv_14(x1,x67,__ATree_7,x74);}}
   }else{
    if(x_x2){
     DSPRDF(x2);
    }else{
     FRPRD(x2,1);}
    if(ISPRM(x69)){
     CPCLS(x1,1);
     {OBJ x78;
      x78=_AHeapConv_13(x1,x68);
      r=_AHeapConv_14(x1,x67,x78,__ATree_7);}
    }else{
     CPCLS(x1,2);
     {OBJ x83;OBJ x82;
      x83=_AHeapConv_13(x1,x69);
      x82=_AHeapConv_13(x1,x68);
      r=_AHeapConv_14(x1,x67,x82,x83);}}}}}
 return r;}

extern OBJ _AHeapConv_14(register OBJ x1,register OBJ x2,register OBJ x3,register OBJ x4) /* sift */
{OBJ r;OBJ* p1=&r;
 for(;;){
  if(ISPRM(x3)){
   if(ISPRM(x4)){
    FRCLS(x1,1);
    PRD1(3,*p1);FLD1(*p1,1)=x2;FLD1(*p1,2)=__ATree_7;FLD1(*p1,3)=__ATree_7;
   }else{
    {OBJ x166=FLD1(x4,1);OBJ x167=FLD1(x4,2);OBJ x168=FLD1(x4,3);
     COPY(x166,2);COPY(x167,1);COPY(x168,1);
     CPCLS(x1,1);
     COPY(x2,1);
     {OBJ x170;
      x170=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x166,x2);
      if(ISTGPRM(x170,1)){
       if(EXPRD(x4,1)){
	DSPRD(x4);
       }else{
	DCPRD(x4,1);}
       {
	PRD1(3,*p1);FLD1(*p1,1)=x166;FLD1(*p1,2)=__ATree_7;
	x3=x167;x4=x168;p1=&FLD1(*p1,3);continue;}
      }else{
       FRCLS(x1,1);
       FREE(x166,1);
       FREE(x167,1);
       FREE(x168,1);
       PRD1(3,*p1);FLD1(*p1,1)=x2;FLD1(*p1,2)=__ATree_7;FLD1(*p1,3)=x4;}}}}
  }else{
   {OBJ x172=FLD1(x3,1);OBJ x173=FLD1(x3,2);OBJ x174=FLD1(x3,3);
    COPY(x172,1);COPY(x173,1);COPY(x174,1);
    if(ISPRM(x4)){
     CPCLS(x1,1);
     COPY(x2,1);
     COPY(x172,1);
     {OBJ x176;
      x176=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x172,x2);
      if(ISTGPRM(x176,1)){
       if(EXPRD(x3,1)){
	DSPRD(x3);
       }else{
	DCPRD(x3,1);}
       {
	PRD1(3,*p1);FLD1(*p1,1)=x172;FLD1(*p1,3)=__ATree_7;
	x3=x173;x4=x174;p1=&FLD1(*p1,2);continue;}
      }else{
       FRCLS(x1,1);
       FREE(x172,1);
       FREE(x173,1);
       FREE(x174,1);
       PRD1(3,*p1);FLD1(*p1,1)=x2;FLD1(*p1,2)=x3;FLD1(*p1,3)=__ATree_7;}}
    }else{
     {OBJ x178=FLD1(x4,1);OBJ x179=FLD1(x4,2);OBJ x180=FLD1(x4,3);
      COPY(x178,1);COPY(x179,1);COPY(x180,1);
      CPCLS(x1,1);
      COPY(x2,1);
      COPY(x172,1);
      {OBJ x183;OBJ x184;OBJ x186;
       x183=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x172,x2);
       if(ISTGPRM(x183,1)){
	x184=__ABUILTIN_3;
       }else{
	x184=__ABUILTIN_5;}
       if(ISTGPRM(x184,1)){
	CPCLS(x1,1);
	COPY(x2,1);
	COPY(x178,1);
	{OBJ x185;
	 x185=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x178,x2);
	 if(ISTGPRM(x185,1)){
	  x186=__ABUILTIN_3;
	 }else{
	  x186=__ABUILTIN_5;}}
       }else{
	x186=__ABUILTIN_3;}
       if(ISTGPRM(x186,1)){
	FRCLS(x1,1);
	FREE(x172,1);
	FREE(x173,1);
	FREE(x174,1);
	FREE(x178,1);
	FREE(x179,1);
	FREE(x180,1);
	PRD1(3,*p1);FLD1(*p1,1)=x2;FLD1(*p1,2)=x3;FLD1(*p1,3)=x4;
       }else{
	{OBJ x187;
	 if(ISTGPRM(x183,1)){
	  CPCLS(x1,1);
	  COPY(x172,1);
	  COPY(x178,1);
	  x187=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x172,x178);
	 }else{
	  x187=__ABUILTIN_3;}
	 if(ISTGPRM(x187,1)){
	  if(EXPRD(x3,1)){
	   DSPRD(x3);
	  }else{
	   DCPRD(x3,1);}
	  FREE(x178,1);
	  FREE(x179,1);
	  FREE(x180,1);
	  {
	   PRD1(3,*p1);FLD1(*p1,1)=x172;FLD1(*p1,3)=x4;
	   x3=x173;x4=x174;p1=&FLD1(*p1,2);continue;}
	 }else{
	  if(EXPRD(x4,1)){
	   DSPRD(x4);
	  }else{
	   DCPRD(x4,1);}
	  FREE(x172,1);
	  FREE(x173,1);
	  FREE(x174,1);
	  {
	   PRD1(3,*p1);FLD1(*p1,1)=x178;FLD1(*p1,2)=x3;
	   x3=x179;x4=x180;p1=&FLD1(*p1,3);continue;}}}}}}}}}
  break;}
 return r;}

extern OBJ _AHeapConv_15(OBJ x1,OBJ x2,OBJ x3) /* <= */
{OBJ r;
 {OBJ x4;
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x3,x2);
  if(ISTGPRM(x4,1)){
   r=__ABUILTIN_3;
  }else{
   r=__ABUILTIN_5;}}
 return r;}

static OBJ _mt_3_1_1(OBJ t,OBJ t1) 
{OBJ r;
 if(EXCLS(t)){
  r=t;
 }else{
  DPCLS(t,r);
  FLDCLS(r,1)=FLDCLS(t,1);
  COPY(FLDCLS(r,1),1);}
 INCCLS(r,1,1);
 FLDCLS(r,2)=t1;
 return r;}

init_AHeapConv()
{
 static int visited=0; if(visited) return; visited=1;
 init_AHeap();
 init_ATree();
 init_ASeq();
 init_AString();
 init_ANat();
 init_AChar();
 init_AOption();
 init_ATreeConv();
 init_ADenotation();
 init_APrintableChar();
 init_ARelCmp();
 init_AInt();
 DEN("H",__AHeapConv_16);
 CLS(3,_AHeapConv_15,__AHeapConv_15);
 CLS(4,_AHeapConv_14,__AHeapConv_14);
 CLS(2,_AHeapConv_13,__AHeapConv_13);
 CLS(2,_AHeapConv_12,__AHeapConv_12);
 CLS(2,_AHeapConv_11,__AHeapConv_11);
 CLS(2,_AHeapConv_10,__AHeapConv_10);
 CLS(2,_AHeapConv_9,__AHeapConv_9);
 CLS(2,_AHeapConv_8,__AHeapConv_8);
 CLS(2,_AHeapConv_7,__AHeapConv_7);
 CLS(3,_AHeapConv_6,__AHeapConv_6);
 CLS(3,_AHeapConv_5,__AHeapConv_5);
 CLS(3,_AHeapConv_4,__AHeapConv_4);
 CLS(3,_AHeapConv_3,__AHeapConv_3);
 MTH(3,1,1,_mt_3_1_1);LZYMTH(3,1,1,_mt_3_1_1);}

