Ejemplo n.º 1
0
static void*Cyc_RenameTemps_local_temp_var(int i){void**_T0;int _T1;char*_T2;void**_T3;void*_T4;void**_T5;int _T6;struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct*_T7;struct _tuple0*_T8;struct _fat_ptr*_T9;struct _fat_ptr _TA;struct Cyc_Int_pa_PrintArg_struct _TB;int _TC;struct _fat_ptr _TD;struct _fat_ptr _TE;void**_TF;int _T10;void*_T11;void*_T12;struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct*_T13;struct _tuple0*_T14;struct _fat_ptr*_T15;struct _fat_ptr _T16;struct Cyc_Int_pa_PrintArg_struct _T17;int _T18;struct _fat_ptr _T19;struct _fat_ptr _T1A;void*_T1B;
static void*memo_arr[256U]={};
if(i >= 256)goto _TL2;_T0=memo_arr;_T1=i;_T2=_check_known_subscript_notnull(_T0,256U,sizeof(void*),_T1);_T3=(void**)_T2;_T4=*_T3;
if(_T4!=0)goto _TL4;_T5=memo_arr;_T6=i;{struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct*_T1C=_cycalloc(sizeof(struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct));_T1C->tag=0;{struct _tuple0*_T1D=_cycalloc(sizeof(struct _tuple0));
_T1D->f0=Cyc_Absyn_Loc_n();{struct _fat_ptr*_T1E=_cycalloc(sizeof(struct _fat_ptr));{struct Cyc_Int_pa_PrintArg_struct _T1F;_T1F.tag=1;_TC=i;_T1F.f1=(unsigned)_TC;_TB=_T1F;}{struct Cyc_Int_pa_PrintArg_struct _T1F=_TB;void*_T20[1];_T20[0]=& _T1F;_TD=_tag_fat("_T%X",sizeof(char),5U);_TE=_tag_fat(_T20,sizeof(void*),1);_TA=Cyc_aprintf(_TD,_TE);}*_T1E=_TA;_T9=(struct _fat_ptr*)_T1E;}_T1D->f1=_T9;_T8=(struct _tuple0*)_T1D;}_T1C->f1=_T8;_T7=(struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct*)_T1C;}_T5[_T6]=(void*)_T7;goto _TL5;_TL4: _TL5: _TF=memo_arr;_T10=i;_T11=_TF[_T10];_T12=
_check_null(_T11);return _T12;_TL2:{struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct*_T1C=_cycalloc(sizeof(struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct));_T1C->tag=0;{struct _tuple0*_T1D=_cycalloc(sizeof(struct _tuple0));
# 51
_T1D->f0=Cyc_Absyn_Loc_n();{struct _fat_ptr*_T1E=_cycalloc(sizeof(struct _fat_ptr));{struct Cyc_Int_pa_PrintArg_struct _T1F;_T1F.tag=1;_T18=i;_T1F.f1=(unsigned)_T18;_T17=_T1F;}{struct Cyc_Int_pa_PrintArg_struct _T1F=_T17;void*_T20[1];_T20[0]=& _T1F;_T19=_tag_fat("_T%X",sizeof(char),5U);_T1A=_tag_fat(_T20,sizeof(void*),1);_T16=Cyc_aprintf(_T19,_T1A);}*_T1E=_T16;_T15=(struct _fat_ptr*)_T1E;}_T1D->f1=_T15;_T14=(struct _tuple0*)_T1D;}_T1C->f1=_T14;_T13=(struct Cyc_Absyn_Unresolved_b_Absyn_Binding_struct*)_T1C;}_T1B=(void*)_T13;return _T1B;}
Ejemplo n.º 2
0
int Cyc_Lineno_lex_engine(int start_state,struct Cyc_Lexing_lexbuf * lbuf) {
  struct Cyc_Lexing_lexbuf * _T0;
  struct Cyc_Lexing_lexbuf * _T1;
  struct Cyc_Lexing_lexbuf * _T2;
  struct Cyc_Lexing_lexbuf * _T3;
  int _T4;
  const int * _T5;
  int _T6;
  const char * _T7;
  const int * _T8;
  int _T9;
  int _TA;
  const int * _TB;
  int _TC;
  struct Cyc_Lexing_lexbuf * _TD;
  struct Cyc_Lexing_lexbuf * _TE;
  struct Cyc_Lexing_lexbuf * _TF;
  struct Cyc_Lexing_lexbuf * _T10;
  int _T11;
  struct Cyc_Lexing_lexbuf * _T12;
  int _T13;
  struct Cyc_Lexing_lexbuf * _T14;
  long _T15;
  int _T16;
  int _T17;
  struct Cyc_Lexing_lexbuf * _T18;
  struct _fat_ptr _T19;
  struct Cyc_Lexing_lexbuf * _T1A;
  int _T1B;
  int _T1C;
  unsigned char * _T1D;
  char * _T1E;
  char _T1F;
  int _T20;
  int _T21;
  const int * _T22;
  int _T23;
  const char * _T24;
  const int * _T25;
  int _T26;
  int _T27;
  const int * _T28;
  int _T29;
  const int * _T2A;
  int _T2B;
  struct Cyc_Lexing_lexbuf * _T2C;
  struct Cyc_Lexing_lexbuf * _T2D;
  struct Cyc_Lexing_lexbuf * _T2E;
  int _T2F;
  int _T30;
  struct Cyc_Lexing_Error_exn_struct * _T31;
  void * _T32;
  struct Cyc_Lexing_lexbuf * _T33;
  int _T34;
  struct Cyc_Lexing_lexbuf * _T35;
  int state;
  int base;
  int backtrk;
  int c;
  state = start_state;
  if (state < 0) { goto _TL0;
  }
  _T0 = lbuf;
  _T1 = lbuf;
  _T2 = lbuf;
  _T1->lex_start_pos = _T2->lex_curr_pos;
  _T0->lex_last_pos = _T1->lex_start_pos;
  _T3 = lbuf;
  _T3->lex_last_action = - 1;
  goto _TL1;
  _TL0: _T4 = - state;
  state = _T4 - 1;
  _TL1: _TL2: if (1) { goto _TL3;
  }else { goto _TL4;
  }
  _TL3: _T5 = Cyc_Lineno_lex_base;
  _T6 = state;
  _T7 = _check_known_subscript_notnull(_T5,10U,sizeof(int),_T6);
  _T8 = (const int *)_T7;
  base = *_T8;
  if (base >= 0) { goto _TL5;
  }
  _T9 = - base;
  _TA = _T9 - 1;
  return _TA;
  _TL5: _TB = Cyc_Lineno_lex_backtrk;
  _TC = state;
  backtrk = _TB[_TC];
  if (backtrk < 0) { goto _TL7;
  }
  _TD = lbuf;
  _TE = lbuf;
  _TD->lex_last_pos = _TE->lex_curr_pos;
  _TF = lbuf;
  _TF->lex_last_action = backtrk;
  goto _TL8;
  _TL7: _TL8: _T10 = lbuf;
  _T11 = _T10->lex_curr_pos;
  _T12 = lbuf;
  _T13 = _T12->lex_buffer_len;
  if (_T11 < _T13) { goto _TL9;
  }
  _T14 = lbuf;
  _T15 = _T14->lex_eof_reached;
  if (_T15) { goto _TLB;
  }else { goto _TLD;
  }
  _TLD: _T16 = - state;
  _T17 = _T16 - 1;
  return _T17;
  _TLB: c = 256;
  goto _TLA;
  _TL9: _T18 = lbuf;
  _T19 = _T18->lex_buffer;
  _T1A = lbuf;
  _T1B = _T1A->lex_curr_pos;
  _T1A->lex_curr_pos = _T1B + 1;
  _T1C = _T1B;
  _T1D = _check_fat_subscript(_T19,sizeof(char),_T1C);
  _T1E = (char *)_T1D;
  _T1F = *_T1E;
  c = (int)_T1F;
  _T20 = c;
  _T21 = - 1;
  if (_T20 != _T21) { goto _TLE;
  }
  c = 256;
  goto _TLF;
  _TLE: if (c >= 0) { goto _TL10;
  }
  c = 256 + c;
  goto _TL11;
  _TL10: _TL11: _TLF: _TLA: _T22 = Cyc_Lineno_lex_check;
  _T23 = base + c;
  _T24 = _check_known_subscript_notnull(_T22,273U,sizeof(int),_T23);
  _T25 = (const int *)_T24;
  _T26 = *_T25;
  _T27 = state;
  if (_T26 != _T27) { goto _TL12;
  }
  _T28 = Cyc_Lineno_lex_trans;
  _T29 = base + c;
  state = _T28[_T29];
  goto _TL13;
  _TL12: _T2A = Cyc_Lineno_lex_default;
  _T2B = state;
  state = _T2A[_T2B];
  _TL13: if (state >= 0) { goto _TL14;
  }
  _T2C = lbuf;
  _T2D = lbuf;
  _T2C->lex_curr_pos = _T2D->lex_last_pos;
  _T2E = lbuf;
  _T2F = _T2E->lex_last_action;
  _T30 = - 1;
  if (_T2F != _T30) { goto _TL16;
  }
  { struct Cyc_Lexing_Error_exn_struct * _T36 = _cycalloc(sizeof(struct Cyc_Lexing_Error_exn_struct));
    _T36->tag = Cyc_Lexing_Error;
    _T36->f1 = _tag_fat("empty token",sizeof(char),12U);
    _T31 = (struct Cyc_Lexing_Error_exn_struct *)_T36;
  }_T32 = (void *)_T31;
  _throw(_T32);
  goto _TL17;
  _TL16: _T33 = lbuf;
  _T34 = _T33->lex_last_action;
  return _T34;
  _TL17: goto _TL15;
  _TL14: if (c != 256) { goto _TL18;
  }
  _T35 = lbuf;
  _T35->lex_eof_reached = 0;
  goto _TL19;
  _TL18: _TL19: _TL15: goto _TL2;
  _TL4: ;
}
Ejemplo n.º 3
0
void Cyc_Array_qsort(int (* less_eq)(void * *,void * *),struct _fat_ptr arr,
		     int len) {
  int _T0;
  unsigned int _T1;
  struct _fat_ptr _T2;
  unsigned int _T3;
  struct Cyc_Core_Invalid_argument_exn_struct * _T4;
  void * _T5;
  int _T6;
  struct _fat_ptr _T7;
  int _T8;
  int _T9;
  int _TA;
  int _TB;
  unsigned char * _TC;
  void * * _TD;
  struct _fat_ptr _TE;
  unsigned char * _TF;
  void * * _T10;
  int _T11;
  int _T12;
  int _T13;
  int _T14;
  struct _fat_ptr _T15;
  int _T16;
  unsigned char * _T17;
  void * * _T18;
  struct _fat_ptr _T19;
  unsigned char * _T1A;
  void * * _T1B;
  int _T1C;
  struct _fat_ptr _T1D;
  int _T1E;
  struct _fat_ptr _T1F;
  unsigned char * _T20;
  unsigned char * _T21;
  void * * _T22;
  struct _fat_ptr _T23;
  int _T24;
  struct _fat_ptr _T25;
  unsigned char * _T26;
  unsigned char * _T27;
  void * * _T28;
  int _T29;
  struct _fat_ptr _T2A;
  int _T2B;
  unsigned char * _T2C;
  void * * _T2D;
  struct _fat_ptr _T2E;
  unsigned char * _T2F;
  void * * _T30;
  int _T31;
  struct _fat_ptr _T32;
  int _T33;
  unsigned char * _T34;
  void * * _T35;
  struct _fat_ptr _T36;
  unsigned char * _T37;
  void * * _T38;
  int _T39;
  struct _fat_ptr _T3A;
  int _T3B;
  struct _fat_ptr _T3C;
  unsigned char * _T3D;
  unsigned char * _T3E;
  void * * _T3F;
  struct _fat_ptr _T40;
  int _T41;
  struct _fat_ptr _T42;
  unsigned char * _T43;
  unsigned char * _T44;
  void * * _T45;
  int _T46;
  struct _fat_ptr _T47;
  unsigned char * _T48;
  void * * _T49;
  int _T4A;
  struct _fat_ptr _T4B;
  unsigned char * _T4C;
  void * * _T4D;
  int _T4E;
  struct _fat_ptr _T4F;
  int _T50;
  unsigned char * _T51;
  void * * _T52;
  struct _fat_ptr _T53;
  unsigned char * _T54;
  void * * _T55;
  int _T56;
  struct _fat_ptr _T57;
  int _T58;
  struct _fat_ptr _T59;
  unsigned char * _T5A;
  unsigned char * _T5B;
  void * * _T5C;
  struct _fat_ptr _T5D;
  int _T5E;
  struct _fat_ptr _T5F;
  unsigned char * _T60;
  unsigned char * _T61;
  void * * _T62;
  int _T63;
  struct _fat_ptr _T64;
  int _T65;
  unsigned char * _T66;
  void * * _T67;
  struct _fat_ptr _T68;
  unsigned char * _T69;
  void * * _T6A;
  int _T6B;
  struct _fat_ptr _T6C;
  unsigned char * _T6D;
  void * * _T6E;
  int _T6F;
  struct _fat_ptr _T70;
  unsigned char * _T71;
  void * * _T72;
  int _T73;
  struct _fat_ptr _T74;
  int _T75;
  struct _fat_ptr _T76;
  unsigned char * _T77;
  unsigned char * _T78;
  void * * _T79;
  struct _fat_ptr _T7A;
  int _T7B;
  struct _fat_ptr _T7C;
  unsigned char * _T7D;
  unsigned char * _T7E;
  void * * _T7F;
  int _T80;
  struct _fat_ptr _T81;
  int _T82;
  struct _fat_ptr _T83;
  unsigned char * _T84;
  unsigned char * _T85;
  void * * _T86;
  struct _fat_ptr _T87;
  int _T88;
  struct _fat_ptr _T89;
  unsigned char * _T8A;
  unsigned char * _T8B;
  void * * _T8C;
  int _T8D;
  struct _fat_ptr _T8E;
  int _T8F;
  unsigned char * _T90;
  void * * _T91;
  struct _fat_ptr _T92;
  unsigned char * _T93;
  void * * _T94;
  int _T95;
  struct _fat_ptr _T96;
  int _T97;
  unsigned char * _T98;
  void * * _T99;
  struct _fat_ptr _T9A;
  unsigned char * _T9B;
  void * * _T9C;
  int _T9D;
  struct _fat_ptr _T9E;
  unsigned char * _T9F;
  void * * _TA0;
  int _TA1;
  struct _fat_ptr _TA2;
  unsigned char * _TA3;
  void * * _TA4;
  int _TA5;
  struct _fat_ptr _TA6;
  int _TA7;
  unsigned char * _TA8;
  void * * _TA9;
  struct _fat_ptr _TAA;
  unsigned char * _TAB;
  void * * _TAC;
  int _TAD;
  int _TAE;
  int _TAF;
  int * _TB0;
  int _TB1;
  char * _TB2;
  int * _TB3;
  int * _TB4;
  int _TB5;
  char * _TB6;
  int * _TB7;
  int * _TB8;
  int _TB9;
  char * _TBA;
  int * _TBB;
  int * _TBC;
  int _TBD;
  char * _TBE;
  int * _TBF;
  struct _fat_ptr _TC0;
  int _TC1;
  struct _fat_ptr _TC2;
  unsigned char * _TC3;
  unsigned char * _TC4;
  void * * _TC5;
  struct _fat_ptr _TC6;
  int _TC7;
  struct _fat_ptr _TC8;
  struct _fat_ptr _TC9;
  unsigned char * _TCA;
  unsigned char * _TCB;
  void * * _TCC;
  int _TCD;
  struct _fat_ptr _TCE;
  int _TCF;
  unsigned char * _TD0;
  void * * _TD1;
  struct _fat_ptr _TD2;
  unsigned char * _TD3;
  void * * _TD4;
  int _TD5;
  struct _fat_ptr _TD6;
  int _TD7;
  unsigned char * _TD8;
  void * * _TD9;
  struct _fat_ptr _TDA;
  unsigned char * _TDB;
  void * * _TDC;
  int _TDD;
  int * _TDE;
  int _TDF;
  char * _TE0;
  int * _TE1;
  int * _TE2;
  int _TE3;
  char * _TE4;
  int * _TE5;
  int base_ofs = 0;
  void * temp;
  int sp[40U];
  int sp_ofs;
  int i;
  int j;
  int limit_ofs;
  if (base_ofs < 0) { goto _TL2;
  }else { goto _TL4;
  }
  _TL4: _T0 = base_ofs + len;
  _T1 = (unsigned int)_T0;
  _T2 = arr;
  _T3 = _get_fat_size(_T2,sizeof(void *));
  if (_T1 > _T3) { goto _TL2;
  }else { goto _TL3;
  }
  _TL3: if (len < 0) { goto _TL2;
  }else { goto _TL0;
  }
  _TL2: { struct Cyc_Core_Invalid_argument_exn_struct * _TE6 = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _TE6->tag = Cyc_Core_Invalid_argument;
    _TE6->f1 = _tag_fat("Array::qsort",sizeof(char),13U);
    _T4 = (struct Cyc_Core_Invalid_argument_exn_struct *)_TE6;
  }_T5 = (void *)_T4;
  _throw(_T5);
  goto _TL1;
  _TL0: _TL1: limit_ofs = base_ofs + len;
  sp_ofs = 0;
  _TL8: if (1) { goto _TL6;
  }else { goto _TL7;
  }
  _TL6: _T6 = limit_ofs - base_ofs;
  if (_T6 <= 3) { goto _TL9;
  }
  _T7 = arr;
  _T8 = limit_ofs - base_ofs;
  _T9 = _T8 / 2;
  _TA = base_ofs;
  _TB = _T9 + _TA;
  _TC = _check_fat_subscript(_T7,sizeof(void *),_TB);
  _TD = (void * *)_TC;
  temp = *_TD;
  _TE = arr;
  _TF = _TE.curr;
  _T10 = (void * *)_TF;
  _T11 = limit_ofs - base_ofs;
  _T12 = _T11 / 2;
  _T13 = base_ofs;
  _T14 = _T12 + _T13;
  _T15 = arr;
  _T16 = base_ofs;
  _T17 = _check_fat_subscript(_T15,sizeof(void *),_T16);
  _T18 = (void * *)_T17;
  _T10[_T14] = *_T18;
  _T19 = arr;
  _T1A = _T19.curr;
  _T1B = (void * *)_T1A;
  _T1C = base_ofs;
  _T1B[_T1C] = temp;
  i = base_ofs + 1;
  j = limit_ofs - 1;
  _T1D = arr;
  _T1E = i;
  _T1F = _fat_ptr_plus(_T1D,sizeof(void *),_T1E);
  _T20 = _untag_fat_ptr_check_bound(_T1F,sizeof(void *),1U);
  _T21 = _check_null(_T20);
  _T22 = (void * *)_T21;
  _T23 = arr;
  _T24 = j;
  _T25 = _fat_ptr_plus(_T23,sizeof(void *),_T24);
  _T26 = _untag_fat_ptr_check_bound(_T25,sizeof(void *),1U);
  _T27 = _check_null(_T26);
  _T28 = (void * *)_T27;
  _T29 = less_eq(_T22,_T28);
  if (_T29 <= 0) { goto _TLB;
  }
  _T2A = arr;
  _T2B = i;
  _T2C = _check_fat_subscript(_T2A,sizeof(void *),_T2B);
  _T2D = (void * *)_T2C;
  temp = *_T2D;
  _T2E = arr;
  _T2F = _T2E.curr;
  _T30 = (void * *)_T2F;
  _T31 = i;
  _T32 = arr;
  _T33 = j;
  _T34 = _check_fat_subscript(_T32,sizeof(void *),_T33);
  _T35 = (void * *)_T34;
  _T30[_T31] = *_T35;
  _T36 = arr;
  _T37 = _T36.curr;
  _T38 = (void * *)_T37;
  _T39 = j;
  _T38[_T39] = temp;
  goto _TLC;
  _TLB: _TLC: _T3A = arr;
  _T3B = base_ofs;
  _T3C = _fat_ptr_plus(_T3A,sizeof(void *),_T3B);
  _T3D = _untag_fat_ptr_check_bound(_T3C,sizeof(void *),1U);
  _T3E = _check_null(_T3D);
  _T3F = (void * *)_T3E;
  _T40 = arr;
  _T41 = j;
  _T42 = _fat_ptr_plus(_T40,sizeof(void *),_T41);
  _T43 = _untag_fat_ptr(_T42,sizeof(void *),1U);
  _T44 = _check_null(_T43);
  _T45 = (void * *)_T44;
  _T46 = less_eq(_T3F,_T45);
  if (_T46 <= 0) { goto _TLD;
  }
  _T47 = arr;
  _T48 = _T47.curr;
  _T49 = (void * *)_T48;
  _T4A = base_ofs;
  temp = _T49[_T4A];
  _T4B = arr;
  _T4C = _T4B.curr;
  _T4D = (void * *)_T4C;
  _T4E = base_ofs;
  _T4F = arr;
  _T50 = j;
  _T51 = _check_fat_subscript(_T4F,sizeof(void *),_T50);
  _T52 = (void * *)_T51;
  _T4D[_T4E] = *_T52;
  _T53 = arr;
  _T54 = _T53.curr;
  _T55 = (void * *)_T54;
  _T56 = j;
  _T55[_T56] = temp;
  goto _TLE;
  _TLD: _TLE: _T57 = arr;
  _T58 = i;
  _T59 = _fat_ptr_plus(_T57,sizeof(void *),_T58);
  _T5A = _untag_fat_ptr(_T59,sizeof(void *),1U);
  _T5B = _check_null(_T5A);
  _T5C = (void * *)_T5B;
  _T5D = arr;
  _T5E = base_ofs;
  _T5F = _fat_ptr_plus(_T5D,sizeof(void *),_T5E);
  _T60 = _untag_fat_ptr(_T5F,sizeof(void *),1U);
  _T61 = _check_null(_T60);
  _T62 = (void * *)_T61;
  _T63 = less_eq(_T5C,_T62);
  if (_T63 <= 0) { goto _TLF;
  }
  _T64 = arr;
  _T65 = i;
  _T66 = _check_fat_subscript(_T64,sizeof(void *),_T65);
  _T67 = (void * *)_T66;
  temp = *_T67;
  _T68 = arr;
  _T69 = _T68.curr;
  _T6A = (void * *)_T69;
  _T6B = i;
  _T6C = arr;
  _T6D = _T6C.curr;
  _T6E = (void * *)_T6D;
  _T6F = base_ofs;
  _T6A[_T6B] = _T6E[_T6F];
  _T70 = arr;
  _T71 = _T70.curr;
  _T72 = (void * *)_T71;
  _T73 = base_ofs;
  _T72[_T73] = temp;
  goto _TL10;
  _TLF: _TL10: _TL14: if (1) { goto _TL12;
  }else { goto _TL13;
  }
  _TL12: _TL15: i = i + 1;
  _T74 = arr;
  _T75 = i;
  _T76 = _fat_ptr_plus(_T74,sizeof(void *),_T75);
  _T77 = _untag_fat_ptr_check_bound(_T76,sizeof(void *),1U);
  _T78 = _check_null(_T77);
  _T79 = (void * *)_T78;
  _T7A = arr;
  _T7B = base_ofs;
  _T7C = _fat_ptr_plus(_T7A,sizeof(void *),_T7B);
  _T7D = _untag_fat_ptr(_T7C,sizeof(void *),1U);
  _T7E = _check_null(_T7D);
  _T7F = (void * *)_T7E;
  _T80 = less_eq(_T79,_T7F);
  if (_T80 < 0) { goto _TL15;
  }else { goto _TL16;
  }
  _TL16: _TL17: j = j + -1;
  _T81 = arr;
  _T82 = j;
  _T83 = _fat_ptr_plus(_T81,sizeof(void *),_T82);
  _T84 = _untag_fat_ptr_check_bound(_T83,sizeof(void *),1U);
  _T85 = _check_null(_T84);
  _T86 = (void * *)_T85;
  _T87 = arr;
  _T88 = base_ofs;
  _T89 = _fat_ptr_plus(_T87,sizeof(void *),_T88);
  _T8A = _untag_fat_ptr(_T89,sizeof(void *),1U);
  _T8B = _check_null(_T8A);
  _T8C = (void * *)_T8B;
  _T8D = less_eq(_T86,_T8C);
  if (_T8D > 0) { goto _TL17;
  }else { goto _TL18;
  }
  _TL18: if (i <= j) { goto _TL19;
  }
  goto _TL13;
  _TL19: _T8E = arr;
  _T8F = i;
  _T90 = _check_fat_subscript(_T8E,sizeof(void *),_T8F);
  _T91 = (void * *)_T90;
  temp = *_T91;
  _T92 = arr;
  _T93 = _T92.curr;
  _T94 = (void * *)_T93;
  _T95 = i;
  _T96 = arr;
  _T97 = j;
  _T98 = _check_fat_subscript(_T96,sizeof(void *),_T97);
  _T99 = (void * *)_T98;
  _T94[_T95] = *_T99;
  _T9A = arr;
  _T9B = _T9A.curr;
  _T9C = (void * *)_T9B;
  _T9D = j;
  _T9C[_T9D] = temp;
  goto _TL14;
  _TL13: _T9E = arr;
  _T9F = _T9E.curr;
  _TA0 = (void * *)_T9F;
  _TA1 = base_ofs;
  temp = _TA0[_TA1];
  _TA2 = arr;
  _TA3 = _TA2.curr;
  _TA4 = (void * *)_TA3;
  _TA5 = base_ofs;
  _TA6 = arr;
  _TA7 = j;
  _TA8 = _check_fat_subscript(_TA6,sizeof(void *),_TA7);
  _TA9 = (void * *)_TA8;
  _TA4[_TA5] = *_TA9;
  _TAA = arr;
  _TAB = _TAA.curr;
  _TAC = (void * *)_TAB;
  _TAD = j;
  _TAC[_TAD] = temp;
  _TAE = j - base_ofs;
  _TAF = limit_ofs - i;
  if (_TAE <= _TAF) { goto _TL1B;
  }
  _TB0 = sp;
  _TB1 = sp_ofs;
  _TB2 = _check_known_subscript_notnull(_TB0,40U,sizeof(int),_TB1);
  _TB3 = (int *)_TB2;
  *_TB3 = base_ofs;
  _TB4 = sp;
  _TB5 = sp_ofs + 1;
  _TB6 = _check_known_subscript_notnull(_TB4,40U,sizeof(int),_TB5);
  _TB7 = (int *)_TB6;
  *_TB7 = j;
  base_ofs = i;
  goto _TL1C;
  _TL1B: _TB8 = sp;
  _TB9 = sp_ofs;
  _TBA = _check_known_subscript_notnull(_TB8,40U,sizeof(int),_TB9);
  _TBB = (int *)_TBA;
  *_TBB = i;
  _TBC = sp;
  _TBD = sp_ofs + 1;
  _TBE = _check_known_subscript_notnull(_TBC,40U,sizeof(int),_TBD);
  _TBF = (int *)_TBE;
  *_TBF = limit_ofs;
  limit_ofs = j;
  _TL1C: sp_ofs = sp_ofs + 2;
  goto _TLA;
  _TL9: j = base_ofs;
  i = j + 1;
  _TL20: if (i < limit_ofs) { goto _TL1E;
  }else { goto _TL1F;
  }
  _TL1E: _TL24: _TC0 = arr;
  _TC1 = j;
  _TC2 = _fat_ptr_plus(_TC0,sizeof(void *),_TC1);
  _TC3 = _untag_fat_ptr_check_bound(_TC2,sizeof(void *),1U);
  _TC4 = _check_null(_TC3);
  _TC5 = (void * *)_TC4;
  _TC6 = arr;
  _TC7 = j;
  _TC8 = _fat_ptr_plus(_TC6,sizeof(void *),_TC7);
  _TC9 = _fat_ptr_plus(_TC8,sizeof(void *),1);
  _TCA = _untag_fat_ptr_check_bound(_TC9,sizeof(void *),1U);
  _TCB = _check_null(_TCA);
  _TCC = (void * *)_TCB;
  _TCD = less_eq(_TC5,_TCC);
  if (_TCD > 0) { goto _TL22;
  }else { goto _TL23;
  }
  _TL22: _TCE = arr;
  _TCF = j;
  _TD0 = _check_fat_subscript(_TCE,sizeof(void *),_TCF);
  _TD1 = (void * *)_TD0;
  temp = *_TD1;
  _TD2 = arr;
  _TD3 = _TD2.curr;
  _TD4 = (void * *)_TD3;
  _TD5 = j;
  _TD6 = arr;
  _TD7 = j + 1;
  _TD8 = _check_fat_subscript(_TD6,sizeof(void *),_TD7);
  _TD9 = (void * *)_TD8;
  _TD4[_TD5] = *_TD9;
  _TDA = arr;
  _TDB = _TDA.curr;
  _TDC = (void * *)_TDB;
  _TDD = j + 1;
  _TDC[_TDD] = temp;
  if (j != base_ofs) { goto _TL25;
  }
  goto _TL23;
  _TL25: j = j + -1;
  goto _TL24;
  _TL23: j = i;
  i = i + 1;
  goto _TL20;
  _TL1F: if (sp_ofs == 0) { goto _TL27;
  }
  sp_ofs = sp_ofs - 2;
  _TDE = sp;
  _TDF = sp_ofs;
  _TE0 = _check_known_subscript_notnull(_TDE,40U,sizeof(int),_TDF);
  _TE1 = (int *)_TE0;
  base_ofs = *_TE1;
  _TE2 = sp;
  _TE3 = sp_ofs + 1;
  _TE4 = _check_known_subscript_notnull(_TE2,40U,sizeof(int),_TE3);
  _TE5 = (int *)_TE4;
  limit_ofs = *_TE5;
  goto _TL28;
  _TL27: goto _TL7;
  _TL28: _TLA: goto _TL8;
  _TL7: ;
}
Ejemplo n.º 4
0
int Cyc_Base64_encode(struct _fat_ptr src,struct _fat_ptr dest,unsigned int src_len) {
  struct _handler_cons * _T0;
  int _T1;
  struct _fat_ptr _T2;
  unsigned int _T3;
  unsigned int _T4;
  int _T5;
  unsigned char * _T6;
  const char * _T7;
  int _T8;
  struct _fat_ptr _T9;
  unsigned int _TA;
  int _TB;
  unsigned char * _TC;
  const char * _TD;
  char _TE;
  int _TF;
  struct _fat_ptr _T10;
  unsigned int _T11;
  int _T12;
  unsigned char * _T13;
  const char * _T14;
  char _T15;
  char _T16;
  int _T17;
  int _T18;
  int _T19;
  int _T1A;
  int _T1B;
  int _T1C;
  struct _fat_ptr _T1D;
  unsigned int _T1E;
  unsigned int _T1F;
  int _T20;
  unsigned char * _T21;
  char * _T22;
  char * _T23;
  int _T24;
  char * _T25;
  char * _T26;
  unsigned int _T27;
  unsigned char * _T28;
  char * _T29;
  struct _fat_ptr _T2A;
  unsigned int _T2B;
  unsigned int _T2C;
  int _T2D;
  unsigned char * _T2E;
  char * _T2F;
  char * _T30;
  int _T31;
  char * _T32;
  char * _T33;
  unsigned int _T34;
  unsigned char * _T35;
  char * _T36;
  struct _fat_ptr _T37;
  unsigned int _T38;
  unsigned int _T39;
  int _T3A;
  unsigned char * _T3B;
  char * _T3C;
  char * _T3D;
  int _T3E;
  char * _T3F;
  char * _T40;
  unsigned int _T41;
  unsigned char * _T42;
  char * _T43;
  struct _fat_ptr _T44;
  unsigned int _T45;
  unsigned int _T46;
  int _T47;
  unsigned char * _T48;
  char * _T49;
  char * _T4A;
  int _T4B;
  char * _T4C;
  char * _T4D;
  unsigned int _T4E;
  unsigned char * _T4F;
  char * _T50;
  unsigned int _T51;
  int _T52;
  struct _fat_ptr _T53;
  unsigned int _T54;
  int _T55;
  unsigned char * _T56;
  char * _T57;
  unsigned int _T58;
  unsigned char * _T59;
  char * _T5A;
  void * _T5B;
  struct _handler_cons _T5C;
  _T0 = &_T5C;
  _push_handler(_T0);
  { int _T5D = 0;
    _T1 = setjmp(_T5C.handler);
    if (! _T1) { goto _TL2;
    }
    _T5D = 1;
    goto _TL3;
    _TL2: _TL3: if (_T5D) { goto _TL4;
    }else { goto _TL6;
    }
    _TL6: { unsigned int i = 0U;
      unsigned int j = 0U;
      _TL7: if (i < src_len) { goto _TL8;
      }else { goto _TL9;
      }
      _TL8: _T2 = src;
      _T3 = i;
      i = _T3 + 1;
      _T4 = _T3;
      _T5 = (int)_T4;
      _T6 = _check_fat_subscript(_T2,sizeof(char),_T5);
      _T7 = (const char *)_T6;
      { char b1 = *_T7;
	if (i >= src_len) { goto _TLA;
	}
	_T9 = src;
	_TA = i;
	_TB = (int)_TA;
	_TC = _check_fat_subscript(_T9,sizeof(char),_TB);
	_TD = (const char *)_TC;
	_TE = *_TD;
	_T8 = (int)_TE;
	goto _TLB;
	_TLA: _T8 = 0;
	_TLB: { int b2 = _T8;
	  i = i + 1;
	  if (i >= src_len) { goto _TLC;
	  }
	  _T10 = src;
	  _T11 = i;
	  _T12 = (int)_T11;
	  _T13 = _check_fat_subscript(_T10,sizeof(char),_T12);
	  _T14 = (const char *)_T13;
	  _T15 = *_T14;
	  _TF = (int)_T15;
	  goto _TLD;
	  _TLC: _TF = 0;
	  _TLD: { int b3 = _TF;
	    i = i + 1;
	    _T16 = b1 << 16;
	    _T17 = (int)_T16;
	    _T18 = b2 << 8;
	    _T19 = _T17 | _T18;
	    _T1A = b3;
	    { int r = _T19 | _T1A;
	      int a = r >> 18;
	      _T1B = r >> 12;
	      { int b = _T1B & 63;
		_T1C = r >> 6;
		{ int c = _T1C & 63;
		  int d = r & 63;
		  _T1D = dest;
		  _T1E = j;
		  j = _T1E + 1;
		  _T1F = _T1E;
		  _T20 = (int)_T1F;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T1D,sizeof(char),
							 _T20);
		    _T21 = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T22 = (char *)_T21;
		    { char _T5F = *_T22;
		      _T23 = Cyc_Base64_encode_map;
		      _T24 = a;
		      _T25 = _check_known_subscript_notnull(_T23,65U,sizeof(char),
							    _T24);
		      _T26 = (char *)_T25;
		      { char _T60 = *_T26;
			_T27 = _get_fat_size(_T5E,sizeof(char));
			if (_T27 != 1U) { goto _TLE;
			}
			if (_T5F != 0) { goto _TLE;
			}
			if (_T60 == 0) { goto _TLE;
			}
			_throw_arraybounds();
			goto _TLF;
			_TLE: _TLF: _T28 = _T5E.curr;
			_T29 = (char *)_T28;
			*_T29 = _T60;
		      }
		    }
		  }_T2A = dest;
		  _T2B = j;
		  j = _T2B + 1;
		  _T2C = _T2B;
		  _T2D = (int)_T2C;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T2A,sizeof(char),
							 _T2D);
		    _T2E = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T2F = (char *)_T2E;
		    { char _T5F = *_T2F;
		      _T30 = Cyc_Base64_encode_map;
		      _T31 = b;
		      _T32 = _check_known_subscript_notnull(_T30,65U,sizeof(char),
							    _T31);
		      _T33 = (char *)_T32;
		      { char _T60 = *_T33;
			_T34 = _get_fat_size(_T5E,sizeof(char));
			if (_T34 != 1U) { goto _TL10;
			}
			if (_T5F != 0) { goto _TL10;
			}
			if (_T60 == 0) { goto _TL10;
			}
			_throw_arraybounds();
			goto _TL11;
			_TL10: _TL11: _T35 = _T5E.curr;
			_T36 = (char *)_T35;
			*_T36 = _T60;
		      }
		    }
		  }_T37 = dest;
		  _T38 = j;
		  j = _T38 + 1;
		  _T39 = _T38;
		  _T3A = (int)_T39;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T37,sizeof(char),
							 _T3A);
		    _T3B = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T3C = (char *)_T3B;
		    { char _T5F = *_T3C;
		      _T3D = Cyc_Base64_encode_map;
		      _T3E = c;
		      _T3F = _check_known_subscript_notnull(_T3D,65U,sizeof(char),
							    _T3E);
		      _T40 = (char *)_T3F;
		      { char _T60 = *_T40;
			_T41 = _get_fat_size(_T5E,sizeof(char));
			if (_T41 != 1U) { goto _TL12;
			}
			if (_T5F != 0) { goto _TL12;
			}
			if (_T60 == 0) { goto _TL12;
			}
			_throw_arraybounds();
			goto _TL13;
			_TL12: _TL13: _T42 = _T5E.curr;
			_T43 = (char *)_T42;
			*_T43 = _T60;
		      }
		    }
		  }_T44 = dest;
		  _T45 = j;
		  j = _T45 + 1;
		  _T46 = _T45;
		  _T47 = (int)_T46;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T44,sizeof(char),
							 _T47);
		    _T48 = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T49 = (char *)_T48;
		    { char _T5F = *_T49;
		      _T4A = Cyc_Base64_encode_map;
		      _T4B = d;
		      _T4C = _check_known_subscript_notnull(_T4A,65U,sizeof(char),
							    _T4B);
		      _T4D = (char *)_T4C;
		      { char _T60 = *_T4D;
			_T4E = _get_fat_size(_T5E,sizeof(char));
			if (_T4E != 1U) { goto _TL14;
			}
			if (_T5F != 0) { goto _TL14;
			}
			if (_T60 == 0) { goto _TL14;
			}
			_throw_arraybounds();
			goto _TL15;
			_TL14: _TL15: _T4F = _T5E.curr;
			_T50 = (char *)_T4F;
			*_T50 = _T60;
		      }
		    }
		  }
		}
	      }
	    }
	  }
	}
      }goto _TL7;
      _TL9: { unsigned int k = i - src_len;
	_TL19: _T51 = k;
	_T52 = (int)_T51;
	if (_T52) { goto _TL17;
	}else { goto _TL18;
	}
	_TL17: _T53 = dest;
	_T54 = j - k;
	_T55 = (int)_T54;
	{ struct _fat_ptr _T5E = _fat_ptr_plus(_T53,sizeof(char),_T55);
	  _T56 = _check_fat_subscript(_T5E,sizeof(char),0U);
	  _T57 = (char *)_T56;
	  { char _T5F = *_T57;
	    char _T60 = '=';
	    _T58 = _get_fat_size(_T5E,sizeof(char));
	    if (_T58 != 1U) { goto _TL1A;
	    }
	    if (_T5F != 0) { goto _TL1A;
	    }
	    if (_T60 == 0) { goto _TL1A;
	    }
	    _throw_arraybounds();
	    goto _TL1B;
	    _TL1A: _TL1B: _T59 = _T5E.curr;
	    _T5A = (char *)_T59;
	    *_T5A = _T60;
	  }
	}k = k + -1;
	goto _TL19;
	_TL18: ;
      }{ int _T5E = 0;
	_npop_handler(0);
	return _T5E;
      }
    }_pop_handler();
    goto _TL5;
    _TL4: _T5B = Cyc_Core_get_exn_thrown();
    { void * _T5E = (void *)_T5B;
      return 1;
      ;
    }_TL5: ;
  }
}
Ejemplo n.º 5
0
int Cyc_XP_fromstr(int n,struct _fat_ptr z,const char*str,int base){const char*_T0;unsigned _T1;int(*_T2)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T3)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T4;struct _fat_ptr _T5;int(*_T6)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T7)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T8;struct _fat_ptr _T9;const char*_TA;char _TB;int _TC;const char*_TD;char _TE;int _TF;int _T10;const char*_T11;int _T12;const char*_T13;char _T14;int _T15;const char*_T16;char _T17;int _T18;int _T19;char*_T1A;const char*_T1B;char _T1C;int _T1D;int _T1E;char*_T1F;char*_T20;char _T21;int _T22;int _T23;const char*_T24;char _T25;int _T26;const char*_T27;char _T28;int _T29;int _T2A;char*_T2B;const char*_T2C;char _T2D;int _T2E;int _T2F;char*_T30;char*_T31;char _T32;int _T33;int _T34;int _T35;int _T36;struct _fat_ptr _T37;struct _fat_ptr _T38;char*_T39;const char*_T3A;char _T3B;int _T3C;int _T3D;char*_T3E;char*_T3F;char _T40;int _T41;const char*_T42;int _T43;int _T44;
# 249
const char*p=str;_T0=p;_T1=(unsigned)_T0;
if(!_T1)goto _TL97;goto _TL98;_TL97: _T3=Cyc___assert_fail;{int(*_T45)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T3;_T2=_T45;}_T4=_tag_fat("p",sizeof(char),2U);_T5=_tag_fat("xp.cyc",sizeof(char),7U);_T2(_T4,_T5,250U);_TL98:
 if(base < 2)goto _TL99;if(base > 36)goto _TL99;goto _TL9A;_TL99: _T7=Cyc___assert_fail;{int(*_T45)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T7;_T6=_T45;}_T8=_tag_fat("base >= 2 && base <= 36",sizeof(char),24U);_T9=_tag_fat("xp.cyc",sizeof(char),7U);_T6(_T8,_T9,251U);_TL9A:
 _TL9B: _TA=_check_null(p);_TB=*_TA;_TC=(int)_TB;if(_TC)goto _TL9E;else{goto _TL9D;}_TL9E: _TD=p;_TE=*_TD;_TF=(int)_TE;_T10=isspace(_TF);if(_T10)goto _TL9C;else{goto _TL9D;}
