static int cpudef_setfield(const char *name, const char *str, void *opaque)

{

    x86_def_t *def = opaque;

    int err = 0;



    if (!strcmp(name, "name")) {

        def->name = strdup(str);

    } else if (!strcmp(name, "model_id")) {

        strncpy(def->model_id, str, sizeof (def->model_id));

    } else if (!strcmp(name, "level")) {

        setscalar(&def->level, str, &err)

    } else if (!strcmp(name, "vendor")) {

        cpyid(&str[0], &def->vendor1);

        cpyid(&str[4], &def->vendor2);

        cpyid(&str[8], &def->vendor3);

    } else if (!strcmp(name, "family")) {

        setscalar(&def->family, str, &err)

    } else if (!strcmp(name, "model")) {

        setscalar(&def->model, str, &err)

    } else if (!strcmp(name, "stepping")) {

        setscalar(&def->stepping, str, &err)

    } else if (!strcmp(name, "feature_edx")) {

        setfeatures(&def->features, str, feature_name, &err);

    } else if (!strcmp(name, "feature_ecx")) {

        setfeatures(&def->ext_features, str, ext_feature_name, &err);

    } else if (!strcmp(name, "extfeature_edx")) {

        setfeatures(&def->ext2_features, str, ext2_feature_name, &err);

    } else if (!strcmp(name, "extfeature_ecx")) {

        setfeatures(&def->ext3_features, str, ext3_feature_name, &err);

    } else if (!strcmp(name, "xlevel")) {

        setscalar(&def->xlevel, str, &err)

    } else {

        fprintf(stderr, "error: unknown option [%s = %s]\n", name, str);

        return (1);

    }

    if (err) {

        fprintf(stderr, "error: bad option value [%s = %s]\n", name, str);

        return (1);

    }

    return (0);

}

static int cpudef_setfield(const char *name, const char *str, void *opaque)

{

    x86_def_t *def = opaque;

    int err = 0;



    if (!strcmp(name, "name")) {

        def->name = strdup(str);

    } else if (!strcmp(name, "model_id")) {

        strncpy(def->model_id, str, sizeof (def->model_id));

    } else if (!strcmp(name, "level")) {

        setscalar(&def->level, str, &err)

    } else if (!strcmp(name, "vendor")) {

        cpyid(&str[0], &def->vendor1);

        cpyid(&str[4], &def->vendor2);

        cpyid(&str[8], &def->vendor3);

    } else if (!strcmp(name, "family")) {

        setscalar(&def->family, str, &err)

    } else if (!strcmp(name, "model")) {

        setscalar(&def->model, str, &err)

    } else if (!strcmp(name, "stepping")) {

        setscalar(&def->stepping, str, &err)

    } else if (!strcmp(name, "feature_edx")) {

        setfeatures(&def->features, str, feature_name, &err);

    } else if (!strcmp(name, "feature_ecx")) {

        setfeatures(&def->ext_features, str, ext_feature_name, &err);

    } else if (!strcmp(name, "extfeature_edx")) {

        setfeatures(&def->ext2_features, str, ext2_feature_name, &err);

    } else if (!strcmp(name, "extfeature_ecx")) {

        setfeatures(&def->ext3_features, str, ext3_feature_name, &err);

    } else if (!strcmp(name, "xlevel")) {

        setscalar(&def->xlevel, str, &err)

    } else {

        fprintf(stderr, "error: unknown option [%s = %s]\n", name, str);

        return (1);

    }

    if (err) {

        fprintf(stderr, "error: bad option value [%s = %s]\n", name, str);

        return (1);

    }

    return (0);

}

static int FUNC_0(const char *VAR_0, const char *VAR_1, void *VAR_2)

