home *** CD-ROM | disk | FTP | other *** search
- /* ANSI C code generated by SmallEiffel. */
- /*
- -- SmallEiffel -- Release (- 0.84) -- FRANCE
- -- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN
- -- University Henri Poincare' - Nancy 1 - email colnet@loria.fr
- -- CRIN (Centre de Recherche en Informatique de Nancy)
- -- FRANCE
- */
- #include "example1.h"
- char tag_pos_1[]="assignment";
- char tag_pos_2[]="boolean exp.";
- char tag_pos_3[]="instruction";
- char tag_pos_4[]="assertion";
- char tag_pos_5[]="creation call";
- char tag_pos_6[]="variant exp.";
- char Current[]="Current";
- char Result[]="Result";
- double*rs_bot;
- double*rs;
- double*rs_lb;
- double*rs_top;
- void se_rsg(int sz){
- if(rs+sz<rs_top)return;
- {int osz=(rs_top-rs_bot+1);
- int nsz;
- double*nrs_bot;
- int msz=262144;
- nsz=osz*2;
- nrs_bot=(void*)malloc(nsz*sizeof(double));
- if((osz>msz)||(nrs_bot==NULL)){
- printf("Stack Overflow (limit = %d).\n",msz);
- rsp();if(!se_rspf)exit(0);}
- ((void)memcpy(nrs_bot,rs_bot,osz*sizeof(double)));
- rs_lb=nrs_bot+(rs_lb-rs_bot);
- rs=nrs_bot+(rs-rs_bot);
- rs_top=nrs_bot+(nsz-1);
- free(rs_bot);
- rs_bot=nrs_bot;
- return;}}
- void rs_link(char*tag){
- se_rsg(1024);
- *((int*)rs++)=LINKid;
- *((int*)rs)=(rs-rs_lb);
- rs_lb=rs++;
- *((int*)rs++)=FTAGid;
- *((char**)rs++)=tag;}
- void rs_unlink(void){
- rs=rs_lb-1;
- rs_lb=rs_lb-(*((int*)rs_lb));}
- void rs_pPOS(char* tp,int l,int c,int f){
- *((int*)rs++)=LINEid;
- *((int*)rs++)=l;
- *((int*)rs++)=COLUMNid;
- *((int*)rs++)=c;
- *((int*)rs++)=PATHid;
- *((int*)rs++)=f;
- *((int*)rs++)=DOINGid;
- *((char**)rs++)=tp;}
- int rs_pop_int(int e){
- rs-=8;
- return e;}
- void rs_pINT(int*i,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=INTEGERid;
- *((int**)rs++)=i;}
- void rs_pCHA(char*c,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=CHARACTERid;
- *((char**)rs++)=c;}
- void rs_pBOO(int*b,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=BOOLEANid;
- *((int**)rs++)=b;}
- void rs_pREA(float*r,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=REALid;
- *((float**)rs++)=r;}
- void rs_pDOU(double*d,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=DOUBLEid;
- *((double**)rs++)=d;}
- void rs_pPOI(void*p,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=POINTERid;
- *((void**)rs++)=p;}
- void rs_pBIT(void*p,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=BITid;
- *((void**)rs++)=p;}
- void rs_pREF(void**r,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=REFid;
- *((void***)rs++)=r;}
- void rs_pEXP(void*e,char*n){
- *((int*)rs++)=NAMEid;
- *((char**)rs++)=n;
- *((int*)rs++)=expandedid;
- *((void**)rs++)=e;}
- int se_af=0;
- int se_rspf=0;
- int se_af_rlc;
- int se_af_rlr;
- void ac_req(int v){
- if (!v && se_af_rlc)
- error0("Require Assertion Violated.");
- se_af_rlr=se_af_rlr&&v;
- rs-=8;}
- void ac_ens(int v){
- if (!v) error0("Ensure Assertion Violated.");
- rs-=8;}
- void ac_inv(int v){
- if (!v) error0("Class Invariant Violation.");
- rs-=8;}
- int se_rciaux(double* sp){
- if((*((char**)sp))!=Current) return 0;sp++; if((*((int*)sp))!=REFid) return 0;return 1;}
- int se_rci(void*C){
- double*lb=rs_lb;
- double*sp;
- if(se_af)return 0;
- if(se_rspf)return 0;
- while(1){
- if(lb==rs_bot)return 0;
- sp=lb+4;
- if(se_rciaux(sp)){
- sp+=2;
- if((**((void***)sp))==C)break;}
- lb=lb-(*((int*)lb));}
- while(1){
- lb=lb-(*((int*)lb));
- if(lb==rs_bot)return 1;
- sp=lb+4;
- if(se_rciaux(sp)){
- sp+=2;
- if((**((void***)sp))==C)return 0;}}}
- void ac_liv(int v){
- if (!v) error0("Loop Invariant Violation.");
- rs-=8;}
- int lvc(int lc,int lv1,int lv2){
- if (lc==0){if (lv2 < 0){
- rsp();
- printf("Bad First Variant Value = %d\n",lv2);}
- else {rs-=8;return lv2;}}
- else if ((lv2 < 0)||(lv2 >= lv1)){
- rsp();
- printf("Loop Body Count = %d (done)\nNew Variant = %d\nPrevious Variant = %d\n",lc,lv2,lv1);}
- else {rs-=8;return lv2;}
- printf("*** Error at Run Time *** : Bad Loop Variant.\n");
- if(!se_rspf)exit(1);}
- void ac_civ(int v){
- if (!v) error0("Check Assertion Violated.");
- rs-=8;}
- void rT2append_in(int C,T0* a1){
- int _i=0;
- int _val=0;
- rs_link("append_in of INTEGER");
- rs_pINT(&C,Current);
- rs_pREF((void**)&a1,"str");
- rs_pINT(&_val,"val");
- rs_pINT(&_i,"i");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,192,7,2);
- ac_req((a1)!=(((void*)NULL)));
- se_af=0;}
- /*IF*/if (rs_pPOS(tag_pos_2,196,14,2),rs_pop_int((C)==(0))) {
- rs_pPOS(tag_pos_3,197,10,2);
- rT7extend(ivT7(((T7*)ci(7,a1,197,6,2))),'0');
- rs-=8;
- }
- else {
- /*IF*/if (rs_pPOS(tag_pos_2,199,17,2),rs_pop_int((C)>(0))) {
- rs_pPOS(tag_pos_1,201,5,2);
- _i=((((T7*)ivT7(((T7*)ci(7,a1,201,10,2)))))->_count/*W3*/)+(1);
- rs-=8;
- _val=C;
- while (!(rs_pPOS(tag_pos_2,204,9,2),rs_pop_int((_val)==(0)))) {
- rs_pPOS(tag_pos_3,206,9,2);
- rT7extend(ivT7(((T7*)ci(7,a1,206,5,2))),rT2digit((_val)%(10)));
- rs-=8;
- _val=(_val)/(10);
- }
- }
- else {
- rs_pPOS(tag_pos_3,210,13,2);
- rT7extend(ivT7(((T7*)ci(7,a1,210,9,2))),'\55');
- rs-=8;
- rs_pPOS(tag_pos_1,212,5,2);
- _i=((((T7*)ivT7(((T7*)ci(7,a1,212,10,2)))))->_count/*W3*/)+(1);
- rs-=8;
- _val=C;
- while (!(rs_pPOS(tag_pos_2,215,9,2),rs_pop_int((_val)==(0)))) {
- rs_pPOS(tag_pos_3,217,9,2);
- rT7extend(ivT7(((T7*)ci(7,a1,217,5,2))),rT2digit(-((_val)%(10))));
- rs-=8;
- _val=(_val)/(10);
- }
- }
- /*FI*/_val=(((T7*)ivT7(((T7*)ci(7,a1,222,16,2)))))->_count/*W3*/;
- while (!(rs_pPOS(tag_pos_2,224,11,2),rs_pop_int((_i)>=(_val)))) {
- rs_pPOS(tag_pos_3,226,13,2);
- rT7swap(ivT7(((T7*)ci(7,a1,226,9,2))),_i,_val);
- rs-=8;
- _val=(_val)-(1);
- _i=(_i)+(1);
- }
- }
- /*FI*/rs_unlink();
- }
- int ofBC1tagged_out_memory=0;
- T0*oRBC1tagged_out_memory=NULL;
- T0* rT2tagged_out_memory(/*C*/void){
- if (ofBC1tagged_out_memory==0){
- T0* R=NULL;
- rs_link("tagged_out_memory of GENERAL");
- rs_pREF((void**)&R,Result);
- ofBC1tagged_out_memory=1;
- rs_pPOS(tag_pos_5,344,3,1);
- {T7*n;
- n=((void*)calloc(sizeof(T7),1));
- ((T0*)n)->id=7;
- rT7make(n,1024);
- R=(T0*)n;
- ivT7(n);}
- rs-=8;
- rs_unlink();
- oRBC1tagged_out_memory=R;}
- return oRBC1tagged_out_memory;}
- /*No:INTEGER.item*/
- void rT2fill_tagged_out_memory(int C){
- rs_link("out_in_tagged_out_memory of INTEGER");
- rs_pINT(&C,Current);
- rs_pPOS(tag_pos_3,315,11,2);
- rT2append_in(C,rT2tagged_out_memory());
- rs-=8;
- rs_unlink();
- }
- int rT2is_equal(int C,int a1){
- int R=0;
- rs_link("is_equal of COMPARABLE");
- rs_pINT(&C,Current);
- rs_pINT(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- /*IF*/if (rs_pPOS(tag_pos_2,63,14,384),rs_pop_int((C)<(a1))) {
- }
- else if (rs_pPOS(tag_pos_2,64,16,384),rs_pop_int((a1)<(C))) {
- }
- else {
- R=1;
- }
- /*FI*/if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,108,40,1);
- ac_ens((!((C)==(a1)))||(R));
- rs_pPOS(tag_pos_4,109,21,1);
- ac_ens((!(R))||(rT2is_equal(a1,C)));
- rs_pPOS(tag_pos_4,69,22,384);
- ac_ens((R)==(rT6_px_and(rT6_ix_not((C)<(a1)),rT6_ix_not((a1)<(C)))));
- se_af=0;}
- rs_unlink();
- return R;
- }
- int rT2valid_divisor(/*C*/int a1){
- int R=0;
- rs_link("valid_divisor of INTEGER_REF");
- rs_pINT(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- rs_pPOS(tag_pos_1,120,3,509);
- R=(a1)!=(0);
- rs-=8;
- rs_unlink();
- return R;
- }
- char rT2digit(int C){
- char R=0;
- rs_link("digit of INTEGER");
- rs_pINT(&C,Current);
- rs_pCHA(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,274,5,2);
- ac_req((0)<=(C));
- rs_pPOS(tag_pos_4,275,11,2);
- ac_req((C)<=(9));
- se_af=0;}
- R=(C)+(((unsigned char)'0'));
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,279,18,2);
- ac_ens(rT7has(((T7*)ms1_2),R));
- rs_pPOS(tag_pos_4,280,16,2);
- ac_ens((rT3value(R))==(C));
- se_af=0;}
- rs_unlink();
- return R;
- }
- T0* rT6to_string(int C){
- T0* R=NULL;
- rs_link("to_string of BOOLEAN");
- rs_pBOO(&C,Current);
- rs_pREF((void**)&R,Result);
- /*IF*/if (C) {
- R=ms1_6;
- }
- else {
- R=ms2_6;
- }
- /*FI*/rs_unlink();
- return R;
- }
- T0* rT6tagged_out_memory(/*C*/void){
- if (ofBC1tagged_out_memory==0){
- T0* R=NULL;
- rs_link("tagged_out_memory of GENERAL");
- rs_pREF((void**)&R,Result);
- ofBC1tagged_out_memory=1;
- rs_pPOS(tag_pos_5,344,3,1);
- {T7*n;
- n=((void*)calloc(sizeof(T7),1));
- ((T0*)n)->id=7;
- rT7make(n,1024);
- R=(T0*)n;
- ivT7(n);}
- rs-=8;
- rs_unlink();
- oRBC1tagged_out_memory=R;}
- return oRBC1tagged_out_memory;}
- void rT6fill_tagged_out_memory(int C){
- rs_link("out_in_tagged_out_memory of BOOLEAN");
- rs_pBOO(&C,Current);
- rs_pPOS(tag_pos_3,101,21,6);
- rT7append(ivT7(((T7*)ci(7,rT6tagged_out_memory(),101,3,6))),rT6to_string(C));
- rs-=8;
- rs_unlink();
- }
- int rT6_px_or(int C,int a1){
- int R=0;
- rs_link("infix or of BOOLEAN");
- rs_pBOO(&C,Current);
- rs_pBOO(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- R=(C)||(a1);
- rs_unlink();
- return R;
- }
- int rT6_px_and(int C,int a1){
- int R=0;
- rs_link("infix and of BOOLEAN");
- rs_pBOO(&C,Current);
- rs_pBOO(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- R=(C)&&(a1);
- rs_unlink();
- return R;
- }
- int rT6_ix_not(int C){
- int R=0;
- rs_link("prefix not of BOOLEAN");
- rs_pBOO(&C,Current);
- rs_pBOO(&R,Result);
- /*IF*/if (C) {
- }
- else {
- R=1;
- }
- /*FI*/rs_unlink();
- return R;
- }
- int rT3_px_60(char C,char a1){
- int R=0;
- rs_link("infix < of CHARACTER");
- rs_pCHA(&C,Current);
- rs_pCHA(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- rs_pPOS(tag_pos_1,27,3,3);
- R=(((unsigned char)C))<(((unsigned char)a1));
- rs-=8;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,20,22,384);
- ac_ens((!(R))||(rT6_ix_not(rT3_px_60(a1,C))));
- se_af=0;}
- rs_unlink();
- return R;
- }
- T0* rT3tagged_out_memory(/*C*/void){
- if (ofBC1tagged_out_memory==0){
- T0* R=NULL;
- rs_link("tagged_out_memory of GENERAL");
- rs_pREF((void**)&R,Result);
- ofBC1tagged_out_memory=1;
- rs_pPOS(tag_pos_5,344,3,1);
- {T7*n;
- n=((void*)calloc(sizeof(T7),1));
- ((T0*)n)->id=7;
- rT7make(n,1024);
- R=(T0*)n;
- ivT7(n);}
- rs-=8;
- rs_unlink();
- oRBC1tagged_out_memory=R;}
- return oRBC1tagged_out_memory;}
- void rT3fill_tagged_out_memory(char C){
- rs_link("out_in_tagged_out_memory of CHARACTER");
- rs_pCHA(&C,Current);
- rs_pPOS(tag_pos_3,268,21,3);
- rT7extend(ivT7(((T7*)ci(7,rT3tagged_out_memory(),268,3,3))),C);
- rs-=8;
- rs_unlink();
- }
- int rT3is_equal(char C,char a1){
- int R=0;
- rs_link("is_equal of COMPARABLE");
- rs_pCHA(&C,Current);
- rs_pCHA(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- /*IF*/if (rs_pPOS(tag_pos_2,63,14,384),rs_pop_int(rT3_px_60(C,a1))) {
- }
- else if (rs_pPOS(tag_pos_2,64,16,384),rs_pop_int(rT3_px_60(a1,C))) {
- }
- else {
- R=1;
- }
- /*FI*/if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,69,22,384);
- ac_ens((R)==(rT6_px_and(rT6_ix_not(rT3_px_60(C,a1)),rT6_ix_not(rT3_px_60(a1,C)))));
- rs_pPOS(tag_pos_4,108,40,1);
- ac_ens((!((C)==(a1)))||(R));
- rs_pPOS(tag_pos_4,109,21,1);
- ac_ens((!(R))||(rT3is_equal(a1,C)));
- se_af=0;}
- rs_unlink();
- return R;
- }
- int rT3value(char C){
- int R=0;
- rs_link("value of CHARACTER");
- rs_pCHA(&C,Current);
- rs_pINT(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,60,3,3);
- ac_req(rT3is_digit(C));
- se_af=0;}
- rs_pPOS(tag_pos_1,62,3,3);
- R=(((unsigned char)C))-(48);
- rs-=8;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,64,15,3);
- ac_ens(rT6_px_and((0)<=(R),(R)<=(9)));
- rs_pPOS(tag_pos_4,65,22,3);
- ac_ens((R)==((((unsigned char)C))-(48)));
- se_af=0;}
- rs_unlink();
- return R;
- }
- int rT3_px_6061(char C,char a1){
- int R=0;
- rs_link("infix <= of CHARACTER");
- rs_pCHA(&C,Current);
- rs_pCHA(&a1,"other");
- rs_pBOO(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- se_af=0;}
- rs_pPOS(tag_pos_1,33,3,3);
- R=(((unsigned char)C))<=(((unsigned char)a1));
- rs-=8;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,30,42,384);
- ac_ens(rT6_px_or((R)==(rT3_px_60(C,a1)),rT3is_equal(C,a1)));
- se_af=0;}
- rs_unlink();
- return R;
- }
- int rT3is_digit(char C){
- int R=0;
- rs_link("is_digit of CHARACTER");
- rs_pCHA(&C,Current);
- rs_pBOO(&R,Result);
- {int z1=C;
-
- if(((48<=z1)&&(z1<=57))){
- R=1;
- }
- }
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,134,9,3);
- ac_ens((!(R))||(rT6_px_and(rT3_px_6061('0',C),rT3_px_6061(C,'9'))));
- se_af=0;}
- rs_unlink();
- return R;
- }
- void rT5append_in(double C,T0* a1){
- rs_link("append_in of DOUBLE");
- rs_pDOU(&C,Current);
- rs_pREF((void**)&a1,"str");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,182,7,5);
- ac_req((a1)!=(((void*)NULL)));
- se_af=0;}
- rs_pPOS(tag_pos_3,184,3,5);
- rT5append_in_format(C,a1,6);
- rs-=8;
- rs_unlink();
- }
- void rT5append_in_format(double C,T0* a1,int a2){
- int _i=0;
- rs_link("append_in_format of DOUBLE");
- rs_pDOU(&C,Current);
- rs_pREF((void**)&a1,"str");
- rs_pINT(&a2,"f");
- rs_pINT(&_i,"i");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,200,7,5);
- ac_req((a1)!=(((void*)NULL)));
- rs_pPOS(tag_pos_4,201,5,5);
- ac_req((a2)>=(0));
- se_af=0;}
- rs_pPOS(tag_pos_3,206,6,5);
- {int i;
- double d=C;
- sprintf(_spfd+2,"%d",(a2));
- for(i=2;_spfd[i]!=0;i++);
- _spfd[i]='f';
- _spfd[++i]=0;
- sprintf((rT5tmp_native_array()),_spfd,d);
- }
- rs-=8;
- _i=0;
- while (!(rs_pPOS(tag_pos_2,209,31,5),rs_pop_int(((rT5tmp_native_array())[_i])==('\0')))) {
- rs_pPOS(tag_pos_3,211,10,5);
- rT7extend(ivT7(((T7*)ci(7,a1,211,6,5))),(rT5tmp_native_array())[_i]);
- rs-=8;
- _i=(_i)+(1);
- }
- rs_unlink();
- }
- int ofBC5tmp_native_array=0;
- T510 oRBC5tmp_native_array=NULL;
- T510 rT5tmp_native_array(/*C*/void){
- if (ofBC5tmp_native_array==0){
- T510 R=NULL;
- rs_link("tmp_native_array of DOUBLE");
- rs_pEXP(&R,Result);
- ofBC5tmp_native_array=1;
- rs_pPOS(tag_pos_1,306,3,5);
- R=calloc(128,sizeof(char));
- rs-=8;
- rs_unlink();
- oRBC5tmp_native_array=R;}
- return oRBC5tmp_native_array;}
- void rT4append_in(float C,T0* a1){
- rs_link("append_in of REAL");
- rs_pREA(&C,Current);
- rs_pREF((void**)&a1,"str");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,156,7,4);
- ac_req((a1)!=(((void*)NULL)));
- se_af=0;}
- rs_pPOS(tag_pos_3,158,13,4);
- rT5append_in(((double)C),a1);
- rs-=8;
- rs_unlink();
- }
- void rT8append_in(void* C,T0* a1){
- int _i=0;
- rs_link("append_in of POINTER");
- rs_pPOI(&C,Current);
- rs_pREF((void**)&a1,"str");
- rs_pINT(&_i,"i");
- rs_pPOS(tag_pos_3,41,3,8);
- {void*p=C;
- sprintf((rT8tmp_native_array()),"%p",p);}
- rs-=8;
- _i=0;
- while (!(rs_pPOS(tag_pos_2,45,31,8),rs_pop_int(((rT8tmp_native_array())[_i])==('\0')))) {
- rs_pPOS(tag_pos_3,47,10,8);
- rT7extend(ivT7(((T7*)ci(7,a1,47,6,8))),(rT8tmp_native_array())[_i]);
- rs-=8;
- _i=(_i)+(1);
- }
- rs_unlink();
- }
- int ofBC8tmp_native_array=0;
- T510 oRBC8tmp_native_array=NULL;
- T510 rT8tmp_native_array(/*C*/void){
- if (ofBC8tmp_native_array==0){
- T510 R=NULL;
- rs_link("tmp_native_array of POINTER");
- rs_pEXP(&R,Result);
- ofBC8tmp_native_array=1;
- rs_pPOS(tag_pos_1,65,3,8);
- R=calloc(32,sizeof(char));
- rs-=8;
- rs_unlink();
- oRBC8tmp_native_array=R;}
- return oRBC8tmp_native_array;}
- int rT510is_not_void(T510 C){
- int R=0;
- rs_link("is_not_void of NATIVE_ARRAY");
- rs_pEXP(&C,Current);
- rs_pBOO(&R,Result);
- R=(NULL!=((void*)C));
- rs_unlink();
- return R;
- }
- int rT510fast_index_of(T510 C,char a1,int a2){
- int R=0;
- rs_link("fast_index_of of NATIVE_ARRAY");
- rs_pEXP(&C,Current);
- rs_pCHA(&a1,"element");
- rs_pINT(&a2,"upper");
- rs_pINT(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,125,9,864);
- ac_req((a2)>=(-(1)));
- se_af=0;}
- while (!(rs_pPOS(tag_pos_2,129,21,864),rs_pop_int(((R)>(a2))||((a1)==((C)[R]))))) {
- R=(R)+(1);
- }
- rs_unlink();
- return R;
- }
- void rT510copy_from(T510 C,T510 a1,int a2){
- int _i=0;
- rs_link("copy_from of NATIVE_ARRAY");
- rs_pEXP(&C,Current);
- rs_pEXP(&a1,"other");
- rs_pINT(&a2,"upper");
- rs_pINT(&_i,"i");
- _i=a2;
- while (!(rs_pPOS(tag_pos_2,217,8,864),rs_pop_int((_i)<(0)))) {
- rs_pPOS(tag_pos_3,219,6,864);
- (C)[_i]=((a1)[_i]);
- rs-=8;
- _i=(_i)-(1);
- }
- rs_unlink();
- }
- T510 rT510realloc(T510 C,int a1,int a2){
- T510 R=NULL;
- rs_link("realloc of NATIVE_ARRAY");
- rs_pEXP(&C,Current);
- rs_pINT(&a1,"old_nb_elts");
- rs_pINT(&a2,"new_nb_elts");
- rs_pEXP(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,54,14,864);
- ac_req((NULL!=((void*)C)));
- rs_pPOS(tag_pos_4,55,15,864);
- ac_req((a1)<(a2));
- se_af=0;}
- rs_pPOS(tag_pos_1,57,3,864);
- R=calloc(a2,sizeof(char));
- rs-=8;
- rs_pPOS(tag_pos_3,58,10,864);
- rT510copy_from(R,C,(a1)-(1));
- rs-=8;
- rs_pPOS(tag_pos_3,59,3,864);
- free(C);
- rs-=8;
- rs_unlink();
- return R;
- }
- void rT7out_in_tagged_out_memory(T7* C){
- rs_link("out_in_tagged_out_memory of STRING");
- rs_pREF((void**)&C,Current);
- rs_pPOS(tag_pos_3,881,21,7);
- rT7append(ivT7(((T7*)ci(7,rT7tagged_out_memory(),881,3,7))),(T0*)C);
- rs-=8;
- if(se_rci(C))ivT7(C);
- rs_unlink();
- }
- void rT7extend(T7* C,char a1){
- int _new_capacity=0;
- int o1=(((T7*)C))->_count/*W3*/;
- rs_link("add_last of STRING");
- rs_pREF((void**)&C,Current);
- rs_pCHA(&a1,"ch");
- rs_pINT(&_new_capacity,"new_capacity");
- /*IF*/if (rs_pPOS(tag_pos_2,508,15,7),rs_pop_int(((((T7*)C))->_capacity/*W2*/)>((((T7*)C))->_count/*W3*/))) {
- }
- else if (rs_pPOS(tag_pos_2,509,19,7),rs_pop_int(((((T7*)C))->_capacity/*W2*/)==(0))) {
- C->_capacity=32;
- rs_pPOS(tag_pos_1,511,6,7);
- C->_storage=calloc((((T7*)C))->_capacity/*W2*/,sizeof(char));
- rs-=8;
- }
- else {
- rs_pPOS(tag_pos_1,513,6,7);
- _new_capacity=(2)*((((T7*)C))->_capacity/*W2*/);
- rs-=8;
- rs_pPOS(tag_pos_1,514,6,7);
- C->_storage=rT510realloc((((T7*)C))->_storage/*W1*/,(((T7*)C))->_capacity/*W2*/,_new_capacity);
- rs-=8;
- C->_capacity=_new_capacity;
- }
- /*FI*/rs_pPOS(tag_pos_1,517,3,7);
- C->_count=((((T7*)C))->_count/*W3*/)+(1);
- rs-=8;
- rs_pPOS(tag_pos_3,518,3,7);
- rT7put(C,a1,(((T7*)C))->_count/*W3*/);
- rs-=8;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,520,9,7);
- ac_ens(((((T7*)C))->_count/*W3*/)==((1)+(o1)));
- rs_pPOS(tag_pos_4,521,16,7);
- ac_ens((rT7item(C,(((T7*)C))->_count/*W3*/))==(a1));
- se_af=0;}
- rs_unlink();
- }
- void rT7make(T7* C,int a1){
- rs_link("make of STRING");
- rs_pREF((void**)&C,Current);
- rs_pINT(&a1,"needed_capacity");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,37,19,7);
- ac_req((a1)>=(0));
- se_af=0;}
- /*IF*/if (rs_pPOS(tag_pos_2,39,22,7),rs_pop_int((a1)>(0))) {
- /*IF*/if (rs_pPOS(tag_pos_2,40,18,7),rs_pop_int(((((T7*)C))->_capacity/*W2*/)<(a1))) {
- /*IF*/if (rs_pPOS(tag_pos_2,41,21,7),rs_pop_int(((((T7*)C))->_capacity/*W2*/)>(0))) {
- rs_pPOS(tag_pos_3,42,13,7);
- free((((T7*)C))->_storage/*W1*/);
- rs-=8;
- }
- /*FI*/rs_pPOS(tag_pos_1,44,9,7);
- C->_storage=calloc(a1,sizeof(char));
- rs-=8;
- C->_capacity=a1;
- }
- /*FI*/}
- /*FI*/C->_count=0;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,50,19,7);
- ac_ens((a1)<=((((T7*)C))->_capacity/*W2*/));
- rs_pPOS(tag_pos_4,51,9,7);
- ac_ens(((((T7*)C))->_count/*W3*/)==(0));
- se_af=0;}
- rs_unlink();
- }
- T0*oRBC1std_output=NULL;
- T0* rT7tagged_out_memory(/*C*/void){
- if (ofBC1tagged_out_memory==0){
- T0* R=NULL;
- rs_link("tagged_out_memory of GENERAL");
- rs_pREF((void**)&R,Result);
- ofBC1tagged_out_memory=1;
- rs_pPOS(tag_pos_5,344,3,1);
- {T7*n;
- n=((void*)calloc(sizeof(T7),1));
- ((T0*)n)->id=7;
- rT7make(n,1024);
- R=(T0*)n;
- ivT7(n);}
- rs-=8;
- rs_unlink();
- oRBC1tagged_out_memory=R;}
- return oRBC1tagged_out_memory;}
- char rT7item(T7* C,int a1){
- char R=0;
- rs_link("item of STRING");
- rs_pREF((void**)&C,Current);
- rs_pINT(&a1,"index");
- rs_pCHA(&R,Result);
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,78,3,7);
- ac_req(rT7valid_index(C,a1));
- se_af=0;}
- R=((((T7*)C))->_storage/*W1*/)[(a1)-(1)];
- if(se_rci(C))ivT7(C);
- rs_unlink();
- return R;
- }
- void rT7clear(T7* C){
- rs_link("clear of STRING");
- rs_pREF((void**)&C,Current);
- C->_count=0;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,308,9,7);
- ac_ens(((((T7*)C))->_count/*W3*/)==(0));
- se_af=0;}
- rs_unlink();
- }
- void rT7fill_tagged_out_memory(T7* C){
- rs_link("fill_tagged_out_memory of STRING");
- rs_pREF((void**)&C,Current);
- rs_pPOS(tag_pos_3,886,21,7);
- rT7append(ivT7(((T7*)ci(7,rT7tagged_out_memory(),886,3,7))),ms3_7);
- rs-=8;
- rs_pPOS(tag_pos_3,887,9,7);
- rT2append_in((((T7*)C))->_count/*W3*/,rT7tagged_out_memory());
- rs-=8;
- rs_pPOS(tag_pos_3,888,21,7);
- rT7append(ivT7(((T7*)ci(7,rT7tagged_out_memory(),888,3,7))),ms4_7);
- rs-=8;
- rs_pPOS(tag_pos_3,889,12,7);
- rT2append_in((((T7*)C))->_capacity/*W2*/,rT7tagged_out_memory());
- rs-=8;
- rs_pPOS(tag_pos_3,890,21,7);
- rT7append(ivT7(((T7*)ci(7,rT7tagged_out_memory(),890,3,7))),ms5_7);
- rs-=8;
- rs_pPOS(tag_pos_3,891,21,7);
- rT7append(ivT7(((T7*)ci(7,rT7tagged_out_memory(),891,3,7))),(T0*)C);
- rs-=8;
- rs_pPOS(tag_pos_3,892,21,7);
- rT7extend(ivT7(((T7*)ci(7,rT7tagged_out_memory(),892,3,7))),'\42');
- rs-=8;
- if(se_rci(C))ivT7(C);
- rs_unlink();
- }
- /*No:STRING.storage*/
- void rT7print_on(T7* C,T0* a1){
- rs_link("print_on of GENERAL");
- rs_pREF((void**)&C,Current);
- rs_pREF((void**)&a1,"file");
- rs_pPOS(tag_pos_3,300,21,1);
- rT7clear(ivT7(((T7*)ci(7,rT7tagged_out_memory(),300,3,1))));
- rs-=8;
- rs_pPOS(tag_pos_3,301,3,1);
- rT7out_in_tagged_out_memory(C);
- rs-=8;
- rs_pPOS(tag_pos_3,302,8,1);
- X817put_string(302,3,1,a1,rT7tagged_out_memory());
- rs-=8;
- if(se_rci(C))ivT7(C);
- rs_unlink();
- }
- void rT7swap(T7* C,int a1,int a2){
- char _tmp=0;
- char o3=rT7item(C,a2);
- char o2=rT7item(C,a1);
- rs_link("swap of STRING");
- rs_pREF((void**)&C,Current);
- rs_pINT(&a1,"i1");
- rs_pINT(&a2,"i2");
- rs_pCHA(&_tmp,"tmp");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,407,3,7);
- ac_req(rT7valid_index(C,a1));
- rs_pPOS(tag_pos_4,408,3,7);
- ac_req(rT7valid_index(C,a2));
- se_af=0;}
- _tmp=rT7item(C,a1);
- rs_pPOS(tag_pos_3,413,3,7);
- rT7put(C,rT7item(C,a2),a1);
- rs-=8;
- rs_pPOS(tag_pos_3,414,3,7);
- rT7put(C,_tmp,a2);
- rs-=8;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,416,12,7);
- ac_ens((rT7item(C,a1))==(o3));
- rs_pPOS(tag_pos_4,417,12,7);
- ac_ens((rT7item(C,a2))==(o2));
- se_af=0;}
- rs_unlink();
- }
- /*No:STRING.capacity*/
- int rT7has(T7* C,char a1){
- int R=0;
- rs_link("has of STRING");
- rs_pREF((void**)&C,Current);
- rs_pCHA(&a1,"ch");
- rs_pBOO(&R,Result);
- rs_pPOS(tag_pos_1,241,3,7);
- R=(rT7index_of(C,a1))!=(((((T7*)C))->_count/*W3*/)+(1));
- rs-=8;
- if(se_rci(C))ivT7(C);
- rs_unlink();
- return R;
- }
- void rT7put(T7* C,char a1,int a2){
- rs_link("put of STRING");
- rs_pREF((void**)&C,Current);
- rs_pCHA(&a1,"ch");
- rs_pINT(&a2,"index");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,398,3,7);
- ac_req(rT7valid_index(C,a2));
- se_af=0;}
- rs_pPOS(tag_pos_3,400,11,7);
- ((((T7*)C))->_storage/*W1*/)[(a2)-(1)]=(a1);
- rs-=8;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,402,16,7);
- ac_ens((rT7item(C,a2))==(a1));
- se_af=0;}
- rs_unlink();
- }
- int rT7valid_index(T7* C,int a1){
- int R=0;
- rs_link("valid_index of STRING");
- rs_pREF((void**)&C,Current);
- rs_pINT(&a1,"index");
- rs_pBOO(&R,Result);
- rs_pPOS(tag_pos_1,86,3,7);
- R=((1)<=(a1))&&((a1)<=((((T7*)C))->_count/*W3*/));
- rs-=8;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,88,10,7);
- ac_ens((R)==(rT6_px_and((1)<=(a1),(a1)<=((((T7*)C))->_count/*W3*/))));
- se_af=0;}
- rs_unlink();
- return R;
- }
- /*No:STRING.count*/
- int rT7index_of(T7* C,char a1){
- int R=0;
- rs_link("index_of of STRING");
- rs_pREF((void**)&C,Current);
- rs_pCHA(&a1,"ch");
- rs_pINT(&R,Result);
- rs_pPOS(tag_pos_1,185,3,7);
- R=(1)+(rT510fast_index_of((((T7*)C))->_storage/*W1*/,a1,((((T7*)C))->_count/*W3*/)-(1)));
- rs-=8;
- if(se_rci(C))ivT7(C);
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,187,25,7);
- ac_ens((!((R)!=(((((T7*)C))->_count/*W3*/)+(1))))||((rT7item(C,R))==(a1)));
- se_af=0;}
- rs_unlink();
- return R;
- }
- void rT7print(/*C*/T0* a1){
- rs_link("print of GENERAL");
- rs_pREF((void**)&a1,"some");
- /*IF*/if (rs_pPOS(tag_pos_2,286,11,1),rs_pop_int((a1)==(((void*)NULL)))) {
- rs_pPOS(tag_pos_3,287,17,1);
- X830put_string(287,6,1,oRBC1std_output,ms1_1);
- rs-=8;
- }
- else {
- rs_pPOS(tag_pos_3,289,11,1);
- X1print_on(289,6,1,a1,oRBC1std_output);
- rs-=8;
- }
- /*FI*/rs_unlink();
- }
- void rT7append(T7* C,T0* a1){
- int _i=0;
- rs_link("append of STRING");
- rs_pREF((void**)&C,Current);
- rs_pREF((void**)&a1,"other");
- rs_pINT(&_i,"i");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,344,9,7);
- ac_req((a1)!=(((void*)NULL)));
- se_af=0;}
- _i=1;
- while (!(rs_pPOS(tag_pos_2,351,8,7),rs_pop_int((_i)>((((T7*)ivT7(((T7*)ci(7,a1,351,10,7)))))->_count/*W3*/)))) {
- rs_pPOS(tag_pos_3,353,6,7);
- rT7extend(C,rT7item(ivT7(((T7*)ci(7,a1,353,13,7))),_i));
- rs-=8;
- _i=(_i)+(1);
- }
- if(se_rci(C))ivT7(C);
- rs_unlink();
- }
- T7 *ivT7(T7 *C){
- *((int*)rs++)=INVid;*((char**)rs++)=p[7];
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,1163,6,7);
- ac_inv((0)<=((((T7*)C))->_count/*W3*/));
- rs_pPOS(tag_pos_4,1165,10,7);
- ac_inv(((((T7*)C))->_count/*W3*/)<=((((T7*)C))->_capacity/*W2*/));
- rs_pPOS(tag_pos_4,1167,17,7);
- ac_inv((!(((((T7*)C))->_capacity/*W2*/)>(0)))||(rT510is_not_void((((T7*)C))->_storage/*W1*/)));
- se_af=0;}
- rs-=2;return C;}
- void rT830out_in_tagged_out_memory(T830* C){
- rs_link("out_in_tagged_out_memory of GENERAL");
- rs_pREF((void**)&C,Current);
- rs_pPOS(tag_pos_3,332,21,1);
- rT7append(ivT7(((T7*)ci(7,rT830tagged_out_memory(),332,3,1))),((T0*)(gt[(C)->id])));
- rs-=8;
- /*IF*/{/*AT*/rs_pPOS(tag_pos_3,334,24,1);
- rT7extend(ivT7(((T7*)ci(7,rT830tagged_out_memory(),334,6,1))),'\43');
- rs-=8;
- rs_pPOS(tag_pos_3,335,25,1);
- rT8append_in(((void*)C),rT830tagged_out_memory());
- rs-=8;
- }
- /*FI*/rs_pPOS(tag_pos_3,337,21,1);
- rT7extend(ivT7(((T7*)ci(7,rT830tagged_out_memory(),337,3,1))),'\133');
- rs-=8;
- rs_pPOS(tag_pos_3,338,3,1);
- rT830fill_tagged_out_memory();
- rs-=8;
- rs_pPOS(tag_pos_3,339,21,1);
- rT7extend(ivT7(((T7*)ci(7,rT830tagged_out_memory(),339,3,1))),'\135');
- rs-=8;
- rs_unlink();
- }
- void rT830make(/*C*/void){
- rs_link("make of STD_OUTPUT");
- rs_unlink();
- }
- T0* rT830tagged_out_memory(/*C*/void){
- if (ofBC1tagged_out_memory==0){
- T0* R=NULL;
- rs_link("tagged_out_memory of GENERAL");
- rs_pREF((void**)&R,Result);
- ofBC1tagged_out_memory=1;
- rs_pPOS(tag_pos_5,344,3,1);
- {T7*n;
- n=((void*)calloc(sizeof(T7),1));
- ((T0*)n)->id=7;
- rT7make(n,1024);
- R=(T0*)n;
- ivT7(n);}
- rs-=8;
- rs_unlink();
- oRBC1tagged_out_memory=R;}
- return oRBC1tagged_out_memory;}
- void rT830fill_tagged_out_memory(/*C*/void){
- rs_link("fill_tagged_out_memory of GENERAL");
- rs_unlink();
- }
- void rT830print_on(T830* C,T0* a1){
- rs_link("print_on of GENERAL");
- rs_pREF((void**)&C,Current);
- rs_pREF((void**)&a1,"file");
- rs_pPOS(tag_pos_3,300,21,1);
- rT7clear(ivT7(((T7*)ci(7,rT830tagged_out_memory(),300,3,1))));
- rs-=8;
- rs_pPOS(tag_pos_3,301,3,1);
- rT830out_in_tagged_out_memory(C);
- rs-=8;
- rs_pPOS(tag_pos_3,302,8,1);
- X817put_string(302,3,1,a1,rT830tagged_out_memory());
- rs-=8;
- rs_unlink();
- }
- void rT830put_string(T830* C,T0* a1){
- int _i=0;
- rs_link("put_string of OUTPUT_STREAM");
- rs_pREF((void**)&C,Current);
- rs_pREF((void**)&a1,"s");
- rs_pINT(&_i,"i");
- se_af_rlc=1;
- if(!se_af){se_af=1;
- rs_pPOS(tag_pos_4,27,5,817);
- ac_req((a1)!=(((void*)NULL)));
- se_af=0;}
- _i=1;
- while (!(rs_pPOS(tag_pos_2,34,8,817),rs_pop_int((_i)>((((T7*)ivT7(((T7*)ci(7,a1,34,10,817)))))->_count/*W3*/)))) {
- rs_pPOS(tag_pos_3,36,6,817);
- rT830put_character(C,rT7item(ivT7(((T7*)ci(7,a1,36,20,817))),_i));
- rs-=8;
- _i=(_i)+(1);
- }
- rs_unlink();
- }
- void rT830put_character(T830* C,char a1){
- rs_link("put_character of STD_OUTPUT");
- rs_pREF((void**)&C,Current);
- rs_pCHA(&a1,"c");
- rs_pPOS(tag_pos_3,33,3,830);
- fputc(a1,stdout);
- rs-=8;
- rs_unlink();
- }
- void rT830print(/*C*/T0* a1){
- rs_link("print of GENERAL");
- rs_pREF((void**)&a1,"some");
- /*IF*/if (rs_pPOS(tag_pos_2,286,11,1),rs_pop_int((a1)==(((void*)NULL)))) {
- rs_pPOS(tag_pos_3,287,17,1);
- X830put_string(287,6,1,oRBC1std_output,ms1_1);
- rs-=8;
- }
- else {
- rs_pPOS(tag_pos_3,289,11,1);
- X1print_on(289,6,1,a1,oRBC1std_output);
- rs-=8;
- }
- /*FI*/rs_unlink();
- }
-
-