

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ __AVoid_2;
extern OBJ _AString_39(OBJ);extern OBJ __AString_39;
extern OBJ _AString_49(OBJ);extern OBJ __AString_49;
extern OBJ __ASeq_6;
extern OBJ _ASeq_52(OBJ,OBJ);extern OBJ __ASeq_52;

#include "Char.h"

#include "Int.h"

#include "NatConv.h"

#include "Denotation.h"
extern OBJ _AStringIndex_1(OBJ,OBJ);extern OBJ __AStringIndex_1;
extern OBJ _ASeqIndex_2(OBJ,OBJ);extern OBJ __ASeqIndex_2;

#include "Array.h"
extern OBJ _AOptionMap_3(OBJ,OBJ);extern OBJ __AOptionMap_3;

#include "Real.h"

#include "Process.h"

#define __AProcess_Aarg_L27 __AProcess_27
#define _AProcess_Aarg_L27 _AProcess_27
#define AProcess_27 AProcess_Aarg_L27
extern OBJ __AProcess_Aarg_L27;
extern OBJ _AProcess_Aarg_L27(OBJ);

#define __AProcess_Aarg_L28 __AProcess_28
#define _AProcess_Aarg_L28 _AProcess_28
#define AProcess_28 AProcess_Aarg_L28
extern OBJ __AProcess_Aarg_L28;
extern OBJ _AProcess_Aarg_L28(OBJ,OBJ,OBJ);

#define __AProcess_Aargv_L29 __AProcess_29
extern OBJ __AProcess_Aargv_L29;

#define __AProcess_Aargv_L30 __AProcess_30
#define _AProcess_Aargv_L30 _AProcess_30
#define AProcess_30 AProcess_Aargv_L30
extern OBJ __AProcess_Aargv_L30;
extern OBJ _AProcess_Aargv_L30(OBJ,OBJ,OBJ);

#define __AProcess_Await_L31 __AProcess_31
#define _AProcess_Await_L31 _AProcess_31
#define AProcess_31 AProcess_Await_L31
extern OBJ __AProcess_Await_L31;
extern OBJ _AProcess_Await_L31(OBJ);
OBJ __AProcess_Aself; /* self */
extern OBJ _AProcess_Aself_(OBJ);OBJ __AProcess_Aself_; /* self? */
OBJ __AProcess_Afork; /* fork */
extern OBJ _AProcess_Aexecve(OBJ,OBJ,OBJ);OBJ __AProcess_Aexecve; /* execve */
extern OBJ _AProcess_Akill(OBJ,OBJ);OBJ __AProcess_Akill; /* kill */
OBJ __AProcess_Await; /* wait */
extern OBJ _AProcess_Apopen(OBJ,OBJ);OBJ __AProcess_Apopen; /* popen */
extern OBJ _AProcess_Apclose(OBJ);OBJ __AProcess_Apclose; /* pclose */
extern OBJ _AProcess_Apair(OBJ,OBJ);OBJ __AProcess_Apair; /* pair */
extern OBJ _AProcess_Apair_(OBJ);OBJ __AProcess_Apair_; /* pair? */
extern OBJ _AProcess_A2nd(OBJ);OBJ __AProcess_A2nd; /* 2nd */
extern OBJ _AProcess_A1st(OBJ);OBJ __AProcess_A1st; /* 1st */
OBJ __AProcess_Aprimitive; /* primitive */
extern OBJ _AProcess_Aprimitive_(OBJ);OBJ __AProcess_Aprimitive_; /* primitive? */
extern OBJ _AProcess_Axfork(OBJ);OBJ __AProcess_Axfork; /* xfork */
extern OBJ _AProcess_Axexecve(OBJ,OBJ,OBJ,OBJ);OBJ __AProcess_Axexecve; /* xexecve */
extern OBJ _AProcess_Axkill(OBJ,OBJ,OBJ);OBJ __AProcess_Axkill; /* xkill */
extern OBJ _AProcess_Axwait(OBJ);OBJ __AProcess_Axwait; /* xwait */
extern OBJ _AProcess_Axpopen(OBJ,OBJ,OBJ);OBJ __AProcess_Axpopen; /* xpopen */
extern OBJ _AProcess_Axpclose(OBJ,OBJ);OBJ __AProcess_Axpclose; /* xpclose */
extern OBJ _AProcess_Aargv(OBJ);OBJ __AProcess_Aargv; /* argv */
extern OBJ _AProcess_Aarg(OBJ);OBJ __AProcess_Aarg; /* arg */
extern OBJ _AProcess_Aarg_L27(OBJ);OBJ __AProcess_Aarg_L27; /* arg'27 */
extern OBJ _AProcess_Aarg_L28(OBJ,OBJ,OBJ);OBJ __AProcess_Aarg_L28; /* arg'28 */
OBJ __AProcess_Aargv_L29; /* argv'29 */
extern OBJ _AProcess_Aargv_L30(OBJ,OBJ,OBJ);OBJ __AProcess_Aargv_L30; /* argv'30 */
extern OBJ _AProcess_Await_L31(OBJ);OBJ __AProcess_Await_L31; /* wait'31 */

