static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)

{

    DisplaySurface *surface = qemu_console_surface(qxl->vga.con);

    uint8_t *dst = surface_data(surface);

    uint8_t *src;

    int len, i;



    if (is_buffer_shared(surface)) {

        return;

    }

    if (!qxl->guest_primary.data) {

        trace_qxl_render_blit_guest_primary_initialized();

        qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram);

    }

    trace_qxl_render_blit(qxl->guest_primary.qxl_stride,

            rect->left, rect->right, rect->top, rect->bottom);

    src = qxl->guest_primary.data;

    if (qxl->guest_primary.qxl_stride < 0) {

        /* qxl surface is upside down, walk src scanlines

         * in reverse order to flip it */

        src += (qxl->guest_primary.surface.height - rect->top - 1) *

            qxl->guest_primary.abs_stride;

    } else {

        src += rect->top * qxl->guest_primary.abs_stride;

    }

    dst += rect->top  * qxl->guest_primary.abs_stride;

    src += rect->left * qxl->guest_primary.bytes_pp;

    dst += rect->left * qxl->guest_primary.bytes_pp;

    len  = (rect->right - rect->left) * qxl->guest_primary.bytes_pp;



    for (i = rect->top; i < rect->bottom; i++) {

        memcpy(dst, src, len);

        dst += qxl->guest_primary.abs_stride;

        src += qxl->guest_primary.qxl_stride;

    }

}

static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)

{

    DisplaySurface *surface = qemu_console_surface(qxl->vga.con);

    uint8_t *dst = surface_data(surface);

    uint8_t *src;

    int len, i;



    if (is_buffer_shared(surface)) {

        return;

    }

    if (!qxl->guest_primary.data) {

        trace_qxl_render_blit_guest_primary_initialized();

        qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram);

    }

    trace_qxl_render_blit(qxl->guest_primary.qxl_stride,

            rect->left, rect->right, rect->top, rect->bottom);

    src = qxl->guest_primary.data;

    if (qxl->guest_primary.qxl_stride < 0) {

        



        src += (qxl->guest_primary.surface.height - rect->top - 1) *

            qxl->guest_primary.abs_stride;

    } else {

        src += rect->top * qxl->guest_primary.abs_stride;

    }

    dst += rect->top  * qxl->guest_primary.abs_stride;

    src += rect->left * qxl->guest_primary.bytes_pp;

    dst += rect->left * qxl->guest_primary.bytes_pp;

    len  = (rect->right - rect->left) * qxl->guest_primary.bytes_pp;



    for (i = rect->top; i < rect->bottom; i++) {

        memcpy(dst, src, len);

        dst += qxl->guest_primary.abs_stride;

        src += qxl->guest_primary.qxl_stride;

    }

}

static void FUNC_0(PCIQXLDevice *VAR_0, QXLRect *VAR_1)

{

    DisplaySurface *surface = qemu_console_surface(VAR_0->vga.con);

    uint8_t *dst = surface_data(surface);

    uint8_t *src;

    int VAR_2, VAR_3;



    if (is_buffer_shared(surface)) {

        return;

    }

    if (!VAR_0->guest_primary.data) {

        trace_qxl_render_blit_guest_primary_initialized();

        VAR_0->guest_primary.data = memory_region_get_ram_ptr(&VAR_0->vga.vram);

    }

    trace_qxl_render_blit(VAR_0->guest_primary.qxl_stride,

            VAR_1->left, VAR_1->right, VAR_1->top, VAR_1->bottom);

    src = VAR_0->guest_primary.data;

    if (VAR_0->guest_primary.qxl_stride < 0) {

        



        src += (VAR_0->guest_primary.surface.height - VAR_1->top - 1) *

            VAR_0->guest_primary.abs_stride;

    } else {

        src += VAR_1->top * VAR_0->guest_primary.abs_stride;

    }

    dst += VAR_1->top  * VAR_0->guest_primary.abs_stride;

    src += VAR_1->left * VAR_0->guest_primary.bytes_pp;

    dst += VAR_1->left * VAR_0->guest_primary.bytes_pp;

    VAR_2  = (VAR_1->right - VAR_1->left) * VAR_0->guest_primary.bytes_pp;



    for (VAR_3 = VAR_1->top; VAR_3 < VAR_1->bottom; VAR_3++) {

        memcpy(dst, src, VAR_2);

        dst += VAR_0->guest_primary.abs_stride;

        src += VAR_0->guest_primary.qxl_stride;

    }

}

static void FUNC_0(PCIQXLDevice *VAR_0, QXLRect *VAR_1)
{ DisplaySurface *surface = qemu_console_surface(VAR_0->vga.con); uint8_t *dst = surface_data(surface); uint8_t *src; int VAR_2, VAR_3; if (is_buffer_shared(surface)) { return; } if (!VAR_0->guest_primary.data) { trace_qxl_render_blit_guest_primary_initialized(); VAR_0->guest_primary.data = memory_region_get_ram_ptr(&VAR_0->vga.vram); } trace_qxl_render_blit(VAR_0->guest_primary.qxl_stride,
VAR_1->left, VAR_1->right, VAR_1->top, VAR_1->bottom); src = VAR_0->guest_primary.data; if (VAR_0->guest_primary.qxl_stride < 0) { src += (VAR_0->guest_primary.surface.height - VAR_1->top - 1) *
VAR_0->guest_primary.abs_stride; } else { src += VAR_1->top * VAR_0->guest_primary.abs_stride; } dst += VAR_1->top  * VAR_0->guest_primary.abs_stride; src += VAR_1->left * VAR_0->guest_primary.bytes_pp; dst += VAR_1->left * VAR_0->guest_primary.bytes_pp; VAR_2  = (VAR_1->right - VAR_1->left) * VAR_0->guest_primary.bytes_pp; for (VAR_3 = VAR_1->top; VAR_3 < VAR_1->bottom; VAR_3++) { memcpy(dst, src, VAR_2); dst += VAR_0->guest_primary.abs_stride; src += VAR_0->guest_primary.qxl_stride; } }