int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,

                        int64_t offset, int bytes)

{

    uint64_t bs_size = bs->total_sectors * BDRV_SECTOR_SIZE;

    int n1;



    if ((offset + bytes) <= bs_size) {

        return bytes;

    }



    if (offset >= bs_size) {

        n1 = 0;

    } else {

        n1 = bs_size - offset;

    }



    qemu_iovec_memset(qiov, n1, 0, bytes - n1);



    return n1;

}

int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,

                        int64_t offset, int bytes)

{

    uint64_t bs_size = bs->total_sectors * BDRV_SECTOR_SIZE;

    int n1;



    if ((offset + bytes) <= bs_size) {

        return bytes;

    }



    if (offset >= bs_size) {

        n1 = 0;

    } else {

        n1 = bs_size - offset;

    }



    qemu_iovec_memset(qiov, n1, 0, bytes - n1);



    return n1;

}

int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,                         int64_t offset, int bytes)     uint64_t bs_size = bs->total_sectors * BDRV_SECTOR_SIZE;     int n1;     if ((offset + bytes) <= bs_size) {         return bytes;     if (offset >= bs_size) {         n1 = 0;     } else {         n1 = bs_size - offset;     qemu_iovec_memset(qiov, n1, 0, bytes - n1);     return n1; int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,
int FUNC_0(BlockDriverState *VAR_0, QEMUIOVector *VAR_1,

                        int64_t VAR_2, int VAR_3)

{

    uint64_t bs_size = VAR_0->total_sectors * BDRV_SECTOR_SIZE;

    int VAR_4;



    if ((VAR_2 + VAR_3) <= bs_size) {

        return VAR_3;

    }



    if (VAR_2 >= bs_size) {

        VAR_4 = 0;

    } else {

        VAR_4 = bs_size - VAR_2;

    }



    qemu_iovec_memset(VAR_1, VAR_4, 0, VAR_3 - VAR_4);



    return VAR_4;

}

int FUNC_0(BlockDriverState *VAR_0, QEMUIOVector *VAR_1,
int64_t VAR_2, int VAR_3)
{ uint64_t bs_size = VAR_0->total_sectors * BDRV_SECTOR_SIZE; int VAR_4; if ((VAR_2 + VAR_3) <= bs_size) { return VAR_3; } if (VAR_2 >= bs_size) { VAR_4 = 0; } else { VAR_4 = bs_size - VAR_2; } qemu_iovec_memset(VAR_1, VAR_4, 0, VAR_3 - VAR_4); return VAR_4; }