static void do_pci_unregister_device(PCIDevice *pci_dev)

{

    pci_dev->bus->devices[pci_dev->devfn] = NULL;

    pci_config_free(pci_dev);



    if (memory_region_is_mapped(&pci_dev->bus_master_enable_region)) {

        memory_region_del_subregion(&pci_dev->bus_master_container_region,

                                    &pci_dev->bus_master_enable_region);

    }

    address_space_destroy(&pci_dev->bus_master_as);

}

static void do_pci_unregister_device(PCIDevice *pci_dev)

{

    pci_dev->bus->devices[pci_dev->devfn] = NULL;

    pci_config_free(pci_dev);



    if (memory_region_is_mapped(&pci_dev->bus_master_enable_region)) {

        memory_region_del_subregion(&pci_dev->bus_master_container_region,

                                    &pci_dev->bus_master_enable_region);

    }

    address_space_destroy(&pci_dev->bus_master_as);

}

static void FUNC_0(PCIDevice *VAR_0)

{

    VAR_0->bus->devices[VAR_0->devfn] = NULL;

    pci_config_free(VAR_0);



    if (memory_region_is_mapped(&VAR_0->bus_master_enable_region)) {

        memory_region_del_subregion(&VAR_0->bus_master_container_region,

                                    &VAR_0->bus_master_enable_region);

    }

    address_space_destroy(&VAR_0->bus_master_as);

}

static void FUNC_0(PCIDevice *VAR_0)
{ VAR_0->bus->devices[VAR_0->devfn] = NULL; pci_config_free(VAR_0); if (memory_region_is_mapped(&VAR_0->bus_master_enable_region)) { memory_region_del_subregion(&VAR_0->bus_master_container_region,
&VAR_0->bus_master_enable_region); } address_space_destroy(&VAR_0->bus_master_as); }