static const char *keyval_parse_one(QDict *qdict, const char *params,

                                    const char *implied_key,

                                    Error **errp)

{

    const char *key, *key_end, *s;

    size_t len;

    char key_in_cur[128];

    QDict *cur;

    int ret;

    QObject *next;

    QString *val;



    key = params;

    len = strcspn(params, "=,");

    if (implied_key && len && key[len] != '=') {

        /* Desugar implied key */

        key = implied_key;

        len = strlen(implied_key);

    }

    key_end = key + len;



    /*

     * Loop over key fragments: @s points to current fragment, it

     * applies to @cur.  @key_in_cur[] holds the previous fragment.

     */

    cur = qdict;

    s = key;

    for (;;) {

        ret = parse_qapi_name(s, false);

        len = ret < 0 ? 0 : ret;

        assert(s + len <= key_end);

        if (!len || (s + len < key_end && s[len] != '.')) {

            assert(key != implied_key);

            error_setg(errp, "Invalid parameter '%.*s'",

                       (int)(key_end - key), key);

            return NULL;

        }

        if (len >= sizeof(key_in_cur)) {

            assert(key != implied_key);

            error_setg(errp, "Parameter%s '%.*s' is too long",

                       s != key || s + len != key_end ? " fragment" : "",

                       (int)len, s);

            return NULL;

        }



        if (s != key) {

            next = keyval_parse_put(cur, key_in_cur, NULL,

                                    key, s - 1, errp);

            if (!next) {

                return NULL;

            }

            cur = qobject_to_qdict(next);

            assert(cur);

        }



        memcpy(key_in_cur, s, len);

        key_in_cur[len] = 0;

        s += len;



        if (*s != '.') {

            break;

        }

        s++;

    }



    if (key == implied_key) {

        assert(!*s);

        s = params;

    } else {

        if (*s != '=') {

            error_setg(errp, "Expected '=' after parameter '%.*s'",

                       (int)(s - key), key);

            return NULL;

        }

        s++;

    }



    val = qstring_new();

    for (;;) {

        if (!*s) {

            break;

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

            s++;

            if (*s != ',') {

                break;

            }

        }

        qstring_append_chr(val, *s++);

    }



    if (!keyval_parse_put(cur, key_in_cur, val, key, key_end, errp)) {

        return NULL;

    }

    return s;

}

static const char *keyval_parse_one(QDict *qdict, const char *params,

                                    const char *implied_key,

                                    Error **errp)

{

    const char *key, *key_end, *s;

    size_t len;

    char key_in_cur[128];

    QDict *cur;

    int ret;

    QObject *next;

    QString *val;



    key = params;

    len = strcspn(params, "=,");

    if (implied_key && len && key[len] != '=') {

        

        key = implied_key;

        len = strlen(implied_key);

    }

    key_end = key + len;



    







    cur = qdict;

    s = key;

    for (;;) {

        ret = parse_qapi_name(s, false);

        len = ret < 0 ? 0 : ret;

        assert(s + len <= key_end);

        if (!len || (s + len < key_end && s[len] != '.')) {

            assert(key != implied_key);

            error_setg(errp, "Invalid parameter '%.*s'",

                       (int)(key_end - key), key);

            return NULL;

        }

        if (len >= sizeof(key_in_cur)) {

            assert(key != implied_key);

            error_setg(errp, "Parameter%s '%.*s' is too long",

                       s != key || s + len != key_end ? " fragment" : "",

                       (int)len, s);

            return NULL;

        }



        if (s != key) {

            next = keyval_parse_put(cur, key_in_cur, NULL,

                                    key, s - 1, errp);

            if (!next) {

                return NULL;

            }

            cur = qobject_to_qdict(next);

            assert(cur);

        }



        memcpy(key_in_cur, s, len);

        key_in_cur[len] = 0;

        s += len;



        if (*s != '.') {

            break;

        }

        s++;

    }



    if (key == implied_key) {

        assert(!*s);

        s = params;

    } else {

        if (*s != '=') {

            error_setg(errp, "Expected '=' after parameter '%.*s'",

                       (int)(s - key), key);

            return NULL;

        }

        s++;

    }



    val = qstring_new();

    for (;;) {

        if (!*s) {

            break;

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

            s++;

            if (*s != ',') {

                break;

            }

        }

        qstring_append_chr(val, *s++);

    }



    if (!keyval_parse_put(cur, key_in_cur, val, key, key_end, errp)) {

        return NULL;

    }

    return s;

}

    const char *key, *key_end, *s;         ret = parse_qapi_name(s, false);         len = ret < 0 ? 0 : ret;
static const char *FUNC_0(QDict *VAR_0, const char *VAR_1,

                                    const char *VAR_2,

                                    Error **VAR_3)

