allocate_itemsets ()
{
  int nsyms.0;
  long unsigned int D.4170;
  unsigned int D.4171;
  unsigned int D.4172;
  short int * ritem.1;
  int nitems.2;
  long unsigned int D.4175;
  long unsigned int D.4176;
  short int D.4177;
  long unsigned int D.4180;
  long unsigned int D.4181;
  short int * D.4182;
  short int D.4183;
  short int D.4184;
  unsigned short D.4185;
  unsigned short D.4186;
  short int D.4187;
  unsigned int D.4188;
  char * kernel_base.3;
  long unsigned int D.4190;
  unsigned int D.4191;
  unsigned int D.4192;
  char * kernel_items.4;
  short int * * kernel_base.5;
  long unsigned int D.4195;
  long unsigned int D.4196;
  short int * * D.4197;
  short int * kernel_items.6;
  long unsigned int D.4199;
  short int * D.4200;
  long unsigned int D.4201;
  short int * D.4202;
  short int D.4203;
  int D.4204;
  char * kernel_end.7;
  register short int * itemp;
  register short int * item_end;
  register int symbol;
  register int i;
  register int count;
  register int max;
  register short int * symbol_count;

  count = 0;
  nsyms.0 = nsyms;
  D.4170 = (long unsigned int) nsyms.0;
  D.4171 = (unsigned int) D.4170;
  D.4172 = D.4171 * 2;
  symbol_count = allocate (D.4172);
  ritem.1 = ritem;
  nitems.2 = nitems;
  D.4175 = (long unsigned int) nitems.2;
  D.4176 = D.4175 * 2;
  item_end = ritem.1 + D.4176;
  itemp = ritem;
  goto <D.3961>;
  <D.3960>:
  D.4177 = *itemp;
  symbol = (int) D.4177;
  if (symbol >= 0) goto <D.4178>; else goto <D.4179>;
  <D.4178>:
  count = count + 1;
  D.4180 = (long unsigned int) symbol;
  D.4181 = D.4180 * 2;
  D.4182 = symbol_count + D.4181;
  D.4183 = *D.4182;
  D.4184 = D.4183;
  D.4185 = (unsigned short) D.4184;
  D.4186 = D.4185 + 1;
  D.4187 = (short int) D.4186;
  *D.4182 = D.4187;
  <D.4179>:
  itemp = itemp + 2;
  <D.3961>:
  if (itemp < item_end) goto <D.3960>; else goto <D.3962>;
  <D.3962>:
  nsyms.0 = nsyms;
  D.4170 = (long unsigned int) nsyms.0;
  D.4171 = (unsigned int) D.4170;
  D.4188 = D.4171 * 8;
  kernel_base.3 = allocate (D.4188);
  kernel_base = kernel_base.3;
  D.4190 = (long unsigned int) count;
  D.4191 = (unsigned int) D.4190;
  D.4192 = D.4191 * 2;
  kernel_items.4 = allocate (D.4192);
  kernel_items = kernel_items.4;
  count = 0;
  max = 0;
  i = 0;
  goto <D.3964>;
  <D.3963>:
  kernel_base.5 = kernel_base;
  D.4195 = (long unsigned int) i;
  D.4196 = D.4195 * 8;
  D.4197 = kernel_base.5 + D.4196;
  kernel_items.6 = kernel_items;
  D.4190 = (long unsigned int) count;
  D.4199 = D.4190 * 2;
  D.4200 = kernel_items.6 + D.4199;
  *D.4197 = D.4200;
  D.4195 = (long unsigned int) i;
  D.4201 = D.4195 * 2;
  D.4202 = symbol_count + D.4201;
  D.4203 = *D.4202;
  D.4204 = (int) D.4203;
  count = D.4204 + count;
  D.4195 = (long unsigned int) i;
  D.4201 = D.4195 * 2;
  D.4202 = symbol_count + D.4201;
  D.4203 = *D.4202;
  D.4204 = (int) D.4203;
  if (D.4204 > max) goto <D.4205>; else goto <D.4206>;
  <D.4205>:
  D.4195 = (long unsigned int) i;
  D.4201 = D.4195 * 2;
  D.4202 = symbol_count + D.4201;
  D.4203 = *D.4202;
  max = (int) D.4203;
  <D.4206>:
  i = i + 1;
  <D.3964>:
  nsyms.0 = nsyms;
  if (i < nsyms.0) goto <D.3963>; else goto <D.3965>;
  <D.3965>:
  shift_symbol = symbol_count;
  nsyms.0 = nsyms;
  D.4170 = (long unsigned int) nsyms.0;
  D.4171 = (unsigned int) D.4170;
  D.4188 = D.4171 * 8;
  kernel_end.7 = allocate (D.4188);
  kernel_end = kernel_end.7;
}


allocate_storage ()
{
  int nsyms.8;
  long unsigned int D.4209;
  unsigned int D.4210;
  unsigned int D.4211;
  char * shiftset.9;
  int nrules.10;
  int D.4214;
  long unsigned int D.4215;
  unsigned int D.4216;
  unsigned int D.4217;
  char * redset.11;
  int nitems.12;
  long unsigned int D.4220;
  unsigned int D.4221;
  unsigned int D.4222;
  char * state_set.13;

  allocate_itemsets ();
  nsyms.8 = nsyms;
  D.4209 = (long unsigned int) nsyms.8;
  D.4210 = (unsigned int) D.4209;
  D.4211 = D.4210 * 2;
  shiftset.9 = allocate (D.4211);
  shiftset = shiftset.9;
  nrules.10 = nrules;
  D.4214 = nrules.10 + 1;
  D.4215 = (long unsigned int) D.4214;
  D.4216 = (unsigned int) D.4215;
  D.4217 = D.4216 * 2;
  redset.11 = allocate (D.4217);
  redset = redset.11;
  nitems.12 = nitems;
  D.4220 = (long unsigned int) nitems.12;
  D.4221 = (unsigned int) D.4220;
  D.4222 = D.4221 * 8;
  state_set.13 = allocate (D.4222);
  state_set = state_set.13;
}


