static int do_write_compressed(BlockBackend *blk, char *buf, int64_t offset,

                               int64_t count, int64_t *total)

{

    int ret;



    if (count >> 9 > INT_MAX) {

        return -ERANGE;

    }



    ret = blk_write_compressed(blk, offset >> 9, (uint8_t *)buf, count >> 9);

    if (ret < 0) {

        return ret;

    }

    *total = count;

    return 1;

}

static int do_write_compressed(BlockBackend *blk, char *buf, int64_t offset,

                               int64_t count, int64_t *total)

{

    int ret;



    if (count >> 9 > INT_MAX) {

        return -ERANGE;

    }



    ret = blk_write_compressed(blk, offset >> 9, (uint8_t *)buf, count >> 9);

    if (ret < 0) {

        return ret;

    }

    *total = count;

    return 1;

}

static int FUNC_0(BlockBackend *VAR_0, char *VAR_1, int64_t VAR_2,

                               int64_t VAR_3, int64_t *VAR_4)

{

    int VAR_5;



    if (VAR_3 >> 9 > INT_MAX) {

        return -ERANGE;

    }



    VAR_5 = blk_write_compressed(VAR_0, VAR_2 >> 9, (uint8_t *)VAR_1, VAR_3 >> 9);

    if (VAR_5 < 0) {

        return VAR_5;

    }

    *VAR_4 = VAR_3;

    return 1;

}

static int FUNC_0(BlockBackend *VAR_0, char *VAR_1, int64_t VAR_2,
int64_t VAR_3, int64_t *VAR_4)
{ int VAR_5; if (VAR_3 >> 9 > INT_MAX) { return -ERANGE; } VAR_5 = blk_write_compressed(VAR_0, VAR_2 >> 9, (uint8_t *)VAR_1, VAR_3 >> 9); if (VAR_5 < 0) { return VAR_5; } *VAR_4 = VAR_3; return 1; }