

#include "BUILTIN.h"
extern OBJ _AString_4(OBJ);extern OBJ __AString_4;
extern OBJ __AString_6;
extern OBJ _AString_49(OBJ);extern OBJ __AString_49;
extern OBJ _AString_66(OBJ,OBJ);extern OBJ __AString_66;
extern OBJ _AStringFilter_3(OBJ,OBJ);extern OBJ __AStringFilter_3;
extern OBJ _AStringFilter_4(OBJ,OBJ);extern OBJ __AStringFilter_4;
extern TUP2 _AStringFilter_5(OBJ,OBJ);extern OBJ __AStringFilter_5;
extern OBJ _AStringConv_1(OBJ);extern OBJ __AStringConv_1;

#include "Char.h"

#include "Denotation.h"

#include "Nat.h"

#include "Int.h"
extern OBJ _AFileName_1(OBJ);OBJ __AFileName_1; /* baseName */
extern OBJ _AFileName_2(OBJ,OBJ);OBJ __AFileName_2; /* baseName,1 */
extern OBJ _AFileName_3(OBJ);OBJ __AFileName_3; /* dirName */
extern OBJ _AFileName_4(OBJ);OBJ __AFileName_4; /* dirName1 */
extern OBJ _AFileName_5(OBJ);OBJ __AFileName_5; /* normPath */
extern OBJ _AFileName_6(OBJ,OBJ);OBJ __AFileName_6; /* defaultPath */
extern TUP2 _AFileName_7(OBJ,OBJ);OBJ __AFileName_7; /* splitSuffix */
OBJ __AFileName_8; /* baseName'8 */
extern OBJ _AFileName_9(OBJ);OBJ __AFileName_9; /* baseName'9 */
extern OBJ _AFileName_10(OBJ);OBJ __AFileName_10; /* baseName'10 */
OBJ __AFileName_11; /* normPath'11 */
OBJ __AFileName_12; /* normPath'12 */
extern OBJ _AFileName_13(OBJ);OBJ __AFileName_13; /* normPath'13 */
extern OBJ _AFileName_14(OBJ);OBJ __AFileName_14; /* dirName'14 */
extern OBJ _AFileName_15(OBJ);OBJ __AFileName_15; /* dirName'15 */
extern OBJ _AFileName_16(OBJ);OBJ __AFileName_16; /* dirName1'16 */
extern OBJ _AFileName_17(OBJ,OBJ);OBJ __AFileName_17; /* splitSuffix'17 */

extern OBJ _AFileName_1(OBJ x1) /* baseName */
{OBJ r;
 CPCLS(__AFileName_10,1);
 {OBJ x2;OBJ x3;OBJ x4;OBJ x5;
  x2=_AString_49(x1);
  x3=_AString_66(x2,__AString_6);
  x4=_AStringFilter_3(__AFileName_10,x3);
  x5=_AString_66(x4,__AString_6);
  r=_AStringConv_1(x5);}
 return r;}

extern OBJ _AFileName_2(OBJ x1,OBJ x2) /* baseName,1 */
{OBJ r;
 CPCLS(__ABUILTIN_2,1);
 CPPRD(x1,1);
 CPPRD(x2,1);
 {OBJ x3;OBJ x4;OBJ x5;OBJ x6;OBJ x7;OBJ x8;OBJ x9;OBJ x10;
  x3=_AFileName_1(x1);
  CPPRD(x3,1);
  x4=_AString_49(x2);
  x5=_AString_66(x4,__AString_6);
  x6=_AString_49(x3);
  x7=_AStringConv_1(x5);
  x8=_AString_66(x6,__AString_6);
  x9=_AStringConv_1(x8);
  x10=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABUILTIN_2,2))(__ABUILTIN_2,x7,x9);
  if(ISPRM(x10)&&(ISTGPRM(x10,1))){
   FRPRD(x1,1);
   CPPRD(x3,1);
   {OBJ x11;OBJ x12;OBJ x13;OBJ x14;
    ADenotation_15(x2,x11);
    ADenotation_15(x3,x12);
    ANat_62(x12,x11,x13);
    ANat_62(x13,__ANat_8,x14);
    ADenotation_11(x3,__ANat_5,x14,r);}
  }else{
   FRPRD(x2,1);
   FRPRD(x3,1);
   FREE(x10,1);
   r=x1;}}
 return r;}

