static void usb_xhci_exit(PCIDevice *dev)

{

    int i;

    XHCIState *xhci = XHCI(dev);



    trace_usb_xhci_exit();



    for (i = 0; i < xhci->numslots; i++) {

        xhci_disable_slot(xhci, i + 1);

    }



    if (xhci->mfwrap_timer) {

        timer_del(xhci->mfwrap_timer);

        timer_free(xhci->mfwrap_timer);

        xhci->mfwrap_timer = NULL;

    }



    memory_region_del_subregion(&xhci->mem, &xhci->mem_cap);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_oper);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_runtime);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_doorbell);



    for (i = 0; i < xhci->numports; i++) {

        XHCIPort *port = &xhci->ports[i];

        memory_region_del_subregion(&xhci->mem, &port->mem);

    }



    /* destroy msix memory region */

    if (dev->msix_table && dev->msix_pba

        && dev->msix_entry_used) {

        memory_region_del_subregion(&xhci->mem, &dev->msix_table_mmio);

        memory_region_del_subregion(&xhci->mem, &dev->msix_pba_mmio);

    }



    usb_bus_release(&xhci->bus);

}

static void usb_xhci_exit(PCIDevice *dev)

{

    int i;

    XHCIState *xhci = XHCI(dev);



    trace_usb_xhci_exit();



    for (i = 0; i < xhci->numslots; i++) {

        xhci_disable_slot(xhci, i + 1);

    }



    if (xhci->mfwrap_timer) {

        timer_del(xhci->mfwrap_timer);

        timer_free(xhci->mfwrap_timer);

        xhci->mfwrap_timer = NULL;

    }



    memory_region_del_subregion(&xhci->mem, &xhci->mem_cap);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_oper);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_runtime);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_doorbell);



    for (i = 0; i < xhci->numports; i++) {

        XHCIPort *port = &xhci->ports[i];

        memory_region_del_subregion(&xhci->mem, &port->mem);

    }



    

    if (dev->msix_table && dev->msix_pba

        && dev->msix_entry_used) {

        memory_region_del_subregion(&xhci->mem, &dev->msix_table_mmio);

        memory_region_del_subregion(&xhci->mem, &dev->msix_pba_mmio);

    }



    usb_bus_release(&xhci->bus);

}

        memory_region_del_subregion(&xhci->mem, &dev->msix_table_mmio);         memory_region_del_subregion(&xhci->mem, &dev->msix_pba_mmio);
static void FUNC_0(PCIDevice *VAR_0)

{

    int VAR_1;

    XHCIState *xhci = XHCI(VAR_0);



    trace_usb_xhci_exit();



    for (VAR_1 = 0; VAR_1 < xhci->numslots; VAR_1++) {

        xhci_disable_slot(xhci, VAR_1 + 1);

    }



    if (xhci->mfwrap_timer) {

        timer_del(xhci->mfwrap_timer);

        timer_free(xhci->mfwrap_timer);

        xhci->mfwrap_timer = NULL;

    }



    memory_region_del_subregion(&xhci->mem, &xhci->mem_cap);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_oper);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_runtime);

    memory_region_del_subregion(&xhci->mem, &xhci->mem_doorbell);



    for (VAR_1 = 0; VAR_1 < xhci->numports; VAR_1++) {

        XHCIPort *port = &xhci->ports[VAR_1];

        memory_region_del_subregion(&xhci->mem, &port->mem);

    }



    

    if (VAR_0->msix_table && VAR_0->msix_pba

        && VAR_0->msix_entry_used) {

        memory_region_del_subregion(&xhci->mem, &VAR_0->msix_table_mmio);

        memory_region_del_subregion(&xhci->mem, &VAR_0->msix_pba_mmio);

    }



    usb_bus_release(&xhci->bus);

}

static void FUNC_0(PCIDevice *VAR_0)
{ int VAR_1; XHCIState *xhci = XHCI(VAR_0); trace_usb_xhci_exit(); for (VAR_1 = 0; VAR_1 < xhci->numslots; VAR_1++) { xhci_disable_slot(xhci, VAR_1 + 1); } if (xhci->mfwrap_timer) { timer_del(xhci->mfwrap_timer); timer_free(xhci->mfwrap_timer); xhci->mfwrap_timer = NULL; } memory_region_del_subregion(&xhci->mem, &xhci->mem_cap); memory_region_del_subregion(&xhci->mem, &xhci->mem_oper); memory_region_del_subregion(&xhci->mem, &xhci->mem_runtime); memory_region_del_subregion(&xhci->mem, &xhci->mem_doorbell); for (VAR_1 = 0; VAR_1 < xhci->numports; VAR_1++) { XHCIPort *port = &xhci->ports[VAR_1]; memory_region_del_subregion(&xhci->mem, &port->mem); } if (VAR_0->msix_table && VAR_0->msix_pba
&& VAR_0->msix_entry_used) { memory_region_del_subregion(&xhci->mem, &VAR_0->msix_table_mmio); memory_region_del_subregion(&xhci->mem, &VAR_0->msix_pba_mmio); } usb_bus_release(&xhci->bus); }