{

    const char *VAR_4, *VAR_5, *VAR_6;

    size_t len;

    char VAR_7[128];

    QDict *cur;

    int VAR_8;

    QObject *next;

    QString *val;



    VAR_4 = VAR_1;

    len = strcspn(VAR_1, "=,");

    if (VAR_2 && len && VAR_4[len] != '=') {

        

        VAR_4 = VAR_2;

        len = strlen(VAR_2);

    }

    VAR_5 = VAR_4 + len;



    







    cur = VAR_0;

    VAR_6 = VAR_4;

    for (;;) {

        VAR_8 = parse_qapi_name(VAR_6, false);

        len = VAR_8 < 0 ? 0 : VAR_8;

        assert(VAR_6 + len <= VAR_5);

        if (!len || (VAR_6 + len < VAR_5 && VAR_6[len] != '.')) {

            assert(VAR_4 != VAR_2);

            error_setg(VAR_3, "Invalid parameter '%.*VAR_6'",

                       (int)(VAR_5 - VAR_4), VAR_4);

            return NULL;

        }

        if (len >= sizeof(VAR_7)) {

            assert(VAR_4 != VAR_2);

            error_setg(VAR_3, "Parameter%VAR_6 '%.*VAR_6' is too long",

                       VAR_6 != VAR_4 || VAR_6 + len != VAR_5 ? " fragment" : "",

                       (int)len, VAR_6);

            return NULL;

        }



        if (VAR_6 != VAR_4) {

            next = keyval_parse_put(cur, VAR_7, NULL,

                                    VAR_4, VAR_6 - 1, VAR_3);

            if (!next) {

                return NULL;

            }

            cur = qobject_to_qdict(next);

            assert(cur);

        }



        memcpy(VAR_7, VAR_6, len);

        VAR_7[len] = 0;

        VAR_6 += len;



        if (*VAR_6 != '.') {

            break;

        }

        VAR_6++;

    }



    if (VAR_4 == VAR_2) {

        assert(!*VAR_6);

        VAR_6 = VAR_1;

    } else {

        if (*VAR_6 != '=') {

            error_setg(VAR_3, "Expected '=' after parameter '%.*VAR_6'",

                       (int)(VAR_6 - VAR_4), VAR_4);

            return NULL;

        }

        VAR_6++;

    }



    val = qstring_new();

    for (;;) {

        if (!*VAR_6) {

            break;

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

            VAR_6++;

            if (*VAR_6 != ',') {

                break;

            }

        }

        qstring_append_chr(val, *VAR_6++);

    }



    if (!keyval_parse_put(cur, VAR_7, val, VAR_4, VAR_5, VAR_3)) {

        return NULL;

    }

    return VAR_6;

}

static const char *FUNC_0(QDict *VAR_0, const char *VAR_1,
const char *VAR_2,
Error **VAR_3)
{ const char *VAR_4, *VAR_5, *VAR_6; size_t len; char VAR_7[128]; QDict *cur; int VAR_8; QObject *next; QString *val; VAR_4 = VAR_1; len = strcspn(VAR_1, "=,"); if (VAR_2 && len && VAR_4[len] != '=') { VAR_4 = VAR_2; len = strlen(VAR_2); } VAR_5 = VAR_4 + len; cur = VAR_0; VAR_6 = VAR_4; for (;;) { VAR_8 = parse_qapi_name(VAR_6, false); len = VAR_8 < 0 ? 0 : VAR_8; assert(VAR_6 + len <= VAR_5); if (!len || (VAR_6 + len < VAR_5 && VAR_6[len] != '.')) { assert(VAR_4 != VAR_2); error_setg(VAR_3, "Invalid parameter '%.*VAR_6'",
(int)(VAR_5 - VAR_4), VAR_4); return NULL; } if (len >= sizeof(VAR_7)) { assert(VAR_4 != VAR_2); error_setg(VAR_3, "Parameter%VAR_6 '%.*VAR_6' is too long",
VAR_6 != VAR_4 || VAR_6 + len != VAR_5 ? " fragment" : "",
(int)len, VAR_6); return NULL; } if (VAR_6 != VAR_4) { next = keyval_parse_put(cur, VAR_7, NULL,
VAR_4, VAR_6 - 1, VAR_3); if (!next) { return NULL; } cur = qobject_to_qdict(next); assert(cur); } memcpy(VAR_7, VAR_6, len); VAR_7[len] = 0; VAR_6 += len; if (*VAR_6 != '.') { break; } VAR_6++; } if (VAR_4 == VAR_2) { assert(!*VAR_6); VAR_6 = VAR_1; } else { if (*VAR_6 != '=') { error_setg(VAR_3, "Expected '=' after parameter '%.*VAR_6'",
(int)(VAR_6 - VAR_4), VAR_4); return NULL; } VAR_6++; } val = qstring_new(); for (;;) { if (!*VAR_6) { break; } else if (*VAR_6 == ',') { VAR_6++; if (*VAR_6 != ',') { break; } } qstring_append_chr(val, *VAR_6++); } if (!keyval_parse_put(cur, VAR_7, val, VAR_4, VAR_5, VAR_3)) { return NULL; } return VAR_6; }