

#include "BUILTIN.h"

#include "Nat.h"

#include "Bitset.h"

#include "Array.h"
extern OBJ _AArrayReduce_5(OBJ,OBJ,OBJ);extern OBJ __AArrayReduce_5;

#include "Char.h"
extern OBJ _ADArrayReduce_3(OBJ,OBJ,OBJ);OBJ __ADArrayReduce_3; /* / */
extern OBJ _ADArrayReduce_4(OBJ,OBJ,OBJ);OBJ __ADArrayReduce_4; /* \ */
extern OBJ _ADArrayReduce_5(OBJ,OBJ,OBJ);OBJ __ADArrayReduce_5; /* /,1 */
extern OBJ _ADArrayReduce_6(OBJ,OBJ,OBJ);OBJ __ADArrayReduce_6; /* \,1 */
extern OBJ _ADArrayReduce_7(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __ADArrayReduce_7; /* lift */
extern OBJ _ADArrayReduce_8(OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __ADArrayReduce_8; /* lift,1 */

extern OBJ _ADArrayReduce_3(OBJ x1,OBJ x2,OBJ x3) /* / */
{OBJ r;
 {OBJ x13=FLD1(x3,1);OBJ x14=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   CPPRD(x13,1);CPPRD(x14,1);
   FRPRD(x3,1);}
  CPCLS(__ADArrayReduce_7,1);
  {OBJ x16;
   x16=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ADArrayReduce_7,2))(__ADArrayReduce_7,x1,x14);
   r=_AArrayReduce_5(x16,x2,x13);}}
 return r;}

extern OBJ _ADArrayReduce_4(OBJ x1,OBJ x2,OBJ x3) /* \ */
{OBJ r;
 {OBJ x13=FLD1(x3,1);OBJ x14=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   CPPRD(x13,1);CPPRD(x14,1);
   FRPRD(x3,1);}
  CPCLS(__ADArrayReduce_7,1);
  {OBJ x16;
   x16=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ADArrayReduce_7,2))(__ADArrayReduce_7,x1,x14);
   r=_AArrayReduce_5(x16,x2,x13);}}
 return r;}

extern OBJ _ADArrayReduce_5(OBJ x1,OBJ x2,OBJ x3) /* /,1 */
{OBJ r;
 {OBJ x13=FLD1(x3,1);OBJ x14=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   CPPRD(x13,1);CPPRD(x14,1);
   FRPRD(x3,1);}
  CPCLS(__ADArrayReduce_8,1);
  {OBJ x16;
   x16=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ADArrayReduce_8,2))(__ADArrayReduce_8,x1,x14);
   r=_AArrayReduce_5(x16,x2,x13);}}
 return r;}

extern OBJ _ADArrayReduce_6(OBJ x1,OBJ x2,OBJ x3) /* \,1 */
{OBJ r;
 {OBJ x13=FLD1(x3,1);OBJ x14=FLD1(x3,2);
  if(EXPRD(x3,1)){
   DSPRDF(x3);
  }else{
   CPPRD(x13,1);CPPRD(x14,1);
   FRPRD(x3,1);}
  CPCLS(__ADArrayReduce_8,1);
  {OBJ x16;
   x16=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ADArrayReduce_8,2))(__ADArrayReduce_8,x1,x14);
   r=_AArrayReduce_5(x16,x2,x13);}}
 return r;}

extern OBJ _ADArrayReduce_7(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* lift */
{OBJ r;
 {OBJ x6;
  ABitset_21(x3,x2,x6);
  if(ISTGPRM(x6,1)){
   r=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(x1,2))(x1,x4,x5);
  }else{
   FRCLS(x1,1);
   FREE(x4,1);
   r=x5;}}
 return r;}

extern OBJ _ADArrayReduce_8(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5) /* lift,1 */
{OBJ r;
 {OBJ x6;
  ABitset_21(x3,x2,x6);
  if(ISTGPRM(x6,1)){
   r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(x1,3))(x1,x3,x4,x5);
  }else{
   FRCLS(x1,1);
   FREE(x4,1);
   r=x5;}}
 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_ADArrayReduce()
{
 static int visited=0; if(visited) return; visited=1;
 init_ADArray();
 init_ANat();
 init_AOption();
 init_ABitset();
 init_AArray();
 init_ADArrayConv();
 init_AArrayReduce();
 init_ASeq();
 init_AString();
 init_AChar();
 CLS(5,_ADArrayReduce_8,__ADArrayReduce_8);
 CLS(5,_ADArrayReduce_7,__ADArrayReduce_7);
 CLS(3,_ADArrayReduce_6,__ADArrayReduce_6);
 CLS(3,_ADArrayReduce_5,__ADArrayReduce_5);
 CLS(3,_ADArrayReduce_4,__ADArrayReduce_4);
 CLS(3,_ADArrayReduce_3,__ADArrayReduce_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);}

