

#include "BUILTIN.h"

#include "Nat.h"
extern TUP2 _ATable_8(OBJ,OBJ);extern OBJ __ATable_8;
extern OBJ __ATable_10;
extern OBJ _ATable_17(OBJ,OBJ,OBJ);extern OBJ __ATable_17;
extern OBJ _ADArray_15(OBJ,OBJ,OBJ);extern OBJ __ADArray_15;
extern OBJ _ADArray_16(OBJ,OBJ,OBJ);extern OBJ __ADArray_16;
extern OBJ _ADArray_20(OBJ,OBJ);extern OBJ __ADArray_20;
extern OBJ _ADArray_21(OBJ,OBJ);extern OBJ __ADArray_21;
extern OBJ __AOption_5;

#include "Char.h"

#include "Bitset.h"

#include "Array.h"
extern OBJ _ADEBUG_4(OBJ,OBJ,OBJ);extern OBJ __ADEBUG_4;
extern OBJ _ADEBUG_10(OBJ);extern OBJ __ADEBUG_10;
extern OBJ _ADArrayReduce_6(OBJ,OBJ,OBJ);extern OBJ __ADArrayReduce_6;
extern OBJ _AUniqueTable_2(OBJ,OBJ);OBJ __AUniqueTable_2; /* uniqueTable */
extern OBJ _AUniqueTable_3(OBJ,OBJ);OBJ __AUniqueTable_3; /* uniqueTable? */
extern OBJ _AUniqueTable_4(OBJ,OBJ);OBJ __AUniqueTable_4; /* refCtable */
extern OBJ _AUniqueTable_6(OBJ);OBJ __AUniqueTable_6; /* refCEntry */
extern OBJ _AUniqueTable_7(OBJ,OBJ);OBJ __AUniqueTable_7; /* refCEntry? */
extern OBJ _AUniqueTable_8(OBJ,OBJ);OBJ __AUniqueTable_8; /* entry */
extern OBJ _AUniqueTable_9(OBJ,OBJ);OBJ __AUniqueTable_9; /* refC */
extern OBJ _AUniqueTable_12(OBJ);OBJ __AUniqueTable_12; /* {} */
extern TUP2 _AUniqueTable_13(OBJ,OBJ,OBJ);OBJ __AUniqueTable_13; /* incl */
extern OBJ _AUniqueTable_14(OBJ,OBJ);OBJ __AUniqueTable_14; /* toStatic */
extern OBJ _AUniqueTable_15(OBJ,OBJ,OBJ);OBJ __AUniqueTable_15; /* ! */
extern OBJ _AUniqueTable_16(OBJ,OBJ,OBJ,OBJ);OBJ __AUniqueTable_16; /* upd */
extern OBJ _AUniqueTable_17(OBJ,OBJ,OBJ,OBJ);OBJ __AUniqueTable_17; /* upd,1 */
extern OBJ _AUniqueTable_18(OBJ,OBJ,OBJ);OBJ __AUniqueTable_18; /* incr */
extern OBJ _AUniqueTable_19(OBJ,OBJ,OBJ);OBJ __AUniqueTable_19; /* decr */
extern OBJ _AUniqueTable_20(OBJ,OBJ,OBJ,OBJ);OBJ __AUniqueTable_20; /* ` */
extern OBJ _AUniqueTable_28(OBJ,OBJ,OBJ);OBJ __AUniqueTable_28; /* = */
extern OBJ _AUniqueTable_29(OBJ,OBJ);OBJ __AUniqueTable_29; /* refCEntry,1 */
extern OBJ _AUniqueTable_30(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __AUniqueTable_30; /* incl'30 */
extern OBJ _AUniqueTable_31(OBJ,OBJ,OBJ);OBJ __AUniqueTable_31; /* incl'31 */
extern OBJ _AUniqueTable_32(OBJ,OBJ,OBJ);OBJ __AUniqueTable_32; /* upd,1'32 */
OBJ __AUniqueTable_33; /* upd'33 */
extern OBJ _AUniqueTable_34(OBJ);OBJ __AUniqueTable_34; /* upd'34 */
OBJ __AUniqueTable_35; /* upd'35 */
extern OBJ _AUniqueTable_36(OBJ,OBJ);OBJ __AUniqueTable_36; /* upd'36 */
extern OBJ _AUniqueTable_37(OBJ,OBJ);OBJ __AUniqueTable_37; /* incr'37 */
extern OBJ _AUniqueTable_38(OBJ,OBJ);OBJ __AUniqueTable_38; /* decr'38 */
extern OBJ _AUniqueTable_39(OBJ,OBJ);OBJ __AUniqueTable_39; /* `'39 */

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

extern OBJ _AUniqueTable_3(OBJ x1,OBJ x2) /* uniqueTable? */
{OBJ r;
 FRCLS(x1,1);
 FRPRD(x2,1);
 r=__ABUILTIN_5;
 return r;}

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

extern OBJ _AUniqueTable_6(OBJ x1) /* refCEntry */
{OBJ r;
 CPPRD(__AUniqueTable_29,1);
 FRCLS(x1,1);
 r=__AUniqueTable_29;
 return r;}

extern OBJ _AUniqueTable_7(OBJ x1,OBJ x2) /* refCEntry? */
{OBJ r;
 FRCLS(x1,1);
 FRPRD(x2,1);
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AUniqueTable_8(OBJ x1,OBJ x2) /* entry */
{OBJ r;
 FRCLS(x1,1);
 {OBJ x4=FLD1(x2,2);
  if(EXPRD(x2,1)){
   r=x4;
   DSPRDF(x2);
  }else{
   COPY(x4,1);
   r=x4;
   FRPRD(x2,1);}}
 return r;}

extern OBJ _AUniqueTable_9(OBJ x1,OBJ x2) /* refC */
{OBJ r;
 FRCLS(x1,1);
 {OBJ x3=FLD1(x2,1);
  if(EXPRD(x2,1)){
   r=x3;
   FREE(FLD1(x2,2),1);DSPRDF(x2);
  }else{
   r=x3;
   FRPRD(x2,1);}}
 return r;}

extern OBJ _AUniqueTable_12(OBJ x1) /* {} */
{OBJ r;
 CPPRD(__ATable_10,1);
 FRCLS(x1,1);
 r=__ATable_10;
 return r;}

extern TUP2 _AUniqueTable_13(OBJ x1,OBJ x2,OBJ x3) /* incl */
{TUP2 r;
 CPCLS(__AUniqueTable_30,1);
 CPCLS(x1,1);
 COPY(x2,1);
 CPPRD(x3,1);
 {OBJ x4;OBJ x5;
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AUniqueTable_30,2))(__AUniqueTable_30,x1,x2);
  x5=_ADArrayReduce_6(x4,__AOption_5,x3);
  if(ISPRM(x5)){
   CPCLS(__AUniqueTable_6,1);
   {OBJ x16;
    x16=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AUniqueTable_6,3))(__AUniqueTable_6,x1,__ANat_8,x2);
    r=_ATable_8(x16,x3);}
  }else{
   {OBJ x20=FLD1(x5,1);
    if(EXPRD(x5,1)){
     r.c1=x20;
     DSPRDF(x5);
    }else{
     r.c1=x20;
     FRPRD(x5,1);}
    CPCLS(__AUniqueTable_31,1);
    {OBJ x21;
     x21=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AUniqueTable_31,2))(__AUniqueTable_31,x1,x2);
     r.c2=_ADArray_16(r.c1,x21,x3);}}}}
 return r;}