append_states ()
{
  short int * shift_symbol.14;
  long unsigned int D.4225;
  long unsigned int D.4226;
  short int * D.4227;
  short int D.4228;
  long unsigned int D.4229;
  long unsigned int D.4230;
  short int * D.4231;
  sizetype D.4232;
  short int * D.4233;
  short int D.4234;
  int D.4236;
  short int D.4237;
  int nshifts.15;
  short int * shiftset.16;
  short int * D.4240;
  int D.4241;
  short int D.4242;
  register int i;
  register int j;
  register int symbol;

  i = 1;
  goto <D.3977>;
  <D.3976>:
  shift_symbol.14 = shift_symbol;
  D.4225 = (long unsigned int) i;
  D.4226 = D.4225 * 2;
  D.4227 = shift_symbol.14 + D.4226;
  D.4228 = *D.4227;
  symbol = (int) D.4228;
  j = i;
  goto <D.3974>;
  <D.3973>:
  shift_symbol.14 = shift_symbol;
  D.4229 = (long unsigned int) j;
  D.4230 = D.4229 * 2;
  D.4231 = shift_symbol.14 + D.4230;
  shift_symbol.14 = shift_symbol;
  D.4229 = (long unsigned int) j;
  D.4230 = D.4229 * 2;
  D.4232 = D.4230 + 18446744073709551614;
  D.4233 = shift_symbol.14 + D.4232;
  D.4234 = *D.4233;
  *D.4231 = D.4234;
  j = j + -1;
  <D.3974>:
  if (j > 0) goto <D.4235>; else goto <D.3975>;
  <D.4235>:
  shift_symbol.14 = shift_symbol;
  D.4229 = (long unsigned int) j;
  D.4230 = D.4229 * 2;
  D.4232 = D.4230 + 18446744073709551614;
  D.4233 = shift_symbol.14 + D.4232;
  D.4234 = *D.4233;
  D.4236 = (int) D.4234;
  if (D.4236 > symbol) goto <D.3973>; else goto <D.3975>;
  <D.3975>:
  shift_symbol.14 = shift_symbol;
  D.4229 = (long unsigned int) j;
  D.4230 = D.4229 * 2;
  D.4231 = shift_symbol.14 + D.4230;
  D.4237 = (short int) symbol;
  *D.4231 = D.4237;
  i = i + 1;
  <D.3977>:
  nshifts.15 = nshifts;
  if (i < nshifts.15) goto <D.3976>; else goto <D.3978>;
  <D.3978>:
  i = 0;
  goto <D.3980>;
  <D.3979>:
  shift_symbol.14 = shift_symbol;
  D.4225 = (long unsigned int) i;
  D.4226 = D.4225 * 2;
  D.4227 = shift_symbol.14 + D.4226;
  D.4228 = *D.4227;
  symbol = (int) D.4228;
  shiftset.16 = shiftset;
  D.4225 = (long unsigned int) i;
  D.4226 = D.4225 * 2;
  D.4240 = shiftset.16 + D.4226;
  D.4241 = get_state (symbol);
  D.4242 = (short int) D.4241;
  *D.4240 = D.4242;
  i = i + 1;
  <D.3980>:
  nshifts.15 = nshifts;
  if (i < nshifts.15) goto <D.3979>; else goto <D.3981>;
  <D.3981>:
}


free_storage ()
{
  short int * shift_symbol.17;
  short int * redset.18;
  short int * shiftset.19;
  short int * * kernel_base.20;
  short int * * kernel_end.21;
  short int * kernel_items.22;
  struct core * * state_set.23;

  shift_symbol.17 = shift_symbol;
  free (shift_symbol.17);
  redset.18 = redset;
  free (redset.18);
  shiftset.19 = shiftset;
  free (shiftset.19);
  kernel_base.20 = kernel_base;
  free (kernel_base.20);
  kernel_end.21 = kernel_end;
  free (kernel_end.21);
  kernel_items.22 = kernel_items;
  free (kernel_items.22);
  state_set.23 = state_set;
  free (state_set.23);
}


generate_states ()
{
  int nitems.24;
  long unsigned int D.4251;
  unsigned int D.4252;
  unsigned int D.4253;
  char * itemset.25;
  int nrules.26;
  int D.4256;
  int D.4257;
  long unsigned int D.4258;
  unsigned int D.4259;
  unsigned int D.4260;
  char * ruleset.27;
  struct core * this_state.28;
  short int D.4263;
  int D.4264;
  short int[1] * D.4265;
  int nshifts.29;
  struct core * this_state.30;
  extern int set_first_derives ();
  extern int initialize_states ();
  extern int finalize_closure ();

  allocate_storage ();
  nitems.24 = nitems;
  D.4251 = (long unsigned int) nitems.24;
  D.4252 = (unsigned int) D.4251;
  D.4253 = D.4252 * 2;
  itemset.25 = allocate (D.4253);
  itemset = itemset.25;
  nrules.26 = nrules;
  D.4256 = nrules.26 + 31;
  D.4257 = D.4256 / 32;
  D.4258 = (long unsigned int) D.4257;
  D.4259 = (unsigned int) D.4258;
  D.4260 = D.4259 * 4;
  ruleset.27 = allocate (D.4260);
  ruleset = ruleset.27;
  set_first_derives ();
  initialize_states ();
  goto <D.3997>;
  <D.3996>:
  {
    extern int closure ();
    extern int save_reductions ();
    extern int new_itemsets ();
    extern int save_shifts ();

    this_state.28 = this_state;
    D.4263 = this_state.28->nitems;
    D.4264 = (int) D.4263;
    this_state.28 = this_state;
    D.4265 = &this_state.28->items;
    closure (D.4265, D.4264);
    save_reductions ();
    new_itemsets ();
    append_states ();
    nshifts.29 = nshifts;
    if (nshifts.29 > 0) goto <D.4267>; else goto <D.4268>;
    <D.4267>:
    save_shifts ();
    <D.4268>:
    this_state.28 = this_state;
    this_state.30 = this_state.28->next;
    this_state = this_state.30;
  }
  <D.3997>:
  this_state.28 = this_state;
  if (this_state.28 != 0B) goto <D.3996>; else goto <D.3998>;
  <D.3998>:
  finalize_closure ();
  free_storage ();
}


