static void exponents_from_scale_factors(MPADecodeContext *s,

                                         GranuleDef *g,

                                         int16_t *exponents)

{

    const uint8_t *bstab, *pretab;

    int len, i, j, k, l, v0, shift, gain, gains[3];

    int16_t *exp_ptr;



    exp_ptr = exponents;

    gain = g->global_gain - 210;

    shift = g->scalefac_scale + 1;



    bstab = band_size_long[s->sample_rate_index];

    pretab = mpa_pretab[g->preflag];

    for(i=0;i<g->long_end;i++) {

        v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift);

        len = bstab[i];

        for(j=len;j>0;j--)

            *exp_ptr++ = v0;

    }



    if (g->short_start < 13) {

        bstab = band_size_short[s->sample_rate_index];

        gains[0] = gain - (g->subblock_gain[0] << 3);

        gains[1] = gain - (g->subblock_gain[1] << 3);

        gains[2] = gain - (g->subblock_gain[2] << 3);

        k = g->long_end;

        for(i=g->short_start;i<13;i++) {

            len = bstab[i];

            for(l=0;l<3;l++) {

                v0 = gains[l] - (g->scale_factors[k++] << shift);

                for(j=len;j>0;j--)

                *exp_ptr++ = v0;

            }

        }

    }

}

static void exponents_from_scale_factors(MPADecodeContext *s,

                                         GranuleDef *g,

                                         int16_t *exponents)

{

    const uint8_t *bstab, *pretab;

    int len, i, j, k, l, v0, shift, gain, gains[3];

    int16_t *exp_ptr;



    exp_ptr = exponents;

    gain = g->global_gain - 210;

    shift = g->scalefac_scale + 1;



    bstab = band_size_long[s->sample_rate_index];

    pretab = mpa_pretab[g->preflag];

    for(i=0;i<g->long_end;i++) {

        v0 = gain - ((g->scale_factors[i] + pretab[i]) << shift);

        len = bstab[i];

        for(j=len;j>0;j--)

            *exp_ptr++ = v0;

    }



    if (g->short_start < 13) {

        bstab = band_size_short[s->sample_rate_index];

        gains[0] = gain - (g->subblock_gain[0] << 3);

        gains[1] = gain - (g->subblock_gain[1] << 3);

        gains[2] = gain - (g->subblock_gain[2] << 3);

        k = g->long_end;

        for(i=g->short_start;i<13;i++) {

            len = bstab[i];

            for(l=0;l<3;l++) {

                v0 = gains[l] - (g->scale_factors[k++] << shift);

                for(j=len;j>0;j--)

                *exp_ptr++ = v0;

            }

        }

    }

}

static void FUNC_0(MPADecodeContext *VAR_0,

                                         GranuleDef *VAR_1,

                                         int16_t *VAR_2)

{

    const uint8_t *VAR_3, *pretab;

    int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10, VAR_11, VAR_12[3];

    int16_t *exp_ptr;



    exp_ptr = VAR_2;

    VAR_11 = VAR_1->global_gain - 210;

    VAR_10 = VAR_1->scalefac_scale + 1;



    VAR_3 = band_size_long[VAR_0->sample_rate_index];

    pretab = mpa_pretab[VAR_1->preflag];

    for(VAR_5=0;VAR_5<VAR_1->long_end;VAR_5++) {

        VAR_9 = VAR_11 - ((VAR_1->scale_factors[VAR_5] + pretab[VAR_5]) << VAR_10);

        VAR_4 = VAR_3[VAR_5];

        for(VAR_6=VAR_4;VAR_6>0;VAR_6--)

            *exp_ptr++ = VAR_9;

    }



    if (VAR_1->short_start < 13) {

        VAR_3 = band_size_short[VAR_0->sample_rate_index];

        VAR_12[0] = VAR_11 - (VAR_1->subblock_gain[0] << 3);

        VAR_12[1] = VAR_11 - (VAR_1->subblock_gain[1] << 3);

        VAR_12[2] = VAR_11 - (VAR_1->subblock_gain[2] << 3);

        VAR_7 = VAR_1->long_end;

        for(VAR_5=VAR_1->short_start;VAR_5<13;VAR_5++) {

            VAR_4 = VAR_3[VAR_5];

            for(VAR_8=0;VAR_8<3;VAR_8++) {

                VAR_9 = VAR_12[VAR_8] - (VAR_1->scale_factors[VAR_7++] << VAR_10);

                for(VAR_6=VAR_4;VAR_6>0;VAR_6--)

                *exp_ptr++ = VAR_9;

            }

        }

    }

}

static void FUNC_0(MPADecodeContext *VAR_0,
GranuleDef *VAR_1,
int16_t *VAR_2)
{ const uint8_t *VAR_3, *pretab; int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9, VAR_10, VAR_11, VAR_12[3]; int16_t *exp_ptr; exp_ptr = VAR_2; VAR_11 = VAR_1->global_gain - 210; VAR_10 = VAR_1->scalefac_scale + 1; VAR_3 = band_size_long[VAR_0->sample_rate_index]; pretab = mpa_pretab[VAR_1->preflag]; for(VAR_5=0;VAR_5<VAR_1->long_end;VAR_5++) { VAR_9 = VAR_11 - ((VAR_1->scale_factors[VAR_5] + pretab[VAR_5]) << VAR_10); VAR_4 = VAR_3[VAR_5]; for(VAR_6=VAR_4;VAR_6>0;VAR_6--) *exp_ptr++ = VAR_9; } if (VAR_1->short_start < 13) { VAR_3 = band_size_short[VAR_0->sample_rate_index]; VAR_12[0] = VAR_11 - (VAR_1->subblock_gain[0] << 3); VAR_12[1] = VAR_11 - (VAR_1->subblock_gain[1] << 3); VAR_12[2] = VAR_11 - (VAR_1->subblock_gain[2] << 3); VAR_7 = VAR_1->long_end; for(VAR_5=VAR_1->short_start;VAR_5<13;VAR_5++) { VAR_4 = VAR_3[VAR_5]; for(VAR_8=0;VAR_8<3;VAR_8++) { VAR_9 = VAR_12[VAR_8] - (VAR_1->scale_factors[VAR_7++] << VAR_10); for(VAR_6=VAR_4;VAR_6>0;VAR_6--) *exp_ptr++ = VAR_9; } } } }