void qbus_free(BusState *bus)

{

    DeviceState *dev;



    while ((dev = QLIST_FIRST(&bus->children)) != NULL) {

        qdev_free(dev);

    }

    if (bus->parent) {

        QLIST_REMOVE(bus, sibling);

        bus->parent->num_child_bus--;

    }


    if (bus->qdev_allocated) {

        qemu_free(bus);

    }

}
void qbus_free(BusState *bus)

{

    DeviceState *dev;



    while ((dev = QLIST_FIRST(&bus->children)) != NULL) {

        qdev_free(dev);

    }

    if (bus->parent) {

        QLIST_REMOVE(bus, sibling);

        bus->parent->num_child_bus--;

    }


    if (bus->qdev_allocated) {

        qemu_free(bus);

    }

}
void FUNC_0(BusState *VAR_0)

{

    DeviceState *dev;



    while ((dev = QLIST_FIRST(&VAR_0->children)) != NULL) {

        qdev_free(dev);

    }

    if (VAR_0->parent) {

        QLIST_REMOVE(VAR_0, sibling);

        VAR_0->parent->num_child_bus--;

    }


    if (VAR_0->qdev_allocated) {

        qemu_free(VAR_0);

    }

}
void FUNC_0(BusState *VAR_0)
{ DeviceState *dev; while ((dev = QLIST_FIRST(&VAR_0->children)) != NULL) { qdev_free(dev); } if (VAR_0->parent) { QLIST_REMOVE(VAR_0, sibling); VAR_0->parent->num_child_bus--; } if (VAR_0->qdev_allocated) { qemu_free(VAR_0); } }