

#include "BUILTIN.h"

#include "Nat.h"

#include "Int.h"

#include "Real.h"

#include "Char.h"
extern OBJ __ASeq_6;
extern OBJ _ABTUnion_2(OBJ);OBJ __ABTUnion_2; /* denotation */
extern OBJ _ABTUnion_3(OBJ);OBJ __ABTUnion_3; /* denotation? */
extern OBJ _ABTUnion_4(OBJ);OBJ __ABTUnion_4; /* denotation,1 */
extern OBJ _ABTUnion_5(OBJ);OBJ __ABTUnion_5; /* bool */
extern OBJ _ABTUnion_6(OBJ);OBJ __ABTUnion_6; /* bool? */
extern OBJ _ABTUnion_7(OBJ);OBJ __ABTUnion_7; /* bool,1 */
extern OBJ _ABTUnion_8(OBJ);OBJ __ABTUnion_8; /* string */
extern OBJ _ABTUnion_9(OBJ);OBJ __ABTUnion_9; /* string? */
extern OBJ _ABTUnion_10(OBJ);OBJ __ABTUnion_10; /* string,1 */
extern OBJ _ABTUnion_11(OBJ);OBJ __ABTUnion_11; /* char */
extern OBJ _ABTUnion_12(OBJ);OBJ __ABTUnion_12; /* char? */
extern OBJ _ABTUnion_13(OBJ);OBJ __ABTUnion_13; /* char,1 */
extern OBJ _ABTUnion_14(OBJ);OBJ __ABTUnion_14; /* real */
extern OBJ _ABTUnion_15(OBJ);OBJ __ABTUnion_15; /* real? */
extern OBJ _ABTUnion_16(OBJ);OBJ __ABTUnion_16; /* real,1 */
extern OBJ _ABTUnion_17(OBJ);OBJ __ABTUnion_17; /* int */
extern OBJ _ABTUnion_18(OBJ);OBJ __ABTUnion_18; /* int? */
extern OBJ _ABTUnion_19(OBJ);OBJ __ABTUnion_19; /* int,1 */
extern OBJ _ABTUnion_20(OBJ);OBJ __ABTUnion_20; /* nat */
extern OBJ _ABTUnion_21(OBJ);OBJ __ABTUnion_21; /* nat? */
extern OBJ _ABTUnion_22(OBJ);OBJ __ABTUnion_22; /* nat,1 */
extern OBJ _ABTUnion_23(OBJ,OBJ);OBJ __ABTUnion_23; /* u */
extern OBJ _ABTUnion_24(OBJ,OBJ);OBJ __ABTUnion_24; /* u,1 */
extern OBJ _ABTUnion_25(OBJ,OBJ);OBJ __ABTUnion_25; /* u,2 */
extern OBJ _ABTUnion_26(OBJ,OBJ);OBJ __ABTUnion_26; /* u,3 */
extern OBJ _ABTUnion_27(OBJ,OBJ);OBJ __ABTUnion_27; /* u,4 */
extern OBJ _ABTUnion_28(OBJ,OBJ);OBJ __ABTUnion_28; /* u,5 */
extern OBJ _ABTUnion_29(OBJ,OBJ);OBJ __ABTUnion_29; /* u,6 */
extern OBJ _ABTUnion_30(OBJ);OBJ __ABTUnion_30; /* u,7 */
extern OBJ _ABTUnion_31(OBJ);OBJ __ABTUnion_31; /* u,8 */
extern OBJ _ABTUnion_32(OBJ);OBJ __ABTUnion_32; /* u,9 */
extern OBJ _ABTUnion_33(OBJ);OBJ __ABTUnion_33; /* u,10 */
extern OBJ _ABTUnion_34(OBJ);OBJ __ABTUnion_34; /* u,11 */
extern OBJ _ABTUnion_35(OBJ);OBJ __ABTUnion_35; /* u,12 */
extern OBJ _ABTUnion_36(OBJ);OBJ __ABTUnion_36; /* u,13 */

