int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)

{

    int i, regnum;

    PowerPCCPU *cpu = POWERPC_CPU(cs);

    CPUPPCState *env = &cpu->env;



    /* General purpose registers */

    if ((tolower(name[0]) == 'r') &&

        ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->gpr), &regnum)) {

        *pval = env->gpr[regnum];

        return 0;

    }



    /* Floating point registers */

    if ((tolower(name[0]) == 'f') &&

        ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->fpr), &regnum)) {

        *pval = env->fpr[regnum];

        return 0;

    }



    /* Special purpose registers */

    for (i = 0; i < ARRAY_SIZE(env->spr_cb); ++i) {

        ppc_spr_t *spr = &env->spr_cb[i];



        if (spr->name && (strcasecmp(name, spr->name) == 0)) {

            *pval = env->spr[i];

            return 0;

        }

    }



    /* Segment registers */

#if !defined(CONFIG_USER_ONLY)

    if ((strncasecmp(name, "sr", 2) == 0) &&

        ppc_cpu_get_reg_num(name + 2, ARRAY_SIZE(env->sr), &regnum)) {

        *pval = env->sr[regnum];

        return 0;

    }

#endif



    return -EINVAL;

}

int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)

{

    int i, regnum;

    PowerPCCPU *cpu = POWERPC_CPU(cs);

    CPUPPCState *env = &cpu->env;



    

    if ((tolower(name[0]) == 'r') &&

        ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->gpr), &regnum)) {

        *pval = env->gpr[regnum];

        return 0;

    }



    

    if ((tolower(name[0]) == 'f') &&

        ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->fpr), &regnum)) {

        *pval = env->fpr[regnum];

        return 0;

    }



    

    for (i = 0; i < ARRAY_SIZE(env->spr_cb); ++i) {

        ppc_spr_t *spr = &env->spr_cb[i];



        if (spr->name && (strcasecmp(name, spr->name) == 0)) {

            *pval = env->spr[i];

            return 0;

        }

    }



    

#if !defined(CONFIG_USER_ONLY)

    if ((strncasecmp(name, "sr", 2) == 0) &&

        ppc_cpu_get_reg_num(name + 2, ARRAY_SIZE(env->sr), &regnum)) {

        *pval = env->sr[regnum];

        return 0;

    }

#endif



    return -EINVAL;

}

    if ((tolower(name[0]) == 'r') &&     if ((tolower(name[0]) == 'f') &&
int FUNC_0(CPUState *VAR_0, const char *VAR_1, uint64_t *VAR_2)

{

    int VAR_3, VAR_4;

    PowerPCCPU *cpu = POWERPC_CPU(VAR_0);

    CPUPPCState *env = &cpu->env;



    

    if ((tolower(VAR_1[0]) == 'r') &&

        ppc_cpu_get_reg_num(VAR_1 + 1, ARRAY_SIZE(env->gpr), &VAR_4)) {

        *VAR_2 = env->gpr[VAR_4];

        return 0;

    }



    

    if ((tolower(VAR_1[0]) == 'f') &&

        ppc_cpu_get_reg_num(VAR_1 + 1, ARRAY_SIZE(env->fpr), &VAR_4)) {

        *VAR_2 = env->fpr[VAR_4];

        return 0;

    }



    

    for (VAR_3 = 0; VAR_3 < ARRAY_SIZE(env->spr_cb); ++VAR_3) {

        ppc_spr_t *spr = &env->spr_cb[VAR_3];



        if (spr->VAR_1 && (strcasecmp(VAR_1, spr->VAR_1) == 0)) {

            *VAR_2 = env->spr[VAR_3];

            return 0;

        }

    }



    

#if !defined(CONFIG_USER_ONLY)

    if ((strncasecmp(VAR_1, "sr", 2) == 0) &&

        ppc_cpu_get_reg_num(VAR_1 + 2, ARRAY_SIZE(env->sr), &VAR_4)) {

        *VAR_2 = env->sr[VAR_4];

        return 0;

    }

#endif



    return -EINVAL;

}

int FUNC_0(CPUState *VAR_0, const char *VAR_1, uint64_t *VAR_2)
{ int VAR_3, VAR_4; PowerPCCPU *cpu = POWERPC_CPU(VAR_0); CPUPPCState *env = &cpu->env; if ((tolower(VAR_1[0]) == 'r') &&
ppc_cpu_get_reg_num(VAR_1 + 1, ARRAY_SIZE(env->gpr), &VAR_4)) { *VAR_2 = env->gpr[VAR_4]; return 0; } if ((tolower(VAR_1[0]) == 'f') &&
ppc_cpu_get_reg_num(VAR_1 + 1, ARRAY_SIZE(env->fpr), &VAR_4)) { *VAR_2 = env->fpr[VAR_4]; return 0; } for (VAR_3 = 0; VAR_3 < ARRAY_SIZE(env->spr_cb); ++VAR_3) { ppc_spr_t *spr = &env->spr_cb[VAR_3]; if (spr->VAR_1 && (strcasecmp(VAR_1, spr->VAR_1) == 0)) { *VAR_2 = env->spr[VAR_3]; return 0; } } #if !defined(CONFIG_USER_ONLY)
if ((strncasecmp(VAR_1, "sr", 2) == 0) &&
ppc_cpu_get_reg_num(VAR_1 + 2, ARRAY_SIZE(env->sr), &VAR_4)) { *VAR_2 = env->sr[VAR_4]; return 0; } #endif
return -EINVAL; }