void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)

{

    NetClientState *ncs[MAX_QUEUE_NUM];

    int count, i, len;



    len = strlen(str);

    readline_set_completion_index(rs, len);

    if (nb_args == 2) {

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NONE,

                                             MAX_QUEUE_NUM);

        for (i = 0; i < count; i++) {

            int id;

            char name[16];



            if (net_hub_id_for_client(ncs[i], &id)) {

                continue;

            }

            snprintf(name, sizeof(name), "%d", id);

            if (!strncmp(str, name, len)) {

                readline_add_completion(rs, name);

            }

        }

        return;

    } else if (nb_args == 3) {

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NIC,

                                             MAX_QUEUE_NUM);

        for (i = 0; i < count; i++) {

            int id;

            const char *name;



            if (ncs[i]->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT ||

                net_hub_id_for_client(ncs[i], &id)) {

                continue;

            }

            name = ncs[i]->name;

            if (!strncmp(str, name, len)) {

                readline_add_completion(rs, name);

            }

        }

        return;

    }

}

void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)

{

    NetClientState *ncs[MAX_QUEUE_NUM];

    int count, i, len;



    len = strlen(str);

    readline_set_completion_index(rs, len);

    if (nb_args == 2) {

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NONE,

                                             MAX_QUEUE_NUM);

        for (i = 0; i < count; i++) {

            int id;

            char name[16];



            if (net_hub_id_for_client(ncs[i], &id)) {

                continue;

            }

            snprintf(name, sizeof(name), "%d", id);

            if (!strncmp(str, name, len)) {

                readline_add_completion(rs, name);

            }

        }

        return;

    } else if (nb_args == 3) {

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NIC,

                                             MAX_QUEUE_NUM);

        for (i = 0; i < count; i++) {

            int id;

            const char *name;



            if (ncs[i]->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT ||

                net_hub_id_for_client(ncs[i], &id)) {

                continue;

            }

            name = ncs[i]->name;

            if (!strncmp(str, name, len)) {

                readline_add_completion(rs, name);

            }

        }

        return;

    }

}

        for (i = 0; i < count; i++) {         for (i = 0; i < count; i++) {         for (i = 0; i < count; i++) {
void FUNC_0(ReadLineState *VAR_0, int VAR_1, const char *VAR_2)

{

    NetClientState *ncs[MAX_QUEUE_NUM];

    int VAR_3, VAR_4, VAR_5;



    VAR_5 = strlen(VAR_2);

    readline_set_completion_index(VAR_0, VAR_5);

    if (VAR_1 == 2) {

        VAR_3 = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NONE,

                                             MAX_QUEUE_NUM);

        for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) {

            int VAR_8;

            char VAR_8[16];



            if (net_hub_id_for_client(ncs[VAR_4], &VAR_8)) {

                continue;

            }

            snprintf(VAR_8, sizeof(VAR_8), "%d", VAR_8);

            if (!strncmp(VAR_2, VAR_8, VAR_5)) {

                readline_add_completion(VAR_0, VAR_8);

            }

        }

        return;

    } else if (VAR_1 == 3) {

        VAR_3 = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NIC,

                                             MAX_QUEUE_NUM);

        for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) {

            int VAR_8;

            const char *VAR_8;



            if (ncs[VAR_4]->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT ||

                net_hub_id_for_client(ncs[VAR_4], &VAR_8)) {

                continue;

            }

            VAR_8 = ncs[VAR_4]->VAR_8;

            if (!strncmp(VAR_2, VAR_8, VAR_5)) {

                readline_add_completion(VAR_0, VAR_8);

            }

        }

        return;

    }

}

void FUNC_0(ReadLineState *VAR_0, int VAR_1, const char *VAR_2)
{ NetClientState *ncs[MAX_QUEUE_NUM]; int VAR_3, VAR_4, VAR_5; VAR_5 = strlen(VAR_2); readline_set_completion_index(VAR_0, VAR_5); if (VAR_1 == 2) { VAR_3 = qemu_find_net_clients_except(NULL, ncs,
NET_CLIENT_OPTIONS_KIND_NONE,
MAX_QUEUE_NUM); for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) { int VAR_8; char VAR_8[16]; if (net_hub_id_for_client(ncs[VAR_4], &VAR_8)) { continue; } snprintf(VAR_8, sizeof(VAR_8), "%d", VAR_8); if (!strncmp(VAR_2, VAR_8, VAR_5)) { readline_add_completion(VAR_0, VAR_8); } } return; } else if (VAR_1 == 3) { VAR_3 = qemu_find_net_clients_except(NULL, ncs,
NET_CLIENT_OPTIONS_KIND_NIC,
MAX_QUEUE_NUM); for (VAR_4 = 0; VAR_4 < VAR_3; VAR_4++) { int VAR_8; const char *VAR_8; if (ncs[VAR_4]->info->type == NET_CLIENT_OPTIONS_KIND_HUBPORT ||
net_hub_id_for_client(ncs[VAR_4], &VAR_8)) { continue; } VAR_8 = ncs[VAR_4]->VAR_8; if (!strncmp(VAR_2, VAR_8, VAR_5)) { readline_add_completion(VAR_0, VAR_8); } } return; } }