void command_loop(void)

{

    int c, i, j = 0, done = 0, fetchable = 0, prompted = 0;

    char *input;

    char **v;

    const cmdinfo_t *ct;



    for (i = 0; !done && i < ncmdline; i++) {

        input = strdup(cmdline[i]);

        if (!input) {

            fprintf(stderr, _("cannot strdup command '%s': %s\n"),

                    cmdline[i], strerror(errno));

            exit(1);

        }

        v = breakline(input, &c);

        if (c) {

            ct = find_command(v[0]);

            if (ct) {

                if (ct->flags & CMD_FLAG_GLOBAL) {

                    done = command(ct, c, v);

                } else {

                    j = 0;

                    while (!done && (j = args_command(j))) {

                        done = command(ct, c, v);

                    }

                }

            } else {

                fprintf(stderr, _("command \"%s\" not found\n"), v[0]);

            }

	}

        doneline(input, v);

    }

    if (cmdline) {

        free(cmdline);

        return;

    }



    while (!done) {

        if (!prompted) {

            printf("%s", get_prompt());

            fflush(stdout);

            qemu_aio_set_fd_handler(STDIN_FILENO, prep_fetchline, NULL, NULL,

                                    NULL, &fetchable);

            prompted = 1;

        }



        qemu_aio_wait();



        if (!fetchable) {

            continue;

        }

        input = fetchline();

        if (input == NULL) {

            break;

        }

        v = breakline(input, &c);

        if (c) {

            ct = find_command(v[0]);

            if (ct) {

                done = command(ct, c, v);

            } else {

                fprintf(stderr, _("command \"%s\" not found\n"), v[0]);

            }

        }

        doneline(input, v);



        prompted = 0;

        fetchable = 0;

    }

    qemu_aio_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL, NULL, NULL);

}

void command_loop(void)

{

    int c, i, j = 0, done = 0, fetchable = 0, prompted = 0;

    char *input;

    char **v;

    const cmdinfo_t *ct;



    for (i = 0; !done && i < ncmdline; i++) {

        input = strdup(cmdline[i]);

        if (!input) {

            fprintf(stderr, _("cannot strdup command '%s': %s\n"),

                    cmdline[i], strerror(errno));

            exit(1);

        }

        v = breakline(input, &c);

        if (c) {

            ct = find_command(v[0]);

            if (ct) {

                if (ct->flags & CMD_FLAG_GLOBAL) {

                    done = command(ct, c, v);

                } else {

                    j = 0;

                    while (!done && (j = args_command(j))) {

                        done = command(ct, c, v);

                    }

                }

            } else {

                fprintf(stderr, _("command \"%s\" not found\n"), v[0]);

            }

	}

        doneline(input, v);

    }

    if (cmdline) {

        free(cmdline);

        return;

    }



    while (!done) {

        if (!prompted) {

            printf("%s", get_prompt());

            fflush(stdout);

            qemu_aio_set_fd_handler(STDIN_FILENO, prep_fetchline, NULL, NULL,

                                    NULL, &fetchable);

            prompted = 1;

        }



        qemu_aio_wait();



        if (!fetchable) {

            continue;

        }

        input = fetchline();

        if (input == NULL) {

            break;

        }

        v = breakline(input, &c);

        if (c) {

            ct = find_command(v[0]);

            if (ct) {

                done = command(ct, c, v);

            } else {

                fprintf(stderr, _("command \"%s\" not found\n"), v[0]);

            }

        }

        doneline(input, v);



        prompted = 0;

        fetchable = 0;

    }

    qemu_aio_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL, NULL, NULL);

}

        free(cmdline);
void FUNC_0(void)

