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

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


extern struct dbg_info* dbg_info__unquote;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG _unquote_TRACE
int _unquote_TRACE;
extern struct OPS *int_ops;
static Vlist1 owns__unquote = {0, 1,{ {0, 2, "_init", &int_ops}
}
};
extern errcode _bytevecOPindexc();
extern errcode _cvt();
extern errcode intOPadd();
extern errcode intOPequal();
extern errcode stringOPsize();
extern errcode stringOPconcat();
extern errcode stringOPsubstr();
extern errcode intOPsub();
extern errcode stringOPrest();
extern OWN_req _bytevec_ownreqs;
extern struct OPS *_bytevec_ops;
static int _unquote_own_init = 0;

/**** BEGIN PROCEDURE _unquote ****/

errcode _unquote(s, ret_1)
CLUREF s;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF i;
        CLUREF s;
        } locals;
    locals.i.num = UNINIT;
    locals.s.num = UNINIT;
    locals.DBG_INFO = dbg_info__unquote;
    locals.s = s;
        if (_unquote_own_init == 0) {
        _unquote_own_init = 1;
    }
    enter_proc(3);

  LINE(4);
    {
        {locals.i.num = 0;
        }
        }

  LINE(5);
    for (;;) {
        if (true != true) { break; }

  LINE(6);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CLUREF T_2_3;
        CLUREF T_2_4;
        T_2_1.ch = '\\';
        T_2_2.num = locals.s.num;
        locals.err = intOPadd(locals.i, CLU_1, &T_2_3);
        if (locals.err != ERR_ok) goto ex_0;
        locals.err = _bytevecOPindexc(T_2_1, T_2_2, T_2_3, &T_2_4);
        if (locals.err != ERR_ok) goto ex_0;
        locals.i.num = T_2_4.num;
        }

  LINE(7);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CLUREF T_2_3;
        CLUREF T_2_4;
        T_2_2.num = (locals.i.num == 0)? true : false;
        T_2_1.num = T_2_2.num;
        if (!T_2_2.num) {
            locals.err = stringOPsize(locals.s, &T_2_3);
            if (locals.err != ERR_ok) goto ex_0;
            T_2_4.num = (locals.i.num == T_2_3.num)? true : false;
            T_2_1.num = T_2_4.num;
        }
        if (T_2_1.num == true) {

  LINE(8);
            {
            {
            ret_1->num = locals.s.num;
            }
            {signal (ERR_ok);}}
            }
            }/* end if */

  LINE(9);
        {
        CLUREF T_2_1;
        CLUREF T_2_2;
        CLUREF T_2_3;
        CLUREF T_2_4;
        CLUREF T_2_5;
        locals.err = intOPsub(locals.i, CLU_1, &T_2_1);
        if (locals.err != ERR_ok) goto ex_0;
        locals.err = stringOPsubstr(locals.s, CLU_1, T_2_1, &T_2_2);
        if (locals.err != ERR_ok) goto ex_0;
        locals.err = intOPadd(locals.i, CLU_1, &T_2_3);
        if (locals.err != ERR_ok) goto ex_0;
        locals.err = stringOPrest(locals.s, T_2_3, &T_2_4);
        if (locals.err != ERR_ok) goto ex_0;
        locals.err = stringOPconcat(T_2_2, T_2_4, &T_2_5);
        if (locals.err != ERR_ok) goto ex_0;
        locals.s.num = T_2_5.num;
        }
        }
        end_while_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 _unquote ****/

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;
    siglist0 *sigs;
    Vlist4 *locals;
    Vlist1 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info__unquote_actual;
static Vlist1 vals__unquote = {0, 1, { {0, 2, "", &string_ops}}
};
static siglist0 sigs__unquote = {0, 0};
static Vlist4 locals__unquote = {0, 4,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "i", &int_ops},  {0, 2, "s", &string_ops}}
};
static Vlist0 popowns__unquote = {0, 0};
Slist0 tformals__unquote = {0, 0};
Slist0 opformals__unquote = {0, 0};
dbg_info__unquote_actual dbg_info__unquote_data = {0, 12, 
    "_unquote", "/common/pub/dcurtis-temp/pclu/lib/clu/_unquote.clu", 0, 0, (int)_unquote, 1, 
    &vals__unquote, &sigs__unquote, &locals__unquote, &owns__unquote, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info__unquote = (struct dbg_info*)&dbg_info__unquote_data;
