

#include "BUILTIN.h"
extern OBJ _ASetByBST_21(OBJ,OBJ);extern OBJ __ASetByBST_21;
extern OBJ _ASetByBST_41(OBJ,OBJ,OBJ);extern OBJ __ASetByBST_41;

#include "Nat.h"
extern OBJ _ABSTree_58(OBJ,OBJ,OBJ);extern OBJ __ABSTree_58;
extern OBJ __ATree_7;
extern OBJ _ABSTreeMap_5(OBJ,OBJ,OBJ,OBJ);extern OBJ __ABSTreeMap_5;
extern OBJ _ASetByBSTConstr_5(OBJ,OBJ,OBJ,OBJ);OBJ __ASetByBSTConstr_5; /* x */
extern OBJ _ASetByBSTConstr_6(OBJ,OBJ,OBJ,OBJ);OBJ __ASetByBSTConstr_6; /* < */
extern OBJ _ASetByBSTConstr_7(OBJ,OBJ,OBJ,OBJ);OBJ __ASetByBSTConstr_7; /* U */
extern OBJ _ASetByBSTConstr_8(OBJ,OBJ,OBJ,OBJ);OBJ __ASetByBSTConstr_8; /* <,1 */
extern OBJ _ASetByBSTConstr_9(OBJ,OBJ);OBJ __ASetByBSTConstr_9; /* x'9 */
extern OBJ _ASetByBSTConstr_10(OBJ);OBJ __ASetByBSTConstr_10; /* U'10 */
extern OBJ _ASetByBSTConstr_11(OBJ);OBJ __ASetByBSTConstr_11; /* U'11 */

extern OBJ _ASetByBSTConstr_5(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* x */
{OBJ r;
 if(ISPRM(x3)){
  FRCLS(x1,1);
  FRCLS(x2,1);
  FREE(x4,1);
  r=__ATree_7;
 }else{
  CPCLS(x1,3);
  CPCLS(x2,2);
  CPPRD(x3,1);
  COPY(x4,1);
  CPCLS(__ASetByBSTConstr_6,1);
  CPCLS(__ASetByBSTConstr_9,1);
  {OBJ x18;OBJ x19;OBJ x20;OBJ x21;OBJ x22;OBJ x23;
   x18=_ASetByBST_21(x1,x3);
   COPY(x18,1);
   x19=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ASetByBSTConstr_6,2))(__ASetByBSTConstr_6,x1,x2);
   CPCLS(x19,1);
   x20=_ABSTree_58(x1,x18,x3);
   x21=(*(OBJ(*)(OBJ,OBJ))METHOD(__ASetByBSTConstr_9,1))(__ASetByBSTConstr_9,x18);
   x22=_ASetByBSTConstr_5(x1,x2,x20,x4);
   x23=_ABSTreeMap_5(x2,x19,x21,x4);
   r=_ASetByBST_41(x19,x23,x22);}}
 return r;}

extern OBJ _ASetByBSTConstr_6(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* < */
{OBJ r;
 {OBJ x19=FLD1(x3,1);OBJ x20=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   COPY(x19,1);COPY(x20,1);
   FRPRD(x3,1);}
  {OBJ x29=FLD1(x4,1);OBJ x30=FLD1(x4,2);
   if(EXPRD(x4,1)){
    COPY(x29,1);
    DSPRDF(x4);
   }else{
    COPY(x29,2);COPY(x30,1);
    FRPRD(x4,1);}
   CPCLS(x1,1);
   COPY(x19,1);
   {OBJ x31;
    x31=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x19,x29);
    if(ISTGPRM(x31,1)){
     FRCLS(x1,1);
     FRCLS(x2,1);
     FREE(x19,1);
     FREE(x20,1);
     FREE(x29,1);
     FREE(x30,1);
     r=__ABUILTIN_5;
    }else{
     {OBJ x32;
      x32=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x29,x19);
      if(ISTGPRM(x32,1)){
       FRCLS(x2,1);
       FREE(x20,1);
       FREE(x30,1);
       r=__ABUILTIN_3;
      }else{
       r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x2,2))(x2,x20,x30);}}}}}}
 return r;}

