#include "chdecl.h"
void CH_chcode_chrtoa(current, sched, cop)
#define ARGUMENTS 6
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb3;
    case 2: goto c4;
    case 3: goto c10;
    case 4: goto cb10;
    case 5: goto c11;
    case 6: goto c12;
    case 7: goto c15;
    case 8: goto c32;
    case 9: goto c34;  }
c0:
/* block , 0 */
  if((ch_returncode = che_block(QUAL(0),sched)) != Normal)
     goto ch_raise_exception;
/* chs_lit 3 , "g" */
  if( !chs_lit(DEF(3),"g") ) goto ch_depletion;
  current->ip = 1;
cb3:
/* receive 4 0 */
  if ((ch_returncode = che_receive(DEF(4),DEF(0),sched)) != Normal)
     goto ch_raise_exception;
  return;
c4:
/* copy 5 4.0 */
  if((ch_returncode = cp_outport(& ch_val, REF(4)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5).value = ch_val;
  REF(5).tsdr = & dr_outport;
/* new_inport 6 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6).value = ch_val; REF(6).tsdr = & dr_inport;
/* connect 4.1 6 */
  if (REF(6).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(4)DOT(1).tsdr)->finalize)(REF(4)DOT(1).value,F_DISCARD,sched);
  REF(6).value.inport->refcount++;
  REF(4)DOT(1).value.outport = REF(6).value.inport;
  REF(4)DOT(1).tsdr = & dr_outport;
/* return 4 */
  if (ch_caller = do_return(REF(4).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(4).value);
  REF(4).tsdr = & dr_bottom;
c8:
/* noop */
  
c10:
  current->ip = 4;
cb10:
/* receive 7 6 */
  if ((ch_returncode = che_receive(DEF(7),DEF(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c11:
/* call 5 3 7.0 8 , 1 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(5),
          arguments[1] = DEF(3),
          arguments[2] = DEF(7)DOT(0),
          arguments[3] = DEF(8),
          arguments[3+1] = nil,& arguments[0]),QUAL(1),sched)) != Normal)
     goto ch_raise_exception;
  return;
c12:
/* move 7.1 8 */
  (*(REF(7)DOT(1).tsdr)->finalize)(REF(7)DOT(1).value,F_DISCARD,sched);
  REF(7)DOT(1) = REF(8);
  REF(8).tsdr = & dr_bottom;
/* boolean 9 , TRUE */
  REF(9).value.boolean = TRUE;
  REF(9).tsdr = & dr_boolean;
/* initget 10 7.1 , 0,0 */
  (*(REF(10).tsdr)->finalize)(REF(10).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(10),DEF(7)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c15:
/* get_or_goto 10 7.1 , 26 */
  if ((ch_returncode = get_selected_object(DEF(10),DEF(7)DOT(1)
    ,sched)) != Normal) goto c26;
/* oege 11 10 =(48) */
  REF(11).value.boolean = (REF(10).value.ord_enum >= 48);
/* oele 12 10 =(57) */
  REF(12).value.boolean = (REF(10).value.ord_enum <= 57);
/* and 13 11 12 */
  REF(13).value.boolean = REF(11).value.boolean&REF(12).value.boolean;
  REF(13).tsdr = & dr_boolean;
/* equal 14 10 =(45) */
  REF(14).value.boolean = (REF(10).value.ord_enum == 45);
  REF(14).tsdr = & dr_boolean;
/* or 15 13 14 */
  REF(15).value.boolean = REF(13).value.boolean|REF(14).value.boolean;
  REF(15).tsdr = & dr_boolean;
/* branch_true 15 , 15 */
  if ( REF(15).value.boolean ) goto c15;
/* boolean 9 , FALSE */
  REF(9).value.boolean = FALSE;
  REF(9).tsdr = & dr_boolean;
c26:
/* endget 10 7.1 */
  end_selector(DEF(10),DEF(7)DOT(1),sched,GET);
/* branch_false 9 , 30 */
  if ( !REF(9).value.boolean ) goto c30;
/* chs_lit 16 , ".0" */
  if( !chs_lit(DEF(16),".0") ) goto ch_depletion;
/* merge 7.1 16 */
  if ((ch_returncode = mergefunc(DEF(7)DOT(1),DEF(16),FALSE,0)) != Normal)
     goto ch_raise_exception;
c30:
/* return 7 */
  if (ch_caller = do_return(REF(7).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(7).value);
  REF(7).tsdr = & dr_bottom;
/* branch , 8 */
   goto c8;
c32:
/* endblock */
  che_endblock(sched);
c34:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
