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

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


extern struct dbg_info* dbg_info_g_form;
#undef MY_TRACE_FLAG
#define MY_TRACE_FLAG g_form_TRACE
int g_form_TRACE;
extern struct OPS *int_ops;
static Vlist1 owns_g_form = {0, 1,{ {0, 2, "_init", &int_ops}
}
};
extern errcode intOPlt();
extern errcode intOPequal();
extern errcode realOPexponent();
extern errcode realOPequal();
extern errcode intOPge();
extern errcode f_form();
extern errcode intOPsub();
extern errcode intOPadd();
extern errcode e_form();
extern OWN_req int_ownreqs;
static int g_form_own_init = 0;

/**** BEGIN PROCEDURE g_form ****/

errcode g_form(x, i, f, ret_1)
CLUREF x;
CLUREF i;
CLUREF f;
CLUREF *ret_1;
    {
    struct {
        struct dbg_info *DBG_INFO;
        int DBG_LINE;
        errcode err;
        errcode ecode2;
        CLUREF expon;
        CLUREF x;
        CLUREF i;
        CLUREF f;
        } locals;
    locals.expon.num = UNINIT;
    locals.x.num = UNINIT;
    locals.i.num = UNINIT;
    locals.f.num = UNINIT;
    locals.DBG_INFO = dbg_info_g_form;
    locals.x = x;
    locals.i = i;
    locals.f = f;
        if (g_form_own_init == 0) {
        g_form_own_init = 1;
    }
    enter_proc(3);

  LINE(6);
    {
    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;
    T_1_3.num = (locals.i.num < 0)? true : false;
    T_1_2.num = T_1_3.num;
    if (!T_1_3.num) {
        T_1_4.num = (locals.f.num < 0)? true : false;
        T_1_2.num = T_1_4.num;
    }
    T_1_1.num = T_1_2.num;
    if (!T_1_2.num) {
        T_1_6.num = (locals.i.num == 0)? true : false;
        T_1_5.num = T_1_6.num;
        if (T_1_6.num) {
            T_1_7.num = (locals.f.num == 0)? true : false;
            T_1_5.num = T_1_7.num;
        }
        T_1_1.num = T_1_5.num;
    }
    if (T_1_1.num == true) {

  LINE(7);
        {
        {signal (ERR_illegal_field_width);}}
        }
        }/* end if */

  LINE(8);
    {
        {CLUREF T_2_1;
        locals.err = realOPexponent(locals.x, &T_2_1);
        if (locals.err != ERR_ok) goto ex_1;
        locals.expon.num = T_2_1.num;
        }
        }
        goto end_1;
        ex_1:
            if ((locals.err == ERR_undefined)) {
            }
            else {
                goto ex_0;
            }
        end_1:;

  LINE(10);
    {
    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;
    T_1_2.real = 0.000000e+00;
    locals.err = realOPequal(locals.x, T_1_2, &T_1_3);
    if (locals.err != ERR_ok) goto ex_0;
    T_1_1.num = T_1_3.num;
    if (!T_1_3.num) {
        T_1_5.num = -1;
        T_1_6.num = (locals.expon.num >= T_1_5.num)? true : false;
        T_1_4.num = T_1_6.num;
        if (T_1_6.num) {
            T_1_7.num = (locals.expon.num < locals.i.num)? true : false;
            T_1_4.num = T_1_7.num;
        }
        T_1_1.num = T_1_4.num;
    }
    if (T_1_1.num == true) {

  LINE(11);
        {
        {
        CLUREF T_3_1;
        locals.err = f_form(locals.x, locals.i, locals.f, &T_3_1);
        if (locals.err != ERR_ok) goto ex_2;
        ret_1->num = T_3_1.num;
        }
        {signal (ERR_ok);}}
            goto end_2;
            ex_2:
                if ((locals.err == ERR_insufficient_field_width)) {
                }
                else {
                    goto ex_0;
                }
            end_2:;
        }
        }/* end if */

  LINE(14);
    {
    CLUREF T_1_1;
    CLUREF T_1_2;
    locals.err = intOPadd(locals.i, locals.f, &T_1_1);
    if (locals.err != ERR_ok) goto ex_0;
    locals.err = intOPsub(T_1_1, CLU_5, &T_1_2);
    if (locals.err != ERR_ok) goto ex_0;
    locals.i.num = T_1_2.num;
    }

  LINE(15);
    {
    CLUREF T_1_1;
    T_1_1.num = (locals.i.num >= 0)? true : false;
    if (T_1_1.num == true) {

  LINE(16);
        {
        {
        CLUREF T_2_1;
        locals.err = e_form(locals.x, CLU_1, locals.i, &T_2_1);
        if (locals.err != ERR_ok) goto ex_0;
        ret_1->num = T_2_1.num;
        }
        {signal (ERR_ok);}}
        }
        }/* end if */

  LINE(17);
    {
    {signal (ERR_insufficient_field_width);}}
    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 g_form ****/

extern struct OPS *string_ops;
extern struct OPS *real_ops;
typedef struct {
    int hdr;
    int count;
    char *name;
    char *fname;
    bool is_iter;
    int is_parmd;
    int addr;
    int nargs;
    Vlist1 *vals;
    siglist2 *sigs;
    Vlist6 *locals;
    Vlist1 *owns;
    Vlist0 *ptowns;
    Vlist0 *popowns;
    Slist0 *type_formals;
    Slist0 *op_formals;
    } dbg_info_g_form_actual;
static Vlist1 vals_g_form = {0, 1, { {0, 2, "", &string_ops}}
};
static sig_desc0 sig_g_form_1 = {0, 3, "illegal_field_width", {0, 0
}};
static sig_desc0 sig_g_form_2 = {0, 3, "insufficient_field_width", {0, 0
}};
static siglist2 sigs_g_form = {0, 2, (sig_desc*)&sig_g_form_1, (sig_desc*)&sig_g_form_2};
static Vlist6 locals_g_form = {0, 6,{ {0, 2, "err", &int_ops},  {0, 2, "ecode2", &int_ops},  {0, 2, "expon", &int_ops},  {0, 2, "x", &real_ops},  {0, 2, "i", &int_ops},  {0, 2, "f", &int_ops}}
};
static Vlist0 popowns_g_form = {0, 0};
Slist0 tformals_g_form = {0, 0};
Slist0 opformals_g_form = {0, 0};
dbg_info_g_form_actual dbg_info_g_form_data = {0, 12, 
    "g_form", "/common/pub/dcurtis-temp/pclu/sys/clu/g_form", 0, 0, (int)g_form, 3, 
    &vals_g_form, &sigs_g_form, &locals_g_form, &owns_g_form, &NO_VALS, &NO_VALS, &NO_PARMS, &NO_PARMS};
    struct dbg_info *dbg_info_g_form = (struct dbg_info*)&dbg_info_g_form_data;
