#include "chdecl.h"
void CH_codegen_cgcase(current, sched, cop)
#define ARGUMENTS 5
#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 cb12;
    case 6: goto c13;
    case 7: goto cb17;
    case 8: goto c18;
    case 9: goto c19;
    case 10: goto cb21;
    case 11: goto c22;
    case 12: goto c36;  }
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:
/* new_record 4 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4).value = ch_val; REF(4).tsdr = & dr_record;
/* new_table 4.1 , 1 */
  if ((ch_returncode = che_new_table(DEF(4)DOT(1),QUAL(1),sched)) != Normal) 
     goto ch_raise_exception;
/* lookup_at 5 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(5).value,0);
  REF(5).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 6 5 */
  if((ch_returncode = (REF(5).tsdr->copy)(& ch_val, REF(5).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val;
  REF(6).tsdr = datarepmap[REF(5).tsdr->number];
  current->ip = 3;
cb7:
/* call 3.2.4.4 6 7 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(6),
          arguments[2] = DEF(7),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c8:
/* insert 4.1 7 */
  if ((ch_returncode = insertfunc(DEF(4)DOT(1),DEF(7),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* lookup_at 8 3.0.2 =(1) */
  if (1 >= (ch_t = REF(3)DOT(0)DOT(2).value.table)->size) goto ch_notfound;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(8).value,1);
  REF(8).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 9 8 */
  if((ch_returncode = (REF(8).tsdr->copy)(& ch_val, REF(8).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(8).tsdr->number];
  current->ip = 5;
cb12:
/* call 3.2.4.4 9 10 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(9),
          arguments[2] = DEF(10),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c13:
/* insert 4.1 10 */
  if ((ch_returncode = insertfunc(DEF(4)DOT(1),DEF(10),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* lookup_at 11 3.0.2 =(1) */
  if (1 >= (ch_t = REF(3)DOT(0)DOT(2).value.table)->size) goto ch_notfound;
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(11).value,1);
  REF(11).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 12 11 */
  if((ch_returncode = (REF(11).tsdr->copy)(& ch_val, REF(11).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val;
  REF(12).tsdr = datarepmap[REF(11).tsdr->number];
  current->ip = 7;
cb17:
/* call 3.2.4.6 12 13 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(6),
          arguments[1] = DEF(12),
          arguments[2] = DEF(13),
          arguments[2+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c18:
/* call 3.2.3.16 13 14 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(16),
          arguments[1] = DEF(13),
          arguments[2] = DEF(14),
          arguments[2+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c19:
/* move 15 14 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15) = REF(14);
  REF(14).tsdr = & dr_bottom;
/* reveal 15.2 , 6 */
  if (6 != REF(15)DOT(2).value.variant->info.variant_case) goto ch_case_error;
  current->ip = 10;
cb21:
/* call 3.2.3.16 15.2.0.0 16 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(16),
          arguments[1] = DEF(15)DOT(2)DOT(0)DOT(0),
          arguments[2] = DEF(16),
          arguments[2+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c22:
/* move 15 16 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15) = REF(16);
  REF(16).tsdr = & dr_bottom;
/* reveal 15.2 , 3 */
  if (3 != REF(15)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* branch_false 15.2.0.0 , 28 */
  if ( !REF(15)DOT(2)DOT(0)DOT(0).value.boolean ) goto c28;
/* enum_lit 4.0 , 52 */
  REF(4)DOT(0).value.enumeration = 52;
  REF(4)DOT(0).tsdr = & dr_enumeration;
/* branch , 30 */
   goto c30;
c28:
/* enum_lit 4.0 , 51 */
  REF(4)DOT(0).value.enumeration = 51;
  REF(4)DOT(0).tsdr = & dr_enumeration;
c30:
/* unite 4.2 17 , 0 */
  if ((ch_returncode = che_unite(DEF(4)DOT(2),DEF(17),sched,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 4 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(4)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* 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);
c36:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
