Exemplo n.º 1
0
static long Cyc_Callgraph_visit_cg_f1(struct _tuple11 * env,struct Cyc_Absyn_Exp * e) {
  struct Cyc_Absyn_Exp * _T0;
  int * _T1;
  int _T2;
  struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct * _T3;
  void * _T4;
  int * _T5;
  unsigned int _T6;
  void * _T7;
  struct Cyc_Absyn_Fndecl * _T8;
  void * _T9;
  struct Cyc_Absyn_Vardecl * _TA;
  struct _tuple11 * _TB;
  struct _handler_cons * _TC;
  int _TD;
  struct Cyc_Set_Set * (* _TE)(struct Cyc_Set_Set *,struct Cyc_Absyn_Fndecl *);
  struct Cyc_Set_Set * (* _TF)(struct Cyc_Set_Set *,void *);
  struct Cyc_Set_Set * _T10;
  struct Cyc_Absyn_Fndecl * (* _T11)(struct Cyc_Hashtable_Table *,struct _tuple0 *);
  void * (* _T12)(struct Cyc_Hashtable_Table *,void *);
  struct Cyc_Absyn_Fndecl * _T13;
  struct _tuple11 * _T14;
  struct _tuple11 _T15;
  void * _T16;
  struct Cyc_Core_Not_found_exn_struct * _T17;
  char * _T18;
  char * _T19;
  struct _tuple0 * name;
  _T0 = e;
  { void * _T1A = _T0->r;
    struct Cyc_Absyn_Vardecl * _T1B;
    struct Cyc_Absyn_Fndecl * _T1C;
    _T1 = (int *)_T1A;
    _T2 = *_T1;
    if (_T2 != 1) { goto _TL0;
    }
    _T3 = (struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct *)_T1A;
    _T4 = _T3->f1;
    _T5 = (int *)_T4;
    _T6 = *_T5;
    switch (_T6) {
    case 2: 
      { struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct * _T1D = (struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct *)_T1A;
	_T7 = _T1D->f1;
	{ struct Cyc_Absyn_Funname_b_Absyn_Binding_struct * _T1E = (struct Cyc_Absyn_Funname_b_Absyn_Binding_struct *)_T7;
	  _T1C = _T1E->f1;
	}
      }{ struct Cyc_Absyn_Fndecl * fd = _T1C;
	_T8 = fd;
	name = _T8->name;
	goto _LL0;
      }
    case 1: 
      { struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct * _T1D = (struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct *)_T1A;
	_T9 = _T1D->f1;
	{ struct Cyc_Absyn_Global_b_Absyn_Binding_struct * _T1E = (struct Cyc_Absyn_Global_b_Absyn_Binding_struct *)_T9;
	  _T1B = _T1E->f1;
	}
      }{ struct Cyc_Absyn_Vardecl * vd = _T1B;
	_TA = vd;
	name = _TA->name;
	goto _LL0;
      }
    default: 
      goto _LL5;
    }
    goto _TL1;
    _TL0: _LL5: return 1;
    _TL1: _LL0: ;
  }{ struct Cyc_Set_Set * _T1A;
    struct Cyc_Hashtable_Table * _T1B;
    _TB = env;
    { struct _tuple11 _T1C = *_TB;
      _T1B = _T1C.f0;
      _T1A = _T1C.f1;
    }{ struct Cyc_Hashtable_Table * fds = _T1B;
      struct Cyc_Set_Set * s = _T1A;
      { struct _handler_cons _T1C;
	_TC = &_T1C;
	_push_handler(_TC);
	{ int _T1D = 0;
	  _TD = setjmp(_T1C.handler);
	  if (! _TD) { goto _TL3;
	  }
	  _T1D = 1;
	  goto _TL4;
	  _TL3: _TL4: if (_T1D) { goto _TL5;
	  }else { goto _TL7;
	  }
	  _TL7: _TF = Cyc_Set_insert;
	  { struct Cyc_Set_Set * (* _T1E)(struct Cyc_Set_Set *,struct Cyc_Absyn_Fndecl *) = (struct Cyc_Set_Set * (*)(struct Cyc_Set_Set *,
														      struct Cyc_Absyn_Fndecl *))_TF;
	    _TE = _T1E;
	  }_T10 = s;
	  _T12 = Cyc_Hashtable_lookup;
	  { struct Cyc_Absyn_Fndecl * (* _T1E)(struct Cyc_Hashtable_Table *,
					       struct _tuple0 *) = (struct Cyc_Absyn_Fndecl * (*)(struct Cyc_Hashtable_Table *,
												  struct _tuple0 *))_T12;
	    _T11 = _T1E;
	  }_T13 = _T11(fds,name);
	  s = _TE(_T10,_T13);
	  _T14 = env;
	  { struct _tuple11 _T1E;
	    _T1E.f0 = fds;
	    _T1E.f1 = s;
	    _T15 = _T1E;
	  }*_T14 = _T15;
	  _pop_handler();
	  goto _TL6;
	  _TL5: _T16 = Cyc_Core_get_exn_thrown();
	  { void * _T1E = (void *)_T16;
	    void * _T1F;
	    _T17 = (struct Cyc_Core_Not_found_exn_struct *)_T1E;
	    _T18 = _T17->tag;
	    _T19 = Cyc_Core_Not_found;
	    if (_T18 != _T19) { goto _TL8;
	    }
	    goto _LLA;
	    _TL8: _T1F = _T1E;
	    { void * exn = _T1F;
	      _rethrow(exn);
	    }_LLA: ;
	  }_TL6: ;
	}
      }return 0;
    }
  }
}
Exemplo n.º 2
0
static int Cyc_RenameTemps_rename_visit_f1(struct Cyc_RenameTemps_Env*env,struct Cyc_Absyn_Exp*e){struct Cyc_Absyn_Exp*_T0;int*_T1;int _T2;struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct*_T3;void**_T4;void**_T5;void*_T6;int _T7;struct _handler_cons*_T8;int _T9;void**_TA;void*(*_TB)(struct Cyc_Dict_Dict,struct _tuple0*);void*(*_TC)(struct Cyc_Dict_Dict,void*);struct Cyc_RenameTemps_Env*_TD;struct Cyc_Dict_Dict _TE;struct _tuple0*_TF;void*_T10;struct Cyc_String_pa_PrintArg_struct _T11;struct Cyc___cycFILE*_T12;struct _fat_ptr _T13;struct _fat_ptr _T14;_T0=e;{
void*_T15=_T0->r;void*_T16;_T1=(int*)_T15;_T2=*_T1;if(_T2!=1)goto _TL6;{struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct*_T17=(struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct*)_T15;_T3=(struct Cyc_Absyn_Var_e_Absyn_Raw_exp_struct*)_T15;_T4=& _T3->f1;_T16=(void**)_T4;}{void**b=(void**)_T16;_T5=b;_T6=*_T5;{
# 59
struct _tuple0*qv=Cyc_Absyn_binding2qvar(_T6);_T7=
Cyc_RenameTemps_is_temp_var(qv);if(!_T7)goto _TL8;{struct _handler_cons _T17;_T8=& _T17;_push_handler(_T8);{int _T18=0;_T9=setjmp(_T17.handler);if(!_T9)goto _TLA;_T18=1;goto _TLB;_TLA: _TLB: if(_T18)goto _TLC;else{goto _TLE;}_TLE: _TA=b;_TC=Cyc_Dict_lookup;{
# 62
void*(*_T19)(struct Cyc_Dict_Dict,struct _tuple0*)=(void*(*)(struct Cyc_Dict_Dict,struct _tuple0*))_TC;_TB=_T19;}_TD=env;_TE=_TD->d;_TF=qv;*_TA=_TB(_TE,_TF);_pop_handler();goto _TLD;_TLC: _T10=Cyc_Core_get_exn_thrown();{void*_T19=(void*)_T10;{struct Cyc_String_pa_PrintArg_struct _T1A;_T1A.tag=0;
# 65
_T1A.f1=Cyc_Absynpp_exp2string(e);_T11=_T1A;}{struct Cyc_String_pa_PrintArg_struct _T1A=_T11;void*_T1B[1];_T1B[0]=& _T1A;_T12=Cyc_stderr;_T13=_tag_fat("can't find var %s!!!\n",sizeof(char),22U);_T14=_tag_fat(_T1B,sizeof(void*),1);Cyc_fprintf(_T12,_T13,_T14);}goto _LL5;_LL5:;}_TLD:;}}goto _TL9;_TL8: _TL9:
# 69
 return 0;}}_TL6:
 return 1;;}}
