#include "chdecl.h"
void CH_type_variantcomponent(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 c16;
    case 4: goto c24;
    case 5: goto cb35;
    case 6: goto c36;
    case 7: goto c42;
    case 8: goto c47;
    case 9: goto c50;
    case 10: goto c53;  }
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:
/* size 4 3.0.1 */
  REF(4).value.integer = REF(3)DOT(0)DOT(1).value.table->size;
  REF(4).tsdr = & dr_integer;
/* notequal . 4 =(0) , 9 */
  if ( REF(4).value.integer != 0 ) goto c9;
/* exit , 2 */
  ch_e = handler_type__exit; ch_val = QUAL(2); goto ch_exception;
c9:
/* find 5 3.1 3.0.0.0 , 0 */
  if (findfunc(DEF(5),DEF(3)DOT(1),(
          arguments[0] = DEF(3)DOT(0)DOT(0)DOT(0),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* find 6 5.1 3.0.0.1 , 0 */
  if (findfunc(DEF(6),DEF(5)DOT(1),(
          arguments[0] = DEF(3)DOT(0)DOT(0)DOT(1),& arguments[0]),sched,0
            ) == FAILURE) goto ch_notfound;
/* copy 7 6.1 */
  if((ch_returncode = cp_variant(& ch_val, REF(6)DOT(1).value)) != Normal)
     goto ch_raise_exception;
  (*(REF(7).tsdr)->finalize)(REF(7).value,F_DISCARD,sched);
  REF(7).value = ch_val;
  REF(7).tsdr = & dr_variant;
/* reveal 7 , 0 */
  if (0 != REF(7).value.variant->info.variant_case) goto ch_case_error;
/* dissolve 8 7 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8) = REF(7).value.variant->data[VARIANT_COMPONENT];
  { freedotmain(REF(7).value.variant, VARIANT_SIZE); }
  REF(7).tsdr = & dr_bottom;
/* ilit 9 , 0 */
  REF(9).value.integer = 0;
  REF(9).tsdr = & dr_integer;
c16:
/* size 10 3.0.1 */
  REF(10).value.integer = REF(3)DOT(0)DOT(1).value.table->size;
  REF(10).tsdr = & dr_integer;
/* isubtract 11 10 =(1) */
  if (!chf_isubtract(DEF(11),REF(10).value.integer,1)) goto ch_depletion;
/* ige . 9 11 , 35 */
  if ( REF(9).value.integer >= REF(11).value.integer ) goto c35;
/* find 12 3.2 8.0 , 0 */
  if (findfunc(DEF(12),DEF(3)DOT(2),(
          arguments[0] = DEF(8)DOT(0),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* find 13 12.1 8.1 , 0 */
  if (findfunc(DEF(13),DEF(12)DOT(1),(
          arguments[0] = DEF(8)DOT(1),& arguments[0]),sched,0) == FAILURE)
             goto ch_notfound;
/* initget 14 13.1 , 0,0 */
  (*(REF(14).tsdr)->finalize)(REF(14).value,F_DISCARD,sched);
  if ((ch_returncode = init_selector(DEF(14),DEF(13)DOT(1),nil,sched,GET,0,0
    )) != Normal) goto ch_raise_exception;
c24:
/* get_or_err 14 13.1 */
  if ((ch_returncode = get_selected_object(DEF(14),DEF(13)DOT(1)
    ,sched)) != Normal) goto ch_raise_exception;
/* lookup_at 15 3.0.1 9 */
  if((ch_i = REF(9).value.integer) < 0 || ch_i >= (ch_t = 
    REF(3)DOT(0)DOT(1).value.table)->size) goto ch_notfound;
  (*(REF(15).tsdr)->finalize)(REF(15).value,F_DISCARD,sched);
  (*(ch_t->tbls[ORDER_TBL].des->lookup_at))
    (ch_t, ORDER_TBL, & REF(15).value,ch_i);
  REF(15).tsdr = qdatarepmap[ch_t->tsdr->number];
/* copy 16 15 */
  if((ch_returncode = (REF(15).tsdr->copy)(& ch_val, REF(15).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(16).tsdr)->finalize)(REF(16).value,F_DISCARD,sched);
  REF(16).value = ch_val;
  REF(16).tsdr = datarepmap[REF(15).tsdr->number];
/* notequal . 14.0 16 , 24 */
  if ( !(REF(14)DOT(0).tsdr->equal)(REF(14)DOT(0).value,REF(16).value) )
     goto c24;
/* copy 8 14.1 */
  if((ch_returncode = (REF(14)DOT(1).tsdr->copy)(& ch_val, REF(14)DOT(1).value
    )) != Normal) goto ch_raise_exception;
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).value = ch_val;
  REF(8).tsdr = datarepmap[REF(14)DOT(1).tsdr->number];
/* endget 14 13.1 */
  end_selector(DEF(14),DEF(13)DOT(1),sched,GET);
/* iadd 9 9 =(1) */
  if (!chf_iadd(DEF(9),REF(9).value.integer,1)) goto ch_depletion;
/* branch , 16 */
   goto c16;
c35:
  current->ip = 5;
cb35:
/* call 3.3 8 3.2 17 , 3 */
  if ((ch_returncode = che_call((
          arguments[0] = DEF(3)DOT(3),
          arguments[1] = DEF(8),
          arguments[2] = DEF(3)DOT(2),
          arguments[3] = DEF(17),
          arguments[3+1] = nil,& arguments[0]),QUAL(3),sched)) != Normal)
     goto ch_raise_exception;
  return;
c36:
/* branch_false 17 , 39 */
  if ( !REF(17).value.boolean ) goto c39;
/* exit , 4 */
  ch_e = handler_type__exit; ch_val = QUAL(4); goto ch_exception;
c39:
/* exit , 2 */
  ch_e = handler_type__exit; ch_val = QUAL(2); goto ch_exception;
/* endblock */
  che_endblock(sched);
/* branch , 50 */
   goto c50;
c42:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* boolean 3.4 , FALSE */
  REF(3)DOT(4).value.boolean = FALSE;
  REF(3)DOT(4).tsdr = & dr_boolean;
/* 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;
/* branch , 50 */
   goto c50;
c47:
/* boolean 3.4 , TRUE */
  REF(3)DOT(4).value.boolean = TRUE;
  REF(3)DOT(4).tsdr = & dr_boolean;
/* 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;
c50:
/* discard 8 */
  (*(REF(8).tsdr)->finalize)(REF(8).value,F_DISCARD,sched);
  REF(8).tsdr = & dr_bottom;
/* endblock */
  che_endblock(sched);
c53:
/* endprocess */
  che_endprocess(sched); return;
#include "chtail.h"
