

#include "BUILTIN.h"

#include "Denotation.h"

#include "Nat.h"

#include "Char.h"

#include "Int.h"
extern OBJ _AUnion3Conv_4(OBJ,OBJ,OBJ,OBJ);OBJ __AUnion3Conv_4; /* ` */
OBJ __AUnion3Conv_5; /* `'5 */
OBJ __AUnion3Conv_6; /* `'6 */
OBJ __AUnion3Conv_7; /* `'7 */
OBJ __AUnion3Conv_8; /* `'8 */

extern OBJ _AUnion3Conv_4(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* ` */
{OBJ r;
 switch(TGPRD(x4)){
  case 2:
   {OBJ x37=FLD(x4,1);
    if(EXPRD(x4,1)){
     DSPRDF(x4);
    }else{
     COPY(x37,1);
     FRPRD(x4,1);}
    FRCLS(x1,1);
    FRCLS(x2,1);
    CPPRD(__AUnion3Conv_5,1);
    CPPRD(__AUnion3Conv_7,1);
    {OBJ x38;OBJ x39;
     x38=(*(OBJ(*)(OBJ,OBJ))METHOD(x3,1))(x3,x37);
     ADenotation_4(x38,__AUnion3Conv_5,x39);
     ADenotation_4(__AUnion3Conv_7,x39,r);}}break;
  case 0:
   {OBJ x40=FLD(x4,1);
    if(EXPRD(x4,1)){
     DSPRDF(x4);
    }else{
     COPY(x40,1);
     FRPRD(x4,1);}
    FRCLS(x2,1);
    FRCLS(x3,1);
    CPPRD(__AUnion3Conv_5,1);
    CPPRD(__AUnion3Conv_8,1);
    {OBJ x41;OBJ x42;
     x41=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x40);
     ADenotation_4(x41,__AUnion3Conv_5,x42);
     ADenotation_4(__AUnion3Conv_8,x42,r);}}break;
  default: 
   {OBJ x34=FLD(x4,1);
    if(EXPRD(x4,1)){
     DSPRDF(x4);
    }else{
     COPY(x34,1);
     FRPRD(x4,1);}
    FRCLS(x1,1);
    FRCLS(x3,1);
    CPPRD(__AUnion3Conv_5,1);
    CPPRD(__AUnion3Conv_6,1);
    {OBJ x35;OBJ x36;
     x35=(*(OBJ(*)(OBJ,OBJ))METHOD(x2,1))(x2,x34);
     ADenotation_4(x35,__AUnion3Conv_5,x36);
     ADenotation_4(__AUnion3Conv_6,x36,r);}}}
 return r;}

static OBJ _mt_4_0_3(OBJ t,OBJ t1,OBJ t2,OBJ t3) 
{OBJ r;
 DPCLS(t,r);
 INCCLS(r,0,3);
 FLDCLS(r,1)=t1;
 FLDCLS(r,2)=t2;
 FLDCLS(r,3)=t3;
 return r;}

static OBJ _mt_4_0_4(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3,t4);
 return r;}

static OBJ _mt_4_3_1(OBJ t,OBJ t1) 
{OBJ r;
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  COPY(FLDCLS(t,1),1);
  COPY(FLDCLS(t,2),1);
  COPY(FLDCLS(t,3),1);
  DCCLS(t,1);}
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),FLDCLS(t,3),t1);
 return r;}
static OBJ _mt_4_3_1_l(OBJ t,OBJ t1) 
{OBJ r;
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))ENTRY(t))(FLDCLS(t,1),FLDCLS(t,2),FLDCLS(t,3),t1);
 if(EXCLS(t)){
  DSCLSF(t);
 }else{
  DCCLS(t,1);
  FLDCLS(t,1)=NIL;FLDCLS(t,2)=NIL;FLDCLS(t,3)=NIL;
  COPY(r,1);LZYCLS(t,r);}
 return r;}

init_AUnion3Conv()
{
 static int visited=0; if(visited) return; visited=1;
 init_AUnion3();
 init_ADenotation();
 init_ANat();
 init_AChar();
 init_AInt();
 DEN("[1|",__AUnion3Conv_8);
 DEN("[3|",__AUnion3Conv_7);
 DEN("[2|",__AUnion3Conv_6);
 DEN("]",__AUnion3Conv_5);
 CLS(4,_AUnion3Conv_4,__AUnion3Conv_4);
 MTH(4,0,3,_mt_4_0_3);LZYMTH(4,0,3,_mt_4_0_3);
 MTH(4,0,4,_mt_4_0_4);LZYMTH(4,0,4,_mt_4_0_4);
 MTH(4,3,1,_mt_4_3_1);LZYMTH(4,3,1,_mt_4_3_1_l);}

