static char *pxb_host_ofw_unit_address(const SysBusDevice *dev)

{

    const PCIHostState *pxb_host;

    const PCIBus *pxb_bus;

    const PXBDev *pxb_dev;

    int position;

    const DeviceState *pxb_dev_base;

    const PCIHostState *main_host;

    const SysBusDevice *main_host_sbd;



    pxb_host = PCI_HOST_BRIDGE(dev);

    pxb_bus = pxb_host->bus;

    pxb_dev = PXB_DEV(pxb_bus->parent_dev);

    position = g_list_index(pxb_dev_list, pxb_dev);

    assert(position >= 0);



    pxb_dev_base = DEVICE(pxb_dev);

    main_host = PCI_HOST_BRIDGE(pxb_dev_base->parent_bus->parent);

    main_host_sbd = SYS_BUS_DEVICE(main_host);



    if (main_host_sbd->num_mmio > 0) {

        return g_strdup_printf(TARGET_FMT_plx ",%x",

                               main_host_sbd->mmio[0].addr, position + 1);

    }

    if (main_host_sbd->num_pio > 0) {

        return g_strdup_printf("i%04x,%x",

                               main_host_sbd->pio[0], position + 1);

    }

    return NULL;

}

static char *pxb_host_ofw_unit_address(const SysBusDevice *dev)

{

    const PCIHostState *pxb_host;

    const PCIBus *pxb_bus;

    const PXBDev *pxb_dev;

    int position;

    const DeviceState *pxb_dev_base;

    const PCIHostState *main_host;

    const SysBusDevice *main_host_sbd;



    pxb_host = PCI_HOST_BRIDGE(dev);

    pxb_bus = pxb_host->bus;

    pxb_dev = PXB_DEV(pxb_bus->parent_dev);

    position = g_list_index(pxb_dev_list, pxb_dev);

    assert(position >= 0);



    pxb_dev_base = DEVICE(pxb_dev);

    main_host = PCI_HOST_BRIDGE(pxb_dev_base->parent_bus->parent);

    main_host_sbd = SYS_BUS_DEVICE(main_host);



    if (main_host_sbd->num_mmio > 0) {

        return g_strdup_printf(TARGET_FMT_plx ",%x",

                               main_host_sbd->mmio[0].addr, position + 1);

    }

    if (main_host_sbd->num_pio > 0) {

        return g_strdup_printf("i%04x,%x",

                               main_host_sbd->pio[0], position + 1);

    }

    return NULL;

}

static char *FUNC_0(const SysBusDevice *VAR_0)

{

    const PCIHostState *VAR_1;

    const PCIBus *VAR_2;

    const PXBDev *VAR_3;

    int VAR_4;

    const DeviceState *VAR_5;

    const PCIHostState *VAR_6;

    const SysBusDevice *VAR_7;



    VAR_1 = PCI_HOST_BRIDGE(VAR_0);

    VAR_2 = VAR_1->bus;

    VAR_3 = PXB_DEV(VAR_2->parent_dev);

    VAR_4 = g_list_index(pxb_dev_list, VAR_3);

    assert(VAR_4 >= 0);



    VAR_5 = DEVICE(VAR_3);

    VAR_6 = PCI_HOST_BRIDGE(VAR_5->parent_bus->parent);

    VAR_7 = SYS_BUS_DEVICE(VAR_6);



    if (VAR_7->num_mmio > 0) {

        return g_strdup_printf(TARGET_FMT_plx ",%x",

                               VAR_7->mmio[0].addr, VAR_4 + 1);

    }

    if (VAR_7->num_pio > 0) {

        return g_strdup_printf("i%04x,%x",

                               VAR_7->pio[0], VAR_4 + 1);

    }

    return NULL;

}

static char *FUNC_0(const SysBusDevice *VAR_0)
{ const PCIHostState *VAR_1; const PCIBus *VAR_2; const PXBDev *VAR_3; int VAR_4; const DeviceState *VAR_5; const PCIHostState *VAR_6; const SysBusDevice *VAR_7; VAR_1 = PCI_HOST_BRIDGE(VAR_0); VAR_2 = VAR_1->bus; VAR_3 = PXB_DEV(VAR_2->parent_dev); VAR_4 = g_list_index(pxb_dev_list, VAR_3); assert(VAR_4 >= 0); VAR_5 = DEVICE(VAR_3); VAR_6 = PCI_HOST_BRIDGE(VAR_5->parent_bus->parent); VAR_7 = SYS_BUS_DEVICE(VAR_6); if (VAR_7->num_mmio > 0) { return g_strdup_printf(TARGET_FMT_plx ",%x",
VAR_7->mmio[0].addr, VAR_4 + 1); } if (VAR_7->num_pio > 0) { return g_strdup_printf("i%04x,%x",
VAR_7->pio[0], VAR_4 + 1); } return NULL; }