void usb_desc_attach(USBDevice *dev)

{

    const USBDesc *desc = usb_device_get_usb_desc(dev);



    assert(desc != NULL);

    if (desc->super && (dev->port->speedmask & USB_SPEED_MASK_SUPER)) {

        dev->speed = USB_SPEED_SUPER;

    } else if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) {

        dev->speed = USB_SPEED_HIGH;

    } else if (desc->full && (dev->port->speedmask & USB_SPEED_MASK_FULL)) {

        dev->speed = USB_SPEED_FULL;

    } else {

        return;

    }

    usb_desc_setdefaults(dev);

}

void usb_desc_attach(USBDevice *dev)

{

    const USBDesc *desc = usb_device_get_usb_desc(dev);



    assert(desc != NULL);

    if (desc->super && (dev->port->speedmask & USB_SPEED_MASK_SUPER)) {

        dev->speed = USB_SPEED_SUPER;

    } else if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) {

        dev->speed = USB_SPEED_HIGH;

    } else if (desc->full && (dev->port->speedmask & USB_SPEED_MASK_FULL)) {

        dev->speed = USB_SPEED_FULL;

    } else {

        return;

    }

    usb_desc_setdefaults(dev);

}

void FUNC_0(USBDevice *VAR_0)

{

    const USBDesc *VAR_1 = usb_device_get_usb_desc(VAR_0);



    assert(VAR_1 != NULL);

    if (VAR_1->super && (VAR_0->port->speedmask & USB_SPEED_MASK_SUPER)) {

        VAR_0->speed = USB_SPEED_SUPER;

    } else if (VAR_1->high && (VAR_0->port->speedmask & USB_SPEED_MASK_HIGH)) {

        VAR_0->speed = USB_SPEED_HIGH;

    } else if (VAR_1->full && (VAR_0->port->speedmask & USB_SPEED_MASK_FULL)) {

        VAR_0->speed = USB_SPEED_FULL;

    } else {

        return;

    }

    usb_desc_setdefaults(VAR_0);

}

void FUNC_0(USBDevice *VAR_0)
{ const USBDesc *VAR_1 = usb_device_get_usb_desc(VAR_0); assert(VAR_1 != NULL); if (VAR_1->super && (VAR_0->port->speedmask & USB_SPEED_MASK_SUPER)) { VAR_0->speed = USB_SPEED_SUPER; } else if (VAR_1->high && (VAR_0->port->speedmask & USB_SPEED_MASK_HIGH)) { VAR_0->speed = USB_SPEED_HIGH; } else if (VAR_1->full && (VAR_0->port->speedmask & USB_SPEED_MASK_FULL)) { VAR_0->speed = USB_SPEED_FULL; } else { return; } usb_desc_setdefaults(VAR_0); }