#include "chdecl.h"
void CH_window_writewin(current, sched, cop)
#define ARGUMENTS 10
#include "chhead.h"
select: switch (SELECTOR) {
    case 0: goto c0;
    case 1: goto cb2;
    case 2: goto c3;
    case 3: goto c15;
    case 4: goto cb15;
    case 6: goto cb17;
    case 7: goto c18;
    case 8: goto cb20;
    case 9: goto c21;
    case 10: goto cb24;
    case 11: goto c25;
    case 12: goto c31;
    case 13: goto cb32;
    case 14: goto c33;
    case 15: goto c34;
    case 16: goto c40;
    case 17: goto c43;
    case 18: goto c46;
    case 19: goto cb48;
    case 20: goto c49;
    case 21: goto c51;
    case 22: goto c52;
    case 23: goto cb55;
    case 24: goto c56;
    case 25: goto c62;
    case 26: goto c64;
    case 5: goto c66;
    case 27: goto c66;
    case 28: goto c69;
    case 29: goto c72;
    case 30: goto c80;
    case 31: goto c82;  }
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:
/* move 4 3.0 */
  (*(REF(4).tsdr)->finalize)(REF(4).value,F_DISCARD,sched);
  REF(4) = REF(3)DOT(0);
  REF(3)DOT(0).tsdr = & dr_bottom;
/* move 5 3.1 */
  (*(REF(5).tsdr)->finalize)(REF(5).value,F_DISCARD,sched);
  REF(5) = REF(3)DOT(1);
  REF(3)DOT(1).tsdr = & dr_bottom;
/* move 6 3.2 */
  (*(REF(6).tsdr)->finalize)(REF(6).value,F_DISCARD,sched);
  REF(6) = REF(3)DOT(2);
  REF(3)DOT(2).tsdr = & dr_bottom;
/* new_inport 7 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val; REF(7).tsdr = & dr_inport;
/* connect 3.3 7 */
  if (REF(7).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(3).tsdr)->finalize)(REF(3)DOT(3).value,F_DISCARD,sched);
  REF(7).value.inport->refcount++;
  REF(3)DOT(3).value.outport = REF(7).value.inport;
  REF(3)DOT(3).tsdr = & dr_outport;
/* new_inport 8 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).value = ch_val; REF(8).tsdr = & dr_inport;
/* connect 3.4 8 */
  if (REF(8).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(4).tsdr)->finalize)(REF(3)DOT(4).value,F_DISCARD,sched);
  REF(8).value.inport->refcount++;
  REF(3)DOT(4).value.outport = REF(8).value.inport;
  REF(3)DOT(4).tsdr = & dr_outport;
/* new_inport 9 */
  if ((ch_val.inport = make_inport()) == nil) goto ch_depletion;
  (*(REF(9).tsdr)->finalize)(REF(9).value,F_DISCARD,sched);
  REF(9).value = ch_val; REF(9).tsdr = & dr_inport;
/* connect 3.5 9 */
  if (REF(9).value.inport->refcount == MAXCOUNTER) goto ch_depletion;
  (*(REF(3)DOT(5).tsdr)->finalize)(REF(3)DOT(5).value,F_DISCARD,sched);
  REF(9).value.inport->refcount++;
  REF(3)DOT(5).value.outport = REF(9).value.inport;
  REF(3)DOT(5).tsdr = & dr_outport;
/* 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;
c13:
/* noop */
  
c15:
  current->ip = 4;
cb15:
/* select 6 * 9 * 8 * 7 * , 2 */
  if ((ch_returncode = che_select((
          arguments[0] = DEF(6),
          arguments[1] = NO_OBJECT,
          arguments[2] = DEF(9),
          arguments[3] = NO_OBJECT,
          arguments[4] = DEF(8),
          arguments[5] = NO_OBJECT,
          arguments[6] = DEF(7),
          arguments[7] = NO_OBJECT,
          arguments[7+1] = nil,& arguments[0]),QUAL(2),sched)) != Normal)
     goto ch_raise_exception;
  if (current->ip == 4) return; else COMPUTE_TARGET;
c17:
  current->ip = 6;
cb17:
/* receive 10 6 */
  if ((ch_returncode = che_receive(DEF(10),DEF(6),sched)) != Normal)
     goto ch_raise_exception;
  return;
c18:
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c20:
  current->ip = 8;
cb20:
/* receive 11 9 */
  if ((ch_returncode = che_receive(DEF(11),DEF(9),sched)) != Normal)
     goto ch_raise_exception;
  return;
