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

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


/**** BEGIN CLUSTER du ****/

extern errcode arrayOPpredict();
extern errcode arrayOPaddh();
extern errcode oneofOPmake_4();
extern errcode oneofOPmake_1();
extern errcode arrayOPsize();
extern errcode recordOPget_2();
extern errcode arrayOPfetch();
extern errcode recordOPget_1();
extern errcode arrayOPstore();
extern errcode oneofOPis_2();
extern errcode p_envOPadd_token();
extern errcode recordOPget_12();
extern errcode cmpvarOPstuffs();
extern errcode oneofOPmake_38();
extern errcode intOPgt();
extern errcode oneofOPis_4();
extern errcode arrayOPhigh();
extern errcode intOPsub();
extern errcode intOPfrom_to();
extern errcode intOPadd();
extern errcode recordOPequal();
extern errcode stringOPequal();
extern errcode recordOP_gcd();
extern struct OPS *int_ops;
extern struct OPS *string_ops;
struct OPS  *record_index_name_ops;
static int du_own_init = 0;
OWN_req du_ownreqs = {0,0};
CLUREF duOPstore;
CLUREF duOPfixups;
CLUREF duOPcache;
CLUREF duOPkeepmax;
errcode du_own_init_proc()
{
    errcode err;
    enter_own_init_proc();
        if (du_own_init == 0) {
        add_selector_info("index", 0, int_ops); 
        add_selector_info("name", 1, string_ops); 
        find_selector_ops("record", 2, &(record_index_name_ops));
        du_own_init = 1;
        {
            {CLUREF T_0_1;
            CLUREF T_0_2;
            T_0_1.num = 100;
            err = arrayOPpredict(CLU_1, T_0_1, &T_0_2);
            if (err != ERR_ok) goto ex_0;
            duOPstore.num = T_0_2.num;
            }
            }
        {
            {CLUREF T_0_3;
            CLUREF T_0_4;
            T_0_3.num = 100;
            err = arrayOPpredict(CLU_1, T_0_3, &T_0_4);
            if (err != ERR_ok) goto ex_0;
            duOPfixups.num = T_0_4.num;
            }
            }
        {
            {CLUREF T_0_5;
            CLUREF T_0_6;
            T_0_5.num = 100;
            err = arrayOPpredict(CLU_1, T_0_5, &T_0_6);
            if (err != ERR_ok) goto ex_0;
            duOPcache.num = T_0_6.num;
            }
            }
        {
            {duOPkeepmax.num = 0;
            }
            }
        {signal(ERR_ok);}
    ex_0: pclu_unhandled(err); {signal(ERR_failure);}
        }
    }


/**** BEGIN PROCEDURE create ****/

errcode duOPcreate(common, ret_1)
CLUREF common;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(34);

  LINE(35);
    {
    CLUREF T_1_1;
    CellAlloc(4, nil, T_1_1);
    {
    if ((duOPstore.array->int_low + duOPstore.array->ext_size + 1) < duOPstore.array->int_size) {
        duOPstore.array->store->data[duOPstore.array->int_low + duOPstore.array->ext_size] = T_1_1.num;
        duOPstore.array->ext_size++; duOPstore.array->ext_high++;}
    else {
        err = arrayOPaddh(duOPstore, T_1_1);
        if (err != ERR_ok) goto ex_0;}
    }
    }

  LINE(36);
    {
    {
    if ((duOPfixups.array->int_low + duOPfixups.array->ext_size + 1) < duOPfixups.array->int_size) {
        duOPfixups.array->store->data[duOPfixups.array->int_low + duOPfixups.array->ext_size] = false;
        duOPfixups.array->ext_size++; duOPfixups.array->ext_high++;}
    else {
        err = arrayOPaddh(duOPfixups, CLU_0);
        if (err != ERR_ok) goto ex_0;}
    }
    }

  LINE(37);
    {
    CLUREF T_1_1;
    CellAlloc(1, nil, T_1_1);
    {
    if ((duOPcache.array->int_low + duOPcache.array->ext_size + 1) < duOPcache.array->int_size) {
        duOPcache.array->store->data[duOPcache.array->int_low + duOPcache.array->ext_size] = T_1_1.num;
        duOPcache.array->ext_size++; duOPcache.array->ext_high++;}
    else {
        err = arrayOPaddh(duOPcache, T_1_1);
        if (err != ERR_ok) goto ex_0;}
    }
    }

  LINE(38);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    RecordAlloc(2, T_1_1);
    T_1_1.vec->data[1]  = common.num;
    T_1_2.num = duOPstore.array->ext_size;
    T_1_1.vec->data[0]  = T_1_2.num;
    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 create ****/


