

#include "BUILTIN.h"

#include "Nat.h"

#include "Real.h"
extern OBJ __ASeq_6;

#include "Denotation.h"

#include "Char.h"

#include "Array.h"

#include "Wait.h"
OBJ __AWait_AstoppedUnknown; /* stoppedUnknown */
extern OBJ _AWait_AstoppedUnknown_(OBJ);OBJ __AWait_AstoppedUnknown_; /* stoppedUnknown? */
extern OBJ _AWait_Astopped(OBJ);OBJ __AWait_Astopped; /* stopped */
extern OBJ _AWait_Astopped_(OBJ);OBJ __AWait_Astopped_; /* stopped? */
extern OBJ _AWait_Asignal(OBJ);OBJ __AWait_Asignal; /* signal */
OBJ __AWait_AsignalledUnknown; /* signalledUnknown */
extern OBJ _AWait_AsignalledUnknown_(OBJ);OBJ __AWait_AsignalledUnknown_; /* signalledUnknown? */
extern OBJ _AWait_Asignalled(OBJ);OBJ __AWait_Asignalled; /* signalled */
extern OBJ _AWait_Asignalled_(OBJ);OBJ __AWait_Asignalled_; /* signalled? */
extern OBJ _AWait_Aexited(OBJ);OBJ __AWait_Aexited; /* exited */
extern OBJ _AWait_Aexited_(OBJ);OBJ __AWait_Aexited_; /* exited? */
extern OBJ _AWait_Astatus(OBJ);OBJ __AWait_Astatus; /* status */
OBJ __AWait_Await; /* wait */
OBJ __AWait_Await_O1; /* wait,1 */
extern OBJ _AWait_Await_O2(OBJ);OBJ __AWait_Await_O2; /* wait,2 */
extern OBJ _AWait_Await_O3(OBJ);OBJ __AWait_Await_O3; /* wait,3 */
OBJ __AWait_AwaitGrp; /* waitGrp */
OBJ __AWait_AwaitGrp_O1; /* waitGrp,1 */
extern OBJ _AWait_AwaitGrp_O2(OBJ);OBJ __AWait_AwaitGrp_O2; /* waitGrp,2 */
extern OBJ _AWait_AwaitGrp_O3(OBJ);OBJ __AWait_AwaitGrp_O3; /* waitGrp,3 */
extern OBJ _AWait_Ahc_Awaitpid_Aany(OBJ);OBJ __AWait_Ahc_Awaitpid_Aany; /* hc_waitpid_any */
extern OBJ _AWait_Ahc_Awaitpid_Aany_Anb(OBJ);OBJ __AWait_Ahc_Awaitpid_Aany_Anb; /* hc_waitpid_any_nb */
extern OBJ _AWait_Ahc_Awaitpid(OBJ,OBJ);OBJ __AWait_Ahc_Awaitpid; /* hc_waitpid */
extern OBJ _AWait_Ahc_Awaitpid_Anb(OBJ,OBJ);OBJ __AWait_Ahc_Awaitpid_Anb; /* hc_waitpid_nb */
extern OBJ _AWait_Ahc_Awaitgrp_Aany(OBJ);OBJ __AWait_Ahc_Awaitgrp_Aany; /* hc_waitgrp_any */
extern OBJ _AWait_Ahc_Awaitgrp_Aany_Anb(OBJ);OBJ __AWait_Ahc_Awaitgrp_Aany_Anb; /* hc_waitgrp_any_nb */
extern OBJ _AWait_Ahc_Awaitgrp(OBJ,OBJ);OBJ __AWait_Ahc_Awaitgrp; /* hc_waitgrp */
extern OBJ _AWait_Ahc_Awaitgrp_Anb(OBJ,OBJ);OBJ __AWait_Ahc_Awaitgrp_Anb; /* hc_waitgrp_nb */

#include "Wait.hc.c"

extern OBJ _AWait_AstoppedUnknown_(OBJ x1) /* stoppedUnknown? */
{OBJ r;
 if(ISPRM(x1)&&(ISTGPRM(x1,4))){
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AWait_Astopped(OBJ x1) /* stopped */
{OBJ r;
 PRDF(1,3,r);FLD(r,1)=x1;
 return r;}

extern OBJ _AWait_Astopped_(OBJ x1) /* stopped? */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,3))){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AWait_Asignal(OBJ x1) /* signal */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,3)||ISTGPRD(x1,1))){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRD(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("Wait at <unknown> : undefined selection signal\'Wait:childstat->signal");}
 return r;}

