static void x86_cpu_parse_featurestr(CPUState *cs, char *features,

                                     Error **errp)

{

    X86CPU *cpu = X86_CPU(cs);

    char *featurestr; /* Single 'key=value" string being parsed */

    FeatureWord w;

    /* Features to be added */

    FeatureWordArray plus_features = { 0 };

    /* Features to be removed */

    FeatureWordArray minus_features = { 0 };

    CPUX86State *env = &cpu->env;

    Error *local_err = NULL;



    featurestr = features ? strtok(features, ",") : NULL;



    while (featurestr) {

        char *val;

        if (featurestr[0] == '+') {

            add_flagname_to_bitmaps(featurestr + 1, plus_features, &local_err);

        } else if (featurestr[0] == '-') {

            add_flagname_to_bitmaps(featurestr + 1, minus_features, &local_err);

        } else if ((val = strchr(featurestr, '='))) {

            *val = 0; val++;

            feat2prop(featurestr);

            if (!strcmp(featurestr, "tsc-freq")) {

                int64_t tsc_freq;

                char *err;

                char num[32];



                tsc_freq = qemu_strtosz_suffix_unit(val, &err,

                                               QEMU_STRTOSZ_DEFSUFFIX_B, 1000);

                if (tsc_freq < 0 || *err) {

                    error_setg(errp, "bad numerical value %s", val);

                    return;

                }

                snprintf(num, sizeof(num), "%" PRId64, tsc_freq);

                object_property_parse(OBJECT(cpu), num, "tsc-frequency",

                                      &local_err);

            } else {

                object_property_parse(OBJECT(cpu), val, featurestr, &local_err);

            }

        } else {

            feat2prop(featurestr);

            object_property_parse(OBJECT(cpu), "on", featurestr, &local_err);

        }

        if (local_err) {

            error_propagate(errp, local_err);

            return;

        }

        featurestr = strtok(NULL, ",");

    }



    if (cpu->host_features) {

        for (w = 0; w < FEATURE_WORDS; w++) {

            env->features[w] =

                x86_cpu_get_supported_feature_word(w, cpu->migratable);

        }

    }



    for (w = 0; w < FEATURE_WORDS; w++) {

        env->features[w] |= plus_features[w];

        env->features[w] &= ~minus_features[w];

    }

}

static void x86_cpu_parse_featurestr(CPUState *cs, char *features,

                                     Error **errp)

{

    X86CPU *cpu = X86_CPU(cs);

    char *featurestr; 

    FeatureWord w;

    

    FeatureWordArray plus_features = { 0 };

    

    FeatureWordArray minus_features = { 0 };

    CPUX86State *env = &cpu->env;

    Error *local_err = NULL;



    featurestr = features ? strtok(features, ",") : NULL;



    while (featurestr) {

        char *val;

        if (featurestr[0] == '+') {

            add_flagname_to_bitmaps(featurestr + 1, plus_features, &local_err);

        } else if (featurestr[0] == '-') {

            add_flagname_to_bitmaps(featurestr + 1, minus_features, &local_err);

        } else if ((val = strchr(featurestr, '='))) {

            *val = 0; val++;

            feat2prop(featurestr);

            if (!strcmp(featurestr, "tsc-freq")) {

                int64_t tsc_freq;

                char *err;

                char num[32];



                tsc_freq = qemu_strtosz_suffix_unit(val, &err,

                                               QEMU_STRTOSZ_DEFSUFFIX_B, 1000);

                if (tsc_freq < 0 || *err) {

                    error_setg(errp, "bad numerical value %s", val);

                    return;

                }

                snprintf(num, sizeof(num), "%" PRId64, tsc_freq);

                object_property_parse(OBJECT(cpu), num, "tsc-frequency",

                                      &local_err);

            } else {

                object_property_parse(OBJECT(cpu), val, featurestr, &local_err);

            }

        } else {

            feat2prop(featurestr);

            object_property_parse(OBJECT(cpu), "on", featurestr, &local_err);

        }

        if (local_err) {

            error_propagate(errp, local_err);

            return;

        }

        featurestr = strtok(NULL, ",");

    }



    if (cpu->host_features) {

        for (w = 0; w < FEATURE_WORDS; w++) {

            env->features[w] =

                x86_cpu_get_supported_feature_word(w, cpu->migratable);

        }

    }



    for (w = 0; w < FEATURE_WORDS; w++) {

        env->features[w] |= plus_features[w];

        env->features[w] &= ~minus_features[w];

    }

}

static void FUNC_0(CPUState *VAR_0, char *VAR_1,

                                     Error **VAR_2)