extern OBJ _AFileName_3(OBJ x1) /* dirName */
{OBJ r;
 CPCLS(__AFileName_15,1);
 {OBJ x2;OBJ x3;OBJ x4;OBJ x5;OBJ x6;
  x2=_AString_49(x1);
  x3=_AString_66(x2,__AString_6);
  x4=_AStringFilter_4(__AFileName_15,x3);
  x5=_AString_66(x4,__AString_6);
  x6=_AStringConv_1(x5);
  r=_AFileName_5(x6);}
 return r;}

extern OBJ _AFileName_4(OBJ x1) /* dirName1 */
{OBJ r;
 {OBJ x2;OBJ x3;OBJ x4;
  x2=_AFileName_3(x1);
  CPPRD(x2,1);
  ADenotation_15(x2,x3);
  ANat_76(x3,__ANat_5,x4);
  if(ISTGPRM(x4,1)){
   FRPRD(x2,1);
   CPPRD(__AFileName_11,1);
   r=__AFileName_11;
  }else{
   CPPRD(x2,1);
   CPCLS(__AFileName_16,1);
   {OBJ x5;OBJ x6;OBJ x7;OBJ x8;
    x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFileName_16,1))(__AFileName_16,__ABUILTIN_20);
    ANat_62(x3,__ANat_8,x6);
    ADenotation_14(x2,x6,x7);
    AChar_15(x7,x5,x8);
    if(ISTGPRM(x8,1)){
     {OBJ x9;
      ANat_62(x3,__ANat_9,x9);
      ADenotation_11(x2,__ANat_5,x9,r);}
    }else{
     r=x2;}}}}
 return r;}

extern OBJ _AFileName_5(OBJ x1) /* normPath */
{OBJ r;
 CPPRD(__AFileName_11,1);
 CPPRD(x1,1);
 {OBJ x2;OBJ x3;
  ADenotation_21(x1,__AFileName_11,x2);
  if(ISTGPRM(x2,1)){
   x3=__ABUILTIN_5;
  }else{
   CPPRD(x1,1);
   CPPRD(__AFileName_12,1);
   ADenotation_21(x1,__AFileName_12,x3);}
  if(ISTGPRM(x3,1)){
   FRPRD(x1,1);
   CPPRD(__AFileName_12,1);
   r=__AFileName_12;
  }else{
   CPPRD(x1,2);
   CPCLS(__AFileName_13,1);
   {OBJ x4;OBJ x5;OBJ x6;OBJ x7;OBJ x8;
    ADenotation_15(x1,x4);
    x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFileName_13,1))(__AFileName_13,__ABUILTIN_20);
    ANat_4(x4,x6);
    ADenotation_14(x1,x6,x7);
    AChar_15(x7,x5,x8);
    if(ISTGPRM(x8,1)){
     r=x1;
    }else{
     CPPRD(__AFileName_8,1);
     ADenotation_4(x1,__AFileName_8,r);}}}}
 return r;}

extern OBJ _AFileName_6(OBJ x1,OBJ x2) /* defaultPath */
{OBJ r;
 CPPRD(__AFileName_8,1);
 CPCLS(__ABUILTIN_2,1);
 CPPRD(x2,1);
 {OBJ x3;
  x3=(*(OBJ(*)(OBJ,OBJ,OBJ))METHOD(__ABUILTIN_2,2))(__ABUILTIN_2,__AFileName_8,x2);
  if(ISPRM(x3)&&(ISTGPRM(x3,1))){
   FRPRD(x1,1);
   r=x2;
  }else{
   FREE(x3,1);
   {OBJ x4;
    x4=_AFileName_5(x1);
    ADenotation_4(x4,x2,r);}}}
 return r;}