get_state (int symbol)
{
  short int * * kernel_base.31;
  long unsigned int D.4271;
  long unsigned int D.4272;
  short int * * D.4273;
  short int * * kernel_end.32;
  short int * * D.4275;
  long int iend.33;
  long int isp1.34;
  long int D.4278;
  long int D.4279;
  short int D.4280;
  int nitems.35;
  struct core * * state_set.36;
  long unsigned int D.4286;
  long unsigned int D.4287;
  struct core * * D.4288;
  short int D.4291;
  int D.4292;
  short int * isp1.37;
  short int D.4296;
  short int * isp2.38;
  short int D.4298;
  _Bool D.4301;
  _Bool D.4302;
  _Bool D.4303;
  struct core * D.4306;
  struct core * D.4310;
  int D.4312;
  short int D.4313;
  register int key;
  register short int * isp1;
  register short int * isp2;
  register short int * iend;
  register struct core * sp;
  register int found;
  register int n;
  static const char __PRETTY_FUNCTION__[10] = "get_state";

  kernel_base.31 = kernel_base;
  D.4271 = (long unsigned int) symbol;
  D.4272 = D.4271 * 8;
  D.4273 = kernel_base.31 + D.4272;
  isp1 = *D.4273;
  kernel_end.32 = kernel_end;
  D.4271 = (long unsigned int) symbol;
  D.4272 = D.4271 * 8;
  D.4275 = kernel_end.32 + D.4272;
  iend = *D.4275;
  iend.33 = (long int) iend;
  isp1.34 = (long int) isp1;
  D.4278 = iend.33 - isp1.34;
  D.4279 = D.4278 /[ex] 2;
  n = (int) D.4279;
  D.4280 = *isp1;
  key = (int) D.4280;
  if (key < 0) goto <D.4281>; else goto <D.4283>;
  <D.4283>:
  nitems.35 = nitems;
  if (key >= nitems.35) goto <D.4281>; else goto <D.4282>;
  <D.4281>:
  __assert_fail ("0 <= key && key < nitems", "lr0.c", 213, &__PRETTY_FUNCTION__);
  <D.4282>:
  state_set.36 = state_set;
  D.4286 = (long unsigned int) key;
  D.4287 = D.4286 * 8;
  D.4288 = state_set.36 + D.4287;
  sp = *D.4288;
  if (sp != 0B) goto <D.4289>; else goto <D.4290>;
  <D.4289>:
  found = 0;
  goto <D.4018>;
  <D.4017>:
  D.4291 = sp->nitems;
  D.4292 = (int) D.4291;
  if (D.4292 == n) goto <D.4293>; else goto <D.4294>;
  <D.4293>:
  found = 1;
  kernel_base.31 = kernel_base;
  D.4271 = (long unsigned int) symbol;
  D.4272 = D.4271 * 8;
  D.4273 = kernel_base.31 + D.4272;
  isp1 = *D.4273;
  isp2 = &sp->items;
  goto <D.4015>;
  <D.4014>:
  isp1.37 = isp1;
  isp1 = isp1.37 + 2;
  D.4296 = *isp1.37;
  isp2.38 = isp2;
  isp2 = isp2.38 + 2;
  D.4298 = *isp2.38;
  if (D.4296 != D.4298) goto <D.4299>; else goto <D.4300>;
  <D.4299>:
  found = 0;
  <D.4300>:
  <D.4015>:
  D.4301 = found != 0;
  D.4302 = isp1 < iend;
  D.4303 = D.4301 & D.4302;
  if (D.4303 != 0) goto <D.4014>; else goto <D.4016>;
  <D.4016>:
  <D.4294>:
  if (found == 0) goto <D.4304>; else goto <D.4305>;
  <D.4304>:
  D.4306 = sp->link;
  if (D.4306 != 0B) goto <D.4307>; else goto <D.4308>;
  <D.4307>:
  sp = sp->link;
  goto <D.4309>;
  <D.4308>:
  D.4310 = new_state (symbol);
  sp->link = D.4310;
  sp = sp->link;
  found = 1;
  <D.4309>:
  <D.4305>:
  <D.4018>:
  if (found == 0) goto <D.4017>; else goto <D.4019>;
  <D.4019>:
  goto <D.4311>;
  <D.4290>:
  state_set.36 = state_set;
  D.4286 = (long unsigned int) key;
  D.4287 = D.4286 * 8;
  D.4288 = state_set.36 + D.4287;
  sp = new_state (symbol);
  *D.4288 = sp;
  <D.4311>:
  D.4313 = sp->number;
  D.4312 = (int) D.4313;
  return D.4312;
}


