void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, bool smm_enabled,

                  qemu_irq sci_irq)

{

    memory_region_init(&pm->io, OBJECT(lpc_pci), "ich9-pm", ICH9_PMIO_SIZE);

    memory_region_set_enabled(&pm->io, false);

    memory_region_add_subregion(pci_address_space_io(lpc_pci),

                                0, &pm->io);



    acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);

    acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);

    acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, pm->disable_s3, pm->disable_s4,

                      pm->s4_val);



    acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);

    memory_region_init_io(&pm->io_gpe, OBJECT(lpc_pci), &ich9_gpe_ops, pm,

                          "acpi-gpe0", ICH9_PMIO_GPE0_LEN);

    memory_region_add_subregion(&pm->io, ICH9_PMIO_GPE0_STS, &pm->io_gpe);



    memory_region_init_io(&pm->io_smi, OBJECT(lpc_pci), &ich9_smi_ops, pm,

                          "acpi-smi", 8);

    memory_region_add_subregion(&pm->io, ICH9_PMIO_SMI_EN, &pm->io_smi);



    pm->smm_enabled = smm_enabled;

    pm->irq = sci_irq;

    qemu_register_reset(pm_reset, pm);

    pm->powerdown_notifier.notify = pm_powerdown_req;

    qemu_register_powerdown_notifier(&pm->powerdown_notifier);



    acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),

                          &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);



    if (pm->acpi_memory_hotplug.is_enabled) {

        acpi_memory_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),

                                 &pm->acpi_memory_hotplug);

    }

}

void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, bool smm_enabled,

                  qemu_irq sci_irq)

{

    memory_region_init(&pm->io, OBJECT(lpc_pci), "ich9-pm", ICH9_PMIO_SIZE);

    memory_region_set_enabled(&pm->io, false);

    memory_region_add_subregion(pci_address_space_io(lpc_pci),

                                0, &pm->io);



    acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);

    acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);

    acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, pm->disable_s3, pm->disable_s4,

                      pm->s4_val);



    acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);

    memory_region_init_io(&pm->io_gpe, OBJECT(lpc_pci), &ich9_gpe_ops, pm,

                          "acpi-gpe0", ICH9_PMIO_GPE0_LEN);

    memory_region_add_subregion(&pm->io, ICH9_PMIO_GPE0_STS, &pm->io_gpe);



    memory_region_init_io(&pm->io_smi, OBJECT(lpc_pci), &ich9_smi_ops, pm,

                          "acpi-smi", 8);

    memory_region_add_subregion(&pm->io, ICH9_PMIO_SMI_EN, &pm->io_smi);



    pm->smm_enabled = smm_enabled;

    pm->irq = sci_irq;

    qemu_register_reset(pm_reset, pm);

    pm->powerdown_notifier.notify = pm_powerdown_req;

    qemu_register_powerdown_notifier(&pm->powerdown_notifier);



    acpi_cpu_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),

                          &pm->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);



    if (pm->acpi_memory_hotplug.is_enabled) {

        acpi_memory_hotplug_init(pci_address_space_io(lpc_pci), OBJECT(lpc_pci),

                                 &pm->acpi_memory_hotplug);

    }

}

void FUNC_0(PCIDevice *VAR_0, ICH9LPCPMRegs *VAR_1, bool VAR_2,

                  qemu_irq VAR_3)

