static QDict *monitor_parse_arguments(Monitor *mon,

                                      const char **endp,

                                      const mon_cmd_t *cmd)

{

    const char *typestr;

    char *key;

    int c;

    const char *p = *endp;

    char buf[1024];

    QDict *qdict = qdict_new();



    /* parse the parameters */

    typestr = cmd->args_type;

    for(;;) {

        typestr = key_get_info(typestr, &key);

        if (!typestr)

            break;

        c = *typestr;

        typestr++;

        switch(c) {

        case 'F':

        case 'B':

        case 's':

            {

                int ret;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?') {

                    typestr++;

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

                        /* no optional string: NULL argument */

                        break;

                    }

                }

                ret = get_str(buf, sizeof(buf), &p);

                if (ret < 0) {

                    switch(c) {

                    case 'F':

                        monitor_printf(mon, "%s: filename expected\n",

                                       cmd->name);

                        break;

                    case 'B':

                        monitor_printf(mon, "%s: block device name expected\n",

                                       cmd->name);

                        break;

                    default:

                        monitor_printf(mon, "%s: string expected\n", cmd->name);

                        break;

                    }

                    goto fail;

                }

                qdict_put(qdict, key, qstring_from_str(buf));

            }

            break;

        case 'O':

            {

                QemuOptsList *opts_list;

                QemuOpts *opts;



                opts_list = qemu_find_opts(key);

                if (!opts_list || opts_list->desc->name) {

                    goto bad_type;

                }

                while (qemu_isspace(*p)) {

                    p++;

                }

                if (!*p)

                    break;

                if (get_str(buf, sizeof(buf), &p) < 0) {

                    goto fail;

                }

                opts = qemu_opts_parse_noisily(opts_list, buf, true);

                if (!opts) {

                    goto fail;

                }

                qemu_opts_to_qdict(opts, qdict);

                qemu_opts_del(opts);

            }

            break;

        case '/':

            {

                int count, format, size;



                while (qemu_isspace(*p))

                    p++;

                if (*p == '/') {

                    /* format found */

                    p++;

                    count = 1;

                    if (qemu_isdigit(*p)) {

                        count = 0;

                        while (qemu_isdigit(*p)) {

                            count = count * 10 + (*p - '0');

                            p++;

                        }

                    }

                    size = -1;

                    format = -1;

                    for(;;) {

                        switch(*p) {

                        case 'o':

                        case 'd':

                        case 'u':

                        case 'x':

                        case 'i':

                        case 'c':

                            format = *p++;

                            break;

                        case 'b':

                            size = 1;

                            p++;

                            break;

                        case 'h':

                            size = 2;

                            p++;

                            break;

                        case 'w':

                            size = 4;

                            p++;

                            break;

                        case 'g':

                        case 'L':

                            size = 8;

                            p++;

                            break;

                        default:

                            goto next;

                        }

                    }

                next:

                    if (*p != '\0' && !qemu_isspace(*p)) {

                        monitor_printf(mon, "invalid char in format: '%c'\n",

                                       *p);

                        goto fail;

                    }

                    if (format < 0)

                        format = default_fmt_format;

                    if (format != 'i') {

                        /* for 'i', not specifying a size gives -1 as size */

                        if (size < 0)

                            size = default_fmt_size;

                        default_fmt_size = size;

                    }

                    default_fmt_format = format;

                } else {

                    count = 1;

                    format = default_fmt_format;

                    if (format != 'i') {

                        size = default_fmt_size;

                    } else {

                        size = -1;

                    }

                }

                qdict_put(qdict, "count", qint_from_int(count));

                qdict_put(qdict, "format", qint_from_int(format));

                qdict_put(qdict, "size", qint_from_int(size));

            }

            break;

        case 'i':

        case 'l':

        case 'M':

            {

                int64_t val;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?' || *typestr == '.') {

                    if (*typestr == '?') {

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

                            typestr++;

                            break;

                        }

                    } else {

                        if (*p == '.') {

                            p++;

                            while (qemu_isspace(*p))

                                p++;

                        } else {

                            typestr++;

                            break;

                        }

                    }

                    typestr++;

                }

                if (get_expr(mon, &val, &p))

                    goto fail;

                /* Check if 'i' is greater than 32-bit */

                if ((c == 'i') && ((val >> 32) & 0xffffffff)) {

                    monitor_printf(mon, "\'%s\' has failed: ", cmd->name);

                    monitor_printf(mon, "integer is for 32-bit values\n");

                    goto fail;

                } else if (c == 'M') {

                    if (val < 0) {

                        monitor_printf(mon, "enter a positive value\n");

                        goto fail;

                    }

                    val <<= 20;

                }

                qdict_put(qdict, key, qint_from_int(val));

            }

            break;

        case 'o':

            {

                int64_t val;

                char *end;



                while (qemu_isspace(*p)) {

                    p++;

                }

                if (*typestr == '?') {

                    typestr++;

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

                        break;

                    }

                }

                val = qemu_strtosz_MiB(p, &end);

                if (val < 0) {

                    monitor_printf(mon, "invalid size\n");

                    goto fail;

                }

                qdict_put(qdict, key, qint_from_int(val));

                p = end;

            }

            break;

        case 'T':

            {

                double val;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?') {

                    typestr++;

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

                        break;

                    }

                }

                if (get_double(mon, &val, &p) < 0) {

                    goto fail;

                }

                if (p[0] && p[1] == 's') {

                    switch (*p) {

                    case 'm':

                        val /= 1e3; p += 2; break;

                    case 'u':

                        val /= 1e6; p += 2; break;

                    case 'n':

                        val /= 1e9; p += 2; break;

                    }

                }

                if (*p && !qemu_isspace(*p)) {

                    monitor_printf(mon, "Unknown unit suffix\n");

                    goto fail;

                }

                qdict_put(qdict, key, qfloat_from_double(val));

            }

            break;

        case 'b':

            {

                const char *beg;

                bool val;



                while (qemu_isspace(*p)) {

                    p++;

                }

                beg = p;

                while (qemu_isgraph(*p)) {

                    p++;

                }

                if (p - beg == 2 && !memcmp(beg, "on", p - beg)) {

                    val = true;

                } else if (p - beg == 3 && !memcmp(beg, "off", p - beg)) {

                    val = false;

                } else {

                    monitor_printf(mon, "Expected 'on' or 'off'\n");

                    goto fail;

                }

                qdict_put(qdict, key, qbool_from_bool(val));

            }

            break;

        case '-':

            {

                const char *tmp = p;

                int skip_key = 0;

                /* option */



                c = *typestr++;

                if (c == '\0')

                    goto bad_type;

                while (qemu_isspace(*p))

                    p++;

                if (*p == '-') {

                    p++;

                    if(c != *p) {

                        if(!is_valid_option(p, typestr)) {

                  

                            monitor_printf(mon, "%s: unsupported option -%c\n",

                                           cmd->name, *p);

                            goto fail;

                        } else {

                            skip_key = 1;

                        }

                    }

                    if(skip_key) {

                        p = tmp;

                    } else {

                        /* has option */

                        p++;

                        qdict_put(qdict, key, qbool_from_bool(true));

                    }

                }

            }

            break;

        case 'S':

            {

                /* package all remaining string */

                int len;



                while (qemu_isspace(*p)) {

                    p++;

                }

                if (*typestr == '?') {

                    typestr++;

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

                        /* no remaining string: NULL argument */

                        break;

                    }

                }

                len = strlen(p);

                if (len <= 0) {

                    monitor_printf(mon, "%s: string expected\n",

                                   cmd->name);

                    goto fail;

                }

                qdict_put(qdict, key, qstring_from_str(p));

                p += len;

            }

            break;

        default:

        bad_type:

            monitor_printf(mon, "%s: unknown type '%c'\n", cmd->name, c);

            goto fail;

        }

        g_free(key);

        key = NULL;

    }

    /* check that all arguments were parsed */

    while (qemu_isspace(*p))

        p++;

    if (*p != '\0') {

        monitor_printf(mon, "%s: extraneous characters at the end of line\n",

                       cmd->name);

        goto fail;

    }



    return qdict;



