Пример #1
0
struct Cyc_Set_Set*Cyc_Set_intersect(struct Cyc_Set_Set*s1,struct Cyc_Set_Set*s2){struct Cyc_Set_Set*_T0;struct Cyc_Set_Set*_T1;struct Cyc_Set_Set*_T2;struct Cyc_Set_Set*_T3;struct Cyc_Set_Set*_T4;struct Cyc_Set_Set*_T5;struct Cyc_List_List*_T6;void*_T7;struct Cyc_List_List*_T8;void*_T9;struct Cyc_List_List*_TA;struct Cyc_List_List*_TB;struct Cyc_List_List*_TC;struct Cyc_List_List*_TD;struct Cyc_List_List*_TE;struct Cyc_List_List*_TF;struct Cyc_List_List*_T10;struct Cyc_List_List*_T11;struct Cyc_List_List*_T12;struct Cyc_List_List*_T13;struct Cyc_Set_Set*_T14;
if(s1!=s2)goto _TL54;_T0=s1;
return _T0;_TL54: _T1=s1;{
int(*comp)(void*,void*)=_T1->cmp;_T2=s1;{
struct Cyc_List_List*x1=_T2->nodes;_T3=s2;{
struct Cyc_List_List*x2=_T3->nodes;
struct Cyc_List_List*result=0;struct Cyc_List_List*prev=0;
int card=0;
if(x1!=0)goto _TL56;_T4=s1;
return _T4;_TL56:
 if(x2!=0)goto _TL58;_T5=s2;
return _T5;_TL58:
# 295
 _TL5A: if(x1!=0)goto _TL5D;else{goto _TL5C;}_TL5D: if(x2!=0)goto _TL5B;else{goto _TL5C;}
_TL5B: _T6=x1;_T7=_T6->hd;_T8=x2;_T9=_T8->hd;{int i=comp(_T7,_T9);
if(i!=0)goto _TL5E;
if(result!=0)goto _TL60;{struct Cyc_List_List*_T15=_cycalloc(sizeof(struct Cyc_List_List));_TB=x1;
_T15->hd=_TB->hd;_T15->tl=0;_TA=(struct Cyc_List_List*)_T15;}result=_TA;
prev=result;goto _TL61;
# 302
_TL60: _TC=_check_null(prev);{struct Cyc_List_List*_T15=_cycalloc(sizeof(struct Cyc_List_List));_TE=x1;_T15->hd=_TE->hd;_T15->tl=0;_TD=(struct Cyc_List_List*)_T15;}_TC->tl=_TD;_TF=prev;
prev=_TF->tl;_TL61:
# 305
 card=card + 1;_T10=x1;
x1=_T10->tl;_T11=x2;
x2=_T11->tl;goto _TL5F;
_TL5E: if(i >= 0)goto _TL62;_T12=x1;
x1=_T12->tl;goto _TL63;
# 311
_TL62: _T13=x2;x2=_T13->tl;_TL63: _TL5F:;}goto _TL5A;_TL5C:{struct Cyc_Set_Set*_T15=_cycalloc(sizeof(struct Cyc_Set_Set));
# 314
_T15->cmp=comp;_T15->cardinality=card;_T15->nodes=result;_T14=(struct Cyc_Set_Set*)_T15;}return _T14;}}}}
Пример #2
0
struct Cyc_Lineno_Pos * Cyc_Lineno_pos_of_abs(struct _fat_ptr filename,int abs) {
  struct Cyc_Lineno_Pos * _T0;
  struct Cyc_Lineno_Pos * _T1;
  struct Cyc_Lineno_Pos * _T2;
  struct Cyc_Lineno_Pos * _T3;
  struct _fat_ptr _T4;
  struct Cyc_List_List * _T5;
  struct _tuple1 * _T6;
  struct Cyc_Lineno_Pos * _T7;
  struct Cyc_Lineno_Pos * ans;
  ans = _cycalloc(sizeof(struct Cyc_Lineno_Pos));
  _T0 = ans;
  _T0->logical_file = _tag_fat("",sizeof(char),1U);
  _T1 = ans;
  _T1->line = Cyc_Core_new_string(0U);
  _T2 = ans;
  _T2->line_no = 0;
  _T3 = ans;
  _T3->col = 0;
  _T4 = filename;
  { struct Cyc_List_List * _T8 = _cycalloc(sizeof(struct Cyc_List_List));
    { struct _tuple1 * _T9 = _cycalloc(sizeof(struct _tuple1));
      _T9->f0 = abs;
      _T9->f1 = ans;
      _T6 = (struct _tuple1 *)_T9;
    }_T8->hd = _T6;
    _T8->tl = 0;
    _T5 = (struct Cyc_List_List *)_T8;
  }Cyc_Lineno_poss_of_abss(_T4,_T5);
  _T7 = ans;
  return _T7;
}
Пример #3
0
struct Cyc_APQ_T * Cyc_APQ_fromAP(struct Cyc_AP_T * n,struct Cyc_AP_T * d) {
    int _T0;
    struct Cyc_Invalid_argument_exn_struct * _T1;
    void * _T2;
    void * _T3;
    struct Cyc_APQ_T * _T4;
    struct Cyc_APQ_T * _T5;
    struct Cyc_APQ_T * _T6;
    _T0 = Cyc_AP_cmp(d,Cyc_AP_zero);
    if (_T0 != 0) {
        goto _TL4;
    }
    {   struct Cyc_Invalid_argument_exn_struct * _T7 = _cycalloc(sizeof(struct Cyc_Invalid_argument_exn_struct));
        _T7->tag = Cyc_Invalid_argument;
        _T7->f1 = _tag_fat("APQ_fromAP: divide by zero",sizeof(char),27U);
        _T1 = (struct Cyc_Invalid_argument_exn_struct *)_T7;
    }
    _T2 = (void *)_T1;
    _throw(_T2);
    goto _TL5;
_TL4:
_TL5:
    _T3 = _cycalloc(sizeof(struct Cyc_APQ_T));
    {   struct Cyc_APQ_T * q = (struct Cyc_APQ_T *)_T3;
        _T4 = q;
        _T4->n = n;
        _T5 = q;
        _T5->d = d;
        _T6 = Cyc_reduce(q);
        return _T6;
    }
}
Пример #4
0
struct Cyc_List_List * Cyc_Position_strings_of_segments(struct Cyc_List_List * segs) {
  struct Cyc_List_List * _T0;
  struct _fat_ptr * _T1;
  struct Cyc_List_List * _T2;
  void * _T3;
  unsigned int _T4;
  struct Cyc_List_List * _T5;
  struct Cyc_List_List * _T6;
  struct Cyc_List_List * ans = 0;
  _TLB: if (segs != 0) { goto _TL9;
  }else { goto _TLA;
  }
  _TL9: { struct Cyc_List_List * _T7 = _cycalloc(sizeof(struct Cyc_List_List));
    { struct _fat_ptr * _T8 = _cycalloc(sizeof(struct _fat_ptr));
      _T2 = segs;
      _T3 = _T2->hd;
      _T4 = (unsigned int)_T3;
      *_T8 = Cyc_Position_string_of_segment(_T4);
      _T1 = (struct _fat_ptr *)_T8;
    }_T7->hd = _T1;
    _T7->tl = ans;
    _T0 = (struct Cyc_List_List *)_T7;
  }ans = _T0;
  _T5 = segs;
  segs = _T5->tl;
  goto _TLB;
  _TLA: _T6 = ans;
  return _T6;
}
Пример #5
0
struct Cyc_Set_Set*Cyc_Set_union_two(struct Cyc_Set_Set*s1,struct Cyc_Set_Set*s2){struct Cyc_Set_Set*_T0;struct Cyc_Set_Set*_T1;int _T2;struct Cyc_Set_Set*_T3;struct Cyc_Set_Set*_T4;int _T5;struct Cyc_Set_Set*_T6;struct Cyc_Set_Set*_T7;struct Cyc_Set_Set*_T8;struct Cyc_Set_Set*_T9;struct Cyc_List_List*_TA;void*_TB;struct Cyc_List_List*_TC;void*_TD;struct Cyc_List_List*_TE;struct Cyc_List_List*_TF;struct Cyc_List_List*_T10;struct Cyc_List_List*_T11;struct Cyc_List_List*_T12;struct Cyc_List_List*_T13;struct Cyc_List_List*_T14;struct Cyc_List_List*_T15;struct Cyc_List_List*_T16;struct Cyc_List_List*_T17;struct Cyc_List_List*_T18;struct Cyc_List_List*_T19;struct Cyc_List_List*_T1A;struct Cyc_List_List*_T1B;struct Cyc_List_List*_T1C;struct Cyc_List_List*_T1D;int _T1E;struct Cyc_List_List*_T1F;int _T20;struct Cyc_Set_Set*_T21;
if(s1!=s2)goto _TL22;_T0=s1;
return _T0;_TL22: _T1=s1;_T2=_T1->cardinality;
if(_T2!=0)goto _TL24;_T3=s2;
return _T3;_TL24: _T4=s2;_T5=_T4->cardinality;
if(_T5!=0)goto _TL26;_T6=s1;
return _T6;_TL26: {
# 149
struct Cyc_List_List*nodes=0;
int cardinality=0;_T7=s1;{
int(*comp)(void*,void*)=_T7->cmp;_T8=s1;{
# 153
struct Cyc_List_List*x1=_T8->nodes;_T9=s2;{
struct Cyc_List_List*x2=_T9->nodes;
struct Cyc_List_List*curr=0;
# 157
_TL28: if(x1!=0)goto _TL2B;else{goto _TL2A;}_TL2B: if(x2!=0)goto _TL29;else{goto _TL2A;}
_TL29: _TA=x1;_TB=_TA->hd;_TC=x2;_TD=_TC->hd;{int i=comp(_TB,_TD);
if(i!=0)goto _TL2C;_TE=x2;
# 161
x2=_TE->tl;goto _TL2D;
_TL2C: if(i >= 0)goto _TL2E;
# 164
if(curr!=0)goto _TL30;{struct Cyc_List_List*_T22=_cycalloc(sizeof(struct Cyc_List_List));_T10=x1;
_T22->hd=_T10->hd;_T22->tl=0;_TF=(struct Cyc_List_List*)_T22;}nodes=_TF;
curr=nodes;goto _TL31;
# 168
_TL30: _T11=curr;{struct Cyc_List_List*_T22=_cycalloc(sizeof(struct Cyc_List_List));_T13=x1;_T22->hd=_T13->hd;_T22->tl=0;_T12=(struct Cyc_List_List*)_T22;}_T11->tl=_T12;_T14=curr;
curr=_T14->tl;_TL31: _T15=x1;
# 171
x1=_T15->tl;
cardinality=cardinality + 1;goto _TL2F;
# 175
_TL2E: if(curr!=0)goto _TL32;{struct Cyc_List_List*_T22=_cycalloc(sizeof(struct Cyc_List_List));_T17=x2;
_T22->hd=_T17->hd;_T22->tl=0;_T16=(struct Cyc_List_List*)_T22;}nodes=_T16;
curr=nodes;goto _TL33;
# 179
_TL32: _T18=curr;{struct Cyc_List_List*_T22=_cycalloc(sizeof(struct Cyc_List_List));_T1A=x2;_T22->hd=_T1A->hd;_T22->tl=0;_T19=(struct Cyc_List_List*)_T22;}_T18->tl=_T19;_T1B=curr;
curr=_T1B->tl;_TL33: _T1C=x2;
# 182
x2=_T1C->tl;
cardinality=cardinality + 1;_TL2F: _TL2D:;}goto _TL28;_TL2A:
# 186
 if(x1==0)goto _TL34;
# 188
if(curr!=0)goto _TL36;
nodes=x1;goto _TL37;
# 191
_TL36: _T1D=curr;_T1D->tl=x1;_TL37: _T1E=
Cyc_List_length(x1);cardinality=cardinality + _T1E;goto _TL35;
_TL34: if(x2==0)goto _TL38;
# 195
if(curr!=0)goto _TL3A;
nodes=x2;goto _TL3B;
# 198
_TL3A: _T1F=curr;_T1F->tl=x2;_TL3B: _T20=
Cyc_List_length(x2);cardinality=cardinality + _T20;goto _TL39;_TL38: _TL39: _TL35:{struct Cyc_Set_Set*_T22=_cycalloc(sizeof(struct Cyc_Set_Set));
# 201
_T22->cmp=comp;_T22->cardinality=cardinality;_T22->nodes=nodes;_T21=(struct Cyc_Set_Set*)_T22;}return _T21;}}}}}
Пример #6
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;}
Пример #7
0
static struct Cyc_List_List*Cyc_Set_delete_b(int(*cmp)(void*,void*),struct Cyc_List_List*n,void*elt){struct Cyc_List_List*_T0;void*_T1;void*_T2;int _T3;struct Cyc_List_List*_T4;struct Cyc_List_List*_T5;struct Cyc_List_List*_T6;struct Cyc_List_List*_T7;struct Cyc_List_List*_T8;struct Cyc_List_List*_T9;struct Cyc_List_List*_TA;void*_TB;void*_TC;int _TD;struct Cyc_List_List*_TE;struct Cyc_List_List*_TF;struct Cyc_List_List*_T10;struct Cyc_List_List*_T11;struct Cyc_List_List*_T12;struct Cyc_List_List*_T13;struct Cyc_List_List*_T14;struct Cyc_List_List*_T15;_T0=
_check_null(n);_T1=_T0->hd;_T2=elt;_T3=cmp(_T1,_T2);if(_T3!=0)goto _TL3C;_T4=n;_T5=_T4->tl;return _T5;_TL3C: {
# 209
struct Cyc_List_List*result;result=_cycalloc(sizeof(struct Cyc_List_List));_T6=result;_T7=n;_T6->hd=_T7->hd;_T8=result;_T8->tl=0;{
struct Cyc_List_List*prev=result;_T9=n;
n=_T9->tl;
_TL3E: if(n!=0)goto _TL41;else{goto _TL40;}_TL41: _TA=n;_TB=_TA->hd;_TC=elt;_TD=cmp(_TB,_TC);if(_TD!=0)goto _TL3F;else{goto _TL40;}
_TL3F: _TE=_check_null(prev);{struct Cyc_List_List*_T16=_cycalloc(sizeof(struct Cyc_List_List));_T10=n;_T16->hd=_T10->hd;_T16->tl=0;_TF=(struct Cyc_List_List*)_T16;}_TE->tl=_TF;_T11=prev;
prev=_T11->tl;_T12=n;
n=_T12->tl;goto _TL3E;_TL40: _T13=
# 217
_check_null(prev);_T14=_check_null(n);_T13->tl=_T14->tl;_T15=result;
return _T15;}}}
Пример #8
0
void Cyc_Xarray_set(struct Cyc_Xarray_Xarray * xarr,int i,void * a) {
  int _T0;
  struct Cyc_Xarray_Xarray * _T1;
  int _T2;
  struct Cyc_Core_Invalid_argument_exn_struct * _T3;
  void * _T4;
  struct Cyc_Xarray_Xarray * _T5;
  struct _fat_ptr _T6;
  int _T7;
  unsigned char * _T8;
  void * * _T9;
  if (i < 0) { goto _TL6;
  }else { goto _TL7;
  }
  _TL7: _T0 = i;
  _T1 = xarr;
  _T2 = _T1->num_elmts;
  if (_T0 >= _T2) { goto _TL6;
  }else { goto _TL4;
  }
  _TL6: { struct Cyc_Core_Invalid_argument_exn_struct * _TA = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _TA->tag = Cyc_Core_Invalid_argument;
    _TA->f1 = _tag_fat("Xarray::set: bad index",sizeof(char),23U);
    _T3 = (struct Cyc_Core_Invalid_argument_exn_struct *)_TA;
  }_T4 = (void *)_T3;
  _throw(_T4);
  goto _TL5;
  _TL4: _TL5: _T5 = xarr;
  _T6 = _T5->elmts;
  _T7 = i;
  _T8 = _check_fat_subscript(_T6,sizeof(void *),_T7);
  _T9 = (void * *)_T8;
  *_T9 = a;
}
Пример #9
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);
}
Пример #10
0
void Cyc_initialize_states() {
  void * _T0;
  struct Cyc_core_tag * _T1;
  struct Cyc_core_tag * _T2;
  struct Cyc_core_tag * _T3;
  struct Cyc_core_tag * _T4;
  struct Cyc_core_tag * _T5;
  struct Cyc_core_tag * _T6;
  struct Cyc_core_tag * p;
  _T0 = _cycalloc(sizeof(struct Cyc_core_tag));
  p = (struct Cyc_core_tag *)_T0;
  _T1 = p;
  _T1->next = 0;
  _T2 = p;
  _T2->link = 0;
  _T3 = p;
  _T3->number = 0;
  _T4 = p;
  _T4->accessing_symbol = 0;
  _T5 = p;
  _T5->nitems = 0;
  _T6 = p;
  _T6->items = _tag_fat(0,0,0);
  Cyc_this_state = p;
  Cyc_last_state = Cyc_this_state;
  Cyc_first_state = Cyc_last_state;
  Cyc_nstates = 1;
}
Пример #11
0
struct Cyc_Set_Set*Cyc_Set_delete(struct Cyc_Set_Set*s,void*elt){int _T0;struct Cyc_Set_Set*_T1;struct Cyc_Set_Set*_T2;struct Cyc_Set_Set*_T3;int _T4;struct Cyc_Set_Set*_T5;int(*_T6)(void*,void*);struct Cyc_Set_Set*_T7;struct Cyc_List_List*_T8;void*_T9;struct Cyc_Set_Set*_TA;_T0=
Cyc_Set_member(s,elt);if(!_T0)goto _TL42;{struct Cyc_Set_Set*_TB=_cycalloc(sizeof(struct Cyc_Set_Set));_T2=s;
_TB->cmp=_T2->cmp;_T3=s;_T4=_T3->cardinality;_TB->cardinality=_T4 - 1;_T5=s;_T6=_T5->cmp;_T7=s;_T8=_T7->nodes;_T9=elt;
_TB->nodes=Cyc_Set_delete_b(_T6,_T8,_T9);_T1=(struct Cyc_Set_Set*)_TB;}
# 224
return _T1;_TL42: _TA=s;
# 226
return _TA;}
Пример #12
0
static struct Cyc_List_List * Cyc_Compact_non_default_elements(int def,struct _fat_ptr v) {
  struct _fat_ptr _T0;
  unsigned int _T1;
  unsigned int _T2;
  struct _fat_ptr _T3;
  unsigned char * _T4;
  int * _T5;
  int * _T6;
  int _T7;
  struct Cyc_List_List * _T8;
  struct _tuple3 * _T9;
  struct Cyc_List_List * _TA;
  struct Cyc_List_List * ans = 0;
  _T0 = v;
  _T1 = _get_fat_size(_T0,sizeof(int));
  _T2 = _T1 - 1U;
  { int i = (int)_T2;
    _TL10: if (i >= 0) { goto _TLE;
    }else { goto _TLF;
    }
    _TLE: _T3 = v;
    _T4 = _T3.curr;
    _T5 = (int *)_T4;
    _T6 = _check_null(_T5);
    _T7 = i;
    { int e = _T6[_T7];
      if (e == def) { goto _TL11;
      }
      { struct Cyc_List_List * _TB = _cycalloc(sizeof(struct Cyc_List_List));
	{ struct _tuple3 * _TC = _cycalloc(sizeof(struct _tuple3));
	  _TC->f0 = i;
	  _TC->f1 = e;
	  _T9 = (struct _tuple3 *)_TC;
	}_TB->hd = _T9;
	_TB->tl = ans;
	_T8 = (struct Cyc_List_List *)_TB;
      }ans = _T8;
      goto _TL12;
      _TL11: _TL12: ;
    }i = i + -1;
    goto _TL10;
    _TLF: ;
  }_TA = ans;
  return _TA;
}
Пример #13
0
struct Cyc_Queue_Queue * Cyc_Queue_create() {
  struct Cyc_Queue_Queue * _T0;
  { struct Cyc_Queue_Queue * _T1 = _cycalloc(sizeof(struct Cyc_Queue_Queue));
    _T1->front = 0;
    _T1->rear = 0;
    _T1->len = 0U;
    _T0 = (struct Cyc_Queue_Queue *)_T1;
  }return _T0;
}
Пример #14
0
static struct Cyc_Lineno_Pos * Cyc_Position_new_pos() {
  struct Cyc_Lineno_Pos * _T0;
  { struct Cyc_Lineno_Pos * _T1 = _cycalloc(sizeof(struct Cyc_Lineno_Pos));
    _T1->logical_file = _tag_fat("",sizeof(char),1U);
    _T1->line = Cyc_Core_new_string(0U);
    _T1->line_no = 0;
    _T1->col = 0;
    _T0 = (struct Cyc_Lineno_Pos *)_T1;
  }return _T0;
}
Пример #15
0
struct Cyc_Set_Set*Cyc_Set_from_list(int(*comp)(void*,void*),struct Cyc_List_List*x){int(*_T0)(void*,void*);struct Cyc_List_List*_T1;struct Cyc_List_List*_T2;struct Cyc_List_List*_T3;struct Cyc_List_List*_T4;void*_T5;struct Cyc_List_List*_T6;struct Cyc_List_List*_T7;void*_T8;int _T9;struct Cyc_List_List*_TA;struct Cyc_List_List*_TB;struct Cyc_List_List*_TC;struct Cyc_List_List*_TD;struct Cyc_List_List*_TE;struct Cyc_Set_Set*_TF;_T0=comp;_T1=x;{
struct Cyc_List_List*z=Cyc_List_merge_sort(_T0,_T1);{
# 320
struct Cyc_List_List*y=z;_TL67: if(y!=0)goto _TL65;else{goto _TL66;}
_TL65: _T2=y;_T3=_T2->tl;if(_T3==0)goto _TL68;_T4=y;_T5=_T4->hd;_T6=y;_T7=_T6->tl;_T8=_T7->hd;_T9=comp(_T5,_T8);if(_T9!=0)goto _TL68;_TA=y;_TB=y;_TC=_TB->tl;_TD=
_check_null(_TC);_TA->tl=_TD->tl;goto _TL69;_TL68: _TL69: _TE=y;
# 320
y=_TE->tl;goto _TL67;_TL66:;}{struct Cyc_Set_Set*_T10=_cycalloc(sizeof(struct Cyc_Set_Set));
# 323
_T10->cmp=comp;_T10->cardinality=Cyc_List_length(z);_T10->nodes=z;_TF=(struct Cyc_Set_Set*)_T10;}return _TF;}}
Пример #16
0
struct Cyc_APQ_T*Cyc_reduce(struct Cyc_APQ_T*q){struct Cyc_APQ_T*_T0;struct Cyc_AP_T*_T1;struct Cyc_AP_T*_T2;int _T3;struct Cyc_APQ_T*_T4;struct Cyc_APQ_T*_T5;struct Cyc_AP_T*_T6;struct Cyc_APQ_T*_T7;struct Cyc_APQ_T*_T8;struct Cyc_AP_T*_T9;struct Cyc_APQ_T*_TA;struct Cyc_AP_T*_TB;struct Cyc_AP_T*_TC;struct Cyc_APQ_T*_TD;struct Cyc_AP_T*_TE;int _TF;struct Cyc_APQ_T*_T10;void*_T11;struct Cyc_APQ_T*_T12;struct Cyc_APQ_T*_T13;struct Cyc_AP_T*_T14;struct Cyc_AP_T*_T15;struct Cyc_APQ_T*_T16;struct Cyc_APQ_T*_T17;struct Cyc_AP_T*_T18;struct Cyc_AP_T*_T19;struct Cyc_APQ_T*_T1A;_T0=
_check_null(q);_T1=_T0->d;_T2=Cyc_AP_zero;_T3=Cyc_AP_cmp(_T1,_T2);if(_T3 >= 0)goto _TL0;_T4=q;_T5=q;_T6=_T5->d;
_T4->d=Cyc_AP_neg(_T6);_T7=q;_T8=q;_T9=_T8->n;
_T7->n=Cyc_AP_neg(_T9);goto _TL1;_TL0: _TL1: _TA=q;_TB=_TA->n;_TC=
# 18
Cyc_AP_abs(_TB);_TD=q;_TE=_TD->d;{struct Cyc_AP_T*gcd=Cyc_AP_gcd(_TC,_TE);_TF=
Cyc_AP_cmp(gcd,Cyc_AP_one);if(_TF!=0)goto _TL2;_T10=q;
return _T10;_TL2: _T11=_cycalloc(sizeof(struct Cyc_APQ_T));{
struct Cyc_APQ_T*newq=(struct Cyc_APQ_T*)_T11;_T12=newq;_T13=q;_T14=_T13->n;_T15=gcd;
_T12->n=Cyc_AP_div(_T14,_T15);_T16=newq;_T17=q;_T18=_T17->d;_T19=gcd;
_T16->d=Cyc_AP_div(_T18,_T19);_T1A=newq;
return _T1A;}}}
Пример #17
0
struct _fat_ptr Cyc_Filename_chop_extension(struct _fat_ptr filename) {
  struct _fat_ptr _T0;
  unsigned int _T1;
  unsigned int _T2;
  struct _fat_ptr _T3;
  unsigned char * _T4;
  const char * _T5;
  const char * _T6;
  int _T7;
  char _T8;
  int _T9;
  struct Cyc_Core_Invalid_argument_exn_struct * _TA;
  void * _TB;
  struct _fat_ptr _TC;
  int _TD;
  unsigned long _TE;
  struct _fat_ptr _TF;
  _T0 = filename;
  _T1 = _get_fat_size(_T0,sizeof(char));
  _T2 = _T1 - 1U;
  { int i = (int)_T2;
    _TL0: if (i >= 0) { goto _TL3;
    }else { goto _TL2;
    }
    _TL3: _T3 = filename;
    _T4 = _T3.curr;
    _T5 = (const char *)_T4;
    _T6 = _check_null(_T5);
    _T7 = i;
    _T8 = _T6[_T7];
    _T9 = (int)_T8;
    if (_T9 != 46) { goto _TL1;
    }else { goto _TL2;
    }
    _TL1: i = i + -1;
    goto _TL0;
    _TL2: if (i >= 0) { goto _TL4;
    }
    { struct Cyc_Core_Invalid_argument_exn_struct * _T10 = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
      _T10->tag = Cyc_Core_Invalid_argument;
      _T10->f1 = _tag_fat("chop_extension",sizeof(char),15U);
      _TA = (struct Cyc_Core_Invalid_argument_exn_struct *)_T10;
    }_TB = (void *)_TA;
    _throw(_TB);
    goto _TL5;
    _TL4: _TL5: _TC = filename;
    _TD = i;
    _TE = (unsigned long)_TD;
    _TF = Cyc_substring(_TC,0,_TE);
    return _TF;
  }
}
Пример #18
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;}}
Пример #19
0
struct Cyc_APQ_T * Cyc_APQ_fromint(int i) {
    void * _T0;
    struct Cyc_APQ_T * _T1;
    struct Cyc_APQ_T * _T2;
    struct Cyc_APQ_T * _T3;
    _T0 = _cycalloc(sizeof(struct Cyc_APQ_T));
    {   struct Cyc_APQ_T * q = (struct Cyc_APQ_T *)_T0;
        _T1 = q;
        _T1->n = Cyc_AP_fromint(i);
        _T2 = q;
        _T2->d = Cyc_AP_one;
        _T3 = q;
        return _T3;
    }
}
Пример #20
0
struct Cyc_APQ_T * Cyc_APQ_div(struct Cyc_APQ_T * p,struct Cyc_APQ_T * q) {
    struct Cyc_APQ_T * _T0;
    struct Cyc_AP_T * _T1;
    struct Cyc_AP_T * _T2;
    int _T3;
    struct Cyc_Invalid_argument_exn_struct * _T4;
    void * _T5;
    struct Cyc_APQ_T * _T6;
    struct Cyc_AP_T * _T7;
    struct Cyc_APQ_T * _T8;
    struct Cyc_AP_T * _T9;
    struct Cyc_AP_T * _TA;
    struct Cyc_APQ_T * _TB;
    struct Cyc_AP_T * _TC;
    struct Cyc_APQ_T * _TD;
    struct Cyc_AP_T * _TE;
    struct Cyc_AP_T * _TF;
    struct Cyc_APQ_T * _T10;
    _T0 = _check_null(q);
    _T1 = _T0->n;
    _T2 = Cyc_AP_zero;
    _T3 = Cyc_AP_cmp(_T1,_T2);
    if (_T3 != 0) {
        goto _TL10;
    }
    {   struct Cyc_Invalid_argument_exn_struct * _T11 = _cycalloc(sizeof(struct Cyc_Invalid_argument_exn_struct));
        _T11->tag = Cyc_Invalid_argument;
        _T11->f1 = _tag_fat("APQ_div: divide by zero",sizeof(char),24U);
        _T4 = (struct Cyc_Invalid_argument_exn_struct *)_T11;
    }
    _T5 = (void *)_T4;
    _throw(_T5);
    goto _TL11;
_TL10:
_TL11:
    _T6 = _check_null(p);
    _T7 = _T6->n;
    _T8 = q;
    _T9 = _T8->d;
    _TA = Cyc_AP_mul(_T7,_T9);
    _TB = p;
    _TC = _TB->d;
    _TD = q;
    _TE = _TD->n;
    _TF = Cyc_AP_mul(_TC,_TE);
    _T10 = Cyc_APQ_fromAP(_TA,_TF);
    return _T10;
}
Пример #21
0
struct _fat_ptr Cyc_Array_rev_copy(struct _fat_ptr x) {
  struct _fat_ptr _T0;
  unsigned int _T1;
  struct _fat_ptr _T2;
  int _T3;
  void * * _T4;
  unsigned int _T5;
  unsigned int _T6;
  struct _fat_ptr _T7;
  int _T8;
  unsigned int _T9;
  unsigned int _TA;
  unsigned int _TB;
  int _TC;
  unsigned char * _TD;
  void * * _TE;
  _T0 = x;
  _T1 = _get_fat_size(_T0,sizeof(void *));
  { int sx = (int)_T1;
    int n = sx - 1;
    _T3 = sx;
    { unsigned int _TF = (unsigned int)_T3;
      _T5 = _check_times(_TF,sizeof(void *));
      { void * * _T10 = _cycalloc(_T5);
	{ unsigned int _T11 = _TF;
	  unsigned int i;
	  i = 0;
	  _TLA4: if (i < _T11) { goto _TLA2;
	  }else { goto _TLA3;
	  }
	  _TLA2: _T6 = i;
	  _T7 = x;
	  _T8 = n;
	  _T9 = (unsigned int)_T8;
	  _TA = i;
	  _TB = _T9 - _TA;
	  _TC = (int)_TB;
	  _TD = _check_fat_subscript(_T7,sizeof(void *),_TC);
	  _TE = (void * *)_TD;
	  _T10[_T6] = *_TE;
	  i = i + 1;
	  goto _TLA4;
	  _TLA3: ;
	}_T4 = (void * *)_T10;
      }_T2 = _tag_fat(_T4,sizeof(void *),_TF);
    }return _T2;
  }
}
Пример #22
0
struct Cyc_Xarray_Xarray * Cyc_Xarray_rcreate(struct _RegionHandle * r,int len,
					      void * a) {
  struct Cyc_Core_Invalid_argument_exn_struct * _T0;
  void * _T1;
  struct Cyc_Xarray_Xarray * _T2;
  struct _RegionHandle * _T3;
  struct _fat_ptr _T4;
  int _T5;
  void * * _T6;
  unsigned int _T7;
  unsigned int _T8;
  unsigned int _T9;
  if (len >= 0) { goto _TL8;
  }
  { struct Cyc_Core_Invalid_argument_exn_struct * _TA = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _TA->tag = Cyc_Core_Invalid_argument;
    _TA->f1 = _tag_fat("xarrays must have a non-negative size buffer",sizeof(char),
		       45U);
    _T0 = (struct Cyc_Core_Invalid_argument_exn_struct *)_TA;
  }_T1 = (void *)_T0;
  _throw(_T1);
  goto _TL9;
  _TL8: _TL9: _T3 = r;
  { struct Cyc_Xarray_Xarray * _TA = _region_malloc(_T3,0U,sizeof(struct Cyc_Xarray_Xarray));
    _T5 = len;
    { unsigned int _TB = (unsigned int)_T5;
      _T7 = Cyc_Core_unique_qual;
      _T8 = _check_times(_TB,sizeof(void *));
      { void * * _TC = _aqual_malloc(_T7,_T8);
	{ unsigned int _TD = _TB;
	  unsigned int i;
	  i = 0;
	  _TLD: if (i < _TD) { goto _TLB;
	  }else { goto _TLC;
	  }
	  _TLB: _T9 = i;
	  _TC[_T9] = a;
	  i = i + 1;
	  goto _TLD;
	  _TLC: ;
	}_T6 = (void * *)_TC;
      }_T4 = _tag_fat(_T6,sizeof(void *),_TB);
    }_TA->elmts = _T4;
    _TA->num_elmts = 0;
    _T2 = (struct Cyc_Xarray_Xarray *)_TA;
  }return _T2;
}
Пример #23
0
struct _fat_ptr Cyc_Array_map_c(void * (* f)(void *,void *),void * env,struct _fat_ptr x) {
  struct _fat_ptr _T0;
  unsigned int _T1;
  struct _fat_ptr _T2;
  int _T3;
  void * * _T4;
  unsigned int _T5;
  unsigned int _T6;
  void * _T7;
  struct _fat_ptr _T8;
  unsigned char * _T9;
  void * * _TA;
  void * * _TB;
  unsigned int _TC;
  int _TD;
  void * _TE;
  _T0 = x;
  _T1 = _get_fat_size(_T0,sizeof(void *));
  { int sx = (int)_T1;
    _T3 = sx;
    { unsigned int _TF = (unsigned int)_T3;
      _T5 = _check_times(_TF,sizeof(void *));
      { void * * _T10 = _cycalloc(_T5);
	{ unsigned int _T11 = _TF;
	  unsigned int i;
	  i = 0;
	  _TL5A: if (i < _T11) { goto _TL58;
	  }else { goto _TL59;
	  }
	  _TL58: _T6 = i;
	  _T7 = env;
	  _T8 = x;
	  _T9 = _T8.curr;
	  _TA = (void * *)_T9;
	  _TB = _check_null(_TA);
	  _TC = i;
	  _TD = (int)_TC;
	  _TE = _TB[_TD];
	  _T10[_T6] = f(_T7,_TE);
	  i = i + 1;
	  goto _TL5A;
	  _TL59: ;
	}_T4 = (void * *)_T10;
      }_T2 = _tag_fat(_T4,sizeof(void *),_TF);
    }return _T2;
  }
}
Пример #24
0
struct Cyc_Set_Set*Cyc_Set_diff(struct Cyc_Set_Set*s1,struct Cyc_Set_Set*s2){struct Cyc_Set_Set*_T0;struct Cyc_Set_Set*_T1;struct Cyc_Set_Set*_T2;struct Cyc_Set_Set*_T3;struct Cyc_Set_Set*_T4;struct Cyc_List_List*_T5;int(*_T6)(void*,void*);struct Cyc_List_List*_T7;void*_T8;int _T9;int(*_TA)(void*,void*);struct Cyc_List_List*_TB;void*_TC;struct Cyc_List_List*_TD;struct Cyc_Set_Set*_TE;_T0=s1;{
int(*comp)(void*,void*)=_T0->cmp;_T1=s1;{
struct Cyc_List_List*x1=_T1->nodes;_T2=s2;{
struct Cyc_List_List*x2=_T2->nodes;_T3=s1;{
int card=_T3->cardinality;
# 354
if(x2!=0)goto _TL75;_T4=s1;return _T4;_TL75:
# 356
 _TL7A: if(x2!=0)goto _TL78;else{goto _TL79;}
_TL78: _T5=x2;{void*elt=_T5->hd;_T6=comp;_T7=x1;_T8=elt;_T9=
Cyc_Set_member_b(_T6,_T7,_T8);if(!_T9)goto _TL7B;
card=card + -1;_TA=comp;_TB=x1;_TC=elt;
x1=Cyc_Set_delete_b(_TA,_TB,_TC);goto _TL7C;_TL7B: _TL7C:;}_TD=x2;
# 356
x2=_TD->tl;goto _TL7A;_TL79:{struct Cyc_Set_Set*_TF=_cycalloc(sizeof(struct Cyc_Set_Set));
# 363
_TF->cmp=comp;_TF->cardinality=card;_TF->nodes=x1;_TE=(struct Cyc_Set_Set*)_TF;}return _TE;}}}}}
Пример #25
0
struct Cyc_Position_Error * Cyc_Position_mk_err(unsigned int l,struct _fat_ptr desc) {
  struct Cyc_Position_Error * _T0;
  struct _tuple0 _T1 = Cyc_Position_seg_to_loc(l);
  unsigned int _T2;
  struct _fat_ptr _T3;
  _T3 = _T1.f0;
  _T2 = _T1.f1;
  { struct _fat_ptr source = _T3;
    unsigned int loc = _T2;
    { struct Cyc_Position_Error * _T4 = _cycalloc(sizeof(struct Cyc_Position_Error));
      _T4->source = source;
      _T4->seg = l;
      _T4->desc = desc;
      _T0 = (struct Cyc_Position_Error *)_T4;
    }return _T0;
  }
}
Пример #26
0
struct _fat_ptr Cyc_Array_map(void * (* f)(void *),struct _fat_ptr x) {
  struct _fat_ptr _T0;
  unsigned int _T1;
  struct _fat_ptr _T2;
  int _T3;
  void * * _T4;
  unsigned int _T5;
  unsigned int _T6;
  struct _fat_ptr _T7;
  unsigned char * _T8;
  void * * _T9;
  void * * _TA;
  unsigned int _TB;
  int _TC;
  void * _TD;
  _T0 = x;
  _T1 = _get_fat_size(_T0,sizeof(void *));
  { int sx = (int)_T1;
    _T3 = sx;
    { unsigned int _TE = (unsigned int)_T3;
      _T5 = _check_times(_TE,sizeof(void *));
      { void * * _TF = _cycalloc(_T5);
	{ unsigned int _T10 = _TE;
	  unsigned int i;
	  i = 0;
	  _TL56: if (i < _T10) { goto _TL54;
	  }else { goto _TL55;
	  }
	  _TL54: _T6 = i;
	  _T7 = x;
	  _T8 = _T7.curr;
	  _T9 = (void * *)_T8;
	  _TA = _check_null(_T9);
	  _TB = i;
	  _TC = (int)_TB;
	  _TD = _TA[_TC];
	  _TF[_T6] = f(_TD);
	  i = i + 1;
	  goto _TL56;
	  _TL55: ;
	}_T4 = (void * *)_TF;
      }_T2 = _tag_fat(_T4,sizeof(void *),_TE);
    }return _T2;
  }
}
Пример #27
0
struct _fat_ptr Cyc_Array_copy(struct _fat_ptr x) {
  struct _fat_ptr _T0;
  unsigned int _T1;
  struct _fat_ptr _T2;
  int _T3;
  void * * _T4;
  unsigned int _T5;
  unsigned int _T6;
  struct _fat_ptr _T7;
  unsigned char * _T8;
  void * * _T9;
  void * * _TA;
  unsigned int _TB;
  int _TC;
  _T0 = x;
  _T1 = _get_fat_size(_T0,sizeof(void *));
  { int sx = (int)_T1;
    _T3 = sx;
    { unsigned int _TD = (unsigned int)_T3;
      _T5 = _check_times(_TD,sizeof(void *));
      { void * * _TE = _cycalloc(_T5);
	{ unsigned int _TF = _TD;
	  unsigned int i;
	  i = 0;
	  _TL52: if (i < _TF) { goto _TL50;
	  }else { goto _TL51;
	  }
	  _TL50: _T6 = i;
	  _T7 = x;
	  _T8 = _T7.curr;
	  _T9 = (void * *)_T8;
	  _TA = _check_null(_T9);
	  _TB = i;
	  _TC = (int)_TB;
	  _TE[_T6] = _TA[_TC];
	  i = i + 1;
	  goto _TL52;
	  _TL51: ;
	}_T4 = (void * *)_TE;
      }_T2 = _tag_fat(_T4,sizeof(void *),_TD);
    }return _T2;
  }
}
Пример #28
0
void Cyc_Xarray_delete(struct Cyc_Xarray_Xarray * xarr,int num) {
  int _T0;
  int _T1;
  struct Cyc_Core_Invalid_argument_exn_struct * _T2;
  void * _T3;
  struct Cyc_Xarray_Xarray * _T4;
  int _T5;
  _T0 = num;
  _T1 = Cyc_Xarray_length(xarr);
  if (_T0 <= _T1) { goto _TL60;
  }
  { struct Cyc_Core_Invalid_argument_exn_struct * _T6 = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _T6->tag = Cyc_Core_Invalid_argument;
    _T6->f1 = _tag_fat("number deleted is greater than length of xarray",
		       sizeof(char),48U);
    _T2 = (struct Cyc_Core_Invalid_argument_exn_struct *)_T6;
  }_T3 = (void *)_T2;
  _throw(_T3);
  goto _TL61;
  _TL60: _TL61: _T4 = xarr;
  _T5 = num;
  _T4->num_elmts = _T4->num_elmts - _T5;
}
Пример #29
0
struct Cyc_Xarray_Xarray * Cyc_Xarray_rsingleton(struct _RegionHandle * r,
						 int len,void * a) {
  struct Cyc_Core_Invalid_argument_exn_struct * _T0;
  void * _T1;
  struct Cyc_Xarray_Xarray * _T2;
  struct Cyc_Xarray_Xarray * _T3;
  if (len >= 1) { goto _TLE;
  }
  { struct Cyc_Core_Invalid_argument_exn_struct * _T4 = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _T4->tag = Cyc_Core_Invalid_argument;
    _T4->f1 = _tag_fat("singleton xarray must have size >=1",sizeof(char),
		       36U);
    _T0 = (struct Cyc_Core_Invalid_argument_exn_struct *)_T4;
  }_T1 = (void *)_T0;
  _throw(_T1);
  goto _TLF;
  _TLE: _TLF: { struct Cyc_Xarray_Xarray * x = Cyc_Xarray_rcreate(r,len,a);
    _T2 = x;
    _T2->num_elmts = 1;
    _T3 = x;
    return _T3;
  }
}
Пример #30
0
void * Cyc_Xarray_get(struct Cyc_Xarray_Xarray * xarr,int i) {
  int _T0;
  struct Cyc_Xarray_Xarray * _T1;
  int _T2;
  struct Cyc_Core_Invalid_argument_exn_struct * _T3;
  void * _T4;
  struct Cyc_Xarray_Xarray * _T5;
  struct _fat_ptr _T6;
  int _T7;
  unsigned char * _T8;
  void * * _T9;
  void * _TA;
  if (i < 0) { goto _TL2;
  }else { goto _TL3;
  }
  _TL3: _T0 = i;
  _T1 = xarr;
  _T2 = _T1->num_elmts;
  if (_T0 >= _T2) { goto _TL2;
  }else { goto _TL0;
  }
  _TL2: { struct Cyc_Core_Invalid_argument_exn_struct * _TB = _cycalloc(sizeof(struct Cyc_Core_Invalid_argument_exn_struct));
    _TB->tag = Cyc_Core_Invalid_argument;
    _TB->f1 = _tag_fat("Xarray::get: bad index",sizeof(char),23U);
    _T3 = (struct Cyc_Core_Invalid_argument_exn_struct *)_TB;
  }_T4 = (void *)_T3;
  _throw(_T4);
  goto _TL1;
  _TL0: _TL1: _T5 = xarr;
  _T6 = _T5->elmts;
  _T7 = i;
  _T8 = _check_fat_subscript(_T6,sizeof(void *),_T7);
  _T9 = (void * *)_T8;
  _TA = *_T9;
  return _TA;
}