/**** BEGIN PROCEDURE get_unique ****/

errcode duOPget_unique(d, ret_1)
CLUREF d;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(42);

  LINE(43);
    {
    {
    CLUREF T_1_1;
    T_1_1.num = d.vec->data[1];
    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 get_unique ****/


/**** BEGIN PROCEDURE get_common ****/

errcode duOPget_common(d, ret_1)
CLUREF d;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(46);

  LINE(47);
    {
    {
    CLUREF T_1_1;
    T_1_1.num = d.vec->data[1];
    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 get_common ****/


/**** BEGIN PROCEDURE read_specs ****/

errcode duOPread_specs(d, ret_1, ret_2)
CLUREF d;
CLUREF *ret_1;
CLUREF *ret_2;
    {
    errcode err;
    errcode ecode2;
    CLUREF fixdus;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(50);

  LINE(51);
    {
        {CLUREF T_1_1;
        CLUREF T_1_2;
        T_1_1.num = d.vec->data[0];
        if (T_1_1.num < duOPfixups.array->ext_low || T_1_1.num > duOPfixups.array->ext_high ) {
            err = ERR_bounds;
            goto ex_0;}
        T_1_2.num = duOPfixups.array->store->data[T_1_1.num - duOPfixups.array->ext_low + duOPfixups.array->int_low];
        fixdus.num = T_1_2.num;
        }
        }

  LINE(52);
    {
    if (fixdus.num == true) {

  LINE(53);
        {
        CLUREF T_2_1;
        T_2_1.num = d.vec->data[0];
        {
        if (T_2_1.num < duOPfixups.array->ext_low || T_2_1.num > duOPfixups.array->ext_high) {
            err = ERR_bounds;
            goto ex_0;}
        duOPfixups.array->store->data[T_2_1.num + duOPfixups.array->int_low - duOPfixups.array->ext_low] = false;
        }
        }
        }
        }/* end if */

  LINE(54);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = d.vec->data[0];
    if (T_1_1.num < duOPstore.array->ext_low || T_1_1.num > duOPstore.array->ext_high ) {
        err = ERR_bounds;
        goto ex_0;}
    T_1_2.num = duOPstore.array->store->data[T_1_1.num - duOPstore.array->ext_low + duOPstore.array->int_low];
    ret_1->num = T_1_2.num;
    }
    {
    ret_2->num = fixdus.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 read_specs ****/


/**** BEGIN PROCEDURE add_specs ****/

errcode duOPadd_specs(d, specs)
CLUREF d;
CLUREF specs;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(57);

  LINE(58);
    {
    CLUREF T_1_1;
    T_1_1.num = d.vec->data[0];
    {
    if (T_1_1.num < duOPstore.array->ext_low || T_1_1.num > duOPstore.array->ext_high) {
        err = ERR_bounds;
        goto ex_0;}
    duOPstore.array->store->data[T_1_1.num + duOPstore.array->int_low - duOPstore.array->ext_low] = specs.num;
    }
    }

  LINE(59);
    {
    CLUREF T_1_1;
    if (specs.cell->tag == 2) T_1_1.num = true; else T_1_1.num = false;
    if (T_1_1.num == true) {

  LINE(60);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CLUREF T_2_3;
        CLUREF T_2_4;
        CLUREF T_2_5;
        err = cmpvarOPstuffs(&T_2_1);
        if (err != ERR_ok) goto ex_0;
        T_2_2.num = T_2_1.vec->data[11];
        T_2_3.num = d.vec->data[1];
        CellAlloc(1, d.num, T_2_4);
        CellAlloc(38, T_2_4.num, T_2_5);
        err = p_envOPadd_token(T_2_2, T_2_3, T_2_5);
        if (err != ERR_ok) goto ex_0;
        }
        }
        }/* end if */
    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 add_specs ****/


/**** BEGIN PROCEDURE get_mspecs ****/

errcode duOPget_mspecs(d, ret_1)
CLUREF d;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(67);

  LINE(68);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = d.vec->data[0];
    if (T_1_1.num < duOPcache.array->ext_low || T_1_1.num > duOPcache.array->ext_high ) {
        err = ERR_bounds;
        goto ex_0;}
    T_1_2.num = duOPcache.array->store->data[T_1_1.num - duOPcache.array->ext_low + duOPcache.array->int_low];
    ret_1->num = T_1_2.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 get_mspecs ****/


/**** BEGIN PROCEDURE set_mspecs ****/

errcode duOPset_mspecs(d, specs)
CLUREF d;
CLUREF specs;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(71);

  LINE(72);
    {
    CLUREF T_1_1;
    T_1_1.num = d.vec->data[0];
    {
    if (T_1_1.num < duOPcache.array->ext_low || T_1_1.num > duOPcache.array->ext_high) {
        err = ERR_bounds;
        goto ex_0;}
    duOPcache.array->store->data[T_1_1.num + duOPcache.array->int_low - duOPcache.array->ext_low] = specs.num;
    }
    }
    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 set_mspecs ****/


/**** BEGIN PROCEDURE get_dump_info ****/

errcode duOPget_dump_info(d, ret_1, ret_2)
CLUREF d;
CLUREF *ret_1;
CLUREF *ret_2;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(75);

  LINE(76);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = d.vec->data[0];
    if (T_1_1.num < duOPstore.array->ext_low || T_1_1.num > duOPstore.array->ext_high ) {
        err = ERR_bounds;
        goto ex_0;}
    T_1_2.num = duOPstore.array->store->data[T_1_1.num - duOPstore.array->ext_low + duOPstore.array->int_low];
    ret_1->num = T_1_2.num;
    }
    {
    CLUREF T_1_3;
    CLUREF T_1_4;
    T_1_3.num = d.vec->data[0];
    T_1_4.num = (T_1_3.num > duOPkeepmax.num)? true : false;
    ret_2->num = T_1_4.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 get_dump_info ****/


/**** BEGIN PROCEDURE update_specs ****/

errcode duOPupdate_specs(d, specs)
CLUREF d;
CLUREF specs;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(79);

  LINE(80);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    T_1_1.num = d.vec->data[0];
    if (T_1_1.num < duOPstore.array->ext_low || T_1_1.num > duOPstore.array->ext_high ) {
        err = ERR_bounds;
        goto ex_0;}
    T_1_2.num = duOPstore.array->store->data[T_1_1.num - duOPstore.array->ext_low + duOPstore.array->int_low];
    if (T_1_2.cell->tag == 4) T_1_3.num = true; else T_1_3.num = false;
    if (T_1_3.num == true) {

  LINE(81);
        {
        CLUREF T_2_1;
        T_2_1.num = d.vec->data[0];
        {
        if (T_2_1.num < duOPstore.array->ext_low || T_2_1.num > duOPstore.array->ext_high) {
            err = ERR_bounds;
            goto ex_0;}
        duOPstore.array->store->data[T_2_1.num + duOPstore.array->int_low - duOPstore.array->ext_low] = specs.num;
        }
        }

  LINE(82);
        {
        CLUREF T_2_1;
        T_2_1.num = d.vec->data[0];
        {
        if (T_2_1.num < duOPfixups.array->ext_low || T_2_1.num > duOPfixups.array->ext_high) {
            err = ERR_bounds;
            goto ex_0;}
        duOPfixups.array->store->data[T_2_1.num + duOPfixups.array->int_low - duOPfixups.array->ext_low] = true;
        }
        }

  LINE(83);
        {
        CLUREF T_2_1;
        if (specs.cell->tag == 2) T_2_1.num = true; else T_2_1.num = false;
        if (T_2_1.num == true) {

  LINE(84);
            {
            CLUREF T_3_1;
            CLUREF T_3_2;
            CLUREF T_3_3;
            CLUREF T_3_4;
            CLUREF T_3_5;
            err = cmpvarOPstuffs(&T_3_1);
            if (err != ERR_ok) goto ex_0;
            T_3_2.num = T_3_1.vec->data[11];
            T_3_3.num = d.vec->data[1];
            CellAlloc(1, d.num, T_3_4);
            CellAlloc(38, T_3_4.num, T_3_5);
            err = p_envOPadd_token(T_3_2, T_3_3, T_3_5);
            if (err != ERR_ok) goto ex_0;
            }
            }
            }/* end if */
        }
        }/* end if */
    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 update_specs ****/


/**** BEGIN PROCEDURE forget_specs ****/

errcode duOPforget_specs(d)
CLUREF d;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(92);

  LINE(93);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    T_1_1.num = d.vec->data[0];
    T_1_2.num = (T_1_1.num > duOPkeepmax.num)? true : false;
    if (T_1_2.num == true) {

  LINE(94);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        T_2_1.num = d.vec->data[0];
        CellAlloc(4, nil, T_2_2);
        {
        if (T_2_1.num < duOPstore.array->ext_low || T_2_1.num > duOPstore.array->ext_high) {
            err = ERR_bounds;
            goto ex_0;}
        duOPstore.array->store->data[T_2_1.num + duOPstore.array->int_low - duOPstore.array->ext_low] = T_2_2.num;
        }
        }

  LINE(95);
        {
        CLUREF T_2_1;
        T_2_1.num = d.vec->data[0];
        {
        if (T_2_1.num < duOPfixups.array->ext_low || T_2_1.num > duOPfixups.array->ext_high) {
            err = ERR_bounds;
            goto ex_0;}
        duOPfixups.array->store->data[T_2_1.num + duOPfixups.array->int_low - duOPfixups.array->ext_low] = false;
        }
        }

  LINE(96);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        T_2_1.num = d.vec->data[0];
        CellAlloc(1, nil, T_2_2);
        {
        if (T_2_1.num < duOPcache.array->ext_low || T_2_1.num > duOPcache.array->ext_high) {
            err = ERR_bounds;
            goto ex_0;}
        duOPcache.array->store->data[T_2_1.num + duOPcache.array->int_low - duOPcache.array->ext_low] = T_2_2.num;
        }
        }
        }
        }/* end if */
    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 forget_specs ****/


