static uint32_t virtio_read_config(PCIDevice *pci_dev,

                                   uint32_t address, int len)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

    struct virtio_pci_cfg_cap *cfg;



    if (proxy->config_cap &&

        ranges_overlap(address, len, proxy->config_cap + offsetof(struct virtio_pci_cfg_cap,

                                                                  pci_cfg_data),

                       sizeof cfg->pci_cfg_data)) {

        uint32_t off;

        uint32_t len;



        cfg = (void *)(proxy->pci_dev.config + proxy->config_cap);

        off = le32_to_cpu(cfg->cap.offset);

        len = le32_to_cpu(cfg->cap.length);



        if (len <= sizeof cfg->pci_cfg_data) {

            virtio_address_space_read(&proxy->modern_as, off,

                                      cfg->pci_cfg_data, len);

        }

    }



    return pci_default_read_config(pci_dev, address, len);

}

static uint32_t virtio_read_config(PCIDevice *pci_dev,

                                   uint32_t address, int len)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

    struct virtio_pci_cfg_cap *cfg;



    if (proxy->config_cap &&

        ranges_overlap(address, len, proxy->config_cap + offsetof(struct virtio_pci_cfg_cap,

                                                                  pci_cfg_data),

                       sizeof cfg->pci_cfg_data)) {

        uint32_t off;

        uint32_t len;



        cfg = (void *)(proxy->pci_dev.config + proxy->config_cap);

        off = le32_to_cpu(cfg->cap.offset);

        len = le32_to_cpu(cfg->cap.length);



        if (len <= sizeof cfg->pci_cfg_data) {

            virtio_address_space_read(&proxy->modern_as, off,

                                      cfg->pci_cfg_data, len);

        }

    }



    return pci_default_read_config(pci_dev, address, len);

}

        if (len <= sizeof cfg->pci_cfg_data) {         if (len <= sizeof cfg->pci_cfg_data) {
static uint32_t FUNC_0(PCIDevice *pci_dev,

                                   uint32_t address, int len)

{

    VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);

    struct virtio_pci_cfg_cap *VAR_0;



    if (proxy->config_cap &&

        ranges_overlap(address, len, proxy->config_cap + offsetof(struct virtio_pci_cfg_cap,

                                                                  pci_cfg_data),

                       sizeof VAR_0->pci_cfg_data)) {

        uint32_t off;

        uint32_t len;



        VAR_0 = (void *)(proxy->pci_dev.config + proxy->config_cap);

        off = le32_to_cpu(VAR_0->cap.offset);

        len = le32_to_cpu(VAR_0->cap.length);



        if (len <= sizeof VAR_0->pci_cfg_data) {

            virtio_address_space_read(&proxy->modern_as, off,

                                      VAR_0->pci_cfg_data, len);

        }

    }



    return pci_default_read_config(pci_dev, address, len);

}

static uint32_t FUNC_0(PCIDevice *pci_dev,
uint32_t address, int len)
{ VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); struct virtio_pci_cfg_cap *VAR_0; if (proxy->config_cap &&
ranges_overlap(address, len, proxy->config_cap + offsetof(struct virtio_pci_cfg_cap,
pci_cfg_data),
sizeof VAR_0->pci_cfg_data)) { uint32_t off; uint32_t len; VAR_0 = (void *)(proxy->pci_dev.config + proxy->config_cap); off = le32_to_cpu(VAR_0->cap.offset); len = le32_to_cpu(VAR_0->cap.length); if (len <= sizeof VAR_0->pci_cfg_data) { virtio_address_space_read(&proxy->modern_as, off,
VAR_0->pci_cfg_data, len); } } return pci_default_read_config(pci_dev, address, len); }