#include "Process.hc.c"

extern OBJ _AProcess_Aexecve(OBJ x1,OBJ x2,OBJ x3) /* execve */
{OBJ r;
 CPCLS(__AProcess_Axexecve,1);
 CPCLS(__AProcess_Aargv,1);
 CPPRD(x1,1);
 {OBJ x4;OBJ x5;OBJ x6;OBJ x7;OBJ x8;
  x4=_AString_49(x1);
  x5=_AOptionMap_3(__AProcess_Aargv,x3);
  PRD1(2,x6);FLD1(x6,1)=x4;FLD1(x6,2)=x2;
  AProcess_Aargv(x6,x7);
  x8=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ))METHOD(__AProcess_Axexecve,3))(__AProcess_Axexecve,x1,x7,x5);
  PRD(2,0,r);FLD(r,1)=x8;FLD(r,2)=__ASeq_6;}
 return r;}

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

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

extern OBJ _AProcess_Apclose(OBJ x1) /* pclose */
{OBJ r;
 CPCLS(__AProcess_Axpclose,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcess_Axpclose,1))(__AProcess_Axpclose,x1);
  PRD(2,0,r);FLD(r,1)=x2;FLD(r,2)=__ASeq_6;}
 return r;}

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

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

extern OBJ _AProcess_A2nd(OBJ x1) /* 2nd */
{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 _AProcess_A1st(OBJ x1) /* 1st */
{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 _AProcess_Aprimitive_(OBJ x1) /* primitive? */
{OBJ r;
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AProcess_Aargv(OBJ x1) /* argv */
{OBJ r;
 CPCLS(__AProcess_Aargv_L30,1);
 COPY(x1,1);
 {OBJ x2;OBJ x3;OBJ x4;
  x2=_ASeq_52(x1,__ANat_5);
  ANat_61(x2,__ANat_8,x3);
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AProcess_Aargv_L30,2))(__AProcess_Aargv_L30,x1,x2);
  AArray_4(x3,x4,r);}
 return r;}

extern OBJ _AProcess_Aarg(OBJ x1) /* arg */
{OBJ r;
 CPCLS(__AProcess_Aarg_L28,1);
 COPY(x1,1);
 {OBJ x2;OBJ x3;OBJ x4;
  x2=_AString_39(x1);
  ANat_61(x2,__ANat_8,x3);
  x4=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__AProcess_Aarg_L28,2))(__AProcess_Aarg_L28,x1,x2);
  ADenotation_2(x3,x4,r);}
 return r;}

extern OBJ _AProcess_Aarg_L27(OBJ x1) /* arg'27 */
{OBJ r;
 ANatConv_2(__ANat_5,r);
 return r;}

extern OBJ _AProcess_Aarg_L28(OBJ x1,OBJ x2,OBJ x3) /* arg'28 */
{OBJ r;
 {OBJ x4;
  ANat_76(x3,x2,x4);
  if(ISTGPRM(x4,1)){
   FREE(x1,1);
   CPCLS(__AProcess_Aarg_L27,1);
   r=(*(OBJ(*)(OBJ,OBJ))METHOD(__AProcess_Aarg_L27,1))(__AProcess_Aarg_L27,__ABUILTIN_20);
  }else{
   r=_AStringIndex_1(x1,x3);}}
 return r;}

