

#include "BUILTIN.h"

#include "Nat.h"

#include "Real.h"
extern OBJ __ASeq_6;

#include "Time.h"
OBJ __ATime_Asat; /* sat */
extern OBJ _ATime_Asat_(OBJ);OBJ __ATime_Asat_; /* sat? */
OBJ __ATime_Afri; /* fri */
extern OBJ _ATime_Afri_(OBJ);OBJ __ATime_Afri_; /* fri? */
OBJ __ATime_Athu; /* thu */
extern OBJ _ATime_Athu_(OBJ);OBJ __ATime_Athu_; /* thu? */
OBJ __ATime_Awed; /* wed */
extern OBJ _ATime_Awed_(OBJ);OBJ __ATime_Awed_; /* wed? */
OBJ __ATime_Atue; /* tue */
extern OBJ _ATime_Atue_(OBJ);OBJ __ATime_Atue_; /* tue? */
OBJ __ATime_Amon; /* mon */
extern OBJ _ATime_Amon_(OBJ);OBJ __ATime_Amon_; /* mon? */
OBJ __ATime_Asun; /* sun */
extern OBJ _ATime_Asun_(OBJ);OBJ __ATime_Asun_; /* sun? */
OBJ __ATime_Atime; /* time */
extern OBJ _ATime_Sl(OBJ,OBJ);OBJ __ATime_Sl; /* < */
extern OBJ _ATime_Sle(OBJ,OBJ);OBJ __ATime_Sle; /* <= */
extern OBJ _ATime_Se(OBJ,OBJ);OBJ __ATime_Se; /* = */
extern OBJ _ATime_SSe(OBJ,OBJ);OBJ __ATime_SSe; /* |= */
extern OBJ _ATime_Sge(OBJ,OBJ);OBJ __ATime_Sge; /* >= */
extern OBJ _ATime_Sg(OBJ,OBJ);OBJ __ATime_Sg; /* > */
extern OBJ _ATime_Sm(OBJ,OBJ);OBJ __ATime_Sm; /* - */
extern OBJ _ATime_Sl_O1(OBJ,OBJ);OBJ __ATime_Sl_O1; /* <,1 */
extern OBJ _ATime_Se_O1(OBJ,OBJ);OBJ __ATime_Se_O1; /* =,1 */
extern OBJ _ATime_Asec(OBJ);OBJ __ATime_Asec; /* sec */
extern OBJ _ATime_Amin(OBJ);OBJ __ATime_Amin; /* min */
extern OBJ _ATime_Ahour(OBJ);OBJ __ATime_Ahour; /* hour */
extern OBJ _ATime_Aday(OBJ);OBJ __ATime_Aday; /* day */
extern OBJ _ATime_Amon_O1(OBJ);OBJ __ATime_Amon_O1; /* mon,1 */
extern OBJ _ATime_Ayear(OBJ);OBJ __ATime_Ayear; /* year */
extern OBJ _ATime_Awday(OBJ);OBJ __ATime_Awday; /* wday */
extern OBJ _ATime_Ayday(OBJ);OBJ __ATime_Ayday; /* yday */
extern OBJ _ATime_Adst_(OBJ);OBJ __ATime_Adst_; /* dst? */
extern OBJ _ATime_Atm(OBJ,OBJ,OBJ,OBJ,OBJ,OBJ,OBJ,OBJ,OBJ);OBJ __ATime_Atm; /* tm */
extern OBJ _ATime_Atm_(OBJ);OBJ __ATime_Atm_; /* tm? */
extern OBJ _ATime_Atmdst_(OBJ);OBJ __ATime_Atmdst_; /* tmdst? */
extern OBJ _ATime_Atmyday(OBJ);OBJ __ATime_Atmyday; /* tmyday */
extern OBJ _ATime_Atmwday(OBJ);OBJ __ATime_Atmwday; /* tmwday */
extern OBJ _ATime_Atmyear(OBJ);OBJ __ATime_Atmyear; /* tmyear */
extern OBJ _ATime_Atmmon(OBJ);OBJ __ATime_Atmmon; /* tmmon */
extern OBJ _ATime_Atmday(OBJ);OBJ __ATime_Atmday; /* tmday */
extern OBJ _ATime_Atmhour(OBJ);OBJ __ATime_Atmhour; /* tmhour */
extern OBJ _ATime_Atmmin(OBJ);OBJ __ATime_Atmmin; /* tmmin */
extern OBJ _ATime_Atmsec(OBJ);OBJ __ATime_Atmsec; /* tmsec */
extern OBJ _ATime_Aord(OBJ);OBJ __ATime_Aord; /* ord */
extern OBJ _ATime_Ahc_Atime(OBJ);OBJ __ATime_Ahc_Atime; /* hc_time */
extern OBJ _ATime_Ahc_AasTm(OBJ);OBJ __ATime_Ahc_AasTm; /* hc_asTm */

