Ejemplo n.º 1
0
void Cyc_Xarray_reuse(struct Cyc_Xarray_Xarray * xarr) {
  struct Cyc_Xarray_Xarray * _T0;
  struct Cyc_Xarray_Xarray * _T1;
  struct Cyc_Xarray_Xarray * _T2;
  void (* _T3)(void * *);
  void (* _T4)(void *);
  struct _fat_ptr _T5;
  unsigned char * _T6;
  void * * _T7;
  struct _fat_ptr newarr = _tag_fat(0,0,0);
  { struct _fat_ptr _T8 = newarr;
    _T0 = xarr;
    { struct _fat_ptr _T9 = _T0->elmts;
      newarr = _T9;
      _T1 = xarr;
      _T1->elmts = _T8;
    }
  }_T2 = xarr;
  _T2->num_elmts = 0;
  _T4 = Cyc_Core_ufree;
  { void (* _T8)(void * *) = (void (*)(void * *))_T4;
    _T3 = _T8;
  }_T5 = newarr;
  _T6 = _untag_fat_ptr_check_bound(_T5,sizeof(void *),1U);
  _T7 = (void * *)_T6;
  _T3(_T7);
}
Ejemplo n.º 2
0
enum Cyc_Lineno_token_val Cyc_Lineno_token_rec(struct Cyc_Lexing_lexbuf * lexbuf,
					       int lexstate) {
  int _T0;
  int _T1;
  struct Cyc_Lexing_lexbuf * _T2;
  void (* _T3)(struct Cyc_Lexing_lexbuf *);
  enum Cyc_Lineno_token_val _T4;
  struct Cyc_Lexing_Error_exn_struct * _T5;
  void * _T6;
  lexstate = Cyc_Lineno_lex_engine(lexstate,lexbuf);
  _T0 = lexstate;
  _T1 = (int)_T0;
  switch (_T1) {
  case 0: 
    return 1U;
  case 1: 
    return 0U;
  case 2: 
    return 2U;
  default: 
    _T2 = lexbuf;
    _T3 = _T2->refill_buff;
    _T3(lexbuf);
    _T4 = Cyc_Lineno_token_rec(lexbuf,lexstate);
    return _T4;
  }
  { struct Cyc_Lexing_Error_exn_struct * _T7 = _cycalloc(sizeof(struct Cyc_Lexing_Error_exn_struct));
    _T7->tag = Cyc_Lexing_Error;
    _T7->f1 = _tag_fat("some action didn't return!",sizeof(char),27U);
    _T5 = (struct Cyc_Lexing_Error_exn_struct *)_T7;
  }_T6 = (void *)_T5;
  _throw(_T6);
}
Ejemplo n.º 3
0
void Cyc_Hashtable_remove(struct Cyc_Hashtable_Table * t,void * key) {
  struct Cyc_Hashtable_Table * _T0;
  struct Cyc_Hashtable_Table * _T1;
  struct Cyc_Hashtable_Table * _T2;
  int (* _T3)(void *);
  int _T4;
  unsigned int _T5;
  struct _fat_ptr _T6;
  unsigned int _T7;
  struct _fat_ptr _T8;
  unsigned int _T9;
  int _TA;
  struct _fat_ptr _TB;
  unsigned char * _TC;
  unsigned char * _TD;
  struct Cyc_Hashtable_Bucket * _TE;
  void * _TF;
  struct Cyc_Hashtable_Cell * _T10;
  void * _T11;
  int _T12;
  struct Cyc_Hashtable_Bucket * _T13;
  struct Cyc_Hashtable_Cell * _T14;
  struct Cyc_Hashtable_Bucket * _T15;
  struct Cyc_Hashtable_Cell * _T16;
  struct Cyc_Hashtable_Cell * _T17;
  struct Cyc_Hashtable_Cell * _T18;
  void * _T19;
  struct Cyc_Hashtable_Cell * _T1A;
  void * _T1B;
  int _T1C;
  struct Cyc_Hashtable_Cell * _T1D;
  struct Cyc_Hashtable_Cell * _T1E;
  struct Cyc_Hashtable_Bucket * _T1F;
  struct Cyc_Hashtable_Cell * _T20;
  struct Cyc_Hashtable_Cell * _T21;
  _T0 = t;
  { struct _fat_ptr tab = _T0->tab;
    _T1 = t;
    { int (* cmp)(void *,void *) = _T1->cmp;
      _T2 = t;
      _T3 = _T2->hash;
      _T4 = _T3(key);
      _T5 = (unsigned int)_T4;
      _T6 = tab;
      _T7 = _get_fat_size(_T6,sizeof(struct Cyc_Hashtable_Bucket));
      { unsigned int bucket = _T5 % _T7;
	_T8 = tab;
	_T9 = bucket;
	_TA = (int)_T9;
	_TB = _fat_ptr_plus(_T8,sizeof(struct Cyc_Hashtable_Bucket),_TA);
	_TC = _untag_fat_ptr_check_bound(_TB,sizeof(struct Cyc_Hashtable_Bucket),
					 1U);
	_TD = _check_null(_TC);
	{ struct Cyc_Hashtable_Bucket * b = (struct Cyc_Hashtable_Bucket *)_TD;
	  _TE = b;
	  { struct Cyc_Hashtable_Cell * l = _TE->cells;
	    if (l != 0) { goto _TL20;
	    }
	    return;
	    _TL20: _TF = key;
	    _T10 = l;
	    _T11 = _T10->key;
	    _T12 = cmp(_TF,_T11);
	    if (_T12 != 0) { goto _TL22;
	    }
	    _T13 = b;
	    _T14 = l;
	    _T13->cells = _T14->next;
	    _T15 = b;
	    _T15->length = _T15->length + -1;
	    return;
	    _TL22: _T16 = l;
	    { struct Cyc_Hashtable_Cell * next = _T16->next;
	      _TL27: _T17 = _check_null(l);
	      _T18 = _T17->next;
	      if (_T18 != 0) { goto _TL25;
	      }else { goto _TL26;
	      }
	      _TL25: _T19 = key;
	      _T1A = _check_null(next);
	      _T1B = _T1A->key;
	      _T1C = cmp(_T19,_T1B);
	      if (_T1C != 0) { goto _TL28;
	      }
	      _T1D = l;
	      _T1E = next;
	      _T1D->next = _T1E->next;
	      _T1F = b;
	      _T1F->length = _T1F->length + -1;
	      return;
	      _TL28: _T20 = l;
	      l = _T20->next;
	      _T21 = next;
	      next = _T21->next;
	      goto _TL27;
	      _TL26: ;
	    }
	  }
	}
      }
    }
  }
}
Ejemplo n.º 4
0
struct _fat_ptr Cyc_XP_tostr(struct _fat_ptr str,int size,int base,int n,struct _fat_ptr x){struct _fat_ptr _T0;unsigned char*_T1;unsigned _T2;int(*_T3)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T4)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T5;struct _fat_ptr _T6;int(*_T7)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T8)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T9;struct _fat_ptr _TA;int(*_TB)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_TC)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _TD;struct _fat_ptr _TE;struct _fat_ptr _TF;int _T10;int _T11;unsigned char*_T12;char*_T13;struct _fat_ptr _T14;int _T15;unsigned char*_T16;const char*_T17;unsigned _T18;unsigned char*_T19;char*_T1A;struct _fat_ptr _T1B;int _T1C;unsigned char*_T1D;unsigned char*_T1E;unsigned char _T1F;int _T20;struct _fat_ptr _T21;unsigned char*_T22;unsigned char*_T23;unsigned char _T24;int _T25;int(*_T26)(struct _fat_ptr,struct _fat_ptr,unsigned);void*(*_T27)(struct _fat_ptr,struct _fat_ptr,unsigned);struct _fat_ptr _T28;struct _fat_ptr _T29;struct _fat_ptr _T2A;int _T2B;unsigned char*_T2C;char*_T2D;unsigned _T2E;unsigned char*_T2F;char*_T30;int _T31;int _T32;struct _fat_ptr _T33;int _T34;unsigned char*_T35;char*_T36;struct _fat_ptr _T37;int _T38;unsigned char*_T39;char*_T3A;struct _fat_ptr _T3B;int _T3C;unsigned char*_T3D;char*_T3E;unsigned _T3F;unsigned char*_T40;char*_T41;struct _fat_ptr _T42;int _T43;unsigned char*_T44;char*_T45;unsigned _T46;unsigned char*_T47;char*_T48;struct _fat_ptr _T49;
# 269
int i=0;_T0=str;_T1=_T0.curr;_T2=(unsigned)_T1;
if(!_T2)goto _TLAD;goto _TLAE;_TLAD: _T4=Cyc___assert_fail;{int(*_T4A)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T4;_T3=_T4A;}_T5=_tag_fat("str",sizeof(char),4U);_T6=_tag_fat("xp.cyc",sizeof(char),7U);_T3(_T5,_T6,270U);_TLAE:
 if(base < 2)goto _TLAF;if(base > 36)goto _TLAF;goto _TLB0;_TLAF: _T8=Cyc___assert_fail;{int(*_T4A)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T8;_T7=_T4A;}_T9=_tag_fat("base >= 2 && base <= 36",sizeof(char),24U);_TA=_tag_fat("xp.cyc",sizeof(char),7U);_T7(_T9,_TA,271U);_TLB0:
# 273
 _TLB1:{int r=Cyc_XP_quotient(n,x,x,base);
if(i >= size)goto _TLB3;goto _TLB4;_TLB3: _TC=Cyc___assert_fail;{int(*_T4A)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_TC;_TB=_T4A;}_TD=_tag_fat("i < size",sizeof(char),9U);_TE=_tag_fat("xp.cyc",sizeof(char),7U);_TB(_TD,_TE,274U);_TLB4: _TF=str;_T10=i;
i=_T10 + 1;_T11=_T10;{struct _fat_ptr _T4A=_fat_ptr_plus(_TF,sizeof(char),_T11);_T12=_check_fat_subscript(_T4A,sizeof(char),0U);_T13=(char*)_T12;{char _T4B=*_T13;_T14=Cyc_digits;_T15=r;_T16=_check_fat_subscript(_T14,sizeof(char),_T15);_T17=(const char*)_T16;{char _T4C=*_T17;_T18=_get_fat_size(_T4A,sizeof(char));if(_T18!=1U)goto _TLB5;if(_T4B!=0)goto _TLB5;if(_T4C==0)goto _TLB5;_throw_arraybounds();goto _TLB6;_TLB5: _TLB6: _T19=_T4A.curr;_T1A=(char*)_T19;*_T1A=_T4C;}}}
_TLB7: if(n > 1)goto _TLBA;else{goto _TLB9;}_TLBA: _T1B=x;_T1C=n - 1;_T1D=_check_fat_subscript(_T1B,sizeof(unsigned char),_T1C);_T1E=(unsigned char*)_T1D;_T1F=*_T1E;_T20=(int)_T1F;if(_T20==0)goto _TLB8;else{goto _TLB9;}
_TLB8: n=n + -1;goto _TLB7;_TLB9:;}
# 272
if(n > 1)goto _TLB1;else{goto _TLBB;}_TLBB: _T21=x;_T22=_check_fat_subscript(_T21,sizeof(unsigned char),0);_T23=(unsigned char*)_T22;_T24=*_T23;_T25=(int)_T24;if(_T25!=0)goto _TLB1;else{goto _TLB2;}_TLB2:
# 279
 if(i >= size)goto _TLBC;goto _TLBD;_TLBC: _T27=Cyc___assert_fail;{int(*_T4A)(struct _fat_ptr,struct _fat_ptr,unsigned)=(int(*)(struct _fat_ptr,struct _fat_ptr,unsigned))_T27;_T26=_T4A;}_T28=_tag_fat("i < size",sizeof(char),9U);_T29=_tag_fat("xp.cyc",sizeof(char),7U);_T26(_T28,_T29,279U);_TLBD: _T2A=str;_T2B=i;{struct _fat_ptr _T4A=_fat_ptr_plus(_T2A,sizeof(char),_T2B);_T2C=_check_fat_subscript(_T4A,sizeof(char),0U);_T2D=(char*)_T2C;{char _T4B=*_T2D;char _T4C='\000';_T2E=_get_fat_size(_T4A,sizeof(char));if(_T2E!=1U)goto _TLBE;if(_T4B!=0)goto _TLBE;if(_T4C==0)goto _TLBE;_throw_arraybounds();goto _TLBF;_TLBE: _TLBF: _T2F=_T4A.curr;_T30=(char*)_T2F;*_T30=_T4C;}}{
# 282
int j;
j=0;_TLC3: _T31=j;i=i + -1;_T32=i;if(_T31 < _T32)goto _TLC1;else{goto _TLC2;}
_TLC1: _T33=str;_T34=j;_T35=_check_fat_subscript(_T33,sizeof(char),_T34);_T36=(char*)_T35;{char c=*_T36;_T37=str;_T38=j;{struct _fat_ptr _T4A=_fat_ptr_plus(_T37,sizeof(char),_T38);_T39=_T4A.curr;_T3A=(char*)_T39;{char _T4B=*_T3A;_T3B=str;_T3C=i;_T3D=_check_fat_subscript(_T3B,sizeof(char),_T3C);_T3E=(char*)_T3D;{char _T4C=*_T3E;_T3F=_get_fat_size(_T4A,sizeof(char));if(_T3F!=1U)goto _TLC4;if(_T4B!=0)goto _TLC4;if(_T4C==0)goto _TLC4;_throw_arraybounds();goto _TLC5;_TLC4: _TLC5: _T40=_T4A.curr;_T41=(char*)_T40;*_T41=_T4C;}}}_T42=str;_T43=i;{struct _fat_ptr _T4A=_fat_ptr_plus(_T42,sizeof(char),_T43);_T44=_T4A.curr;_T45=(char*)_T44;{char _T4B=*_T45;char _T4C=c;_T46=_get_fat_size(_T4A,sizeof(char));if(_T46!=1U)goto _TLC6;if(_T4B!=0)goto _TLC6;if(_T4C==0)goto _TLC6;_throw_arraybounds();goto _TLC7;_TLC6: _TLC7: _T47=_T4A.curr;_T48=(char*)_T47;*_T48=_T4C;}}}
# 283
j=j + 1;goto _TLC3;_TLC2:;}_T49=str;
# 289
return _T49;}