_TL9C:{const char**_T45=& p;_T11=*_T45;_T12=*_T11;if(_T12==0)goto _TL9F;*_T45=*_T45 + 1;goto _TLA0;_TL9F: _throw_arraybounds();_TLA0:;}goto _TL9B;_TL9D: _T13=p;_T14=*_T13;_T15=(int)_T14;
if(!_T15)goto _TLA1;_T16=p;_T17=*_T16;_T18=(int)_T17;_T19=isalnum(_T18);if(!_T19)goto _TLA1;_T1A=Cyc_map;_T1B=p;_T1C=*_T1B;_T1D=(int)_T1C;_T1E=_T1D - 48;_T1F=_check_known_subscript_notnull(_T1A,75U,sizeof(char),_T1E);_T20=(char*)_T1F;_T21=*_T20;_T22=(int)_T21;_T23=base;if(_T22 >= _T23)goto _TLA1;{
int carry;
_TLA6: _T24=_check_null(p);_T25=*_T24;_T26=(int)_T25;if(_T26)goto _TLA8;else{goto _TLA5;}_TLA8: _T27=p;_T28=*_T27;_T29=(int)_T28;_T2A=isalnum(_T29);if(_T2A)goto _TLA7;else{goto _TLA5;}_TLA7: _T2B=Cyc_map;_T2C=p;_T2D=*_T2C;_T2E=(int)_T2D;_T2F=_T2E - 48;_T30=_check_known_subscript_notnull(_T2B,75U,sizeof(char),_T2F);_T31=(char*)_T30;_T32=*_T31;_T33=(int)_T32;_T34=base;if(_T33 < _T34)goto _TLA4;else{goto _TLA5;}
_TLA4: carry=Cyc_XP_product(n,z,z,base);_T35=carry;
if(!_T35)goto _TLA9;goto _TLA5;_TLA9: _T36=n;_T37=z;_T38=z;_T39=Cyc_map;_T3A=p;_T3B=*_T3A;_T3C=(int)_T3B;_T3D=_T3C - 48;_T3E=_check_known_subscript_notnull(_T39,75U,sizeof(char),_T3D);_T3F=(char*)_T3E;_T40=*_T3F;_T41=(int)_T40;
# 260
Cyc_XP_sum(_T36,_T37,_T38,_T41);{const char**_T45=& p;_T42=*_T45;_T43=*_T42;if(_T43==0)goto _TLAB;*_T45=*_T45 + 1;goto _TLAC;_TLAB: _throw_arraybounds();_TLAC:;}goto _TLA6;_TLA5: _T44=carry;
# 262
return _T44;}
# 264
_TLA1: return 0;}