extern TUP2 _AFileName_7(OBJ x1,OBJ x2) /* splitSuffix */
{TUP2 r;
 CPCLS(__AFileName_17,1);
 CPPRD(x1,1);
 {OBJ x3;OBJ x4;OBJ x5;TUP2 x7;
  x3=_AString_49(x1);
  x4=_AString_66(x3,__AString_6);
  x5=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFileName_17,1))(__AFileName_17,x2);
  x7=_AStringFilter_5(x5,x4);
  if(ISPRM(x7.c2)){
   FREE(x7.c1,1);
   CPPRD(__AFileName_12,1);
   r.c1=x1;r.c2=__AFileName_12;
  }else{
   FRPRD(x1,1);
   {OBJ x21;OBJ x22;OBJ x24;
    x21=_AString_66(x7.c1,__AString_6);
    x22=_AString_4(x7.c2);
    r.c2=_AStringConv_1(x21);
    x24=_AString_66(x22,__AString_6);
    r.c1=_AStringConv_1(x24);}}}
 return r;}
extern OBJ _AFileName_7_c(OBJ x1,OBJ x2) /* splitSuffix */
{OBJ r;
 {TUP2 t=_AFileName_7(x1,x2);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern OBJ _AFileName_9(OBJ x1) /* baseName'9 */
{OBJ r;
 CPPRD(__AFileName_8,1);
 AChar_32(__AFileName_8,r);
 return r;}

extern OBJ _AFileName_10(OBJ x1) /* baseName'10 */
{OBJ r;
 CPCLS(__AFileName_9,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFileName_9,1))(__AFileName_9,__ABUILTIN_20);
  AChar_19(x1,x2,r);}
 return r;}

extern OBJ _AFileName_13(OBJ x1) /* normPath'13 */
{OBJ r;
 CPPRD(__AFileName_8,1);
 AChar_32(__AFileName_8,r);
 return r;}

extern OBJ _AFileName_14(OBJ x1) /* dirName'14 */
{OBJ r;
 CPPRD(__AFileName_8,1);
 AChar_32(__AFileName_8,r);
 return r;}

extern OBJ _AFileName_15(OBJ x1) /* dirName'15 */
{OBJ r;
 CPCLS(__AFileName_14,1);
 {OBJ x2;
  x2=(*(OBJ(*)(OBJ,OBJ))METHOD(__AFileName_14,1))(__AFileName_14,__ABUILTIN_20);
  AChar_19(x1,x2,r);}
 return r;}

extern OBJ _AFileName_16(OBJ x1) /* dirName1'16 */
{OBJ r;
 CPPRD(__AFileName_8,1);
 AChar_32(__AFileName_8,r);
 return r;}

extern OBJ _AFileName_17(OBJ x1,OBJ x2) /* splitSuffix'17 */
{OBJ r;
 {OBJ x3;
  AChar_32(x1,x3);
  AChar_19(x2,x3,r);}
 return r;}

init_AFileName()
{
 static int visited=0; if(visited) return; visited=1;
 init_AString();
 init_AStringFilter();
 init_AStringConv();
 init_AChar();
 init_ADenotation();
 init_ANat();
 init_ASeq();
 init_AOption();
 init_AStringMapSeq();
 init_AInt();
 CLS(2,_AFileName_17,__AFileName_17);
 LCLS(1,_AFileName_16,__AFileName_16);
 CLS(1,_AFileName_15,__AFileName_15);
 LCLS(1,_AFileName_14,__AFileName_14);
 LCLS(1,_AFileName_13,__AFileName_13);
 DEN("",__AFileName_12);
 DEN(".",__AFileName_11);
 CLS(1,_AFileName_10,__AFileName_10);
 LCLS(1,_AFileName_9,__AFileName_9);
 DEN("/",__AFileName_8);
 CLS(2,_AFileName_7_c,__AFileName_7);
 CLS(2,_AFileName_6,__AFileName_6);
 CLS(1,_AFileName_5,__AFileName_5);
 CLS(1,_AFileName_4,__AFileName_4);
 CLS(1,_AFileName_3,__AFileName_3);
 CLS(2,_AFileName_2,__AFileName_2);
 CLS(1,_AFileName_1,__AFileName_1);}

