static void usb_msd_copy_data(MSDState *s)

{

    uint32_t len;

    len = s->usb_len;

    if (len > s->scsi_len)

        len = s->scsi_len;

    if (s->mode == USB_MSDM_DATAIN) {

        memcpy(s->usb_buf, s->scsi_buf, len);

    } else {

        memcpy(s->scsi_buf, s->usb_buf, len);

    }

    s->usb_len -= len;

    s->scsi_len -= len;

    s->usb_buf += len;

    s->scsi_buf += len;

    s->data_len -= len;

    if (s->scsi_len == 0 || s->data_len == 0) {

        if (s->mode == USB_MSDM_DATAIN) {

            s->scsi_dev->info->read_data(s->scsi_dev, s->tag);

        } else if (s->mode == USB_MSDM_DATAOUT) {

            s->scsi_dev->info->write_data(s->scsi_dev, s->tag);

        }

    }

}

static void usb_msd_copy_data(MSDState *s)

{

    uint32_t len;

    len = s->usb_len;

    if (len > s->scsi_len)

        len = s->scsi_len;

    if (s->mode == USB_MSDM_DATAIN) {

        memcpy(s->usb_buf, s->scsi_buf, len);

    } else {

        memcpy(s->scsi_buf, s->usb_buf, len);

    }

    s->usb_len -= len;

    s->scsi_len -= len;

    s->usb_buf += len;

    s->scsi_buf += len;

    s->data_len -= len;

    if (s->scsi_len == 0 || s->data_len == 0) {

        if (s->mode == USB_MSDM_DATAIN) {

            s->scsi_dev->info->read_data(s->scsi_dev, s->tag);

        } else if (s->mode == USB_MSDM_DATAOUT) {

            s->scsi_dev->info->write_data(s->scsi_dev, s->tag);

        }

    }

}

            s->scsi_dev->info->read_data(s->scsi_dev, s->tag);             s->scsi_dev->info->write_data(s->scsi_dev, s->tag);
static void FUNC_0(MSDState *VAR_0)

{

    uint32_t len;

    len = VAR_0->usb_len;

    if (len > VAR_0->scsi_len)

        len = VAR_0->scsi_len;

    if (VAR_0->mode == USB_MSDM_DATAIN) {

        memcpy(VAR_0->usb_buf, VAR_0->scsi_buf, len);

    } else {

        memcpy(VAR_0->scsi_buf, VAR_0->usb_buf, len);

    }

    VAR_0->usb_len -= len;

    VAR_0->scsi_len -= len;

    VAR_0->usb_buf += len;

    VAR_0->scsi_buf += len;

    VAR_0->data_len -= len;

    if (VAR_0->scsi_len == 0 || VAR_0->data_len == 0) {

        if (VAR_0->mode == USB_MSDM_DATAIN) {

            VAR_0->scsi_dev->info->read_data(VAR_0->scsi_dev, VAR_0->tag);

        } else if (VAR_0->mode == USB_MSDM_DATAOUT) {

            VAR_0->scsi_dev->info->write_data(VAR_0->scsi_dev, VAR_0->tag);

        }

    }

}

static void FUNC_0(MSDState *VAR_0)
{ uint32_t len; len = VAR_0->usb_len; if (len > VAR_0->scsi_len)
len = VAR_0->scsi_len; if (VAR_0->mode == USB_MSDM_DATAIN) { memcpy(VAR_0->usb_buf, VAR_0->scsi_buf, len); } else { memcpy(VAR_0->scsi_buf, VAR_0->usb_buf, len); } VAR_0->usb_len -= len; VAR_0->scsi_len -= len; VAR_0->usb_buf += len; VAR_0->scsi_buf += len; VAR_0->data_len -= len; if (VAR_0->scsi_len == 0 || VAR_0->data_len == 0) { if (VAR_0->mode == USB_MSDM_DATAIN) { VAR_0->scsi_dev->info->read_data(VAR_0->scsi_dev, VAR_0->tag); } else if (VAR_0->mode == USB_MSDM_DATAOUT) { VAR_0->scsi_dev->info->write_data(VAR_0->scsi_dev, VAR_0->tag); } } }