static void cpu_ioreq_move(ioreq_t *req)

{

    int i, sign;



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



    if (!req->data_is_ptr) {

        if (req->dir == IOREQ_READ) {

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

                cpu_physical_memory_read(

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

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

            }

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

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

                cpu_physical_memory_write(

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

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

            }

        }

    } else {

        uint64_t tmp;



        if (req->dir == IOREQ_READ) {

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

                cpu_physical_memory_read(

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

                        (uint8_t*) &tmp, 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) {

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

                cpu_physical_memory_read(

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

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

                cpu_physical_memory_write(

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

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

            }

        }

    }

}

static void cpu_ioreq_move(ioreq_t *req)

{

    int i, sign;



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



    if (!req->data_is_ptr) {

        if (req->dir == IOREQ_READ) {

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

                cpu_physical_memory_read(

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

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

            }

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

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

                cpu_physical_memory_write(

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

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

            }

        }

    } else {

        uint64_t tmp;



        if (req->dir == IOREQ_READ) {

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

                cpu_physical_memory_read(

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

                        (uint8_t*) &tmp, 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) {

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

                cpu_physical_memory_read(

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

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

                cpu_physical_memory_write(

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

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

            }

        }

    }

}

    int i, sign;     sign = req->df ? -1 : 1;                 cpu_physical_memory_write(                         req->data + (sign * i * (int64_t)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(                         req->addr + (sign * i * (int64_t)req->size),                         (uint8_t *) &req->data, req->size);                 cpu_physical_memory_write(                         req->addr + (sign * i * (int64_t)req->size),                         (uint8_t *) &req->data, req->size);                 cpu_physical_memory_read(                         req->addr + (sign * i * (int64_t)req->size),                         (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(                         req->addr + (sign * i * (int64_t)req->size),                         (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->data_is_ptr) {

        if (VAR_0->dir == IOREQ_READ) {

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

                cpu_physical_memory_read(

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

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

            }

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

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

                cpu_physical_memory_write(

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

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

            }

        }

    } else {

        uint64_t tmp;



        if (VAR_0->dir == IOREQ_READ) {

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

                cpu_physical_memory_read(

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

                        (uint8_t*) &tmp, 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) {

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

                cpu_physical_memory_read(

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

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

                cpu_physical_memory_write(

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

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

            }

        }

    }

}

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