Example #1
0
long Cyc_Hashtable_try_lookup(struct Cyc_Hashtable_Table * t,void * key,void * * data) {
  struct Cyc_Hashtable_Table * _T0;
  struct Cyc_Hashtable_Table * _T1;
  struct _fat_ptr _T2;
  unsigned char * _T3;
  struct Cyc_Hashtable_Bucket * _T4;
  struct Cyc_Hashtable_Bucket * _T5;
  struct Cyc_Hashtable_Table * _T6;
  int (* _T7)(void *);
  int _T8;
  unsigned int _T9;
  struct _fat_ptr _TA;
  unsigned int _TB;
  unsigned int _TC;
  int _TD;
  struct Cyc_Hashtable_Bucket _TE;
  struct Cyc_Hashtable_Cell * _TF;
  void * _T10;
  void * _T11;
  int _T12;
  void * * _T13;
  struct Cyc_Hashtable_Cell * _T14;
  struct Cyc_Hashtable_Cell * _T15;
  _T0 = t;
  { struct _fat_ptr tab = _T0->tab;
    _T1 = t;
    { int (* cmp)(void *,void *) = _T1->cmp;
      _T2 = tab;
      _T3 = _T2.curr;
      _T4 = (struct Cyc_Hashtable_Bucket *)_T3;
      _T5 = _check_null(_T4);
      _T6 = t;
      _T7 = _T6->hash;
      _T8 = _T7(key);
      _T9 = (unsigned int)_T8;
      _TA = tab;
      _TB = _get_fat_size(_TA,sizeof(struct Cyc_Hashtable_Bucket));
      _TC = _T9 % _TB;
      _TD = (int)_TC;
      _TE = _T5[_TD];
      { struct Cyc_Hashtable_Cell * p = _TE.cells;
	_TL1D: if (p != 0) { goto _TL1B;
	}else { goto _TL1C;
	}
	_TL1B: _TF = p;
	_T10 = _TF->key;
	_T11 = key;
	_T12 = cmp(_T10,_T11);
	if (_T12 != 0) { goto _TL1E;
	}
	_T13 = data;
	_T14 = p;
	*_T13 = _T14->value;
	return 1;
	_TL1E: _T15 = p;
	p = _T15->next;
	goto _TL1D;
	_TL1C: return 0;
      }
    }
  }
}
Example #2
0
static struct Cyc_Dict_Dict Cyc_Callgraph_cg_topdecls(struct Cyc_Hashtable_Table * fds,
						      struct Cyc_Dict_Dict cg,
						      struct Cyc_List_List * ds) {
  struct Cyc_Set_Set * (* _T0)(int (*)(struct Cyc_Absyn_Fndecl *,struct Cyc_Absyn_Fndecl *));
  struct Cyc_Set_Set * (* _T1)(int (*)(void *,void *));
  struct Cyc_List_List * _T2;
  void * _T3;
  struct Cyc_Absyn_Decl * _T4;
  int * _T5;
  unsigned int _T6;
  struct Cyc_Dict_Dict (* _T7)(struct Cyc_Dict_Dict,struct Cyc_Absyn_Fndecl *,
			       struct Cyc_Set_Set *);
  struct Cyc_Dict_Dict (* _T8)(struct Cyc_Dict_Dict,void *,struct Cyc_Set_Set *);
  struct Cyc_Dict_Dict _T9;
  struct Cyc_Absyn_Fndecl * _TA;
  struct Cyc_Hashtable_Table * _TB;
  struct Cyc_Absyn_Fndecl * _TC;
  struct Cyc_Absyn_Stmt * _TD;
  struct Cyc_Set_Set * _TE;
  struct Cyc_Set_Set * _TF;
  struct Cyc_List_List * _T10;
  struct Cyc_Dict_Dict _T11;
  _T1 = Cyc_Set_empty;
  { struct Cyc_Set_Set * (* _T12)(int (*)(struct Cyc_Absyn_Fndecl *,struct Cyc_Absyn_Fndecl *)) = (struct Cyc_Set_Set * (*)(int (*)(struct Cyc_Absyn_Fndecl *,
																    struct Cyc_Absyn_Fndecl *)))_T1;
    _T0 = _T12;
  }{ struct Cyc_Set_Set * mt = _T0(Cyc_Callgraph_fndecl_cmp);
    { struct Cyc_List_List * _T12 = ds;
      struct Cyc_List_List * ds = _T12;
      _TLD: if (ds != 0) { goto _TLB;
      }else { goto _TLC;
      }
      _TLB: _T2 = ds;
      _T3 = _T2->hd;
      _T4 = (struct Cyc_Absyn_Decl *)_T3;
      { void * _T13 = _T4->r;
	struct Cyc_List_List * _T14;
	struct Cyc_Absyn_Fndecl * _T15;
	_T5 = (int *)_T13;
	_T6 = *_T5;
	switch (_T6) {
	case 1: 
	  { struct Cyc_Absyn_Fn_d_Absyn_Raw_decl_struct * _T16 = (struct Cyc_Absyn_Fn_d_Absyn_Raw_decl_struct *)_T13;
	    _T15 = _T16->f1;
	  }{ struct Cyc_Absyn_Fndecl * fd = _T15;
	    _T8 = Cyc_Graph_add_edges;
	    { struct Cyc_Dict_Dict (* _T16)(struct Cyc_Dict_Dict,struct Cyc_Absyn_Fndecl *,
					    struct Cyc_Set_Set *) = (struct Cyc_Dict_Dict (*)(struct Cyc_Dict_Dict,
											      struct Cyc_Absyn_Fndecl *,
											      struct Cyc_Set_Set *))_T8;
	      _T7 = _T16;
	    }_T9 = cg;
	    _TA = fd;
	    _TB = fds;
	    _TC = fd;
	    _TD = _TC->body;
	    _TE = mt;
	    _TF = Cyc_Callgraph_cg_stmt(_TB,_TD,_TE);
	    cg = _T7(_T9,_TA,_TF);
	    goto _LL0;
	  }
	case 10: 
	  { struct Cyc_Absyn_Using_d_Absyn_Raw_decl_struct * _T16 = (struct Cyc_Absyn_Using_d_Absyn_Raw_decl_struct *)_T13;
	    _T14 = _T16->f2;
	  }{ struct Cyc_List_List * ds = _T14;
	    _T14 = ds;
	    goto _LL6;
	  }
	case 9: 
	  { struct Cyc_Absyn_Namespace_d_Absyn_Raw_decl_struct * _T16 = (struct Cyc_Absyn_Namespace_d_Absyn_Raw_decl_struct *)_T13;
	    _T14 = _T16->f2;
	  }_LL6: { struct Cyc_List_List * ds = _T14;
	    cg = Cyc_Callgraph_cg_topdecls(fds,cg,ds);
	    goto _LL0;
	  }
	default: 
	  goto _LL0;
	}
	_LL0: ;
      }_T10 = ds;
      ds = _T10->tl;
      goto _TLD;
      _TLC: ;
    }_T11 = cg;
    return _T11;
  }
}
Example #3
0
void * Cyc_Hashtable_lookup(struct Cyc_Hashtable_Table * t,void * key) {
  struct Cyc_Hashtable_Table * _T0;
  struct Cyc_Hashtable_Table * _T1;
  struct _fat_ptr _T2;
  unsigned char * _T3;
  struct Cyc_Hashtable_Bucket * _T4;
  struct Cyc_Hashtable_Bucket * _T5;
  struct Cyc_Hashtable_Table * _T6;
  int (* _T7)(void *);
  int _T8;
  unsigned int _T9;
  struct _fat_ptr _TA;
  unsigned int _TB;
  unsigned int _TC;
  int _TD;
  struct Cyc_Hashtable_Bucket _TE;
  struct Cyc_Hashtable_Cell * _TF;
  void * _T10;
  void * _T11;
  int _T12;
  struct Cyc_Hashtable_Cell * _T13;
  void * _T14;
  struct Cyc_Hashtable_Cell * _T15;
  struct Cyc_Core_Not_found_exn_struct * _T16;
  struct Cyc_Core_Not_found_exn_struct * _T17;
  _T0 = t;
  { struct _fat_ptr tab = _T0->tab;
    _T1 = t;
    { int (* cmp)(void *,void *) = _T1->cmp;
      _T2 = tab;
      _T3 = _T2.curr;
      _T4 = (struct Cyc_Hashtable_Bucket *)_T3;
      _T5 = _check_null(_T4);
      _T6 = t;
      _T7 = _T6->hash;
      _T8 = _T7(key);
      _T9 = (unsigned int)_T8;
      _TA = tab;
      _TB = _get_fat_size(_TA,sizeof(struct Cyc_Hashtable_Bucket));
      _TC = _T9 % _TB;
      _TD = (int)_TC;
      _TE = _T5[_TD];
      { struct Cyc_Hashtable_Cell * p = _TE.cells;
	_TL5: if (p != 0) { goto _TL3;
	}else { goto _TL4;
	}
	_TL3: _TF = p;
	_T10 = _TF->key;
	_T11 = key;
	_T12 = cmp(_T10,_T11);
	if (_T12 != 0) { goto _TL6;
	}
	_T13 = p;
	_T14 = _T13->value;
	return _T14;
	_TL6: _T15 = p;
	p = _T15->next;
	goto _TL5;
	_TL4: _T16 = &Cyc_Core_Not_found_val;
	_T17 = (struct Cyc_Core_Not_found_exn_struct *)_T16;
	_throw(_T17);
      }
    }
  }
}
Example #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;}