
/* This file was automatically generated by pclu.*/

#include "pclu_err.h"
#include "pclu_sys.h"


/**** BEGIN CLUSTER istream ****/

extern errcode boolOPnot();
extern errcode stringOPequal();
extern errcode _chanOPopen();
extern errcode _wordvecOPcreate();
extern errcode oneofOPmake_2();
extern errcode oneofOPmake_3();
extern errcode _chanOPget_name();
extern errcode oneofOPis_2();
extern errcode recordOPget_1();
extern errcode oneofOPis_3();
extern errcode intOPgt();
extern errcode recordOPget_2();
extern errcode recordOPget_3();
extern errcode recordOPset_3();
extern errcode intOPdiv();
extern errcode _chanOPgetw();
extern errcode recordOPget_4();
extern errcode recordOPset_2();
extern errcode _chanOPreset();
extern errcode _chanOPputw();
extern errcode intOPmul();
extern errcode _chanOPget_date();
extern errcode _chanOPclose();
extern errcode recordOPset_1();
extern errcode oneofOPmake_1();
extern errcode _chanOPabort();
extern errcode oneofOPis_1();
extern errcode recordOPequal();
extern errcode _wordvecOPfetch();
extern errcode intOPadd();
extern errcode intOPequal();
extern errcode _wordvecOPstore();
extern errcode _cvt();
extern errcode _bytevecOPcreate();
extern errcode intOPsub();
extern errcode intOPlt();
extern errcode _wordvecOPmove_w2b();
extern errcode _bytevecOPsize();
extern errcode _wordvecOPmove_b2w();
extern errcode recordOPdebug_print();
extern OWN_req bool_ownreqs;
extern struct OPS *bool_ops;
extern struct OPS *_chan_ops;
extern struct OPS *int_ops;
extern struct OPS *_wordvec_ops;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
extern struct OPS *null_ops;
extern struct OPS *record_chan_idx_max_wvec_ops;
extern struct OPS *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
extern struct OPS *oneof_closed_read_write_ops;
extern struct OPS *file_name_ops;
struct OPS  *record_buf_name_ops;
CLUREF STR_read;
CLUREF STR_write;
CLUREF STR_append;
CLUREF STR_bad_040access_040mode;
CLUREF STR_cannot_040read_040from_040this_040istream;
CLUREF STR_cannot_040get_040date;
CLUREF STR_cannot_040set_040date;
CLUREF STR_no_040channel_040attached_040to_040istream;
CLUREF STR_bad_040format;
CLUREF STR_cannot_040write_040to_040this_040istream;
CLUREF STR_;
static int istream_own_init = 0;
OWN_req istream_ownreqs = {0,0};
errcode istream_own_init_proc()
{
struct {
    errcode err;
    } locals;
    enter_own_init_proc();
        if (istream_own_init == 0) {
        add_selector_info("chan", 0, _chan_ops); 
        add_selector_info("idx", 1, int_ops); 
        add_selector_info("max", 2, int_ops); 
        add_selector_info("wvec", 3, _wordvec_ops); 
        find_selector_ops("record", 4, &(record_chan_idx_max_wvec_ops));
        add_selector_info("chan", 0, _chan_ops); 
        add_selector_info("idx", 1, int_ops); 
        add_selector_info("wvec", 2, _wordvec_ops); 
        find_selector_ops("record", 3, &(record_chan_idx_wvec_ops));
        add_selector_info("closed", 0, null_ops); 
        add_selector_info("read", 1, record_chan_idx_max_wvec_ops); 
        add_selector_info("write", 2, record_chan_idx_wvec_ops); 
        find_selector_ops("oneof", 3, &(oneof_closed_read_write_ops));
        add_selector_info("buf", 0, oneof_closed_read_write_ops); 
        add_selector_info("name", 1, file_name_ops); 
        find_selector_ops("record", 2, &(record_buf_name_ops));
        stringOPcons("read", CLU_1, CLU_4, &STR_read);
        stringOPcons("write", CLU_1, CLU_5, &STR_write);
        stringOPcons("append", CLU_1, CLU_6, &STR_append);
        stringOPcons("bad access mode", CLU_1, CLU_15, &STR_bad_040access_040mode);
        stringOPcons("cannot read from this istream", CLU_1, CLU_29, &STR_cannot_040read_040from_040this_040istream);
        stringOPcons("cannot get date", CLU_1, CLU_15, &STR_cannot_040get_040date);
        stringOPcons("cannot set date", CLU_1, CLU_15, &STR_cannot_040set_040date);
        stringOPcons("no channel attached to istream", CLU_1, CLU_30, &STR_no_040channel_040attached_040to_040istream);
        stringOPcons("bad format", CLU_1, CLU_10, &STR_bad_040format);
        stringOPcons("cannot write to this istream", CLU_1, CLU_28, &STR_cannot_040write_040to_040this_040istream);
        stringOPcons("", CLU_1, CLU_0, &STR_);
        istream_own_init = 1;
        {signal(ERR_ok);}
    ex_0: pclu_unhandled(locals.err); {signal(ERR_failure);}
        }
    }

extern struct dbg_info* dbg_info_istreamOPopen;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPopen_TRACE
int istreamOPopen_TRACE;
static Vlist22 owns_istream = {0, 22,{ {0, 2, "istream_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
, {0, 2, "istreamOPopen_init", &int_ops}
}
};
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPopen_own_init = 0;

/**** BEGIN PROCEDURE open ****/

errcode istreamOPopen(f, access, ret_1)
CLUREF f;
CLUREF access;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ch;
        CLUREF wvec;
        CLUREF b;
        CLUREF f;
        CLUREF access;
        } locals;
    locals.ch.num = UNINIT;
    locals.wvec.num = UNINIT;
    locals.b.num = UNINIT;
    locals.f.num = UNINIT;
    locals.access.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPopen;
    locals.f = f;
    locals.access = access;
        if (istreamOPopen_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPopen_own_init = 1;
    }
    enter_proc(29);

  LINE(30);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    CLUREF T_1_4;
    CLUREF T_1_5;
    CLUREF T_1_6;
    CLUREF T_1_7;
    CLUREF T_1_8;
    locals.err = stringOPequal(locals.access, STR_read, &T_1_3);
    if (locals.err != ERR_ok) goto ex_0;
    T_1_4.num = T_1_3.num ^ 1;
    T_1_2.num = T_1_4.num;
    if (T_1_4.num) {
        locals.err = stringOPequal(locals.access, STR_write, &T_1_5);
        if (locals.err != ERR_ok) goto ex_0;
        T_1_6.num = T_1_5.num ^ 1;
        T_1_2.num = T_1_6.num;
    }
    T_1_1.num = T_1_2.num;
    if (T_1_2.num) {
        locals.err = stringOPequal(locals.access, STR_append, &T_1_7);
        if (locals.err != ERR_ok) goto ex_0;
        T_1_8.num = T_1_7.num ^ 1;
        T_1_1.num = T_1_8.num;
    }
    if (T_1_1.num == true) {

  LINE(31);
        {
        elist[0] = STR_bad_040access_040mode;
        {signal (ERR_not_possible);}}
        }
        }/* end if */

  LINE(32);
    {
        {CLUREF T_2_1;
        locals.err = _chanOPopen(locals.f, locals.access, CLU_0, &T_2_1);
        if (locals.err != ERR_ok) goto ex_1;
        locals.ch.num = T_2_1.num;
        }
        }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;

  LINE(34);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        T_1_1.num = 256;
        locals.err = _wordvecOPcreate(T_1_1, &T_1_2);
        if (locals.err != ERR_ok) goto ex_0;
        locals.wvec.num = T_1_2.num;
        }
        }

  LINE(35);
    locals.b.num = UNINIT;

  LINE(36);
    {
    CLUREF T_1_1;
    locals.err = stringOPequal(locals.access, STR_read, &T_1_1);
    if (locals.err != ERR_ok) goto ex_0;
    if (T_1_1.num == true) {

  LINE(37);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        RecordAlloc(4, T_2_1);
        T_2_1.vec->data[0]  = locals.ch.num;
        T_2_1.vec->data[3]  = locals.wvec.num;
        T_2_1.vec->data[1]  = 1;
        T_2_1.vec->data[2]  = 0;
        CellAlloc(2, T_2_1.num, T_2_2);
        locals.b.num = T_2_2.num;
        }
        }
    else {

  LINE(41);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        RecordAlloc(3, T_2_1);
        T_2_1.vec->data[0]  = locals.ch.num;
        T_2_1.vec->data[2]  = locals.wvec.num;
        T_2_1.vec->data[1]  = 0;
        CellAlloc(3, T_2_1.num, T_2_2);
        locals.b.num = T_2_2.num;
        }
        }}/* end if */

  LINE(45);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    RecordAlloc(2, T_1_1);
    T_1_1.vec->data[0]  = locals.b.num;
    locals.err = _chanOPget_name(locals.ch, &T_1_2);
    if (locals.err != ERR_ok) goto ex_0;
    T_1_1.vec->data[1]  = T_1_2.num;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE open ****/

