

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ _ACom_4(OBJ);extern OBJ __ACom_4;
extern OBJ _ACom_22(OBJ);extern OBJ __ACom_22;
extern OBJ _ACom_50(OBJ,OBJ);extern OBJ __ACom_50;
extern OBJ __ASeq_6;
extern OBJ _ASeq_26(OBJ,OBJ);extern OBJ __ASeq_26;
extern OBJ _AComCompose_3(OBJ,OBJ);extern OBJ __AComCompose_3;
extern OBJ _AEQUALITY_2(OBJ,OBJ);extern OBJ __AEQUALITY_2;
extern OBJ _ASeqMap_3(OBJ,OBJ);extern OBJ __ASeqMap_3;

#include "ComAgent.h"

#define __AComAgent_AmakeTop_L22 __AComAgent_22
#define _AComAgent_AmakeTop_L22 _AComAgent_22
#define AComAgent_22 AComAgent_AmakeTop_L22
extern OBJ __AComAgent_AmakeTop_L22;
extern OBJ _AComAgent_AmakeTop_L22(OBJ);

#define __AComAgent_AmakeTop_L23 __AComAgent_23
#define _AComAgent_AmakeTop_L23 _AComAgent_23
#define AComAgent_23 AComAgent_AmakeTop_L23
extern OBJ __AComAgent_AmakeTop_L23;
extern OBJ _AComAgent_AmakeTop_L23(OBJ);
extern OBJ _AComAgent_Aagent(OBJ);OBJ __AComAgent_Aagent; /* agent */
extern OBJ _AComAgent_Await(OBJ);OBJ __AComAgent_Await; /* wait */
extern OBJ _AComAgent_Akill(OBJ);OBJ __AComAgent_Akill; /* kill */
extern OBJ _AComAgent_Akilled_(OBJ);OBJ __AComAgent_Akilled_; /* killed? */
OBJ __AComAgent_Aself; /* self */
extern OBJ _AComAgent_AsomeProd(OBJ,OBJ);OBJ __AComAgent_AsomeProd; /* someProd */
extern OBJ _AComAgent_AsomeProd_(OBJ);OBJ __AComAgent_AsomeProd_; /* someProd? */
extern OBJ _AComAgent_As2(OBJ);OBJ __AComAgent_As2; /* s2 */
extern OBJ _AComAgent_As1(OBJ);OBJ __AComAgent_As1; /* s1 */
extern OBJ _AComAgent_AagentProc(OBJ,OBJ);OBJ __AComAgent_AagentProc; /* agentProc */
extern OBJ _AComAgent_AwaitProc(OBJ,OBJ);OBJ __AComAgent_AwaitProc; /* waitProc */
extern OBJ _AComAgent_AkillProc(OBJ,OBJ);OBJ __AComAgent_AkillProc; /* killProc */
extern OBJ _AComAgent_AselfProc(OBJ);OBJ __AComAgent_AselfProc; /* selfProc */
OBJ __AComAgent_AansKilled; /* ansKilled */
extern OBJ _AComAgent_AexecCont(OBJ,OBJ);OBJ __AComAgent_AexecCont; /* execCont */
extern OBJ _AComAgent_AtermProc(OBJ,OBJ);OBJ __AComAgent_AtermProc; /* termProc */
extern OBJ _AComAgent_AactivateClient(OBJ,OBJ);OBJ __AComAgent_AactivateClient; /* activateClient */
extern OBJ _AComAgent_AactivateClientProc(OBJ,OBJ,OBJ);OBJ __AComAgent_AactivateClientProc; /* activateClientProc */
extern OBJ _AComAgent_AmakeTop(OBJ);OBJ __AComAgent_AmakeTop; /* makeTop */
extern OBJ _AComAgent_AmakeTop_L22(OBJ);OBJ __AComAgent_AmakeTop_L22; /* makeTop'22 */
extern OBJ _AComAgent_AmakeTop_L23(OBJ);OBJ __AComAgent_AmakeTop_L23; /* makeTop'23 */
extern OBJ _AComAgent_AmakeTop_L24(OBJ);OBJ __AComAgent_AmakeTop_L24; /* makeTop'24 */