fail:

    QDECREF(qdict);

    g_free(key);

    return NULL;

}

static QDict *monitor_parse_arguments(Monitor *mon,

                                      const char **endp,

                                      const mon_cmd_t *cmd)

{

    const char *typestr;

    char *key;

    int c;

    const char *p = *endp;

    char buf[1024];

    QDict *qdict = qdict_new();



    

    typestr = cmd->args_type;

    for(;;) {

        typestr = key_get_info(typestr, &key);

        if (!typestr)

            break;

        c = *typestr;

        typestr++;

        switch(c) {

        case 'F':

        case 'B':

        case 's':

            {

                int ret;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?') {

                    typestr++;

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

                        

                        break;

                    }

                }

                ret = get_str(buf, sizeof(buf), &p);

                if (ret < 0) {

                    switch(c) {

                    case 'F':

                        monitor_printf(mon, "%s: filename expected\n",

                                       cmd->name);

                        break;

                    case 'B':

                        monitor_printf(mon, "%s: block device name expected\n",

                                       cmd->name);

                        break;

                    default:

                        monitor_printf(mon, "%s: string expected\n", cmd->name);

                        break;

                    }

                    goto fail;

                }

                qdict_put(qdict, key, qstring_from_str(buf));

            }

            break;

        case 'O':

            {

                QemuOptsList *opts_list;

                QemuOpts *opts;



                opts_list = qemu_find_opts(key);

                if (!opts_list || opts_list->desc->name) {

                    goto bad_type;

                }

                while (qemu_isspace(*p)) {

                    p++;

                }

                if (!*p)

                    break;

                if (get_str(buf, sizeof(buf), &p) < 0) {

                    goto fail;

                }

                opts = qemu_opts_parse_noisily(opts_list, buf, true);

                if (!opts) {

                    goto fail;

                }

                qemu_opts_to_qdict(opts, qdict);

                qemu_opts_del(opts);

            }

            break;

        case '/':

            {

                int count, format, size;



                while (qemu_isspace(*p))

                    p++;

                if (*p == '/') {

                    

                    p++;

                    count = 1;

                    if (qemu_isdigit(*p)) {

                        count = 0;

                        while (qemu_isdigit(*p)) {

                            count = count * 10 + (*p - '0');

                            p++;

                        }

                    }

                    size = -1;

                    format = -1;

                    for(;;) {

                        switch(*p) {

                        case 'o':

                        case 'd':

                        case 'u':

                        case 'x':

                        case 'i':

                        case 'c':

                            format = *p++;

                            break;

                        case 'b':

                            size = 1;

                            p++;

                            break;

                        case 'h':

                            size = 2;

                            p++;

                            break;

                        case 'w':

                            size = 4;

                            p++;

                            break;

                        case 'g':

                        case 'L':

                            size = 8;

                            p++;

                            break;

                        default:

                            goto next;

                        }

                    }

                next:

                    if (*p != '\0' && !qemu_isspace(*p)) {

                        monitor_printf(mon, "invalid char in format: '%c'\n",

                                       *p);

                        goto fail;

                    }

                    if (format < 0)

                        format = default_fmt_format;

                    if (format != 'i') {

                        

                        if (size < 0)

                            size = default_fmt_size;

                        default_fmt_size = size;

                    }

                    default_fmt_format = format;

                } else {

                    count = 1;

                    format = default_fmt_format;

                    if (format != 'i') {

                        size = default_fmt_size;

                    } else {

                        size = -1;

                    }

                }

                qdict_put(qdict, "count", qint_from_int(count));

                qdict_put(qdict, "format", qint_from_int(format));

                qdict_put(qdict, "size", qint_from_int(size));

            }

            break;

        case 'i':

        case 'l':

        case 'M':

            {

                int64_t val;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?' || *typestr == '.') {

                    if (*typestr == '?') {

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

                            typestr++;

                            break;

                        }

                    } else {

                        if (*p == '.') {

                            p++;

                            while (qemu_isspace(*p))

                                p++;

                        } else {

                            typestr++;

                            break;

                        }

                    }

                    typestr++;

                }

                if (get_expr(mon, &val, &p))

                    goto fail;

                

                if ((c == 'i') && ((val >> 32) & 0xffffffff)) {

                    monitor_printf(mon, "\'%s\' has failed: ", cmd->name);

                    monitor_printf(mon, "integer is for 32-bit values\n");

                    goto fail;

                } else if (c == 'M') {

                    if (val < 0) {

                        monitor_printf(mon, "enter a positive value\n");

                        goto fail;

                    }

                    val <<= 20;

                }

                qdict_put(qdict, key, qint_from_int(val));

            }

            break;

        case 'o':

            {

                int64_t val;

                char *end;



                while (qemu_isspace(*p)) {

                    p++;

                }

                if (*typestr == '?') {

                    typestr++;

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

                        break;

                    }

                }

                val = qemu_strtosz_MiB(p, &end);

                if (val < 0) {

                    monitor_printf(mon, "invalid size\n");

                    goto fail;

                }

                qdict_put(qdict, key, qint_from_int(val));

                p = end;

            }

            break;

        case 'T':

            {

                double val;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?') {

                    typestr++;

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

                        break;

                    }

                }

                if (get_double(mon, &val, &p) < 0) {

                    goto fail;

                }

                if (p[0] && p[1] == 's') {

                    switch (*p) {

                    case 'm':

                        val /= 1e3; p += 2; break;

                    case 'u':

                        val /= 1e6; p += 2; break;

                    case 'n':

                        val /= 1e9; p += 2; break;

                    }

                }

                if (*p && !qemu_isspace(*p)) {

                    monitor_printf(mon, "Unknown unit suffix\n");

                    goto fail;

                }

                qdict_put(qdict, key, qfloat_from_double(val));

            }

            break;

        case 'b':

            {

                const char *beg;

                bool val;



                while (qemu_isspace(*p)) {

                    p++;

                }

                beg = p;

                while (qemu_isgraph(*p)) {

                    p++;

                }

                if (p - beg == 2 && !memcmp(beg, "on", p - beg)) {

                    val = true;

                } else if (p - beg == 3 && !memcmp(beg, "off", p - beg)) {

                    val = false;

                } else {

                    monitor_printf(mon, "Expected 'on' or 'off'\n");

                    goto fail;

                }

                qdict_put(qdict, key, qbool_from_bool(val));

            }

            break;

        case '-':

            {

                const char *tmp = p;

                int skip_key = 0;

                



                c = *typestr++;

                if (c == '\0')

                    goto bad_type;

                while (qemu_isspace(*p))

                    p++;

                if (*p == '-') {

                    p++;

                    if(c != *p) {

                        if(!is_valid_option(p, typestr)) {

                  

                            monitor_printf(mon, "%s: unsupported option -%c\n",

                                           cmd->name, *p);

                            goto fail;

                        } else {

                            skip_key = 1;

                        }

                    }

                    if(skip_key) {

                        p = tmp;

                    } else {

                        

                        p++;

                        qdict_put(qdict, key, qbool_from_bool(true));

                    }

                }

            }

            break;

        case 'S':

            {

                

                int len;



                while (qemu_isspace(*p)) {

                    p++;

                }

                if (*typestr == '?') {

                    typestr++;

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

                        

                        break;

                    }

                }

                len = strlen(p);

                if (len <= 0) {

                    monitor_printf(mon, "%s: string expected\n",

                                   cmd->name);

                    goto fail;

                }

                qdict_put(qdict, key, qstring_from_str(p));

                p += len;

            }

            break;

        default:

        bad_type:

            monitor_printf(mon, "%s: unknown type '%c'\n", cmd->name, c);

            goto fail;

        }

        g_free(key);

        key = NULL;

    }

    

    while (qemu_isspace(*p))

        p++;

    if (*p != '\0') {

        monitor_printf(mon, "%s: extraneous characters at the end of line\n",

                       cmd->name);

        goto fail;

    }



    return qdict;



