void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque)

{

    int i, found;

    WaitObjects *w = &wait_objects;



    found = 0;

    for (i = 0; i < w->num; i++) {

        if (w->events[i] == handle)

            found = 1;

        if (found) {

            w->events[i] = w->events[i + 1];

            w->func[i] = w->func[i + 1];

            w->opaque[i] = w->opaque[i + 1];

        }

    }

    if (found)

        w->num--;

}

void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque)

{

    int i, found;

    WaitObjects *w = &wait_objects;



    found = 0;

    for (i = 0; i < w->num; i++) {

        if (w->events[i] == handle)

            found = 1;

        if (found) {

            w->events[i] = w->events[i + 1];

            w->func[i] = w->func[i + 1];

            w->opaque[i] = w->opaque[i + 1];

        }

    }

    if (found)

        w->num--;

}

void FUNC_0(HANDLE VAR_0, WaitObjectFunc *VAR_1, void *VAR_2)

{

    int VAR_3, VAR_4;

    WaitObjects *w = &wait_objects;



    VAR_4 = 0;

    for (VAR_3 = 0; VAR_3 < w->num; VAR_3++) {

        if (w->events[VAR_3] == VAR_0)

            VAR_4 = 1;

        if (VAR_4) {

            w->events[VAR_3] = w->events[VAR_3 + 1];

            w->VAR_1[VAR_3] = w->VAR_1[VAR_3 + 1];

            w->VAR_2[VAR_3] = w->VAR_2[VAR_3 + 1];

        }

    }

    if (VAR_4)

        w->num--;

}

void FUNC_0(HANDLE VAR_0, WaitObjectFunc *VAR_1, void *VAR_2)
{ int VAR_3, VAR_4; WaitObjects *w = &wait_objects; VAR_4 = 0; for (VAR_3 = 0; VAR_3 < w->num; VAR_3++) { if (w->events[VAR_3] == VAR_0)
VAR_4 = 1; if (VAR_4) { w->events[VAR_3] = w->events[VAR_3 + 1]; w->VAR_1[VAR_3] = w->VAR_1[VAR_3 + 1]; w->VAR_2[VAR_3] = w->VAR_2[VAR_3 + 1]; } } if (VAR_4)
w->num--; }