static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,

                                  CcwDataStreamOp op)

{

    int ret;



    ret = cds_check_len(cds, len);

    if (ret <= 0) {

        return ret;





    if (op == CDS_OP_A) {

        goto incr;


    ret = address_space_rw(&address_space_memory, cds->cda,

                           MEMTXATTRS_UNSPECIFIED, buff, len, op);

    if (ret != MEMTX_OK) {

        cds->flags |= CDS_F_STREAM_BROKEN;

        return -EINVAL;


incr:

    cds->at_byte += len;

    cds->cda += len;

    return 0;

static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,

                                  CcwDataStreamOp op)

{

    int ret;



    ret = cds_check_len(cds, len);

    if (ret <= 0) {

        return ret;





    if (op == CDS_OP_A) {

        goto incr;


    ret = address_space_rw(&address_space_memory, cds->cda,

                           MEMTXATTRS_UNSPECIFIED, buff, len, op);

    if (ret != MEMTX_OK) {

        cds->flags |= CDS_F_STREAM_BROKEN;

        return -EINVAL;


incr:

    cds->at_byte += len;

    cds->cda += len;

    return 0;

static int FUNC_0(CcwDataStream *VAR_0, void *VAR_1, int VAR_2,

                                  CcwDataStreamOp VAR_3)

{

    int VAR_4;



    VAR_4 = cds_check_len(VAR_0, VAR_2);

    if (VAR_4 <= 0) {

        return VAR_4;





    if (VAR_3 == CDS_OP_A) {

        goto incr;


    VAR_4 = address_space_rw(&address_space_memory, VAR_0->cda,

                           MEMTXATTRS_UNSPECIFIED, VAR_1, VAR_2, VAR_3);

    if (VAR_4 != MEMTX_OK) {

        VAR_0->flags |= CDS_F_STREAM_BROKEN;

        return -EINVAL;


incr:

    VAR_0->at_byte += VAR_2;

    VAR_0->cda += VAR_2;

    return 0;

static int FUNC_0(CcwDataStream *VAR_0, void *VAR_1, int VAR_2,
CcwDataStreamOp VAR_3)
{ int VAR_4; VAR_4 = cds_check_len(VAR_0, VAR_2); if (VAR_4 <= 0) { return VAR_4; if (VAR_3 == CDS_OP_A) { goto incr; VAR_4 = address_space_rw(&address_space_memory, VAR_0->cda,
MEMTXATTRS_UNSPECIFIED, VAR_1, VAR_2, VAR_3); if (VAR_4 != MEMTX_OK) { VAR_0->flags |= CDS_F_STREAM_BROKEN; return -EINVAL; incr:
VAR_0->at_byte += VAR_2; VAR_0->cda += VAR_2; return 0;