c21:
/* copy 12 11.0 */
  if((ch_returncode = cp_table(& ch_val, REF(11)DOT(0).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).value = ch_val;
  REF(12).tsdr = & dr_table;
/* ordenum_lit 13 , 10 */
  REF(13).value.ord_enum = 10;
  REF(13).tsdr = & dr_ord_enumeration;
/* insert 12 13 */
  if ((ch_returncode = insertfunc(DEF(12),DEF(13),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 10;
cb24:
/* call 4 12 14 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(12),
          arguments[2] = DEF(14),
          arguments[2+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c25:
/* branch_false 14 , 28 */
  if ( !REF(14).value.boolean ) goto c28;
/* return 11 */
  if (ch_caller = do_return(REF(11).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(11).value);
  REF(11).tsdr = & dr_bottom;
/* branch , 66 */
   goto c66;
c28:
/* discard 11 */
  (*(REF(11).tsdr)->finalize)(REF(11).value,F_DISCARD,sched);
  REF(11).tsdr = & dr_bottom;
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c31:
/* block , 5 */
  if((ch_returncode = che_block(QUAL(5),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 13;
cb32:
/* receive 15 8 */
  if ((ch_returncode = che_receive(DEF(15),DEF(8),sched)) != Normal)
     goto ch_raise_exception;
  return;
c33:
/* call 4 15.0 16 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(15)DOT(0),
          arguments[2] = DEF(16),
          arguments[2+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c34:
/* branch_false 16 , 37 */
  if ( !REF(16).value.boolean ) goto c37;
/* return 15 */
  if (ch_caller = do_return(REF(15).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(15).value);
  REF(15).tsdr = & dr_bottom;
/* branch , 38 */
   goto c38;
c37:
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c38:
/* endblock */
  che_endblock(sched);
/* branch , 66 */
   goto c66;
c40:
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c43:
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c46:
/* block , 6 */
  if((ch_returncode = che_block(QUAL(6),sched)) != Normal)
     goto ch_raise_exception;
/* block , 7 */
  if((ch_returncode = che_block(QUAL(7),sched)) != Normal)
     goto ch_raise_exception;
  current->ip = 19;
cb48:
/* receive 17 7 */
  if ((ch_returncode = che_receive(DEF(17),DEF(7),sched)) != Normal)
     goto ch_raise_exception;
  return;
c49:
/* endblock */
  che_endblock(sched);
/* branch , 52 */
   goto c52;
c51:
/* exit , 8 */
  ch_e = handler_type__exit; ch_val = QUAL(8); goto ch_exception;
c52:
/* new_table 18 , 9 */
  if ((ch_returncode = che_new_table(DEF(18),QUAL(9),sched)) != Normal) 
     goto ch_raise_exception;
/* copy 19 17.0 */
  if((ch_returncode = (REF(17)DOT(0).tsdr->copy)(& ch_val, REF(17)DOT(0).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(17)DOT(0).tsdr->number];
/* insert 18 19 */
  if ((ch_returncode = insertfunc(DEF(18),DEF(19),FALSE,0)) != Normal)
     goto ch_raise_exception;
  current->ip = 23;
cb55:
/* call 4 18 20 , 4 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(4),
          arguments[1] = DEF(18),
          arguments[2] = DEF(20),
          arguments[2+1] = nil,& arguments[0]),QUAL(4),sched)) != Normal)
     goto ch_raise_exception;
  return;
c56:
/* branch_false 20 , 59 */
  if ( !REF(20).value.boolean ) goto c59;
/* return 17 */
  if (ch_caller = do_return(REF(17).value)) {
    if (ch_caller->type < CProcess) ch_caller->ip++;
      sched->wakeup_proc(sched, ch_caller);}
  else rem_return(REF(17).value);
  REF(17).tsdr = & dr_bottom;
/* branch , 60 */
   goto c60;
c59:
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c60:
/* endblock */
  che_endblock(sched);
/* branch , 66 */
   goto c66;
c62:
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c64:
/* exit , 3 */
  ch_e = handler_type__exit; ch_val = QUAL(3); goto ch_exception;
c16:
c66:
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* branch , 13 */
   goto c13;
c69:
/* endblock */
  che_endblock(sched);
/* branch , 80 */
   goto c80;
c72:
/* discard 17 */
  (*(REF(17).tsdr)->finalize)(REF(17).value,F_DISCARD,sched);
  REF(17).tsdr = & dr_bottom;
/* discard 18 */
  (*(REF(18).tsdr)->finalize)(REF(18).value,F_DISCARD,sched);
  REF(18).tsdr = & dr_bottom;
/* discard 15 */
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  REF(15).tsdr = & dr_bottom;
/* discard 12 */
  (*(REF(12).tsdr)->finalize)(REF(12).value,F_DISCARD,sched);
  REF(12).tsdr = & dr_bottom;
/* block , 10 */
  if((ch_returncode = che_block(QUAL(10),sched)) != Normal)
     goto ch_raise_exception;
/* send 5 10 */
  if ((ch_returncode = che_send(DEF(5),DEF(10),sched)) != Normal)
     goto ch_raise_exception;
/* endblock */
  che_endblock(sched);
c80:
/* endblock */
  che_endblock(sched);
c82:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
