static void shpc_set_status(SHPCDevice *shpc,

                            int slot, uint8_t value, uint16_t msk)

{

    uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot);

    pci_word_test_and_clear_mask(status, msk);

    pci_word_test_and_set_mask(status, value << (ffs(msk) - 1));

}

static void shpc_set_status(SHPCDevice *shpc,

                            int slot, uint8_t value, uint16_t msk)

{

    uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot);

    pci_word_test_and_clear_mask(status, msk);

    pci_word_test_and_set_mask(status, value << (ffs(msk) - 1));

}

static void FUNC_0(SHPCDevice *VAR_0,

                            int VAR_1, uint8_t VAR_2, uint16_t VAR_3)

{

    uint8_t *status = VAR_0->config + SHPC_SLOT_STATUS(VAR_1);

    pci_word_test_and_clear_mask(status, VAR_3);

    pci_word_test_and_set_mask(status, VAR_2 << (ffs(VAR_3) - 1));

}

static void FUNC_0(SHPCDevice *VAR_0,
int VAR_1, uint8_t VAR_2, uint16_t VAR_3)
{ uint8_t *status = VAR_0->config + SHPC_SLOT_STATUS(VAR_1); pci_word_test_and_clear_mask(status, VAR_3); pci_word_test_and_set_mask(status, VAR_2 << (ffs(VAR_3) - 1)); }