Exemplo n.º 3
0
static struct _tuple0 * Cyc_Lineno_parse_linedef(struct _fat_ptr line) {
  struct _handler_cons * _T0;
  int _T1;
  int _T2;
  unsigned int _T3;
  struct _fat_ptr _T4;
  unsigned int _T5;
  struct _fat_ptr _T6;
  unsigned char * _T7;
  char * _T8;
  char * _T9;
  int _TA;
  char _TB;
  int _TC;
  struct _fat_ptr _TD;
  unsigned char * _TE;
  char * _TF;
  int _T10;
  char _T11;
  int _T12;
  int _T13;
  unsigned int _T14;
  struct _fat_ptr _T15;
  unsigned int _T16;
  struct _fat_ptr _T17;
  unsigned char * _T18;
  char * _T19;
  char * _T1A;
  int _T1B;
  char _T1C;
  int _T1D;
  struct _fat_ptr _T1E;
  unsigned char * _T1F;
  char * _T20;
  int _T21;
  char _T22;
  int _T23;
  int _T24;
  unsigned int _T25;
  struct _fat_ptr _T26;
  unsigned int _T27;
  int _T28;
  struct Cyc_IntPtr_sa_ScanfArg_struct _T29;
  struct _fat_ptr _T2A;
  int _T2B;
  int _T2C;
  unsigned long _T2D;
  struct _fat_ptr _T2E;
  struct _fat_ptr _T2F;
  struct _fat_ptr _T30;
  int _T31;
  unsigned int _T32;
  struct _fat_ptr _T33;
  unsigned int _T34;
  struct _fat_ptr _T35;
  unsigned char * _T36;
  char * _T37;
  char * _T38;
  int _T39;
  char _T3A;
  int _T3B;
  int _T3C;
  unsigned int _T3D;
  struct _fat_ptr _T3E;
  unsigned int _T3F;
  struct _fat_ptr _T40;
  unsigned char * _T41;
  char * _T42;
  char * _T43;
  int _T44;
  char _T45;
  int _T46;
  int _T47;
  unsigned int _T48;
  struct _fat_ptr _T49;
  unsigned int _T4A;
  int _T4B;
  unsigned int _T4C;
  struct _fat_ptr _T4D;
  unsigned int _T4E;
  struct _fat_ptr _T4F;
  int _T50;
  int _T51;
  unsigned long _T52;
  void * _T53;
  struct _handler_cons _T54;
  _T0 = &_T54;
  _push_handler(_T0);
  { int _T55 = 0;
    _T1 = setjmp(_T54.handler);
    if (! _T1) { goto _TL1B;
    }
    _T55 = 1;
    goto _TL1C;
    _TL1B: _TL1C: if (_T55) { goto _TL1D;
    }else { goto _TL1F;
    }
    _TL1F: { int i = 0;
      _TL20: _T2 = i;
      _T3 = (unsigned int)_T2;
      _T4 = line;
      _T5 = _get_fat_size(_T4,sizeof(char));
      if (_T3 < _T5) { goto _TL23;
      }else { goto _TL22;
      }
      _TL23: _T6 = line;
      _T7 = _T6.curr;
      _T8 = (char *)_T7;
      _T9 = _check_null(_T8);
      _TA = i;
      _TB = _T9[_TA];
      _TC = (int)_TB;
      if (_TC < 48) { goto _TL21;
      }else { goto _TL24;
      }
      _TL24: _TD = line;
      _TE = _TD.curr;
      _TF = (char *)_TE;
      _T10 = i;
      _T11 = _TF[_T10];
      _T12 = (int)_T11;
      if (_T12 > 57) { goto _TL21;
      }else { goto _TL22;
      }
      _TL21: i = i + 1;
      goto _TL20;
      _TL22: { int j = i;
	_TL25: _T13 = j;
	_T14 = (unsigned int)_T13;
	_T15 = line;
	_T16 = _get_fat_size(_T15,sizeof(char));
	if (_T14 < _T16) { goto _TL29;
	}else { goto _TL27;
	}
	_TL29: _T17 = line;
	_T18 = _T17.curr;
	_T19 = (char *)_T18;
	_T1A = _check_null(_T19);
	_T1B = j;
	_T1C = _T1A[_T1B];
	_T1D = (int)_T1C;
	if (_T1D >= 48) { goto _TL28;
	}else { goto _TL27;
	}
	_TL28: _T1E = line;
	_T1F = _T1E.curr;
	_T20 = (char *)_T1F;
	_T21 = j;
	_T22 = _T20[_T21];
	_T23 = (int)_T22;
	if (_T23 <= 57) { goto _TL26;
	}else { goto _TL27;
	}
	_TL26: j = j + 1;
	goto _TL25;
	_TL27: _T24 = i;
	_T25 = (unsigned int)_T24;
	_T26 = line;
	_T27 = _get_fat_size(_T26,sizeof(char));
	if (_T25 != _T27) { goto _TL2A;
	}
	{ struct _tuple0 * _T56 = 0;
	  _npop_handler(0);
	  return _T56;
	}_TL2A: { int number = 0;
	  { struct Cyc_IntPtr_sa_ScanfArg_struct _T56;
	    _T56.tag = 2;
	    _T56.f1 = &number;
	    _T29 = _T56;
	  }{ struct Cyc_IntPtr_sa_ScanfArg_struct _T56 = _T29;
	    void * _T57[1];
	    _T57[0] = &_T56;
	    _T2A = line;
	    _T2B = i;
	    _T2C = j - i;
	    _T2D = (unsigned long)_T2C;
	    _T2E = Cyc_substring(_T2A,_T2B,_T2D);
	    _T2F = _tag_fat("%d",sizeof(char),3U);
	    _T30 = _tag_fat(_T57,sizeof(void *),1);
	    _T28 = Cyc_sscanf(_T2E,_T2F,_T30);
	  }if (_T28 == 1) { goto _TL2C;
	  }
	  { struct _tuple0 * _T56 = 0;
	    _npop_handler(0);
	    return _T56;
	  }_TL2C: _TL2E: _T31 = j;
	  _T32 = (unsigned int)_T31;
	  _T33 = line;
	  _T34 = _get_fat_size(_T33,sizeof(char));
	  if (_T32 < _T34) { goto _TL31;
	  }else { goto _TL30;
	  }
	  _TL31: _T35 = line;
	  _T36 = _T35.curr;
	  _T37 = (char *)_T36;
	  _T38 = _check_null(_T37);
	  _T39 = j;
	  _T3A = _T38[_T39];
	  _T3B = (int)_T3A;
	  if (_T3B != 34) { goto _TL2F;
	  }else { goto _TL30;
	  }
	  _TL2F: j = j + 1;
	  goto _TL2E;
	  _TL30: j = j + 1;
	  { int k = j;
	    _TL32: _T3C = k;
	    _T3D = (unsigned int)_T3C;
	    _T3E = line;
	    _T3F = _get_fat_size(_T3E,sizeof(char));
	    if (_T3D < _T3F) { goto _TL35;
	    }else { goto _TL34;
	    }
	    _TL35: _T40 = line;
	    _T41 = _T40.curr;
	    _T42 = (char *)_T41;
	    _T43 = _check_null(_T42);
	    _T44 = k;
	    _T45 = _T43[_T44];
	    _T46 = (int)_T45;
	    if (_T46 != 34) { goto _TL33;
	    }else { goto _TL34;
	    }
	    _TL33: k = k + 1;
	    goto _TL32;
	    _TL34: _T47 = j;
	    _T48 = (unsigned int)_T47;
	    _T49 = line;
	    _T4A = _get_fat_size(_T49,sizeof(char));
	    if (_T48 == _T4A) { goto _TL38;
	    }else { goto _TL39;
	    }
	    _TL39: _T4B = k;
	    _T4C = (unsigned int)_T4B;
	    _T4D = line;
	    _T4E = _get_fat_size(_T4D,sizeof(char));
	    if (_T4C == _T4E) { goto _TL38;
	    }else { goto _TL36;
	    }
	    _TL38: { struct _tuple0 * _T56 = 0;
	      _npop_handler(0);
	      return _T56;
	    }_TL36: _T4F = line;
	    _T50 = j;
	    _T51 = k - j;
	    _T52 = (unsigned long)_T51;
	    { struct _fat_ptr fname = Cyc_substring(_T4F,_T50,_T52);
	      struct _tuple0 * _T56;
	      _T56 = _cycalloc(sizeof(struct _tuple0));
	      _T56->f0 = fname;
	      _T56->f1 = number;
	      _npop_handler(0);
	      return _T56;
	    }
	  }
	}
      }
    }_pop_handler();
    goto _TL1E;
    _TL1D: _T53 = Cyc_Core_get_exn_thrown();
    { void * _T56 = (void *)_T53;
      return 0;
      ;
    }_TL1E: ;
  }
}
Exemplo n.º 4
0
void Cyc_Lineno_poss_of_abss(struct _fat_ptr filename,struct Cyc_List_List * places) {
  struct Cyc_List_List * (* _T0)(int (*)(struct _tuple1 *,struct _tuple1 *),
				 struct Cyc_List_List *);
  struct Cyc_List_List * (* _T1)(int (*)(void *,void *),struct Cyc_List_List *);
  struct Cyc_List_List * _T2;
  struct _fat_ptr _T3;
  struct _fat_ptr _T4;
  struct _handler_cons * _T5;
  int _T6;
  enum Cyc_Lineno_token_val _T7;
  int _T8;
  int _T9;
  struct Cyc_List_List * _TA;
  void * _TB;
  struct _tuple1 * _TC;
  struct _tuple1 _TD;
  int _TE;
  enum Cyc_Lineno_token_val _TF;
  int _T10;
  struct _tuple0 * _T11;
  struct _tuple0 _T12;
  struct _tuple0 * _T13;
  struct _tuple0 _T14;
  enum Cyc_Lineno_token_val _T15;
  int _T16;
  int _T17;
  struct Cyc_List_List * _T18;
  void * _T19;
  struct _tuple1 * _T1A;
  struct _tuple1 _T1B;
  int _T1C;
  struct Cyc_List_List * _T1D;
  void * _T1E;
  struct _tuple1 * _T1F;
  struct _tuple1 _T20;
  struct Cyc_Lineno_Pos * _T21;
  struct Cyc_Lineno_Pos * _T22;
  struct Cyc_Lineno_Pos * _T23;
  struct Cyc_Lineno_Pos * _T24;
  unsigned long _T25;
  int _T26;
  struct Cyc_List_List * _T27;
  void * _T28;
  struct _tuple1 * _T29;
  struct _tuple1 _T2A;
  int _T2B;
  int _T2C;
  unsigned long _T2D;
  unsigned long _T2E;
  struct Cyc_Lineno_Pos * _T2F;
  int _T30;
  struct Cyc_Lineno_Pos * _T31;
  struct Cyc_List_List * _T32;
  void * _T33;
  _T1 = Cyc_List_merge_sort;
  { struct Cyc_List_List * (* _T34)(int (*)(struct _tuple1 *,struct _tuple1 *),
				    struct Cyc_List_List *) = (struct Cyc_List_List * (*)(int (*)(struct _tuple1 *,
												  struct _tuple1 *),
											  struct Cyc_List_List *))_T1;
    _T0 = _T34;
  }_T2 = places;
  places = _T0(Cyc_Lineno_place_cmp,_T2);
  _T3 = filename;
  _T4 = _tag_fat("r",sizeof(char),2U);
  { struct Cyc___cycFILE * f = Cyc_file_open(_T3,_T4);
    { struct _handler_cons _T34;
      _T5 = &_T34;
      _push_handler(_T5);
      { int _T35 = 0;
	_T6 = setjmp(_T34.handler);
	if (! _T6) { goto _TL3A;
	}
	_T35 = 1;
	goto _TL3B;
	_TL3A: _TL3B: if (_T35) { goto _TL3C;
	}else { goto _TL3E;
	}
	_TL3E: { struct Cyc_Lexing_lexbuf * lbuf = Cyc_Lexing_from_file(f);
	  struct _fat_ptr source_file = filename;
	  int line = 1;
	  struct _fat_ptr this_line;
	  int eol;
	  enum Cyc_Lineno_token_val next;
	  _TL3F: if (places != 0) { goto _TL40;
	  }else { goto _TL41;
	  }
	  _TL40: _TL42: if (1) { goto _TL43;
	  }else { goto _TL44;
	  }
	  _TL43: next = Cyc_Lineno_token(lbuf);
	  eol = Cyc_Lexing_lexeme_end(lbuf);
	  this_line = Cyc_Lexing_lexeme(lbuf);
	  _T7 = next;
	  _T8 = (int)_T7;
	  if (_T8 == 2) { goto _TL47;
	  }else { goto _TL48;
	  }
	  _TL48: _T9 = eol;
	  _TA = places;
	  _TB = _TA->hd;
	  _TC = (struct _tuple1 *)_TB;
	  _TD = *_TC;
	  _TE = _TD.f0;
	  if (_T9 > _TE) { goto _TL47;
	  }else { goto _TL45;
	  }
	  _TL47: goto _TL44;
	  _TL45: _TF = next;
	  _T10 = (int)_TF;
	  if (_T10 != 0) { goto _TL49;
	  }
	  line = line + 1;
	  goto _TL4A;
	  _TL49: { struct _tuple0 * fno = Cyc_Lineno_parse_linedef(this_line);
	    if (fno != 0) { goto _TL4B;
	    }
	    line = line + 1;
	    goto _TL4C;
	    _TL4B: _T11 = fno;
	    _T12 = *_T11;
	    source_file = _T12.f0;
	    _T13 = fno;
	    _T14 = *_T13;
	    line = _T14.f1;
	    _TL4C: ;
	  }_TL4A: goto _TL42;
	  _TL44: _TL4D: if (places != 0) { goto _TL50;
	  }else { goto _TL4F;
	  }
	  _TL50: _T15 = next;
	  _T16 = (int)_T15;
	  if (_T16 == 2) { goto _TL4E;
	  }else { goto _TL51;
	  }
	  _TL51: _T17 = eol;
	  _T18 = places;
	  _T19 = _T18->hd;
	  _T1A = (struct _tuple1 *)_T19;
	  _T1B = *_T1A;
	  _T1C = _T1B.f0;
	  if (_T17 > _T1C) { goto _TL4E;
	  }else { goto _TL4F;
	  }
	  _TL4E: _T1D = places;
	  _T1E = _T1D->hd;
	  _T1F = (struct _tuple1 *)_T1E;
	  _T20 = *_T1F;
	  { struct Cyc_Lineno_Pos * p = _T20.f1;
	    _T21 = p;
	    _T21->logical_file = Cyc_strdup(source_file);
	    _T22 = p;
	    _T22->line = this_line;
	    _T23 = p;
	    _T23->line_no = line;
	    _T24 = p;
	    _T25 = Cyc_strlen(this_line);
	    _T26 = eol;
	    _T27 = places;
	    _T28 = _T27->hd;
	    _T29 = (struct _tuple1 *)_T28;
	    _T2A = *_T29;
	    _T2B = _T2A.f0;
	    _T2C = _T26 - _T2B;
	    _T2D = (unsigned long)_T2C;
	    _T2E = _T25 - _T2D;
	    _T24->col = (int)_T2E;
	    _T2F = p;
	    _T30 = _T2F->col;
	    if (_T30 >= 0) { goto _TL52;
	    }
	    _T31 = p;
	    _T31->col = 0;
	    goto _TL53;
	    _TL52: _TL53: _T32 = places;
	    places = _T32->tl;
	  }goto _TL4D;
	  _TL4F: line = line + 1;
	  goto _TL3F;
	  _TL41: ;
	}_pop_handler();
	goto _TL3D;
	_TL3C: _T33 = Cyc_Core_get_exn_thrown();
	{ void * _T36 = (void *)_T33;
	  void * _T37;
	  _T37 = _T36;
	  { void * y = _T37;
	    Cyc_file_close(f);
	    _throw(y);
	  };
	}_TL3D: ;
      }
    }Cyc_file_close(f);
    return;
  }
}
Exemplo n.º 5
0
int Cyc_Base64_encode(struct _fat_ptr src,struct _fat_ptr dest,unsigned int src_len) {
  struct _handler_cons * _T0;
  int _T1;
  struct _fat_ptr _T2;
  unsigned int _T3;
  unsigned int _T4;
  int _T5;
  unsigned char * _T6;
  const char * _T7;
  int _T8;
  struct _fat_ptr _T9;
  unsigned int _TA;
  int _TB;
  unsigned char * _TC;
  const char * _TD;
  char _TE;
  int _TF;
  struct _fat_ptr _T10;
  unsigned int _T11;
  int _T12;
  unsigned char * _T13;
  const char * _T14;
  char _T15;
  char _T16;
  int _T17;
  int _T18;
  int _T19;
  int _T1A;
  int _T1B;
  int _T1C;
  struct _fat_ptr _T1D;
  unsigned int _T1E;
  unsigned int _T1F;
  int _T20;
  unsigned char * _T21;
  char * _T22;
  char * _T23;
  int _T24;
  char * _T25;
  char * _T26;
  unsigned int _T27;
  unsigned char * _T28;
  char * _T29;
  struct _fat_ptr _T2A;
  unsigned int _T2B;
  unsigned int _T2C;
  int _T2D;
  unsigned char * _T2E;
  char * _T2F;
  char * _T30;
  int _T31;
  char * _T32;
  char * _T33;
  unsigned int _T34;
  unsigned char * _T35;
  char * _T36;
  struct _fat_ptr _T37;
  unsigned int _T38;
  unsigned int _T39;
  int _T3A;
  unsigned char * _T3B;
  char * _T3C;
  char * _T3D;
  int _T3E;
  char * _T3F;
  char * _T40;
  unsigned int _T41;
  unsigned char * _T42;
  char * _T43;
  struct _fat_ptr _T44;
  unsigned int _T45;
  unsigned int _T46;
  int _T47;
  unsigned char * _T48;
  char * _T49;
  char * _T4A;
  int _T4B;
  char * _T4C;
  char * _T4D;
  unsigned int _T4E;
  unsigned char * _T4F;
  char * _T50;
  unsigned int _T51;
  int _T52;
  struct _fat_ptr _T53;
  unsigned int _T54;
  int _T55;
  unsigned char * _T56;
  char * _T57;
  unsigned int _T58;
  unsigned char * _T59;
  char * _T5A;
  void * _T5B;
  struct _handler_cons _T5C;
  _T0 = &_T5C;
  _push_handler(_T0);
  { int _T5D = 0;
    _T1 = setjmp(_T5C.handler);
    if (! _T1) { goto _TL2;
    }
    _T5D = 1;
    goto _TL3;
    _TL2: _TL3: if (_T5D) { goto _TL4;
    }else { goto _TL6;
    }
    _TL6: { unsigned int i = 0U;
      unsigned int j = 0U;
      _TL7: if (i < src_len) { goto _TL8;
      }else { goto _TL9;
      }
      _TL8: _T2 = src;
      _T3 = i;
      i = _T3 + 1;
      _T4 = _T3;
      _T5 = (int)_T4;
      _T6 = _check_fat_subscript(_T2,sizeof(char),_T5);
      _T7 = (const char *)_T6;
      { char b1 = *_T7;
	if (i >= src_len) { goto _TLA;
	}
	_T9 = src;
	_TA = i;
	_TB = (int)_TA;
	_TC = _check_fat_subscript(_T9,sizeof(char),_TB);
	_TD = (const char *)_TC;
	_TE = *_TD;
	_T8 = (int)_TE;
	goto _TLB;
	_TLA: _T8 = 0;
	_TLB: { int b2 = _T8;
	  i = i + 1;
	  if (i >= src_len) { goto _TLC;
	  }
	  _T10 = src;
	  _T11 = i;
	  _T12 = (int)_T11;
	  _T13 = _check_fat_subscript(_T10,sizeof(char),_T12);
	  _T14 = (const char *)_T13;
	  _T15 = *_T14;
	  _TF = (int)_T15;
	  goto _TLD;
	  _TLC: _TF = 0;
	  _TLD: { int b3 = _TF;
	    i = i + 1;
	    _T16 = b1 << 16;
	    _T17 = (int)_T16;
	    _T18 = b2 << 8;
	    _T19 = _T17 | _T18;
	    _T1A = b3;
	    { int r = _T19 | _T1A;
	      int a = r >> 18;
	      _T1B = r >> 12;
	      { int b = _T1B & 63;
		_T1C = r >> 6;
		{ int c = _T1C & 63;
		  int d = r & 63;
		  _T1D = dest;
		  _T1E = j;
		  j = _T1E + 1;
		  _T1F = _T1E;
		  _T20 = (int)_T1F;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T1D,sizeof(char),
							 _T20);
		    _T21 = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T22 = (char *)_T21;
		    { char _T5F = *_T22;
		      _T23 = Cyc_Base64_encode_map;
		      _T24 = a;
		      _T25 = _check_known_subscript_notnull(_T23,65U,sizeof(char),
							    _T24);
		      _T26 = (char *)_T25;
		      { char _T60 = *_T26;
			_T27 = _get_fat_size(_T5E,sizeof(char));
			if (_T27 != 1U) { goto _TLE;
			}
			if (_T5F != 0) { goto _TLE;
			}
			if (_T60 == 0) { goto _TLE;
			}
			_throw_arraybounds();
			goto _TLF;
			_TLE: _TLF: _T28 = _T5E.curr;
			_T29 = (char *)_T28;
			*_T29 = _T60;
		      }
		    }
		  }_T2A = dest;
		  _T2B = j;
		  j = _T2B + 1;
		  _T2C = _T2B;
		  _T2D = (int)_T2C;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T2A,sizeof(char),
							 _T2D);
		    _T2E = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T2F = (char *)_T2E;
		    { char _T5F = *_T2F;
		      _T30 = Cyc_Base64_encode_map;
		      _T31 = b;
		      _T32 = _check_known_subscript_notnull(_T30,65U,sizeof(char),
							    _T31);
		      _T33 = (char *)_T32;
		      { char _T60 = *_T33;
			_T34 = _get_fat_size(_T5E,sizeof(char));
			if (_T34 != 1U) { goto _TL10;
			}
			if (_T5F != 0) { goto _TL10;
			}
			if (_T60 == 0) { goto _TL10;
			}
			_throw_arraybounds();
			goto _TL11;
			_TL10: _TL11: _T35 = _T5E.curr;
			_T36 = (char *)_T35;
			*_T36 = _T60;
		      }
		    }
		  }_T37 = dest;
		  _T38 = j;
		  j = _T38 + 1;
		  _T39 = _T38;
		  _T3A = (int)_T39;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T37,sizeof(char),
							 _T3A);
		    _T3B = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T3C = (char *)_T3B;
		    { char _T5F = *_T3C;
		      _T3D = Cyc_Base64_encode_map;
		      _T3E = c;
		      _T3F = _check_known_subscript_notnull(_T3D,65U,sizeof(char),
							    _T3E);
		      _T40 = (char *)_T3F;
		      { char _T60 = *_T40;
			_T41 = _get_fat_size(_T5E,sizeof(char));
			if (_T41 != 1U) { goto _TL12;
			}
			if (_T5F != 0) { goto _TL12;
			}
			if (_T60 == 0) { goto _TL12;
			}
			_throw_arraybounds();
			goto _TL13;
			_TL12: _TL13: _T42 = _T5E.curr;
			_T43 = (char *)_T42;
			*_T43 = _T60;
		      }
		    }
		  }_T44 = dest;
		  _T45 = j;
		  j = _T45 + 1;
		  _T46 = _T45;
		  _T47 = (int)_T46;
		  { struct _fat_ptr _T5E = _fat_ptr_plus(_T44,sizeof(char),
							 _T47);
		    _T48 = _check_fat_subscript(_T5E,sizeof(char),0U);
		    _T49 = (char *)_T48;
		    { char _T5F = *_T49;
		      _T4A = Cyc_Base64_encode_map;
		      _T4B = d;
		      _T4C = _check_known_subscript_notnull(_T4A,65U,sizeof(char),
							    _T4B);
		      _T4D = (char *)_T4C;
		      { char _T60 = *_T4D;
			_T4E = _get_fat_size(_T5E,sizeof(char));
			if (_T4E != 1U) { goto _TL14;
			}
			if (_T5F != 0) { goto _TL14;
			}
			if (_T60 == 0) { goto _TL14;
			}
			_throw_arraybounds();
			goto _TL15;
			_TL14: _TL15: _T4F = _T5E.curr;
			_T50 = (char *)_T4F;
			*_T50 = _T60;
		      }
		    }
		  }
		}
	      }
	    }
	  }
	}
      }goto _TL7;
      _TL9: { unsigned int k = i - src_len;
	_TL19: _T51 = k;
	_T52 = (int)_T51;
	if (_T52) { goto _TL17;
	}else { goto _TL18;
	}
	_TL17: _T53 = dest;
	_T54 = j - k;
	_T55 = (int)_T54;
	{ struct _fat_ptr _T5E = _fat_ptr_plus(_T53,sizeof(char),_T55);
	  _T56 = _check_fat_subscript(_T5E,sizeof(char),0U);
	  _T57 = (char *)_T56;
	  { char _T5F = *_T57;
	    char _T60 = '=';
	    _T58 = _get_fat_size(_T5E,sizeof(char));
	    if (_T58 != 1U) { goto _TL1A;
	    }
	    if (_T5F != 0) { goto _TL1A;
	    }
	    if (_T60 == 0) { goto _TL1A;
	    }
	    _throw_arraybounds();
	    goto _TL1B;
	    _TL1A: _TL1B: _T59 = _T5E.curr;
	    _T5A = (char *)_T59;
	    *_T5A = _T60;
	  }
	}k = k + -1;
	goto _TL19;
	_TL18: ;
      }{ int _T5E = 0;
	_npop_handler(0);
	return _T5E;
      }
    }_pop_handler();
    goto _TL5;
    _TL4: _T5B = Cyc_Core_get_exn_thrown();
    { void * _T5E = (void *)_T5B;
      return 1;
      ;
    }_TL5: ;
  }
}
Exemplo n.º 6
0
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;
    }
  }
}
Exemplo n.º 7
0
static int Cyc_Compact_most_frequent_elt(struct _fat_ptr v) {
  struct Cyc_Hashtable_Table * (* _T0)(int,int (*)(int,int),int (*)(int));
  struct Cyc_Hashtable_Table * (* _T1)(int,int (*)(void *,void *),int (*)(void *));
  int (* _T2)(int,int);
  int (* _T3)(int);
  void * (* _T4)(void *);
  int _T5;
  unsigned int _T6;
  struct _fat_ptr _T7;
  unsigned int _T8;
  struct _fat_ptr _T9;
  unsigned char * _TA;
  int * _TB;
  int * _TC;
  int _TD;
  struct _handler_cons * _TE;
  int _TF;
  int * (* _T10)(struct Cyc_Hashtable_Table *,int);
  void * (* _T11)(struct Cyc_Hashtable_Table *,void *);
  void * _T12;
  struct Cyc_Core_Not_found_exn_struct * _T13;
  char * _T14;
  char * _T15;
  int * _T16;
  struct _RegionHandle * _T17;
  void (* _T18)(struct Cyc_Hashtable_Table *,int,int *);
  void (* _T19)(struct Cyc_Hashtable_Table *,void *,void *);
  int * _T1A;
  int _T1B;
  int * _T1C;
  struct _RegionHandle _T1D = _new_region(0U,"rgn");
  struct _RegionHandle * rgn = &_T1D;
  _push_region(rgn);
  _T1 = Cyc_Hashtable_create;
  { struct Cyc_Hashtable_Table * (* _T1E)(int,int (*)(int,int),int (*)(int)) = (struct Cyc_Hashtable_Table * (*)(int,
														 int (*)(int,
															 int),
														 int (*)(int)))_T1;
    _T0 = _T1E;
  }_T2 = Cyc_Core_intcmp;
  _T4 = Cyc_Core_identity;
  { int (* _T1E)(int) = (int (*)(int))_T4;
    _T3 = _T1E;
  }{ struct Cyc_Hashtable_Table * frequencies = _T0(17,_T2,_T3);
    int max_freq = 0;
    int most_freq = 0;
    { int i = 0;
      _TL3: _T5 = i;
      _T6 = (unsigned int)_T5;
      _T7 = v;
      _T8 = _get_fat_size(_T7,sizeof(int));
      if (_T6 < _T8) { goto _TL1;
      }else { goto _TL2;
      }
      _TL1: _T9 = v;
      _TA = _T9.curr;
      _TB = (int *)_TA;
      _TC = _check_null(_TB);
      _TD = i;
      { int e = _TC[_TD];
	int * r;
	{ struct _handler_cons _T1E;
	  _TE = &_T1E;
	  _push_handler(_TE);
	  { int _T1F = 0;
	    _TF = setjmp(_T1E.handler);
	    if (! _TF) { goto _TL4;
	    }
	    _T1F = 1;
	    goto _TL5;
	    _TL4: _TL5: if (_T1F) { goto _TL6;
	    }else { goto _TL8;
	    }
	    _TL8: _T11 = Cyc_Hashtable_lookup;
	    { int * (* _T20)(struct Cyc_Hashtable_Table *,int) = (int * (*)(struct Cyc_Hashtable_Table *,
									    int))_T11;
	      _T10 = _T20;
	    }r = _T10(frequencies,e);
	    _pop_handler();
	    goto _TL7;
	    _TL6: _T12 = Cyc_Core_get_exn_thrown();
	    { void * _T20 = (void *)_T12;
	      void * _T21;
	      _T13 = (struct Cyc_Core_Not_found_exn_struct *)_T20;
	      _T14 = _T13->tag;
	      _T15 = Cyc_Core_Not_found;
	      if (_T14 != _T15) { goto _TL9;
	      }
	      _T17 = rgn;
	      { int * _T22 = _region_malloc(_T17,0U,sizeof(int));
		*_T22 = 0;
		_T16 = (int *)_T22;
	      }r = _T16;
	      _T19 = Cyc_Hashtable_insert;
	      { void (* _T22)(struct Cyc_Hashtable_Table *,int,int *) = (void (*)(struct Cyc_Hashtable_Table *,
										  int,
										  int *))_T19;
		_T18 = _T22;
	      }_T18(frequencies,e,r);
	      goto _LL0;
	      _TL9: _T21 = _T20;
	      { void * exn = _T21;
		_rethrow(exn);
	      }_LL0: ;
	    }_TL7: ;
	  }
	}_T1A = r;
	_T1B = *_T1A;
	{ int f = _T1B + 1;
	  _T1C = r;
	  *_T1C = f;
	  if (f <= max_freq) { goto _TLB;
	  }
	  max_freq = f;
	  most_freq = e;
	  goto _TLC;
	  _TLB: _TLC: ;
	}
      }i = i + 1;
      goto _TL3;
      _TL2: ;
    }{ int _T1E = most_freq;
      _npop_handler(0);
      return _T1E;
    }
  }_pop_region();
}