fail:

    QDECREF(qdict);

    g_free(key);

    return NULL;

}

static QDict *FUNC_0(Monitor *mon,

                                      const char **endp,

                                      const mon_cmd_t *cmd)

{

    const char *VAR_0;

    char *VAR_1;

    int VAR_2;

    const char *VAR_3 = *endp;

    char VAR_4[1024];

    QDict *qdict = qdict_new();



    

    VAR_0 = cmd->args_type;

    for(;;) {

        VAR_0 = key_get_info(VAR_0, &VAR_1);

        if (!VAR_0)

            break;

        VAR_2 = *VAR_0;

        VAR_0++;

        switch(VAR_2) {

        case 'F':

        case 'B':

        case 's':

            {

                int VAR_5;



                while (qemu_isspace(*VAR_3))

                    VAR_3++;

                if (*VAR_0 == '?') {

                    VAR_0++;

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

                        

                        break;

                    }

                }

                VAR_5 = get_str(VAR_4, sizeof(VAR_4), &VAR_3);

                if (VAR_5 < 0) {

                    switch(VAR_2) {

                    case 'F':

                        monitor_printf(mon, "%s: filename expected\n",

                                       cmd->name);

                        break;

                    case 'B':

                        monitor_printf(mon, "%s: block device name expected\n",

                                       cmd->name);

                        break;

                    default:

                        monitor_printf(mon, "%s: string expected\n", cmd->name);

                        break;

                    }

                    goto fail;

                }

                qdict_put(qdict, VAR_1, qstring_from_str(VAR_4));

            }

            break;

        case 'O':

            {

                QemuOptsList *opts_list;

                QemuOpts *opts;



                opts_list = qemu_find_opts(VAR_1);

                if (!opts_list || opts_list->desc->name) {

                    goto bad_type;

                }

                while (qemu_isspace(*VAR_3)) {

                    VAR_3++;

                }

                if (!*VAR_3)

                    break;

                if (get_str(VAR_4, sizeof(VAR_4), &VAR_3) < 0) {

                    goto fail;

                }

                opts = qemu_opts_parse_noisily(opts_list, VAR_4, true);

                if (!opts) {

                    goto fail;

                }

                qemu_opts_to_qdict(opts, qdict);

                qemu_opts_del(opts);

            }

            break;

        case '/':

            {

                int VAR_6, VAR_7, VAR_8;



                while (qemu_isspace(*VAR_3))

                    VAR_3++;

                if (*VAR_3 == '/') {

                    

                    VAR_3++;

                    VAR_6 = 1;

                    if (qemu_isdigit(*VAR_3)) {

                        VAR_6 = 0;

                        while (qemu_isdigit(*VAR_3)) {

                            VAR_6 = VAR_6 * 10 + (*VAR_3 - '0');

                            VAR_3++;

                        }

                    }

                    VAR_8 = -1;

                    VAR_7 = -1;

                    for(;;) {

                        switch(*VAR_3) {

                        case 'o':

                        case 'd':

                        case 'u':

                        case 'x':

                        case 'i':

                        case 'VAR_2':

                            VAR_7 = *VAR_3++;

                            break;

                        case 'b':

                            VAR_8 = 1;

                            VAR_3++;

                            break;

                        case 'h':

                            VAR_8 = 2;

                            VAR_3++;

                            break;

                        case 'w':

                            VAR_8 = 4;

                            VAR_3++;

                            break;

                        case 'g':

                        case 'L':

                            VAR_8 = 8;

                            VAR_3++;

                            break;

                        default:

                            goto next;

                        }

                    }

                next:

                    if (*VAR_3 != '\0' && !qemu_isspace(*VAR_3)) {

                        monitor_printf(mon, "invalid char in VAR_7: '%VAR_2'\n",

                                       *VAR_3);

                        goto fail;

                    }

                    if (VAR_7 < 0)

                        VAR_7 = default_fmt_format;

                    if (VAR_7 != 'i') {

                        

                        if (VAR_8 < 0)

                            VAR_8 = default_fmt_size;

                        default_fmt_size = VAR_8;

                    }

                    default_fmt_format = VAR_7;

                } else {

                    VAR_6 = 1;

                    VAR_7 = default_fmt_format;

                    if (VAR_7 != 'i') {

                        VAR_8 = default_fmt_size;

                    } else {

                        VAR_8 = -1;

                    }

                }

                qdict_put(qdict, "VAR_6", qint_from_int(VAR_6));

                qdict_put(qdict, "VAR_7", qint_from_int(VAR_7));

                qdict_put(qdict, "VAR_8", qint_from_int(VAR_8));

            }

            break;

        case 'i':

        case 'l':

        case 'M':

            {

                int64_t VAR_10;



                while (qemu_isspace(*VAR_3))

                    VAR_3++;

                if (*VAR_0 == '?' || *VAR_0 == '.') {

                    if (*VAR_0 == '?') {

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

                            VAR_0++;

                            break;

                        }

                    } else {

                        if (*VAR_3 == '.') {

                            VAR_3++;

                            while (qemu_isspace(*VAR_3))

                                VAR_3++;

                        } else {

                            VAR_0++;

                            break;

                        }

                    }

                    VAR_0++;

                }

                if (get_expr(mon, &VAR_10, &VAR_3))

                    goto fail;

                

                if ((VAR_2 == 'i') && ((VAR_10 >> 32) & 0xffffffff)) {

                    monitor_printf(mon, "\'%s\' has failed: ", cmd->name);

                    monitor_printf(mon, "integer is for 32-bit values\n");

                    goto fail;

                } else if (VAR_2 == 'M') {

                    if (VAR_10 < 0) {

                        monitor_printf(mon, "enter a positive value\n");

                        goto fail;

                    }

                    VAR_10 <<= 20;

                }

                qdict_put(qdict, VAR_1, qint_from_int(VAR_10));

            }

            break;

        case 'o':

            {

                int64_t VAR_10;

                char *VAR_9;



                while (qemu_isspace(*VAR_3)) {

                    VAR_3++;

                }

                if (*VAR_0 == '?') {

                    VAR_0++;

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

                        break;

                    }

                }

                VAR_10 = qemu_strtosz_MiB(VAR_3, &VAR_9);

                if (VAR_10 < 0) {

                    monitor_printf(mon, "invalid VAR_8\n");

                    goto fail;

                }

                qdict_put(qdict, VAR_1, qint_from_int(VAR_10));

                VAR_3 = VAR_9;

            }

            break;

        case 'T':

            {

                double VAR_10;



                while (qemu_isspace(*VAR_3))

                    VAR_3++;

                if (*VAR_0 == '?') {

                    VAR_0++;

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

                        break;

                    }

                }

                if (get_double(mon, &VAR_10, &VAR_3) < 0) {

                    goto fail;

                }

                if (VAR_3[0] && VAR_3[1] == 's') {

                    switch (*VAR_3) {

                    case 'm':

                        VAR_10 /= 1e3; VAR_3 += 2; break;

                    case 'u':

                        VAR_10 /= 1e6; VAR_3 += 2; break;

                    case 'n':

                        VAR_10 /= 1e9; VAR_3 += 2; break;

                    }

                }

                if (*VAR_3 && !qemu_isspace(*VAR_3)) {

                    monitor_printf(mon, "Unknown unit suffix\n");

                    goto fail;

                }

                qdict_put(qdict, VAR_1, qfloat_from_double(VAR_10));

            }

            break;

        case 'b':

            {

                const char *VAR_11;

                bool VAR_10;



                while (qemu_isspace(*VAR_3)) {

                    VAR_3++;

                }

                VAR_11 = VAR_3;

                while (qemu_isgraph(*VAR_3)) {

                    VAR_3++;

                }

                if (VAR_3 - VAR_11 == 2 && !memcmp(VAR_11, "on", VAR_3 - VAR_11)) {

                    VAR_10 = true;

                } else if (VAR_3 - VAR_11 == 3 && !memcmp(VAR_11, "off", VAR_3 - VAR_11)) {

                    VAR_10 = false;

                } else {

                    monitor_printf(mon, "Expected 'on' or 'off'\n");

                    goto fail;

                }

                qdict_put(qdict, VAR_1, qbool_from_bool(VAR_10));

            }

            break;

        case '-':

            {

                const char *VAR_12 = VAR_3;

                int VAR_13 = 0;

                



                VAR_2 = *VAR_0++;

                if (VAR_2 == '\0')

                    goto bad_type;

                while (qemu_isspace(*VAR_3))

                    VAR_3++;

                if (*VAR_3 == '-') {

                    VAR_3++;

                    if(VAR_2 != *VAR_3) {

                        if(!is_valid_option(VAR_3, VAR_0)) {

                  

                            monitor_printf(mon, "%s: unsupported option -%VAR_2\n",

                                           cmd->name, *VAR_3);

                            goto fail;

                        } else {

                            VAR_13 = 1;

                        }

                    }

                    if(VAR_13) {

                        VAR_3 = VAR_12;

                    } else {

                        

                        VAR_3++;

                        qdict_put(qdict, VAR_1, qbool_from_bool(true));

                    }

                }

            }

            break;

        case 'S':

            {

                

                int VAR_14;



                while (qemu_isspace(*VAR_3)) {

                    VAR_3++;

                }

                if (*VAR_0 == '?') {

                    VAR_0++;

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

                        

                        break;

                    }

                }

                VAR_14 = strlen(VAR_3);

                if (VAR_14 <= 0) {

                    monitor_printf(mon, "%s: string expected\n",

                                   cmd->name);

                    goto fail;

                }

                qdict_put(qdict, VAR_1, qstring_from_str(VAR_3));

                VAR_3 += VAR_14;

            }

            break;

        default:

        bad_type:

            monitor_printf(mon, "%s: unknown type '%VAR_2'\n", cmd->name, VAR_2);

            goto fail;

        }

        g_free(VAR_1);

        VAR_1 = NULL;

    }

    

    while (qemu_isspace(*VAR_3))

        VAR_3++;

    if (*VAR_3 != '\0') {

        monitor_printf(mon, "%s: extraneous characters at the VAR_9 of line\n",

                       cmd->name);

        goto fail;

    }



    return qdict;



