static int decode0(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, unsigned freq, unsigned total_freq)

{

    int t;



    if (total_freq == 0)

        return AVERROR_INVALIDDATA;



    t = rc->range * (uint64_t)cumFreq / total_freq;



    rc->code1 += t + 1;

    rc->range = rc->range * (uint64_t)(freq + cumFreq) / total_freq - (t + 1);



    while (rc->range < TOP && bytestream2_get_bytes_left(gb) > 0) {

        unsigned byte = bytestream2_get_byte(gb);

        rc->code = (rc->code << 8) | byte;

        rc->code1 <<= 8;

        rc->range <<= 8;

    }



    return 0;

}

static int decode0(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, unsigned freq, unsigned total_freq)

{

    int t;



    if (total_freq == 0)

        return AVERROR_INVALIDDATA;



    t = rc->range * (uint64_t)cumFreq / total_freq;



    rc->code1 += t + 1;

    rc->range = rc->range * (uint64_t)(freq + cumFreq) / total_freq - (t + 1);



    while (rc->range < TOP && bytestream2_get_bytes_left(gb) > 0) {

        unsigned byte = bytestream2_get_byte(gb);

        rc->code = (rc->code << 8) | byte;

        rc->code1 <<= 8;

        rc->range <<= 8;

    }



    return 0;

}

    int t;
static int FUNC_0(GetByteContext *VAR_0, RangeCoder *VAR_1, unsigned VAR_2, unsigned VAR_3, unsigned VAR_4)

{

    int VAR_5;



    if (VAR_4 == 0)

        return AVERROR_INVALIDDATA;



    VAR_5 = VAR_1->range * (uint64_t)VAR_2 / VAR_4;



    VAR_1->code1 += VAR_5 + 1;

    VAR_1->range = VAR_1->range * (uint64_t)(VAR_3 + VAR_2) / VAR_4 - (VAR_5 + 1);



    while (VAR_1->range < TOP && bytestream2_get_bytes_left(VAR_0) > 0) {

        unsigned VAR_6 = bytestream2_get_byte(VAR_0);

        VAR_1->code = (VAR_1->code << 8) | VAR_6;

        VAR_1->code1 <<= 8;

        VAR_1->range <<= 8;

    }



    return 0;

}

static int FUNC_0(GetByteContext *VAR_0, RangeCoder *VAR_1, unsigned VAR_2, unsigned VAR_3, unsigned VAR_4)
{ int VAR_5; if (VAR_4 == 0)
return AVERROR_INVALIDDATA; VAR_5 = VAR_1->range * (uint64_t)VAR_2 / VAR_4; VAR_1->code1 += VAR_5 + 1; VAR_1->range = VAR_1->range * (uint64_t)(VAR_3 + VAR_2) / VAR_4 - (VAR_5 + 1); while (VAR_1->range < TOP && bytestream2_get_bytes_left(VAR_0) > 0) { unsigned VAR_6 = bytestream2_get_byte(VAR_0); VAR_1->code = (VAR_1->code << 8) | VAR_6; VAR_1->code1 <<= 8; VAR_1->range <<= 8; } return 0; }