static void piix4_device_plug_cb(HotplugHandler *hotplug_dev,

                                 DeviceState *dev, Error **errp)

{

    PIIX4PMState *s = PIIX4_PM(hotplug_dev);



    if (s->acpi_memory_hotplug.is_enabled &&

        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {

        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {

            nvdimm_acpi_plug_cb(hotplug_dev, dev);

        } else {

            acpi_memory_plug_cb(hotplug_dev, &s->acpi_memory_hotplug,

                                dev, errp);

        }

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {

        if (!xen_enabled()) {

            acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev,

                                      errp);

        }

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {

        if (s->cpu_hotplug_legacy) {

            legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe_cpu, dev, errp);

        } else {

            acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp);

        }

    } else {

        error_setg(errp, "acpi: device plug request for not supported device"

                   " type: %s", object_get_typename(OBJECT(dev)));

    }

}

static void piix4_device_plug_cb(HotplugHandler *hotplug_dev,

                                 DeviceState *dev, Error **errp)

{

    PIIX4PMState *s = PIIX4_PM(hotplug_dev);



    if (s->acpi_memory_hotplug.is_enabled &&

        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {

        if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {

            nvdimm_acpi_plug_cb(hotplug_dev, dev);

        } else {

            acpi_memory_plug_cb(hotplug_dev, &s->acpi_memory_hotplug,

                                dev, errp);

        }

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {

        if (!xen_enabled()) {

            acpi_pcihp_device_plug_cb(hotplug_dev, &s->acpi_pci_hotplug, dev,

                                      errp);

        }

    } else if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) {

        if (s->cpu_hotplug_legacy) {

            legacy_acpi_cpu_plug_cb(hotplug_dev, &s->gpe_cpu, dev, errp);

        } else {

            acpi_cpu_plug_cb(hotplug_dev, &s->cpuhp_state, dev, errp);

        }

    } else {

        error_setg(errp, "acpi: device plug request for not supported device"

                   " type: %s", object_get_typename(OBJECT(dev)));

    }

}

static void FUNC_0(HotplugHandler *VAR_0,

                                 DeviceState *VAR_1, Error **VAR_2)

{

    PIIX4PMState *s = PIIX4_PM(VAR_0);



    if (s->acpi_memory_hotplug.is_enabled &&

        object_dynamic_cast(OBJECT(VAR_1), TYPE_PC_DIMM)) {

        if (object_dynamic_cast(OBJECT(VAR_1), TYPE_NVDIMM)) {

            nvdimm_acpi_plug_cb(VAR_0, VAR_1);

        } else {

            acpi_memory_plug_cb(VAR_0, &s->acpi_memory_hotplug,

                                VAR_1, VAR_2);

        }

    } else if (object_dynamic_cast(OBJECT(VAR_1), TYPE_PCI_DEVICE)) {

        if (!xen_enabled()) {

            acpi_pcihp_device_plug_cb(VAR_0, &s->acpi_pci_hotplug, VAR_1,

                                      VAR_2);

        }

    } else if (object_dynamic_cast(OBJECT(VAR_1), TYPE_CPU)) {

        if (s->cpu_hotplug_legacy) {

            legacy_acpi_cpu_plug_cb(VAR_0, &s->gpe_cpu, VAR_1, VAR_2);

        } else {

            acpi_cpu_plug_cb(VAR_0, &s->cpuhp_state, VAR_1, VAR_2);

        }

    } else {

        error_setg(VAR_2, "acpi: device plug request for not supported device"

                   " type: %s", object_get_typename(OBJECT(VAR_1)));

    }

}

static void FUNC_0(HotplugHandler *VAR_0,
DeviceState *VAR_1, Error **VAR_2)
{ PIIX4PMState *s = PIIX4_PM(VAR_0); if (s->acpi_memory_hotplug.is_enabled &&
object_dynamic_cast(OBJECT(VAR_1), TYPE_PC_DIMM)) { if (object_dynamic_cast(OBJECT(VAR_1), TYPE_NVDIMM)) { nvdimm_acpi_plug_cb(VAR_0, VAR_1); } else { acpi_memory_plug_cb(VAR_0, &s->acpi_memory_hotplug,
VAR_1, VAR_2); } } else if (object_dynamic_cast(OBJECT(VAR_1), TYPE_PCI_DEVICE)) { if (!xen_enabled()) { acpi_pcihp_device_plug_cb(VAR_0, &s->acpi_pci_hotplug, VAR_1,
VAR_2); } } else if (object_dynamic_cast(OBJECT(VAR_1), TYPE_CPU)) { if (s->cpu_hotplug_legacy) { legacy_acpi_cpu_plug_cb(VAR_0, &s->gpe_cpu, VAR_1, VAR_2); } else { acpi_cpu_plug_cb(VAR_0, &s->cpuhp_state, VAR_1, VAR_2); } } else { error_setg(VAR_2, "acpi: device plug request for not supported device"
" type: %s", object_get_typename(OBJECT(VAR_1))); } }