static int get_monitor_def(target_long *pval, const char *name)

{

    const MonitorDef *md;

    void *ptr;



    for(md = monitor_defs; md->name != NULL; md++) {

        if (compare_cmd(name, md->name)) {

            if (md->get_value) {

                *pval = md->get_value(md, md->offset);

            } else {

                CPUState *env = mon_get_cpu();

                if (!env)

                    return -2;

                ptr = (uint8_t *)env + md->offset;

                switch(md->type) {

                case MD_I32:

                    *pval = *(int32_t *)ptr;

                    break;

                case MD_TLONG:

                    *pval = *(target_long *)ptr;

                    break;

                default:

                    *pval = 0;

                    break;

                }

            }

            return 0;

        }

    }

    return -1;

}

static int get_monitor_def(target_long *pval, const char *name)

{

    const MonitorDef *md;

    void *ptr;



    for(md = monitor_defs; md->name != NULL; md++) {

        if (compare_cmd(name, md->name)) {

            if (md->get_value) {

                *pval = md->get_value(md, md->offset);

            } else {

                CPUState *env = mon_get_cpu();

                if (!env)

                    return -2;

                ptr = (uint8_t *)env + md->offset;

                switch(md->type) {

                case MD_I32:

                    *pval = *(int32_t *)ptr;

                    break;

                case MD_TLONG:

                    *pval = *(target_long *)ptr;

                    break;

                default:

                    *pval = 0;

                    break;

                }

            }

            return 0;

        }

    }

    return -1;

}

                if (!env)                     return -2;
static int FUNC_0(target_long *VAR_0, const char *VAR_1)

{

    const MonitorDef *VAR_2;

    void *VAR_3;



    for(VAR_2 = monitor_defs; VAR_2->VAR_1 != NULL; VAR_2++) {

        if (compare_cmd(VAR_1, VAR_2->VAR_1)) {

            if (VAR_2->get_value) {

                *VAR_0 = VAR_2->get_value(VAR_2, VAR_2->offset);

            } else {

                CPUState *env = mon_get_cpu();

                if (!env)

                    return -2;

                VAR_3 = (uint8_t *)env + VAR_2->offset;

                switch(VAR_2->type) {

                case MD_I32:

                    *VAR_0 = *(int32_t *)VAR_3;

                    break;

                case MD_TLONG:

                    *VAR_0 = *(target_long *)VAR_3;

                    break;

                default:

                    *VAR_0 = 0;

                    break;

                }

            }

            return 0;

        }

    }

    return -1;

}

static int FUNC_0(target_long *VAR_0, const char *VAR_1)
{ const MonitorDef *VAR_2; void *VAR_3; for(VAR_2 = monitor_defs; VAR_2->VAR_1 != NULL; VAR_2++) { if (compare_cmd(VAR_1, VAR_2->VAR_1)) { if (VAR_2->get_value) { *VAR_0 = VAR_2->get_value(VAR_2, VAR_2->offset); } else { CPUState *env = mon_get_cpu(); if (!env)
return -2; VAR_3 = (uint8_t *)env + VAR_2->offset; switch(VAR_2->type) { case MD_I32:
*VAR_0 = *(int32_t *)VAR_3; break; case MD_TLONG:
*VAR_0 = *(target_long *)VAR_3; break; default:
*VAR_0 = 0; break; } } return 0; } } return -1; }