#include "Time.hc.c"

extern OBJ _ATime_Asat_(OBJ x1) /* sat? */
{OBJ r;
 if(ISTGPRM(x1,6)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Afri_(OBJ x1) /* fri? */
{OBJ r;
 if(ISTGPRM(x1,5)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Athu_(OBJ x1) /* thu? */
{OBJ r;
 if(ISTGPRM(x1,4)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Awed_(OBJ x1) /* wed? */
{OBJ r;
 if(ISTGPRM(x1,3)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Atue_(OBJ x1) /* tue? */
{OBJ r;
 if(ISTGPRM(x1,2)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Amon_(OBJ x1) /* mon? */
{OBJ r;
 if(ISTGPRM(x1,1)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Asun_(OBJ x1) /* sun? */
{OBJ r;
 if(ISTGPRM(x1,0)){
  r=__ABUILTIN_5;
 }else{
  r=__ABUILTIN_3;}
 return r;}

extern OBJ _ATime_Sl_O1(OBJ x1,OBJ x2) /* <,1 */
{OBJ r;
 {OBJ x4;OBJ x3;
  switch(TGPRM(x2)){
   case 5:
    x4=__ANat_12;break;
   case 6:
    x4=__ANat_13;break;
   case 4:
    x4=__ANat_11;break;
   case 1:
    x4=__ANat_8;break;
   case 2:
    x4=__ANat_9;break;
   case 0:
    x4=__ANat_5;break;
   default: 
    x4=__ANat_10;}
  switch(TGPRM(x1)){
   case 5:
    x3=__ANat_12;break;
   case 6:
    x3=__ANat_13;break;
   case 4:
    x3=__ANat_11;break;
   case 1:
    x3=__ANat_8;break;
   case 2:
    x3=__ANat_9;break;
   case 0:
    x3=__ANat_5;break;
   default: 
    x3=__ANat_10;}
  ANat_80(x3,x4,r);}
 return r;}

extern OBJ _ATime_Se_O1(OBJ x1,OBJ x2) /* =,1 */
{OBJ r;
 {OBJ x4;OBJ x3;
  switch(TGPRM(x2)){
   case 5:
    x4=__ANat_12;break;
   case 6:
    x4=__ANat_13;break;
   case 4:
    x4=__ANat_11;break;
   case 1:
    x4=__ANat_8;break;
   case 2:
    x4=__ANat_9;break;
   case 0:
    x4=__ANat_5;break;
   default: 
    x4=__ANat_10;}
  switch(TGPRM(x1)){
   case 5:
    x3=__ANat_12;break;
   case 6:
    x3=__ANat_13;break;
   case 4:
    x3=__ANat_11;break;
   case 1:
    x3=__ANat_8;break;
   case 2:
    x3=__ANat_9;break;
   case 0:
    x3=__ANat_5;break;
   default: 
    x3=__ANat_10;}
  ANat_76(x3,x4,r);}
 return r;}

extern OBJ _ATime_Asec(OBJ x1) /* sec */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x3=FLD1(x2,1);
   if(EXPRD(x2,1)){
    r=x3;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x3;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Amin(OBJ x1) /* min */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x4=FLD1(x2,2);
   if(EXPRD(x2,1)){
    r=x4;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x4;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Ahour(OBJ x1) /* hour */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x5=FLD1(x2,3);
   if(EXPRD(x2,1)){
    r=x5;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x5;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Aday(OBJ x1) /* day */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x6=FLD1(x2,4);
   if(EXPRD(x2,1)){
    r=x6;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x6;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Amon_O1(OBJ x1) /* mon,1 */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x7=FLD1(x2,5);
   if(EXPRD(x2,1)){
    r=x7;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x7;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Ayear(OBJ x1) /* year */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x8=FLD1(x2,6);
   if(EXPRD(x2,1)){
    r=x8;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x8;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Awday(OBJ x1) /* wday */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x9=FLD1(x2,7);
   if(EXPRD(x2,1)){
    r=x9;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x9;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Ayday(OBJ x1) /* yday */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x10=FLD1(x2,8);
   if(EXPRD(x2,1)){
    r=x10;
    FREE(FLD1(x2,9),1);DSPRDF(x2);
   }else{
    r=x10;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Adst_(OBJ x1) /* dst? */
{OBJ r;
 {OBJ x2;
  ATime_Ahc_AasTm(x1,x2);
  {OBJ x11=FLD1(x2,9);
   if(EXPRD(x2,1)){
    r=x11;
    DSPRDF(x2);
   }else{
    COPY(x11,1);
    r=x11;
    FRPRD(x2,1);}}}
 return r;}

extern OBJ _ATime_Atm(OBJ x1,OBJ x2,OBJ x3,OBJ x4,OBJ x5,OBJ x6,OBJ x7,OBJ x8,OBJ x9) /* tm */
{OBJ r;
 PRD1(9,r);FLD1(r,1)=x1;FLD1(r,2)=x2;FLD1(r,3)=x3;FLD1(r,4)=x4;FLD1(r,5)=x5;FLD1(r,6)=x6;FLD1(r,7)=x7;FLD1(r,8)=x8;FLD1(r,9)=x9;
 return r;}

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

extern OBJ _ATime_Atmdst_(OBJ x1) /* tmdst? */
{OBJ r;
 {OBJ x10=FLD1(x1,9);
  if(EXPRD(x1,1)){
   r=x10;
   DSPRDF(x1);
  }else{
   COPY(x10,1);
   r=x10;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmyday(OBJ x1) /* tmyday */
{OBJ r;
 {OBJ x9=FLD1(x1,8);
  if(EXPRD(x1,1)){
   r=x9;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x9;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmwday(OBJ x1) /* tmwday */
{OBJ r;
 {OBJ x8=FLD1(x1,7);
  if(EXPRD(x1,1)){
   r=x8;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x8;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmyear(OBJ x1) /* tmyear */
{OBJ r;
 {OBJ x7=FLD1(x1,6);
  if(EXPRD(x1,1)){
   r=x7;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x7;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmmon(OBJ x1) /* tmmon */
{OBJ r;
 {OBJ x6=FLD1(x1,5);
  if(EXPRD(x1,1)){
   r=x6;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x6;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmday(OBJ x1) /* tmday */
{OBJ r;
 {OBJ x5=FLD1(x1,4);
  if(EXPRD(x1,1)){
   r=x5;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x5;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmhour(OBJ x1) /* tmhour */
{OBJ r;
 {OBJ x4=FLD1(x1,3);
  if(EXPRD(x1,1)){
   r=x4;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x4;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmmin(OBJ x1) /* tmmin */
{OBJ r;
 {OBJ x3=FLD1(x1,2);
  if(EXPRD(x1,1)){
   r=x3;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x3;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Atmsec(OBJ x1) /* tmsec */
{OBJ r;
 {OBJ x2=FLD1(x1,1);
  if(EXPRD(x1,1)){
   r=x2;
   FREE(FLD1(x1,9),1);DSPRDF(x1);
  }else{
   r=x2;
   FRPRD(x1,1);}}
 return r;}

extern OBJ _ATime_Aord(OBJ x1) /* ord */
{OBJ r;
 switch(TGPRM(x1)){
  case 5:
   r=__ANat_12;break;
  case 6:
   r=__ANat_13;break;
  case 4:
   r=__ANat_11;break;
  case 1:
   r=__ANat_8;break;
  case 2:
   r=__ANat_9;break;
  case 0:
   r=__ANat_5;break;
  default: 
   r=__ANat_10;}
 return r;}









static OBJ _mt_9_0_9(OBJ t,OBJ t1,OBJ t2,OBJ t3,OBJ t4,OBJ t5,OBJ t6,OBJ t7,OBJ t8,OBJ t9) 
{OBJ r;
 DCCLS(t,1);
 r=(*(OBJ(*)(OBJ,OBJ,OBJ,OBJ,OBJ,OBJ,OBJ,OBJ,OBJ))ENTRY(t))(t1,t2,t3,t4,t5,t6,t7,t8,t9);
 return r;}

init_ATime()
{
 static int visited=0; if(visited) return; visited=1;
 init_AOption();
 init_ANat();
 init_ACom();
 init_AReal();
 init_AVoid();
 init_ASeq();
 init_ASeqMap();
 CLS(1,_ATime_31,__ATime_31);
 CLS(1,_ATime_30,__ATime_30);
 CLS(1,_ATime_29,__ATime_29);
 CLS(1,_ATime_28,__ATime_28);
 CLS(1,_ATime_27,__ATime_27);
 CLS(2,_ATime_26,__ATime_26);
 CLS(2,_ATime_25,__ATime_25);
 CLS(2,_ATime_24,__ATime_24);
 CLS(2,_ATime_23,__ATime_23);
 CLS(2,_ATime_22,__ATime_22);
 CLS(2,_ATime_21,__ATime_21);
 CLS(2,_ATime_20,__ATime_20);
 CLS(2,_ATime_19,__ATime_19);
 CLS(1,_ATime_83,__ATime_83);
 CLS(2,_ATime_18,__ATime_18);
 CLS(1,_ATime_82,__ATime_82);
 CLS(1,_ATime_81,__ATime_81);
 CLS(1,_ATime_15,__ATime_15);
 CLS(1,_ATime_47,__ATime_47);
 CLS(1,_ATime_46,__ATime_46);
 CLS(1,_ATime_13,__ATime_13);
 CLS(1,_ATime_45,__ATime_45);
 CLS(1,_ATime_44,__ATime_44);
 CLS(1,_ATime_11,__ATime_11);
 CLS(1,_ATime_43,__ATime_43);
 CLS(1,_ATime_42,__ATime_42);
 CLS(1,_ATime_9,__ATime_9);
 CLS(1,_ATime_41,__ATime_41);
 CLS(1,_ATime_40,__ATime_40);
 CLS(1,_ATime_7,__ATime_7);
 CLS(1,_ATime_39,__ATime_39);
 CLS(1,_ATime_38,__ATime_38);
 CLS(1,_ATime_5,__ATime_5);
 CLS(9,_ATime_37,__ATime_37);
 CLS(1,_ATime_3,__ATime_3);
 CLS(1,_ATime_35,__ATime_35);
 CLS(1,_ATime_34,__ATime_34);
 CLS(1,_ATime_33,__ATime_33);
 CLS(1,_ATime_32,__ATime_32);
 MTH(9,0,9,_mt_9_0_9);LZYMTH(9,0,9,_mt_9_0_9);
 init_const_ATime();
 /* __ATime_Asat */
 PRM(6,__ATime_Asat);
 /* __ATime_Afri */
 PRM(5,__ATime_Afri);
 /* __ATime_Athu */
 PRM(4,__ATime_Athu);
 /* __ATime_Awed */
 PRM(3,__ATime_Awed);
 /* __ATime_Atue */
 PRM(2,__ATime_Atue);
 /* __ATime_Amon */
 PRM(1,__ATime_Amon);
 /* __ATime_Asun */
 PRM(0,__ATime_Asun);
 /* __ATime_Atime */
 CPCLS(__ATime_Ahc_Atime,1);
 PRD(2,0,__ATime_Atime);FLD(__ATime_Atime,1)=__ATime_Ahc_Atime;FLD(__ATime_Atime,2)=__ASeq_6;}