/**** BEGIN PROCEDURE keep ****/

errcode duOPkeep()
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(100);

  LINE(101);
    {
    CLUREF T_1_1;
    T_1_1.num = duOPstore.array->ext_high;
    duOPkeepmax.num = T_1_1.num;
    }

  LINE(102);
    for (;;) {
        CLUREF T_1_1;
        CLUREF T_1_2;
        CLUREF T_1_3;
        CLUREF T_1_4;
        T_1_2.num = (duOPkeepmax.num > 0)? true : false;
        T_1_1.num = T_1_2.num;
        if (T_1_2.num) {
            if (duOPkeepmax.num < duOPstore.array->ext_low || duOPkeepmax.num > duOPstore.array->ext_high ) {
                err = ERR_bounds;
                goto ex_0;}
            T_1_3.num = duOPstore.array->store->data[duOPkeepmax.num - duOPstore.array->ext_low + duOPstore.array->int_low];
            if (T_1_3.cell->tag == 4) T_1_4.num = true; else T_1_4.num = false;
            T_1_1.num = T_1_4.num;
        }
        if (T_1_1.num != true) { break; }

  LINE(103);
        {
        CLUREF T_2_1;
        T_2_1.num = duOPkeepmax.num - 1;
         if ((T_2_1.num >= 0 && duOPkeepmax.num < 0 && (-1) < 0) || 
             (T_2_1.num <= 0 && duOPkeepmax.num > 0 && (-1) > 0)) {
            err = ERR_overflow;
            goto ex_0;}
        duOPkeepmax.num = T_2_1.num;
        }
        }
        end_while_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 keep ****/


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