extern struct OPS *record_buf_name_ops;
extern struct OPS *string_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist1 *sigs;
    Vlist7 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPopen_actual;
static Vlist1 vals_istreamOPopen = {0, 1, { {0, 2, "", &record_buf_name_ops}}
};
static sig_desc1 sig_istreamOPopen_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPopen = {0, 1, (sig_desc*)&sig_istreamOPopen_1};
static Vlist7 locals_istreamOPopen = {0, 7,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ch", &_chan_ops},  {0, 2, "wvec", &_wordvec_ops},  {0, 2, "b", &oneof_closed_read_write_ops},  {0, 2, "f", &file_name_ops},  {0, 2, "access", &string_ops}}
};
static Vlist0 popowns_istreamOPopen = {0, 0};
Slist0 tformals_istreamOPopen = {0, 0};
Slist0 opformals_istreamOPopen = {0, 0};
dbg_info_istreamOPopen_actual dbg_info_istreamOPopen_data = {0, 12, 
    "istreamOPopen", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPopen, 2, 
    &vals_istreamOPopen, &sigs_istreamOPopen, &locals_istreamOPopen, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPopen = (struct dbg_info*)&dbg_info_istreamOPopen_data;
extern struct dbg_info* dbg_info_istreamOPcan_read;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPcan_read_TRACE
int istreamOPcan_read_TRACE;
extern OWN_req null_ownreqs;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPcan_read_own_init = 0;

/**** BEGIN PROCEDURE can_read ****/

errcode istreamOPcan_read(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist;
        } locals;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPcan_read;
    locals.ist = ist;
        if (istreamOPcan_read_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPcan_read_own_init = 1;
    }
    enter_proc(49);

  LINE(50);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = locals.ist.vec->data[0];
    if (T_1_1.cell->tag == 2) T_1_2.num = true; else T_1_2.num = false;
    ret_1->num = T_1_2.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE can_read ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist3 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPcan_read_actual;
static Vlist1 vals_istreamOPcan_read = {0, 1, { {0, 2, "", &bool_ops}}
};
static siglist0 sigs_istreamOPcan_read = {0, 0};
static Vlist3 locals_istreamOPcan_read = {0, 3,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPcan_read = {0, 0};
Slist0 tformals_istreamOPcan_read = {0, 0};
Slist0 opformals_istreamOPcan_read = {0, 0};
dbg_info_istreamOPcan_read_actual dbg_info_istreamOPcan_read_data = {0, 12, 
    "istreamOPcan_read", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPcan_read, 1, 
    &vals_istreamOPcan_read, &sigs_istreamOPcan_read, &locals_istreamOPcan_read, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPcan_read = (struct dbg_info*)&dbg_info_istreamOPcan_read_data;
extern struct dbg_info* dbg_info_istreamOPcan_write;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPcan_write_TRACE
int istreamOPcan_write_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPcan_write_own_init = 0;

/**** BEGIN PROCEDURE can_write ****/

errcode istreamOPcan_write(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist;
        } locals;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPcan_write;
    locals.ist = ist;
        if (istreamOPcan_write_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPcan_write_own_init = 1;
    }
    enter_proc(53);

  LINE(54);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = locals.ist.vec->data[0];
    if (T_1_1.cell->tag == 3) T_1_2.num = true; else T_1_2.num = false;
    ret_1->num = T_1_2.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE can_write ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist3 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPcan_write_actual;
static Vlist1 vals_istreamOPcan_write = {0, 1, { {0, 2, "", &bool_ops}}
};
static siglist0 sigs_istreamOPcan_write = {0, 0};
static Vlist3 locals_istreamOPcan_write = {0, 3,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPcan_write = {0, 0};
Slist0 tformals_istreamOPcan_write = {0, 0};
Slist0 opformals_istreamOPcan_write = {0, 0};
dbg_info_istreamOPcan_write_actual dbg_info_istreamOPcan_write_data = {0, 12, 
    "istreamOPcan_write", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPcan_write, 1, 
    &vals_istreamOPcan_write, &sigs_istreamOPcan_write, &locals_istreamOPcan_write, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPcan_write = (struct dbg_info*)&dbg_info_istreamOPcan_write_data;
extern struct dbg_info* dbg_info_istreamOPempty;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPempty_TRACE
int istreamOPempty_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPempty_own_init = 0;

/**** BEGIN PROCEDURE empty ****/

errcode istreamOPempty(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPempty;
    locals.ist = ist;
        if (istreamOPempty_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPempty_own_init = 1;
    }
    enter_proc(57);

  LINE(58);
    {
    CLUREF T_3_1;
    T_3_1.num = locals.ist.vec->data[0];
    switch (T_3_1.cell->tag) {
    case 2: 
         {CLUREF T_3_2;
        T_3_2.num = T_3_1.cell->value;
        locals.rb.num = T_3_2.num;

  LINE(60);
            {
            CLUREF T_4_1;
            CLUREF T_4_2;
            CLUREF T_4_3;
            T_4_1.num = locals.rb.vec->data[1];
            T_4_2.num = locals.rb.vec->data[2];
            T_4_3.num = (T_4_1.num > T_4_2.num)? true : false;
            if (T_4_3.num == true) {

  LINE(61);
                {
                CLUREF T_5_1;
                CLUREF T_5_2;
                CLUREF T_5_3;
                CLUREF T_5_4;
                T_5_1.num = locals.rb.vec->data[0];
                T_5_2.num = locals.rb.vec->data[3];
                locals.err = _chanOPgetw(T_5_1, T_5_2, &T_5_3);
                if (locals.err != ERR_ok) goto ex_2;
                locals.err = intOPdiv(T_5_3, CLU_4, &T_5_4);
                if (locals.err != ERR_ok) goto ex_2;
                locals.rb.vec->data[2]  = T_5_4.num;
                }

  LINE(62);
                {
                locals.rb.vec->data[1]  = 1;
                }
                }
                }/* end if */

  LINE(64);
            {
            {
            ret_1->tf = false;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(66);
        {
        elist[0] = STR_cannot_040read_040from_040this_040istream;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_2;
    ex_2:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_1;}
    end_2:;
        goto end_1;
        ex_1:
            if ((locals.err == ERR_end_of_file)) {

  LINE(68);
                {
                {
                ret_1->tf = true;
                }
                {signal (ERR_ok);}}
            }
            else {
                goto ex_0;
            }
        end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE empty ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist1 *sigs;
    Vlist4 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPempty_actual;
static Vlist1 vals_istreamOPempty = {0, 1, { {0, 2, "", &bool_ops}}
};
static sig_desc1 sig_istreamOPempty_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPempty = {0, 1, (sig_desc*)&sig_istreamOPempty_1};
static Vlist4 locals_istreamOPempty = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPempty = {0, 0};
Slist0 tformals_istreamOPempty = {0, 0};
Slist0 opformals_istreamOPempty = {0, 0};
dbg_info_istreamOPempty_actual dbg_info_istreamOPempty_data = {0, 12, 
    "istreamOPempty", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPempty, 1, 
    &vals_istreamOPempty, &sigs_istreamOPempty, &locals_istreamOPempty, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPempty = (struct dbg_info*)&dbg_info_istreamOPempty_data;
extern struct dbg_info* dbg_info_istreamOPreset;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPreset_TRACE
int istreamOPreset_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPreset_own_init = 0;

/**** BEGIN PROCEDURE reset ****/

errcode istreamOPreset(ist)
CLUREF ist;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF wb;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPreset;
    locals.ist = ist;
        if (istreamOPreset_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPreset_own_init = 1;
    }
    enter_proc(71);

  LINE(72);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 2: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.rb.num = T_2_2.num;

  LINE(74);
            {
            CLUREF T_3_1;
            T_3_1.num = locals.rb.vec->data[0];
            locals.err = _chanOPreset(T_3_1);
            if (locals.err != ERR_ok) goto ex_1;
            }

  LINE(75);
            {
            locals.rb.vec->data[1]  = 1;
            }

  LINE(76);
            {
            locals.rb.vec->data[2]  = 0;
            }
            break;
            }
    case 3: 
         {CLUREF T_2_3;
        T_2_3.num = T_2_1.cell->value;
        locals.wb.num = T_2_3.num;

  LINE(78);
            {
            CLUREF T_3_1;
            T_3_1.num = locals.wb.vec->data[0];
            locals.err = _chanOPreset(T_3_1);
            if (locals.err != ERR_ok) goto ex_1;
            }

  LINE(79);
            {
            locals.wb.vec->data[1]  = 0;
            }
            break;
            }
    default: {
    }
    }
    }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE reset ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist1 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPreset_actual;
static Vlist0 vals_istreamOPreset = {0, 0};
static sig_desc1 sig_istreamOPreset_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPreset = {0, 1, (sig_desc*)&sig_istreamOPreset_1};
static Vlist5 locals_istreamOPreset = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPreset = {0, 0};
Slist0 tformals_istreamOPreset = {0, 0};
Slist0 opformals_istreamOPreset = {0, 0};
dbg_info_istreamOPreset_actual dbg_info_istreamOPreset_data = {0, 12, 
    "istreamOPreset", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPreset, 1, 
    &vals_istreamOPreset, &sigs_istreamOPreset, &locals_istreamOPreset, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPreset = (struct dbg_info*)&dbg_info_istreamOPreset_data;
extern struct dbg_info* dbg_info_istreamOPflush;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPflush_TRACE
int istreamOPflush_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPflush_own_init = 0;

/**** BEGIN PROCEDURE flush ****/

errcode istreamOPflush(ist)
CLUREF ist;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF wb;
        CLUREF ist;
        } locals;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPflush;
    locals.ist = ist;
        if (istreamOPflush_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPflush_own_init = 1;
    }
    enter_proc(84);

  LINE(85);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 3: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.wb.num = T_2_2.num;

  LINE(87);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            CLUREF T_3_3;
            CLUREF T_3_4;
            T_3_1.num = locals.wb.vec->data[0];
            T_3_2.num = locals.wb.vec->data[2];
            T_3_3.num = locals.wb.vec->data[1];
            locals.err = intOPmul(CLU_4, T_3_3, &T_3_4);
            if (locals.err != ERR_ok) goto ex_1;
            locals.err = _chanOPputw(T_3_1, T_3_2, CLU_1, T_3_4, CLU_0);
            if (locals.err != ERR_ok) goto ex_1;
            }

  LINE(88);
            {
            locals.wb.vec->data[1]  = 0;
            }
            break;
            }
    default: {
    }
    }
    }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE flush ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist1 *sigs;
    Vlist4 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPflush_actual;
static Vlist0 vals_istreamOPflush = {0, 0};
static sig_desc1 sig_istreamOPflush_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPflush = {0, 1, (sig_desc*)&sig_istreamOPflush_1};
static Vlist4 locals_istreamOPflush = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPflush = {0, 0};
Slist0 tformals_istreamOPflush = {0, 0};
Slist0 opformals_istreamOPflush = {0, 0};
dbg_info_istreamOPflush_actual dbg_info_istreamOPflush_data = {0, 12, 
    "istreamOPflush", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPflush, 1, 
    &vals_istreamOPflush, &sigs_istreamOPflush, &locals_istreamOPflush, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPflush = (struct dbg_info*)&dbg_info_istreamOPflush_data;
extern struct dbg_info* dbg_info_istreamOPget_date;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPget_date_TRACE
int istreamOPget_date_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPget_date_own_init = 0;

/**** BEGIN PROCEDURE get_date ****/

errcode istreamOPget_date(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF wb;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPget_date;
    locals.ist = ist;
        if (istreamOPget_date_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPget_date_own_init = 1;
    }
    enter_proc(93);

  LINE(94);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 2: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.rb.num = T_2_2.num;

  LINE(96);
            {
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            T_3_1.num = locals.rb.vec->data[0];
            locals.err = _chanOPget_date(T_3_1, &T_3_2);
            if (locals.err != ERR_ok) goto ex_1;
            ret_1->num = T_3_2.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    case 3: 
         {CLUREF T_2_3;
        T_2_3.num = T_2_1.cell->value;
        locals.wb.num = T_2_3.num;

  LINE(98);
            {
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            T_3_1.num = locals.wb.vec->data[0];
            locals.err = _chanOPget_date(T_3_1, &T_3_2);
            if (locals.err != ERR_ok) goto ex_1;
            ret_1->num = T_3_2.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(100);
        {
        elist[0] = STR_cannot_040get_040date;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE get_date ****/

extern struct OPS *date_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist1 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPget_date_actual;
static Vlist1 vals_istreamOPget_date = {0, 1, { {0, 2, "", &date_ops}}
};
static sig_desc1 sig_istreamOPget_date_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPget_date = {0, 1, (sig_desc*)&sig_istreamOPget_date_1};
static Vlist5 locals_istreamOPget_date = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPget_date = {0, 0};
Slist0 tformals_istreamOPget_date = {0, 0};
Slist0 opformals_istreamOPget_date = {0, 0};
dbg_info_istreamOPget_date_actual dbg_info_istreamOPget_date_data = {0, 12, 
    "istreamOPget_date", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPget_date, 1, 
    &vals_istreamOPget_date, &sigs_istreamOPget_date, &locals_istreamOPget_date, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPget_date = (struct dbg_info*)&dbg_info_istreamOPget_date_data;
extern struct dbg_info* dbg_info_istreamOPset_date;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPset_date_TRACE
int istreamOPset_date_TRACE;
static int istreamOPset_date_own_init = 0;

/**** BEGIN PROCEDURE set_date ****/

errcode istreamOPset_date(ist, new_date)
CLUREF ist;
CLUREF new_date;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist;
        CLUREF new_date;
        } locals;
    locals.ist.num = UNINIT;
    locals.new_date.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPset_date;
    locals.ist = ist;
    locals.new_date = new_date;
        if (istreamOPset_date_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPset_date_own_init = 1;
    }
    enter_proc(104);

  LINE(105);
    {
    elist[0] = STR_cannot_040set_040date;
    {signal (ERR_not_possible);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE set_date ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist1 *sigs;
    Vlist4 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPset_date_actual;
static Vlist0 vals_istreamOPset_date = {0, 0};
static sig_desc1 sig_istreamOPset_date_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPset_date = {0, 1, (sig_desc*)&sig_istreamOPset_date_1};
static Vlist4 locals_istreamOPset_date = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist", &record_buf_name_ops},  {0, 2, "new_date", &date_ops}}
};
static Vlist0 popowns_istreamOPset_date = {0, 0};
Slist0 tformals_istreamOPset_date = {0, 0};
Slist0 opformals_istreamOPset_date = {0, 0};
dbg_info_istreamOPset_date_actual dbg_info_istreamOPset_date_data = {0, 12, 
    "istreamOPset_date", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPset_date, 2, 
    &vals_istreamOPset_date, &sigs_istreamOPset_date, &locals_istreamOPset_date, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPset_date = (struct dbg_info*)&dbg_info_istreamOPset_date_data;
extern struct dbg_info* dbg_info_istreamOPget_name;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPget_name_TRACE
int istreamOPget_name_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPget_name_own_init = 0;

/**** BEGIN PROCEDURE get_name ****/

errcode istreamOPget_name(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist;
        } locals;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPget_name;
    locals.ist = ist;
        if (istreamOPget_name_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPget_name_own_init = 1;
    }
    enter_proc(108);

  LINE(109);
    {
    {
    CLUREF T_1_1;
    T_1_1.num = locals.ist.vec->data[1];
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE get_name ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist1 *sigs;
    Vlist3 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPget_name_actual;
static Vlist1 vals_istreamOPget_name = {0, 1, { {0, 2, "", &file_name_ops}}
};
static sig_desc1 sig_istreamOPget_name_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPget_name = {0, 1, (sig_desc*)&sig_istreamOPget_name_1};
static Vlist3 locals_istreamOPget_name = {0, 3,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPget_name = {0, 0};
Slist0 tformals_istreamOPget_name = {0, 0};
Slist0 opformals_istreamOPget_name = {0, 0};
dbg_info_istreamOPget_name_actual dbg_info_istreamOPget_name_data = {0, 12, 
    "istreamOPget_name", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPget_name, 1, 
    &vals_istreamOPget_name, &sigs_istreamOPget_name, &locals_istreamOPget_name, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPget_name = (struct dbg_info*)&dbg_info_istreamOPget_name_data;
extern struct dbg_info* dbg_info_istreamOPclose;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPclose_TRACE
int istreamOPclose_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPclose_own_init = 0;

/**** BEGIN PROCEDURE close ****/

errcode istreamOPclose(ist)
CLUREF ist;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF wb;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPclose;
    locals.ist = ist;
        if (istreamOPclose_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPclose_own_init = 1;
    }
    enter_proc(112);

  LINE(113);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 2: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.rb.num = T_2_2.num;

  LINE(115);
            {
            CLUREF T_3_1;
            T_3_1.num = locals.rb.vec->data[0];
            locals.err = _chanOPclose(T_3_1);
            if (locals.err != ERR_ok) goto ex_1;
            }
            break;
            }
    case 3: 
         {CLUREF T_2_3;
        T_2_3.num = T_2_1.cell->value;
        locals.wb.num = T_2_3.num;

  LINE(117);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            CLUREF T_3_3;
            CLUREF T_3_4;
            T_3_1.num = locals.wb.vec->data[0];
            T_3_2.num = locals.wb.vec->data[2];
            T_3_3.num = locals.wb.vec->data[1];
            locals.err = intOPmul(CLU_4, T_3_3, &T_3_4);
            if (locals.err != ERR_ok) goto ex_1;
            locals.err = _chanOPputw(T_3_1, T_3_2, CLU_1, T_3_4, CLU_0);
            if (locals.err != ERR_ok) goto ex_1;
            }

  LINE(118);
            {
            locals.wb.vec->data[1]  = 0;
            }

  LINE(119);
            {
            CLUREF T_3_1;
            T_3_1.num = locals.wb.vec->data[0];
            locals.err = _chanOPclose(T_3_1);
            if (locals.err != ERR_ok) goto ex_1;
            }
            break;
            }
    default: {
    }
    }
    }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;

  LINE(122);
    {
    CLUREF T_1_1;
    CellAlloc(1, nil, T_1_1);
    locals.ist.vec->data[0]  = T_1_1.num;
    }
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE close ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist1 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPclose_actual;
static Vlist0 vals_istreamOPclose = {0, 0};
static sig_desc1 sig_istreamOPclose_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPclose = {0, 1, (sig_desc*)&sig_istreamOPclose_1};
static Vlist5 locals_istreamOPclose = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPclose = {0, 0};
Slist0 tformals_istreamOPclose = {0, 0};
Slist0 opformals_istreamOPclose = {0, 0};
dbg_info_istreamOPclose_actual dbg_info_istreamOPclose_data = {0, 12, 
    "istreamOPclose", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPclose, 1, 
    &vals_istreamOPclose, &sigs_istreamOPclose, &locals_istreamOPclose, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPclose = (struct dbg_info*)&dbg_info_istreamOPclose_data;
extern struct dbg_info* dbg_info_istreamOPabort;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPabort_TRACE
int istreamOPabort_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPabort_own_init = 0;

/**** BEGIN PROCEDURE abort ****/

errcode istreamOPabort(ist)
CLUREF ist;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF wb;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPabort;
    locals.ist = ist;
        if (istreamOPabort_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPabort_own_init = 1;
    }
    enter_proc(125);

  LINE(126);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 2: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.rb.num = T_2_2.num;

  LINE(128);
            {
            CLUREF T_3_1;
            T_3_1.num = locals.rb.vec->data[0];
            locals.err = _chanOPabort(T_3_1);
            if (locals.err != ERR_ok) goto ex_1;
            }
            break;
            }
    case 3: 
         {CLUREF T_2_3;
        T_2_3.num = T_2_1.cell->value;
        locals.wb.num = T_2_3.num;

  LINE(130);
            {
            CLUREF T_3_1;
            T_3_1.num = locals.wb.vec->data[0];
            locals.err = _chanOPabort(T_3_1);
            if (locals.err != ERR_ok) goto ex_1;
            }
            break;
            }
    default: {
    }
    }
    }
        goto end_1;
        ex_1:
            if ((locals.err == ERR_not_possible)) {
            }
            else {
                goto ex_0;
            }
        end_1:;

  LINE(133);
    {
    CLUREF T_1_1;
    CellAlloc(1, nil, T_1_1);
    locals.ist.vec->data[0]  = T_1_1.num;
    }
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE abort ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist0 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPabort_actual;
static Vlist0 vals_istreamOPabort = {0, 0};
static siglist0 sigs_istreamOPabort = {0, 0};
static Vlist5 locals_istreamOPabort = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPabort = {0, 0};
Slist0 tformals_istreamOPabort = {0, 0};
Slist0 opformals_istreamOPabort = {0, 0};
dbg_info_istreamOPabort_actual dbg_info_istreamOPabort_data = {0, 12, 
    "istreamOPabort", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPabort, 1, 
    &vals_istreamOPabort, &sigs_istreamOPabort, &locals_istreamOPabort, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPabort = (struct dbg_info*)&dbg_info_istreamOPabort_data;
extern struct dbg_info* dbg_info_istreamOPis_closed;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPis_closed_TRACE
int istreamOPis_closed_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPis_closed_own_init = 0;

/**** BEGIN PROCEDURE is_closed ****/

errcode istreamOPis_closed(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist;
        } locals;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPis_closed;
    locals.ist = ist;
        if (istreamOPis_closed_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPis_closed_own_init = 1;
    }
    enter_proc(136);

  LINE(137);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = locals.ist.vec->data[0];
    if (T_1_1.cell->tag == 1) T_1_2.num = true; else T_1_2.num = false;
    ret_1->num = T_1_2.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE is_closed ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist3 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPis_closed_actual;
static Vlist1 vals_istreamOPis_closed = {0, 1, { {0, 2, "", &bool_ops}}
};
static siglist0 sigs_istreamOPis_closed = {0, 0};
static Vlist3 locals_istreamOPis_closed = {0, 3,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPis_closed = {0, 0};
Slist0 tformals_istreamOPis_closed = {0, 0};
Slist0 opformals_istreamOPis_closed = {0, 0};
dbg_info_istreamOPis_closed_actual dbg_info_istreamOPis_closed_data = {0, 12, 
    "istreamOPis_closed", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPis_closed, 1, 
    &vals_istreamOPis_closed, &sigs_istreamOPis_closed, &locals_istreamOPis_closed, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPis_closed = (struct dbg_info*)&dbg_info_istreamOPis_closed_data;
extern struct dbg_info* dbg_info_istreamOPequal;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPequal_TRACE
int istreamOPequal_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPequal_own_init = 0;

/**** BEGIN PROCEDURE equal ****/

errcode istreamOPequal(ist1, ist2, ret_1)
CLUREF ist1;
CLUREF ist2;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist1;
        CLUREF ist2;
        } locals;
    locals.ist1.num = UNINIT;
    locals.ist2.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPequal;
    locals.ist1 = ist1;
    locals.ist2 = ist2;
        if (istreamOPequal_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPequal_own_init = 1;
    }
    enter_proc(140);

  LINE(141);
    {
    {
    CLUREF T_1_1;
    T_1_1.num = (locals.ist1.num == locals.ist2.num)? true : false;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE equal ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist4 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPequal_actual;
static Vlist1 vals_istreamOPequal = {0, 1, { {0, 2, "", &bool_ops}}
};
static siglist0 sigs_istreamOPequal = {0, 0};
static Vlist4 locals_istreamOPequal = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist1", &record_buf_name_ops},  {0, 2, "ist2", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPequal = {0, 0};
Slist0 tformals_istreamOPequal = {0, 0};
Slist0 opformals_istreamOPequal = {0, 0};
dbg_info_istreamOPequal_actual dbg_info_istreamOPequal_data = {0, 12, 
    "istreamOPequal", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPequal, 2, 
    &vals_istreamOPequal, &sigs_istreamOPequal, &locals_istreamOPequal, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPequal = (struct dbg_info*)&dbg_info_istreamOPequal_data;
extern struct dbg_info* dbg_info_istreamOPsimilar;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPsimilar_TRACE
int istreamOPsimilar_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPsimilar_own_init = 0;

/**** BEGIN PROCEDURE similar ****/

errcode istreamOPsimilar(ist1, ist2, ret_1)
CLUREF ist1;
CLUREF ist2;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist1;
        CLUREF ist2;
        } locals;
    locals.ist1.num = UNINIT;
    locals.ist2.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPsimilar;
    locals.ist1 = ist1;
    locals.ist2 = ist2;
        if (istreamOPsimilar_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPsimilar_own_init = 1;
    }
    enter_proc(144);

  LINE(145);
    {
    {
    CLUREF T_1_1;
    T_1_1.num = (locals.ist1.num == locals.ist2.num)? true : false;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE similar ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist4 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPsimilar_actual;
static Vlist1 vals_istreamOPsimilar = {0, 1, { {0, 2, "", &bool_ops}}
};
static siglist0 sigs_istreamOPsimilar = {0, 0};
static Vlist4 locals_istreamOPsimilar = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist1", &record_buf_name_ops},  {0, 2, "ist2", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPsimilar = {0, 0};
Slist0 tformals_istreamOPsimilar = {0, 0};
Slist0 opformals_istreamOPsimilar = {0, 0};
dbg_info_istreamOPsimilar_actual dbg_info_istreamOPsimilar_data = {0, 12, 
    "istreamOPsimilar", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPsimilar, 2, 
    &vals_istreamOPsimilar, &sigs_istreamOPsimilar, &locals_istreamOPsimilar, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPsimilar = (struct dbg_info*)&dbg_info_istreamOPsimilar_data;
extern struct dbg_info* dbg_info_istreamOPcopy;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPcopy_TRACE
int istreamOPcopy_TRACE;

/**** BEGIN PROCEDURE copy ****/

errcode istreamOPcopy(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF ist;
        } locals;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPcopy;
    locals.ist = ist;
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
    enter_proc(148);

  LINE(149);
    {
    {
    ret_1->num = locals.ist.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE copy ****/

extern struct OPS *istream_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist0 *sigs;
    Vlist3 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPcopy_actual;
static Vlist1 vals_istreamOPcopy = {0, 1, { {0, 2, "", &istream_ops}}
};
static siglist0 sigs_istreamOPcopy = {0, 0};
static Vlist3 locals_istreamOPcopy = {0, 3,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "ist", &istream_ops}}
};
static Vlist0 popowns_istreamOPcopy = {0, 0};
Slist0 tformals_istreamOPcopy = {0, 0};
Slist0 opformals_istreamOPcopy = {0, 0};
dbg_info_istreamOPcopy_actual dbg_info_istreamOPcopy_data = {0, 12, 
    "istreamOPcopy", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPcopy, 1, 
    &vals_istreamOPcopy, &sigs_istreamOPcopy, &locals_istreamOPcopy, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPcopy = (struct dbg_info*)&dbg_info_istreamOPcopy_data;
extern struct dbg_info* dbg_info_istreamOPget_chan;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPget_chan_TRACE
int istreamOPget_chan_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPget_chan_own_init = 0;

/**** BEGIN PROCEDURE get_chan ****/

errcode istreamOPget_chan(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF wb;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPget_chan;
    locals.ist = ist;
        if (istreamOPget_chan_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPget_chan_own_init = 1;
    }
    enter_proc(154);

  LINE(155);
    {
    CLUREF T_1_1;
    T_1_1.num = locals.ist.vec->data[0];
    switch (T_1_1.cell->tag) {
    case 2: 
         {CLUREF T_1_2;
        T_1_2.num = T_1_1.cell->value;
        locals.rb.num = T_1_2.num;

  LINE(157);
            {
            {
            CLUREF T_2_1;
            T_2_1.num = locals.rb.vec->data[0];
            ret_1->num = T_2_1.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    case 3: 
         {CLUREF T_1_3;
        T_1_3.num = T_1_1.cell->value;
        locals.wb.num = T_1_3.num;

  LINE(159);
            {
            {
            CLUREF T_2_1;
            T_2_1.num = locals.wb.vec->data[0];
            ret_1->num = T_2_1.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(161);
        {
        elist[0] = STR_no_040channel_040attached_040to_040istream;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE get_chan ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist1 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPget_chan_actual;
static Vlist1 vals_istreamOPget_chan = {0, 1, { {0, 2, "", &_chan_ops}}
};
static sig_desc1 sig_istreamOPget_chan_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPget_chan = {0, 1, (sig_desc*)&sig_istreamOPget_chan_1};
static Vlist5 locals_istreamOPget_chan = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPget_chan = {0, 0};
Slist0 tformals_istreamOPget_chan = {0, 0};
Slist0 opformals_istreamOPget_chan = {0, 0};
dbg_info_istreamOPget_chan_actual dbg_info_istreamOPget_chan_data = {0, 12, 
    "istreamOPget_chan", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPget_chan, 1, 
    &vals_istreamOPget_chan, &sigs_istreamOPget_chan, &locals_istreamOPget_chan, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPget_chan = (struct dbg_info*)&dbg_info_istreamOPget_chan_data;
extern struct dbg_info* dbg_info_istreamOPgeti;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPgeti_TRACE
int istreamOPgeti_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPgeti_own_init = 0;

/**** BEGIN PROCEDURE geti ****/

errcode istreamOPgeti(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF i;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.i.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPgeti;
    locals.ist = ist;
        if (istreamOPgeti_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPgeti_own_init = 1;
    }
    enter_proc(165);

  LINE(166);
    {
    CLUREF T_3_1;
    T_3_1.num = locals.ist.vec->data[0];
    switch (T_3_1.cell->tag) {
    case 2: 
         {CLUREF T_3_2;
        T_3_2.num = T_3_1.cell->value;
        locals.rb.num = T_3_2.num;

  LINE(168);
            {
            CLUREF T_4_1;
            CLUREF T_4_2;
            CLUREF T_4_3;
            T_4_1.num = locals.rb.vec->data[1];
            T_4_2.num = locals.rb.vec->data[2];
            T_4_3.num = (T_4_1.num > T_4_2.num)? true : false;
            if (T_4_3.num == true) {

  LINE(169);
                {
                CLUREF T_5_1;
                CLUREF T_5_2;
                CLUREF T_5_3;
                CLUREF T_5_4;
                T_5_1.num = locals.rb.vec->data[0];
                T_5_2.num = locals.rb.vec->data[3];
                locals.err = _chanOPgetw(T_5_1, T_5_2, &T_5_3);
                if (locals.err != ERR_ok) goto ex_2;
                locals.err = intOPdiv(T_5_3, CLU_4, &T_5_4);
                if (locals.err != ERR_ok) goto ex_2;
                locals.rb.vec->data[2]  = T_5_4.num;
                }

  LINE(170);
                {
                locals.rb.vec->data[1]  = 1;
                }
                }
                }/* end if */

  LINE(172);
            {
                {CLUREF T_4_1;
                CLUREF T_4_2;
                CLUREF T_4_3;
                T_4_1.num = locals.rb.vec->data[3];
                T_4_2.num = locals.rb.vec->data[1];
                locals.err = _wordvecOPfetch(T_4_1, T_4_2, &T_4_3);
                if (locals.err != ERR_ok) goto ex_2;
                locals.i.num = T_4_3.num;
                }
                }

  LINE(173);
            {
            CLUREF T_4_1;
            CLUREF T_4_2;
            T_4_1.num = locals.rb.vec->data[1];
            locals.err = intOPadd(T_4_1, CLU_1, &T_4_2);
            if (locals.err != ERR_ok) goto ex_2;
            locals.rb.vec->data[1]  = T_4_2.num;
            }

  LINE(174);
            {
            {
            ret_1->num = locals.i.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(176);
        {
        elist[0] = STR_cannot_040read_040from_040this_040istream;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_2;
    ex_2:
        if (locals.err == ERR_end_of_file) {signal(ERR_end_of_file);}
        else if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_1;}
    end_2:;
        goto end_1;
        ex_1:
            if ((locals.err == ERR_overflow)) {

  LINE(178);
                {
                elist[0] = STR_bad_040format;
                {signal (ERR_not_possible);}}
            }
            else {
                goto ex_0;
            }
        end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE geti ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist2 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPgeti_actual;
static Vlist1 vals_istreamOPgeti = {0, 1, { {0, 2, "", &int_ops}}
};
static sig_desc0 sig_istreamOPgeti_1 = {0, 3, "end_of_file", {0, 0
}};
static sig_desc1 sig_istreamOPgeti_2 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist2 sigs_istreamOPgeti = {0, 2, (sig_desc*)&sig_istreamOPgeti_1, (sig_desc*)&sig_istreamOPgeti_2};
static Vlist5 locals_istreamOPgeti = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "i", &int_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPgeti = {0, 0};
Slist0 tformals_istreamOPgeti = {0, 0};
Slist0 opformals_istreamOPgeti = {0, 0};
dbg_info_istreamOPgeti_actual dbg_info_istreamOPgeti_data = {0, 12, 
    "istreamOPgeti", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPgeti, 1, 
    &vals_istreamOPgeti, &sigs_istreamOPgeti, &locals_istreamOPgeti, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPgeti = (struct dbg_info*)&dbg_info_istreamOPgeti_data;
extern struct dbg_info* dbg_info_istreamOPputi;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPputi_TRACE
int istreamOPputi_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPputi_own_init = 0;

/**** BEGIN PROCEDURE puti ****/

errcode istreamOPputi(ist, i)
CLUREF ist;
CLUREF i;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF wb;
        CLUREF ist;
        CLUREF i;
        } locals;
    locals.wb.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.i.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPputi;
    locals.ist = ist;
    locals.i = i;
        if (istreamOPputi_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPputi_own_init = 1;
    }
    enter_proc(181);

  LINE(182);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 3: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.wb.num = T_2_2.num;

  LINE(184);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            CLUREF T_3_3;
            T_3_1.num = locals.wb.vec->data[1];
            T_3_2.num = 256;
            T_3_3.num = (T_3_1.num == T_3_2.num)? true : false;
            if (T_3_3.num == true) {

  LINE(185);
                {
                CLUREF T_4_1;
                CLUREF T_4_2;
                CLUREF T_4_3;
                T_4_1.num = locals.wb.vec->data[0];
                T_4_2.num = locals.wb.vec->data[2];
                T_4_3.num = 1024;
                locals.err = _chanOPputw(T_4_1, T_4_2, CLU_1, T_4_3, CLU_0);
                if (locals.err != ERR_ok) goto ex_1;
                }

  LINE(186);
                {
                locals.wb.vec->data[1]  = 0;
                }
                }
                }/* end if */

  LINE(188);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            T_3_1.num = locals.wb.vec->data[1];
            locals.err = intOPadd(T_3_1, CLU_1, &T_3_2);
            if (locals.err != ERR_ok) goto ex_1;
            locals.wb.vec->data[1]  = T_3_2.num;
            }

  LINE(189);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            T_3_1.num = locals.wb.vec->data[2];
            T_3_2.num = locals.wb.vec->data[1];
            locals.err = _wordvecOPstore(T_3_1, T_3_2, locals.i);
            if (locals.err != ERR_ok) goto ex_1;
            }
            break;
            }
    default: {

  LINE(191);
        {
        elist[0] = STR_cannot_040write_040to_040this_040istream;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE puti ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist1 *sigs;
    Vlist5 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPputi_actual;
static Vlist0 vals_istreamOPputi = {0, 0};
static sig_desc1 sig_istreamOPputi_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPputi = {0, 1, (sig_desc*)&sig_istreamOPputi_1};
static Vlist5 locals_istreamOPputi = {0, 5,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "ist", &record_buf_name_ops},  {0, 2, "i", &int_ops}}
};
static Vlist0 popowns_istreamOPputi = {0, 0};
Slist0 tformals_istreamOPputi = {0, 0};
Slist0 opformals_istreamOPputi = {0, 0};
dbg_info_istreamOPputi_actual dbg_info_istreamOPputi_data = {0, 12, 
    "istreamOPputi", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPputi, 2, 
    &vals_istreamOPputi, &sigs_istreamOPputi, &locals_istreamOPputi, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPputi = (struct dbg_info*)&dbg_info_istreamOPputi_data;
extern struct dbg_info* dbg_info_istreamOPgetbv;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPgetbv_TRACE
int istreamOPgetbv_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPgetbv_own_init = 0;

/**** BEGIN PROCEDURE getbv ****/

errcode istreamOPgetbv(ist, ret_1)
CLUREF ist;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF rb;
        CLUREF z;
        CLUREF bvec;
        CLUREF i;
        CLUREF bidx;
        CLUREF cnt;
        CLUREF ist;
        } locals;
    locals.rb.num = UNINIT;
    locals.z.num = UNINIT;
    locals.bvec.num = UNINIT;
    locals.i.num = UNINIT;
    locals.bidx.num = UNINIT;
    locals.cnt.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPgetbv;
    locals.ist = ist;
        if (istreamOPgetbv_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPgetbv_own_init = 1;
    }
    enter_proc(195);

  LINE(197);
    {
    CLUREF T_3_1;
    T_3_1.num = locals.ist.vec->data[0];
    switch (T_3_1.cell->tag) {
    case 2: 
         {CLUREF T_3_2;
        T_3_2.num = T_3_1.cell->value;
        locals.rb.num = T_3_2.num;

  LINE(199);
            {
            CLUREF T_4_1;
            CLUREF T_4_2;
            CLUREF T_4_3;
            T_4_1.num = locals.rb.vec->data[1];
            T_4_2.num = locals.rb.vec->data[2];
            T_4_3.num = (T_4_1.num > T_4_2.num)? true : false;
            if (T_4_3.num == true) {

  LINE(200);
                {
                CLUREF T_5_1;
                CLUREF T_5_2;
                CLUREF T_5_3;
                CLUREF T_5_4;
                T_5_1.num = locals.rb.vec->data[0];
                T_5_2.num = locals.rb.vec->data[3];
                locals.err = _chanOPgetw(T_5_1, T_5_2, &T_5_3);
                if (locals.err != ERR_ok) goto ex_2;
                locals.err = intOPdiv(T_5_3, CLU_4, &T_5_4);
                if (locals.err != ERR_ok) goto ex_2;
                locals.rb.vec->data[2]  = T_5_4.num;
                }

  LINE(201);
                {
                locals.rb.vec->data[1]  = 1;
                }
                }
                }/* end if */

  LINE(203);
            {
                {CLUREF T_4_1;
                CLUREF T_4_2;
                CLUREF T_4_3;
                T_4_1.num = locals.rb.vec->data[3];
                T_4_2.num = locals.rb.vec->data[1];
                locals.err = _wordvecOPfetch(T_4_1, T_4_2, &T_4_3);
                if (locals.err != ERR_ok) goto ex_2;
                locals.z.num = T_4_3.num;
                }
                }

  LINE(204);
            {
            CLUREF T_4_1;
            CLUREF T_4_2;
            T_4_1.num = locals.rb.vec->data[1];
            locals.err = intOPadd(T_4_1, CLU_1, &T_4_2);
            if (locals.err != ERR_ok) goto ex_2;
            locals.rb.vec->data[1]  = T_4_2.num;
            }

  LINE(205);
            {
            CLUREF T_4_1;
            T_4_1.num = (locals.z.num == 0)? true : false;
            if (T_4_1.num == true) {

  LINE(206);
                {
                {
                CLUREF T_5_1;
                T_5_1.num = STR_.num;
                ret_1->num = T_5_1.num;
                }
                {signal (ERR_ok);}}
                }
                }/* end if */

  LINE(207);
            {
                {CLUREF T_4_1;
                locals.err = _bytevecOPcreate(locals.z, &T_4_1);
                if (locals.err != ERR_ok) goto ex_2;
                locals.bvec.num = T_4_1.num;
                }
                }

  LINE(208);
            {
                {locals.i.num = 1;
                }
                }

  LINE(209);
            for (;;) {
                CLUREF T_4_1;
                T_4_1.num = (locals.z.num > 0)? true : false;
                if (T_4_1.num != true) { break; }

  LINE(210);
                {
                CLUREF T_5_1;
                CLUREF T_5_2;
                CLUREF T_5_3;
                T_5_1.num = locals.rb.vec->data[1];
                T_5_2.num = locals.rb.vec->data[2];
                T_5_3.num = (T_5_1.num > T_5_2.num)? true : false;
                if (T_5_3.num == true) {

  LINE(211);
                    {
                    CLUREF T_6_1;
                    CLUREF T_6_2;
                    CLUREF T_6_3;
                    CLUREF T_6_4;
                    T_6_1.num = locals.rb.vec->data[0];
                    T_6_2.num = locals.rb.vec->data[3];
                    locals.err = _chanOPgetw(T_6_1, T_6_2, &T_6_3);
                    if (locals.err != ERR_ok) goto ex_2;
                    locals.err = intOPdiv(T_6_3, CLU_4, &T_6_4);
                    if (locals.err != ERR_ok) goto ex_2;
                    locals.rb.vec->data[2]  = T_6_4.num;
                    }

  LINE(212);
                    {
                    locals.rb.vec->data[1]  = 1;
                    }
                    }
                    }/* end if */

  LINE(214);
                {
                    {CLUREF T_5_1;
                    CLUREF T_5_2;
                    CLUREF T_5_3;
                    T_5_1.num = locals.rb.vec->data[1];
                    locals.err = intOPsub(T_5_1, CLU_1, &T_5_2);
                    if (locals.err != ERR_ok) goto ex_2;
                    locals.err = intOPmul(T_5_2, CLU_4, &T_5_3);
                    if (locals.err != ERR_ok) goto ex_2;
                    locals.bidx.num = T_5_3.num;
                    }
                    }

  LINE(215);
                {
                    {CLUREF T_5_1;
                    CLUREF T_5_2;
                    CLUREF T_5_3;
                    T_5_1.num = locals.rb.vec->data[2];
                    locals.err = intOPmul(T_5_1, CLU_4, &T_5_2);
                    if (locals.err != ERR_ok) goto ex_2;
                    locals.err = intOPsub(T_5_2, locals.bidx, &T_5_3);
                    if (locals.err != ERR_ok) goto ex_2;
                    locals.cnt.num = T_5_3.num;
                    }
                    }

  LINE(216);
                {
                CLUREF T_5_1;
                T_5_1.num = (locals.z.num < locals.cnt.num)? true : false;
                if (T_5_1.num == true) {

  LINE(217);
                    {
                    locals.cnt.num = locals.z.num;
                    }
                    }
                    }/* end if */

  LINE(218);
                {
                CLUREF T_5_1;
                CLUREF T_5_2;
                T_5_1.num = locals.rb.vec->data[3];
                locals.err = intOPadd(locals.bidx, CLU_1, &T_5_2);
                if (locals.err != ERR_ok) goto ex_2;
                locals.err = _wordvecOPmove_w2b(T_5_1, T_5_2, locals.bvec, locals.i, locals.cnt);
                if (locals.err != ERR_ok) goto ex_2;
                }

  LINE(219);
                {
                CLUREF T_5_1;
                locals.err = intOPsub(locals.z, locals.cnt, &T_5_1);
                if (locals.err != ERR_ok) goto ex_2;
                locals.z.num = T_5_1.num;
                }

  LINE(220);
                {
                CLUREF T_5_1;
                locals.err = intOPadd(locals.i, locals.cnt, &T_5_1);
                if (locals.err != ERR_ok) goto ex_2;
                locals.i.num = T_5_1.num;
                }

  LINE(221);
                {
                CLUREF T_5_1;
                CLUREF T_5_2;
                CLUREF T_5_3;
                CLUREF T_5_4;
                T_5_1.num = locals.rb.vec->data[1];
                locals.err = intOPadd(locals.cnt, CLU_3, &T_5_2);
                if (locals.err != ERR_ok) goto ex_2;
                locals.err = intOPdiv(T_5_2, CLU_4, &T_5_3);
                if (locals.err != ERR_ok) goto ex_2;
                locals.err = intOPadd(T_5_1, T_5_3, &T_5_4);
                if (locals.err != ERR_ok) goto ex_2;
                locals.rb.vec->data[1]  = T_5_4.num;
                }
                }
                end_while_1:;

  LINE(223);
            {
            {
            ret_1->num = locals.bvec.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(225);
        {
        elist[0] = STR_cannot_040read_040from_040this_040istream;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_2;
    ex_2:
        if (locals.err == ERR_end_of_file) {signal(ERR_end_of_file);}
        else if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_1;}
    end_2:;
        goto end_1;
        ex_1:
            if ((locals.err == ERR_overflow)
             || (locals.err == ERR_toobig)) {

  LINE(227);
                {
                elist[0] = STR_bad_040format;
                {signal (ERR_not_possible);}}
            }
            else {
                goto ex_0;
            }
        end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE getbv ****/

extern struct OPS *_bytevec_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist2 *sigs;
    Vlist9 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPgetbv_actual;
static Vlist1 vals_istreamOPgetbv = {0, 1, { {0, 2, "", &_bytevec_ops}}
};
static sig_desc0 sig_istreamOPgetbv_1 = {0, 3, "end_of_file", {0, 0
}};
static sig_desc1 sig_istreamOPgetbv_2 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist2 sigs_istreamOPgetbv = {0, 2, (sig_desc*)&sig_istreamOPgetbv_1, (sig_desc*)&sig_istreamOPgetbv_2};
static Vlist9 locals_istreamOPgetbv = {0, 9,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "rb", &record_chan_idx_max_wvec_ops},  {0, 2, "z", &int_ops},  {0, 2, "bvec", &_bytevec_ops},  {0, 2, "i", &int_ops},  {0, 2, "bidx", &int_ops},  {0, 2, "cnt", &int_ops},  {0, 2, "ist", &record_buf_name_ops}}
};
static Vlist0 popowns_istreamOPgetbv = {0, 0};
Slist0 tformals_istreamOPgetbv = {0, 0};
Slist0 opformals_istreamOPgetbv = {0, 0};
dbg_info_istreamOPgetbv_actual dbg_info_istreamOPgetbv_data = {0, 12, 
    "istreamOPgetbv", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPgetbv, 1, 
    &vals_istreamOPgetbv, &sigs_istreamOPgetbv, &locals_istreamOPgetbv, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPgetbv = (struct dbg_info*)&dbg_info_istreamOPgetbv_data;
extern struct dbg_info* dbg_info_istreamOPputbv;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPputbv_TRACE
int istreamOPputbv_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPputbv_own_init = 0;

/**** BEGIN PROCEDURE putbv ****/

errcode istreamOPputbv(ist, bvec)
CLUREF ist;
CLUREF bvec;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF wb;
        CLUREF z;
        CLUREF i;
        CLUREF bidx;
        CLUREF cnt;
        CLUREF ist;
        CLUREF bvec;
        } locals;
    locals.wb.num = UNINIT;
    locals.z.num = UNINIT;
    locals.i.num = UNINIT;
    locals.bidx.num = UNINIT;
    locals.cnt.num = UNINIT;
    locals.ist.num = UNINIT;
    locals.bvec.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPputbv;
    locals.ist = ist;
    locals.bvec = bvec;
        if (istreamOPputbv_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPputbv_own_init = 1;
    }
    enter_proc(231);

  LINE(232);
    {
    CLUREF T_2_1;
    T_2_1.num = locals.ist.vec->data[0];
    switch (T_2_1.cell->tag) {
    case 3: 
         {CLUREF T_2_2;
        T_2_2.num = T_2_1.cell->value;
        locals.wb.num = T_2_2.num;

  LINE(234);
            {
                {CLUREF T_3_1;
                locals.err = _bytevecOPsize(locals.bvec, &T_3_1);
                if (locals.err != ERR_ok) goto ex_1;
                locals.z.num = T_3_1.num;
                }
                }

  LINE(235);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            CLUREF T_3_3;
            T_3_1.num = locals.wb.vec->data[1];
            T_3_2.num = 256;
            T_3_3.num = (T_3_1.num == T_3_2.num)? true : false;
            if (T_3_3.num == true) {

  LINE(236);
                {
                CLUREF T_4_1;
                CLUREF T_4_2;
                CLUREF T_4_3;
                T_4_1.num = locals.wb.vec->data[0];
                T_4_2.num = locals.wb.vec->data[2];
                T_4_3.num = 1024;
                locals.err = _chanOPputw(T_4_1, T_4_2, CLU_1, T_4_3, CLU_0);
                if (locals.err != ERR_ok) goto ex_1;
                }

  LINE(237);
                {
                locals.wb.vec->data[1]  = 0;
                }
                }
                }/* end if */

  LINE(239);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            T_3_1.num = locals.wb.vec->data[1];
            locals.err = intOPadd(T_3_1, CLU_1, &T_3_2);
            if (locals.err != ERR_ok) goto ex_1;
            locals.wb.vec->data[1]  = T_3_2.num;
            }

  LINE(240);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            T_3_1.num = locals.wb.vec->data[2];
            T_3_2.num = locals.wb.vec->data[1];
            locals.err = _wordvecOPstore(T_3_1, T_3_2, locals.z);
            if (locals.err != ERR_ok) goto ex_1;
            }

  LINE(241);
            {
                {locals.i.num = 1;
                }
                }

  LINE(242);
            for (;;) {
                CLUREF T_3_1;
                T_3_1.num = (locals.z.num > 0)? true : false;
                if (T_3_1.num != true) { break; }

  LINE(243);
                {
                CLUREF T_4_1;
                CLUREF T_4_2;
                CLUREF T_4_3;
                T_4_1.num = locals.wb.vec->data[1];
                T_4_2.num = 256;
                T_4_3.num = (T_4_1.num == T_4_2.num)? true : false;
                if (T_4_3.num == true) {

  LINE(244);
                    {
                    CLUREF T_5_1;
                    CLUREF T_5_2;
                    CLUREF T_5_3;
                    T_5_1.num = locals.wb.vec->data[0];
                    T_5_2.num = locals.wb.vec->data[2];
                    T_5_3.num = 1024;
                    locals.err = _chanOPputw(T_5_1, T_5_2, CLU_1, T_5_3, CLU_0);
                    if (locals.err != ERR_ok) goto ex_1;
                    }

  LINE(245);
                    {
                    locals.wb.vec->data[1]  = 0;
                    }
                    }
                    }/* end if */

  LINE(247);
                {
                    {CLUREF T_4_1;
                    CLUREF T_4_2;
                    T_4_1.num = locals.wb.vec->data[1];
                    locals.err = intOPmul(T_4_1, CLU_4, &T_4_2);
                    if (locals.err != ERR_ok) goto ex_1;
                    locals.bidx.num = T_4_2.num;
                    }
                    }

  LINE(248);
                {
                    {CLUREF T_4_1;
                    CLUREF T_4_2;
                    T_4_1.num = 1024;
                    locals.err = intOPsub(T_4_1, locals.bidx, &T_4_2);
                    if (locals.err != ERR_ok) goto ex_1;
                    locals.cnt.num = T_4_2.num;
                    }
                    }

  LINE(249);
                {
                CLUREF T_4_1;
                T_4_1.num = (locals.z.num < locals.cnt.num)? true : false;
                if (T_4_1.num == true) {

  LINE(250);
                    {
                    locals.cnt.num = locals.z.num;
                    }
                    }
                    }/* end if */

  LINE(251);
                {
                CLUREF T_4_1;
                CLUREF T_4_2;
                T_4_1.num = locals.wb.vec->data[2];
                locals.err = intOPadd(locals.bidx, CLU_1, &T_4_2);
                if (locals.err != ERR_ok) goto ex_1;
                locals.err = _wordvecOPmove_b2w(locals.bvec, locals.i, T_4_1, T_4_2, locals.cnt);
                if (locals.err != ERR_ok) goto ex_1;
                }

  LINE(252);
                {
                CLUREF T_4_1;
                locals.err = intOPsub(locals.z, locals.cnt, &T_4_1);
                if (locals.err != ERR_ok) goto ex_1;
                locals.z.num = T_4_1.num;
                }

  LINE(253);
                {
                CLUREF T_4_1;
                locals.err = intOPadd(locals.i, locals.cnt, &T_4_1);
                if (locals.err != ERR_ok) goto ex_1;
                locals.i.num = T_4_1.num;
                }

  LINE(254);
                {
                CLUREF T_4_1;
                CLUREF T_4_2;
                CLUREF T_4_3;
                CLUREF T_4_4;
                T_4_1.num = locals.wb.vec->data[1];
                locals.err = intOPadd(locals.cnt, CLU_3, &T_4_2);
                if (locals.err != ERR_ok) goto ex_1;
                locals.err = intOPdiv(T_4_2, CLU_4, &T_4_3);
                if (locals.err != ERR_ok) goto ex_1;
                locals.err = intOPadd(T_4_1, T_4_3, &T_4_4);
                if (locals.err != ERR_ok) goto ex_1;
                locals.wb.vec->data[1]  = T_4_4.num;
                }
                }
                end_while_1:;
            break;
            }
    default: {

  LINE(257);
        {
        elist[0] = STR_cannot_040write_040to_040this_040istream;
        {signal (ERR_not_possible);}}
    }
    }
    }
    goto end_1;
    ex_1:
        if (locals.err == ERR_not_possible) {signal(ERR_not_possible);}
        else {
            goto ex_0;}
    end_1:;
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE putbv ****/

typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist1 *sigs;
    Vlist9 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPputbv_actual;
static Vlist0 vals_istreamOPputbv = {0, 0};
static sig_desc1 sig_istreamOPputbv_1 = {0, 4, "not_possible", {0, 1
, { {0, 2, "", &string_ops}}}};
static siglist1 sigs_istreamOPputbv = {0, 1, (sig_desc*)&sig_istreamOPputbv_1};
static Vlist9 locals_istreamOPputbv = {0, 9,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "wb", &record_chan_idx_wvec_ops},  {0, 2, "z", &int_ops},  {0, 2, "i", &int_ops},  {0, 2, "bidx", &int_ops},  {0, 2, "cnt", &int_ops},  {0, 2, "ist", &record_buf_name_ops},  {0, 2, "bvec", &_bytevec_ops}}
};
static Vlist0 popowns_istreamOPputbv = {0, 0};
Slist0 tformals_istreamOPputbv = {0, 0};
Slist0 opformals_istreamOPputbv = {0, 0};
dbg_info_istreamOPputbv_actual dbg_info_istreamOPputbv_data = {0, 12, 
    "istreamOPputbv", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPputbv, 2, 
    &vals_istreamOPputbv, &sigs_istreamOPputbv, &locals_istreamOPputbv, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPputbv = (struct dbg_info*)&dbg_info_istreamOPputbv_data;
extern struct dbg_info* dbg_info_istreamOPdebug_print;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG istreamOPdebug_print_TRACE
int istreamOPdebug_print_TRACE;
struct OPS  *record_chan_idx_max_wvec_ops;
struct OPS  *record_chan_idx_wvec_ops;
struct OPS  *oneof_closed_read_write_ops;
struct OPS  *record_buf_name_ops;
static int istreamOPdebug_print_own_init = 0;

/**** BEGIN PROCEDURE debug_print ****/

errcode istreamOPdebug_print(_rep, ps)
CLUREF _rep;
CLUREF ps;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF _rep;
        CLUREF ps;
        } locals;
    locals._rep.num = UNINIT;
    locals.ps.num = UNINIT;
    locals.DBG_INFO = dbg_info_istreamOPdebug_print;
    locals._rep = _rep;
    locals.ps = ps;
        if (istreamOPdebug_print_own_init == 0) {
        if (istream_own_init == 0) {
            locals.err = istream_own_init_proc();
            if (locals.err != ERR_ok) goto ex_0;
            }
        istreamOPdebug_print_own_init = 1;
    }
    enter_proc(1);

  LINE(2);
    {
    generic_CLU_proc.type_owns = 0;
    generic_CLU_proc.op_owns = record_buf_name_ops->entry[7].fcn->op_owns;
    generic_CLU_proc.proc = recordOPdebug_print;
    CUR_PROC_VAR.proc = &generic_CLU_proc;
    locals.err = recordOPdebug_print(locals._rep, locals.ps);
    if (locals.err != ERR_ok) goto ex_0;
    }
    goto end_0;
    ex_0:
        {
            if (locals.err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(locals.err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE debug_print ****/

extern struct OPS *pstream_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist0 *vals;
    siglist0 *sigs;
    Vlist4 *locals;
    Vlist22 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_istreamOPdebug_print_actual;
static Vlist0 vals_istreamOPdebug_print = {0, 0};
static siglist0 sigs_istreamOPdebug_print = {0, 0};
static Vlist4 locals_istreamOPdebug_print = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "_rep", &record_buf_name_ops},  {0, 2, "ps", &pstream_ops}}
};
static Vlist0 popowns_istreamOPdebug_print = {0, 0};
Slist0 tformals_istreamOPdebug_print = {0, 0};
Slist0 opformals_istreamOPdebug_print = {0, 0};
dbg_info_istreamOPdebug_print_actual dbg_info_istreamOPdebug_print_data = {0, 12, 
    "istreamOPdebug_print", "/common/pub/dcurtis-temp/pclu/lib/clu/istream.clu", 0, 0, (int)istreamOPdebug_print, 2, 
    &vals_istreamOPdebug_print, &sigs_istreamOPdebug_print, &locals_istreamOPdebug_print, &owns_istream, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_istreamOPdebug_print = (struct dbg_info*)&dbg_info_istreamOPdebug_print_data;
typedef struct{
    int count;
    OWNPTR type_owns;
    OWNPTR op_owns;
    struct OP_ENTRY entry[16];
} istream_OPS;

CLU_proc istream_oe_abort = {{0,0,0,0}, istreamOPabort, 0};
CLU_proc istream_oe_can_read = {{0,0,0,0}, istreamOPcan_read, 0};
CLU_proc istream_oe_can_write = {{0,0,0,0}, istreamOPcan_write, 0};
CLU_proc istream_oe_close = {{0,0,0,0}, istreamOPclose, 0};
CLU_proc istream_oe_copy = {{0,0,0,0}, istreamOPcopy, 0};
CLU_proc istream_oe_empty = {{0,0,0,0}, istreamOPempty, 0};
CLU_proc istream_oe_equal = {{0,0,0,0}, istreamOPequal, 0};
CLU_proc istream_oe_flush = {{0,0,0,0}, istreamOPflush, 0};
CLU_proc istream_oe_get_date = {{0,0,0,0}, istreamOPget_date, 0};
CLU_proc istream_oe_get_name = {{0,0,0,0}, istreamOPget_name, 0};
CLU_proc istream_oe_is_closed = {{0,0,0,0}, istreamOPis_closed, 0};
CLU_proc istream_oe_open = {{0,0,0,0}, istreamOPopen, 0};
CLU_proc istream_oe_reset = {{0,0,0,0}, istreamOPreset, 0};
CLU_proc istream_oe_set_date = {{0,0,0,0}, istreamOPset_date, 0};
CLU_proc istream_oe_similar = {{0,0,0,0}, istreamOPsimilar, 0};
CLU_proc istream_oe_debug_print = {{0,0,0,0}, istreamOPdebug_print, 0};

istream_OPS istream_ops_actual = {16, (OWNPTR)&istream_own_init, (OWNPTR)&istream_own_init, {
    {&istream_oe_abort, "abort"},
    {&istream_oe_can_read, "can_read"},
    {&istream_oe_can_write, "can_write"},
    {&istream_oe_close, "close"},
    {&istream_oe_copy, "copy"},
    {&istream_oe_empty, "empty"},
    {&istream_oe_equal, "equal"},
    {&istream_oe_flush, "flush"},
    {&istream_oe_get_date, "get_date"},
    {&istream_oe_get_name, "get_name"},
    {&istream_oe_is_closed, "is_closed"},
    {&istream_oe_open, "open"},
    {&istream_oe_reset, "reset"},
    {&istream_oe_set_date, "set_date"},
    {&istream_oe_similar, "similar"},
    {&istream_oe_debug_print, "debug_print"}}};

struct OPS *istream_ops = (struct OPS *)&istream_ops_actual;

/**** END CLUSTER istream ****/
