예제 #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);
}
예제 #2
0
struct Cyc_APQ_T*Cyc_APQ_fromstr(struct _fat_ptr str,int base){void*_T0;struct _fat_ptr _T1;unsigned char*_T2;const char*_T3;char _T4;int _T5;struct _fat_ptr _T6;unsigned char*_T7;const char*_T8;char _T9;int _TA;struct _fat_ptr*_TB;struct Cyc_APQ_T*_TC;struct _fat_ptr _TD;unsigned char*_TE;const char*_TF;int _T10;struct _fat_ptr _T11;unsigned char*_T12;const char*_T13;char _T14;int _T15;struct _fat_ptr _T16;struct _fat_ptr _T17;unsigned char*_T18;const char*_T19;int _T1A;int _T1B;struct Cyc_APQ_T*_T1C;struct Cyc_Invalid_argument_exn_struct*_T1D;void*_T1E;struct Cyc_APQ_T*_T1F;struct Cyc_APQ_T*_T20;_T0=_cycalloc(sizeof(struct Cyc_APQ_T));{
struct Cyc_APQ_T*q=(struct Cyc_APQ_T*)_T0;
struct _fat_ptr s=str;
_TL6: _T1=s;_T2=_check_fat_subscript(_T1,sizeof(char),0U);_T3=(const char*)_T2;_T4=*_T3;_T5=(int)_T4;if(_T5)goto _TL9;else{goto _TL8;}_TL9: _T6=s;_T7=_T6.curr;_T8=(const char*)_T7;_T9=*_T8;_TA=(int)_T9;if(_TA!=47)goto _TL7;else{goto _TL8;}_TL7: _TB=& s;_fat_ptr_inplace_plus(_TB,sizeof(char),1);goto _TL6;_TL8: _TC=q;_TD=str;_TE=_untag_fat_ptr_check_bound(_TD,sizeof(char),1U);_TF=(const char*)_TE;_T10=base;
_TC->n=Cyc_AP_fromstr(_TF,_T10);_T11=s;_T12=_T11.curr;_T13=(const char*)_T12;_T14=*_T13;_T15=(int)_T14;
if(!_T15)goto _TLA;_T16=s;_T17=
_fat_ptr_plus(_T16,sizeof(char),1);_T18=_untag_fat_ptr_check_bound(_T17,sizeof(char),1U);_T19=(const char*)_T18;_T1A=base;{struct Cyc_AP_T*d=Cyc_AP_fromstr(_T19,_T1A);_T1B=
Cyc_AP_cmp(d,Cyc_AP_zero);if(!_T1B)goto _TLC;_T1C=q;
_T1C->d=d;goto _TLD;
_TLC:{struct Cyc_Invalid_argument_exn_struct*_T21=_cycalloc(sizeof(struct Cyc_Invalid_argument_exn_struct));_T21->tag=Cyc_Invalid_argument;_T21->f1=_tag_fat("APQ_fromstr: malformed string",sizeof(char),30U);_T1D=(struct Cyc_Invalid_argument_exn_struct*)_T21;}_T1E=(void*)_T1D;_throw(_T1E);_TLD:;}goto _TLB;
# 54
_TLA: _T1F=q;_T1F->d=Cyc_AP_one;_TLB: _T20=
Cyc_reduce(q);return _T20;}}
예제 #3
0
void Cyc_Hashtable_insert(struct Cyc_Hashtable_Table * t,void * key,void * val) {
  struct Cyc_Hashtable_Table * _T0;
  struct Cyc_Hashtable_Table * _T1;
  int (* _T2)(void *);
  int _T3;
  unsigned int _T4;
  struct _fat_ptr _T5;
  unsigned int _T6;
  struct _fat_ptr _T7;
  unsigned int _T8;
  int _T9;
  struct _fat_ptr _TA;
  unsigned char * _TB;
  unsigned char * _TC;
  struct Cyc_Hashtable_Bucket * _TD;
  struct Cyc_Hashtable_Cell * _TE;
  struct Cyc_Hashtable_Table * _TF;
  struct _RegionHandle * _T10;
  struct Cyc_Hashtable_Bucket * _T11;
  struct Cyc_Hashtable_Bucket * _T12;
  unsigned int _T13;
  struct Cyc_Hashtable_Bucket * _T14;
  unsigned int _T15;
  struct Cyc_Hashtable_Table * _T16;
  int _T17;
  unsigned int _T18;
  _T0 = t;
  { struct _fat_ptr tab = _T0->tab;
    _T1 = t;
    _T2 = _T1->hash;
    _T3 = _T2(key);
    _T4 = (unsigned int)_T3;
    _T5 = tab;
    _T6 = _get_fat_size(_T5,sizeof(struct Cyc_Hashtable_Bucket));
    { unsigned int bucket = _T4 % _T6;
      _T7 = tab;
      _T8 = bucket;
      _T9 = (int)_T8;
      _TA = _fat_ptr_plus(_T7,sizeof(struct Cyc_Hashtable_Bucket),_T9);
      _TB = _untag_fat_ptr_check_bound(_TA,sizeof(struct Cyc_Hashtable_Bucket),
				       1U);
      _TC = _check_null(_TB);
      { struct Cyc_Hashtable_Bucket * b = (struct Cyc_Hashtable_Bucket *)_TC;
	_TD = b;
	_TF = t;
	_T10 = _TF->r;
	{ struct Cyc_Hashtable_Cell * _T19 = _region_malloc(_T10,0U,sizeof(struct Cyc_Hashtable_Cell));
	  _T19->key = key;
	  _T19->value = val;
	  _T11 = b;
	  _T19->next = _T11->cells;
	  _TE = (struct Cyc_Hashtable_Cell *)_T19;
	}_TD->cells = _TE;
	_T12 = b;
	_T13 = _T12->length;
	{ unsigned int i = _T13 + 1U;
	  _T14 = b;
	  _T14->length = i;
	  _T15 = i;
	  _T16 = t;
	  _T17 = _T16->max_len;
	  _T18 = (unsigned int)_T17;
	  if (_T15 <= _T18) { goto _TL0;
	  }
	  Cyc_Hashtable_resize(t);
	  goto _TL1;
	  _TL0: _TL1: ;
	}
      }
    }
  }
}
예제 #4
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: ;
	    }
	  }
	}
      }
    }
  }
}
예제 #5
0
void Cyc_Array_msort(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;
  struct _fat_ptr _T6;
  int _T7;
  void * * _T8;
  unsigned int _T9;
  unsigned int _TA;
  struct _fat_ptr _TB;
  unsigned char * _TC;
  void * * _TD;
  void * * _TE;
  int _TF;
  int _T10;
  int _T11;
  int _T12;
  int _T13;
  int _T14;
  int _T15;
  int _T16;
  int _T17;
  int _T18;
  struct _fat_ptr _T19;
  int _T1A;
  struct _fat_ptr _T1B;
  unsigned char * _T1C;
  unsigned char * _T1D;
  void * * _T1E;
  struct _fat_ptr _T1F;
  int _T20;
  struct _fat_ptr _T21;
  unsigned char * _T22;
  unsigned char * _T23;
  void * * _T24;
  int _T25;
  struct _fat_ptr _T26;
  int _T27;
  int _T28;
  unsigned char * _T29;
  void * * _T2A;
  struct _fat_ptr _T2B;
  int _T2C;
  int _T2D;
  unsigned char * _T2E;
  void * * _T2F;
  struct _fat_ptr _T30;
  int _T31;
  int _T32;
  unsigned char * _T33;
  void * * _T34;
  struct _fat_ptr _T35;
  int _T36;
  int _T37;
  unsigned char * _T38;
  void * * _T39;
  struct _fat_ptr _T3A;
  int _T3B;
  int _T3C;
  unsigned char * _T3D;
  void * * _T3E;
  struct _fat_ptr _T3F;
  int _T40;
  int _T41;
  unsigned char * _T42;
  void * * _T43;
  struct _fat_ptr _T44;
  int _T45;
  int _T46;
  unsigned char * _T47;
  void * * _T48;
  struct _fat_ptr _T49;
  int _T4A;
  int _T4B;
  unsigned char * _T4C;
  void * * _T4D;
  int _T4E;
  int _T4F;
  long _T50;
  struct _fat_ptr _T51;
  unsigned char * _T52;
  void * * _T53;
  int _T54;
  struct _fat_ptr _T55;
  unsigned char * _T56;
  void * * _T57;
  int _T58;
  _T0 = len;
  _T1 = (unsigned int)_T0;
  _T2 = arr;
  _T3 = _get_fat_size(_T2,sizeof(void *));
  if (_T1 > _T3) { goto _TL2B;
  }else { goto _TL2C;
  }
  _TL2C: if (len < 0) { goto _TL2B;
  }else { goto _TL29;
  }
  _TL2B: { struct Cyc_Core_Invalid_argument_exn_struct * _T59 = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _T59->tag = Cyc_Core_Invalid_argument;
    _T59->f1 = _tag_fat("Array::msort",sizeof(char),13U);
    _T4 = (struct Cyc_Core_Invalid_argument_exn_struct *)_T59;
  }_T5 = (void *)_T4;
  _throw(_T5);
  goto _TL2A;
  _TL29: _TL2A: _T7 = len;
  { unsigned int _T59 = (unsigned int)_T7;
    _T9 = _check_times(_T59,sizeof(void *));
    { void * * _T5A = _cycalloc(_T9);
      { unsigned int _T5B = _T59;
	unsigned int i;
	i = 0;
	_TL30: if (i < _T5B) { goto _TL2E;
	}else { goto _TL2F;
	}
	_TL2E: _TA = i;
	_TB = arr;
	_TC = _TB.curr;
	_TD = (void * *)_TC;
	_TE = _check_null(_TD);
	_T5A[_TA] = _TE[0];
	i = i + 1;
	goto _TL30;
	_TL2F: ;
      }_T8 = (void * *)_T5A;
    }_T6 = _tag_fat(_T8,sizeof(void *),_T59);
  }{ struct _fat_ptr from = _T6;
    struct _fat_ptr to = arr;
    struct _fat_ptr swap;
    long swapped = 0;
    int stepsize;
    int start;
    int lstart;
    int lend;
    int rstart;
    int rend;
    int dest;
    stepsize = 1;
    _TL34: if (stepsize < len) { goto _TL32;
    }else { goto _TL33;
    }
    _TL32: swap = from;
    from = to;
    to = swap;
    dest = 0;
    start = 0;
    _TL38: if (start < len) { goto _TL36;
    }else { goto _TL37;
    }
    _TL36: lstart = start;
    _T10 = start + stepsize;
    _T11 = len;
    if (_T10 >= _T11) { goto _TL39;
    }
    _TF = start + stepsize;
    goto _TL3A;
    _TL39: _TF = len;
    _TL3A: rstart = _TF;
    lend = rstart;
    _T13 = start;
    _T14 = stepsize * 2;
    _T15 = _T13 + _T14;
    _T16 = len;
    if (_T15 >= _T16) { goto _TL3B;
    }
    _T17 = start;
    _T18 = stepsize * 2;
    _T12 = _T17 + _T18;
    goto _TL3C;
    _TL3B: _T12 = len;
    _TL3C: rend = _T12;
    _TL3D: if (lstart < lend) { goto _TL40;
    }else { goto _TL3F;
    }
    _TL40: if (rstart < rend) { goto _TL3E;
    }else { goto _TL3F;
    }
    _TL3E: _T19 = from;
    _T1A = lstart;
    _T1B = _fat_ptr_plus(_T19,sizeof(void *),_T1A);
    _T1C = _untag_fat_ptr_check_bound(_T1B,sizeof(void *),1U);
    _T1D = _check_null(_T1C);
    _T1E = (void * *)_T1D;
    _T1F = from;
    _T20 = rstart;
    _T21 = _fat_ptr_plus(_T1F,sizeof(void *),_T20);
    _T22 = _untag_fat_ptr_check_bound(_T21,sizeof(void *),1U);
    _T23 = _check_null(_T22);
    _T24 = (void * *)_T23;
    _T25 = less_eq(_T1E,_T24);
    if (_T25 > 0) { goto _TL41;
    }
    _T26 = to;
    _T27 = dest;
    dest = _T27 + 1;
    _T28 = _T27;
    _T29 = _check_fat_subscript(_T26,sizeof(void *),_T28);
    _T2A = (void * *)_T29;
    _T2B = from;
    _T2C = lstart;
    lstart = _T2C + 1;
    _T2D = _T2C;
    _T2E = _check_fat_subscript(_T2B,sizeof(void *),_T2D);
    _T2F = (void * *)_T2E;
    *_T2A = *_T2F;
    goto _TL42;
    _TL41: _T30 = to;
    _T31 = dest;
    dest = _T31 + 1;
    _T32 = _T31;
    _T33 = _check_fat_subscript(_T30,sizeof(void *),_T32);
    _T34 = (void * *)_T33;
    _T35 = from;
    _T36 = rstart;
    rstart = _T36 + 1;
    _T37 = _T36;
    _T38 = _check_fat_subscript(_T35,sizeof(void *),_T37);
    _T39 = (void * *)_T38;
    *_T34 = *_T39;
    _TL42: goto _TL3D;
    _TL3F: _TL43: if (lstart < lend) { goto _TL44;
    }else { goto _TL45;
    }
    _TL44: _T3A = to;
    _T3B = dest;
    dest = _T3B + 1;
    _T3C = _T3B;
    _T3D = _check_fat_subscript(_T3A,sizeof(void *),_T3C);
    _T3E = (void * *)_T3D;
    _T3F = from;
    _T40 = lstart;
    lstart = _T40 + 1;
    _T41 = _T40;
    _T42 = _check_fat_subscript(_T3F,sizeof(void *),_T41);
    _T43 = (void * *)_T42;
    *_T3E = *_T43;
    goto _TL43;
    _TL45: _TL46: if (rstart < rend) { goto _TL47;
    }else { goto _TL48;
    }
    _TL47: _T44 = to;
    _T45 = dest;
    dest = _T45 + 1;
    _T46 = _T45;
    _T47 = _check_fat_subscript(_T44,sizeof(void *),_T46);
    _T48 = (void * *)_T47;
    _T49 = from;
    _T4A = rstart;
    rstart = _T4A + 1;
    _T4B = _T4A;
    _T4C = _check_fat_subscript(_T49,sizeof(void *),_T4B);
    _T4D = (void * *)_T4C;
    *_T48 = *_T4D;
    goto _TL46;
    _TL48: _T4E = start;
    _T4F = stepsize * 2;
    start = _T4E + _T4F;
    goto _TL38;
    _TL37: stepsize = stepsize * 2;
    goto _TL34;
    _TL33: _T50 = swapped;
    if (! _T50) { goto _TL49;
    }
    { int i = 0;
      _TL4E: if (i < len) { goto _TL4C;
      }else { goto _TL4D;
      }
      _TL4C: _T51 = from;
      _T52 = _T51.curr;
      _T53 = (void * *)_T52;
      _T54 = i;
      _T55 = to;
      _T56 = _T55.curr;
      _T57 = (void * *)_T56;
      _T58 = i;
      _T53[_T54] = _T57[_T58];
      i = i + 1;
      goto _TL4E;
      _TL4D: ;
    }goto _TL4A;
    _TL49: _TL4A: ;
  }
}
예제 #6
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: ;
}
예제 #7
0
파일: main.c 프로젝트: pippijn/cyclone-boot
int Cyc_main(int argc,struct _fat_ptr argv) {
  struct Cyc___cycFILE * _T0;
  struct _fat_ptr _T1;
  struct _fat_ptr _T2;
  struct _fat_ptr _T3;
  unsigned char * _T4;
  struct _fat_ptr * _T5;
  struct _fat_ptr _T6;
  unsigned char * _T7;
  struct _fat_ptr * _T8;
  struct _fat_ptr _T9;
  struct _fat_ptr _TA;
  long _TB;
  struct _fat_ptr _TC;
  struct _fat_ptr _TD;
  struct _fat_ptr _TE;
  struct _fat_ptr _TF;
  struct _handler_cons * _T10;
  int _T11;
  struct _fat_ptr _T12;
  struct _fat_ptr _T13;
  struct _fat_ptr _T14;
  struct _fat_ptr _T15;
  void * _T16;
  struct Cyc___cycFILE * _T17;
  struct _fat_ptr _T18;
  struct _fat_ptr _T19;
  struct _fat_ptr _T1A;
  unsigned char * _T1B;
  unsigned char * _T1C;
  const char * _T1D;
  struct _handler_cons * _T1E;
  int _T1F;
  struct _fat_ptr _T20;
  struct Cyc___cycFILE * _T21;
  struct Cyc___cycFILE * _T22;
  struct Cyc_Syntax_Lexer_definition * _T23;
  struct Cyc_Syntax_Location * _T24;
  struct Cyc_Compact_Lex_tables * _T25;
  struct Cyc_List_List * _T26;
  struct Cyc_Syntax_Lexer_definition * _T27;
  struct Cyc_Syntax_Location * _T28;
  void * _T29;
  struct Cyc_Parser_Parser_error_exn_struct * _T2A;
  char * _T2B;
  char * _T2C;
  struct Cyc_String_pa_PrintArg_struct _T2D;
  struct Cyc_Int_pa_PrintArg_struct _T2E;
  int _T2F;
  struct Cyc___cycFILE * _T30;
  struct _fat_ptr _T31;
  struct _fat_ptr _T32;
  struct Cyc_Lexer_Lexical_error_exn_struct * _T33;
  char * _T34;
  char * _T35;
  struct Cyc_String_pa_PrintArg_struct _T36;
  struct Cyc_Int_pa_PrintArg_struct _T37;
  int _T38;
  struct Cyc_Int_pa_PrintArg_struct _T39;
  int _T3A;
  struct Cyc_String_pa_PrintArg_struct _T3B;
  struct Cyc___cycFILE * _T3C;
  struct _fat_ptr _T3D;
  struct _fat_ptr _T3E;
  struct Cyc_Output_Table_overflow_exn_struct * _T3F;
  char * _T40;
  char * _T41;
  struct Cyc_String_pa_PrintArg_struct _T42;
  struct Cyc___cycFILE * _T43;
  struct _fat_ptr _T44;
  struct _fat_ptr _T45;
  struct Cyc___cycFILE * _T46;
  struct _fat_ptr _T47;
  struct _fat_ptr _T48;
  struct _fat_ptr _T49;
  unsigned char * _T4A;
  unsigned char * _T4B;
  const char * _T4C;
  GC_blacklist_warn_clear();
  if (argc < 2) { goto _TL2;
  }else { goto _TL3;
  }
  _TL3: if (argc > 3) { goto _TL2;
  }else { goto _TL0;
  }
  _TL2: _T0 = Cyc_stderr;
  _T1 = _tag_fat("Usage: cyclex <input file> [<output file>]",sizeof(char),
		 43U);
  _T2 = _tag_fat(0U,sizeof(void *),0);
  Cyc_fprintf(_T0,_T1,_T2);
  return 1;
  _TL0: _T3 = argv;
  _T4 = _check_fat_subscript(_T3,sizeof(struct _fat_ptr),1);
  _T5 = (struct _fat_ptr *)_T4;
  { struct _fat_ptr source_name = *_T5;
    struct _fat_ptr dest_name;
    if (argc != 3) { goto _TL4;
    }
    _T6 = argv;
    _T7 = _check_fat_subscript(_T6,sizeof(struct _fat_ptr),2);
    _T8 = (struct _fat_ptr *)_T7;
    dest_name = *_T8;
    goto _TL5;
    _TL4: _T9 = source_name;
    _TA = _tag_fat(".cyl",sizeof(char),5U);
    _TB = Cyc_Filename_check_suffix(_T9,_TA);
    if (! _TB) { goto _TL6;
    }
    _TC = Cyc_Filename_chop_extension(source_name);
    _TD = _tag_fat(".cyc",sizeof(char),5U);
    dest_name = Cyc_strconcat(_TC,_TD);
    goto _TL7;
    _TL6: _TE = source_name;
    _TF = _tag_fat(".cyc",sizeof(char),5U);
    dest_name = Cyc_strconcat(_TE,_TF);
    _TL7: _TL5: { struct Cyc___cycFILE * ic;
      struct Cyc___cycFILE * oc;
      { struct _handler_cons _T4D;
	_T10 = &_T4D;
	_push_handler(_T10);
	{ int _T4E = 0;
	  _T11 = setjmp(_T4D.handler);
	  if (! _T11) { goto _TL8;
	  }
	  _T4E = 1;
	  goto _TL9;
	  _TL8: _TL9: if (_T4E) { goto _TLA;
	  }else { goto _TLC;
	  }
	  _TLC: _T12 = source_name;
	  _T13 = _tag_fat("rb",sizeof(char),3U);
	  ic = Cyc_file_open(_T12,_T13);
	  _T14 = dest_name;
	  _T15 = _tag_fat("w",sizeof(char),2U);
	  oc = Cyc_file_open(_T14,_T15);
	  _pop_handler();
	  goto _TLB;
	  _TLA: _T16 = Cyc_Core_get_exn_thrown();
	  { void * _T4F = (void *)_T16;
	    _T17 = Cyc_stderr;
	    _T18 = _tag_fat("trouble opening files",sizeof(char),22U);
	    _T19 = _tag_fat(0U,sizeof(void *),0);
	    Cyc_fprintf(_T17,_T18,_T19);
	    _T1A = dest_name;
	    _T1B = _untag_fat_ptr_check_bound(_T1A,sizeof(char),1U);
	    _T1C = _check_null(_T1B);
	    _T1D = (const char *)_T1C;
	    remove(_T1D);
	    return 1;
	    ;
	  }_TLB: ;
	}
      }{ struct _handler_cons _T4D;
	_T1E = &_T4D;
	_push_handler(_T1E);
	{ int _T4E = 0;
	  _T1F = setjmp(_T4D.handler);
	  if (! _T1F) { goto _TLD;
	  }
	  _T4E = 1;
	  goto _TLE;
	  _TLD: _TLE: if (_T4E) { goto _TLF;
	  }else { goto _TL11;
	  }
	  _TL11: { struct Cyc_Syntax_Lexer_definition * def = Cyc_Parser_parse_file(ic);
	    struct _tuple6 * _T4F = Cyc_Lexgen_make_dfa(def);
	    struct _fat_ptr _T50;
	    struct Cyc_List_List * _T51;
	    { struct _tuple6 _T52 = *_T4F;
	      _T51 = _T52.f0;
	      _T50 = _T52.f1;
	    }{ struct Cyc_List_List * entries = _T51;
	      struct _fat_ptr transitions = _T50;
	      struct Cyc_Compact_Lex_tables * tables = Cyc_Compact_compact_tables(transitions);
	      _T20 = source_name;
	      _T21 = ic;
	      _T22 = oc;
	      _T23 = _check_null(def);
	      _T24 = _T23->header;
	      _T25 = tables;
	      _T26 = entries;
	      _T27 = def;
	      _T28 = _T27->trailer;
	      Cyc_Output_output_lexdef(_T20,_T21,_T22,_T24,_T25,_T26,_T28);
	    }
	  }_pop_handler();
	  goto _TL10;
	  _TLF: _T29 = Cyc_Core_get_exn_thrown();
	  { void * _T4F = (void *)_T29;
	    void * _T50;
	    int _T51;
	    int _T52;
	    struct _fat_ptr _T53;
	    _T2A = (struct Cyc_Parser_Parser_error_exn_struct *)_T4F;
	    _T2B = _T2A->tag;
	    _T2C = Cyc_Parser_Parser_error;
	    if (_T2B != _T2C) { goto _TL12;
	    }
	    { struct Cyc_Parser_Parser_error_exn_struct * _T54 = (struct Cyc_Parser_Parser_error_exn_struct *)_T4F;
	      _T53 = _T54->f1;
	    }{ struct _fat_ptr s = _T53;
	      { struct Cyc_String_pa_PrintArg_struct _T54;
		_T54.tag = 0;
		_T54.f1 = source_name;
		_T2D = _T54;
	      }{ struct Cyc_String_pa_PrintArg_struct _T54 = _T2D;
		{ struct Cyc_Int_pa_PrintArg_struct _T55;
		  _T55.tag = 1;
		  _T2F = Cyc_Lexer_line_num;
		  _T55.f1 = (unsigned long)_T2F;
		  _T2E = _T55;
		}{ struct Cyc_Int_pa_PrintArg_struct _T55 = _T2E;
		  void * _T56[2];
		  _T56[0] = &_T54;
		  _T56[1] = &_T55;
		  _T30 = Cyc_stderr;
		  _T31 = _tag_fat("File \"%s\", line %d: syntax error.\n",
				  sizeof(char),35U);
		  _T32 = _tag_fat(_T56,sizeof(void *),2);
		  Cyc_fprintf(_T30,_T31,_T32);
		}
	      }goto _LL6;
	    }_TL12: _T33 = (struct Cyc_Lexer_Lexical_error_exn_struct *)_T4F;
	    _T34 = _T33->tag;
	    _T35 = Cyc_Lexer_Lexical_error;
	    if (_T34 != _T35) { goto _TL14;
	    }
	    { struct Cyc_Lexer_Lexical_error_exn_struct * _T54 = (struct Cyc_Lexer_Lexical_error_exn_struct *)_T4F;
	      _T53 = _T54->f1;
	      _T52 = _T54->f2;
	      _T51 = _T54->f3;
	    }{ struct _fat_ptr msg = _T53;
	      int line = _T52;
	      int col = _T51;
	      { struct Cyc_String_pa_PrintArg_struct _T54;
		_T54.tag = 0;
		_T54.f1 = source_name;
		_T36 = _T54;
	      }{ struct Cyc_String_pa_PrintArg_struct _T54 = _T36;
		{ struct Cyc_Int_pa_PrintArg_struct _T55;
		  _T55.tag = 1;
		  _T38 = line;
		  _T55.f1 = (unsigned long)_T38;
		  _T37 = _T55;
		}{ struct Cyc_Int_pa_PrintArg_struct _T55 = _T37;
		  { struct Cyc_Int_pa_PrintArg_struct _T56;
		    _T56.tag = 1;
		    _T3A = col;
		    _T56.f1 = (unsigned long)_T3A;
		    _T39 = _T56;
		  }{ struct Cyc_Int_pa_PrintArg_struct _T56 = _T39;
		    { struct Cyc_String_pa_PrintArg_struct _T57;
		      _T57.tag = 0;
		      _T57.f1 = msg;
		      _T3B = _T57;
		    }{ struct Cyc_String_pa_PrintArg_struct _T57 = _T3B;
		      void * _T58[4];
		      _T58[0] = &_T54;
		      _T58[1] = &_T55;
		      _T58[2] = &_T56;
		      _T58[3] = &_T57;
		      _T3C = Cyc_stderr;
		      _T3D = _tag_fat("File \"%s\", line %d, character %d: %s.\n",
				      sizeof(char),39U);
		      _T3E = _tag_fat(_T58,sizeof(void *),4);
		      Cyc_fprintf(_T3C,_T3D,_T3E);
		    }
		  }
		}
	      }goto _LL6;
	    }_TL14: _T3F = (struct Cyc_Output_Table_overflow_exn_struct *)_T4F;
	    _T40 = _T3F->tag;
	    _T41 = Cyc_Output_Table_overflow;
	    if (_T40 != _T41) { goto _TL16;
	    }
	    { struct Cyc_String_pa_PrintArg_struct _T54;
	      _T54.tag = 0;
	      _T54.f1 = source_name;
	      _T42 = _T54;
	    }{ struct Cyc_String_pa_PrintArg_struct _T54 = _T42;
	      void * _T55[1];
	      _T55[0] = &_T54;
	      _T43 = Cyc_stderr;
	      _T44 = _tag_fat("File \"%s\":\ntransition table overflow, automaton is too big\n",
			      sizeof(char),60U);
	      _T45 = _tag_fat(_T55,sizeof(void *),1);
	      Cyc_fprintf(_T43,_T44,_T45);
	    }goto _LL6;
	    _TL16: _T50 = _T4F;
	    { void * exn = _T50;
	      _T46 = Cyc_stderr;
	      _T47 = _tag_fat("error in parsing, generation, compaction, or output",
			      sizeof(char),52U);
	      _T48 = _tag_fat(0U,sizeof(void *),0);
	      Cyc_fprintf(_T46,_T47,_T48);
	      _T49 = dest_name;
	      _T4A = _untag_fat_ptr_check_bound(_T49,sizeof(char),1U);
	      _T4B = _check_null(_T4A);
	      _T4C = (const char *)_T4B;
	      remove(_T4C);
	      _throw(exn);
	      return 1;
	    }_LL6: ;
	  }_TL10: ;
	}
      }return 0;
    }
  }
}
예제 #8
0
void Cyc_Xarray_add(struct Cyc_Xarray_Xarray * xarr,void * a) {
  struct Cyc_Xarray_Xarray * _T0;
  int _T1;
  unsigned int _T2;
  struct Cyc_Xarray_Xarray * _T3;
  struct _fat_ptr _T4;
  unsigned int _T5;
  struct Cyc_Xarray_Xarray * _T6;
  int _T7;
  struct Cyc_Xarray_Xarray * _T8;
  void * * _T9;
  void * * _TA;
  unsigned int _TB;
  unsigned int _TC;
  unsigned int _TD;
  struct _fat_ptr _TE;
  struct Cyc_Xarray_Xarray * _TF;
  int _T10;
  int _T11;
  void * * _T12;
  unsigned int _T13;
  unsigned int _T14;
  unsigned int _T15;
  struct Cyc_Xarray_Xarray * _T16;
  struct _fat_ptr _T17;
  unsigned char * _T18;
  void * * _T19;
  void * * _T1A;
  int _T1B;
  struct Cyc_Xarray_Xarray * _T1C;
  int _T1D;
  struct _fat_ptr _T1E;
  int _T1F;
  unsigned char * _T20;
  void * * _T21;
  struct Cyc_Xarray_Xarray * _T22;
  struct _fat_ptr _T23;
  int _T24;
  unsigned char * _T25;
  void * * _T26;
  struct Cyc_Xarray_Xarray * _T27;
  struct Cyc_Xarray_Xarray * _T28;
  void (* _T29)(void * *);
  void (* _T2A)(void *);
  struct _fat_ptr _T2B;
  unsigned char * _T2C;
  void * * _T2D;
  struct Cyc_Xarray_Xarray * _T2E;
  struct _fat_ptr _T2F;
  struct Cyc_Xarray_Xarray * _T30;
  int _T31;
  int _T32;
  unsigned char * _T33;
  void * * _T34;
  _T0 = xarr;
  _T1 = _T0->num_elmts;
  _T2 = (unsigned int)_T1;
  _T3 = xarr;
  _T4 = _T3->elmts;
  _T5 = _get_fat_size(_T4,sizeof(void *));
  if (_T2 != _T5) { goto _TL10;
  }
  _T6 = xarr;
  _T7 = _T6->num_elmts;
  if (_T7 != 0) { goto _TL12;
  }
  _T8 = xarr;
  { unsigned int _T35 = 10U;
    _TB = Cyc_Core_unique_qual;
    _TC = _check_times(_T35,sizeof(void *));
    { void * * _T36 = _aqual_malloc(_TB,_TC);
      { unsigned int _T37 = _T35;
	unsigned int i;
	i = 0;
	_TL17: if (i < _T37) { goto _TL15;
	}else { goto _TL16;
	}
	_TL15: _TD = i;
	_T36[_TD] = a;
	i = i + 1;
	goto _TL17;
	_TL16: ;
      }_TA = (void * *)_T36;
    }_T9 = _TA;
  }_T8->elmts = _tag_fat(_T9,sizeof(void *),10U);
  goto _TL13;
  _TL12: _TF = xarr;
  _T10 = _TF->num_elmts;
  _T11 = _T10 * 2;
  { unsigned int _T35 = (unsigned int)_T11;
    _T13 = Cyc_Core_unique_qual;
    _T14 = _check_times(_T35,sizeof(void *));
    { void * * _T36 = _aqual_malloc(_T13,_T14);
      { unsigned int _T37 = _T35;
	unsigned int i;
	i = 0;
	_TL1B: if (i < _T37) { goto _TL19;
	}else { goto _TL1A;
	}
	_TL19: _T15 = i;
	_T16 = xarr;
	_T17 = _T16->elmts;
	_T18 = _T17.curr;
	_T19 = (void * *)_T18;
	_T1A = _check_null(_T19);
	_T36[_T15] = _T1A[0];
	i = i + 1;
	goto _TL1B;
	_TL1A: ;
      }_T12 = (void * *)_T36;
    }_TE = _tag_fat(_T12,sizeof(void *),_T35);
  }{ struct _fat_ptr newarr = _TE;
    { int i = 1;
      _TL1F: _T1B = i;
      _T1C = xarr;
      _T1D = _T1C->num_elmts;
      if (_T1B < _T1D) { goto _TL1D;
      }else { goto _TL1E;
      }
      _TL1D: _T1E = newarr;
      _T1F = i;
      _T20 = _check_fat_subscript(_T1E,sizeof(void *),_T1F);
      _T21 = (void * *)_T20;
      _T22 = xarr;
      _T23 = _T22->elmts;
      _T24 = i;
      _T25 = _check_fat_subscript(_T23,sizeof(void *),_T24);
      _T26 = (void * *)_T25;
      *_T21 = *_T26;
      i = i + 1;
      goto _TL1F;
      _TL1E: ;
    }_T27 = xarr;
    { struct _fat_ptr _T35 = _T27->elmts;
      struct _fat_ptr _T36 = newarr;
      _T28 = xarr;
      _T28->elmts = _T36;
      newarr = _T35;
    }_T2A = Cyc_Core_ufree;
    { void (* _T35)(void * *) = (void (*)(void * *))_T2A;
      _T29 = _T35;
    }_T2B = newarr;
    _T2C = _untag_fat_ptr_check_bound(_T2B,sizeof(void *),1U);
    _T2D = (void * *)_T2C;
    _T29(_T2D);
  }_TL13: goto _TL11;
  _TL10: _TL11: _T2E = xarr;
  _T2F = _T2E->elmts;
  _T30 = xarr;
  _T31 = _T30->num_elmts;
  _T30->num_elmts = _T31 + 1;
  _T32 = _T31;
  _T33 = _check_fat_subscript(_T2F,sizeof(void *),_T32);
  _T34 = (void * *)_T33;
  *_T34 = a;
}