static void spice_update_buttons(QemuSpicePointer *pointer,

                                 int wheel, uint32_t button_mask)

{

    static uint32_t bmap[INPUT_BUTTON__MAX] = {

        [INPUT_BUTTON_LEFT]        = 0x01,

        [INPUT_BUTTON_MIDDLE]      = 0x04,

        [INPUT_BUTTON_RIGHT]       = 0x02,

        [INPUT_BUTTON_WHEEL_UP]    = 0x10,

        [INPUT_BUTTON_WHEEL_DOWN]  = 0x20,

    };



    if (wheel < 0) {

        button_mask |= 0x10;

    }

    if (wheel > 0) {

        button_mask |= 0x20;

    }



    if (pointer->last_bmask == button_mask) {

        return;

    }

    qemu_input_update_buttons(NULL, bmap, pointer->last_bmask, button_mask);

    pointer->last_bmask = button_mask;

}

static void spice_update_buttons(QemuSpicePointer *pointer,

                                 int wheel, uint32_t button_mask)

{

    static uint32_t bmap[INPUT_BUTTON__MAX] = {

        [INPUT_BUTTON_LEFT]        = 0x01,

        [INPUT_BUTTON_MIDDLE]      = 0x04,

        [INPUT_BUTTON_RIGHT]       = 0x02,

        [INPUT_BUTTON_WHEEL_UP]    = 0x10,

        [INPUT_BUTTON_WHEEL_DOWN]  = 0x20,

    };



    if (wheel < 0) {

        button_mask |= 0x10;

    }

    if (wheel > 0) {

        button_mask |= 0x20;

    }



    if (pointer->last_bmask == button_mask) {

        return;

    }

    qemu_input_update_buttons(NULL, bmap, pointer->last_bmask, button_mask);

    pointer->last_bmask = button_mask;

}

static void FUNC_0(QemuSpicePointer *VAR_0,

                                 int VAR_1, uint32_t VAR_2)

{

    static uint32_t VAR_3[INPUT_BUTTON__MAX] = {

        [INPUT_BUTTON_LEFT]        = 0x01,

        [INPUT_BUTTON_MIDDLE]      = 0x04,

        [INPUT_BUTTON_RIGHT]       = 0x02,

        [INPUT_BUTTON_WHEEL_UP]    = 0x10,

        [INPUT_BUTTON_WHEEL_DOWN]  = 0x20,

    };



    if (VAR_1 < 0) {

        VAR_2 |= 0x10;

    }

    if (VAR_1 > 0) {

        VAR_2 |= 0x20;

    }



    if (VAR_0->last_bmask == VAR_2) {

        return;

    }

    qemu_input_update_buttons(NULL, VAR_3, VAR_0->last_bmask, VAR_2);

    VAR_0->last_bmask = VAR_2;

}

static void FUNC_0(QemuSpicePointer *VAR_0,
int VAR_1, uint32_t VAR_2)
{ static uint32_t VAR_3[INPUT_BUTTON__MAX] = { [INPUT_BUTTON_LEFT]        = 0x01,
[INPUT_BUTTON_MIDDLE]      = 0x04,
[INPUT_BUTTON_RIGHT]       = 0x02,
[INPUT_BUTTON_WHEEL_UP]    = 0x10,
[INPUT_BUTTON_WHEEL_DOWN]  = 0x20,
}; if (VAR_1 < 0) { VAR_2 |= 0x10; } if (VAR_1 > 0) { VAR_2 |= 0x20; } if (VAR_0->last_bmask == VAR_2) { return; } qemu_input_update_buttons(NULL, VAR_3, VAR_0->last_bmask, VAR_2); VAR_0->last_bmask = VAR_2; }