static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,

                int x0, int y0, int x1, int y1, int w, int h)

{

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

    uint8_t *vram = s->vga.vram_ptr;

    int bypl = surface_stride(surface);

    int bypp = surface_bytes_per_pixel(surface);

    int width = bypp * w;

    int line = h;

    uint8_t *ptr[2];



    if (y1 > y0) {

        ptr[0] = vram + bypp * x0 + bypl * (y0 + h - 1);

        ptr[1] = vram + bypp * x1 + bypl * (y1 + h - 1);

        for (; line > 0; line --, ptr[0] -= bypl, ptr[1] -= bypl) {

            memmove(ptr[1], ptr[0], width);

        }

    } else {

        ptr[0] = vram + bypp * x0 + bypl * y0;

        ptr[1] = vram + bypp * x1 + bypl * y1;

        for (; line > 0; line --, ptr[0] += bypl, ptr[1] += bypl) {

            memmove(ptr[1], ptr[0], width);

        }

    }



    vmsvga_update_rect_delayed(s, x1, y1, w, h);

}

static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,

                int x0, int y0, int x1, int y1, int w, int h)

{

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

    uint8_t *vram = s->vga.vram_ptr;

    int bypl = surface_stride(surface);

    int bypp = surface_bytes_per_pixel(surface);

    int width = bypp * w;

    int line = h;

    uint8_t *ptr[2];



    if (y1 > y0) {

        ptr[0] = vram + bypp * x0 + bypl * (y0 + h - 1);

        ptr[1] = vram + bypp * x1 + bypl * (y1 + h - 1);

        for (; line > 0; line --, ptr[0] -= bypl, ptr[1] -= bypl) {

            memmove(ptr[1], ptr[0], width);

        }

    } else {

        ptr[0] = vram + bypp * x0 + bypl * y0;

        ptr[1] = vram + bypp * x1 + bypl * y1;

        for (; line > 0; line --, ptr[0] += bypl, ptr[1] += bypl) {

            memmove(ptr[1], ptr[0], width);

        }

    }



    vmsvga_update_rect_delayed(s, x1, y1, w, h);

}

static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
static inline void FUNC_0(struct vmsvga_state_s *VAR_0,

                int VAR_1, int VAR_2, int VAR_3, int VAR_4, int VAR_5, int VAR_6)

{

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

    uint8_t *vram = VAR_0->vga.vram_ptr;

    int VAR_7 = surface_stride(surface);

    int VAR_8 = surface_bytes_per_pixel(surface);

    int VAR_9 = VAR_8 * VAR_5;

    int VAR_10 = VAR_6;

    uint8_t *ptr[2];



    if (VAR_4 > VAR_2) {

        ptr[0] = vram + VAR_8 * VAR_1 + VAR_7 * (VAR_2 + VAR_6 - 1);

        ptr[1] = vram + VAR_8 * VAR_3 + VAR_7 * (VAR_4 + VAR_6 - 1);

        for (; VAR_10 > 0; VAR_10 --, ptr[0] -= VAR_7, ptr[1] -= VAR_7) {

            memmove(ptr[1], ptr[0], VAR_9);

        }

    } else {

        ptr[0] = vram + VAR_8 * VAR_1 + VAR_7 * VAR_2;

        ptr[1] = vram + VAR_8 * VAR_3 + VAR_7 * VAR_4;

        for (; VAR_10 > 0; VAR_10 --, ptr[0] += VAR_7, ptr[1] += VAR_7) {

            memmove(ptr[1], ptr[0], VAR_9);

        }

    }



    vmsvga_update_rect_delayed(VAR_0, VAR_3, VAR_4, VAR_5, VAR_6);

}

static inline void FUNC_0(struct vmsvga_state_s *VAR_0,
int VAR_1, int VAR_2, int VAR_3, int VAR_4, int VAR_5, int VAR_6)
{ DisplaySurface *surface = qemu_console_surface(VAR_0->vga.con); uint8_t *vram = VAR_0->vga.vram_ptr; int VAR_7 = surface_stride(surface); int VAR_8 = surface_bytes_per_pixel(surface); int VAR_9 = VAR_8 * VAR_5; int VAR_10 = VAR_6; uint8_t *ptr[2]; if (VAR_4 > VAR_2) { ptr[0] = vram + VAR_8 * VAR_1 + VAR_7 * (VAR_2 + VAR_6 - 1); ptr[1] = vram + VAR_8 * VAR_3 + VAR_7 * (VAR_4 + VAR_6 - 1); for (; VAR_10 > 0; VAR_10 --, ptr[0] -= VAR_7, ptr[1] -= VAR_7) { memmove(ptr[1], ptr[0], VAR_9); } } else { ptr[0] = vram + VAR_8 * VAR_1 + VAR_7 * VAR_2; ptr[1] = vram + VAR_8 * VAR_3 + VAR_7 * VAR_4; for (; VAR_10 > 0; VAR_10 --, ptr[0] += VAR_7, ptr[1] += VAR_7) { memmove(ptr[1], ptr[0], VAR_9); } } vmsvga_update_rect_delayed(VAR_0, VAR_3, VAR_4, VAR_5, VAR_6); }