initialize_states ()
{
  short int * * derives.39;
  int start_symbol.40;
  long unsigned int D.4317;
  long unsigned int D.4318;
  short int * * D.4319;
  long unsigned int D.4320;
  long unsigned int D.4321;
  short int * D.4322;
  short int D.4323;
  unsigned int D.4324;
  unsigned int D.4325;
  unsigned int D.4326;
  long unsigned int D.4327;
  short int D.4330;
  short int * rrhs.41;
  long unsigned int D.4332;
  long unsigned int D.4333;
  short int * D.4334;
  short int D.4335;
  struct core * this_state.42;
  struct core * last_state.43;
  register int i;
  register short int * start_derives;
  register struct core * p;
  extern int no_space ();

  derives.39 = derives;
  start_symbol.40 = start_symbol;
  D.4317 = (long unsigned int) start_symbol.40;
  D.4318 = D.4317 * 8;
  D.4319 = derives.39 + D.4318;
  start_derives = *D.4319;
  i = 0;
  goto <D.4027>;
  <D.4026>:
  // predicted unlikely by continue predictor.
  goto <D.4025>;
  <D.4025>:
  i = i + 1;
  <D.4027>:
  D.4320 = (long unsigned int) i;
  D.4321 = D.4320 * 2;
  D.4322 = start_derives + D.4321;
  D.4323 = *D.4322;
  if (D.4323 >= 0) goto <D.4026>; else goto <D.4028>;
  <D.4028>:
  D.4320 = (long unsigned int) i;
  D.4324 = (unsigned int) D.4320;
  D.4325 = D.4324 + 12;
  D.4326 = D.4325 * 2;
  D.4327 = (long unsigned int) D.4326;
  p = malloc (D.4327);
  if (p == 0B) goto <D.4328>; else goto <D.4329>;
  <D.4328>:
  no_space ();
  <D.4329>:
  p->next = 0B;
  p->link = 0B;
  p->number = 0;
  p->accessing_symbol = 0;
  D.4330 = (short int) i;
  p->nitems = D.4330;
  i = 0;
  goto <D.4031>;
  <D.4030>:
  rrhs.41 = rrhs;
  D.4320 = (long unsigned int) i;
  D.4321 = D.4320 * 2;
  D.4322 = start_derives + D.4321;
  D.4323 = *D.4322;
  D.4332 = (long unsigned int) D.4323;
  D.4333 = D.4332 * 2;
  D.4334 = rrhs.41 + D.4333;
  D.4335 = *D.4334;
  p->items[i] = D.4335;
  i = i + 1;
  <D.4031>:
  D.4320 = (long unsigned int) i;
  D.4321 = D.4320 * 2;
  D.4322 = start_derives + D.4321;
  D.4323 = *D.4322;
  if (D.4323 >= 0) goto <D.4030>; else goto <D.4032>;
  <D.4032>:
  this_state = p;
  this_state.42 = this_state;
  last_state = this_state.42;
  last_state.43 = last_state;
  first_state = last_state.43;
  nstates = 1;
}


new_itemsets ()
{
  short int * * kernel_end.44;
  long unsigned int D.4339;
  long unsigned int D.4340;
  short int * * D.4341;
  int nsyms.45;
  short int * isp.46;
  short int D.4344;
  short int * ritem.47;
  long unsigned int D.4346;
  short int * D.4347;
  short int D.4348;
  long unsigned int D.4351;
  long unsigned int D.4352;
  short int * * D.4353;
  short int * shift_symbol.48;
  int shiftcount.49;
  long unsigned int D.4358;
  long unsigned int D.4359;
  short int * D.4360;
  short int D.4361;
  short int * * kernel_base.50;
  short int * * D.4363;
  short int * ksp.51;
  unsigned short D.4365;
  unsigned short D.4366;
  short int D.4367;
  short int * itemsetend.52;
  register int i;
  register int shiftcount;
  register short int * isp;
  register short int * ksp;
  register int symbol;

  i = 0;
  goto <D.4042>;
  <D.4041>:
  kernel_end.44 = kernel_end;
  D.4339 = (long unsigned int) i;
  D.4340 = D.4339 * 8;
  D.4341 = kernel_end.44 + D.4340;
  *D.4341 = 0B;
  i = i + 1;
  <D.4042>:
  nsyms.45 = nsyms;
  if (i < nsyms.45) goto <D.4041>; else goto <D.4043>;
  <D.4043>:
  shiftcount = 0;
  isp = itemset;
  goto <D.4045>;
  <D.4044>:
  isp.46 = isp;
  isp = isp.46 + 2;
  D.4344 = *isp.46;
  i = (int) D.4344;
  ritem.47 = ritem;
  D.4339 = (long unsigned int) i;
  D.4346 = D.4339 * 2;
  D.4347 = ritem.47 + D.4346;
  D.4348 = *D.4347;
  symbol = (int) D.4348;
  if (symbol > 0) goto <D.4349>; else goto <D.4350>;
  <D.4349>:
  kernel_end.44 = kernel_end;
  D.4351 = (long unsigned int) symbol;
  D.4352 = D.4351 * 8;
  D.4353 = kernel_end.44 + D.4352;
  ksp = *D.4353;
  if (ksp == 0B) goto <D.4354>; else goto <D.4355>;
  <D.4354>:
  shift_symbol.48 = shift_symbol;
  shiftcount.49 = shiftcount;
  shiftcount = shiftcount.49 + 1;
  D.4358 = (long unsigned int) shiftcount.49;
  D.4359 = D.4358 * 2;
  D.4360 = shift_symbol.48 + D.4359;
  D.4361 = (short int) symbol;
  *D.4360 = D.4361;
  kernel_base.50 = kernel_base;
  D.4351 = (long unsigned int) symbol;
  D.4352 = D.4351 * 8;
  D.4363 = kernel_base.50 + D.4352;
  ksp = *D.4363;
  <D.4355>:
  ksp.51 = ksp;
  ksp = ksp.51 + 2;
  D.4365 = (unsigned short) i;
  D.4366 = D.4365 + 1;
  D.4367 = (short int) D.4366;
  *ksp.51 = D.4367;
  kernel_end.44 = kernel_end;
  D.4351 = (long unsigned int) symbol;
  D.4352 = D.4351 * 8;
  D.4353 = kernel_end.44 + D.4352;
  *D.4353 = ksp;
  <D.4350>:
  <D.4045>:
  itemsetend.52 = itemsetend;
  if (isp < itemsetend.52) goto <D.4044>; else goto <D.4046>;
  <D.4046>:
  nshifts = shiftcount;
}


