static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf)

{

    MouseState *s = ADB_MOUSE(d);

    int dx, dy;



    if (s->last_buttons_state == s->buttons_state &&

        s->dx == 0 && s->dy == 0)

        return 0;



    dx = s->dx;

    if (dx < -63)

        dx = -63;

    else if (dx > 63)

        dx = 63;



    dy = s->dy;

    if (dy < -63)

        dy = -63;

    else if (dy > 63)

        dy = 63;



    s->dx -= dx;

    s->dy -= dy;

    s->last_buttons_state = s->buttons_state;



    dx &= 0x7f;

    dy &= 0x7f;



    if (!(s->buttons_state & MOUSE_EVENT_LBUTTON))

        dy |= 0x80;

    if (!(s->buttons_state & MOUSE_EVENT_RBUTTON))

        dx |= 0x80;



    obuf[0] = dy;

    obuf[1] = dx;

    return 2;

}

static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf)

{

    MouseState *s = ADB_MOUSE(d);

    int dx, dy;



    if (s->last_buttons_state == s->buttons_state &&

        s->dx == 0 && s->dy == 0)

        return 0;



    dx = s->dx;

    if (dx < -63)

        dx = -63;

    else if (dx > 63)

        dx = 63;



    dy = s->dy;

    if (dy < -63)

        dy = -63;

    else if (dy > 63)

        dy = 63;



    s->dx -= dx;

    s->dy -= dy;

    s->last_buttons_state = s->buttons_state;



    dx &= 0x7f;

    dy &= 0x7f;



    if (!(s->buttons_state & MOUSE_EVENT_LBUTTON))

        dy |= 0x80;

    if (!(s->buttons_state & MOUSE_EVENT_RBUTTON))

        dx |= 0x80;



    obuf[0] = dy;

    obuf[1] = dx;

    return 2;

}

        return 0;         return 0; static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf)     MouseState *s = ADB_MOUSE(d);     int dx, dy;     if (s->last_buttons_state == s->buttons_state &&         s->dx == 0 && s->dy == 0)         return 0;     dx = s->dx;     if (dx < -63)         dx = -63;     else if (dx > 63)         dx = 63;     dy = s->dy;     if (dy < -63)         dy = -63;     else if (dy > 63)         dy = 63;     s->dx -= dx;     s->dy -= dy;     s->last_buttons_state = s->buttons_state;     dx &= 0x7f;     dy &= 0x7f;     if (!(s->buttons_state & MOUSE_EVENT_LBUTTON))         dy |= 0x80;     if (!(s->buttons_state & MOUSE_EVENT_RBUTTON))         dx |= 0x80;     obuf[0] = dy;     obuf[1] = dx;     return 2;     MouseState *s = ADB_MOUSE(d);         return 0;
static int FUNC_0(ADBDevice *VAR_0, uint8_t *VAR_1)

{

    MouseState *s = ADB_MOUSE(VAR_0);

    int VAR_2, VAR_3;



    if (s->last_buttons_state == s->buttons_state &&

        s->VAR_2 == 0 && s->VAR_3 == 0)

        return 0;



    VAR_2 = s->VAR_2;

    if (VAR_2 < -63)

        VAR_2 = -63;

    else if (VAR_2 > 63)

        VAR_2 = 63;



    VAR_3 = s->VAR_3;

    if (VAR_3 < -63)

        VAR_3 = -63;

    else if (VAR_3 > 63)

        VAR_3 = 63;



    s->VAR_2 -= VAR_2;

    s->VAR_3 -= VAR_3;

    s->last_buttons_state = s->buttons_state;



    VAR_2 &= 0x7f;

    VAR_3 &= 0x7f;



    if (!(s->buttons_state & MOUSE_EVENT_LBUTTON))

        VAR_3 |= 0x80;

    if (!(s->buttons_state & MOUSE_EVENT_RBUTTON))

        VAR_2 |= 0x80;



    VAR_1[0] = VAR_3;

    VAR_1[1] = VAR_2;

    return 2;

}

static int FUNC_0(ADBDevice *VAR_0, uint8_t *VAR_1)
{ MouseState *s = ADB_MOUSE(VAR_0); int VAR_2, VAR_3; if (s->last_buttons_state == s->buttons_state &&
s->VAR_2 == 0 && s->VAR_3 == 0)
return 0; VAR_2 = s->VAR_2; if (VAR_2 < -63)
VAR_2 = -63; else if (VAR_2 > 63)
VAR_2 = 63; VAR_3 = s->VAR_3; if (VAR_3 < -63)
VAR_3 = -63; else if (VAR_3 > 63)
VAR_3 = 63; s->VAR_2 -= VAR_2; s->VAR_3 -= VAR_3; s->last_buttons_state = s->buttons_state; VAR_2 &= 0x7f; VAR_3 &= 0x7f; if (!(s->buttons_state & MOUSE_EVENT_LBUTTON))
VAR_3 |= 0x80; if (!(s->buttons_state & MOUSE_EVENT_RBUTTON))
VAR_2 |= 0x80; VAR_1[0] = VAR_3; VAR_1[1] = VAR_2; return 2; }