static int flashsv2_prime(FlashSVContext *s, uint8_t *src,

                          int size, int unp_size)

{

    z_stream zs;

    int zret; // Zlib return code



    zs.zalloc = NULL;

    zs.zfree  = NULL;

    zs.opaque = NULL;



    s->zstream.next_in   = src;

    s->zstream.avail_in  = size;

    s->zstream.next_out  = s->tmpblock;

    s->zstream.avail_out = s->block_size * 3;

    inflate(&s->zstream, Z_SYNC_FLUSH);



    deflateInit(&zs, 0);

    zs.next_in   = s->tmpblock;

    zs.avail_in  = s->block_size * 3 - s->zstream.avail_out;

    zs.next_out  = s->deflate_block;

    zs.avail_out = s->deflate_block_size;

    deflate(&zs, Z_SYNC_FLUSH);

    deflateEnd(&zs);



    if ((zret = inflateReset(&s->zstream)) != Z_OK) {

        av_log(s->avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);

        return AVERROR_UNKNOWN;

    }



    s->zstream.next_in   = s->deflate_block;

    s->zstream.avail_in  = s->deflate_block_size - zs.avail_out;

    s->zstream.next_out  = s->tmpblock;

    s->zstream.avail_out = s->block_size * 3;

    inflate(&s->zstream, Z_SYNC_FLUSH);



    return 0;

}

static int flashsv2_prime(FlashSVContext *s, uint8_t *src,

                          int size, int unp_size)

{

    z_stream zs;

    int zret; 



    zs.zalloc = NULL;

    zs.zfree  = NULL;

    zs.opaque = NULL;



    s->zstream.next_in   = src;

    s->zstream.avail_in  = size;

    s->zstream.next_out  = s->tmpblock;

    s->zstream.avail_out = s->block_size * 3;

    inflate(&s->zstream, Z_SYNC_FLUSH);



    deflateInit(&zs, 0);

    zs.next_in   = s->tmpblock;

    zs.avail_in  = s->block_size * 3 - s->zstream.avail_out;

    zs.next_out  = s->deflate_block;

    zs.avail_out = s->deflate_block_size;

    deflate(&zs, Z_SYNC_FLUSH);

    deflateEnd(&zs);



    if ((zret = inflateReset(&s->zstream)) != Z_OK) {

        av_log(s->avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);

        return AVERROR_UNKNOWN;

    }



    s->zstream.next_in   = s->deflate_block;

    s->zstream.avail_in  = s->deflate_block_size - zs.avail_out;

    s->zstream.next_out  = s->tmpblock;

    s->zstream.avail_out = s->block_size * 3;

    inflate(&s->zstream, Z_SYNC_FLUSH);



    return 0;

}

static int FUNC_0(FlashSVContext *VAR_0, uint8_t *VAR_1,

                          int VAR_2, int VAR_3)

{

    z_stream zs;

    int VAR_4; 



    zs.zalloc = NULL;

    zs.zfree  = NULL;

    zs.opaque = NULL;



    VAR_0->zstream.next_in   = VAR_1;

    VAR_0->zstream.avail_in  = VAR_2;

    VAR_0->zstream.next_out  = VAR_0->tmpblock;

    VAR_0->zstream.avail_out = VAR_0->block_size * 3;

    inflate(&VAR_0->zstream, Z_SYNC_FLUSH);



    deflateInit(&zs, 0);

    zs.next_in   = VAR_0->tmpblock;

    zs.avail_in  = VAR_0->block_size * 3 - VAR_0->zstream.avail_out;

    zs.next_out  = VAR_0->deflate_block;

    zs.avail_out = VAR_0->deflate_block_size;

    deflate(&zs, Z_SYNC_FLUSH);

    deflateEnd(&zs);



    if ((VAR_4 = inflateReset(&VAR_0->zstream)) != Z_OK) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", VAR_4);

        return AVERROR_UNKNOWN;

    }



    VAR_0->zstream.next_in   = VAR_0->deflate_block;

    VAR_0->zstream.avail_in  = VAR_0->deflate_block_size - zs.avail_out;

    VAR_0->zstream.next_out  = VAR_0->tmpblock;

    VAR_0->zstream.avail_out = VAR_0->block_size * 3;

    inflate(&VAR_0->zstream, Z_SYNC_FLUSH);



    return 0;

}

static int FUNC_0(FlashSVContext *VAR_0, uint8_t *VAR_1,
int VAR_2, int VAR_3)
{ z_stream zs; int VAR_4; zs.zalloc = NULL; zs.zfree  = NULL; zs.opaque = NULL; VAR_0->zstream.next_in   = VAR_1; VAR_0->zstream.avail_in  = VAR_2; VAR_0->zstream.next_out  = VAR_0->tmpblock; VAR_0->zstream.avail_out = VAR_0->block_size * 3; inflate(&VAR_0->zstream, Z_SYNC_FLUSH); deflateInit(&zs, 0); zs.next_in   = VAR_0->tmpblock; zs.avail_in  = VAR_0->block_size * 3 - VAR_0->zstream.avail_out; zs.next_out  = VAR_0->deflate_block; zs.avail_out = VAR_0->deflate_block_size; deflate(&zs, Z_SYNC_FLUSH); deflateEnd(&zs); if ((VAR_4 = inflateReset(&VAR_0->zstream)) != Z_OK) { av_log(VAR_0->avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", VAR_4); return AVERROR_UNKNOWN; } VAR_0->zstream.next_in   = VAR_0->deflate_block; VAR_0->zstream.avail_in  = VAR_0->deflate_block_size - zs.avail_out; VAR_0->zstream.next_out  = VAR_0->tmpblock; VAR_0->zstream.avail_out = VAR_0->block_size * 3; inflate(&VAR_0->zstream, Z_SYNC_FLUSH); return 0; }