{

    memory_region_init(&VAR_1->io, OBJECT(VAR_0), "ich9-VAR_1", ICH9_PMIO_SIZE);

    memory_region_set_enabled(&VAR_1->io, false);

    memory_region_add_subregion(pci_address_space_io(VAR_0),

                                0, &VAR_1->io);



    acpi_pm_tmr_init(&VAR_1->acpi_regs, ich9_pm_update_sci_fn, &VAR_1->io);

    acpi_pm1_evt_init(&VAR_1->acpi_regs, ich9_pm_update_sci_fn, &VAR_1->io);

    acpi_pm1_cnt_init(&VAR_1->acpi_regs, &VAR_1->io, VAR_1->disable_s3, VAR_1->disable_s4,

                      VAR_1->s4_val);



    acpi_gpe_init(&VAR_1->acpi_regs, ICH9_PMIO_GPE0_LEN);

    memory_region_init_io(&VAR_1->io_gpe, OBJECT(VAR_0), &ich9_gpe_ops, VAR_1,

                          "acpi-gpe0", ICH9_PMIO_GPE0_LEN);

    memory_region_add_subregion(&VAR_1->io, ICH9_PMIO_GPE0_STS, &VAR_1->io_gpe);



    memory_region_init_io(&VAR_1->io_smi, OBJECT(VAR_0), &ich9_smi_ops, VAR_1,

                          "acpi-smi", 8);

    memory_region_add_subregion(&VAR_1->io, ICH9_PMIO_SMI_EN, &VAR_1->io_smi);



    VAR_1->VAR_2 = VAR_2;

    VAR_1->irq = VAR_3;

    qemu_register_reset(pm_reset, VAR_1);

    VAR_1->powerdown_notifier.notify = pm_powerdown_req;

    qemu_register_powerdown_notifier(&VAR_1->powerdown_notifier);



    acpi_cpu_hotplug_init(pci_address_space_io(VAR_0), OBJECT(VAR_0),

                          &VAR_1->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE);



    if (VAR_1->acpi_memory_hotplug.is_enabled) {

        acpi_memory_hotplug_init(pci_address_space_io(VAR_0), OBJECT(VAR_0),

                                 &VAR_1->acpi_memory_hotplug);

    }

}

void FUNC_0(PCIDevice *VAR_0, ICH9LPCPMRegs *VAR_1, bool VAR_2,
qemu_irq VAR_3)
{ memory_region_init(&VAR_1->io, OBJECT(VAR_0), "ich9-VAR_1", ICH9_PMIO_SIZE); memory_region_set_enabled(&VAR_1->io, false); memory_region_add_subregion(pci_address_space_io(VAR_0),
0, &VAR_1->io); acpi_pm_tmr_init(&VAR_1->acpi_regs, ich9_pm_update_sci_fn, &VAR_1->io); acpi_pm1_evt_init(&VAR_1->acpi_regs, ich9_pm_update_sci_fn, &VAR_1->io); acpi_pm1_cnt_init(&VAR_1->acpi_regs, &VAR_1->io, VAR_1->disable_s3, VAR_1->disable_s4,
VAR_1->s4_val); acpi_gpe_init(&VAR_1->acpi_regs, ICH9_PMIO_GPE0_LEN); memory_region_init_io(&VAR_1->io_gpe, OBJECT(VAR_0), &ich9_gpe_ops, VAR_1,
"acpi-gpe0", ICH9_PMIO_GPE0_LEN); memory_region_add_subregion(&VAR_1->io, ICH9_PMIO_GPE0_STS, &VAR_1->io_gpe); memory_region_init_io(&VAR_1->io_smi, OBJECT(VAR_0), &ich9_smi_ops, VAR_1,
"acpi-smi", 8); memory_region_add_subregion(&VAR_1->io, ICH9_PMIO_SMI_EN, &VAR_1->io_smi); VAR_1->VAR_2 = VAR_2; VAR_1->irq = VAR_3; qemu_register_reset(pm_reset, VAR_1); VAR_1->powerdown_notifier.notify = pm_powerdown_req; qemu_register_powerdown_notifier(&VAR_1->powerdown_notifier); acpi_cpu_hotplug_init(pci_address_space_io(VAR_0), OBJECT(VAR_0),
&VAR_1->gpe_cpu, ICH9_CPU_HOTPLUG_IO_BASE); if (VAR_1->acpi_memory_hotplug.is_enabled) { acpi_memory_hotplug_init(pci_address_space_io(VAR_0), OBJECT(VAR_0),
&VAR_1->acpi_memory_hotplug); } }