new_state (int symbol)
{
  int nstates.53;
  short int * * kernel_base.54;
  long unsigned int D.4373;
  long unsigned int D.4374;
  short int * * D.4375;
  short int * * kernel_end.55;
  short int * * D.4377;
  long int iend.56;
  long int isp1.57;
  long int D.4380;
  long int D.4381;
  int D.4382;
  long unsigned int D.4383;
  unsigned int D.4384;
  unsigned int D.4385;
  unsigned int D.4386;
  short int D.4387;
  short int D.4388;
  short int D.4389;
  short int * isp2.58;
  short int * isp1.59;
  short int D.4392;
  struct core * last_state.60;
  int nstates.61;
  struct core * D.4395;
  register int n;
  register struct core * p;
  register short int * isp1;
  register short int * isp2;
  register short int * iend;
  extern int fatal ();

  nstates.53 = nstates;
  if (nstates.53 > 32766) goto <D.4370>; else goto <D.4371>;
  <D.4370>:
  fatal ("too many states");
  <D.4371>:
  kernel_base.54 = kernel_base;
  D.4373 = (long unsigned int) symbol;
  D.4374 = D.4373 * 8;
  D.4375 = kernel_base.54 + D.4374;
  isp1 = *D.4375;
  kernel_end.55 = kernel_end;
  D.4373 = (long unsigned int) symbol;
  D.4374 = D.4373 * 8;
  D.4377 = kernel_end.55 + D.4374;
  iend = *D.4377;
  iend.56 = (long int) iend;
  isp1.57 = (long int) isp1;
  D.4380 = iend.56 - isp1.57;
  D.4381 = D.4380 /[ex] 2;
  n = (int) D.4381;
  D.4382 = n + -1;
  D.4383 = (long unsigned int) D.4382;
  D.4384 = (unsigned int) D.4383;
  D.4385 = D.4384 + 12;
  D.4386 = D.4385 * 2;
  p = allocate (D.4386);
  D.4387 = (short int) symbol;
  p->accessing_symbol = D.4387;
  nstates.53 = nstates;
  D.4388 = (short int) nstates.53;
  p->number = D.4388;
  D.4389 = (short int) n;
  p->nitems = D.4389;
  isp2 = &p->items;
  goto <D.4057>;
  <D.4056>:
  isp2.58 = isp2;
  isp2 = isp2.58 + 2;
  isp1.59 = isp1;
  isp1 = isp1.59 + 2;
  D.4392 = *isp1.59;
  *isp2.58 = D.4392;
  <D.4057>:
  if (isp1 < iend) goto <D.4056>; else goto <D.4058>;
  <D.4058>:
  last_state.60 = last_state;
  last_state.60->next = p;
  last_state = p;
  nstates.53 = nstates;
  nstates.61 = nstates.53 + 1;
  nstates = nstates.61;
  D.4395 = p;
  return D.4395;
}


show_cores ()
{
  char * * symbol_name.62;
  short int D.4400;
  long unsigned int D.4401;
  long unsigned int D.4402;
  char * * D.4403;
  char * D.4404;
  short int D.4405;
  int D.4406;
  short int D.4407;
  short int D.4408;
  short int * ritem.63;
  long unsigned int D.4410;
  long unsigned int D.4411;
  short int * D.4412;
  short int D.4413;
  short int * rlhs.64;
  int D.4415;
  int D.4416;
  long unsigned int D.4417;
  long unsigned int D.4418;
  short int * D.4419;
  short int D.4420;
  long unsigned int D.4421;
  long unsigned int D.4422;
  char * * D.4423;
  char * D.4424;
  short int * rrhs.65;
  short int * D.4426;
  short int D.4427;
  int j.66;
  long unsigned int D.4429;
  long unsigned int D.4430;
  short int * D.4431;
  short int D.4432;
  long unsigned int D.4433;
  long unsigned int D.4434;
  char * * D.4435;
  char * D.4436;
  int j.67;
  long unsigned int D.4438;
  long unsigned int D.4439;
  short int * D.4440;
  short int D.4441;
  long unsigned int D.4442;
  long unsigned int D.4443;
  char * * D.4444;
  char * D.4445;
  struct _IO_FILE * stdout.68;
  struct core * p;
  int i;
  int j;
  int k;
  int n;
  int itemno;

  k = 0;
  p = first_state;
  goto <D.4081>;
  <D.4080>:
  if (k != 0) goto <D.4397>; else goto <D.4398>;
  <D.4397>:
  printf ("\n");
  <D.4398>:
  symbol_name.62 = symbol_name;
  D.4400 = p->accessing_symbol;
  D.4401 = (long unsigned int) D.4400;
  D.4402 = D.4401 * 8;
  D.4403 = symbol_name.62 + D.4402;
  D.4404 = *D.4403;
  D.4405 = p->number;
  D.4406 = (int) D.4405;
  printf ("state %d, number = %d, accessing symbol = %s\n", k, D.4406, D.4404);
  D.4407 = p->nitems;
  n = (int) D.4407;
  i = 0;
  goto <D.4078>;
  <D.4077>:
  D.4408 = p->items[i];
  itemno = (int) D.4408;
  printf ("%4d  ", itemno);
  j = itemno;
  goto <D.4069>;
  <D.4068>:
  j = j + 1;
  <D.4069>:
  ritem.63 = ritem;
  D.4410 = (long unsigned int) j;
  D.4411 = D.4410 * 2;
  D.4412 = ritem.63 + D.4411;
  D.4413 = *D.4412;
  if (D.4413 >= 0) goto <D.4068>; else goto <D.4070>;
  <D.4070>:
  symbol_name.62 = symbol_name;
  rlhs.64 = rlhs;
  ritem.63 = ritem;
  D.4410 = (long unsigned int) j;
  D.4411 = D.4410 * 2;
  D.4412 = ritem.63 + D.4411;
  D.4413 = *D.4412;
  D.4415 = (int) D.4413;
  D.4416 = -D.4415;
  D.4417 = (long unsigned int) D.4416;
  D.4418 = D.4417 * 2;
  D.4419 = rlhs.64 + D.4418;
  D.4420 = *D.4419;
  D.4421 = (long unsigned int) D.4420;
  D.4422 = D.4421 * 8;
  D.4423 = symbol_name.62 + D.4422;
  D.4424 = *D.4423;
  printf ("%s :", D.4424);
  rrhs.65 = rrhs;
  ritem.63 = ritem;
  D.4410 = (long unsigned int) j;
  D.4411 = D.4410 * 2;
  D.4412 = ritem.63 + D.4411;
  D.4413 = *D.4412;
  D.4415 = (int) D.4413;
  D.4416 = -D.4415;
  D.4417 = (long unsigned int) D.4416;
  D.4418 = D.4417 * 2;
  D.4426 = rrhs.65 + D.4418;
  D.4427 = *D.4426;
  j = (int) D.4427;
  goto <D.4072>;
  <D.4071>:
  symbol_name.62 = symbol_name;
  ritem.63 = ritem;
  j.66 = j;
  j = j.66 + 1;
  D.4429 = (long unsigned int) j.66;
  D.4430 = D.4429 * 2;
  D.4431 = ritem.63 + D.4430;
  D.4432 = *D.4431;
  D.4433 = (long unsigned int) D.4432;
  D.4434 = D.4433 * 8;
  D.4435 = symbol_name.62 + D.4434;
  D.4436 = *D.4435;
  printf (" %s", D.4436);
  <D.4072>:
  if (j < itemno) goto <D.4071>; else goto <D.4073>;
  <D.4073>:
  printf (" .");
  goto <D.4075>;
  <D.4074>:
  symbol_name.62 = symbol_name;
  ritem.63 = ritem;
  j.67 = j;
  j = j.67 + 1;
  D.4438 = (long unsigned int) j.67;
  D.4439 = D.4438 * 2;
  D.4440 = ritem.63 + D.4439;
  D.4441 = *D.4440;
  D.4442 = (long unsigned int) D.4441;
  D.4443 = D.4442 * 8;
  D.4444 = symbol_name.62 + D.4443;
  D.4445 = *D.4444;
  printf (" %s", D.4445);
  <D.4075>:
  ritem.63 = ritem;
  D.4410 = (long unsigned int) j;
  D.4411 = D.4410 * 2;
  D.4412 = ritem.63 + D.4411;
  D.4413 = *D.4412;
  if (D.4413 >= 0) goto <D.4074>; else goto <D.4076>;
  <D.4076>:
  printf ("\n");
  stdout.68 = stdout;
  fflush (stdout.68);
  i = i + 1;
  <D.4078>:
  if (i < n) goto <D.4077>; else goto <D.4079>;
  <D.4079>:
  k = k + 1;
  p = p->next;
  <D.4081>:
  if (p != 0B) goto <D.4080>; else goto <D.4082>;
  <D.4082>:
}


