static void tight_send_compact_size(VncState *vs, size_t len)

{

    int lpc = 0;

    int bytes = 0;

    char buf[3] = {0, 0, 0};



    buf[bytes++] = len & 0x7F;

    if (len > 0x7F) {

        buf[bytes-1] |= 0x80;

        buf[bytes++] = (len >> 7) & 0x7F;

        if (len > 0x3FFF) {

            buf[bytes-1] |= 0x80;

            buf[bytes++] = (len >> 14) & 0xFF;

        }

    }

    for (lpc = 0; lpc < bytes; lpc++) {

        vnc_write_u8(vs, buf[lpc]);

    }

}

static void tight_send_compact_size(VncState *vs, size_t len)

{

    int lpc = 0;

    int bytes = 0;

    char buf[3] = {0, 0, 0};



    buf[bytes++] = len & 0x7F;

    if (len > 0x7F) {

        buf[bytes-1] |= 0x80;

        buf[bytes++] = (len >> 7) & 0x7F;

        if (len > 0x3FFF) {

            buf[bytes-1] |= 0x80;

            buf[bytes++] = (len >> 14) & 0xFF;

        }

    }

    for (lpc = 0; lpc < bytes; lpc++) {

        vnc_write_u8(vs, buf[lpc]);

    }

}

static void FUNC_0(VncState *VAR_0, size_t VAR_1)

{

    int VAR_2 = 0;

    int VAR_3 = 0;

    char VAR_4[3] = {0, 0, 0};



    VAR_4[VAR_3++] = VAR_1 & 0x7F;

    if (VAR_1 > 0x7F) {

        VAR_4[VAR_3-1] |= 0x80;

        VAR_4[VAR_3++] = (VAR_1 >> 7) & 0x7F;

        if (VAR_1 > 0x3FFF) {

            VAR_4[VAR_3-1] |= 0x80;

            VAR_4[VAR_3++] = (VAR_1 >> 14) & 0xFF;

        }

    }

    for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) {

        vnc_write_u8(VAR_0, VAR_4[VAR_2]);

    }

}

static void FUNC_0(VncState *VAR_0, size_t VAR_1)
{ int VAR_2 = 0; int VAR_3 = 0; char VAR_4[3] = {0, 0, 0}; VAR_4[VAR_3++] = VAR_1 & 0x7F; if (VAR_1 > 0x7F) { VAR_4[VAR_3-1] |= 0x80; VAR_4[VAR_3++] = (VAR_1 >> 7) & 0x7F; if (VAR_1 > 0x3FFF) { VAR_4[VAR_3-1] |= 0x80; VAR_4[VAR_3++] = (VAR_1 >> 14) & 0xFF; } } for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) { vnc_write_u8(VAR_0, VAR_4[VAR_2]); } }