int usb_desc_handle_control(USBDevice *dev, int request, int value,

                            int index, int length, uint8_t *data)

{

    const USBDesc *desc = dev->info->usb_desc;

    int ret = -1;



    assert(desc != NULL);

    switch(request) {

    case DeviceOutRequest | USB_REQ_SET_ADDRESS:

        dev->addr = value;

        trace_usb_set_addr(dev->addr);

        ret = 0;

        break;



    case DeviceRequest | USB_REQ_GET_DESCRIPTOR:

        ret = usb_desc_get_descriptor(dev, value, data, length);

        break;

    }

    return ret;

}

int usb_desc_handle_control(USBDevice *dev, int request, int value,

                            int index, int length, uint8_t *data)

{

    const USBDesc *desc = dev->info->usb_desc;

    int ret = -1;



    assert(desc != NULL);

    switch(request) {

    case DeviceOutRequest | USB_REQ_SET_ADDRESS:

        dev->addr = value;

        trace_usb_set_addr(dev->addr);

        ret = 0;

        break;



    case DeviceRequest | USB_REQ_GET_DESCRIPTOR:

        ret = usb_desc_get_descriptor(dev, value, data, length);

        break;

    }

    return ret;

}

int FUNC_0(USBDevice *VAR_0, int VAR_1, int VAR_2,

                            int VAR_3, int VAR_4, uint8_t *VAR_5)

{

    const USBDesc *VAR_6 = VAR_0->info->usb_desc;

    int VAR_7 = -1;



    assert(VAR_6 != NULL);

    switch(VAR_1) {

    case DeviceOutRequest | USB_REQ_SET_ADDRESS:

        VAR_0->addr = VAR_2;

        trace_usb_set_addr(VAR_0->addr);

        VAR_7 = 0;

        break;



    case DeviceRequest | USB_REQ_GET_DESCRIPTOR:

        VAR_7 = usb_desc_get_descriptor(VAR_0, VAR_2, VAR_5, VAR_4);

        break;

    }

    return VAR_7;

}

int FUNC_0(USBDevice *VAR_0, int VAR_1, int VAR_2,
int VAR_3, int VAR_4, uint8_t *VAR_5)
{ const USBDesc *VAR_6 = VAR_0->info->usb_desc; int VAR_7 = -1; assert(VAR_6 != NULL); switch(VAR_1) { case DeviceOutRequest | USB_REQ_SET_ADDRESS:
VAR_0->addr = VAR_2; trace_usb_set_addr(VAR_0->addr); VAR_7 = 0; break; case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
VAR_7 = usb_desc_get_descriptor(VAR_0, VAR_2, VAR_5, VAR_4); break; } return VAR_7; }