#include "chdecl.h"
void CH_codegen_cgnamedlit(current, sched, cop)
#define ARGUMENTS 5
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto cb7;
    case 4: goto c8;
    case 5: goto c9;
    case 6: goto cb43;
    case 7: goto c44;
    case 8: goto c50;
    case 9: goto c53;
    case 10: goto c57;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* block , 1 */
  if((ch_returncode = che_block(QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 1;
cb2:
/* receive 3 0 */
  if ((ch_returncode = che_receive(DEF(3),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c3:
/* reveal 3.0.3 , 10 */
  if (10 != REF(3)DOT(0)DOT(3).value.variant->info.variant_case)
     goto ch_case_error;
/* lookup_at 4 3.0.2 =(0) */
  if ( !((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,0);
  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.6 5 6 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(6),
          arguments[1] = DEF(5),
          arguments[2] = DEF(6),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c8:
/* call 3.2.3.16 6 7 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(16),
          arguments[1] = DEF(6),
          arguments[2] = DEF(7),
          arguments[2+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c9:
/* noop */
  
/* ord_case 8 7.2 */
  REF(8).value.ord_enum = REF(7)DOT(2).value.variant->info.variant_case;
  REF(8).tsdr = & dr_ord_enumeration;
/* equal . 8 =(3) , 17 */
  if ( REF(8).value.ord_enum == 3 ) goto c17;
/* equal . 8 =(2) , 30 */
  if ( REF(8).value.ord_enum == 2 ) goto c30;
/* branch , 37 */
   goto c37;
c17:
/* reveal 7.2 , 3 */
  if (3 != REF(7)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* new_record 9 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val; REF(9).tsdr = & dr_record;
/* branch_false 7.2.0.0 , 23 */
  if ( !REF(7)DOT(2)DOT(0)DOT(0).value.boolean ) goto c23;
/* enum_lit 9.0 , 37 */
  REF(9)DOT(0).value.enumeration = 37;
  REF(9)DOT(0).tsdr = & dr_enumeration;
/* branch , 25 */
   goto c25;
c23:
/* enum_lit 9.0 , 36 */
  REF(9)DOT(0).value.enumeration = 36;
  REF(9)DOT(0).tsdr = & dr_enumeration;
c25:
/* new_table 9.1 , 4 */
  if ((ch_returncode = che_new_table(DEF(9)DOT(1),QUAL(4),sched)) != Normal) 
     goto ch_raise_exception;
/* find 10 7.2.0.1 3.0.3.0 , 0 */
  if (findfunc(DEF(10),DEF(7)DOT(2)DOT(0)DOT(1),(
          arguments[0] = DEF(3)DOT(0)DOT(3)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* scan_position 11 10 7.2.0.1 */
  ch_t = REF(7)DOT(2)DOT(0)DOT(1).value.table;
  (*(ch_t->tbls[ORDER_TBL].des->foreach))
    (ch_t,ORDER_TBL,do_table_position,& ch_ctr,CONT_FOREACH,REF(10).value);
  REF(11).value.integer = (dfd_integer) ch_ctr;
  REF(11).tsdr = & dr_integer;
/* unite 9.2 11 , 2 */
  if ((ch_returncode = che_unite(DEF(9)DOT(2),DEF(11),sched,2)) != Normal)
     goto ch_raise_exception;
/* branch , 40 */
   goto c40;
c30:
/* reveal 7.2 , 2 */
  if (2 != REF(7)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* notequal . 3.0.3.0 7.2.0.0 , 35 */
  if ( !(REF(3)DOT(0)DOT(3)DOT(0).tsdr->equal)(REF(3)DOT(0)DOT(3)DOT(0).value,
    REF(7)DOT(2)DOT(0)DOT(0).value) ) goto c35;
/* copy 9 3.2.5.1 */
  if((ch_returncode = cp_record(& ch_val, REF(3)DOT(2)DOT(5)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = & dr_record;
/* branch , 40 */
   goto c40;
c35:
/* copy 9 3.2.5.0 */
  if((ch_returncode = cp_record(& ch_val, REF(3)DOT(2)DOT(5)DOT(0).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val;
  REF(9).tsdr = & dr_record;
/* branch , 40 */
   goto c40;
c37:
/* exit , 5 */
  ch_e = handler_type__exit; ch_val = QUAL(5); goto ch_exception;
c40:
/* noop */
  
/* lookup_at 12 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(12).value,0);
  REF(12).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 13 12 */
  if((ch_returncode = (REF(12).tsdr->copy)(& ch_val, REF(12).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).value = ch_val;
  REF(13).tsdr = datarepmap[REF(12).tsdr->number];
  current->ip = 6;
cb43:
/* call 3.2.4.4 13 14 , 6 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(13),
          arguments[2] = DEF(14),
          arguments[2+1] = nil,& arguments[0]),QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c44:
/* insert 9.1 14 */
  if ((ch_returncode = insertfunc(DEF(9)DOT(1),DEF(14),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 9 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(9)
    ,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);
/* branch , 53 */
   goto c53;
c50:
/* chs_lit 15 , "CantHappen exit taken in cgnamedlit" */
  if( !chs_lit(DEF(15),"CantHappen exit taken in cgnamedlit") )
     goto ch_depletion;
/* print 15 */
  re_print(stderr, 0, DEF(15)); fflush(stderr);
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
c53:
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* discard 13 */
  (*(REF(13).tsdr)->finalize)(REF(13).value,F_DISCARD,sched);
  REF(13).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c57:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
