static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)

{

    int copy_count;

    uint8_t *end_ptr;



    if (s->cirrus_srccounter > 0) {

        if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {

            cirrus_bitblt_common_patterncopy(s, false);

        the_end:

            s->cirrus_srccounter = 0;

            cirrus_bitblt_reset(s);

        } else {

            /* at least one scan line */

            do {

                (*s->cirrus_rop)(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,

                                  s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);

                cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,

                                         s->cirrus_blt_width, 1);

                s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;

                s->cirrus_srccounter -= s->cirrus_blt_srcpitch;

                if (s->cirrus_srccounter <= 0)

                    goto the_end;

                /* more bytes than needed can be transferred because of

                   word alignment, so we keep them for the next line */

                /* XXX: keep alignment to speed up transfer */

                end_ptr = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

                copy_count = s->cirrus_srcptr_end - end_ptr;

                memmove(s->cirrus_bltbuf, end_ptr, copy_count);

                s->cirrus_srcptr = s->cirrus_bltbuf + copy_count;

                s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

            } while (s->cirrus_srcptr >= s->cirrus_srcptr_end);

        }

    }

}

static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)

{

    int copy_count;

    uint8_t *end_ptr;



    if (s->cirrus_srccounter > 0) {

        if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {

            cirrus_bitblt_common_patterncopy(s, false);

        the_end:

            s->cirrus_srccounter = 0;

            cirrus_bitblt_reset(s);

        } else {

            

            do {

                (*s->cirrus_rop)(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,

                                  s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);

                cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,

                                         s->cirrus_blt_width, 1);

                s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;

                s->cirrus_srccounter -= s->cirrus_blt_srcpitch;

                if (s->cirrus_srccounter <= 0)

                    goto the_end;

                



                

                end_ptr = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

                copy_count = s->cirrus_srcptr_end - end_ptr;

                memmove(s->cirrus_bltbuf, end_ptr, copy_count);

                s->cirrus_srcptr = s->cirrus_bltbuf + copy_count;

                s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

            } while (s->cirrus_srcptr >= s->cirrus_srcptr_end);

        }

    }

}

static void FUNC_0(CirrusVGAState * VAR_0)

{

    int VAR_1;

    uint8_t *end_ptr;



    if (VAR_0->cirrus_srccounter > 0) {

        if (VAR_0->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {

            cirrus_bitblt_common_patterncopy(VAR_0, false);

        the_end:

            VAR_0->cirrus_srccounter = 0;

            cirrus_bitblt_reset(VAR_0);

        } else {

            

            do {

                (*VAR_0->cirrus_rop)(VAR_0, VAR_0->vga.vram_ptr + VAR_0->cirrus_blt_dstaddr,

                                  VAR_0->cirrus_bltbuf, 0, 0, VAR_0->cirrus_blt_width, 1);

                cirrus_invalidate_region(VAR_0, VAR_0->cirrus_blt_dstaddr, 0,

                                         VAR_0->cirrus_blt_width, 1);

                VAR_0->cirrus_blt_dstaddr += VAR_0->cirrus_blt_dstpitch;

                VAR_0->cirrus_srccounter -= VAR_0->cirrus_blt_srcpitch;

                if (VAR_0->cirrus_srccounter <= 0)

                    goto the_end;

                



                

                end_ptr = VAR_0->cirrus_bltbuf + VAR_0->cirrus_blt_srcpitch;

                VAR_1 = VAR_0->cirrus_srcptr_end - end_ptr;

                memmove(VAR_0->cirrus_bltbuf, end_ptr, VAR_1);

                VAR_0->cirrus_srcptr = VAR_0->cirrus_bltbuf + VAR_1;

                VAR_0->cirrus_srcptr_end = VAR_0->cirrus_bltbuf + VAR_0->cirrus_blt_srcpitch;

            } while (VAR_0->cirrus_srcptr >= VAR_0->cirrus_srcptr_end);

        }

    }

}

static void FUNC_0(CirrusVGAState * VAR_0)
{ int VAR_1; uint8_t *end_ptr; if (VAR_0->cirrus_srccounter > 0) { if (VAR_0->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) { cirrus_bitblt_common_patterncopy(VAR_0, false); the_end:
VAR_0->cirrus_srccounter = 0; cirrus_bitblt_reset(VAR_0); } else { do { (*VAR_0->cirrus_rop)(VAR_0, VAR_0->vga.vram_ptr + VAR_0->cirrus_blt_dstaddr,
VAR_0->cirrus_bltbuf, 0, 0, VAR_0->cirrus_blt_width, 1); cirrus_invalidate_region(VAR_0, VAR_0->cirrus_blt_dstaddr, 0,
VAR_0->cirrus_blt_width, 1); VAR_0->cirrus_blt_dstaddr += VAR_0->cirrus_blt_dstpitch; VAR_0->cirrus_srccounter -= VAR_0->cirrus_blt_srcpitch; if (VAR_0->cirrus_srccounter <= 0)
goto the_end; end_ptr = VAR_0->cirrus_bltbuf + VAR_0->cirrus_blt_srcpitch; VAR_1 = VAR_0->cirrus_srcptr_end - end_ptr; memmove(VAR_0->cirrus_bltbuf, end_ptr, VAR_1); VAR_0->cirrus_srcptr = VAR_0->cirrus_bltbuf + VAR_1; VAR_0->cirrus_srcptr_end = VAR_0->cirrus_bltbuf + VAR_0->cirrus_blt_srcpitch; } while (VAR_0->cirrus_srcptr >= VAR_0->cirrus_srcptr_end); } } }