

#include "BUILTIN.h"
extern OBJ _ADArray_9(OBJ,OBJ);extern OBJ __ADArray_9;
extern OBJ _ADArray_20(OBJ,OBJ);extern OBJ __ADArray_20;
extern OBJ _ADArray_21(OBJ,OBJ);extern OBJ __ADArray_21;
extern OBJ _ADArray_23(OBJ);extern OBJ __ADArray_23;
extern OBJ __ASeq_6;
extern OBJ _ASeq_24(OBJ,OBJ,OBJ);extern OBJ __ASeq_24;
extern OBJ _ASeq_52(OBJ,OBJ);extern OBJ __ASeq_52;

#include "Array.h"

#include "Nat.h"

#include "Char.h"

#include "Bitset.h"
extern OBJ _AArrayConv_3(OBJ);extern OBJ __AArrayConv_3;
extern OBJ _AArrayConv_4(OBJ,OBJ);extern OBJ __AArrayConv_4;
extern OBJ _AArrayConv_5(OBJ,OBJ);extern OBJ __AArrayConv_5;
extern OBJ _ASeqIndex_2(OBJ,OBJ);extern OBJ __ASeqIndex_2;
extern OBJ _AIdentity_2(OBJ);extern OBJ __AIdentity_2;
extern OBJ _ASeqReduce_4(OBJ,OBJ,OBJ);extern OBJ __ASeqReduce_4;
extern OBJ _ADArrayConv_2(OBJ);OBJ __ADArrayConv_2; /* asSeq */
extern OBJ _ADArrayConv_3(OBJ);OBJ __ADArrayConv_3; /* asDArray */
extern OBJ _ADArrayConv_4(OBJ);OBJ __ADArrayConv_4; /* asArray */
extern OBJ _ADArrayConv_5(OBJ);OBJ __ADArrayConv_5; /* asDArray,1 */
extern OBJ _ADArrayConv_6(OBJ,OBJ);OBJ __ADArrayConv_6; /* ` */
extern OBJ _ADArrayConv_7(OBJ,OBJ);OBJ __ADArrayConv_7; /* `,1 */
extern OBJ _ADArrayConv_8(OBJ,OBJ,OBJ);OBJ __ADArrayConv_8; /* asSeq'8 */
extern OBJ _ADArrayConv_9(OBJ,OBJ);OBJ __ADArrayConv_9; /* asDArray'9 */

extern OBJ _ADArrayConv_2(OBJ x1) /* asSeq */
{OBJ r;
 CPPRD(x1,1);
 {OBJ x2;
  x2=_ADArray_23(x1);
  if(ISTGPRM(x2,1)){
   FRPRD(x1,1);
   r=__ASeq_6;
  }else{
   {OBJ x3=FLD1(x1,1);
    CPPRD(x3,1);
    CPCLS(__ADArrayConv_8,1);
    CPCLS(__AIdentity_2,1);
    {OBJ x6;OBJ x7;OBJ x8;OBJ x9;OBJ x10;
     x6=x3;
     AArray_16(x6,x7);
     ANat_4(x7,x8);
     x9=(*(OBJ(*)(OBJ,OBJ))METHOD(__ADArrayConv_8,1))(__ADArrayConv_8,x1);
     x10=_ASeq_24(__ANat_5,x8,__AIdentity_2);
     r=_ASeqReduce_4(x9,__ASeq_6,x10);}}}}
 return r;}

extern OBJ _ADArrayConv_3(OBJ x1) /* asDArray */
{OBJ r;
 CPCLS(__ADArrayConv_9,1);
 COPY(x1,1);
 {OBJ x2;OBJ x3;
  x2=_ASeq_52(x1,__ANat_5);
  x3=(*(OBJ(*)(OBJ,OBJ))METHOD(__ADArrayConv_9,1))(__ADArrayConv_9,x1);
  r=_ADArray_9(x2,x3);}
 return r;}

extern OBJ _ADArrayConv_4(OBJ x1) /* asArray */
{OBJ r;
 CPPRD(x1,1);
 {OBJ x2;
  x2=_ADArray_23(x1);
  if(ISTGPRM(x2,1)){
   FRPRD(x1,1);
   CPPRD(__AArray_5,1);
   r=__AArray_5;
  }else{
   {OBJ x3;
    x3=_ADArrayConv_2(x1);
    r=_AArrayConv_3(x3);}}}
 return r;}

extern OBJ _ADArrayConv_5(OBJ x1) /* asDArray,1 */
{OBJ r;
 CPPRD(x1,1);
 {OBJ x2;
  AArray_17(x1,x2);
  if(ISTGPRM(x2,1)){
   CPPRD(__ABitset_2,1);
   PRD1(3,r);FLD1(r,1)=x1;FLD1(r,2)=__ABitset_2;FLD1(r,3)=__ANat_5;
  }else{
   CPPRD(x1,1);
   CPCLS(__AIdentity_2,1);
   {OBJ x3;OBJ x4;
    AArray_16(x1,x3);
    ANat_4(x3,x4);
    PRD1(3,r);FLD1(r,1)=x1;FLD1(r,3)=x3;
    ABitset_14(__ANat_5,x4,__AIdentity_2,FLD1(r,2));}}}
 return r;}

extern OBJ _ADArrayConv_6(OBJ x1,OBJ x2) /* ` */
{OBJ r;
 {OBJ x3;
  x3=_ADArrayConv_4(x2);
  r=_AArrayConv_4(x1,x3);}
 return r;}

extern OBJ _ADArrayConv_7(OBJ x1,OBJ x2) /* `,1 */
{OBJ r;
 {OBJ x3;
  x3=_ADArrayConv_4(x2);
  r=_AArrayConv_5(x1,x3);}
 return r;}

extern OBJ _ADArrayConv_8(OBJ x1,OBJ x2,OBJ x3) /* asSeq'8 */
{OBJ r;
 CPPRD(x1,1);
 {OBJ x4;
  x4=_ADArray_21(x1,x2);
  if(ISPRM(x4)){
   FRPRD(x1,1);
   r=x3;
  }else{
   if(EXPRD(x4,1)){
    FREE(FLD1(x4,1),1);DSPRDF(x4);
   }else{
    DCPRD(x4,1);}
   {
    PRD1(2,r);FLD1(r,2)=x3;
    FLD1(r,1)=_ADArray_20(x1,x2);}}}
 return r;}

extern OBJ _ADArrayConv_9(OBJ x1,OBJ x2) /* asDArray'9 */
{OBJ r;
 r=_ASeqIndex_2(x1,x2);
 return r;}

init_ADArrayConv()
{
 static int visited=0; if(visited) return; visited=1;
 init_ADArray();
 init_ASeq();
 init_AString();
 init_AArray();
 init_ANat();
 init_AChar();
 init_AOption();
 init_ABitset();
 init_AArrayConv();
 init_ASeqIndex();
 init_AIdentity();
 init_ASeqReduce();
 init_AArrayReduce();
 CLS(2,_ADArrayConv_9,__ADArrayConv_9);
 CLS(3,_ADArrayConv_8,__ADArrayConv_8);
 CLS(2,_ADArrayConv_7,__ADArrayConv_7);
 CLS(2,_ADArrayConv_6,__ADArrayConv_6);
 CLS(1,_ADArrayConv_5,__ADArrayConv_5);
 CLS(1,_ADArrayConv_4,__ADArrayConv_4);
 CLS(1,_ADArrayConv_3,__ADArrayConv_3);
 CLS(1,_ADArrayConv_2,__ADArrayConv_2);}

