static void qemu_laio_completion_cb(void *opaque)

{

    struct qemu_laio_state *s = opaque;



    while (1) {

        struct io_event events[MAX_EVENTS];

        uint64_t val;

        ssize_t ret;

        struct timespec ts = { 0 };

        int nevents, i;



        do {

            ret = read(s->efd, &val, sizeof(val));

        } while (ret == 1 && errno == EINTR);



        if (ret == -1 && errno == EAGAIN)

            break;



        if (ret != 8)

            break;



        do {

            nevents = io_getevents(s->ctx, val, MAX_EVENTS, events, &ts);

        } while (nevents == -EINTR);



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

            struct iocb *iocb = events[i].obj;

            struct qemu_laiocb *laiocb =

                    container_of(iocb, struct qemu_laiocb, iocb);



            laiocb->ret = io_event_ret(&events[i]);

            qemu_laio_enqueue_completed(s, laiocb);

        }

    }

}

static void qemu_laio_completion_cb(void *opaque)

{

    struct qemu_laio_state *s = opaque;



    while (1) {

        struct io_event events[MAX_EVENTS];

        uint64_t val;

        ssize_t ret;

        struct timespec ts = { 0 };

        int nevents, i;



        do {

            ret = read(s->efd, &val, sizeof(val));

        } while (ret == 1 && errno == EINTR);



        if (ret == -1 && errno == EAGAIN)

            break;



        if (ret != 8)

            break;



        do {

            nevents = io_getevents(s->ctx, val, MAX_EVENTS, events, &ts);

        } while (nevents == -EINTR);



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

            struct iocb *iocb = events[i].obj;

            struct qemu_laiocb *laiocb =

                    container_of(iocb, struct qemu_laiocb, iocb);



            laiocb->ret = io_event_ret(&events[i]);

            qemu_laio_enqueue_completed(s, laiocb);

        }

    }

}

static void FUNC_0(void *VAR_0)

{

    struct qemu_laio_state *VAR_1 = VAR_0;



    while (1) {

        struct io_event VAR_2[MAX_EVENTS];

        uint64_t val;

        ssize_t ret;

        struct timespec VAR_3 = { 0 };

        int VAR_4, VAR_5;



        do {

            ret = read(VAR_1->efd, &val, sizeof(val));

        } while (ret == 1 && errno == EINTR);



        if (ret == -1 && errno == EAGAIN)

            break;



        if (ret != 8)

            break;



        do {

            VAR_4 = io_getevents(VAR_1->ctx, val, MAX_EVENTS, VAR_2, &VAR_3);

        } while (VAR_4 == -EINTR);



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

            struct VAR_6 *VAR_6 = VAR_2[VAR_5].obj;

            struct qemu_laiocb *VAR_7 =

                    container_of(VAR_6, struct qemu_laiocb, VAR_6);



            VAR_7->ret = io_event_ret(&VAR_2[VAR_5]);

            qemu_laio_enqueue_completed(VAR_1, VAR_7);

        }

    }

}

static void FUNC_0(void *VAR_0)
{ struct qemu_laio_state *VAR_1 = VAR_0; while (1) { struct io_event VAR_2[MAX_EVENTS]; uint64_t val; ssize_t ret; struct timespec VAR_3 = { 0 }; int VAR_4, VAR_5; do { ret = read(VAR_1->efd, &val, sizeof(val)); } while (ret == 1 && errno == EINTR); if (ret == -1 && errno == EAGAIN)
break; if (ret != 8)
break; do { VAR_4 = io_getevents(VAR_1->ctx, val, MAX_EVENTS, VAR_2, &VAR_3); } while (VAR_4 == -EINTR); for (VAR_5 = 0; VAR_5 < VAR_4; VAR_5++) { struct VAR_6 *VAR_6 = VAR_2[VAR_5].obj; struct qemu_laiocb *VAR_7 =
container_of(VAR_6, struct qemu_laiocb, VAR_6); VAR_7->ret = io_event_ret(&VAR_2[VAR_5]); qemu_laio_enqueue_completed(VAR_1, VAR_7); } } }