errcode duOPreset()
    {
    errcode err;
    errcode ecode2;
    CLUREF i;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(107);

  LINE(108);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    CLUREF T_1_4;
        T_1_1.num = duOPkeepmax.num + 1;
         if ((T_1_1.num > 0 && duOPkeepmax.num < 0 && 1 < 0) || 
             (T_1_1.num < 0 && duOPkeepmax.num > 0 && 1 > 0)) {
            err = ERR_overflow;
            goto ex_0;}
        T_1_2.num = duOPstore.array->ext_high;
        T_1_4.num = T_1_2.num;
        for (T_1_3.num = T_1_1.num; T_1_3.num <= T_1_4.num; T_1_3.num++) {
            i.num = T_1_3.num;

  LINE(109);
            {
            CLUREF T_2_1;
            CellAlloc(4, nil, T_2_1);
            {
            if (i.num < duOPstore.array->ext_low || i.num > duOPstore.array->ext_high) {
                err = ERR_bounds;
                goto ex_0;}
            duOPstore.array->store->data[i.num + duOPstore.array->int_low - duOPstore.array->ext_low] = T_2_1.num;
            }
            }

  LINE(110);
            {
            {
            if (i.num < duOPfixups.array->ext_low || i.num > duOPfixups.array->ext_high) {
                err = ERR_bounds;
                goto ex_0;}
            duOPfixups.array->store->data[i.num + duOPfixups.array->int_low - duOPfixups.array->ext_low] = false;
            }
            }

  LINE(111);
            {
            CLUREF T_2_1;
            CellAlloc(1, nil, T_2_1);
            {
            if (i.num < duOPcache.array->ext_low || i.num > duOPcache.array->ext_high) {
                err = ERR_bounds;
                goto ex_0;}
            duOPcache.array->store->data[i.num + duOPcache.array->int_low - duOPcache.array->ext_low] = T_2_1.num;
            }
            }
        }
    }
    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 reset ****/


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