extern OBJ _ASetByBSTConstr_7(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* U */
{OBJ r;
 CPCLS(__ASetByBSTConstr_8,1);
 CPCLS(__ASetByBSTConstr_10,1);
 CPCLS(__ASetByBSTConstr_11,1);
 CPCLS(x1,1);
 CPCLS(x2,1);
 {OBJ x5;OBJ x6;OBJ x7;
  x5=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ASetByBSTConstr_8,2))(__ASetByBSTConstr_8,x1,x2);
  CPCLS(x5,2);
  x6=_ABSTreeMap_5(x1,x5,__ASetByBSTConstr_10,x3);
  x7=_ABSTreeMap_5(x2,x5,__ASetByBSTConstr_11,x4);
  r=_ASetByBST_41(x5,x6,x7);}
 return r;}

extern OBJ _ASetByBSTConstr_8(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* <,1 */
{OBJ r;
 if(ISTGPRD(x3,0)){
  {OBJ x51=FLD(x3,1);
   if(EXPRD(x3,1)){
    DSPRDF(x3);
   }else{
    COPY(x51,1);
    FRPRD(x3,1);}
   FRCLS(x2,1);
   if(ISTGPRD(x4,0)){
    {OBJ x52=FLD(x4,1);
     if(EXPRD(x4,1)){
      DSPRDF(x4);
     }else{
      COPY(x52,1);
      FRPRD(x4,1);}
     r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x51,x52);}
   }else{
    if(EXPRD(x4,1)){
     FREE(FLD(x4,1),1);DSPRDF(x4);
    }else{
     DCPRD(x4,1);}
    FRCLS(x1,1);
    FREE(x51,1);
    r=__ABUILTIN_5;}}
 }else{
  {OBJ x54=FLD(x3,1);
   if(EXPRD(x3,1)){
    DSPRDF(x3);
   }else{
    COPY(x54,1);
    FRPRD(x3,1);}
   FRCLS(x1,1);
   if(ISTGPRD(x4,0)){
    if(EXPRD(x4,1)){
     FREE(FLD(x4,1),1);DSPRDF(x4);
    }else{
     DCPRD(x4,1);}
    FRCLS(x2,1);
    FREE(x54,1);
    r=__ABUILTIN_3;
   }else{
    {OBJ x56=FLD(x4,1);
     if(EXPRD(x4,1)){
      DSPRDF(x4);
     }else{
      COPY(x56,1);
      FRPRD(x4,1);}
     r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x2,2))(x2,x54,x56);}}}}
 return r;}

extern OBJ _ASetByBSTConstr_9(OBJ x1,OBJ x2) /* x'9 */
{OBJ r;
 PRD1(2,r);FLD1(r,1)=x1;FLD1(r,2)=x2;
 return r;}

extern OBJ _ASetByBSTConstr_10(OBJ x1) /* U'10 */
{OBJ r;
 PRD(1,0,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ASetByBSTConstr_11(OBJ x1) /* U'11 */
{OBJ r;
 PRD(1,1,r);FLD(r,1)=x1;
 return r;}

init_ASetByBSTConstr()
{
 static int visited=0; if(visited) return; visited=1;
 init_ASetByBST();
 init_APair();
 init_AUnion2();
 init_ANat();
 init_ASeq();
 init_AOption();
 init_ABSTree();
 init_ATree();
 init_ASetByBSTMap();
 init_ABSTreeMap();
 CLS(1,_ASetByBSTConstr_11,__ASetByBSTConstr_11);
 CLS(1,_ASetByBSTConstr_10,__ASetByBSTConstr_10);
 CLS(2,_ASetByBSTConstr_9,__ASetByBSTConstr_9);
 CLS(4,_ASetByBSTConstr_8,__ASetByBSTConstr_8);
 CLS(4,_ASetByBSTConstr_7,__ASetByBSTConstr_7);
 CLS(4,_ASetByBSTConstr_6,__ASetByBSTConstr_6);
 CLS(4,_ASetByBSTConstr_5,__ASetByBSTConstr_5);}

