#include "chdecl.h"
void CH_type_messagetypeof(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 c34;
    case 4: goto c36;  }
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:
/* find 4 3.1 3.0.0 , 0 */
  if (findfunc(DEF(4),DEF(3)DOT(1),(
          arguments[0] = DEF(3)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* find 5 4.1 3.0.1 , 0 */
  if (findfunc(DEF(5),DEF(4)DOT(1),(
          arguments[0] = DEF(3)DOT(0)DOT(1),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* ord_case 6 5.2 */
  REF(6).value.ord_enum = REF(5)DOT(2).value.variant->info.variant_case;
  REF(6).tsdr = & dr_ord_enumeration;
/* equal . 6 =(9) , 12 */
  if ( REF(6).value.ord_enum == 9 ) goto c12;
/* equal . 6 =(8) , 25 */
  if ( REF(6).value.ord_enum == 8 ) goto c25;
/* branch , 28 */
   goto c28;
c12:
/* reveal 5.2 , 9 */
  if (9 != REF(5)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* find 7 3.1 5.2.0.0 , 0 */
  if (findfunc(DEF(7),DEF(3)DOT(1),(
          arguments[0] = DEF(5)DOT(2)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* find 8 7.1 5.2.0.1 , 0 */
  if (findfunc(DEF(8),DEF(7)DOT(1),(
          arguments[0] = DEF(5)DOT(2)DOT(0)DOT(1),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* ord_case 9 8.2 */
  REF(9).value.ord_enum = REF(8)DOT(2).value.variant->info.variant_case;
  REF(9).tsdr = & dr_ord_enumeration;
/* equal . 9 =(8) , 22 */
  if ( REF(9).value.ord_enum == 8 ) goto c22;
/* return_exception 3 , 2 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(2),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(2));
  REF(3).tsdr = & dr_bottom;
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c22:
/* reveal 8.2 , 8 */
  if (8 != REF(8)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* copy 3.2 8.2.0.0 */
  if((ch_returncode = (REF(8)DOT(2)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(8)DOT(2)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(3)DOT(2).tsdr)->finalize)(REF(3)DOT(2).value,F_DISCARD,sched);
  REF(3)DOT(2).value = ch_val;
  REF(3)DOT(2).tsdr = datarepmap[REF(8)DOT(2)DOT(0)DOT(0).tsdr->number];
/* branch , 31 */
   goto c31;
c25:
/* reveal 5.2 , 8 */
  if (8 != REF(5)DOT(2).value.variant->info.variant_case) goto ch_case_error;
/* copy 3.2 5.2.0.0 */
  if((ch_returncode = (REF(5)DOT(2)DOT(0)DOT(0).tsdr->copy)(& ch_val, 
    REF(5)DOT(2)DOT(0)DOT(0).value)) != Normal) goto ch_raise_exception;
  (*(REF(3)DOT(2).tsdr)->finalize)(REF(3)DOT(2).value,F_DISCARD,sched);
  REF(3)DOT(2).value = ch_val;
  REF(3)DOT(2).tsdr = datarepmap[REF(5)DOT(2)DOT(0)DOT(0).tsdr->number];
/* branch , 31 */
   goto c31;
c28:
/* return_exception 3 , 2 */
  if (ch_caller = do_return(REF(3).value)) {
    raise_user(QUAL(2),ch_caller); 
    sched->wakeup_proc(sched,ch_caller);}
  else rem_return_exception(DEF(3),QUAL(2));
  REF(3).tsdr = & dr_bottom;
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c31:
/* 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);
c34:
/* endblock */
  che_endblock(sched);
c36:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