extern OBJ _AWait_AsignalledUnknown_(OBJ x1) /* signalledUnknown? */
{OBJ r;
 if(ISPRM(x1)&&(ISTGPRM(x1,2))){
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AWait_Asignalled(OBJ x1) /* signalled */
{OBJ r;
 PRDF(1,1,r);FLD(r,1)=x1;
 return r;}

extern OBJ _AWait_Asignalled_(OBJ x1) /* signalled? */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,1))){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AWait_Aexited(OBJ x1) /* exited */
{OBJ r;
 PRDF(1,0,r);FLD(r,1)=x1;
 return r;}

extern OBJ _AWait_Aexited_(OBJ x1) /* exited? */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,0))){
  if(EXPRD(x1,1)){
   DSPRDF(x1);
  }else{
   DCPRD(x1,1);}
  r=__ABUILTIN_5;
 }else{
  FREE(x1,1);
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _AWait_Astatus(OBJ x1) /* status */
{OBJ r;
 if(ISPRD(x1)&&(ISTGPRD(x1,0))){
  {OBJ x2=FLD(x1,1);
   if(EXPRD(x1,1)){
    r=x2;
    DSPRDF(x1);
   }else{
    r=x2;
    FRPRD(x1,1);}}
 }else{
  HLT("Wait at <unknown> : undefined selection status\'Wait:childstat->procstat");}
 return r;}

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

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

extern OBJ _AWait_AwaitGrp_O2(OBJ x1) /* waitGrp,2 */
{OBJ r;
 CPCLS(__AWait_Ahc_Awaitgrp,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AWait_Ahc_Awaitgrp,1))(__AWait_Ahc_Awaitgrp,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

extern OBJ _AWait_AwaitGrp_O3(OBJ x1) /* waitGrp,3 */
{OBJ r;
 CPCLS(__AWait_Ahc_Awaitgrp_Anb,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AWait_Ahc_Awaitgrp_Anb,1))(__AWait_Ahc_Awaitgrp_Anb,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}







init_AWait()
{
 static int visited=0; if(visited) return; visited=1;
 init_APair();
 init_AOption();
 init_ACom();
 init_AProcessCtrl();
 init_ASignal();
 init_AVoid();
 init_ANat();
 init_AReal();
 init_AQuadruple();
 init_ASeq();
 init_AFileSystem();
 init_AUserAndGroup();
 init_ADenotation();
 init_ASet();
 init_AChar();
 init_AString();
 init_ATime();
 init_ASeqMap();
 init_AArray();
 CLS(1,_AWait_22,__AWait_22);
 CLS(1,_AWait_21,__AWait_21);
 CLS(2,_AWait_51,__AWait_51);
 CLS(1,_AWait_18,__AWait_18);
 CLS(2,_AWait_50,__AWait_50);
 CLS(1,_AWait_17,__AWait_17);
 CLS(1,_AWait_49,__AWait_49);
 CLS(1,_AWait_48,__AWait_48);
 CLS(2,_AWait_47,__AWait_47);
 CLS(1,_AWait_14,__AWait_14);
 CLS(2,_AWait_46,__AWait_46);
 CLS(1,_AWait_13,__AWait_13);
 CLS(1,_AWait_45,__AWait_45);
 CLS(1,_AWait_12,__AWait_12);
 CLS(1,_AWait_44,__AWait_44);
 CLS(1,_AWait_10,__AWait_10);
 CLS(1,_AWait_9,__AWait_9);
 CLS(1,_AWait_8,__AWait_8);
 CLS(1,_AWait_6,__AWait_6);
 CLS(1,_AWait_5,__AWait_5);
 CLS(1,_AWait_4,__AWait_4);
 CLS(1,_AWait_3,__AWait_3);
 init_const_AWait();
 /* __AWait_AstoppedUnknown */
 PRM(4,__AWait_AstoppedUnknown);
 /* __AWait_AsignalledUnknown */
 PRM(2,__AWait_AsignalledUnknown);
 /* __AWait_Await */
 CPCLS(__AWait_Ahc_Awaitpid_Aany,1);
 PRD(2,0,__AWait_Await);FLD(__AWait_Await,1)=__AWait_Ahc_Awaitpid_Aany;FLD(__AWait_Await,2)=__ASeq_6;
 /* __AWait_Await_O1 */
 CPCLS(__AWait_Ahc_Awaitpid_Aany_Anb,1);
 PRD(2,0,__AWait_Await_O1);FLD(__AWait_Await_O1,1)=__AWait_Ahc_Awaitpid_Aany_Anb;FLD(__AWait_Await_O1,2)=__ASeq_6;
 /* __AWait_AwaitGrp */
 CPCLS(__AWait_Ahc_Awaitgrp_Aany,1);
 PRD(2,0,__AWait_AwaitGrp);FLD(__AWait_AwaitGrp,1)=__AWait_Ahc_Awaitgrp_Aany;FLD(__AWait_AwaitGrp,2)=__ASeq_6;
 /* __AWait_AwaitGrp_O1 */
 CPCLS(__AWait_Ahc_Awaitgrp_Aany_Anb,1);
 PRD(2,0,__AWait_AwaitGrp_O1);FLD(__AWait_AwaitGrp_O1,1)=__AWait_Ahc_Awaitgrp_Aany_Anb;FLD(__AWait_AwaitGrp_O1,2)=__ASeq_6;}