{

    X86CPU *cpu = X86_CPU(VAR_0);

    char *VAR_3; 

    FeatureWord w;

    

    FeatureWordArray plus_features = { 0 };

    

    FeatureWordArray minus_features = { 0 };

    CPUX86State *env = &cpu->env;

    Error *local_err = NULL;



    VAR_3 = VAR_1 ? strtok(VAR_1, ",") : NULL;



    while (VAR_3) {

        char *VAR_4;

        if (VAR_3[0] == '+') {

            add_flagname_to_bitmaps(VAR_3 + 1, plus_features, &local_err);

        } else if (VAR_3[0] == '-') {

            add_flagname_to_bitmaps(VAR_3 + 1, minus_features, &local_err);

        } else if ((VAR_4 = strchr(VAR_3, '='))) {

            *VAR_4 = 0; VAR_4++;

            feat2prop(VAR_3);

            if (!strcmp(VAR_3, "tsc-freq")) {

                int64_t tsc_freq;

                char *VAR_5;

                char VAR_6[32];



                tsc_freq = qemu_strtosz_suffix_unit(VAR_4, &VAR_5,

                                               QEMU_STRTOSZ_DEFSUFFIX_B, 1000);

                if (tsc_freq < 0 || *VAR_5) {

                    error_setg(VAR_2, "bad numerical value %s", VAR_4);

                    return;

                }

                snprintf(VAR_6, sizeof(VAR_6), "%" PRId64, tsc_freq);

                object_property_parse(OBJECT(cpu), VAR_6, "tsc-frequency",

                                      &local_err);

            } else {

                object_property_parse(OBJECT(cpu), VAR_4, VAR_3, &local_err);

            }

        } else {

            feat2prop(VAR_3);

            object_property_parse(OBJECT(cpu), "on", VAR_3, &local_err);

        }

        if (local_err) {

            error_propagate(VAR_2, local_err);

            return;

        }

        VAR_3 = strtok(NULL, ",");

    }



    if (cpu->host_features) {

        for (w = 0; w < FEATURE_WORDS; w++) {

            env->VAR_1[w] =

                x86_cpu_get_supported_feature_word(w, cpu->migratable);

        }

    }



    for (w = 0; w < FEATURE_WORDS; w++) {

        env->VAR_1[w] |= plus_features[w];

        env->VAR_1[w] &= ~minus_features[w];

    }

}

static void FUNC_0(CPUState *VAR_0, char *VAR_1,
Error **VAR_2)
{ X86CPU *cpu = X86_CPU(VAR_0); char *VAR_3; FeatureWord w; FeatureWordArray plus_features = { 0 }; FeatureWordArray minus_features = { 0 }; CPUX86State *env = &cpu->env; Error *local_err = NULL; VAR_3 = VAR_1 ? strtok(VAR_1, ",") : NULL; while (VAR_3) { char *VAR_4; if (VAR_3[0] == '+') { add_flagname_to_bitmaps(VAR_3 + 1, plus_features, &local_err); } else if (VAR_3[0] == '-') { add_flagname_to_bitmaps(VAR_3 + 1, minus_features, &local_err); } else if ((VAR_4 = strchr(VAR_3, '='))) { *VAR_4 = 0; VAR_4++; feat2prop(VAR_3); if (!strcmp(VAR_3, "tsc-freq")) { int64_t tsc_freq; char *VAR_5; char VAR_6[32]; tsc_freq = qemu_strtosz_suffix_unit(VAR_4, &VAR_5,
QEMU_STRTOSZ_DEFSUFFIX_B, 1000); if (tsc_freq < 0 || *VAR_5) { error_setg(VAR_2, "bad numerical value %s", VAR_4); return; } snprintf(VAR_6, sizeof(VAR_6), "%" PRId64, tsc_freq); object_property_parse(OBJECT(cpu), VAR_6, "tsc-frequency",
&local_err); } else { object_property_parse(OBJECT(cpu), VAR_4, VAR_3, &local_err); } } else { feat2prop(VAR_3); object_property_parse(OBJECT(cpu), "on", VAR_3, &local_err); } if (local_err) { error_propagate(VAR_2, local_err); return; } VAR_3 = strtok(NULL, ","); } if (cpu->host_features) { for (w = 0; w < FEATURE_WORDS; w++) { env->VAR_1[w] =
x86_cpu_get_supported_feature_word(w, cpu->migratable); } } for (w = 0; w < FEATURE_WORDS; w++) { env->VAR_1[w] |= plus_features[w]; env->VAR_1[w] &= ~minus_features[w]; } }