extern OBJ _AUniqueTable_13_c(OBJ x1,OBJ x2,OBJ x3) /* incl */
{OBJ r;
 {TUP2 t=_AUniqueTable_13(x1,x2,x3);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

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

extern OBJ _AUniqueTable_15(OBJ x1,OBJ x2,OBJ x3) /* ! */
{OBJ r;
 FRCLS(x1,1);
 {OBJ x4;
  x4=_ADArray_20(x3,x2);
  {OBJ x6=FLD1(x4,2);
   if(EXPRD(x4,1)){
    r=x6;
    DSPRDF(x4);
   }else{
    COPY(x6,1);
    r=x6;
    FRPRD(x4,1);}}}
 return r;}

extern OBJ _AUniqueTable_16(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* upd */
{OBJ r;
 CPPRD(x4,1);
 {OBJ x5;
  x5=_ADArray_21(x4,x2);
  if(ISPRM(x5)){
   CPCLS(__AUniqueTable_6,1);
   CPCLS(__AUniqueTable_34,1);
   CPPRD(__AUniqueTable_35,1);
   {OBJ x13;OBJ x14;OBJ x15;
    x13=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AUniqueTable_6,3))(__AUniqueTable_6,x1,__ANat_5,x3);
    x14=(*(OBJ(*)(OBJ,OBJ))METHOD(__AUniqueTable_34,1))(__AUniqueTable_34,__ABUILTIN_20);
    x15=_ADArray_15(x4,x2,x13);
    r=_ADEBUG_4(x14,__AUniqueTable_35,x15);}
  }else{
   if(EXPRD(x5,1)){
    FRPRD(FLD1(x5,1),1);DSPRDF(x5);
   }else{
    DCPRD(x5,1);}
   CPCLS(__AUniqueTable_32,1);
   CPCLS(__AUniqueTable_36,1);
   {OBJ x17;OBJ x18;
    x17=(*(OBJ(*)(OBJ,OBJ))METHOD(__AUniqueTable_36,1))(__AUniqueTable_36,x3);
    x18=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AUniqueTable_32,2))(__AUniqueTable_32,x1,x17);
    r=_ADArray_16(x2,x18,x4);}}}
 return r;}