printf (const char * restrict __fmt)
{
  int D.4447;

  D.4447 = __printf_chk (1, __fmt, __builtin_va_arg_pack ());
  return D.4447;
}


show_ritems ()
{
  short int * ritem.69;
  long unsigned int D.4450;
  long unsigned int D.4451;
  short int * D.4452;
  short int D.4453;
  int D.4454;
  int nitems.70;
  int i;

  i = 0;
  goto <D.4087>;
  <D.4086>:
  ritem.69 = ritem;
  D.4450 = (long unsigned int) i;
  D.4451 = D.4450 * 2;
  D.4452 = ritem.69 + D.4451;
  D.4453 = *D.4452;
  D.4454 = (int) D.4453;
  printf ("ritem[%d] = %d\n", i, D.4454);
  i = i + 1;
  <D.4087>:
  nitems.70 = nitems;
  if (i < nitems.70) goto <D.4086>; else goto <D.4088>;
  <D.4088>:
}


show_rrhs ()
{
  short int * rrhs.71;
  long unsigned int D.4457;
  long unsigned int D.4458;
  short int * D.4459;
  short int D.4460;
  int D.4461;
  int nrules.72;
  int i;

  i = 0;
  goto <D.4093>;
  <D.4092>:
  rrhs.71 = rrhs;
  D.4457 = (long unsigned int) i;
  D.4458 = D.4457 * 2;
  D.4459 = rrhs.71 + D.4458;
  D.4460 = *D.4459;
  D.4461 = (int) D.4460;
  printf ("rrhs[%d] = %d\n", i, D.4461);
  i = i + 1;
  <D.4093>:
  nrules.72 = nrules;
  if (i < nrules.72) goto <D.4092>; else goto <D.4094>;
  <D.4094>:
}


show_shifts ()
{
  short int D.4465;
  int D.4466;
  short int D.4467;
  int D.4468;
  short int D.4469;
  int D.4470;
  struct shifts * p;
  int i;
  int j;
  int k;

  k = 0;
  p = first_shift;
  goto <D.4105>;
  <D.4104>:
  if (k != 0) goto <D.4463>; else goto <D.4464>;
  <D.4463>:
  printf ("\n");
  <D.4464>:
  D.4465 = p->nshifts;
  D.4466 = (int) D.4465;
  D.4467 = p->number;
  D.4468 = (int) D.4467;
  printf ("shift %d, number = %d, nshifts = %d\n", k, D.4468, D.4466);
  D.4465 = p->nshifts;
  j = (int) D.4465;
  i = 0;
  goto <D.4102>;
  <D.4101>:
  D.4469 = p->shift[i];
  D.4470 = (int) D.4469;
  printf ("\t%d\n", D.4470);
  i = i + 1;
  <D.4102>:
  if (i < j) goto <D.4101>; else goto <D.4103>;
  <D.4103>:
  k = k + 1;
  p = p->next;
  <D.4105>:
  if (p != 0B) goto <D.4104>; else goto <D.4106>;
  <D.4106>:
}


