

#include "BUILTIN.h"
extern OBJ __AOption_5;
extern OBJ _ACAST_3(OBJ);extern OBJ __ACAST_3;

#include "Denotation.h"

#include "Nat.h"

#include "Char.h"

#include "Int.h"
extern OBJ _ADynConv_2(OBJ,OBJ);OBJ __ADynConv_2; /* pack */
extern OBJ _ADynConv_3(OBJ,OBJ);OBJ __ADynConv_3; /* unpack */
extern OBJ _ADynConv_4(OBJ,OBJ);OBJ __ADynConv_4; /* tryUnpack */
OBJ __ADynConv_5; /* unpack'5 */
OBJ __ADynConv_6; /* unpack'6 */
OBJ __ADynConv_7; /* unpack'7 */
OBJ __ADynConv_8; /* unpack'8 */

extern OBJ _ADynConv_2(OBJ x1,OBJ x2) /* pack */
{OBJ r;
 {
  PRD1(2,r);FLD1(r,1)=x2;
  FLD1(r,2)=_ACAST_3(x1);}
 return r;}

extern OBJ _ADynConv_3(OBJ x1,OBJ x2) /* unpack */
{OBJ r;
 {OBJ x15=FLD1(x1,1);OBJ x16=FLD1(x1,2);
  if(EXPRD(x1,1)){
   CPPRD(x15,1);
   DSPRDF(x1);
  }else{
   CPPRD(x15,2);COPY(x16,1);
   FRPRD(x1,1);}
  CPPRD(x2,1);
  {OBJ x17;
   ADenotation_21(x15,x2,x17);
   if(ISTGPRM(x17,1)){
    FRPRD(x2,1);
    FRPRD(x15,1);
    r=_ACAST_3(x16);
   }else{
    FREE(x16,1);
    CPPRD(__ADynConv_5,1);
    CPPRD(__ADynConv_6,1);
    CPPRD(__ADynConv_7,1);
    CPPRD(__ADynConv_8,1);
    {OBJ x18;OBJ x19;OBJ x20;OBJ x21;OBJ x22;
     ADenotation_4(x15,__ADynConv_5,x18);
     ADenotation_4(__ADynConv_6,x18,x19);
     ADenotation_4(x2,x19,x20);
     ADenotation_4(__ADynConv_7,x20,x21);
     ADenotation_4(__ADynConv_8,x21,x22);
     ABUILTIN_12(x22,r);}}}}
 return r;}

extern OBJ _ADynConv_4(OBJ x1,OBJ x2) /* tryUnpack */
{OBJ r;
 {OBJ x11=FLD1(x1,1);OBJ x12=FLD1(x1,2);
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   CPPRD(x11,1);COPY(x12,1);
   FRPRD(x1,1);}
  {OBJ x13;
   ADenotation_21(x11,x2,x13);
   if(ISTGPRM(x13,1)){
    {
     PRD1(1,r);
     FLD1(r,1)=_ACAST_3(x12);}
   }else{
    FREE(x12,1);
    r=__AOption_5;}}}
 return r;}

init_ADynConv()
{
 static int visited=0; if(visited) return; visited=1;
 init_ADyn();
 init_AOption();
 init_ACAST();
 init_ADenotation();
 init_ANat();
 init_AChar();
 init_AInt();
 DEN("unpack\'DynConv: dynamic type tag mismatches:",__ADynConv_8);
 DEN("argument tag: »",__ADynConv_7);
 DEN("« dyn tag: »",__ADynConv_6);
 DEN("«",__ADynConv_5);
 CLS(2,_ADynConv_4,__ADynConv_4);
 CLS(2,_ADynConv_3,__ADynConv_3);
 CLS(2,_ADynConv_2,__ADynConv_2);}