{

    x86_def_t *def = VAR_2;

    int VAR_3 = 0;



    if (!strcmp(VAR_0, "VAR_0")) {

        def->VAR_0 = strdup(VAR_1);

    } else if (!strcmp(VAR_0, "model_id")) {

        strncpy(def->model_id, VAR_1, sizeof (def->model_id));

    } else if (!strcmp(VAR_0, "level")) {

        setscalar(&def->level, VAR_1, &VAR_3)

    } else if (!strcmp(VAR_0, "vendor")) {

        cpyid(&VAR_1[0], &def->vendor1);

        cpyid(&VAR_1[4], &def->vendor2);

        cpyid(&VAR_1[8], &def->vendor3);

    } else if (!strcmp(VAR_0, "family")) {

        setscalar(&def->family, VAR_1, &VAR_3)

    } else if (!strcmp(VAR_0, "model")) {

        setscalar(&def->model, VAR_1, &VAR_3)

    } else if (!strcmp(VAR_0, "stepping")) {

        setscalar(&def->stepping, VAR_1, &VAR_3)

    } else if (!strcmp(VAR_0, "feature_edx")) {

        setfeatures(&def->features, VAR_1, feature_name, &VAR_3);

    } else if (!strcmp(VAR_0, "feature_ecx")) {

        setfeatures(&def->ext_features, VAR_1, ext_feature_name, &VAR_3);

    } else if (!strcmp(VAR_0, "extfeature_edx")) {

        setfeatures(&def->ext2_features, VAR_1, ext2_feature_name, &VAR_3);

    } else if (!strcmp(VAR_0, "extfeature_ecx")) {

        setfeatures(&def->ext3_features, VAR_1, ext3_feature_name, &VAR_3);

    } else if (!strcmp(VAR_0, "xlevel")) {

        setscalar(&def->xlevel, VAR_1, &VAR_3)

    } else {

        fprintf(stderr, "error: unknown option [%s = %s]\n", VAR_0, VAR_1);

        return (1);

    }

    if (VAR_3) {

        fprintf(stderr, "error: bad option value [%s = %s]\n", VAR_0, VAR_1);

        return (1);

    }

    return (0);

}

static int FUNC_0(const char *VAR_0, const char *VAR_1, void *VAR_2)
{ x86_def_t *def = VAR_2; int VAR_3 = 0; if (!strcmp(VAR_0, "VAR_0")) { def->VAR_0 = strdup(VAR_1); } else if (!strcmp(VAR_0, "model_id")) { strncpy(def->model_id, VAR_1, sizeof (def->model_id)); } else if (!strcmp(VAR_0, "level")) { setscalar(&def->level, VAR_1, &VAR_3)
} else if (!strcmp(VAR_0, "vendor")) { cpyid(&VAR_1[0], &def->vendor1); cpyid(&VAR_1[4], &def->vendor2); cpyid(&VAR_1[8], &def->vendor3); } else if (!strcmp(VAR_0, "family")) { setscalar(&def->family, VAR_1, &VAR_3)
} else if (!strcmp(VAR_0, "model")) { setscalar(&def->model, VAR_1, &VAR_3)
} else if (!strcmp(VAR_0, "stepping")) { setscalar(&def->stepping, VAR_1, &VAR_3)
} else if (!strcmp(VAR_0, "feature_edx")) { setfeatures(&def->features, VAR_1, feature_name, &VAR_3); } else if (!strcmp(VAR_0, "feature_ecx")) { setfeatures(&def->ext_features, VAR_1, ext_feature_name, &VAR_3); } else if (!strcmp(VAR_0, "extfeature_edx")) { setfeatures(&def->ext2_features, VAR_1, ext2_feature_name, &VAR_3); } else if (!strcmp(VAR_0, "extfeature_ecx")) { setfeatures(&def->ext3_features, VAR_1, ext3_feature_name, &VAR_3); } else if (!strcmp(VAR_0, "xlevel")) { setscalar(&def->xlevel, VAR_1, &VAR_3)
} else { fprintf(stderr, "error: unknown option [%s = %s]\n", VAR_0, VAR_1); return (1); } if (VAR_3) { fprintf(stderr, "error: bad option value [%s = %s]\n", VAR_0, VAR_1); return (1); } return (0); }