static int parse_str(StringInputVisitor *siv, const char *name, Error **errp)

{

    char *str = (char *) siv->string;

    long long start, end;

    Range *cur;

    char *endptr;



    if (siv->ranges) {

        return 0;

    }



    do {

        errno = 0;

        start = strtoll(str, &endptr, 0);

        if (errno == 0 && endptr > str) {

            if (*endptr == '\0') {

                cur = g_malloc0(sizeof(*cur));

                cur->begin = start;

                cur->end = start + 1;

                siv->ranges = range_list_insert(siv->ranges, cur);

                cur = NULL;

                str = NULL;

            } else if (*endptr == '-') {

                str = endptr + 1;

                errno = 0;

                end = strtoll(str, &endptr, 0);

                if (errno == 0 && endptr > str && start <= end &&

                    (start > INT64_MAX - 65536 ||

                     end < start + 65536)) {

                    if (*endptr == '\0') {

                        cur = g_malloc0(sizeof(*cur));

                        cur->begin = start;

                        cur->end = end + 1;

                        siv->ranges = range_list_insert(siv->ranges, cur);

                        cur = NULL;

                        str = NULL;

                    } else if (*endptr == ',') {

                        str = endptr + 1;

                        cur = g_malloc0(sizeof(*cur));

                        cur->begin = start;

                        cur->end = end + 1;

                        siv->ranges = range_list_insert(siv->ranges, cur);

                        cur = NULL;

                    } else {

                        goto error;

                    }

                } else {

                    goto error;

                }

            } else if (*endptr == ',') {

                str = endptr + 1;

                cur = g_malloc0(sizeof(*cur));

                cur->begin = start;

                cur->end = start + 1;

                siv->ranges = range_list_insert(siv->ranges, cur);

                cur = NULL;

            } else {

                goto error;

            }

        } else {

            goto error;

        }

    } while (str);



    return 0;

error:

    g_list_foreach(siv->ranges, free_range, NULL);

    g_list_free(siv->ranges);

    siv->ranges = NULL;

    error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",

               "an int64 value or range");

    return -1;

}

static int parse_str(StringInputVisitor *siv, const char *name, Error **errp)

{

    char *str = (char *) siv->string;

    long long start, end;

    Range *cur;

    char *endptr;



    if (siv->ranges) {

        return 0;

    }



    do {

        errno = 0;

        start = strtoll(str, &endptr, 0);

        if (errno == 0 && endptr > str) {

            if (*endptr == '\0') {

                cur = g_malloc0(sizeof(*cur));

                cur->begin = start;

                cur->end = start + 1;

                siv->ranges = range_list_insert(siv->ranges, cur);

                cur = NULL;

                str = NULL;

            } else if (*endptr == '-') {

                str = endptr + 1;

                errno = 0;

                end = strtoll(str, &endptr, 0);

                if (errno == 0 && endptr > str && start <= end &&

                    (start > INT64_MAX - 65536 ||

                     end < start + 65536)) {

                    if (*endptr == '\0') {

                        cur = g_malloc0(sizeof(*cur));

                        cur->begin = start;

                        cur->end = end + 1;

                        siv->ranges = range_list_insert(siv->ranges, cur);

                        cur = NULL;

                        str = NULL;

                    } else if (*endptr == ',') {

                        str = endptr + 1;

                        cur = g_malloc0(sizeof(*cur));

                        cur->begin = start;

                        cur->end = end + 1;

                        siv->ranges = range_list_insert(siv->ranges, cur);

                        cur = NULL;

                    } else {

                        goto error;

                    }

                } else {

                    goto error;

                }

            } else if (*endptr == ',') {

                str = endptr + 1;

                cur = g_malloc0(sizeof(*cur));

                cur->begin = start;

                cur->end = start + 1;

                siv->ranges = range_list_insert(siv->ranges, cur);

                cur = NULL;

            } else {

                goto error;

            }

        } else {

            goto error;

        }

    } while (str);



    return 0;

error:

    g_list_foreach(siv->ranges, free_range, NULL);

    g_list_free(siv->ranges);

    siv->ranges = NULL;

    error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",

               "an int64 value or range");

    return -1;

}

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

