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

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


extern errcode c_get_duspecs();
extern errcode recordOPget_1();
extern errcode c_envOPget_type();
extern errcode oneofOPmake_6();
extern errcode oneofOPmake_2();
extern errcode c_envOPget_unknown_type();
extern errcode stringOPequal();
extern errcode recordOPget_2();
extern errcode sequenceOPelements();
extern errcode c_2_parms();
extern errcode recordOPget_3();
extern errcode subst_2_parms();
extern errcode c_envOPerr();
extern errcode get_clusterop_print();
CLUREF STR_debug_137print;
CLUREF STR_bad_040parameters_040to_040_047;
CLUREF STR__047;
CLUREF STR__047_040does_040not_040exist_0401;
static int c_cluster_op_own_init = 0;

/**** BEGIN PROCEDURE c_cluster_op ****/

errcode c_cluster_op(e, dut, cop, ret_1)
CLUREF e;
CLUREF dut;
CLUREF cop;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF info;
    CLUREF specs;
    CLUREF inf;
    CLUREF n;
    CLUREF parms;
    CLUREF tparms;
    CLUREF op;
    CLUREF pparms;
    CLUREF ainfo;
        if (c_cluster_op_own_init == 0) {
        stringOPcons("debug_print", CLU_1, CLU_11, &STR_debug_137print);
        stringOPcons("bad parameters to \'", CLU_1, CLU_19, &STR_bad_040parameters_040to_040_047);
        stringOPcons("\'", CLU_1, CLU_1, &STR__047);
        stringOPcons("\' does not exist 1", CLU_1, CLU_18, &STR__047_040does_040not_040exist_0401);
        c_cluster_op_own_init = 1;
    }
    enter_proc(6);

  LINE(8);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        T_1_1.num = dut.vec->data[0];
        err = c_get_duspecs(e, T_1_1, &T_1_2);
        if (err != ERR_ok) goto ex_0;
        specs.num = T_1_2.num;
        }
        }

  LINE(9);
    {
    switch (specs.cell->tag) {
    case 3: 
         {CLUREF T_1_1;
        T_1_1.num = specs.cell->value;
        inf.num = T_1_1.num;

  LINE(11);
            {
            info.num = inf.num;
            }
            break;
            }
    case 4: 
         {

  LINE(13);
            {
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            CellAlloc(2, cop.num, T_2_1);
            CellAlloc(6, T_2_1.num, T_2_2);
            err = c_envOPget_type(e, T_2_2, &T_2_3);
            if (err != ERR_ok) goto ex_0;
            ret_1->num = T_2_3.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(15);
        {
        {
        CLUREF T_2_1;
        err = c_envOPget_unknown_type(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
    }
    }
    }

  LINE(17);
    {
        {CLUREF T_1_1;
        T_1_1.num = cop.vec->data[0];
        n.num = T_1_1.num;
        }
        }

  LINE(18);
    {
    CLUREF T_1_1;
    T_1_1.num = ((n.str->size != STR_debug_137print.str->size)? false :
        !(bcmp(n.str->data, STR_debug_137print.str->data, n.str->size)));
    if (T_1_1.num == true) {
        {
        {
        CLUREF T_2_1;
        err = c_envOPget_unknown_type(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(19);
    {
        {CLUREF T_1_1;
        T_1_1.num = dut.vec->data[1];
        parms.num = T_1_1.num;
        }
        }

  LINE(20);
    {
        {CLUREF T_1_1;
        T_1_1.num = info.vec->data[1];
        tparms.num = T_1_1.num;
        }
        }

  LINE(21);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    CLUREF T_1_4;
        T_1_1.num = info.vec->data[0];
        T_1_3.num = T_1_1.vec->size; 
        T_1_4 = T_1_1;
        for (T_1_2.num = 1; T_1_2.num <= T_1_3.num; T_1_2.num++) {
            op.num = T_1_4.vec->data[T_1_2.num - 1];

  LINE(22);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            T_2_1.num = op.vec->data[1];
            T_2_2.num = ((n.str->size != T_2_1.str->size)? false :
                !(bcmp(n.str->data, T_2_1.str->data, n.str->size)));
            if (T_2_2.num == true) {

  LINE(23);
                {
                    {CLUREF T_3_1;
                    T_3_1.num = cop.vec->data[1];
                    pparms.num = T_3_1.num;
                    }
                    }

  LINE(24);
                {
                    {CLUREF T_3_1;
                    T_3_1.num = op.vec->data[0];
                    ainfo.num = T_3_1.num;
                    }
                    }

  LINE(25);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                CLUREF T_3_3;
                T_3_1.num = ainfo.vec->data[0];
                T_3_2.num = op.vec->data[2];
                err = c_2_parms(e, pparms, T_3_1, parms, tparms, T_3_2, &T_3_3);
                if (err != ERR_ok) goto ex_0;
                if (T_3_3.num == true) {

  LINE(27);
                    {
                    {
                    CLUREF T_4_1;
                    err = subst_2_parms(e, parms, tparms, pparms, ainfo, &T_4_1);
                    if (err != ERR_ok) goto ex_0;
                    ret_1->num = T_4_1.num;
                    }
                    {signal (ERR_ok);}}
                    }
                    }/* end if */

  LINE(30);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                sequenceOPnew2(CLU_3, &T_3_1);
                T_3_1.vec->data[0] = STR_bad_040parameters_040to_040_047.num;
                err = get_clusterop_print(cop, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                T_3_1.vec->data[1] = T_3_2.num;
                T_3_1.vec->data[2] = STR__047.num;
                err = c_envOPerr(e, T_3_1);
                if (err != ERR_ok) goto ex_0;
                }

  LINE(32);
                {
                {
                CLUREF T_3_1;
                err = c_envOPget_unknown_type(e, &T_3_1);
                if (err != ERR_ok) goto ex_0;
                ret_1->num = T_3_1.num;
                }
                {signal (ERR_ok);}}
                }
                }/* end if */
        }
    }
    end_inline_for_1:;

  LINE(35);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    sequenceOPnew2(CLU_3, &T_1_1);
    T_1_1.vec->data[0] = STR__047.num;
    err = get_clusterop_print(cop, &T_1_2);
    if (err != ERR_ok) goto ex_0;
    T_1_1.vec->data[1] = T_1_2.num;
    T_1_1.vec->data[2] = STR__047_040does_040not_040exist_0401.num;
    err = c_envOPerr(e, T_1_1);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(36);
    {
    {
    CLUREF T_1_1;
    err = c_envOPget_unknown_type(e, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE c_cluster_op ****/


extern errcode exprOPcreate();
extern errcode oneofOPmake_25();
extern errcode c_envOPget_type_type();
extern errcode intOPequal();
extern errcode stringOPindexs();
extern errcode sequenceOPsize();
extern errcode c_select_requires();
extern errcode stringOPrest();
extern errcode intOPadd();
extern errcode stringOPsize();
extern errcode c_sel_type();
extern errcode sequenceOPe2s();
extern errcode c_parms();
extern errcode sequenceOPbottom();
extern errcode duOPequal();
extern errcode c_envOPget_struct_();
extern errcode c_envOPget_oneof_();
extern errcode c_envOPget_record_();
extern errcode c_envOPget_variant_();
extern errcode boolOPnot();
extern errcode oneofOPmake_7();
extern errcode sequenceOPconcat();
extern errcode c_envOPget_proc_();
extern errcode sequenceOPnew();
CLUREF STR_s2r;
CLUREF STR_r2s;
CLUREF STR_o2v;
CLUREF STR_v2o;
CLUREF STR_create;
CLUREF STR_r_137gets_137s;
CLUREF STR_v_137gets_137o;
CLUREF STR__047_040does_040not_040exist_0402;
static int c_select_op_own_init = 0;

/**** BEGIN PROCEDURE c_select_op ****/

errcode c_select_op(e, dut, cop, ret_1)
CLUREF e;
CLUREF dut;
CLUREF cop;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF info;
    CLUREF specs;
    CLUREF inf;
    CLUREF n;
    CLUREF fparms;
    CLUREF x;
    CLUREF op;
    CLUREF opn;
    CLUREF ainfo;
    CLUREF pparms;
    CLUREF sel;
    CLUREF t;
    CLUREF x1;
    CLUREF gen;
    CLUREF t1;
    CLUREF dut1;
    CLUREF t2;
    CLUREF args;
    CLUREF vals;
    CLUREF apt;
        if (c_select_op_own_init == 0) {
        stringOPcons("debug_print", CLU_1, CLU_11, &STR_debug_137print);
        stringOPcons("bad parameters to \'", CLU_1, CLU_19, &STR_bad_040parameters_040to_040_047);
        stringOPcons("\'", CLU_1, CLU_1, &STR__047);
        stringOPcons("s2r", CLU_1, CLU_3, &STR_s2r);
        stringOPcons("r2s", CLU_1, CLU_3, &STR_r2s);
        stringOPcons("o2v", CLU_1, CLU_3, &STR_o2v);
        stringOPcons("v2o", CLU_1, CLU_3, &STR_v2o);
        stringOPcons("create", CLU_1, CLU_6, &STR_create);
        stringOPcons("r_gets_s", CLU_1, CLU_8, &STR_r_137gets_137s);
        stringOPcons("v_gets_o", CLU_1, CLU_8, &STR_v_137gets_137o);
        stringOPcons("\' does not exist 2", CLU_1, CLU_18, &STR__047_040does_040not_040exist_0402);
        c_select_op_own_init = 1;
    }
    enter_proc(39);

  LINE(41);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        T_1_1.num = dut.vec->data[0];
        err = c_get_duspecs(e, T_1_1, &T_1_2);
        if (err != ERR_ok) goto ex_0;
        specs.num = T_1_2.num;
        }
        }

  LINE(42);
    {
    switch (specs.cell->tag) {
    case 5: 
         {CLUREF T_1_1;
        T_1_1.num = specs.cell->value;
        inf.num = T_1_1.num;

  LINE(44);
            {
            info.num = inf.num;
            }
            break;
            }
    case 4: 
         {

  LINE(46);
            {
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            CellAlloc(2, cop.num, T_2_1);
            CellAlloc(6, T_2_1.num, T_2_2);
            err = c_envOPget_type(e, T_2_2, &T_2_3);
            if (err != ERR_ok) goto ex_0;
            ret_1->num = T_2_3.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(48);
        {
        {
        CLUREF T_2_1;
        err = c_envOPget_unknown_type(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
    }
    }
    }

  LINE(50);
    {
        {CLUREF T_1_1;
        T_1_1.num = cop.vec->data[0];
        n.num = T_1_1.num;
        }
        }

  LINE(51);
    {
    CLUREF T_1_1;
    T_1_1.num = ((n.str->size != STR_debug_137print.str->size)? false :
        !(bcmp(n.str->data, STR_debug_137print.str->data, n.str->size)));
    if (T_1_1.num == true) {
        {
        {
        CLUREF T_2_1;
        err = c_envOPget_unknown_type(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(52);
    {
        {CLUREF T_1_1;
        T_1_1.num = dut.vec->data[1];
        fparms.num = T_1_1.num;
        }
        }

  LINE(53);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        CLUREF T_1_3;
        CLUREF T_1_4;
        T_1_1.num = cop.vec->data[2];
        CellAlloc(25, T_1_1.num, T_1_2);
        err = c_envOPget_type_type(e, &T_1_3);
        if (err != ERR_ok) goto ex_0;
        err = exprOPcreate(T_1_2, T_1_3, &T_1_4);
        if (err != ERR_ok) goto ex_0;
        x.num = T_1_4.num;
        }
        }

  LINE(54);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    CLUREF T_1_4;
        T_1_1.num = info.vec->data[0];
        T_1_3.num = T_1_1.vec->size; 
        T_1_4 = T_1_1;
        for (T_1_2.num = 1; T_1_2.num <= T_1_3.num; T_1_2.num++) {
            op.num = T_1_4.vec->data[T_1_2.num - 1];

  LINE(55);
            {
                {CLUREF T_2_1;
                T_2_1.num = op.vec->data[1];
                opn.num = T_2_1.num;
                }
                }

  LINE(56);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            CLUREF T_2_4;
            CLUREF T_2_5;
            CLUREF T_2_6;
            CLUREF T_2_7;
            CLUREF T_2_8;
            CLUREF T_2_9;
            T_2_2.num = ((n.str->size != opn.str->size)? false :
                !(bcmp(n.str->data, opn.str->data, n.str->size)));
            T_2_1.num = T_2_2.num;
            if (!T_2_2.num) {
                err = stringOPindexs(opn, n, &T_2_4);
                if (err != ERR_ok) goto ex_0;
                T_2_5.num = (T_2_4.num == 1)? true : false;
                T_2_3.num = T_2_5.num;
                if (T_2_5.num) {
                    T_2_6.num = op.vec->data[0];
                    T_2_7.num = T_2_6.vec->data[0];
                    T_2_8.num = T_2_7.vec->size;
                    T_2_9.num = (T_2_8.num == 1)? true : false;
                    T_2_3.num = T_2_9.num;
                }
                T_2_1.num = T_2_3.num;
            }
            if (T_2_1.num == true) {

  LINE(58);
                {
                CLUREF T_3_1;
                T_3_1.num = op.vec->data[2];
                err = c_select_requires(e, fparms, T_3_1);
                if (err != ERR_ok) goto ex_0;
                }

  LINE(59);
                {
                    {CLUREF T_3_1;
                    T_3_1.num = op.vec->data[0];
                    ainfo.num = T_3_1.num;
                    }
                    }

  LINE(61);
                {
                CLUREF T_3_1;
                T_3_1.num = ((n.str->size != opn.str->size)? false :
                    !(bcmp(n.str->data, opn.str->data, n.str->size)));
                if (T_3_1.num == true) {

  LINE(62);
                    {
                    CLUREF T_4_1;
                    T_4_1.num = cop.vec->data[1];
                    pparms.num = T_4_1.num;
                    }
                    }
                else {

  LINE(63);
                    {
                        {CLUREF T_4_1;
                        CLUREF T_4_2;
                        CLUREF T_4_3;
                        err = stringOPsize(opn, &T_4_1);
                        if (err != ERR_ok) goto ex_0;
                        T_4_2.num = T_4_1.num + 1;
                         if ((T_4_2.num > 0 && T_4_1.num < 0 && 1 < 0) || 
                             (T_4_2.num < 0 && T_4_1.num > 0 && 1 > 0)) {
                            err = ERR_overflow;
                            goto ex_0;}
                        err = stringOPrest(n, T_4_2, &T_4_3);
                        if (err != ERR_ok) goto ex_0;
                        sel.num = T_4_3.num;
                        }
                        }

  LINE(64);
                    {
                        {CLUREF T_4_1;
                        err = c_sel_type(e, sel, fparms, &T_4_1);
                        if (err != ERR_ok) goto ex_0;
                        t.num = T_4_1.num;
                        }
                        }

  LINE(65);
                    {
                        {CLUREF T_4_1;
                        CLUREF T_4_2;
                        CLUREF T_4_3;
                        CellAlloc(25, t.num, T_4_1);
                        err = c_envOPget_type_type(e, &T_4_2);
                        if (err != ERR_ok) goto ex_0;
                        err = exprOPcreate(T_4_1, T_4_2, &T_4_3);
                        if (err != ERR_ok) goto ex_0;
                        x1.num = T_4_3.num;
                        }
                        }

  LINE(67);
                    {
                    CLUREF T_4_1;
                    err = sequenceOPe2s(x1, &T_4_1);
                    if (err != ERR_ok) goto ex_0;
                    pparms.num = T_4_1.num;
                    }
                    }}/* end if */

  LINE(69);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                T_3_1.num = ainfo.vec->data[0];
                err = c_parms(e, pparms, T_3_1, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                if (T_3_2.num == true) {

  LINE(70);
                    {
                    {
                    CLUREF T_4_1;
                    CLUREF T_4_2;
                    CLUREF T_4_3;
                    CLUREF T_4_4;
                    CLUREF T_4_5;
                    err = sequenceOPe2s(x, &T_4_1);
                    if (err != ERR_ok) goto ex_0;
                    T_4_2.num = info.vec->data[1];
                    err = sequenceOPbottom(T_4_2, &T_4_3);
                    if (err != ERR_ok) goto ex_0;
                    err = sequenceOPe2s(T_4_3, &T_4_4);
                    if (err != ERR_ok) goto ex_0;
                    err = subst_2_parms(e, T_4_1, T_4_4, pparms, ainfo, &T_4_5);
                    if (err != ERR_ok) goto ex_0;
                    ret_1->num = T_4_5.num;
                    }
                    {signal (ERR_ok);}}
                    }
                    }/* end if */

  LINE(76);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                sequenceOPnew2(CLU_3, &T_3_1);
                T_3_1.vec->data[0] = STR_bad_040parameters_040to_040_047.num;
                err = get_clusterop_print(cop, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                T_3_1.vec->data[1] = T_3_2.num;
                T_3_1.vec->data[2] = STR__047.num;
                err = c_envOPerr(e, T_3_1);
                if (err != ERR_ok) goto ex_0;
                }

  LINE(78);
                {
                {
                CLUREF T_3_1;
                err = c_envOPget_unknown_type(e, &T_3_1);
                if (err != ERR_ok) goto ex_0;
                ret_1->num = T_3_1.num;
                }
                {signal (ERR_ok);}}
                }
                }/* end if */
        }
    }
    end_inline_for_1:;

  LINE(81);
    {
        {CLUREF T_1_1;
        T_1_1.num = dut.vec->data[0];
        gen.num = T_1_1.num;
        }
        }

  LINE(82);
    {
    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;
    CLUREF T_1_9;
    CLUREF T_1_10;
    CLUREF T_1_11;
    CLUREF T_1_12;
    CLUREF T_1_13;
    CLUREF T_1_14;
    CLUREF T_1_15;
    CLUREF T_1_16;
    CLUREF T_1_17;
    CLUREF T_1_18;
    CLUREF T_1_19;
    CLUREF T_1_20;
    CLUREF T_1_21;
    CLUREF T_1_22;
    CLUREF T_1_23;
    CLUREF T_1_24;
    CLUREF T_1_25;
    CLUREF T_1_26;
    CLUREF T_1_27;
    CLUREF T_1_28;
    CLUREF T_1_29;
    CLUREF T_1_30;
    CLUREF T_1_31;
    CLUREF T_1_32;
    CLUREF T_1_33;
    CLUREF T_1_34;
    CLUREF T_1_35;
    CLUREF T_1_36;
    CLUREF T_1_37;
    CLUREF T_1_38;
    CLUREF T_1_39;
    CLUREF T_1_40;
    err = c_envOPget_struct_(e, &T_1_6);
    if (err != ERR_ok) goto ex_0;
    err = duOPequal(gen, T_1_6, &T_1_7);
    if (err != ERR_ok) goto ex_0;
    T_1_5.num = T_1_7.num;
    if (T_1_7.num) {
        T_1_9.num = ((n.str->size != STR_s2r.str->size)? false :
            !(bcmp(n.str->data, STR_s2r.str->data, n.str->size)));
        T_1_8.num = T_1_9.num;
        if (!T_1_9.num) {
            T_1_10.num = ((n.str->size != STR_r2s.str->size)? false :
                !(bcmp(n.str->data, STR_r2s.str->data, n.str->size)));
            T_1_8.num = T_1_10.num;
        }
        T_1_5.num = T_1_8.num;
    }
    T_1_4.num = T_1_5.num;
    if (!T_1_5.num) {
        err = c_envOPget_oneof_(e, &T_1_12);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(gen, T_1_12, &T_1_13);
        if (err != ERR_ok) goto ex_0;
        T_1_11.num = T_1_13.num;
        if (T_1_13.num) {
            T_1_15.num = ((n.str->size != STR_o2v.str->size)? false :
                !(bcmp(n.str->data, STR_o2v.str->data, n.str->size)));
            T_1_14.num = T_1_15.num;
            if (!T_1_15.num) {
                T_1_16.num = ((n.str->size != STR_v2o.str->size)? false :
                    !(bcmp(n.str->data, STR_v2o.str->data, n.str->size)));
                T_1_14.num = T_1_16.num;
            }
            T_1_11.num = T_1_14.num;
        }
        T_1_4.num = T_1_11.num;
    }
    T_1_3.num = T_1_4.num;
    if (!T_1_4.num) {
        err = c_envOPget_record_(e, &T_1_18);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(gen, T_1_18, &T_1_19);
        if (err != ERR_ok) goto ex_0;
        T_1_17.num = T_1_19.num;
        if (T_1_19.num) {
            T_1_21.num = ((n.str->size != STR_create.str->size)? false :
                !(bcmp(n.str->data, STR_create.str->data, n.str->size)));
            T_1_20.num = T_1_21.num;
            if (!T_1_21.num) {
                T_1_22.num = ((n.str->size != STR_r_137gets_137s.str->size)? false :
                    !(bcmp(n.str->data, STR_r_137gets_137s.str->data, n.str->size)));
                T_1_20.num = T_1_22.num;
            }
            T_1_17.num = T_1_20.num;
        }
        T_1_3.num = T_1_17.num;
    }
    T_1_2.num = T_1_3.num;
    if (!T_1_3.num) {
        err = c_envOPget_variant_(e, &T_1_24);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(gen, T_1_24, &T_1_25);
        if (err != ERR_ok) goto ex_0;
        T_1_23.num = T_1_25.num;
        if (T_1_25.num) {
            T_1_26.num = ((n.str->size != STR_v_137gets_137o.str->size)? false :
                !(bcmp(n.str->data, STR_v_137gets_137o.str->data, n.str->size)));
            T_1_23.num = T_1_26.num;
        }
        T_1_2.num = T_1_23.num;
    }
    T_1_1.num = T_1_2.num;
    if (!T_1_2.num) {
        T_1_28.num = ((n.str->size != STR_create.str->size)? false :
            !(bcmp(n.str->data, STR_create.str->data, n.str->size)));
        T_1_27.num = T_1_28.num;
        if (T_1_28.num) {
            err = c_envOPget_struct_(e, &T_1_32);
            if (err != ERR_ok) goto ex_0;
            err = duOPequal(gen, T_1_32, &T_1_33);
            if (err != ERR_ok) goto ex_0;
            T_1_31.num = T_1_33.num;
            if (!T_1_33.num) {
                err = c_envOPget_oneof_(e, &T_1_34);
                if (err != ERR_ok) goto ex_0;
                err = duOPequal(gen, T_1_34, &T_1_35);
                if (err != ERR_ok) goto ex_0;
                T_1_31.num = T_1_35.num;
            }
            T_1_30.num = T_1_31.num;
            if (!T_1_31.num) {
                err = c_envOPget_record_(e, &T_1_36);
                if (err != ERR_ok) goto ex_0;
                err = duOPequal(gen, T_1_36, &T_1_37);
                if (err != ERR_ok) goto ex_0;
                T_1_30.num = T_1_37.num;
            }
            T_1_29.num = T_1_30.num;
            if (!T_1_30.num) {
                err = c_envOPget_variant_(e, &T_1_38);
                if (err != ERR_ok) goto ex_0;
                err = duOPequal(gen, T_1_38, &T_1_39);
                if (err != ERR_ok) goto ex_0;
                T_1_29.num = T_1_39.num;
            }
            T_1_40.num = T_1_29.num ^ 1;
            T_1_27.num = T_1_40.num;
        }
        T_1_1.num = T_1_27.num;
    }
    if (T_1_1.num == true) {

  LINE(88);
        {
            {CLUREF T_2_1;
            CLUREF T_2_2;
            CellAlloc(7, dut.num, T_2_1);
            err = c_envOPget_type(e, T_2_1, &T_2_2);
            if (err != ERR_ok) goto ex_0;
            t1.num = T_2_2.num;
            }
            }

  LINE(89);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        err = c_envOPget_struct_(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(gen, T_2_1, &T_2_2);
        if (err != ERR_ok) goto ex_0;
        if (T_2_2.num == true) {

  LINE(90);
            {
            CLUREF T_3_1;
            err = c_envOPget_record_(e, &T_3_1);
            if (err != ERR_ok) goto ex_0;
            gen.num = T_3_1.num;
            }
            }
        else {
        CLUREF T_2_3;
        CLUREF T_2_4;
        err = c_envOPget_oneof_(e, &T_2_3);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(gen, T_2_3, &T_2_4);
        if (err != ERR_ok) goto ex_0;
        if (T_2_4.num == true) {

  LINE(92);
            {
            CLUREF T_3_1;
            err = c_envOPget_variant_(e, &T_3_1);
            if (err != ERR_ok) goto ex_0;
            gen.num = T_3_1.num;
            }
            }
        else {
        CLUREF T_2_5;
        CLUREF T_2_6;
        err = c_envOPget_variant_(e, &T_2_5);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(gen, T_2_5, &T_2_6);
        if (err != ERR_ok) goto ex_0;
        if (T_2_6.num == true) {

  LINE(94);
            {
            CLUREF T_3_1;
            err = c_envOPget_oneof_(e, &T_3_1);
            if (err != ERR_ok) goto ex_0;
            gen.num = T_3_1.num;
            }
            }
        else {

  LINE(95);
            {
            CLUREF T_3_1;
            err = c_envOPget_struct_(e, &T_3_1);
            if (err != ERR_ok) goto ex_0;
            gen.num = T_3_1.num;
            }
            }}}}/* end if */

  LINE(96);
        {
            {CLUREF T_2_1;
            RecordAlloc(2, T_2_1);
            T_2_1.vec->data[0]  = gen.num;
            T_2_1.vec->data[1]  = fparms.num;
            dut1.num = T_2_1.num;
            }
            }

  LINE(98);
        {
            {CLUREF T_2_1;
            CLUREF T_2_2;
            CellAlloc(7, dut1.num, T_2_1);
            err = c_envOPget_type(e, T_2_1, &T_2_2);
            if (err != ERR_ok) goto ex_0;
            t2.num = T_2_2.num;
            }
            }

  LINE(99);
        {
            {CLUREF T_2_1;
            sequenceOPnew2(CLU_1, &T_2_1);
            T_2_1.vec->data[0] = t1.num;
            args.num = T_2_1.num;
            }
            }

  LINE(100);
        {
            {CLUREF T_2_1;
            sequenceOPnew2(CLU_1, &T_2_1);
            T_2_1.vec->data[0] = t2.num;
            vals.num = T_2_1.num;
            }
            }

  LINE(101);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CLUREF T_2_3;
        CLUREF T_2_4;
        CLUREF T_2_5;
        T_2_3.num = ((n.str->size != STR_r2s.str->size)? false :
            !(bcmp(n.str->data, STR_r2s.str->data, n.str->size)));
        T_2_2.num = T_2_3.num;
        if (!T_2_3.num) {
            T_2_4.num = ((n.str->size != STR_v2o.str->size)? false :
                !(bcmp(n.str->data, STR_v2o.str->data, n.str->size)));
            T_2_2.num = T_2_4.num;
        }
        T_2_1.num = T_2_2.num;
        if (!T_2_2.num) {
            T_2_5.num = ((n.str->size != STR_create.str->size)? false :
                !(bcmp(n.str->data, STR_create.str->data, n.str->size)));
            T_2_1.num = T_2_5.num;
        }
        if (T_2_1.num == true) {

  LINE(102);
            {
            CLUREF T_3_1;
            T_3_1 = args;
            args.num = vals.num;
            vals.num = T_3_1.num;
            }
            }
        else {
        CLUREF T_2_6;
        CLUREF T_2_7;
        CLUREF T_2_8;
        T_2_7.num = ((n.str->size != STR_r_137gets_137s.str->size)? false :
            !(bcmp(n.str->data, STR_r_137gets_137s.str->data, n.str->size)));
        T_2_6.num = T_2_7.num;
        if (!T_2_7.num) {
            T_2_8.num = ((n.str->size != STR_v_137gets_137o.str->size)? false :
                !(bcmp(n.str->data, STR_v_137gets_137o.str->data, n.str->size)));
            T_2_6.num = T_2_8.num;
        }
        if (T_2_6.num == true) {

  LINE(104);
            {
            CLUREF T_3_1;
            err = sequenceOPconcat(args, vals, &T_3_1);
            if (err != ERR_ok) goto ex_0;
            args.num = T_3_1.num;
            }

  LINE(105);
            {
            CLUREF T_3_1;
            sequenceOPnew2(CLU_0, &T_3_1);
            vals.num = T_3_1.num;
            }
            }
            }}/* end if */

  LINE(107);
        {
            {CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            RecordAlloc(4, T_2_1);
            err = c_envOPget_proc_(e, &T_2_2);
            if (err != ERR_ok) goto ex_0;
            T_2_1.vec->data[1]  = T_2_2.num;
            T_2_1.vec->data[0]  = args.num;
            T_2_1.vec->data[3]  = vals.num;
            err = sequenceOPnew(&T_2_3);
            if (err != ERR_ok) goto ex_0;
            T_2_1.vec->data[2]  = T_2_3.num;
            apt.num = T_2_1.num;
            }
            }

  LINE(111);
        {
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CellAlloc(2, apt.num, T_2_1);
        err = c_envOPget_type(e, T_2_1, &T_2_2);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_2.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(113);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    sequenceOPnew2(CLU_3, &T_1_1);
    T_1_1.vec->data[0] = STR__047.num;
    err = get_clusterop_print(cop, &T_1_2);
    if (err != ERR_ok) goto ex_0;
    T_1_1.vec->data[1] = T_1_2.num;
    T_1_1.vec->data[2] = STR__047_040does_040not_040exist_0402.num;
    err = c_envOPerr(e, T_1_1);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(114);
    {
    {
    CLUREF T_1_1;
    err = c_envOPget_unknown_type(e, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE c_select_op ****/


extern errcode sequenceOPempty();
CLUREF STR__047_040not_040a_040legal_040selector;
static int c_sel_type_own_init = 0;

/**** BEGIN PROCEDURE c_sel_type ****/

errcode c_sel_type(e, sel, specs, ret_1)
CLUREF e;
CLUREF sel;
CLUREF specs;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF spec;
        if (c_sel_type_own_init == 0) {
        stringOPcons("\'", CLU_1, CLU_1, &STR__047);
        stringOPcons("\' not a legal selector", CLU_1, CLU_22, &STR__047_040not_040a_040legal_040selector);
        c_sel_type_own_init = 1;
    }
    enter_proc(117);

  LINE(118);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
        T_1_2.num = specs.vec->size; 
        T_1_3 = specs;
        for (T_1_1.num = 1; T_1_1.num <= T_1_2.num; T_1_1.num++) {
            spec.num = T_1_3.vec->data[T_1_1.num - 1];

  LINE(119);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            T_2_1.num = spec.vec->data[0];
            T_2_2.num = ((sel.str->size != T_2_1.str->size)? false :
                !(bcmp(sel.str->data, T_2_1.str->data, sel.str->size)));
            if (T_2_2.num == true) {

  LINE(120);
                {
                {
                CLUREF T_3_1;
                T_3_1.num = spec.vec->data[1];
                ret_1->num = T_3_1.num;
                }
                {signal (ERR_ok);}}
                }
                }/* end if */
        }
    }
    end_inline_for_1:;

  LINE(122);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    err = sequenceOPempty(specs, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    T_1_2.num = T_1_1.num ^ 1;
    if (T_1_2.num == true) {

  LINE(123);
        {
        CLUREF T_2_1;
        sequenceOPnew2(CLU_3, &T_2_1);
        T_2_1.vec->data[0] = STR__047.num;
        T_2_1.vec->data[1] = sel.num;
        T_2_1.vec->data[2] = STR__047_040not_040a_040legal_040selector.num;
        err = c_envOPerr(e, T_2_1);
        if (err != ERR_ok) goto ex_0;
        }
        }
        }/* end if */

  LINE(124);
    {
    {
    CLUREF T_1_1;
    err = c_envOPget_unknown_type(e, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE c_sel_type ****/


extern errcode idnOPget_kind();
extern errcode sequenceOPsimilar();
extern errcode c_envOPbuilding_specs();
extern struct REQS *sequence_of_t_reqs;
extern struct OPS *expr_ops;
extern OWN_req sequence_ownreqs;
extern struct OPS *sequence_ops;
struct OPS *sequence_of_expr_table;
struct OPS *sequence_of_expr_ops;
struct OPS *sequence_of_expr_ops;
OWNPTR sequence_of_expr_owns;
CLUREF STR__047_040does_040not_040exist_0403;
static int c_idn_op_own_init = 0;

/**** BEGIN PROCEDURE c_idn_op ****/

errcode c_idn_op(e, i, cop, ret_1)
CLUREF e;
CLUREF i;
CLUREF cop;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF k;
    CLUREF op;
    CLUREF parms;
    CLUREF spec;
        if (c_idn_op_own_init == 0) {
        add_parm_info_type(0, expr_ops, sequence_of_t_reqs);
        find_type_instance(sequence_ops, 1, &sequence_ownreqs, &(sequence_of_expr_ops));
        stringOPcons("\'", CLU_1, CLU_1, &STR__047);
        stringOPcons("\' does not exist 3", CLU_1, CLU_18, &STR__047_040does_040not_040exist_0403);
        c_idn_op_own_init = 1;
    }
    enter_proc(127);

  LINE(128);
    {
    CLUREF T_1_1;
    err = idnOPget_kind(i, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    switch (T_1_1.cell->tag) {
    case 6: 
    case 5: 
         {CLUREF T_1_2;
        T_1_2.num = T_1_1.cell->value;
        k.num = T_1_2.num;

  LINE(130);
            {
                {CLUREF T_2_1;
                T_2_1.num = cop.vec->data[0];
                op.num = T_2_1.num;
                }
                }

  LINE(131);
            {
                {CLUREF T_2_1;
                T_2_1.num = cop.vec->data[1];
                parms.num = T_2_1.num;
                }
                }

  LINE(132);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
                T_2_2.num = k.vec->size; 
                T_2_3 = k;
                for (T_2_1.num = 1; T_2_1.num <= T_2_2.num; T_2_1.num++) {
                    spec.num = T_2_3.vec->data[T_2_1.num - 1];

  LINE(133);
                    {
                    CLUREF T_3_1;
                    CLUREF T_3_2;
                    CLUREF T_3_3;
                    CLUREF T_3_4;
                    CLUREF T_3_5;
                    T_3_2.num = spec.vec->data[0];
                    T_3_3.num = ((op.str->size != T_3_2.str->size)? false :
                        !(bcmp(op.str->data, T_3_2.str->data, op.str->size)));
                    T_3_1.num = T_3_3.num;
                    if (T_3_3.num) {
                        T_3_4.num = spec.vec->data[1];
                        generic_CLU_proc.type_owns = sequence_of_expr_ops->type_owns;
                        generic_CLU_proc.proc = sequenceOPsimilar;
                        CUR_PROC_VAR.proc = &generic_CLU_proc;
                        err = sequenceOPsimilar(parms, T_3_4, &T_3_5);
                        if (err != ERR_ok) goto ex_0;
                        T_3_1.num = T_3_5.num;
                    }
                    if (T_3_1.num == true) {

  LINE(134);
                        {
                        {
                        CLUREF T_4_1;
                        T_4_1.num = spec.vec->data[2];
                        ret_1->num = T_4_1.num;
                        }
                        {signal (ERR_ok);}}
                        }
                        }/* end if */
                }
            }
            end_inline_for_1:;

  LINE(136);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            err = c_envOPbuilding_specs(e, &T_2_1);
            if (err != ERR_ok) goto ex_0;
            T_2_2.num = T_2_1.num ^ 1;
            if (T_2_2.num == true) {

  LINE(137);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                sequenceOPnew2(CLU_3, &T_3_1);
                T_3_1.vec->data[0] = STR__047.num;
                err = get_clusterop_print(cop, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                T_3_1.vec->data[1] = T_3_2.num;
                T_3_1.vec->data[2] = STR__047_040does_040not_040exist_0403.num;
                err = c_envOPerr(e, T_3_1);
                if (err != ERR_ok) goto ex_0;
                }
                }
                }/* end if */
            break;
            }
    case 9: 
    case 4: 
         {

  LINE(141);
            {
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            CellAlloc(2, cop.num, T_2_1);
            CellAlloc(6, T_2_1.num, T_2_2);
            err = c_envOPget_type(e, T_2_2, &T_2_3);
            if (err != ERR_ok) goto ex_0;
            ret_1->num = T_2_3.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {
    }
    }
    }

  LINE(144);
    {
    {
    CLUREF T_1_1;
    err = c_envOPget_unknown_type(e, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE c_idn_op ****/


extern errcode c_envOPget_iter_();
extern errcode oneofOPvalue_25();
extern errcode exprOPget_abs();
extern errcode sequenceOPaddl();
extern errcode recordOPget_4();
extern errcode c_envOPget_int_type();
CLUREF STR__047_040does_040not_040exist_0404;
static int c_apply_op_own_init = 0;

/**** BEGIN PROCEDURE c_apply_op ****/

errcode c_apply_op(e, at, cop, ret_1)
CLUREF e;
CLUREF at;
CLUREF cop;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF info;
    CLUREF specs;
    CLUREF inf;
    CLUREF n;
    CLUREF x;
    CLUREF op;
    CLUREF pparms;
    CLUREF ainfo;
    CLUREF t;
    CLUREF ok;
    CLUREF pta;
    CLUREF pt;
        if (c_apply_op_own_init == 0) {
        stringOPcons("debug_print", CLU_1, CLU_11, &STR_debug_137print);
        stringOPcons("bad parameters to \'", CLU_1, CLU_19, &STR_bad_040parameters_040to_040_047);
        stringOPcons("\'", CLU_1, CLU_1, &STR__047);
        stringOPcons("create", CLU_1, CLU_6, &STR_create);
        stringOPcons("\' does not exist 4", CLU_1, CLU_18, &STR__047_040does_040not_040exist_0404);
        c_apply_op_own_init = 1;
    }
    enter_proc(147);

  LINE(149);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        T_1_1.num = at.vec->data[1];
        err = c_get_duspecs(e, T_1_1, &T_1_2);
        if (err != ERR_ok) goto ex_0;
        specs.num = T_1_2.num;
        }
        }

  LINE(150);
    {
    switch (specs.cell->tag) {
    case 2: 
         {CLUREF T_1_1;
        T_1_1.num = specs.cell->value;
        inf.num = T_1_1.num;

  LINE(152);
            {
            info.num = inf.num;
            }
            break;
            }
    case 4: 
         {

  LINE(154);
            {
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            CellAlloc(2, cop.num, T_2_1);
            CellAlloc(6, T_2_1.num, T_2_2);
            err = c_envOPget_type(e, T_2_2, &T_2_3);
            if (err != ERR_ok) goto ex_0;
            ret_1->num = T_2_3.num;
            }
            {signal (ERR_ok);}}
            break;
            }
    default: {

  LINE(156);
        {
        {
        CLUREF T_2_1;
        err = c_envOPget_unknown_type(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
    }
    }
    }

  LINE(158);
    {
        {CLUREF T_1_1;
        T_1_1.num = cop.vec->data[0];
        n.num = T_1_1.num;
        }
        }

  LINE(159);
    {
    CLUREF T_1_1;
    T_1_1.num = ((n.str->size != STR_debug_137print.str->size)? false :
        !(bcmp(n.str->data, STR_debug_137print.str->data, n.str->size)));
    if (T_1_1.num == true) {
        {
        {
        CLUREF T_2_1;
        err = c_envOPget_unknown_type(e, &T_2_1);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(160);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        CLUREF T_1_3;
        CLUREF T_1_4;
        T_1_1.num = cop.vec->data[2];
        CellAlloc(25, T_1_1.num, T_1_2);
        err = c_envOPget_type_type(e, &T_1_3);
        if (err != ERR_ok) goto ex_0;
        err = exprOPcreate(T_1_2, T_1_3, &T_1_4);
        if (err != ERR_ok) goto ex_0;
        x.num = T_1_4.num;
        }
        }

  LINE(161);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    CLUREF T_1_4;
        T_1_1.num = info.vec->data[0];
        T_1_3.num = T_1_1.vec->size; 
        T_1_4 = T_1_1;
        for (T_1_2.num = 1; T_1_2.num <= T_1_3.num; T_1_2.num++) {
            op.num = T_1_4.vec->data[T_1_2.num - 1];

  LINE(162);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            T_2_1.num = op.vec->data[1];
            T_2_2.num = ((n.str->size != T_2_1.str->size)? false :
                !(bcmp(n.str->data, T_2_1.str->data, n.str->size)));
            if (T_2_2.num == true) {

  LINE(163);
                {
                    {CLUREF T_3_1;
                    T_3_1.num = cop.vec->data[1];
                    pparms.num = T_3_1.num;
                    }
                    }

  LINE(164);
                {
                    {CLUREF T_3_1;
                    T_3_1.num = op.vec->data[0];
                    ainfo.num = T_3_1.num;
                    }
                    }

  LINE(165);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                T_3_1.num = ainfo.vec->data[0];
                err = c_parms(e, pparms, T_3_1, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                if (T_3_2.num == true) {

  LINE(166);
                    {
                    {
                    CLUREF T_4_1;
                    CLUREF T_4_2;
                    CLUREF T_4_3;
                    err = sequenceOPe2s(x, &T_4_1);
                    if (err != ERR_ok) goto ex_0;
                    T_4_2.num = info.vec->data[1];
                    err = subst_2_parms(e, T_4_1, T_4_2, pparms, ainfo, &T_4_3);
                    if (err != ERR_ok) goto ex_0;
                    ret_1->num = T_4_3.num;
                    }
                    {signal (ERR_ok);}}
                    }
                    }/* end if */

  LINE(171);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                sequenceOPnew2(CLU_3, &T_3_1);
                T_3_1.vec->data[0] = STR_bad_040parameters_040to_040_047.num;
                err = get_clusterop_print(cop, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                T_3_1.vec->data[1] = T_3_2.num;
                T_3_1.vec->data[2] = STR__047.num;
                err = c_envOPerr(e, T_3_1);
                if (err != ERR_ok) goto ex_0;
                }

  LINE(173);
                {
                {
                CLUREF T_3_1;
                err = c_envOPget_unknown_type(e, &T_3_1);
                if (err != ERR_ok) goto ex_0;
                ret_1->num = T_3_1.num;
                }
                {signal (ERR_ok);}}
                }
                }/* end if */
        }
    }
    end_inline_for_1:;

  LINE(176);
    {
    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;
    CLUREF T_1_9;
    CLUREF T_1_10;
    CLUREF T_1_11;
    T_1_3.num = ((n.str->size != STR_create.str->size)? false :
        !(bcmp(n.str->data, STR_create.str->data, n.str->size)));
    T_1_2.num = T_1_3.num;
    if (T_1_3.num) {
        T_1_4.num = at.vec->data[1];
        err = c_envOPget_proc_(e, &T_1_5);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(T_1_4, T_1_5, &T_1_6);
        if (err != ERR_ok) goto ex_0;
        T_1_7.num = T_1_6.num ^ 1;
        T_1_2.num = T_1_7.num;
    }
    T_1_1.num = T_1_2.num;
    if (T_1_2.num) {
        T_1_8.num = at.vec->data[1];
        err = c_envOPget_iter_(e, &T_1_9);
        if (err != ERR_ok) goto ex_0;
        err = duOPequal(T_1_8, T_1_9, &T_1_10);
        if (err != ERR_ok) goto ex_0;
        T_1_11.num = T_1_10.num ^ 1;
        T_1_1.num = T_1_11.num;
    }
    if (T_1_1.num == true) {

  LINE(178);
        {
            {CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            T_2_1.num = cop.vec->data[1];
            T_2_2.num = T_2_1.vec->size;
            T_2_3.num = (T_2_2.num == 1)? true : false;
            ok.num = T_2_3.num;
            }
            }

  LINE(179);
        {
        if (ok.num == true) {

  LINE(180);
            {
            CLUREF T_4_1;
            CLUREF T_4_2;
            CLUREF T_4_3;
            CLUREF T_4_4;
            T_4_1.num = cop.vec->data[1];
            err = sequenceOPbottom(T_4_1, &T_4_2);
            if (err != ERR_ok) goto ex_1;
            err = exprOPget_abs(T_4_2, &T_4_3);
            if (err != ERR_ok) goto ex_1;
            if (T_4_3.cell->tag != 25) {err = ERR_wrong_tag; goto ex_1;}
            T_4_4.num = T_4_3.cell->value;
            t.num = T_4_4.num;
            }
            }
            }/* end if */
            goto end_1;
            ex_1:
                if ((err == ERR_wrong_tag)) {

  LINE(181);
                    {
                    ok.tf = false;
                    }
                }
                else {
                    goto ex_0;
                }
            end_1:;

  LINE(182);
        {
        CLUREF T_2_1;
        T_2_1.num = ok.num ^ 1;
        if (T_2_1.num == true) {

  LINE(183);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            sequenceOPnew2(CLU_3, &T_3_1);
            T_3_1.vec->data[0] = STR_bad_040parameters_040to_040_047.num;
            err = get_clusterop_print(cop, &T_3_2);
            if (err != ERR_ok) goto ex_0;
            T_3_1.vec->data[1] = T_3_2.num;
            T_3_1.vec->data[2] = STR__047.num;
            err = c_envOPerr(e, T_3_1);
            if (err != ERR_ok) goto ex_0;
            }

  LINE(185);
            {
            {
            CLUREF T_3_1;
            err = c_envOPget_unknown_type(e, &T_3_1);
            if (err != ERR_ok) goto ex_0;
            ret_1->num = T_3_1.num;
            }
            {signal (ERR_ok);}}
            }
            }/* end if */

  LINE(187);
        {
            {CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
            CLUREF T_2_4;
            CLUREF T_2_5;
            CLUREF T_2_6;
            RecordAlloc(4, T_2_1);
            err = c_envOPget_proc_(e, &T_2_2);
            if (err != ERR_ok) goto ex_0;
            T_2_1.vec->data[1]  = T_2_2.num;
            T_2_3.num = at.vec->data[0];
            err = sequenceOPaddl(T_2_3, t, &T_2_4);
            if (err != ERR_ok) goto ex_0;
            T_2_1.vec->data[0]  = T_2_4.num;
            T_2_5.num = at.vec->data[3];
            T_2_1.vec->data[3]  = T_2_5.num;
            T_2_6.num = at.vec->data[2];
            T_2_1.vec->data[2]  = T_2_6.num;
            pta.num = T_2_1.num;
            }
            }

  LINE(191);
        {
            {CLUREF T_2_1;
            CLUREF T_2_2;
            CellAlloc(2, pta.num, T_2_1);
            err = c_envOPget_type(e, T_2_1, &T_2_2);
            if (err != ERR_ok) goto ex_0;
            pt.num = T_2_2.num;
            }
            }

  LINE(192);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CLUREF T_2_3;
        CLUREF T_2_4;
        CLUREF T_2_5;
        CLUREF T_2_6;
        CLUREF T_2_7;
        RecordAlloc(4, T_2_1);
        err = c_envOPget_proc_(e, &T_2_2);
        if (err != ERR_ok) goto ex_0;
        T_2_1.vec->data[1]  = T_2_2.num;
        sequenceOPnew2(CLU_2, &T_2_3);
        err = c_envOPget_int_type(e, &T_2_4);
        if (err != ERR_ok) goto ex_0;
        T_2_3.vec->data[0] = T_2_4.num;
        T_2_3.vec->data[1] = pt.num;
        T_2_1.vec->data[0]  = T_2_3.num;
        sequenceOPnew2(CLU_1, &T_2_5);
        T_2_6.num = cop.vec->data[2];
        T_2_5.vec->data[0] = T_2_6.num;
        T_2_1.vec->data[3]  = T_2_5.num;
        sequenceOPnew2(CLU_0, &T_2_7);
        T_2_1.vec->data[2]  = T_2_7.num;
        pta.num = T_2_1.num;
        }

  LINE(196);
        {
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CellAlloc(2, pta.num, T_2_1);
        err = c_envOPget_type(e, T_2_1, &T_2_2);
        if (err != ERR_ok) goto ex_0;
        ret_1->num = T_2_2.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(198);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    sequenceOPnew2(CLU_3, &T_1_1);
    T_1_1.vec->data[0] = STR__047.num;
    err = get_clusterop_print(cop, &T_1_2);
    if (err != ERR_ok) goto ex_0;
    T_1_1.vec->data[1] = T_1_2.num;
    T_1_1.vec->data[2] = STR__047_040does_040not_040exist_0404.num;
    err = c_envOPerr(e, T_1_1);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(199);
    {
    {
    CLUREF T_1_1;
    err = c_envOPget_unknown_type(e, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    ret_1->num = T_1_1.num;
    }
    {signal (ERR_ok);}}
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: elist[0].str = no_return_values_STRING;
        {signal(ERR_failure);}
    }

/**** END PROCEDURE c_apply_op ****/


extern errcode sequenceOPindexes();
extern errcode idnOPequal();
extern errcode sequenceOPfetch();
extern errcode c_restrictions();

/**** BEGIN PROCEDURE c_requires ****/

errcode c_requires(e, vals, parms, reqs)
CLUREF e;
CLUREF vals;
CLUREF parms;
CLUREF reqs;
    {
    errcode err;
    errcode ecode2;
    CLUREF req;
    CLUREF p;
    CLUREF i;
    enter_proc(202);

  LINE(203);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
        T_1_2.num = reqs.vec->size; 
        T_1_3 = reqs;
        for (T_1_1.num = 1; T_1_1.num <= T_1_2.num; T_1_1.num++) {
            req.num = T_1_3.vec->data[T_1_1.num - 1];

  LINE(204);
            {
                {CLUREF T_2_1;
                T_2_1.num = req.vec->data[1];
                p.num = T_2_1.num;
                }
                }

  LINE(205);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
                T_2_2.num = parms.vec->size; 
                for (T_2_1.num = 1; T_2_1.num <= T_2_2.num; T_2_1.num++) {
                    i.num = T_2_1.num;

  LINE(206);
                    {
                    CLUREF T_3_1;
                    CLUREF T_3_2;
                    if (i.num < 1 || i.num > parms.vec->size ) {
                        err = ERR_bounds;
                        goto ex_0;}
                    T_3_1.num = parms.vec->data[i.num - 1];
                    err = idnOPequal(p, T_3_1, &T_3_2);
                    if (err != ERR_ok) goto ex_0;
                    if (T_3_2.num == true) {

  LINE(207);
                        {
                        CLUREF T_4_1;
                        CLUREF T_4_2;
                        CLUREF T_4_3;
                        if (i.num < 1 || i.num > vals.vec->size ) {
                            err = ERR_bounds;
                            goto ex_0;}
                        T_4_1.num = vals.vec->data[i.num - 1];
                        T_4_2.num = req.vec->data[0];
                        err = c_restrictions(e, T_4_1, vals, parms, T_4_2, &T_4_3);
                        if (err != ERR_ok) goto ex_0;
                        }
                        }
                        }/* end if */
                }
            }
            end_inline_for_2:;
        }
    }
    end_inline_for_1:;
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE c_requires ****/



/**** BEGIN PROCEDURE c_select_requires ****/

errcode c_select_requires(e, specs, reqs)
CLUREF e;
CLUREF specs;
CLUREF reqs;
    {
    errcode err;
    errcode ecode2;
    CLUREF req;
    CLUREF spec;
    CLUREF x;
    enter_proc(212);

  LINE(213);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
        T_1_2.num = reqs.vec->size; 
        T_1_3 = reqs;
        for (T_1_1.num = 1; T_1_1.num <= T_1_2.num; T_1_1.num++) {
            req.num = T_1_3.vec->data[T_1_1.num - 1];

  LINE(214);
            {
            CLUREF T_2_1;
            CLUREF T_2_2;
            CLUREF T_2_3;
                T_2_2.num = specs.vec->size; 
                T_2_3 = specs;
                for (T_2_1.num = 1; T_2_1.num <= T_2_2.num; T_2_1.num++) {
                    spec.num = T_2_3.vec->data[T_2_1.num - 1];

  LINE(215);
                    {
                        {CLUREF T_3_1;
                        CLUREF T_3_2;
                        CLUREF T_3_3;
                        CLUREF T_3_4;
                        T_3_1.num = spec.vec->data[1];
                        CellAlloc(25, T_3_1.num, T_3_2);
                        err = c_envOPget_type_type(e, &T_3_3);
                        if (err != ERR_ok) goto ex_0;
                        err = exprOPcreate(T_3_2, T_3_3, &T_3_4);
                        if (err != ERR_ok) goto ex_0;
                        x.num = T_3_4.num;
                        }
                        }

  LINE(217);
                    {
                    CLUREF T_3_1;
                    CLUREF T_3_2;
                    CLUREF T_3_3;
                    T_3_1.num = req.vec->data[0];
                    err = sequenceOPempty(T_3_1, &T_3_2);
                    if (err != ERR_ok) goto ex_0;
                    T_3_3.num = T_3_2.num ^ 1;
                    if (T_3_3.num == true) {

  LINE(218);
                        {
                        CLUREF T_4_1;
                        CLUREF T_4_2;
                        CLUREF T_4_3;
                        CLUREF T_4_4;
                        CLUREF T_4_5;
                        err = sequenceOPe2s(x, &T_4_1);
                        if (err != ERR_ok) goto ex_0;
                        T_4_2.num = req.vec->data[1];
                        err = sequenceOPe2s(T_4_2, &T_4_3);
                        if (err != ERR_ok) goto ex_0;
                        T_4_4.num = req.vec->data[0];
                        err = c_restrictions(e, x, T_4_1, T_4_3, T_4_4, &T_4_5);
                        if (err != ERR_ok) goto ex_0;
                        }
                        }
                        }/* end if */
                }
            }
            end_inline_for_2:;
        }
    }
    end_inline_for_1:;
    goto end_0;
    ex_0:
        {
            if (err == ERR_failure) {signal(ERR_failure);}
            elist[0] = _pclu_erstr(err);
            {signal(ERR_failure);}
        }
    end_0: {signal(ERR_ok);}
    }

/**** END PROCEDURE c_select_requires ****/


extern errcode c_envOPbegin_scope();
extern errcode c_envOPpush_vals();
extern errcode b_type();
extern errcode c_envOPend_scope();

/**** BEGIN PROCEDURE subst_parms ****/

errcode subst_parms(e, vals, forms, t, ret_1)
CLUREF e;
CLUREF vals;
CLUREF forms;
CLUREF t;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    enter_proc(225);

  LINE(227);
    {
    CLUREF T_1_1;
    err = sequenceOPempty(vals, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    if (T_1_1.num == true) {
        {
        {
        ret_1->num = t.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(228);
    {
    err = c_envOPbegin_scope(e);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(229);
    {
    err = c_envOPpush_vals(e, forms, vals);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(230);
    {
    CLUREF T_1_1;
    err = b_type(e, t, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    t.num = T_1_1.num;
    }

  LINE(231);
    {
    err = c_envOPend_scope(e);
    if (err != ERR_ok) goto ex_0;
    }

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

/**** END PROCEDURE subst_parms ****/



/**** BEGIN PROCEDURE subst_2_parms ****/

errcode subst_2_parms(e, vals1, parms1, vals2, info, ret_1)
CLUREF e;
CLUREF vals1;
CLUREF parms1;
CLUREF vals2;
CLUREF info;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF t;
    enter_proc(235);

  LINE(237);
    {
        {CLUREF T_1_1;
        T_1_1.num = info.vec->data[1];
        t.num = T_1_1.num;
        }
        }

  LINE(238);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    err = sequenceOPempty(vals1, &T_1_2);
    if (err != ERR_ok) goto ex_0;
    T_1_1.num = T_1_2.num;
    if (T_1_2.num) {
        err = sequenceOPempty(vals2, &T_1_3);
        if (err != ERR_ok) goto ex_0;
        T_1_1.num = T_1_3.num;
    }
    if (T_1_1.num == true) {

  LINE(239);
        {
        {
        ret_1->num = t.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(240);
    {
    err = c_envOPbegin_scope(e);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(241);
    {
    err = c_envOPpush_vals(e, parms1, vals1);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(242);
    {
    CLUREF T_1_1;
    T_1_1.num = info.vec->data[0];
    err = c_envOPpush_vals(e, T_1_1, vals2);
    if (err != ERR_ok) goto ex_0;
    }

  LINE(243);
    {
    CLUREF T_1_1;
    err = b_type(e, t, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    t.num = T_1_1.num;
    }

  LINE(244);
    {
    err = c_envOPend_scope(e);
    if (err != ERR_ok) goto ex_0;
    }

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

/**** END PROCEDURE subst_2_parms ****/


extern errcode subst_parms();
extern errcode c_clusterop();
extern errcode typespecOPmismatch();
CLUREF STR_type_137of_050;
CLUREF STR__051_040does_040not_040match_040restriction;
static int c_restrictions_own_init = 0;

/**** BEGIN PROCEDURE c_restrictions ****/

errcode c_restrictions(e, x, vals, forms, specs, ret_1)
CLUREF e;
CLUREF x;
CLUREF vals;
CLUREF forms;
CLUREF specs;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
    CLUREF t;
    CLUREF xa;
    CLUREF ok;
    CLUREF spec;
    CLUREF opt;
    CLUREF cop;
    CLUREF copt;
        if (c_restrictions_own_init == 0) {
        stringOPcons("type_of(", CLU_1, CLU_8, &STR_type_137of_050);
        stringOPcons(") does not match restriction", CLU_1, CLU_28, &STR__051_040does_040not_040match_040restriction);
        c_restrictions_own_init = 1;
    }
    enter_proc(248);

  LINE(251);
    {
    CLUREF T_1_1;
    err = exprOPget_abs(x, &T_1_1);
    if (err != ERR_ok) goto ex_0;
    switch (T_1_1.cell->tag) {
    case 25: 
         {CLUREF T_1_2;
        T_1_2.num = T_1_1.cell->value;
        xa.num = T_1_2.num;

  LINE(253);
            {
            t.num = xa.num;
            }
            break;
            }
    case 4: 
         {

  LINE(255);
            {
            {
            ret_1->tf = false;
            }
            {signal (ERR_ok);}}
            break;
            }
    case 3: 
         {

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

  LINE(259);
        {
        {
        ret_1->tf = false;
        }
        {signal (ERR_ok);}}
    }
    }
    }

  LINE(261);
    {
        {ok.tf = true;
        }
        }

  LINE(262);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
        T_1_2.num = specs.vec->size; 
        T_1_3 = specs;
        for (T_1_1.num = 1; T_1_1.num <= T_1_2.num; T_1_1.num++) {
            spec.num = T_1_3.vec->data[T_1_1.num - 1];

  LINE(263);
            {
                {CLUREF T_2_1;
                CLUREF T_2_2;
                T_2_1.num = spec.vec->data[2];
                err = subst_parms(e, vals, forms, T_2_1, &T_2_2);
                if (err != ERR_ok) goto ex_0;
                opt.num = T_2_2.num;
                }
                }

  LINE(264);
            {
                {CLUREF T_2_1;
                CLUREF T_2_2;
                CLUREF T_2_3;
                RecordAlloc(3, T_2_1);
                T_2_1.vec->data[2]  = t.num;
                T_2_2.num = spec.vec->data[0];
                T_2_1.vec->data[0]  = T_2_2.num;
                T_2_3.num = spec.vec->data[1];
                T_2_1.vec->data[1]  = T_2_3.num;
                cop.num = T_2_1.num;
                }
                }

  LINE(267);
            {
                {CLUREF T_2_1;
                err = c_clusterop(e, cop, &T_2_1);
                if (err != ERR_ok) goto ex_0;
                copt.num = T_2_1.num;
                }
                }

  LINE(268);
            {
            CLUREF T_2_1;
            err = typespecOPmismatch(opt, copt, &T_2_1);
            if (err != ERR_ok) goto ex_0;
            if (T_2_1.num == true) {

  LINE(269);
                {
                ok.tf = false;
                }

  LINE(270);
                {
                CLUREF T_3_1;
                CLUREF T_3_2;
                sequenceOPnew2(CLU_3, &T_3_1);
                T_3_1.vec->data[0] = STR_type_137of_050.num;
                err = get_clusterop_print(cop, &T_3_2);
                if (err != ERR_ok) goto ex_0;
                T_3_1.vec->data[1] = T_3_2.num;
                T_3_1.vec->data[2] = STR__051_040does_040not_040match_040restriction.num;
                err = c_envOPerr(e, T_3_1);
                if (err != ERR_ok) goto ex_0;
                }
                }
                }/* end if */
        }
    }
    end_inline_for_1:;

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

/**** END PROCEDURE c_restrictions ****/