save_shifts ()
{
  int nshifts.73;
  int D.4472;
  long unsigned int D.4473;
  unsigned int D.4474;
  unsigned int D.4475;
  unsigned int D.4476;
  struct core * this_state.74;
  short int D.4478;
  short int D.4479;
  short int * shiftset.75;
  long unsigned int D.4481;
  long unsigned int D.4482;
  short int * sp2.76;
  short int * sp1.77;
  short int D.4485;
  struct shifts * last_shift.78;
  register struct shifts * p;
  register short int * sp1;
  register short int * sp2;
  register short int * send;

  nshifts.73 = nshifts;
  D.4472 = nshifts.73 + -1;
  D.4473 = (long unsigned int) D.4472;
  D.4474 = (unsigned int) D.4473;
  D.4475 = D.4474 + 8;
  D.4476 = D.4475 * 2;
  p = allocate (D.4476);
  this_state.74 = this_state;
  D.4478 = this_state.74->number;
  p->number = D.4478;
  nshifts.73 = nshifts;
  D.4479 = (short int) nshifts.73;
  p->nshifts = D.4479;
  sp1 = shiftset;
  sp2 = &p->shift;
  shiftset.75 = shiftset;
  nshifts.73 = nshifts;
  D.4481 = (long unsigned int) nshifts.73;
  D.4482 = D.4481 * 2;
  send = shiftset.75 + D.4482;
  goto <D.4114>;
  <D.4113>:
  sp2.76 = sp2;
  sp2 = sp2.76 + 2;
  sp1.77 = sp1;
  sp1 = sp1.77 + 2;
  D.4485 = *sp1.77;
  *sp2.76 = D.4485;
  <D.4114>:
  if (sp1 < send) goto <D.4113>; else goto <D.4115>;
  <D.4115>:
  last_shift.78 = last_shift;
  if (last_shift.78 != 0B) goto <D.4487>; else goto <D.4488>;
  <D.4487>:
  last_shift.78 = last_shift;
  last_shift.78->next = p;
  last_shift = p;
  goto <D.4489>;
  <D.4488>:
  first_shift = p;
  last_shift = p;
  <D.4489>:
}


save_reductions ()
{
  short int * ritem.79;
  short int D.4491;
  long unsigned int D.4492;
  long unsigned int D.4493;
  short int * D.4494;
  short int D.4495;
  short int * redset.80;
  int count.81;
  long unsigned int D.4500;
  long unsigned int D.4501;
  short int * D.4502;
  unsigned short D.4503;
  unsigned short D.4504;
  short int D.4505;
  short int * itemsetend.82;
  int D.4509;
  long unsigned int D.4510;
  unsigned int D.4511;
  unsigned int D.4512;
  unsigned int D.4513;
  struct core * this_state.83;
  short int D.4515;
  short int D.4516;
  long unsigned int D.4517;
  long unsigned int D.4518;
  short int * rp2.84;
  short int * rp1.85;
  short int D.4521;
  struct reductions * last_reduction.86;
  register short int * isp;
  register short int * rp1;
  register short int * rp2;
  register int item;
  register int count;
  register struct reductions * p;
  register short int * rend;

  count = 0;
  isp = itemset;
  goto <D.4126>;
  <D.4125>:
  ritem.79 = ritem;
  D.4491 = *isp;
  D.4492 = (long unsigned int) D.4491;
  D.4493 = D.4492 * 2;
  D.4494 = ritem.79 + D.4493;
  D.4495 = *D.4494;
  item = (int) D.4495;
  if (item < 0) goto <D.4496>; else goto <D.4497>;
  <D.4496>:
  redset.80 = redset;
  count.81 = count;
  count = count.81 + 1;
  D.4500 = (long unsigned int) count.81;
  D.4501 = D.4500 * 2;
  D.4502 = redset.80 + D.4501;
  D.4503 = (unsigned short) item;
  D.4504 = -D.4503;
  D.4505 = (short int) D.4504;
  *D.4502 = D.4505;
  <D.4497>:
  isp = isp + 2;
  <D.4126>:
  itemsetend.82 = itemsetend;
  if (isp < itemsetend.82) goto <D.4125>; else goto <D.4127>;
  <D.4127>:
  if (count != 0) goto <D.4507>; else goto <D.4508>;
  <D.4507>:
  D.4509 = count + -1;
  D.4510 = (long unsigned int) D.4509;
  D.4511 = (unsigned int) D.4510;
  D.4512 = D.4511 + 8;
  D.4513 = D.4512 * 2;
  p = allocate (D.4513);
  this_state.83 = this_state;
  D.4515 = this_state.83->number;
  p->number = D.4515;
  D.4516 = (short int) count;
  p->nreds = D.4516;
  rp1 = redset;
  rp2 = &p->rules;
  D.4517 = (long unsigned int) count;
  D.4518 = D.4517 * 2;
  rend = rp1 + D.4518;
  goto <D.4129>;
  <D.4128>:
  rp2.84 = rp2;
  rp2 = rp2.84 + 2;
  rp1.85 = rp1;
  rp1 = rp1.85 + 2;
  D.4521 = *rp1.85;
  *rp2.84 = D.4521;
  <D.4129>:
  if (rp1 < rend) goto <D.4128>; else goto <D.4130>;
  <D.4130>:
  last_reduction.86 = last_reduction;
  if (last_reduction.86 != 0B) goto <D.4523>; else goto <D.4524>;
  <D.4523>:
  last_reduction.86 = last_reduction;
  last_reduction.86->next = p;
  last_reduction = p;
  goto <D.4525>;
  <D.4524>:
  first_reduction = p;
  last_reduction = p;
  <D.4525>:
  <D.4508>:
}


