static void monitor_handle_command(Monitor *mon, const char *cmdline)

{

    const char *p, *pstart, *typestr;

    char *q;

    int c, nb_args, len, i, has_arg;

    const mon_cmd_t *cmd;

    char cmdname[256];

    char buf[1024];

    void *str_allocated[MAX_ARGS];

    void *args[MAX_ARGS];

    void (*handler_0)(Monitor *mon);

    void (*handler_1)(Monitor *mon, void *arg0);

    void (*handler_2)(Monitor *mon, void *arg0, void *arg1);

    void (*handler_3)(Monitor *mon, void *arg0, void *arg1, void *arg2);

    void (*handler_4)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3);

    void (*handler_5)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3, void *arg4);

    void (*handler_6)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3, void *arg4, void *arg5);

    void (*handler_7)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3, void *arg4, void *arg5, void *arg6);



#ifdef DEBUG

    monitor_printf(mon, "command='%s'\n", cmdline);

#endif



    /* extract the command name */

    p = cmdline;

    q = cmdname;

    while (qemu_isspace(*p))

        p++;

    if (*p == '\0')

        return;

    pstart = p;

    while (*p != '\0' && *p != '/' && !qemu_isspace(*p))

        p++;

    len = p - pstart;

    if (len > sizeof(cmdname) - 1)

        len = sizeof(cmdname) - 1;

    memcpy(cmdname, pstart, len);

    cmdname[len] = '\0';



    /* find the command */

    for(cmd = mon_cmds; cmd->name != NULL; cmd++) {

        if (compare_cmd(cmdname, cmd->name))

            goto found;

    }

    monitor_printf(mon, "unknown command: '%s'\n", cmdname);

    return;

 found:



    for(i = 0; i < MAX_ARGS; i++)

        str_allocated[i] = NULL;



    /* parse the parameters */

    typestr = cmd->args_type;

    nb_args = 0;

    for(;;) {

        c = *typestr;

        if (c == '\0')

            break;

        typestr++;

        switch(c) {

        case 'F':

        case 'B':

        case 's':

            {

                int ret;

                char *str;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?') {

                    typestr++;

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

                        /* no optional string: NULL argument */

                        str = NULL;

                        goto add_str;

                    }

                }

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

                if (ret < 0) {

                    switch(c) {

                    case 'F':

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

                                       cmdname);

                        break;

                    case 'B':

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

                                       cmdname);

                        break;

                    default:

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

                        break;

                    }

                    goto fail;

                }

                str = qemu_malloc(strlen(buf) + 1);

                pstrcpy(str, sizeof(buf), buf);

                str_allocated[nb_args] = str;

            add_str:

                if (nb_args >= MAX_ARGS) {

                error_args:

                    monitor_printf(mon, "%s: too many arguments\n", cmdname);

                    goto fail;

                }

                args[nb_args++] = str;

            }

            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;

                    }

                }

                if (nb_args + 3 > MAX_ARGS)

                    goto error_args;

                args[nb_args++] = (void*)(long)count;

                args[nb_args++] = (void*)(long)format;

                args[nb_args++] = (void*)(long)size;

            }

            break;

        case 'i':

        case 'l':

            {

                int64_t val;



                while (qemu_isspace(*p))

                    p++;

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

                    if (*typestr == '?') {

                        if (*p == '\0')

                            has_arg = 0;

                        else

                            has_arg = 1;

                    } else {

                        if (*p == '.') {

                            p++;

                            while (qemu_isspace(*p))

                                p++;

                            has_arg = 1;

                        } else {

                            has_arg = 0;

                        }

                    }

                    typestr++;

                    if (nb_args >= MAX_ARGS)

                        goto error_args;

                    args[nb_args++] = (void *)(long)has_arg;

                    if (!has_arg) {

                        if (nb_args >= MAX_ARGS)

                            goto error_args;

                        val = -1;

                        goto add_num;

                    }

                }

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

                    goto fail;

            add_num:

                if (c == 'i') {

                    if (nb_args >= MAX_ARGS)

                        goto error_args;

                    args[nb_args++] = (void *)(long)val;

                } else {

                    if ((nb_args + 1) >= MAX_ARGS)

                        goto error_args;

#if TARGET_PHYS_ADDR_BITS > 32

                    args[nb_args++] = (void *)(long)((val >> 32) & 0xffffffff);

#else

                    args[nb_args++] = (void *)0;

#endif

                    args[nb_args++] = (void *)(long)(val & 0xffffffff);

                }

            }

            break;

        case '-':

            {

                int has_option;

                /* option */



                c = *typestr++;

                if (c == '\0')

                    goto bad_type;

                while (qemu_isspace(*p))

                    p++;

                has_option = 0;

                if (*p == '-') {

                    p++;

                    if (*p != c) {

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

                                       cmdname, *p);

                        goto fail;

                    }

                    p++;

                    has_option = 1;

                }

                if (nb_args >= MAX_ARGS)

                    goto error_args;

                args[nb_args++] = (void *)(long)has_option;

            }

            break;

        default:

        bad_type:

            monitor_printf(mon, "%s: unknown type '%c'\n", cmdname, c);

            goto fail;

        }

    }

    /* 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",

                       cmdname);

        goto fail;

    }



    switch(nb_args) {

    case 0:

        handler_0 = cmd->handler;

        handler_0(mon);

        break;

    case 1:

        handler_1 = cmd->handler;

        handler_1(mon, args[0]);

        break;

    case 2:

        handler_2 = cmd->handler;

        handler_2(mon, args[0], args[1]);

        break;

    case 3:

        handler_3 = cmd->handler;

        handler_3(mon, args[0], args[1], args[2]);

        break;

    case 4:

        handler_4 = cmd->handler;

        handler_4(mon, args[0], args[1], args[2], args[3]);

        break;

    case 5:

        handler_5 = cmd->handler;

        handler_5(mon, args[0], args[1], args[2], args[3], args[4]);

        break;

    case 6:

        handler_6 = cmd->handler;

        handler_6(mon, args[0], args[1], args[2], args[3], args[4], args[5]);

        break;

    case 7:

        handler_7 = cmd->handler;

        handler_7(mon, args[0], args[1], args[2], args[3], args[4], args[5],

                  args[6]);

        break;

    default:

        monitor_printf(mon, "unsupported number of arguments: %d\n", nb_args);

        goto fail;

    }

 fail:

    for(i = 0; i < MAX_ARGS; i++)

        qemu_free(str_allocated[i]);

    return;

}

static void monitor_handle_command(Monitor *mon, const char *cmdline)

{

    const char *p, *pstart, *typestr;

    char *q;

    int c, nb_args, len, i, has_arg;

    const mon_cmd_t *cmd;

    char cmdname[256];

    char buf[1024];

    void *str_allocated[MAX_ARGS];

    void *args[MAX_ARGS];

    void (*handler_0)(Monitor *mon);

    void (*handler_1)(Monitor *mon, void *arg0);

    void (*handler_2)(Monitor *mon, void *arg0, void *arg1);

    void (*handler_3)(Monitor *mon, void *arg0, void *arg1, void *arg2);

    void (*handler_4)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3);

    void (*handler_5)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3, void *arg4);

    void (*handler_6)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3, void *arg4, void *arg5);

    void (*handler_7)(Monitor *mon, void *arg0, void *arg1, void *arg2,

                      void *arg3, void *arg4, void *arg5, void *arg6);



#ifdef DEBUG

    monitor_printf(mon, "command='%s'\n", cmdline);

#endif



    

    p = cmdline;

    q = cmdname;

    while (qemu_isspace(*p))

        p++;

    if (*p == '\0')

        return;

    pstart = p;

    while (*p != '\0' && *p != '/' && !qemu_isspace(*p))

        p++;

    len = p - pstart;

    if (len > sizeof(cmdname) - 1)

        len = sizeof(cmdname) - 1;

    memcpy(cmdname, pstart, len);

    cmdname[len] = '\0';



    

    for(cmd = mon_cmds; cmd->name != NULL; cmd++) {

        if (compare_cmd(cmdname, cmd->name))

            goto found;

    }

    monitor_printf(mon, "unknown command: '%s'\n", cmdname);

    return;

 found:



    for(i = 0; i < MAX_ARGS; i++)

        str_allocated[i] = NULL;



    

    typestr = cmd->args_type;

    nb_args = 0;

    for(;;) {

        c = *typestr;

        if (c == '\0')

            break;

        typestr++;

        switch(c) {

        case 'F':

        case 'B':

        case 's':

            {

                int ret;

                char *str;



                while (qemu_isspace(*p))

                    p++;

                if (*typestr == '?') {

                    typestr++;

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

                        

                        str = NULL;

                        goto add_str;

                    }

                }

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

                if (ret < 0) {

                    switch(c) {

                    case 'F':

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

                                       cmdname);

                        break;

                    case 'B':

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

                                       cmdname);

                        break;

                    default:

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

                        break;

                    }

                    goto fail;

                }

                str = qemu_malloc(strlen(buf) + 1);

                pstrcpy(str, sizeof(buf), buf);

                str_allocated[nb_args] = str;

            add_str:

                if (nb_args >= MAX_ARGS) {

                error_args:

                    monitor_printf(mon, "%s: too many arguments\n", cmdname);

                    goto fail;

                }

                args[nb_args++] = str;

            }

            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;

                    }

                }

                if (nb_args + 3 > MAX_ARGS)

                    goto error_args;

                args[nb_args++] = (void*)(long)count;

                args[nb_args++] = (void*)(long)format;

                args[nb_args++] = (void*)(long)size;

            }

            break;

        case 'i':

        case 'l':

            {

                int64_t val;



                while (qemu_isspace(*p))

                    p++;

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

                    if (*typestr == '?') {

                        if (*p == '\0')

                            has_arg = 0;

                        else

                            has_arg = 1;

                    } else {

                        if (*p == '.') {

                            p++;

                            while (qemu_isspace(*p))

                                p++;

                            has_arg = 1;

                        } else {

                            has_arg = 0;

                        }

                    }

                    typestr++;

                    if (nb_args >= MAX_ARGS)

                        goto error_args;

                    args[nb_args++] = (void *)(long)has_arg;

                    if (!has_arg) {

                        if (nb_args >= MAX_ARGS)

                            goto error_args;

                        val = -1;

                        goto add_num;

                    }

                }

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

                    goto fail;

            add_num:

                if (c == 'i') {

                    if (nb_args >= MAX_ARGS)

                        goto error_args;

                    args[nb_args++] = (void *)(long)val;

                } else {

                    if ((nb_args + 1) >= MAX_ARGS)

                        goto error_args;

#if TARGET_PHYS_ADDR_BITS > 32

                    args[nb_args++] = (void *)(long)((val >> 32) & 0xffffffff);

#else

                    args[nb_args++] = (void *)0;

#endif

                    args[nb_args++] = (void *)(long)(val & 0xffffffff);

                }

            }

            break;

        case '-':

            {

                int has_option;

                



                c = *typestr++;

                if (c == '\0')

                    goto bad_type;

                while (qemu_isspace(*p))

                    p++;

                has_option = 0;

                if (*p == '-') {

                    p++;

                    if (*p != c) {

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

                                       cmdname, *p);

                        goto fail;

                    }

                    p++;

                    has_option = 1;

                }

                if (nb_args >= MAX_ARGS)

                    goto error_args;

                args[nb_args++] = (void *)(long)has_option;

            }

            break;

        default:

        bad_type:

            monitor_printf(mon, "%s: unknown type '%c'\n", cmdname, c);

            goto fail;

        }

    }

    

    while (qemu_isspace(*p))

        p++;

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

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

                       cmdname);

        goto fail;

    }



    switch(nb_args) {

    case 0:

        handler_0 = cmd->handler;

        handler_0(mon);

        break;

    case 1:

        handler_1 = cmd->handler;

        handler_1(mon, args[0]);

        break;

    case 2:

        handler_2 = cmd->handler;

        handler_2(mon, args[0], args[1]);

        break;

    case 3:

        handler_3 = cmd->handler;

        handler_3(mon, args[0], args[1], args[2]);

        break;

    case 4:

        handler_4 = cmd->handler;

        handler_4(mon, args[0], args[1], args[2], args[3]);

        break;

    case 5:

        handler_5 = cmd->handler;

        handler_5(mon, args[0], args[1], args[2], args[3], args[4]);

        break;

    case 6:

        handler_6 = cmd->handler;

        handler_6(mon, args[0], args[1], args[2], args[3], args[4], args[5]);

        break;

    case 7:

        handler_7 = cmd->handler;

        handler_7(mon, args[0], args[1], args[2], args[3], args[4], args[5],

                  args[6]);

        break;

    default:

        monitor_printf(mon, "unsupported number of arguments: %d\n", nb_args);

        goto fail;

    }

 fail:

    for(i = 0; i < MAX_ARGS; i++)

        qemu_free(str_allocated[i]);

    return;

}

static void FUNC_0(Monitor *VAR_30, const char *VAR_1)

{

    const char *VAR_2, *VAR_3, *VAR_4;

    char *VAR_5;

    int VAR_6, VAR_7, VAR_8, VAR_9, VAR_10;

    const mon_cmd_t *VAR_11;

    char VAR_12[256];

    char VAR_13[1024];

    void *VAR_14[MAX_ARGS];

    void *VAR_15[MAX_ARGS];

    void (*VAR_16)(Monitor *VAR_30);

    void (*VAR_17)(Monitor *VAR_30, void *VAR_30);

    void (*VAR_19)(Monitor *VAR_30, void *VAR_30, void *VAR_30);

    void (*VAR_21)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30);

    void (*VAR_23)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,

                      void *VAR_30);

    void (*VAR_25)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,

                      void *VAR_30, void *VAR_30);

    void (*VAR_27)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,

                      void *VAR_30, void *VAR_30, void *VAR_30);

    void (*VAR_29)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,

                      void *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30);



#ifdef DEBUG

    monitor_printf(VAR_30, "command='%s'\n", VAR_1);

#endif



    

    VAR_2 = VAR_1;

    VAR_5 = VAR_12;

    while (qemu_isspace(*VAR_2))

        VAR_2++;

    if (*VAR_2 == '\0')

        return;

    VAR_3 = VAR_2;

    while (*VAR_2 != '\0' && *VAR_2 != '/' && !qemu_isspace(*VAR_2))

        VAR_2++;

    VAR_8 = VAR_2 - VAR_3;

    if (VAR_8 > sizeof(VAR_12) - 1)

        VAR_8 = sizeof(VAR_12) - 1;

    memcpy(VAR_12, VAR_3, VAR_8);

    VAR_12[VAR_8] = '\0';



    

    for(VAR_11 = mon_cmds; VAR_11->name != NULL; VAR_11++) {

        if (compare_cmd(VAR_12, VAR_11->name))

            goto found;

    }

    monitor_printf(VAR_30, "unknown command: '%s'\n", VAR_12);

    return;

 found:



    for(VAR_9 = 0; VAR_9 < MAX_ARGS; VAR_9++)

        VAR_14[VAR_9] = NULL;



    

    VAR_4 = VAR_11->args_type;

    VAR_7 = 0;

    for(;;) {

        VAR_6 = *VAR_4;

        if (VAR_6 == '\0')

            break;

        VAR_4++;

        switch(VAR_6) {

        case 'F':

        case 'B':

        case 's':

            {

                int VAR_31;

                char *VAR_32;



                while (qemu_isspace(*VAR_2))

                    VAR_2++;

                if (*VAR_4 == '?') {

                    VAR_4++;

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

                        

                        VAR_32 = NULL;

                        goto add_str;

                    }

                }

                VAR_31 = get_str(VAR_13, sizeof(VAR_13), &VAR_2);

                if (VAR_31 < 0) {

                    switch(VAR_6) {

                    case 'F':

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

                                       VAR_12);

                        break;

                    case 'B':

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

                                       VAR_12);

                        break;

                    default:

                        monitor_printf(VAR_30, "%s: string expected\n", VAR_12);

                        break;

                    }

                    goto fail;

                }

                VAR_32 = qemu_malloc(strlen(VAR_13) + 1);

                pstrcpy(VAR_32, sizeof(VAR_13), VAR_13);

                VAR_14[VAR_7] = VAR_32;

            add_str:

                if (VAR_7 >= MAX_ARGS) {

                error_args:

                    monitor_printf(VAR_30, "%s: too many arguments\n", VAR_12);

                    goto fail;

                }

                VAR_15[VAR_7++] = VAR_32;

            }

            break;

        case '/':

            {

                int VAR_33, VAR_34, VAR_35;



                while (qemu_isspace(*VAR_2))

                    VAR_2++;

                if (*VAR_2 == '/') {

                    

                    VAR_2++;

                    VAR_33 = 1;

                    if (qemu_isdigit(*VAR_2)) {

                        VAR_33 = 0;

                        while (qemu_isdigit(*VAR_2)) {

                            VAR_33 = VAR_33 * 10 + (*VAR_2 - '0');

                            VAR_2++;

                        }

                    }

                    VAR_35 = -1;

                    VAR_34 = -1;

                    for(;;) {

                        switch(*VAR_2) {

                        case 'o':

                        case 'd':

                        case 'u':

                        case 'x':

                        case 'VAR_9':

                        case 'VAR_6':

                            VAR_34 = *VAR_2++;

                            break;

                        case 'b':

                            VAR_35 = 1;

                            VAR_2++;

                            break;

                        case 'h':

                            VAR_35 = 2;

                            VAR_2++;

                            break;

                        case 'w':

                            VAR_35 = 4;

                            VAR_2++;

                            break;

                        case 'g':

                        case 'L':

                            VAR_35 = 8;

                            VAR_2++;

                            break;

                        default:

                            goto next;

                        }

                    }

                next:

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

                        monitor_printf(VAR_30, "invalid char in VAR_34: '%VAR_6'\n",

                                       *VAR_2);

                        goto fail;

                    }

                    if (VAR_34 < 0)

                        VAR_34 = default_fmt_format;

                    if (VAR_34 != 'VAR_9') {

                        

                        if (VAR_35 < 0)

                            VAR_35 = default_fmt_size;

                        default_fmt_size = VAR_35;

                    }

                    default_fmt_format = VAR_34;

                } else {

                    VAR_33 = 1;

                    VAR_34 = default_fmt_format;

                    if (VAR_34 != 'VAR_9') {

                        VAR_35 = default_fmt_size;

                    } else {

                        VAR_35 = -1;

                    }

                }

                if (VAR_7 + 3 > MAX_ARGS)

                    goto error_args;

                VAR_15[VAR_7++] = (void*)(long)VAR_33;

                VAR_15[VAR_7++] = (void*)(long)VAR_34;

                VAR_15[VAR_7++] = (void*)(long)VAR_35;

            }

            break;

        case 'VAR_9':

        case 'l':

            {

                int64_t val;



                while (qemu_isspace(*VAR_2))

                    VAR_2++;

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

                    if (*VAR_4 == '?') {

                        if (*VAR_2 == '\0')

                            VAR_10 = 0;

                        else

                            VAR_10 = 1;

                    } else {

                        if (*VAR_2 == '.') {

                            VAR_2++;

                            while (qemu_isspace(*VAR_2))

                                VAR_2++;

                            VAR_10 = 1;

                        } else {

                            VAR_10 = 0;

                        }

                    }

                    VAR_4++;

                    if (VAR_7 >= MAX_ARGS)

                        goto error_args;

                    VAR_15[VAR_7++] = (void *)(long)VAR_10;

                    if (!VAR_10) {

                        if (VAR_7 >= MAX_ARGS)

                            goto error_args;

                        val = -1;

                        goto add_num;

                    }

                }

                if (get_expr(VAR_30, &val, &VAR_2))

                    goto fail;

            add_num:

                if (VAR_6 == 'VAR_9') {

                    if (VAR_7 >= MAX_ARGS)

                        goto error_args;

                    VAR_15[VAR_7++] = (void *)(long)val;

                } else {

                    if ((VAR_7 + 1) >= MAX_ARGS)

                        goto error_args;

#if TARGET_PHYS_ADDR_BITS > 32

                    VAR_15[VAR_7++] = (void *)(long)((val >> 32) & 0xffffffff);

#else

                    VAR_15[VAR_7++] = (void *)0;

#endif

                    VAR_15[VAR_7++] = (void *)(long)(val & 0xffffffff);

                }

            }

            break;

        case '-':

            {

                int VAR_36;

                



                VAR_6 = *VAR_4++;

                if (VAR_6 == '\0')

                    goto bad_type;

                while (qemu_isspace(*VAR_2))

                    VAR_2++;

                VAR_36 = 0;

                if (*VAR_2 == '-') {

                    VAR_2++;

                    if (*VAR_2 != VAR_6) {

                        monitor_printf(VAR_30, "%s: unsupported option -%VAR_6\n",

                                       VAR_12, *VAR_2);

                        goto fail;

                    }

                    VAR_2++;

                    VAR_36 = 1;

                }

                if (VAR_7 >= MAX_ARGS)

                    goto error_args;

                VAR_15[VAR_7++] = (void *)(long)VAR_36;

            }

            break;

        default:

        bad_type:

            monitor_printf(VAR_30, "%s: unknown type '%VAR_6'\n", VAR_12, VAR_6);

            goto fail;

        }

    }

    

    while (qemu_isspace(*VAR_2))

        VAR_2++;

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

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

                       VAR_12);

        goto fail;

    }



    switch(VAR_7) {

    case 0:

        VAR_16 = VAR_11->handler;

        VAR_16(VAR_30);

        break;

    case 1:

        VAR_17 = VAR_11->handler;

        VAR_17(VAR_30, VAR_15[0]);

        break;

    case 2:

        VAR_19 = VAR_11->handler;

        VAR_19(VAR_30, VAR_15[0], VAR_15[1]);

        break;

    case 3:

        VAR_21 = VAR_11->handler;

        VAR_21(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2]);

        break;

    case 4:

        VAR_23 = VAR_11->handler;

        VAR_23(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3]);

        break;

    case 5:

        VAR_25 = VAR_11->handler;

        VAR_25(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3], VAR_15[4]);

        break;

    case 6:

        VAR_27 = VAR_11->handler;

        VAR_27(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3], VAR_15[4], VAR_15[5]);

        break;

    case 7:

        VAR_29 = VAR_11->handler;

        VAR_29(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3], VAR_15[4], VAR_15[5],

                  VAR_15[6]);

        break;

    default:

        monitor_printf(VAR_30, "unsupported number of arguments: %d\n", VAR_7);

        goto fail;

    }

 fail:

    for(VAR_9 = 0; VAR_9 < MAX_ARGS; VAR_9++)

        qemu_free(VAR_14[VAR_9]);

    return;

}

static void FUNC_0(Monitor *VAR_30, const char *VAR_1)
{ const char *VAR_2, *VAR_3, *VAR_4; char *VAR_5; int VAR_6, VAR_7, VAR_8, VAR_9, VAR_10; const mon_cmd_t *VAR_11; char VAR_12[256]; char VAR_13[1024]; void *VAR_14[MAX_ARGS]; void *VAR_15[MAX_ARGS]; void (*VAR_16)(Monitor *VAR_30); void (*VAR_17)(Monitor *VAR_30, void *VAR_30); void (*VAR_19)(Monitor *VAR_30, void *VAR_30, void *VAR_30); void (*VAR_21)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30); void (*VAR_23)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,
void *VAR_30); void (*VAR_25)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,
void *VAR_30, void *VAR_30); void (*VAR_27)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,
void *VAR_30, void *VAR_30, void *VAR_30); void (*VAR_29)(Monitor *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30,
void *VAR_30, void *VAR_30, void *VAR_30, void *VAR_30); #ifdef DEBUG
monitor_printf(VAR_30, "command='%s'\n", VAR_1); #endif
VAR_2 = VAR_1; VAR_5 = VAR_12; while (qemu_isspace(*VAR_2))
VAR_2++; if (*VAR_2 == '\0')
return; VAR_3 = VAR_2; while (*VAR_2 != '\0' && *VAR_2 != '/' && !qemu_isspace(*VAR_2))
VAR_2++; VAR_8 = VAR_2 - VAR_3; if (VAR_8 > sizeof(VAR_12) - 1)
VAR_8 = sizeof(VAR_12) - 1; memcpy(VAR_12, VAR_3, VAR_8); VAR_12[VAR_8] = '\0'; for(VAR_11 = mon_cmds; VAR_11->name != NULL; VAR_11++) { if (compare_cmd(VAR_12, VAR_11->name))
goto found; } monitor_printf(VAR_30, "unknown command: '%s'\n", VAR_12); return; found:
for(VAR_9 = 0; VAR_9 < MAX_ARGS; VAR_9++) VAR_14[VAR_9] = NULL; VAR_4 = VAR_11->args_type; VAR_7 = 0; for(;;) { VAR_6 = *VAR_4; if (VAR_6 == '\0')
break; VAR_4++; switch(VAR_6) { case 'F':
case 'B':
case 's':
{ int VAR_31; char *VAR_32; while (qemu_isspace(*VAR_2))
VAR_2++; if (*VAR_4 == '?') { VAR_4++; if (*VAR_2 == '\0') { VAR_32 = NULL; goto add_str; } } VAR_31 = get_str(VAR_13, sizeof(VAR_13), &VAR_2); if (VAR_31 < 0) { switch(VAR_6) { case 'F':
monitor_printf(VAR_30, "%s: filename expected\n",
VAR_12); break; case 'B':
monitor_printf(VAR_30, "%s: block device name expected\n",
VAR_12); break; default:
monitor_printf(VAR_30, "%s: string expected\n", VAR_12); break; } goto fail; } VAR_32 = qemu_malloc(strlen(VAR_13) + 1); pstrcpy(VAR_32, sizeof(VAR_13), VAR_13); VAR_14[VAR_7] = VAR_32; add_str:
if (VAR_7 >= MAX_ARGS) { error_args:
monitor_printf(VAR_30, "%s: too many arguments\n", VAR_12); goto fail; } VAR_15[VAR_7++] = VAR_32; } break; case '/':
{ int VAR_33, VAR_34, VAR_35; while (qemu_isspace(*VAR_2))
VAR_2++; if (*VAR_2 == '/') { VAR_2++; VAR_33 = 1; if (qemu_isdigit(*VAR_2)) { VAR_33 = 0; while (qemu_isdigit(*VAR_2)) { VAR_33 = VAR_33 * 10 + (*VAR_2 - '0'); VAR_2++; } } VAR_35 = -1; VAR_34 = -1; for(;;) { switch(*VAR_2) { case 'o':
case 'd':
case 'u':
case 'x':
case 'VAR_9':
case 'VAR_6':
VAR_34 = *VAR_2++; break; case 'b':
VAR_35 = 1; VAR_2++; break; case 'h':
VAR_35 = 2; VAR_2++; break; case 'w':
VAR_35 = 4; VAR_2++; break; case 'g':
case 'L':
VAR_35 = 8; VAR_2++; break; default:
goto next; } } next:
if (*VAR_2 != '\0' && !qemu_isspace(*VAR_2)) { monitor_printf(VAR_30, "invalid char in VAR_34: '%VAR_6'\n",
*VAR_2); goto fail; } if (VAR_34 < 0)
VAR_34 = default_fmt_format; if (VAR_34 != 'VAR_9') { if (VAR_35 < 0)
VAR_35 = default_fmt_size; default_fmt_size = VAR_35; } default_fmt_format = VAR_34; } else { VAR_33 = 1; VAR_34 = default_fmt_format; if (VAR_34 != 'VAR_9') { VAR_35 = default_fmt_size; } else { VAR_35 = -1; } } if (VAR_7 + 3 > MAX_ARGS)
goto error_args; VAR_15[VAR_7++] = (void*)(long)VAR_33; VAR_15[VAR_7++] = (void*)(long)VAR_34; VAR_15[VAR_7++] = (void*)(long)VAR_35; } break; case 'VAR_9':
case 'l':
{ int64_t val; while (qemu_isspace(*VAR_2))
VAR_2++; if (*VAR_4 == '?' || *VAR_4 == '.') { if (*VAR_4 == '?') { if (*VAR_2 == '\0')
VAR_10 = 0; else
VAR_10 = 1; } else { if (*VAR_2 == '.') { VAR_2++; while (qemu_isspace(*VAR_2))
VAR_2++; VAR_10 = 1; } else { VAR_10 = 0; } } VAR_4++; if (VAR_7 >= MAX_ARGS)
goto error_args; VAR_15[VAR_7++] = (void *)(long)VAR_10; if (!VAR_10) { if (VAR_7 >= MAX_ARGS)
goto error_args; val = -1; goto add_num; } } if (get_expr(VAR_30, &val, &VAR_2))
goto fail; add_num:
if (VAR_6 == 'VAR_9') { if (VAR_7 >= MAX_ARGS)
goto error_args; VAR_15[VAR_7++] = (void *)(long)val; } else { if ((VAR_7 + 1) >= MAX_ARGS)
goto error_args; #if TARGET_PHYS_ADDR_BITS > 32
VAR_15[VAR_7++] = (void *)(long)((val >> 32) & 0xffffffff); #else
VAR_15[VAR_7++] = (void *)0; #endif
VAR_15[VAR_7++] = (void *)(long)(val & 0xffffffff); } } break; case '-':
{ int VAR_36; VAR_6 = *VAR_4++; if (VAR_6 == '\0')
goto bad_type; while (qemu_isspace(*VAR_2))
VAR_2++; VAR_36 = 0; if (*VAR_2 == '-') { VAR_2++; if (*VAR_2 != VAR_6) { monitor_printf(VAR_30, "%s: unsupported option -%VAR_6\n",
VAR_12, *VAR_2); goto fail; } VAR_2++; VAR_36 = 1; } if (VAR_7 >= MAX_ARGS)
goto error_args; VAR_15[VAR_7++] = (void *)(long)VAR_36; } break; default:
bad_type:
monitor_printf(VAR_30, "%s: unknown type '%VAR_6'\n", VAR_12, VAR_6); goto fail; } } while (qemu_isspace(*VAR_2))
VAR_2++; if (*VAR_2 != '\0') { monitor_printf(VAR_30, "%s: extraneous characters at the end of line\n",
VAR_12); goto fail; } switch(VAR_7) { case 0:
VAR_16 = VAR_11->handler; VAR_16(VAR_30); break; case 1:
VAR_17 = VAR_11->handler; VAR_17(VAR_30, VAR_15[0]); break; case 2:
VAR_19 = VAR_11->handler; VAR_19(VAR_30, VAR_15[0], VAR_15[1]); break; case 3:
VAR_21 = VAR_11->handler; VAR_21(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2]); break; case 4:
VAR_23 = VAR_11->handler; VAR_23(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3]); break; case 5:
VAR_25 = VAR_11->handler; VAR_25(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3], VAR_15[4]); break; case 6:
VAR_27 = VAR_11->handler; VAR_27(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3], VAR_15[4], VAR_15[5]); break; case 7:
VAR_29 = VAR_11->handler; VAR_29(VAR_30, VAR_15[0], VAR_15[1], VAR_15[2], VAR_15[3], VAR_15[4], VAR_15[5],
VAR_15[6]); break; default:
monitor_printf(VAR_30, "unsupported number of arguments: %d\n", VAR_7); goto fail; } fail:
for(VAR_9 = 0; VAR_9 < MAX_ARGS; VAR_9++) qemu_free(VAR_14[VAR_9]); return; }