static int decode_block_coeffs_internal(VP56RangeCoder *c, DCTELEM block[16],

                                        uint8_t probs[16][3][NUM_DCT_TOKENS-1],

                                        int i, uint8_t *token_prob, int16_t qmul[2])

{

    goto skip_eob;

    do {

        int coeff;

        if (!vp56_rac_get_prob_branchy(c, token_prob[0]))   // DCT_EOB

            return i;



skip_eob:

        if (!vp56_rac_get_prob_branchy(c, token_prob[1])) { // DCT_0

            if (++i == 16)

                return i; // invalid input; blocks should end with EOB

            token_prob = probs[i][0];

            goto skip_eob;

        }



        if (!vp56_rac_get_prob_branchy(c, token_prob[2])) { // DCT_1

            coeff = 1;

            token_prob = probs[i+1][1];

        } else {

            if (!vp56_rac_get_prob_branchy(c, token_prob[3])) { // DCT 2,3,4

                coeff = vp56_rac_get_prob_branchy(c, token_prob[4]);

                if (coeff)

                    coeff += vp56_rac_get_prob(c, token_prob[5]);

                coeff += 2;

            } else {

                // DCT_CAT*

                if (!vp56_rac_get_prob_branchy(c, token_prob[6])) {

                    if (!vp56_rac_get_prob_branchy(c, token_prob[7])) { // DCT_CAT1

                        coeff  = 5 + vp56_rac_get_prob(c, vp8_dct_cat1_prob[0]);

                    } else {                                    // DCT_CAT2

                        coeff  = 7;

                        coeff += vp56_rac_get_prob(c, vp8_dct_cat2_prob[0]) << 1;

                        coeff += vp56_rac_get_prob(c, vp8_dct_cat2_prob[1]);

                    }

                } else {    // DCT_CAT3 and up

                    int a = vp56_rac_get_prob(c, token_prob[8]);

                    int b = vp56_rac_get_prob(c, token_prob[9+a]);

                    int cat = (a<<1) + b;

                    coeff  = 3 + (8<<cat);

                    coeff += vp8_rac_get_coeff(c, ff_vp8_dct_cat_prob[cat]);

                }

            }

            token_prob = probs[i+1][2];

        }

        block[zigzag_scan[i]] = (vp8_rac_get(c) ? -coeff : coeff) * qmul[!!i];

    } while (++i < 16);



    return i;

}

static int decode_block_coeffs_internal(VP56RangeCoder *c, DCTELEM block[16],

                                        uint8_t probs[16][3][NUM_DCT_TOKENS-1],

                                        int i, uint8_t *token_prob, int16_t qmul[2])

{

    goto skip_eob;

    do {

        int coeff;

        if (!vp56_rac_get_prob_branchy(c, token_prob[0]))   

            return i;



skip_eob:

        if (!vp56_rac_get_prob_branchy(c, token_prob[1])) { 

            if (++i == 16)

                return i; 

            token_prob = probs[i][0];

            goto skip_eob;

        }



        if (!vp56_rac_get_prob_branchy(c, token_prob[2])) { 

            coeff = 1;

            token_prob = probs[i+1][1];

        } else {

            if (!vp56_rac_get_prob_branchy(c, token_prob[3])) { 

                coeff = vp56_rac_get_prob_branchy(c, token_prob[4]);

                if (coeff)

                    coeff += vp56_rac_get_prob(c, token_prob[5]);

                coeff += 2;

            } else {

                

                if (!vp56_rac_get_prob_branchy(c, token_prob[6])) {

                    if (!vp56_rac_get_prob_branchy(c, token_prob[7])) { 

                        coeff  = 5 + vp56_rac_get_prob(c, vp8_dct_cat1_prob[0]);

                    } else {                                    

                        coeff  = 7;

                        coeff += vp56_rac_get_prob(c, vp8_dct_cat2_prob[0]) << 1;

                        coeff += vp56_rac_get_prob(c, vp8_dct_cat2_prob[1]);

                    }

                } else {    

                    int a = vp56_rac_get_prob(c, token_prob[8]);

                    int b = vp56_rac_get_prob(c, token_prob[9+a]);

                    int cat = (a<<1) + b;

                    coeff  = 3 + (8<<cat);

                    coeff += vp8_rac_get_coeff(c, ff_vp8_dct_cat_prob[cat]);

                }

            }

            token_prob = probs[i+1][2];

        }

        block[zigzag_scan[i]] = (vp8_rac_get(c) ? -coeff : coeff) * qmul[!!i];

    } while (++i < 16);



    return i;

}

