

#include "BUILTIN.h"
extern OBJ _AISeq_26(OBJ);extern OBJ __AISeq_26;
extern OBJ _AISeq_27(OBJ);extern OBJ __AISeq_27;
extern OBJ __ASeq_6;

#include "Nat.h"
extern OBJ _ACompose_4(OBJ,OBJ,OBJ);extern OBJ __ACompose_4;
extern OBJ _AISeqFilter_2(OBJ,OBJ);OBJ __AISeqFilter_2; /* | */
extern TUP2 _AISeqFilter_3(OBJ,OBJ);OBJ __AISeqFilter_3; /* partition */
extern OBJ _AISeqFilter_4(OBJ,OBJ);OBJ __AISeqFilter_4; /* take */
extern OBJ _AISeqFilter_5(OBJ,OBJ);OBJ __AISeqFilter_5; /* drop */
extern TUP2 _AISeqFilter_6(OBJ,OBJ);OBJ __AISeqFilter_6; /* split */
extern OBJ _AISeqFilter_7(OBJ,OBJ);OBJ __AISeqFilter_7; /* |'7 */
extern OBJ _AISeqFilter_8(OBJ,OBJ,OBJ);OBJ __AISeqFilter_8; /* |'8 */

extern OBJ _AISeqFilter_2(register OBJ x1,register OBJ x2) /* | */
{OBJ r;
 for(;;){
  CPCLS(__AISeq_27,1);
  CPCLS(x1,1);
  CPPRD(x2,1);
  {OBJ x3;OBJ x4;
   x3=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_27,2))(__AISeq_27,x2,__ABUILTIN_20);
   COPY(x3,1);
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x3);
   if(ISTGPRM(x4,1)){
    CPCLS(__AISeqFilter_7,1);
    CPCLS(__AISeqFilter_8,1);
    {OBJ x5;OBJ x6;
     x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AISeqFilter_7,1))(__AISeqFilter_7,x3);
     x6=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeqFilter_8,2))(__AISeqFilter_8,x1,x2);
     PRD1(2,r);FLD1(r,1)=x5;FLD1(r,2)=x6;}
   }else{
    FREE(x3,1);
    CPCLS(__AISeq_26,1);
    {OBJ x7;
     x7=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_26,2))(__AISeq_26,x2,__ABUILTIN_20);
     x2=x7;continue;}}}
  break;}
 return r;}

extern TUP2 _AISeqFilter_3(OBJ x1,OBJ x2) /* partition */
{TUP2 r;
 CPCLS(__ABUILTIN_7,1);
 CPCLS(__ACompose_4,1);
 CPCLS(x1,1);
 CPPRD(x2,1);
 {OBJ x4;
  r.c1=_AISeqFilter_2(x1,x2);
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ACompose_4,2))(__ACompose_4,__ABUILTIN_7,x1);
  r.c2=_AISeqFilter_2(x4,x2);}
 return r;}
extern OBJ _AISeqFilter_3_c(OBJ x1,OBJ x2) /* partition */
{OBJ r;
 {TUP2 t=_AISeqFilter_3(x1,x2);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _AISeqFilter_4(register OBJ x1,register OBJ x2) /* take */
{OBJ r;OBJ* p1=&r;
 for(;;){
  CPCLS(__AISeq_27,1);
  CPCLS(x1,1);
  CPPRD(x2,1);
  {OBJ x3;OBJ x4;
   x3=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_27,2))(__AISeq_27,x2,__ABUILTIN_20);
   COPY(x3,1);
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x3);
   if(ISTGPRM(x4,1)){
    CPCLS(__AISeq_26,1);
    {OBJ x5;
     x5=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_26,2))(__AISeq_26,x2,__ABUILTIN_20);
     PRD1(2,*p1);FLD1(*p1,1)=x3;
     x2=x5;p1=&FLD1(*p1,2);continue;}
   }else{
    FRCLS(x1,1);
    FRPRD(x2,1);
    FREE(x3,1);
    *p1=__ASeq_6;}}
  break;}
 return r;}

extern OBJ _AISeqFilter_5(register OBJ x1,register OBJ x2) /* drop */
{OBJ r;
 for(;;){
  CPCLS(__AISeq_27,1);
  CPCLS(x1,1);
  CPPRD(x2,1);
  {OBJ x3;OBJ x4;
   x3=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_27,2))(__AISeq_27,x2,__ABUILTIN_20);
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x3);
   if(ISTGPRM(x4,1)){
    CPCLS(__AISeq_26,1);
    {OBJ x5;
     x5=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_26,2))(__AISeq_26,x2,__ABUILTIN_20);
     x2=x5;continue;}
   }else{
    FRCLS(x1,1);
    r=x2;}}
  break;}
 return r;}

extern TUP2 _AISeqFilter_6(register OBJ x1,register OBJ x2) /* split */
{TUP2 r;OBJ* p1=&r.c1;OBJ* p2=&r.c2;
 for(;;){
  CPCLS(__AISeq_27,1);
  CPCLS(x1,1);
  CPPRD(x2,1);
  {OBJ x3;OBJ x4;
   x3=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_27,2))(__AISeq_27,x2,__ABUILTIN_20);
   COPY(x3,1);
   x4=(*(OBJ(*)(OBJ,OBJ))METHOD(x1,1))(x1,x3);
   if(ISTGPRM(x4,1)){
    CPCLS(__AISeq_26,1);
    {OBJ x11;
     x11=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_26,2))(__AISeq_26,x2,__ABUILTIN_20);
     PRD1(2,*p1);FLD1(*p1,1)=x3;
     x2=x11;p1=&FLD1(*p1,2);continue;}
   }else{
    FRCLS(x1,1);
    FREE(x3,1);
    *p1=__ASeq_6;*p2=x2;}}
  break;}
 return r;}
extern OBJ _AISeqFilter_6_c(OBJ x1,OBJ x2) /* split */
{OBJ r;
 {TUP2 t=_AISeqFilter_6(x1,x2);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _AISeqFilter_7(OBJ x1,OBJ x2) /* |'7 */
{OBJ r;
 r=x1;
 return r;}

extern OBJ _AISeqFilter_8(OBJ x1,OBJ x2,OBJ x3) /* |'8 */
{OBJ r;
 CPCLS(__AISeq_26,1);
 {OBJ x4;
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AISeq_26,2))(__AISeq_26,x2,__ABUILTIN_20);
  r=_AISeqFilter_2(x1,x4);}
 return r;}

init_AISeqFilter()
{
 static int visited=0; if(visited) return; visited=1;
 init_AISeq();
 init_ASeq();
 init_ANat();
 init_AOption();
 init_ACompose();
 LCLS(3,_AISeqFilter_8,__AISeqFilter_8);
 LCLS(2,_AISeqFilter_7,__AISeqFilter_7);
 CLS(2,_AISeqFilter_6_c,__AISeqFilter_6);
 CLS(2,_AISeqFilter_5,__AISeqFilter_5);
 CLS(2,_AISeqFilter_4,__AISeqFilter_4);
 CLS(2,_AISeqFilter_3_c,__AISeqFilter_3);
 CLS(2,_AISeqFilter_2,__AISeqFilter_2);}

