#include "chdecl.h"
void CH_codegen_cgconvert(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto cb6;
    case 4: goto c7;
    case 5: goto c8;
    case 6: goto cb12;
    case 7: goto c13;
    case 8: goto c14;
    case 9: goto cb66;
    case 10: goto c67;
    case 11: goto cb77;
    case 12: goto c78;
    case 13: goto cb90;
    case 14: goto c91;
    case 15: goto c98;
    case 16: goto c102;
    case 17: goto c104;
    case 18: goto c131;
    case 19: goto c133;
    case 20: goto cb137;
    case 21: goto c138;
    case 22: goto cb142;
    case 23: goto c143;
    case 24: goto c148;
    case 25: goto c152;
    case 26: goto c154;
    case 27: goto c161;  }
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:
/* noop */
  
/* 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;
cb6:
/* 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;
c7:
/* 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;
c8:
/* noop */
  
/* lookup_at 8 3.0.2 =(0) */
  if ( !((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,0);
  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 = 6;
cb12:
/* call 3.2.4.6 9 10 , 2 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(6),
          arguments[1] = DEF(9),
          arguments[2] = DEF(10),
          arguments[2+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  return;
c13:
/* call 3.2.3.16 10 11 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(3)DOT(16),
          arguments[1] = DEF(10),
          arguments[2] = DEF(11),
          arguments[2+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c14:
/* noop */
  
/* new_record 12 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val; REF(12).tsdr = & dr_record;
/* ord_case 13 7.2 */
  REF(13).value.ord_enum = REF(7)DOT(2).value.variant->info.variant_case;
  REF(13).tsdr = & dr_ord_enumeration;
/* equal . 13 =(4) , 25 */
  if ( REF(13).value.ord_enum == 4 ) goto c25;
/* equal . 13 =(3) , 52 */
  if ( REF(13).value.ord_enum == 3 ) goto c52;
/* equal . 13 =(1) , 104 */
  if ( REF(13).value.ord_enum == 1 ) goto c104;
/* branch , 131 */
   goto c131;
c25:
/* ord_case 14 11.2 */
  REF(14).value.ord_enum = REF(11)DOT(2).value.variant->info.variant_case;
  REF(14).tsdr = & dr_ord_enumeration;
/* equal . 14 =(4) , 34 */
  if ( REF(14).value.ord_enum == 4 ) goto c34;
/* equal . 14 =(3) , 38 */
  if ( REF(14).value.ord_enum == 3 ) goto c38;
/* equal . 14 =(1) , 44 */
  if ( REF(14).value.ord_enum == 1 ) goto c44;
/* branch , 48 */
   goto c48;
c34:
/* enum_lit 12.0 , 1 */
  REF(12)DOT(0).value.enumeration = 1;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c38:
/* reveal 11.2 , 3 */
  if (3 != REF(11)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 12.0 , 35 */
  REF(12)DOT(0).value.enumeration = 35;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* size 16 11.2.0.1 */
  REF(16).value.integer = REF(11)DOT(2)DOT(0)DOT(1).value.table->size;
  REF(16).tsdr = & dr_integer;
/* unite 12.2 16 , 2 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(16),sched,2)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c44:
/* enum_lit 12.0 , 34 */
  REF(12)DOT(0).value.enumeration = 34;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c48:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c52:
/* ord_case 17 11.2 */
  REF(17).value.ord_enum = REF(11)DOT(2).value.variant->info.variant_case;
  REF(17).tsdr = & dr_ord_enumeration;
/* equal . 17 =(4) , 61 */
  if ( REF(17).value.ord_enum == 4 ) goto c61;
/* equal . 17 =(3) , 65 */
  if ( REF(17).value.ord_enum == 3 ) goto c65;
/* equal . 17 =(1) , 98 */
  if ( REF(17).value.ord_enum == 1 ) goto c98;
/* branch , 102 */
   goto c102;
c61:
/* enum_lit 12.0 , 43 */
  REF(12)DOT(0).value.enumeration = 43;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c65:
/* reveal 11.2 , 3 */
  if (3 != REF(11)DOT(2).value.variant->info.variant_case) goto ch_case_error;
  current->ip = 9;
cb66:
/* call 3.2.4.7 18 , 5 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(7),
          arguments[1] = DEF(18),
          arguments[1+1] = nil,& arguments[0]),QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  return;
c67:
/* noop */
  
/* enum_lit 12.0 , 42 */
  REF(12)DOT(0).value.enumeration = 42;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* new_table 12.1 , 6 */
  if ((ch_returncode = che_new_table(DEF(12)DOT(1),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 19 18 */
  if((ch_returncode = (REF(18).tsdr->copy)(& ch_val, REF(18).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(19).tsdr)->finalize)(REF(19).value,F_DISCARD,sched);
  REF(19).value = ch_val;
  REF(19).tsdr = datarepmap[REF(18).tsdr->number];
/* insert 12.1 19 */
  if ((ch_returncode = insertfunc(DEF(12)DOT(1),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* lookup_at 20 3.0.2 =(1) */
  if (1 >= (ch_t = REF(3)DOT(0)DOT(2).value.table)->size) goto ch_notfound;
  (*(REF(20).tsdr)->finalize)(REF(20).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(20).value,1);
  REF(20).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 21 20 */
  if((ch_returncode = (REF(20).tsdr->copy)(& ch_val, REF(20).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).value = ch_val;
  REF(21).tsdr = datarepmap[REF(20).tsdr->number];
  current->ip = 11;
cb77:
/* call 3.2.4.4 21 22 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(21),
          arguments[2] = DEF(22),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c78:
/* insert 12.1 22 */
  if ((ch_returncode = insertfunc(DEF(12)DOT(1),DEF(22),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 12 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(12)
    ,FALSE,0)) != Normal) goto ch_raise_exception;
/* new_record 12 , 3 */
  if ((ch_val.record = new_record(3)) == nil) goto ch_depletion;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val; REF(12).tsdr = & dr_record;
/* enum_lit 12.0 , 22 */
  REF(12)DOT(0).value.enumeration = 22;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* size 23 11.2.0.1 */
  REF(23).value.integer = REF(11)DOT(2)DOT(0)DOT(1).value.table->size;
  REF(23).tsdr = & dr_integer;
/* unite 12.2 23 , 2 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(23),sched,2)) != Normal)
     goto ch_raise_exception;
/* new_table 12.1 , 6 */
  if ((ch_returncode = che_new_table(DEF(12)DOT(1),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* lookup_at 24 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(24).tsdr)->finalize)(REF(24).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(24).value,0);
  REF(24).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 25 24 */
  if((ch_returncode = (REF(24).tsdr->copy)(& ch_val, REF(24).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).value = ch_val;
  REF(25).tsdr = datarepmap[REF(24).tsdr->number];
  current->ip = 13;
cb90:
/* call 3.2.4.4 25 26 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(25),
          arguments[2] = DEF(26),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c91:
/* insert 12.1 26 */
  if ((ch_returncode = insertfunc(DEF(12)DOT(1),DEF(26),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 12.1 18 */
  if ((ch_returncode = insertfunc(DEF(12)DOT(1),DEF(18),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 12 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(12)
    ,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;
/* exit , 8 */
  ch_e = handler_type__exit; ch_val = QUAL(8); goto ch_exception;
c98:
/* enum_lit 12.0 , 42 */
  REF(12)DOT(0).value.enumeration = 42;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c102:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c104:
/* ord_case 27 11.2 */
  REF(27).value.ord_enum = REF(11)DOT(2).value.variant->info.variant_case;
  REF(27).tsdr = & dr_ord_enumeration;
/* equal . 27 =(4) , 113 */
  if ( REF(27).value.ord_enum == 4 ) goto c113;
/* equal . 27 =(3) , 117 */
  if ( REF(27).value.ord_enum == 3 ) goto c117;
/* equal . 27 =(1) , 123 */
  if ( REF(27).value.ord_enum == 1 ) goto c123;
/* branch , 127 */
   goto c127;
c113:
/* enum_lit 12.0 , 23 */
  REF(12)DOT(0).value.enumeration = 23;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c117:
/* reveal 11.2 , 3 */
  if (3 != REF(11)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* enum_lit 12.0 , 22 */
  REF(12)DOT(0).value.enumeration = 22;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* size 28 11.2.0.1 */
  REF(28).value.integer = REF(11)DOT(2)DOT(0)DOT(1).value.table->size;
  REF(28).tsdr = & dr_integer;
/* unite 12.2 28 , 2 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(28),sched,2)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c123:
/* enum_lit 12.0 , 1 */
  REF(12)DOT(0).value.enumeration = 1;
  REF(12)DOT(0).tsdr = & dr_enumeration;
/* unite 12.2 15 , 0 */
  if ((ch_returncode = che_unite(DEF(12)DOT(2),DEF(15),sched,0)) != Normal)
     goto ch_raise_exception;
/* branch , 133 */
   goto c133;
c127:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c131:
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c133:
/* new_table 12.1 , 6 */
  if ((ch_returncode = che_new_table(DEF(12)DOT(1),QUAL(6),sched)) != Normal) 
     goto ch_raise_exception;
/* lookup_at 29 3.0.2 =(0) */
  if ( !((ch_t = REF(3)DOT(0)DOT(2).value.table)->size) ) goto ch_notfound;
  (*(REF(29).tsdr)->finalize)(REF(29).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(29).value,0);
  REF(29).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 30 29 */
  if((ch_returncode = (REF(29).tsdr->copy)(& ch_val, REF(29).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  REF(30).value = ch_val;
  REF(30).tsdr = datarepmap[REF(29).tsdr->number];
  current->ip = 20;
cb137:
/* call 3.2.4.4 30 31 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(30),
          arguments[2] = DEF(31),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c138:
/* insert 12.1 31 */
  if ((ch_returncode = insertfunc(DEF(12)DOT(1),DEF(31),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* lookup_at 32 3.0.2 =(1) */
  if (1 >= (ch_t = REF(3)DOT(0)DOT(2).value.table)->size) goto ch_notfound;
  (*(REF(32).tsdr)->finalize)(REF(32).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(32).value,1);
  REF(32).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 33 32 */
  if((ch_returncode = (REF(32).tsdr->copy)(& ch_val, REF(32).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  REF(33).value = ch_val;
  REF(33).tsdr = datarepmap[REF(32).tsdr->number];
  current->ip = 22;
cb142:
/* call 3.2.4.4 33 34 , 7 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(2)DOT(4)DOT(4),
          arguments[1] = DEF(33),
          arguments[2] = DEF(34),
          arguments[2+1] = nil,& arguments[0]),QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c143:
/* insert 12.1 34 */
  if ((ch_returncode = insertfunc(DEF(12)DOT(1),DEF(34),FALSE,0)) != Normal)
     goto ch_raise_exception;
/* insert 3.2.4.3.1 12 */
  if ((ch_returncode = insertfunc(DEF(3)DOT(2)DOT(4)DOT(3)DOT(1),DEF(12)
    ,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 , 154 */
   goto c154;
c148:
/* chs_lit 35 , "CantHappen exit taken in cgconvert" */
  if( !chs_lit(DEF(35),"CantHappen exit taken in cgconvert") )
     goto ch_depletion;
/* print 35 */
  re_print(stderr, 0, DEF(35)); fflush(stderr);
/* discard 35 */
  (*(REF(35).tsdr)->finalize)(REF(35).value,F_DISCARD,sched);
  REF(35).tsdr = & dr_bottom;
/* branch , 154 */
   goto c154;
c152:
/* discard 21 */
  (*(REF(21).tsdr)->finalize)(REF(21).value,F_DISCARD,sched);
  REF(21).tsdr = & dr_bottom;
/* discard 25 */
  (*(REF(25).tsdr)->finalize)(REF(25).value,F_DISCARD,sched);
  REF(25).tsdr = & dr_bottom;
c154:
/* discard 3 */
  (*(REF(3).tsdr)->finalize)(REF(3).value,F_DISCARD,sched);
  REF(3).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* discard 30 */
  (*(REF(30).tsdr)->finalize)(REF(30).value,F_DISCARD,sched);
  REF(30).tsdr = & dr_bottom;
/* discard 33 */
  (*(REF(33).tsdr)->finalize)(REF(33).value,F_DISCARD,sched);
  REF(33).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c161:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