static int FUNC_0(VP56RangeCoder *VAR_0, DCTELEM VAR_1[16],

                                        uint8_t VAR_2[16][3][NUM_DCT_TOKENS-1],

                                        int VAR_3, uint8_t *VAR_4, int16_t VAR_5[2])

{

    goto skip_eob;

    do {

        int VAR_6;

        if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[0]))   

            return VAR_3;



skip_eob:

        if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[1])) { 

            if (++VAR_3 == 16)

                return VAR_3; 

            VAR_4 = VAR_2[VAR_3][0];

            goto skip_eob;

        }



        if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[2])) { 

            VAR_6 = 1;

            VAR_4 = VAR_2[VAR_3+1][1];

        } else {

            if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[3])) { 

                VAR_6 = vp56_rac_get_prob_branchy(VAR_0, VAR_4[4]);

                if (VAR_6)

                    VAR_6 += vp56_rac_get_prob(VAR_0, VAR_4[5]);

                VAR_6 += 2;

            } else {

                

                if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[6])) {

                    if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[7])) { 

                        VAR_6  = 5 + vp56_rac_get_prob(VAR_0, vp8_dct_cat1_prob[0]);

                    } else {                                    

                        VAR_6  = 7;

                        VAR_6 += vp56_rac_get_prob(VAR_0, vp8_dct_cat2_prob[0]) << 1;

                        VAR_6 += vp56_rac_get_prob(VAR_0, vp8_dct_cat2_prob[1]);

                    }

                } else {    

                    int VAR_7 = vp56_rac_get_prob(VAR_0, VAR_4[8]);

                    int VAR_8 = vp56_rac_get_prob(VAR_0, VAR_4[9+VAR_7]);

                    int VAR_9 = (VAR_7<<1) + VAR_8;

                    VAR_6  = 3 + (8<<VAR_9);

                    VAR_6 += vp8_rac_get_coeff(VAR_0, ff_vp8_dct_cat_prob[VAR_9]);

                }

            }

            VAR_4 = VAR_2[VAR_3+1][2];

        }

        VAR_1[zigzag_scan[VAR_3]] = (vp8_rac_get(VAR_0) ? -VAR_6 : VAR_6) * VAR_5[!!VAR_3];

    } while (++VAR_3 < 16);



    return VAR_3;

}

static int FUNC_0(VP56RangeCoder *VAR_0, DCTELEM VAR_1[16],
uint8_t VAR_2[16][3][NUM_DCT_TOKENS-1],
int VAR_3, uint8_t *VAR_4, int16_t VAR_5[2])
{ goto skip_eob; do { int VAR_6; if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[0]))
return VAR_3; skip_eob:
if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[1])) { if (++VAR_3 == 16)
return VAR_3; VAR_4 = VAR_2[VAR_3][0]; goto skip_eob; } if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[2])) { VAR_6 = 1; VAR_4 = VAR_2[VAR_3+1][1]; } else { if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[3])) { VAR_6 = vp56_rac_get_prob_branchy(VAR_0, VAR_4[4]); if (VAR_6)
VAR_6 += vp56_rac_get_prob(VAR_0, VAR_4[5]); VAR_6 += 2; } else { if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[6])) { if (!vp56_rac_get_prob_branchy(VAR_0, VAR_4[7])) { VAR_6  = 5 + vp56_rac_get_prob(VAR_0, vp8_dct_cat1_prob[0]); } else { VAR_6  = 7; VAR_6 += vp56_rac_get_prob(VAR_0, vp8_dct_cat2_prob[0]) << 1; VAR_6 += vp56_rac_get_prob(VAR_0, vp8_dct_cat2_prob[1]); } } else { int VAR_7 = vp56_rac_get_prob(VAR_0, VAR_4[8]); int VAR_8 = vp56_rac_get_prob(VAR_0, VAR_4[9+VAR_7]); int VAR_9 = (VAR_7<<1) + VAR_8; VAR_6  = 3 + (8<<VAR_9); VAR_6 += vp8_rac_get_coeff(VAR_0, ff_vp8_dct_cat_prob[VAR_9]); } } VAR_4 = VAR_2[VAR_3+1][2]; } VAR_1[zigzag_scan[VAR_3]] = (vp8_rac_get(VAR_0) ? -VAR_6 : VAR_6) * VAR_5[!!VAR_3]; } while (++VAR_3 < 16); return VAR_3; }