{

    int VAR_0, VAR_1, VAR_2 = 0, VAR_3 = 0, VAR_4 = 0, VAR_5 = 0;

    char *VAR_6;

    char **VAR_7;

    const cmdinfo_t *VAR_8;



    for (VAR_1 = 0; !VAR_3 && VAR_1 < ncmdline; VAR_1++) {

        VAR_6 = strdup(cmdline[VAR_1]);

        if (!VAR_6) {

            fprintf(stderr, _("cannot strdup command '%s': %s\n"),

                    cmdline[VAR_1], strerror(errno));

            exit(1);

        }

        VAR_7 = breakline(VAR_6, &VAR_0);

        if (VAR_0) {

            VAR_8 = find_command(VAR_7[0]);

            if (VAR_8) {

                if (VAR_8->flags & CMD_FLAG_GLOBAL) {

                    VAR_3 = command(VAR_8, VAR_0, VAR_7);

                } else {

                    VAR_2 = 0;

                    while (!VAR_3 && (VAR_2 = args_command(VAR_2))) {

                        VAR_3 = command(VAR_8, VAR_0, VAR_7);

                    }

                }

            } else {

                fprintf(stderr, _("command \"%s\" not found\n"), VAR_7[0]);

            }

	}

        doneline(VAR_6, VAR_7);

    }

    if (cmdline) {

        free(cmdline);

        return;

    }



    while (!VAR_3) {

        if (!VAR_5) {

            printf("%s", get_prompt());

            fflush(stdout);

            qemu_aio_set_fd_handler(STDIN_FILENO, prep_fetchline, NULL, NULL,

                                    NULL, &VAR_4);

            VAR_5 = 1;

        }



        qemu_aio_wait();



        if (!VAR_4) {

            continue;

        }

        VAR_6 = fetchline();

        if (VAR_6 == NULL) {

            break;

        }

        VAR_7 = breakline(VAR_6, &VAR_0);

        if (VAR_0) {

            VAR_8 = find_command(VAR_7[0]);

            if (VAR_8) {

                VAR_3 = command(VAR_8, VAR_0, VAR_7);

            } else {

                fprintf(stderr, _("command \"%s\" not found\n"), VAR_7[0]);

            }

        }

        doneline(VAR_6, VAR_7);



        VAR_5 = 0;

        VAR_4 = 0;

    }

    qemu_aio_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL, NULL, NULL);

}

void FUNC_0(void)
{ int VAR_0, VAR_1, VAR_2 = 0, VAR_3 = 0, VAR_4 = 0, VAR_5 = 0; char *VAR_6; char **VAR_7; const cmdinfo_t *VAR_8; for (VAR_1 = 0; !VAR_3 && VAR_1 < ncmdline; VAR_1++) { VAR_6 = strdup(cmdline[VAR_1]); if (!VAR_6) { fprintf(stderr, _("cannot strdup command '%s': %s\n"),
cmdline[VAR_1], strerror(errno)); exit(1); } VAR_7 = breakline(VAR_6, &VAR_0); if (VAR_0) { VAR_8 = find_command(VAR_7[0]); if (VAR_8) { if (VAR_8->flags & CMD_FLAG_GLOBAL) { VAR_3 = command(VAR_8, VAR_0, VAR_7); } else { VAR_2 = 0; while (!VAR_3 && (VAR_2 = args_command(VAR_2))) { VAR_3 = command(VAR_8, VAR_0, VAR_7); } } } else { fprintf(stderr, _("command \"%s\" not found\n"), VAR_7[0]); } } doneline(VAR_6, VAR_7); } if (cmdline) { free(cmdline); return; } while (!VAR_3) { if (!VAR_5) { printf("%s", get_prompt()); fflush(stdout); qemu_aio_set_fd_handler(STDIN_FILENO, prep_fetchline, NULL, NULL,
NULL, &VAR_4); VAR_5 = 1; } qemu_aio_wait(); if (!VAR_4) { continue; } VAR_6 = fetchline(); if (VAR_6 == NULL) { break; } VAR_7 = breakline(VAR_6, &VAR_0); if (VAR_0) { VAR_8 = find_command(VAR_7[0]); if (VAR_8) { VAR_3 = command(VAR_8, VAR_0, VAR_7); } else { fprintf(stderr, _("command \"%s\" not found\n"), VAR_7[0]); } } doneline(VAR_6, VAR_7); VAR_5 = 0; VAR_4 = 0; } qemu_aio_set_fd_handler(STDIN_FILENO, NULL, NULL, NULL, NULL, NULL); }