int vnc_hextile_send_framebuffer_update(VncState *vs, int x,

                                        int y, int w, int h)

{

    int i, j;

    int has_fg, has_bg;

    uint8_t *last_fg, *last_bg;

    VncDisplay *vd = vs->vd;



    last_fg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel);

    last_bg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel);

    has_fg = has_bg = 0;

    for (j = y; j < (y + h); j += 16) {

        for (i = x; i < (x + w); i += 16) {

            vs->send_hextile_tile(vs, i, j,

                                  MIN(16, x + w - i), MIN(16, y + h - j),

                                  last_bg, last_fg, &has_bg, &has_fg);

        }

    }

    free(last_fg);

    free(last_bg);



    return 1;

}

int vnc_hextile_send_framebuffer_update(VncState *vs, int x,

                                        int y, int w, int h)

{

    int i, j;

    int has_fg, has_bg;

    uint8_t *last_fg, *last_bg;

    VncDisplay *vd = vs->vd;



    last_fg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel);

    last_bg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel);

    has_fg = has_bg = 0;

    for (j = y; j < (y + h); j += 16) {

        for (i = x; i < (x + w); i += 16) {

            vs->send_hextile_tile(vs, i, j,

                                  MIN(16, x + w - i), MIN(16, y + h - j),

                                  last_bg, last_fg, &has_bg, &has_fg);

        }

    }

    free(last_fg);

    free(last_bg);



    return 1;

}

int FUNC_0(VncState *VAR_0, int VAR_1,

                                        int VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5, VAR_6;

    int VAR_7, VAR_8;

    uint8_t *last_fg, *last_bg;

    VncDisplay *vd = VAR_0->vd;



    last_fg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel);

    last_bg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel);

    VAR_7 = VAR_8 = 0;

    for (VAR_6 = VAR_2; VAR_6 < (VAR_2 + VAR_4); VAR_6 += 16) {

        for (VAR_5 = VAR_1; VAR_5 < (VAR_1 + VAR_3); VAR_5 += 16) {

            VAR_0->send_hextile_tile(VAR_0, VAR_5, VAR_6,

                                  MIN(16, VAR_1 + VAR_3 - VAR_5), MIN(16, VAR_2 + VAR_4 - VAR_6),

                                  last_bg, last_fg, &VAR_8, &VAR_7);

        }

    }

    free(last_fg);

    free(last_bg);



    return 1;

}

int FUNC_0(VncState *VAR_0, int VAR_1,
int VAR_2, int VAR_3, int VAR_4)
{ int VAR_5, VAR_6; int VAR_7, VAR_8; uint8_t *last_fg, *last_bg; VncDisplay *vd = VAR_0->vd; last_fg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel); last_bg = (uint8_t *) qemu_malloc(vd->server->pf.bytes_per_pixel); VAR_7 = VAR_8 = 0; for (VAR_6 = VAR_2; VAR_6 < (VAR_2 + VAR_4); VAR_6 += 16) { for (VAR_5 = VAR_1; VAR_5 < (VAR_1 + VAR_3); VAR_5 += 16) { VAR_0->send_hextile_tile(VAR_0, VAR_5, VAR_6,
MIN(16, VAR_1 + VAR_3 - VAR_5), MIN(16, VAR_2 + VAR_4 - VAR_6),
last_bg, last_fg, &VAR_8, &VAR_7); } } free(last_fg); free(last_bg); return 1; }