errcode duOPequal(d1, d2, ret_1)
CLUREF d1;
CLUREF d2;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(115);

  LINE(116);
    {
    {
    CLUREF T_1_1;
    T_1_1.num = (d1.num == d2.num)? true : false;
    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 equal ****/


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

errcode duOPsimilar(d1, d2, ret_1)
CLUREF d1;
CLUREF d2;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(119);

  LINE(120);
    {
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    CLUREF T_1_3;
    T_1_1.num = d1.vec->data[1];
    T_1_2.num = d2.vec->data[1];
    T_1_3.num = ((T_1_1.str->size != T_1_2.str->size)? false :
        !(bcmp(T_1_1.str->data, T_1_2.str->data, T_1_1.str->size)));
    ret_1->num = T_1_3.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 similar ****/


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

errcode duOPcopy(d, ret_1)
CLUREF d;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
    enter_proc(123);

  LINE(124);
    {
    {
    ret_1->num = d.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 copy ****/

struct OPS  *record_index_name_ops;
static int duOP_gcd_own_init = 0;

/**** BEGIN PROCEDURE _gcd ****/

errcode duOP_gcd(d, tab, ret_1)
CLUREF d;
CLUREF tab;
CLUREF *ret_1;
    {
    errcode err;
    errcode ecode2;
        if (duOP_gcd_own_init == 0) {
        if (du_own_init == 0) {
            err = du_own_init_proc();
            if (err != ERR_ok) goto ex_0;
            }
        duOP_gcd_own_init = 1;
    }
    enter_proc(127);

  LINE(128);
    {
    {
    CLUREF T_1_1;
    generic_CLU_proc.type_owns = 0;
    generic_CLU_proc.op_owns = record_index_name_ops->entry[6].fcn->op_owns;
    generic_CLU_proc.proc = recordOP_gcd;
    CUR_PROC_VAR.proc = &generic_CLU_proc;
    err = recordOP_gcd(d, tab, &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 _gcd ****/

typedef struct{
    int count;
    OWNPTR type_owns;
    OWNPTR op_owns;
    struct OP_ENTRY entry[16];
} du_OPS;

CLU_proc du_oe__gcd = {{0,0,0,0}, duOP_gcd, 0};
CLU_proc du_oe_add_specs = {{0,0,0,0}, duOPadd_specs, 0};
CLU_proc du_oe_copy = {{0,0,0,0}, duOPcopy, 0};
CLU_proc du_oe_create = {{0,0,0,0}, duOPcreate, 0};
CLU_proc du_oe_equal = {{0,0,0,0}, duOPequal, 0};
CLU_proc du_oe_forget_specs = {{0,0,0,0}, duOPforget_specs, 0};
CLU_proc du_oe_get_common = {{0,0,0,0}, duOPget_common, 0};
CLU_proc du_oe_get_dump_info = {{0,0,0,0}, duOPget_dump_info, 0};
CLU_proc du_oe_get_mspecs = {{0,0,0,0}, duOPget_mspecs, 0};
CLU_proc du_oe_get_unique = {{0,0,0,0}, duOPget_unique, 0};
CLU_proc du_oe_keep = {{0,0,0,0}, duOPkeep, 0};
CLU_proc du_oe_read_specs = {{0,0,0,0}, duOPread_specs, 0};
CLU_proc du_oe_reset = {{0,0,0,0}, duOPreset, 0};
CLU_proc du_oe_set_mspecs = {{0,0,0,0}, duOPset_mspecs, 0};
CLU_proc du_oe_similar = {{0,0,0,0}, duOPsimilar, 0};
CLU_proc du_oe_update_specs = {{0,0,0,0}, duOPupdate_specs, 0};

du_OPS du_ops_actual = {16, (OWNPTR)&du_own_init, (OWNPTR)&du_own_init, {
    {&du_oe__gcd, "_gcd"},
    {&du_oe_add_specs, "add_specs"},
    {&du_oe_copy, "copy"},
    {&du_oe_create, "create"},
    {&du_oe_equal, "equal"},
    {&du_oe_forget_specs, "forget_specs"},
    {&du_oe_get_common, "get_common"},
    {&du_oe_get_dump_info, "get_dump_info"},
    {&du_oe_get_mspecs, "get_mspecs"},
    {&du_oe_get_unique, "get_unique"},
    {&du_oe_keep, "keep"},
    {&du_oe_read_specs, "read_specs"},
    {&du_oe_reset, "reset"},
    {&du_oe_set_mspecs, "set_mspecs"},
    {&du_oe_similar, "similar"},
    {&du_oe_update_specs, "update_specs"}}};

struct OPS *du_ops = (struct OPS *)&du_ops_actual;

/**** END CLUSTER du ****/
