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

{

    size_t len;



    len = strlen(str);

    readline_set_completion_index(rs, len);

    if (nb_args == 2) {

        NetClientState *ncs[MAX_QUEUE_NUM];

        int count, i;

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NONE,

                                             MAX_QUEUE_NUM);

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

            const char *name = ncs[i]->name;

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

                readline_add_completion(rs, name);

            }

        }

    } else if (nb_args == 3) {

        add_completion_option(rs, str, "on");

        add_completion_option(rs, str, "off");

    }

}

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

{

    size_t len;



    len = strlen(str);

    readline_set_completion_index(rs, len);

    if (nb_args == 2) {

        NetClientState *ncs[MAX_QUEUE_NUM];

        int count, i;

        count = qemu_find_net_clients_except(NULL, ncs,

                                             NET_CLIENT_OPTIONS_KIND_NONE,

                                             MAX_QUEUE_NUM);

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

            const char *name = ncs[i]->name;

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

                readline_add_completion(rs, name);

            }

        }

    } else if (nb_args == 3) {

        add_completion_option(rs, str, "on");

        add_completion_option(rs, str, "off");

    }

}

        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)

{

    size_t len;



    len = strlen(VAR_2);

    readline_set_completion_index(VAR_0, len);

    if (VAR_1 == 2) {

        NetClientState *ncs[MAX_QUEUE_NUM];

        int VAR_3, VAR_4;

        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++) {

            const char *VAR_5 = ncs[VAR_4]->VAR_5;

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

                readline_add_completion(VAR_0, VAR_5);

            }

        }

    } else if (VAR_1 == 3) {

        add_completion_option(VAR_0, VAR_2, "on");

        add_completion_option(VAR_0, VAR_2, "off");

    }

}

void FUNC_0(ReadLineState *VAR_0, int VAR_1, const char *VAR_2)
{ size_t len; len = strlen(VAR_2); readline_set_completion_index(VAR_0, len); if (VAR_1 == 2) { NetClientState *ncs[MAX_QUEUE_NUM]; int VAR_3, VAR_4; 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++) { const char *VAR_5 = ncs[VAR_4]->VAR_5; if (!strncmp(VAR_2, VAR_5, len)) { readline_add_completion(VAR_0, VAR_5); } } } else if (VAR_1 == 3) { add_completion_option(VAR_0, VAR_2, "on"); add_completion_option(VAR_0, VAR_2, "off"); } }