set_derives ()
{
  int nsyms.87;
  long unsigned int D.4527;
  unsigned int D.4528;
  unsigned int D.4529;
  char * derives.88;
  int nvars.89;
  int nrules.90;
  int D.4533;
  long unsigned int D.4534;
  unsigned int D.4535;
  unsigned int D.4536;
  short int * * derives.91;
  long unsigned int D.4538;
  long unsigned int D.4539;
  short int * * D.4540;
  long unsigned int D.4541;
  long unsigned int D.4542;
  short int * D.4543;
  short int * rlhs.92;
  long unsigned int D.4545;
  long unsigned int D.4546;
  short int * D.4547;
  short int D.4548;
  int D.4549;
  short int D.4552;
  register int i;
  register int k;
  register int lhs;
  register short int * rules;

  nsyms.87 = nsyms;
  D.4527 = (long unsigned int) nsyms.87;
  D.4528 = (unsigned int) D.4527;
  D.4529 = D.4528 * 8;
  derives.88 = allocate (D.4529);
  derives = derives.88;
  nvars.89 = nvars;
  nrules.90 = nrules;
  D.4533 = nvars.89 + nrules.90;
  D.4534 = (long unsigned int) D.4533;
  D.4535 = (unsigned int) D.4534;
  D.4536 = D.4535 * 2;
  rules = allocate (D.4536);
  k = 0;
  lhs = start_symbol;
  goto <D.4141>;
  <D.4140>:
  derives.91 = derives;
  D.4538 = (long unsigned int) lhs;
  D.4539 = D.4538 * 8;
  D.4540 = derives.91 + D.4539;
  D.4541 = (long unsigned int) k;
  D.4542 = D.4541 * 2;
  D.4543 = rules + D.4542;
  *D.4540 = D.4543;
  i = 0;
  goto <D.4138>;
  <D.4137>:
  rlhs.92 = rlhs;
  D.4545 = (long unsigned int) i;
  D.4546 = D.4545 * 2;
  D.4547 = rlhs.92 + D.4546;
  D.4548 = *D.4547;
  D.4549 = (int) D.4548;
  if (D.4549 == lhs) goto <D.4550>; else goto <D.4551>;
  <D.4550>:
  D.4541 = (long unsigned int) k;
  D.4542 = D.4541 * 2;
  D.4543 = rules + D.4542;
  D.4552 = (short int) i;
  *D.4543 = D.4552;
  k = k + 1;
  <D.4551>:
  i = i + 1;
  <D.4138>:
  nrules.90 = nrules;
  if (i < nrules.90) goto <D.4137>; else goto <D.4139>;
  <D.4139>:
  D.4541 = (long unsigned int) k;
  D.4542 = D.4541 * 2;
  D.4543 = rules + D.4542;
  *D.4543 = -1;
  k = k + 1;
  lhs = lhs + 1;
  <D.4141>:
  nsyms.87 = nsyms;
  if (lhs < nsyms.87) goto <D.4140>; else goto <D.4142>;
  <D.4142>:
}


free_derives ()
{
  short int * * derives.93;
  int start_symbol.94;
  long unsigned int D.4555;
  long unsigned int D.4556;
  short int * * D.4557;
  short int * D.4558;

  derives.93 = derives;
  start_symbol.94 = start_symbol;
  D.4555 = (long unsigned int) start_symbol.94;
  D.4556 = D.4555 * 8;
  D.4557 = derives.93 + D.4556;
  D.4558 = *D.4557;
  free (D.4558);
  derives.93 = derives;
  free (derives.93);
}


set_nullable ()
{
  int nsyms.95;
  unsigned int nsyms.96;
  long unsigned int D.4561;
  void * nullable.97;
  char * nullable.98;
  sizetype D.4566;
  char * D.4567;
  sizetype D.4568;
  char * D.4569;
  char D.4570;
  short int * ritem.99;
  long unsigned int D.4574;
  long unsigned int D.4575;
  short int * D.4576;
  short int D.4577;
  short int * rlhs.100;
  int D.4581;
  long unsigned int D.4582;
  long unsigned int D.4583;
  short int * D.4584;
  short int D.4585;
  int nitems.101;
  register int i;
  register int j;
  register int empty;
  int done;
  extern int no_space ();

  nsyms.95 = nsyms;
  nsyms.96 = (unsigned int) nsyms.95;
  D.4561 = (long unsigned int) nsyms.96;
  nullable.97 = malloc (D.4561);
  nullable = nullable.97;
  nullable.98 = nullable;
  if (nullable.98 == 0B) goto <D.4564>; else goto <D.4565>;
  <D.4564>:
  no_space ();
  <D.4565>:
  i = 0;
  goto <D.4152>;
  <D.4151>:
  nullable.98 = nullable;
  D.4566 = (sizetype) i;
  D.4567 = nullable.98 + D.4566;
  *D.4567 = 0;
  i = i + 1;
  <D.4152>:
  nsyms.95 = nsyms;
  if (i < nsyms.95) goto <D.4151>; else goto <D.4153>;
  <D.4153>:
  done = 0;
  goto <D.4161>;
  <D.4160>:
  done = 1;
  i = 1;
  goto <D.4158>;
  <D.4157>:
  empty = 1;
  goto <D.4155>;
  <D.4154>:
  nullable.98 = nullable;
  D.4568 = (sizetype) j;
  D.4569 = nullable.98 + D.4568;
  D.4570 = *D.4569;
  if (D.4570 == 0) goto <D.4571>; else goto <D.4572>;
  <D.4571>:
  empty = 0;
  <D.4572>:
  i = i + 1;
  <D.4155>:
  ritem.99 = ritem;
  D.4574 = (long unsigned int) i;
  D.4575 = D.4574 * 2;
  D.4576 = ritem.99 + D.4575;
  D.4577 = *D.4576;
  j = (int) D.4577;
  if (j >= 0) goto <D.4154>; else goto <D.4156>;
  <D.4156>:
  if (empty != 0) goto <D.4578>; else goto <D.4579>;
  <D.4578>:
  rlhs.100 = rlhs;
  D.4581 = -j;
  D.4582 = (long unsigned int) D.4581;
  D.4583 = D.4582 * 2;
  D.4584 = rlhs.100 + D.4583;
  D.4585 = *D.4584;
  j = (int) D.4585;
  nullable.98 = nullable;
  D.4568 = (sizetype) j;
  D.4569 = nullable.98 + D.4568;
  D.4570 = *D.4569;
  if (D.4570 == 0) goto <D.4586>; else goto <D.4587>;
  <D.4586>:
  nullable.98 = nullable;
  D.4568 = (sizetype) j;
  D.4569 = nullable.98 + D.4568;
  *D.4569 = 1;
  done = 0;
  <D.4587>:
  <D.4579>:
  i = i + 1;
  <D.4158>:
  nitems.101 = nitems;
  if (i < nitems.101) goto <D.4157>; else goto <D.4159>;
  <D.4159>:
  <D.4161>:
  if (done == 0) goto <D.4160>; else goto <D.4162>;
  <D.4162>:
}


free_nullable ()
{
  char * nullable.102;

  nullable.102 = nullable;
  free (nullable.102);
}


lr0 ()
{
  set_derives ();
  set_nullable ();
  generate_states ();
}