#include "ComAgent.hc.c"

extern OBJ _AComAgent_Aagent(OBJ x1) /* agent */
{OBJ r;
 CPCLS(__AComAgent_AagentProc,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AComAgent_AagentProc,1))(__AComAgent_AagentProc,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AComAgent_Await(OBJ x1) /* wait */
{OBJ r;
 CPCLS(__AComAgent_AwaitProc,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AComAgent_AwaitProc,1))(__AComAgent_AwaitProc,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AComAgent_Akill(OBJ x1) /* kill */
{OBJ r;
 CPCLS(__AComAgent_AkillProc,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AComAgent_AkillProc,1))(__AComAgent_AkillProc,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AComAgent_Akilled_(OBJ x1) /* killed? */
{OBJ r;
 CPPRD(__AComAgent_AansKilled,1);
 r=_AEQUALITY_2(x1,__AComAgent_AansKilled);
 return r;}

extern OBJ _AComAgent_AsomeProd(OBJ x1,OBJ x2) /* someProd */
{OBJ r;
 PRD1F(2,r);FLD1(r,1)=x1;FLD1(r,2)=x2;
 return r;}

extern OBJ _AComAgent_AsomeProd_(OBJ x1) /* someProd? */
{OBJ r;
 FRPRD(x1,1);
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AComAgent_As2(OBJ x1) /* s2 */
{OBJ r;
 {OBJ x3=FLD1(x1,2);
  if(EXPRD(x1,1)){
   r=x3;
   DSPRDF(x1);
  }else{
   r=x3;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _AComAgent_As1(OBJ x1) /* s1 */
{OBJ r;
 {OBJ x2=FLD1(x1,1);
  if(EXPRD(x1,1)){
   r=x2;
   DSPRDF(x1);
  }else{
   r=x2;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _AComAgent_AexecCont(OBJ x1,OBJ x2) /* execCont */
{OBJ r;
 if(ISPRM(x1)){
  CPCLS(__AComAgent_AtermProc,1);
  {OBJ x28;
   x28=(*(OBJ(*)(OBJ,OBJ))METHOD(__AComAgent_AtermProc,1))(__AComAgent_AtermProc,x2);
   PRD(2,0,r);FLD(r,1)=x28;FLD(r,2)=__ASeq_6;}
 }else{
  {OBJ x29=FLD1(x1,1);OBJ x30=FLD1(x1,2);
   if(EXPRD(x1,1)){
    DSPRDF(x1);
   }else{
    CPCLS(x29,1);COPY(x30,1);
    FRPRD(x1,1);}
   CPCLS(__ACom_4,1);
   {OBJ x32;
    x32=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ACom_4,2))(__ACom_4,x29,x2);
    if(ISTGPRD(x32,0)){
     {OBJ x33;OBJ x34=FLD(x32,2);
      if(EXPRD(x32,1)){
       {
	RPRD(x32,r);
	FLD(r,2)=_ASeq_26(x34,x30);}
      }else{
       x33=FLD(x32,1);CPCLS(x33,1);COPY(x34,1);
       {
	FRPRD(x32,1);PRD(2,0,r);FLD(r,1)=x33;
	FLD(r,2)=_ASeq_26(x34,x30);}}}
    }else{
     {OBJ x36=FLD(x32,1);
      if(EXPRD(x32,1)){
       CPCLS(__ACom_50,1);
       {OBJ x37;
	x37=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_50,1))(__ACom_50,x30);
	RPRD(x32,r);
	FLD(r,1)=_ASeqMap_3(x37,x36);}
      }else{
       COPY(x36,1);
       CPCLS(__ACom_50,1);
       {OBJ x37;
	x37=(*(OBJ(*)(OBJ,OBJ))METHOD(__ACom_50,1))(__ACom_50,x30);
	FRPRD(x32,1);PRD(1,1,r);
	FLD(r,1)=_ASeqMap_3(x37,x36);}}}}}}}
 return r;}

extern OBJ _AComAgent_AactivateClient(OBJ x1,OBJ x2) /* activateClient */
{OBJ r;
 CPCLS(__AComAgent_AactivateClientProc,1);
 {OBJ x3;
  x3=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AComAgent_AactivateClientProc,2))(__AComAgent_AactivateClientProc,x1,x2);
  PRD(2,0,r);FLD(r,1)=x3;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AComAgent_AmakeTop(OBJ x1) /* makeTop */
{OBJ r;
 CPCLS(__AComAgent_AmakeTop_L24,1);
 r=_AComCompose_3(x1,__AComAgent_AmakeTop_L24);
 return r;}

extern OBJ _AComAgent_AmakeTop_L22(OBJ x1) /* makeTop'22 */
{OBJ r;
 r=_ACom_22(__ANat_5);
 return r;}

extern OBJ _AComAgent_AmakeTop_L23(OBJ x1) /* makeTop'23 */
{OBJ r;
 r=_ACom_22(__ANat_8);
 return r;}

extern OBJ _AComAgent_AmakeTop_L24(OBJ x1) /* makeTop'24 */
{OBJ r;
 if(ISTGPRD(x1,0)){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  CPCLS(__AComAgent_AmakeTop_L22,1);
  r=(*(OBJ(*)(OBJ,OBJ))METHOD(__AComAgent_AmakeTop_L22,1))(__AComAgent_AmakeTop_L22,__ABUILTIN_20);
 }else{
  if(EXPRD(x1,1)){
   FRPRD(FLD(x1,1),1);DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  CPCLS(__AComAgent_AmakeTop_L23,1);
  r=(*(OBJ(*)(OBJ,OBJ))METHOD(__AComAgent_AmakeTop_L23,1))(__AComAgent_AmakeTop_L23,__ABUILTIN_20);}
 return r;}


init_AComAgent()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_ACom();
 init_AVoid();
 init_ASeq();
 init_AOption();
 init_AComCompose();
 init_AEQUALITY();
 init_ASeqMap();
 CLS(1,_AComAgent_24,__AComAgent_24);
 LCLS(1,_AComAgent_23,__AComAgent_23);
 LCLS(1,_AComAgent_22,__AComAgent_22);
 CLS(1,_AComAgent_21,__AComAgent_21);
 CLS(3,_AComAgent_20,__AComAgent_20);
 CLS(2,_AComAgent_19,__AComAgent_19);
 CLS(2,_AComAgent_18,__AComAgent_18);
 CLS(2,_AComAgent_17,__AComAgent_17);
 CLS(1,_AComAgent_15,__AComAgent_15);
 CLS(2,_AComAgent_14,__AComAgent_14);
 CLS(2,_AComAgent_13,__AComAgent_13);
 CLS(2,_AComAgent_12,__AComAgent_12);
 CLS(1,_AComAgent_11,__AComAgent_11);
 CLS(1,_AComAgent_10,__AComAgent_10);
 CLS(1,_AComAgent_9,__AComAgent_9);
 CLS(2,_AComAgent_8,__AComAgent_8);
 CLS(1,_AComAgent_6,__AComAgent_6);
 CLS(1,_AComAgent_5,__AComAgent_5);
 CLS(1,_AComAgent_4,__AComAgent_4);
 CLS(1,_AComAgent_3,__AComAgent_3);
 init_const_AComAgent();
 /* __AComAgent_Aself */
 CPCLS(__AComAgent_AselfProc,1);
 PRD(2,0,__AComAgent_Aself);FLD(__AComAgent_Aself,1)=__AComAgent_AselfProc;FLD(__AComAgent_Aself,2)=__ASeq_6;}

