#include "chdecl.h"
void CH_codegen_cgremove(current, sched, cop)
#define ARGUMENTS 10
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb1;
    case 2: goto c2;
    case 3: goto cb7;
    case 4: goto c8;
    case 5: goto cb18;
    case 6: goto c19;
    case 7: goto cb20;
    case 8: goto c21;
    case 9: goto cb61;
    case 10: goto c62;
    case 11: goto cb69;
    case 12: goto c70;
    case 13: goto cb72;
    case 14: goto c73;
    case 15: goto c76;
    case 16: goto cb77;
    case 17: goto c79;
    case 18: goto c82;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb1:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c2:
/* reveal 3.0.3 , 14 */
  if (14 != REF(3)DOT(0)DOT(3).value.variant->info.variant_case)
     goto ch_case_error;
/* lookup_at 4 3.0.2 =(1) */
  if (1 >= (ch_t = REF(3)DOT(0)DOT(2).value.table)->size) goto ch_notfound;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(4).value,1);
  REF(4).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 5 4 */
  if((ch_returncode = (REF(4).tsdr->copy)(& ch_val, REF(4).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = datarepmap[REF(4).tsdr->number];
  current->ip = 3;
cb7:
/* call 3.2.4.4 5 6 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(5),
          arguments[2] = DEF(6),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c8:
/* move 7 6 */
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7) = REF(6);
  REF(6).tsdr = & dr_bottom;
/* new_record 8 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).value = ch_val; REF(8).tsdr = & dr_record;
/* enum_lit 8.0 , 62 */
  REF(8)DOT(0).value.enumeration = 62;
  REF(8)DOT(0).tsdr = & dr_enumeration;
/* new_table 8.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(8)DOT(1),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 9 7 */
  if((ch_returncode = (REF(7).tsdr->copy)(& ch_val, REF(7).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = datarepmap[REF(7).tsdr->number];
/* insert 8.1 9 */
  if ((ch_returncode = insertfunc(DEF(8)DOT(1),DEF(9),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* unite 8.2 10 , 0 */
  if ((ch_returncode = che_unite(DEF(8)DOT(2),DEF(10),sched,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 8 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(8)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
  current->ip = 5;
cb18:
/* call 3.2.4.6 5 11 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(6),
          arguments[1] = DEF(5),
          arguments[2] = DEF(11),
          arguments[2+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c19:
/* enum_lit 12 , 2 */
  REF(12).value.enumeration = 2;
  REF(12).tsdr = & dr_enumeration;
  current->ip = 7;
cb20:
/* call 3.2.3.10 3.0.3.0 3.2 11 12 13 7 14 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(10),
          arguments[1] = DEF(3)DOT(0)DOT(3)DOT(0),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(11),
          arguments[4] = DEF(12),
          arguments[5] = DEF(13),
          arguments[6] = DEF(7),
          arguments[7] = DEF(14),
          arguments[7+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c21:
/* noop */
  
/* new_record 15 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).value = ch_val; REF(15).tsdr = & dr_record;
/* case 16 13 */
  REF(16).value.enumeration = REF(13).value.variant->info.variant_case;
  REF(16).tsdr = & dr_enumeration;
/* equal . 16 =(3) , 34 */
  if ( REF(16).value.enumeration == 3 ) goto c34;
/* equal . 16 =(2) , 38 */
  if ( REF(16).value.enumeration == 2 ) goto c38;
/* equal . 16 =(1) , 44 */
  if ( REF(16).value.enumeration == 1 ) goto c44;
/* equal . 16 =(0) , 50 */
  if ( REF(16).value.enumeration == 0 ) goto c50;
/* branch , 54 */
   goto c54;
c34:
/* enum_lit 15.0 , 68 */
  REF(15)DOT(0).value.enumeration = 68;
  REF(15)DOT(0).tsdr = & dr_enumeration;
/* unite 15.2 10 , 0 */
  if ((ch_returncode = che_unite(DEF(15)DOT(2),DEF(10),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 57 */
   goto c57;
c38:
/* reveal 13 , 2 */
  if (2 != REF(13).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 15.0 , 73 */
  REF(15)DOT(0).value.enumeration = 73;
  REF(15)DOT(0).tsdr = & dr_enumeration;
/* copy 17 13.0.0 */
  if((ch_returncode = (REF(13)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(13)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).value = ch_val;
  REF(17).tsdr = datarepmap[REF(13)DOT(0)DOT(0).tsdr->number];
/* unite 15.2 17 , 2 */
  if ((ch_returncode = che_unite(DEF(15)DOT(2),DEF(17),sched,2)) != Normal)
     goto ch_raise_exception;
/* branch , 57 */
   goto c57;
c44:
/* reveal 13 , 1 */
  if (1 != REF(13).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 15.0 , 73 */
  REF(15)DOT(0).value.enumeration = 73;
  REF(15)DOT(0).tsdr = & dr_enumeration;
/* copy 18 13.0.0 */
  if((ch_returncode = (REF(13)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(13)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).value = ch_val;
  REF(18).tsdr = datarepmap[REF(13)DOT(0)DOT(0).tsdr->number];
/* unite 15.2 18 , 2 */
  if ((ch_returncode = che_unite(DEF(15)DOT(2),DEF(18),sched,2)) != Normal)
     goto ch_raise_exception;
/* branch , 57 */
   goto c57;
c50:
/* enum_lit 15.0 , 61 */
  REF(15)DOT(0).value.enumeration = 61;
  REF(15)DOT(0).tsdr = & dr_enumeration;
/* unite 15.2 10 , 0 */
  if ((ch_returncode = che_unite(DEF(15)DOT(2),DEF(10),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 57 */
   goto c57;
c54:
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c57:
/* new_table 15.1 , 2 */
  if ((ch_returncode = che_new_table(DEF(15)DOT(1),QUAL(2),sched)) != Normal) 
     goto ch_raise_exception;
/* lookup_at 19 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(19).value,0);
  REF(19).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 20 19 */
  if((ch_returncode = (REF(19).tsdr->copy)(& ch_val, REF(19).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  REF(20).value = ch_val;
  REF(20).tsdr = datarepmap[REF(19).tsdr->number];
  current->ip = 9;
cb61:
/* call 3.2.4.4 20 21 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(20),
          arguments[2] = DEF(21),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c62:
/* insert 15.1 21 */
  if ((ch_returncode = insertfunc(DEF(15)DOT(1),DEF(21),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* case 22 13 */
  REF(22).value.enumeration = REF(13).value.variant->info.variant_case;
  REF(22).tsdr = & dr_enumeration;
/* notequal . 22 =(3) , 72 */
  if ( REF(22).value.enumeration != 3 ) goto c72;
/* reveal 13 , 3 */
  if (3 != REF(13).value.variant->info.variant_case) goto ch_case_error;
/* insert 15.1 7 */
  if ((ch_returncode = insertfunc(DEF(15)DOT(1),DEF(7),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 11;
cb69:
/* call 3.2.4.4 13.0.1 23 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(13)DOT(0)DOT(1),
          arguments[2] = DEF(23),
          arguments[2+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c70:
/* insert 15.1 23 */
  if ((ch_returncode = insertfunc(DEF(15)DOT(1),DEF(23),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* branch , 76 */
   goto c76;
c72:
  current->ip = 13;
cb72:
/* call 3.2.4.5 3.0.3.0.1 3.0.3.0.0 24 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(5),
          arguments[1] = DEF(3)DOT(0)DOT(3)DOT(0)DOT(1),
          arguments[2] = DEF(3)DOT(0)DOT(3)DOT(0)DOT(0),
          arguments[3] = DEF(24),
          arguments[3+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c73:
/* insert 15.1 24 */
  if ((ch_returncode = insertfunc(DEF(15)DOT(1),DEF(24),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 15.1 7 */
  if ((ch_returncode = insertfunc(DEF(15)DOT(1),DEF(7),FALSE,0)) != Normal)
     goto ch_raise_exception;
c76:
/* insert 3.2.4.3.1 15 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(15)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
  current->ip = 16;
cb77:
/* call 14 3.2 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(14),
          arguments[1] = DEF(3)DOT(2),
          arguments[1+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c79:
/* return 3 */
  if (ch_caller = do_return(REF(3).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(3).value);
  REF(3).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c82:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
