void input_type_enum(Visitor *v, int *obj, const char *strings[],

                     const char *kind, const char *name,

                     Error **errp)

{

    int64_t value = 0;

    char *enum_str;



    assert(strings);



    visit_type_str(v, &enum_str, name, errp);

    if (error_is_set(errp)) {

        return;

    }



    while (strings[value] != NULL) {

        if (strcmp(strings[value], enum_str) == 0) {

            break;

        }

        value++;

    }



    if (strings[value] == NULL) {

        error_set(errp, QERR_INVALID_PARAMETER, enum_str);

        g_free(enum_str);

        return;

    }



    g_free(enum_str);

    *obj = value;

}

void input_type_enum(Visitor *v, int *obj, const char *strings[],

                     const char *kind, const char *name,

                     Error **errp)

{

    int64_t value = 0;

    char *enum_str;



    assert(strings);



    visit_type_str(v, &enum_str, name, errp);

    if (error_is_set(errp)) {

        return;

    }



    while (strings[value] != NULL) {

        if (strcmp(strings[value], enum_str) == 0) {

            break;

        }

        value++;

    }



    if (strings[value] == NULL) {

        error_set(errp, QERR_INVALID_PARAMETER, enum_str);

        g_free(enum_str);

        return;

    }



    g_free(enum_str);

    *obj = value;

}

    visit_type_str(v, &enum_str, name, errp);     if (error_is_set(errp)) {     if (error_is_set(errp)) {             break;
void FUNC_0(Visitor *VAR_0, int *VAR_1, const char *VAR_2[],

                     const char *VAR_3, const char *VAR_4,

                     Error **VAR_5)

{

    int64_t value = 0;

    char *VAR_6;



    assert(VAR_2);



    visit_type_str(VAR_0, &VAR_6, VAR_4, VAR_5);

    if (error_is_set(VAR_5)) {

        return;

    }



    while (VAR_2[value] != NULL) {

        if (strcmp(VAR_2[value], VAR_6) == 0) {

            break;

        }

        value++;

    }



    if (VAR_2[value] == NULL) {

        error_set(VAR_5, QERR_INVALID_PARAMETER, VAR_6);

        g_free(VAR_6);

        return;

    }



    g_free(VAR_6);

    *VAR_1 = value;

}

void FUNC_0(Visitor *VAR_0, int *VAR_1, const char *VAR_2[],
const char *VAR_3, const char *VAR_4,
Error **VAR_5)
{ int64_t value = 0; char *VAR_6; assert(VAR_2); visit_type_str(VAR_0, &VAR_6, VAR_4, VAR_5); if (error_is_set(VAR_5)) { return; } while (VAR_2[value] != NULL) { if (strcmp(VAR_2[value], VAR_6) == 0) { break; } value++; } if (VAR_2[value] == NULL) { error_set(VAR_5, QERR_INVALID_PARAMETER, VAR_6); g_free(VAR_6); return; } g_free(VAR_6); *VAR_1 = value; }