{

    char *VAR_3 = (char *) VAR_0->string;

    long long VAR_4, VAR_5;

    Range *cur;

    char *VAR_6;



    if (VAR_0->ranges) {

        return 0;

    }



    do {

        errno = 0;

        VAR_4 = strtoll(VAR_3, &VAR_6, 0);

        if (errno == 0 && VAR_6 > VAR_3) {

            if (*VAR_6 == '\0') {

                cur = g_malloc0(sizeof(*cur));

                cur->begin = VAR_4;

                cur->VAR_5 = VAR_4 + 1;

                VAR_0->ranges = range_list_insert(VAR_0->ranges, cur);

                cur = NULL;

                VAR_3 = NULL;

            } else if (*VAR_6 == '-') {

                VAR_3 = VAR_6 + 1;

                errno = 0;

                VAR_5 = strtoll(VAR_3, &VAR_6, 0);

                if (errno == 0 && VAR_6 > VAR_3 && VAR_4 <= VAR_5 &&

                    (VAR_4 > INT64_MAX - 65536 ||

                     VAR_5 < VAR_4 + 65536)) {

                    if (*VAR_6 == '\0') {

                        cur = g_malloc0(sizeof(*cur));

                        cur->begin = VAR_4;

                        cur->VAR_5 = VAR_5 + 1;

                        VAR_0->ranges = range_list_insert(VAR_0->ranges, cur);

                        cur = NULL;

                        VAR_3 = NULL;

                    } else if (*VAR_6 == ',') {

                        VAR_3 = VAR_6 + 1;

                        cur = g_malloc0(sizeof(*cur));

                        cur->begin = VAR_4;

                        cur->VAR_5 = VAR_5 + 1;

                        VAR_0->ranges = range_list_insert(VAR_0->ranges, cur);

                        cur = NULL;

                    } else {

                        goto error;

                    }

                } else {

                    goto error;

                }

            } else if (*VAR_6 == ',') {

                VAR_3 = VAR_6 + 1;

                cur = g_malloc0(sizeof(*cur));

                cur->begin = VAR_4;

                cur->VAR_5 = VAR_4 + 1;

                VAR_0->ranges = range_list_insert(VAR_0->ranges, cur);

                cur = NULL;

            } else {

                goto error;

            }

        } else {

            goto error;

        }

    } while (VAR_3);



    return 0;

error:

    g_list_foreach(VAR_0->ranges, free_range, NULL);

    g_list_free(VAR_0->ranges);

    VAR_0->ranges = NULL;

    error_setg(VAR_2, QERR_INVALID_PARAMETER_VALUE, VAR_1 ? VAR_1 : "null",

               "an int64 value or range");

    return -1;

}

static int FUNC_0(StringInputVisitor *VAR_0, const char *VAR_1, Error **VAR_2)
{ char *VAR_3 = (char *) VAR_0->string; long long VAR_4, VAR_5; Range *cur; char *VAR_6; if (VAR_0->ranges) { return 0; } do { errno = 0; VAR_4 = strtoll(VAR_3, &VAR_6, 0); if (errno == 0 && VAR_6 > VAR_3) { if (*VAR_6 == '\0') { cur = g_malloc0(sizeof(*cur)); cur->begin = VAR_4; cur->VAR_5 = VAR_4 + 1; VAR_0->ranges = range_list_insert(VAR_0->ranges, cur); cur = NULL; VAR_3 = NULL; } else if (*VAR_6 == '-') { VAR_3 = VAR_6 + 1; errno = 0; VAR_5 = strtoll(VAR_3, &VAR_6, 0); if (errno == 0 && VAR_6 > VAR_3 && VAR_4 <= VAR_5 &&
(VAR_4 > INT64_MAX - 65536 ||
VAR_5 < VAR_4 + 65536)) { if (*VAR_6 == '\0') { cur = g_malloc0(sizeof(*cur)); cur->begin = VAR_4; cur->VAR_5 = VAR_5 + 1; VAR_0->ranges = range_list_insert(VAR_0->ranges, cur); cur = NULL; VAR_3 = NULL; } else if (*VAR_6 == ',') { VAR_3 = VAR_6 + 1; cur = g_malloc0(sizeof(*cur)); cur->begin = VAR_4; cur->VAR_5 = VAR_5 + 1; VAR_0->ranges = range_list_insert(VAR_0->ranges, cur); cur = NULL; } else { goto error; } } else { goto error; } } else if (*VAR_6 == ',') { VAR_3 = VAR_6 + 1; cur = g_malloc0(sizeof(*cur)); cur->begin = VAR_4; cur->VAR_5 = VAR_4 + 1; VAR_0->ranges = range_list_insert(VAR_0->ranges, cur); cur = NULL; } else { goto error; } } else { goto error; } } while (VAR_3); return 0; error:
g_list_foreach(VAR_0->ranges, free_range, NULL); g_list_free(VAR_0->ranges); VAR_0->ranges = NULL; error_setg(VAR_2, QERR_INVALID_PARAMETER_VALUE, VAR_1 ? VAR_1 : "null",
"an int64 value or range"); return -1; }