extern OBJ _AProcess_Aargv_L30(OBJ x1,OBJ x2,OBJ x3) /* argv'30 */
{OBJ r;
 {OBJ x4;
  ANat_76(x3,x2,x4);
  if(ISTGPRM(x4,1)){
   FREE(x1,1);
   CPPRD(__AProcess_Aargv_L29,1);
   r=__AProcess_Aargv_L29;
  }else{
   {OBJ x5;
    x5=_ASeqIndex_2(x1,x3);
    AProcess_Aarg(x5,r);}}}
 return r;}

extern OBJ _AProcess_Await_L31(OBJ x1) /* wait'31 */
{OBJ r;
 {OBJ x2;
  AProcess_Axwait(__AVoid_2,x2);
  if(ISTGPRD(x2,0)){
   {OBJ x24=FLD(x2,1);FLAG x_x2=EXPRD(x2,1);
    if(x_x2){
    }else{
     CPPRD(x24,1);}
    {OBJ x25;OBJ x26;FLAG x_x24=EXPRD(x24,1);
     if(x_x24){
     }else{
      x25=FLD1(x24,1);x26=FLD1(x24,2);}
     {OBJ x27;
      if(x_x24){
       RSOME(x24,x27);
      }else{
       FRPRD(x24,1);PRD1F(2,x27);FLD1(x27,1)=x25;FLD1(x27,2)=x26;}
      if(x_x2){
       RPRD(x2,r);FLD(r,1)=x27;
      }else{
       FRPRD(x2,1);PRD(1,0,r);FLD(r,1)=x27;}}}}
  }else{
   {OBJ x28;
    if(EXPRD(x2,1)){
     RPRD(x2,r);
    }else{
     x28=FLD(x2,1);CPPRD(x28,1);
     FRPRD(x2,1);PRD(1,1,r);FLD(r,1)=x28;}}}}
 return r;}




init_AProcess()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_AVoid();
 init_AString();
 init_ASeq();
 init_AOption();
 init_APair();
 init_ACom();
 init_AFile();
 init_AChar();
 init_AInt();
 init_ANatConv();
 init_ADenotation();
 init_AStringIndex();
 init_ASeqIndex();
 init_AArray();
 init_AOptionMap();
 init_AReal();
 init_ASeqMap();
 CLS(1,_AProcess_31,__AProcess_31);
 CLS(3,_AProcess_30,__AProcess_30);
 DEN("",__AProcess_29);
 CLS(3,_AProcess_28,__AProcess_28);
 LCLS(1,_AProcess_27,__AProcess_27);
 CLS(1,_AProcess_26,__AProcess_26);
 CLS(1,_AProcess_25,__AProcess_25);
 CLS(2,_AProcess_24,__AProcess_24);
 CLS(3,_AProcess_23,__AProcess_23);
 CLS(1,_AProcess_22,__AProcess_22);
 CLS(3,_AProcess_21,__AProcess_21);
 CLS(4,_AProcess_20,__AProcess_20);
 CLS(1,_AProcess_19,__AProcess_19);
 CLS(1,_AProcess_16,__AProcess_16);
 CLS(1,_AProcess_14,__AProcess_14);
 CLS(1,_AProcess_13,__AProcess_13);
 CLS(1,_AProcess_12,__AProcess_12);
 CLS(2,_AProcess_11,__AProcess_11);
 CLS(1,_AProcess_9,__AProcess_9);
 CLS(2,_AProcess_8,__AProcess_8);
 CLS(2,_AProcess_6,__AProcess_6);
 CLS(3,_AProcess_5,__AProcess_5);
 CLS(1,_AProcess_3,__AProcess_3);
 init_const_AProcess();
 /* __AProcess_Afork */
 CPCLS(__AProcess_Axfork,1);
 PRD(2,0,__AProcess_Afork);FLD(__AProcess_Afork,1)=__AProcess_Axfork;FLD(__AProcess_Afork,2)=__ASeq_6;
 /* __AProcess_Await */
 CPCLS(__AProcess_Await_L31,1);
 PRD(2,0,__AProcess_Await);FLD(__AProcess_Await,1)=__AProcess_Await_L31;FLD(__AProcess_Await,2)=__ASeq_6;
 /* __AProcess_Aprimitive */
 PRM1(__AProcess_Aprimitive);}