extern OBJ _AUniqueTable_17(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* upd,1 */
{OBJ r;
 CPCLS(__AUniqueTable_32,1);
 {OBJ x5;
  x5=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AUniqueTable_32,2))(__AUniqueTable_32,x1,x3);
  r=_ADArray_16(x2,x5,x4);}
 return r;}

extern OBJ _AUniqueTable_18(OBJ x1,OBJ x2,OBJ x3) /* incr */
{OBJ r;
 CPCLS(__AUniqueTable_37,1);
 {OBJ x4;
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AUniqueTable_37,1))(__AUniqueTable_37,x1);
  r=_ADArray_16(x2,x4,x3);}
 return r;}

extern OBJ _AUniqueTable_19(OBJ x1,OBJ x2,OBJ x3) /* decr */
{OBJ r;
 CPCLS(__AUniqueTable_38,1);
 {OBJ x4;
  x4=(*(OBJ(*)(OBJ,OBJ))METHOD(__AUniqueTable_38,1))(__AUniqueTable_38,x1);
  r=_ADArray_16(x2,x4,x3);}
 return r;}

extern OBJ _AUniqueTable_20(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* ` */
{OBJ r;
 CPCLS(__AUniqueTable_39,1);
 FRCLS(x1,1);
 {OBJ x5;
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AUniqueTable_39,1))(__AUniqueTable_39,x3);
  r=_ATable_17(x2,x5,x4);}
 return r;}

extern OBJ _AUniqueTable_28(OBJ x1,OBJ x2,OBJ x3) /* = */
{OBJ r;
 {OBJ x5=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   COPY(x5,1);
   FRPRD(x3,1);}
  CPCLS(x1,1);
  COPY(x2,1);
  {OBJ x6;OBJ x7;
   x6=x5;
   COPY(x6,1);
   x7=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x2,x6);
   if(ISTGPRM(x7,1)){
    FRCLS(x1,1);
    FREE(x2,1);
    FREE(x6,1);
    r=__ABUILTIN_3;
   }else{
    {OBJ x10;
     x10=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x6,x2);
     if(ISTGPRM(x10,1)){
      r=__ABUILTIN_3;
     }else{
      r=__ABUILTIN_5;}}}}}
 return r;}

extern OBJ _AUniqueTable_29(OBJ x1,OBJ x2) /* refCEntry,1 */
{OBJ r;
 PRD1(2,r);FLD1(r,1)=x1;FLD1(r,2)=x2;
 return r;}

extern OBJ _AUniqueTable_30(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* incl'30 */
{OBJ r;
 if(ISPRM(x5)){
  {OBJ x10;
   x10=_AUniqueTable_28(x1,x2,x4);
   if(ISTGPRM(x10,1)){
    PRD1F(1,r);FLD1(r,1)=x3;
   }else{
    r=__AOption_5;}}
 }else{
  FRCLS(x1,1);
  FREE(x2,1);
  FRPRD(x4,1);
  r=x5;}
 return r;}

extern OBJ _AUniqueTable_31(OBJ x1,OBJ x2,OBJ x3) /* incl'31 */
{OBJ r;
 {OBJ x4=FLD1(x3,1);
  if(EXPRD(x3,1)){
   FREE(FLD1(x3,2),1);DSPRDF(x3);
  }else{
   FRPRD(x3,1);}
  CPCLS(__AUniqueTable_6,1);
  {OBJ x6;OBJ x7;
   x6=x4;
   ANat_2(x6,x7);
   r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AUniqueTable_6,3))(__AUniqueTable_6,x1,x7,x2);}}
 return r;}

extern OBJ _AUniqueTable_32(OBJ x1,OBJ x2,OBJ x3) /* upd,1'32 */
{OBJ r;
 {OBJ x11=FLD1(x3,1);OBJ x12=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   COPY(x12,1);
   FRPRD(x3,1);}
  CPCLS(__AUniqueTable_6,1);
  {OBJ x13;
   x13=(*(OBJ(*)(OBJ,OBJ))METHOD(x2,1))(x2,x12);
   r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AUniqueTable_6,3))(__AUniqueTable_6,x1,x11,x13);}}
 return r;}

extern OBJ _AUniqueTable_34(OBJ x1) /* upd'34 */
{OBJ r;
 CPPRD(__AUniqueTable_33,1);
 r=_ADEBUG_10(__AUniqueTable_33);
 return r;}

extern OBJ _AUniqueTable_36(OBJ x1,OBJ x2) /* upd'36 */
{OBJ r;
 FREE(x2,1);
 r=x1;
 return r;}

extern OBJ _AUniqueTable_37(OBJ x1,OBJ x2) /* incr'37 */
{OBJ r;
 {OBJ x10=FLD1(x2,1);OBJ x11=FLD1(x2,2);
  if(EXPRD(x2,1)){
   DSPRDF(x2);
  }else{
   COPY(x11,1);
   FRPRD(x2,1);}
  CPCLS(__AUniqueTable_6,1);
  {OBJ x12;
   ANat_2(x10,x12);
   r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AUniqueTable_6,3))(__AUniqueTable_6,x1,x12,x11);}}
 return r;}

extern OBJ _AUniqueTable_38(OBJ x1,OBJ x2) /* decr'38 */
{OBJ r;
 {OBJ x10=FLD1(x2,1);OBJ x11=FLD1(x2,2);
  if(EXPRD(x2,1)){
   DSPRDF(x2);
  }else{
   COPY(x11,1);
   FRPRD(x2,1);}
  CPCLS(__AUniqueTable_6,1);
  {OBJ x12;
   ANat_4(x10,x12);
   r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AUniqueTable_6,3))(__AUniqueTable_6,x1,x12,x11);}}
 return r;}

extern OBJ _AUniqueTable_39(OBJ x1,OBJ x2) /* `'39 */
{OBJ r;
 {OBJ x4=FLD1(x2,2);
  if(EXPRD(x2,1)){
   DSPRDF(x2);
  }else{
   COPY(x4,1);
   FRPRD(x2,1);}
  {OBJ x5;
   x5=x4;
   r=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x5);}}
 return r;}