extern OBJ _ABTUnion_2(OBJ x1) /* denotation */
{OBJ r;
 PRD(1,6,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_3(OBJ x1) /* denotation? */
{OBJ r;
 if(ISTGPRD(x1,6)){
  if(EXPRD(x1,1)){
   FRPRD(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_4(OBJ x1) /* denotation,1 */
{OBJ r;
 if(ISTGPRD(x1,6)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    CPPRD(x2,1);
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection denotation\'BTUnion:union->denotation");}
 return r;}

extern OBJ _ABTUnion_5(OBJ x1) /* bool */
{OBJ r;
 PRDF(1,5,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_6(OBJ x1) /* bool? */
{OBJ r;
 if(ISTGPRD(x1,5)){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_7(OBJ x1) /* bool,1 */
{OBJ r;
 if(ISTGPRD(x1,5)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection bool\'BTUnion:union->bool");}
 return r;}

extern OBJ _ABTUnion_8(OBJ x1) /* string */
{OBJ r;
 PRD(1,4,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_9(OBJ x1) /* string? */
{OBJ r;
 if(ISTGPRD(x1,4)){
  if(EXPRD(x1,1)){
   FREE(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_10(OBJ x1) /* string,1 */
{OBJ r;
 if(ISTGPRD(x1,4)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    COPY(x2,1);
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection string\'BTUnion:union->string");}
 return r;}

extern OBJ _ABTUnion_11(OBJ x1) /* char */
{OBJ r;
 PRDF(1,3,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_12(OBJ x1) /* char? */
{OBJ r;
 if(ISTGPRD(x1,3)){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_13(OBJ x1) /* char,1 */
{OBJ r;
 if(ISTGPRD(x1,3)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection char\'BTUnion:union->char");}
 return r;}

extern OBJ _ABTUnion_14(OBJ x1) /* real */
{OBJ r;
 PRD(1,2,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_15(OBJ x1) /* real? */
{OBJ r;
 if(ISTGPRD(x1,2)){
  if(EXPRD(x1,1)){
   FRPRD(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_16(OBJ x1) /* real,1 */
{OBJ r;
 if(ISTGPRD(x1,2)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    CPPRD(x2,1);
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection real\'BTUnion:union->real");}
 return r;}

extern OBJ _ABTUnion_17(OBJ x1) /* int */
{OBJ r;
 PRDF(1,1,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_18(OBJ x1) /* int? */
{OBJ r;
 if(ISTGPRD(x1,1)){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_19(OBJ x1) /* int,1 */
{OBJ r;
 if(ISTGPRD(x1,1)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection int\'BTUnion:union->int");}
 return r;}

extern OBJ _ABTUnion_20(OBJ x1) /* nat */
{OBJ r;
 PRDF(1,0,r);FLD(r,1)=x1;
 return r;}

extern OBJ _ABTUnion_21(OBJ x1) /* nat? */
{OBJ r;
 if(ISTGPRD(x1,0)){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FRPRD(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ABTUnion_22(OBJ x1) /* nat,1 */
{OBJ r;
 if(ISTGPRD(x1,0)){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("BTUnion at <unknown> : undefined selection nat\'BTUnion:union->nat");}
 return r;}

extern OBJ _ABTUnion_23(OBJ x1,OBJ x2) /* u */
{OBJ r;
 {OBJ x3;
  PRDF(1,0,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_24(OBJ x1,OBJ x2) /* u,1 */
{OBJ r;
 {OBJ x3;
  PRDF(1,1,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_25(OBJ x1,OBJ x2) /* u,2 */
{OBJ r;
 {OBJ x3;
  PRD(1,2,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_26(OBJ x1,OBJ x2) /* u,3 */
{OBJ r;
 {OBJ x3;
  PRDF(1,3,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_27(OBJ x1,OBJ x2) /* u,4 */
{OBJ r;
 {OBJ x3;
  PRD(1,4,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_28(OBJ x1,OBJ x2) /* u,5 */
{OBJ r;
 {OBJ x3;
  PRDF(1,5,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_29(OBJ x1,OBJ x2) /* u,6 */
{OBJ r;
 {OBJ x3;
  PRD(1,6,x3);FLD(x3,1)=x1;
  PRD1(2,r);FLD1(r,1)=x3;FLD1(r,2)=x2;}
 return r;}

extern OBJ _ABTUnion_30(OBJ x1) /* u,7 */
{OBJ r;
 {OBJ x2;
  PRDF(1,0,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ABTUnion_31(OBJ x1) /* u,8 */
{OBJ r;
 {OBJ x2;
  PRDF(1,1,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ABTUnion_32(OBJ x1) /* u,9 */
{OBJ r;
 {OBJ x2;
  PRD(1,2,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ABTUnion_33(OBJ x1) /* u,10 */
{OBJ r;
 {OBJ x2;
  PRDF(1,3,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ABTUnion_34(OBJ x1) /* u,11 */
{OBJ r;
 {OBJ x2;
  PRD(1,4,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ABTUnion_35(OBJ x1) /* u,12 */
{OBJ r;
 {OBJ x2;
  PRDF(1,5,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

extern OBJ _ABTUnion_36(OBJ x1) /* u,13 */
{OBJ r;
 {OBJ x2;
  PRD(1,6,x2);FLD(x2,1)=x1;
  PRD1(2,r);FLD1(r,1)=x2;FLD1(r,2)=__ASeq_6;}
 return r;}

init_ABTUnion()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_AInt();
 init_AReal();
 init_AChar();
 init_AString();
 init_ASeq();
 init_AOption();
 CLS(1,_ABTUnion_31,__ABTUnion_31);
 CLS(1,_ABTUnion_30,__ABTUnion_30);
 CLS(2,_ABTUnion_29,__ABTUnion_29);
 CLS(2,_ABTUnion_28,__ABTUnion_28);
 CLS(2,_ABTUnion_27,__ABTUnion_27);
 CLS(2,_ABTUnion_26,__ABTUnion_26);
 CLS(2,_ABTUnion_25,__ABTUnion_25);
 CLS(2,_ABTUnion_24,__ABTUnion_24);
 CLS(2,_ABTUnion_23,__ABTUnion_23);
 CLS(1,_ABTUnion_22,__ABTUnion_22);
 CLS(1,_ABTUnion_21,__ABTUnion_21);
 CLS(1,_ABTUnion_20,__ABTUnion_20);
 CLS(1,_ABTUnion_19,__ABTUnion_19);
 CLS(1,_ABTUnion_18,__ABTUnion_18);
 CLS(1,_ABTUnion_17,__ABTUnion_17);
 CLS(1,_ABTUnion_16,__ABTUnion_16);
 CLS(1,_ABTUnion_15,__ABTUnion_15);
 CLS(1,_ABTUnion_14,__ABTUnion_14);
 CLS(1,_ABTUnion_13,__ABTUnion_13);
 CLS(1,_ABTUnion_12,__ABTUnion_12);
 CLS(1,_ABTUnion_11,__ABTUnion_11);
 CLS(1,_ABTUnion_10,__ABTUnion_10);
 CLS(1,_ABTUnion_9,__ABTUnion_9);
 CLS(1,_ABTUnion_8,__ABTUnion_8);
 CLS(1,_ABTUnion_7,__ABTUnion_7);
 CLS(1,_ABTUnion_6,__ABTUnion_6);
 CLS(1,_ABTUnion_5,__ABTUnion_5);
 CLS(1,_ABTUnion_4,__ABTUnion_4);
 CLS(1,_ABTUnion_36,__ABTUnion_36);
 CLS(1,_ABTUnion_3,__ABTUnion_3);
 CLS(1,_ABTUnion_35,__ABTUnion_35);
 CLS(1,_ABTUnion_2,__ABTUnion_2);
 CLS(1,_ABTUnion_34,__ABTUnion_34);
 CLS(1,_ABTUnion_33,__ABTUnion_33);
 CLS(1,_ABTUnion_32,__ABTUnion_32);}