fail:

    QDECREF(qdict);

    g_free(VAR_1);

    return NULL;

}

static QDict *FUNC_0(Monitor *mon,
const char **endp,
const mon_cmd_t *cmd)
{ const char *VAR_0; char *VAR_1; int VAR_2; const char *VAR_3 = *endp; char VAR_4[1024]; QDict *qdict = qdict_new(); VAR_0 = cmd->args_type; for(;;) { VAR_0 = key_get_info(VAR_0, &VAR_1); if (!VAR_0)
break; VAR_2 = *VAR_0; VAR_0++; switch(VAR_2) { case 'F':
case 'B':
case 's':
{ int VAR_5; while (qemu_isspace(*VAR_3))
VAR_3++; if (*VAR_0 == '?') { VAR_0++; if (*VAR_3 == '\0') { break; } } VAR_5 = get_str(VAR_4, sizeof(VAR_4), &VAR_3); if (VAR_5 < 0) { switch(VAR_2) { case 'F':
monitor_printf(mon, "%s: filename expected\n",
cmd->name); break; case 'B':
monitor_printf(mon, "%s: block device name expected\n",
cmd->name); break; default:
monitor_printf(mon, "%s: string expected\n", cmd->name); break; } goto fail; } qdict_put(qdict, VAR_1, qstring_from_str(VAR_4)); } break; case 'O':
{ QemuOptsList *opts_list; QemuOpts *opts; opts_list = qemu_find_opts(VAR_1); if (!opts_list || opts_list->desc->name) { goto bad_type; } while (qemu_isspace(*VAR_3)) { VAR_3++; } if (!*VAR_3)
break; if (get_str(VAR_4, sizeof(VAR_4), &VAR_3) < 0) { goto fail; } opts = qemu_opts_parse_noisily(opts_list, VAR_4, true); if (!opts) { goto fail; } qemu_opts_to_qdict(opts, qdict); qemu_opts_del(opts); } break; case '/':
{ int VAR_6, VAR_7, VAR_8; while (qemu_isspace(*VAR_3))
VAR_3++; if (*VAR_3 == '/') { VAR_3++; VAR_6 = 1; if (qemu_isdigit(*VAR_3)) { VAR_6 = 0; while (qemu_isdigit(*VAR_3)) { VAR_6 = VAR_6 * 10 + (*VAR_3 - '0'); VAR_3++; } } VAR_8 = -1; VAR_7 = -1; for(;;) { switch(*VAR_3) { case 'o':
case 'd':
case 'u':
case 'x':
case 'i':
case 'VAR_2':
VAR_7 = *VAR_3++; break; case 'b':
VAR_8 = 1; VAR_3++; break; case 'h':
VAR_8 = 2; VAR_3++; break; case 'w':
VAR_8 = 4; VAR_3++; break; case 'g':
case 'L':
VAR_8 = 8; VAR_3++; break; default:
goto next; } } next:
if (*VAR_3 != '\0' && !qemu_isspace(*VAR_3)) { monitor_printf(mon, "invalid char in VAR_7: '%VAR_2'\n",
*VAR_3); goto fail; } if (VAR_7 < 0)
VAR_7 = default_fmt_format; if (VAR_7 != 'i') { if (VAR_8 < 0)
VAR_8 = default_fmt_size; default_fmt_size = VAR_8; } default_fmt_format = VAR_7; } else { VAR_6 = 1; VAR_7 = default_fmt_format; if (VAR_7 != 'i') { VAR_8 = default_fmt_size; } else { VAR_8 = -1; } } qdict_put(qdict, "VAR_6", qint_from_int(VAR_6)); qdict_put(qdict, "VAR_7", qint_from_int(VAR_7)); qdict_put(qdict, "VAR_8", qint_from_int(VAR_8)); } break; case 'i':
case 'l':
case 'M':
{ int64_t VAR_10; while (qemu_isspace(*VAR_3))
VAR_3++; if (*VAR_0 == '?' || *VAR_0 == '.') { if (*VAR_0 == '?') { if (*VAR_3 == '\0') { VAR_0++; break; } } else { if (*VAR_3 == '.') { VAR_3++; while (qemu_isspace(*VAR_3))
VAR_3++; } else { VAR_0++; break; } } VAR_0++; } if (get_expr(mon, &VAR_10, &VAR_3))
goto fail; if ((VAR_2 == 'i') && ((VAR_10 >> 32) & 0xffffffff)) { monitor_printf(mon, "\'%s\' has failed: ", cmd->name); monitor_printf(mon, "integer is for 32-bit values\n"); goto fail; } else if (VAR_2 == 'M') { if (VAR_10 < 0) { monitor_printf(mon, "enter a positive value\n"); goto fail; } VAR_10 <<= 20; } qdict_put(qdict, VAR_1, qint_from_int(VAR_10)); } break; case 'o':
{ int64_t VAR_10; char *VAR_9; while (qemu_isspace(*VAR_3)) { VAR_3++; } if (*VAR_0 == '?') { VAR_0++; if (*VAR_3 == '\0') { break; } } VAR_10 = qemu_strtosz_MiB(VAR_3, &VAR_9); if (VAR_10 < 0) { monitor_printf(mon, "invalid VAR_8\n"); goto fail; } qdict_put(qdict, VAR_1, qint_from_int(VAR_10)); VAR_3 = VAR_9; } break; case 'T':
{ double VAR_10; while (qemu_isspace(*VAR_3))
VAR_3++; if (*VAR_0 == '?') { VAR_0++; if (*VAR_3 == '\0') { break; } } if (get_double(mon, &VAR_10, &VAR_3) < 0) { goto fail; } if (VAR_3[0] && VAR_3[1] == 's') { switch (*VAR_3) { case 'm':
VAR_10 /= 1e3; VAR_3 += 2; break; case 'u':
VAR_10 /= 1e6; VAR_3 += 2; break; case 'n':
VAR_10 /= 1e9; VAR_3 += 2; break; } } if (*VAR_3 && !qemu_isspace(*VAR_3)) { monitor_printf(mon, "Unknown unit suffix\n"); goto fail; } qdict_put(qdict, VAR_1, qfloat_from_double(VAR_10)); } break; case 'b':
{ const char *VAR_11; bool VAR_10; while (qemu_isspace(*VAR_3)) { VAR_3++; } VAR_11 = VAR_3; while (qemu_isgraph(*VAR_3)) { VAR_3++; } if (VAR_3 - VAR_11 == 2 && !memcmp(VAR_11, "on", VAR_3 - VAR_11)) { VAR_10 = true; } else if (VAR_3 - VAR_11 == 3 && !memcmp(VAR_11, "off", VAR_3 - VAR_11)) { VAR_10 = false; } else { monitor_printf(mon, "Expected 'on' or 'off'\n"); goto fail; } qdict_put(qdict, VAR_1, qbool_from_bool(VAR_10)); } break; case '-':
{ const char *VAR_12 = VAR_3; int VAR_13 = 0; VAR_2 = *VAR_0++; if (VAR_2 == '\0')
goto bad_type; while (qemu_isspace(*VAR_3))
VAR_3++; if (*VAR_3 == '-') { VAR_3++; if(VAR_2 != *VAR_3) { if(!is_valid_option(VAR_3, VAR_0)) { monitor_printf(mon, "%s: unsupported option -%VAR_2\n",
cmd->name, *VAR_3); goto fail; } else { VAR_13 = 1; } } if(VAR_13) { VAR_3 = VAR_12; } else { VAR_3++; qdict_put(qdict, VAR_1, qbool_from_bool(true)); } } } break; case 'S':
{ int VAR_14; while (qemu_isspace(*VAR_3)) { VAR_3++; } if (*VAR_0 == '?') { VAR_0++; if (*VAR_3 == '\0') { break; } } VAR_14 = strlen(VAR_3); if (VAR_14 <= 0) { monitor_printf(mon, "%s: string expected\n",
cmd->name); goto fail; } qdict_put(qdict, VAR_1, qstring_from_str(VAR_3)); VAR_3 += VAR_14; } break; default:
bad_type:
monitor_printf(mon, "%s: unknown type '%VAR_2'\n", cmd->name, VAR_2); goto fail; } g_free(VAR_1); VAR_1 = NULL; } while (qemu_isspace(*VAR_3))
VAR_3++; if (*VAR_3 != '\0') { monitor_printf(mon, "%s: extraneous characters at the VAR_9 of line\n",
cmd->name); goto fail; } return qdict; fail:
QDECREF(qdict); g_free(VAR_1); return NULL; }