static OBJ _mt_1_0_3(OBJ t,OBJ t1,OBJ t2,OBJ t3) 
{OBJ r;
 {OBJ t4;
  DCCLS(t,1);
  t4=(*(OBJ(*)(OBJ))ENTRY(t))(t1);
  r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(t4,2))(t4,t2,t3);}
 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;}

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

static OBJ _mt_4_1_3(OBJ t,OBJ t1,OBJ t2,OBJ t3) 
{OBJ r;
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  COPY(FLDCLS(t,1),1);
  DCCLS(t,1);}
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),t1,t2,t3);
 return r;}

static OBJ _mt_5_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_5_2_3(OBJ t,OBJ t1,OBJ t2,OBJ t3) 
{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,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),t1,t2,t3);
 return r;}

init_AUniqueTable()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_AString();
 init_ATable();
 init_ADArray();
 init_ANatMap();
 init_AOption();
 init_APair();
 init_ASeq();
 init_AChar();
 init_ASet();
 init_ABitset();
 init_AArray();
 init_ATableFun2();
 init_ASeqFilter();
 init_ASeqMap();
 init_ADEBUG();
 init_ACom();
 init_AVoid();
 init_ADArrayReduce();
 CLS(3,_AUniqueTable_31,__AUniqueTable_31);
 CLS(5,_AUniqueTable_30,__AUniqueTable_30);
 CLS(2,_AUniqueTable_29,__AUniqueTable_29);
 CLS(3,_AUniqueTable_28,__AUniqueTable_28);
 CLS(4,_AUniqueTable_20,__AUniqueTable_20);
 CLS(3,_AUniqueTable_19,__AUniqueTable_19);
 CLS(3,_AUniqueTable_18,__AUniqueTable_18);
 CLS(4,_AUniqueTable_17,__AUniqueTable_17);
 CLS(4,_AUniqueTable_16,__AUniqueTable_16);
 CLS(3,_AUniqueTable_15,__AUniqueTable_15);
 CLS(2,_AUniqueTable_14,__AUniqueTable_14);
 CLS(3,_AUniqueTable_13_c,__AUniqueTable_13);
 CLS(1,_AUniqueTable_12,__AUniqueTable_12);
 CLS(2,_AUniqueTable_9,__AUniqueTable_9);
 CLS(2,_AUniqueTable_8,__AUniqueTable_8);
 CLS(2,_AUniqueTable_39,__AUniqueTable_39);
 CLS(2,_AUniqueTable_7,__AUniqueTable_7);
 CLS(2,_AUniqueTable_38,__AUniqueTable_38);
 CLS(1,_AUniqueTable_6,__AUniqueTable_6);
 CLS(2,_AUniqueTable_37,__AUniqueTable_37);
 CLS(2,_AUniqueTable_36,__AUniqueTable_36);
 CLS(2,_AUniqueTable_4,__AUniqueTable_4);
 DEN("update on unused entry",__AUniqueTable_35);
 CLS(2,_AUniqueTable_3,__AUniqueTable_3);
 LCLS(1,_AUniqueTable_34,__AUniqueTable_34);
 CLS(2,_AUniqueTable_2,__AUniqueTable_2);
 DEN("-zcheckTable",__AUniqueTable_33);
 CLS(3,_AUniqueTable_32,__AUniqueTable_32);
 MTH(1,0,3,_mt_1_0_3);LZYMTH(1,0,3,_mt_1_0_3);
 MTH(3,1,1,_mt_3_1_1);LZYMTH(3,1,1,_mt_3_1_1);
 MTH(4,0,1,_mt_4_0_1);LZYMTH(4,0,1,_mt_4_0_1);
 MTH(4,1,3,_mt_4_1_3);LZYMTH(4,1,3,_mt_4_1_3);
 MTH(5,0,2,_mt_5_0_2);LZYMTH(5,0,2,_mt_5_0_2);
 MTH(5,2,3,_mt_5_2_3);LZYMTH(5,2,3,_mt_5_2_3);}

