static void cpu_ioreq_pio(ioreq_t *req)

{

    int i, sign;



    sign = req->df ? -1 : 1;



    if (req->dir == IOREQ_READ) {

        if (!req->data_is_ptr) {

            req->data = do_inp(req->addr, req->size);

        } else {

            uint32_t tmp;



            for (i = 0; i < req->count; i++) {

                tmp = do_inp(req->addr, req->size);

                cpu_physical_memory_write(

                        req->data + (sign * i * (int64_t)req->size),

                        (uint8_t *) &tmp, req->size);

            }

        }

    } else if (req->dir == IOREQ_WRITE) {

        if (!req->data_is_ptr) {

            do_outp(req->addr, req->size, req->data);

        } else {

            for (i = 0; i < req->count; i++) {

                uint32_t tmp = 0;



                cpu_physical_memory_read(

                        req->data + (sign * i * (int64_t)req->size),

                        (uint8_t*) &tmp, req->size);

                do_outp(req->addr, req->size, tmp);

            }

        }

    }

}

static void cpu_ioreq_pio(ioreq_t *req)

{

    int i, sign;



    sign = req->df ? -1 : 1;



    if (req->dir == IOREQ_READ) {

        if (!req->data_is_ptr) {

            req->data = do_inp(req->addr, req->size);

        } else {

            uint32_t tmp;



            for (i = 0; i < req->count; i++) {

                tmp = do_inp(req->addr, req->size);

                cpu_physical_memory_write(

                        req->data + (sign * i * (int64_t)req->size),

                        (uint8_t *) &tmp, req->size);

            }

        }

    } else if (req->dir == IOREQ_WRITE) {

        if (!req->data_is_ptr) {

            do_outp(req->addr, req->size, req->data);

        } else {

            for (i = 0; i < req->count; i++) {

                uint32_t tmp = 0;



                cpu_physical_memory_read(

                        req->data + (sign * i * (int64_t)req->size),

                        (uint8_t*) &tmp, req->size);

                do_outp(req->addr, req->size, tmp);

            }

        }

    }

}

static void cpu_ioreq_pio(ioreq_t *req)     int i, sign;     sign = req->df ? -1 : 1;                 cpu_physical_memory_write(                         req->data + (sign * i * (int64_t)req->size),                         (uint8_t *) &tmp, req->size);                 cpu_physical_memory_read(                         req->data + (sign * i * (int64_t)req->size),                         (uint8_t*) &tmp, req->size);     int i, sign;     sign = req->df ? -1 : 1;                 cpu_physical_memory_read(                 cpu_physical_memory_write(                 cpu_physical_memory_read(                         (uint8_t*) &tmp, req->size);                 cpu_physical_memory_write(                         req->data + (sign * i * (int64_t)req->size),                         (uint8_t*) &tmp, req->size);                 cpu_physical_memory_read(                         req->data + (sign * i * (int64_t)req->size),                         (uint8_t*) &tmp, req->size);                 cpu_physical_memory_write(                         (uint8_t*) &tmp, req->size);
static void FUNC_0(ioreq_t *VAR_0)

{

    int VAR_1, VAR_2;



    VAR_2 = VAR_0->df ? -1 : 1;



    if (VAR_0->dir == IOREQ_READ) {

        if (!VAR_0->data_is_ptr) {

            VAR_0->data = do_inp(VAR_0->addr, VAR_0->size);

        } else {

            uint32_t tmp;



            for (VAR_1 = 0; VAR_1 < VAR_0->count; VAR_1++) {

                tmp = do_inp(VAR_0->addr, VAR_0->size);

                cpu_physical_memory_write(

                        VAR_0->data + (VAR_2 * VAR_1 * (int64_t)VAR_0->size),

                        (uint8_t *) &tmp, VAR_0->size);

            }

        }

    } else if (VAR_0->dir == IOREQ_WRITE) {

        if (!VAR_0->data_is_ptr) {

            do_outp(VAR_0->addr, VAR_0->size, VAR_0->data);

        } else {

            for (VAR_1 = 0; VAR_1 < VAR_0->count; VAR_1++) {

                uint32_t tmp = 0;



                cpu_physical_memory_read(

                        VAR_0->data + (VAR_2 * VAR_1 * (int64_t)VAR_0->size),

                        (uint8_t*) &tmp, VAR_0->size);

                do_outp(VAR_0->addr, VAR_0->size, tmp);

            }

        }

    }

}

static void FUNC_0(ioreq_t *VAR_0)
{ int VAR_1, VAR_2; VAR_2 = VAR_0->df ? -1 : 1; if (VAR_0->dir == IOREQ_READ) { if (!VAR_0->data_is_ptr) { VAR_0->data = do_inp(VAR_0->addr, VAR_0->size); } else { uint32_t tmp; for (VAR_1 = 0; VAR_1 < VAR_0->count; VAR_1++) { tmp = do_inp(VAR_0->addr, VAR_0->size); cpu_physical_memory_write(
VAR_0->data + (VAR_2 * VAR_1 * (int64_t)VAR_0->size),
(uint8_t *) &tmp, VAR_0->size); } } } else if (VAR_0->dir == IOREQ_WRITE) { if (!VAR_0->data_is_ptr) { do_outp(VAR_0->addr, VAR_0->size, VAR_0->data); } else { for (VAR_1 = 0; VAR_1 < VAR_0->count; VAR_1++) { uint32_t tmp = 0; cpu_physical_memory_read(
VAR_0->data + (VAR_2 * VAR_1 * (int64_t)VAR_0->size),
(uint8_t*) &tmp, VAR_0->size); do_outp(VAR_0->addr, VAR_0->size, tmp); } } } }