static void gain_compensate(COOKContext *q, cook_gains *gains_ptr,

                            float* previous_buffer)

{

    const float fc = q->pow2tab[gains_ptr->previous[0] + 63];

    float *buffer = q->mono_mdct_output;

    int i;



    /* Overlap with the previous block. */

    for(i=0 ; i<q->samples_per_channel ; i++) {

        buffer[i] *= fc;

        buffer[i] += previous_buffer[i];

    }



    /* Apply gain profile */

    for (i = 0; i < 8; i++) {

        if (gains_ptr->now[i] || gains_ptr->now[i + 1])

            interpolate(q, &buffer[q->gain_size_factor * i],

                        gains_ptr->now[i], gains_ptr->now[i + 1]);

    }



    /* Save away the current to be previous block. */

    memcpy(previous_buffer, buffer+q->samples_per_channel,

           sizeof(float)*q->samples_per_channel);

}

static void gain_compensate(COOKContext *q, cook_gains *gains_ptr,

                            float* previous_buffer)

{

    const float fc = q->pow2tab[gains_ptr->previous[0] + 63];

    float *buffer = q->mono_mdct_output;

    int i;



    

    for(i=0 ; i<q->samples_per_channel ; i++) {

        buffer[i] *= fc;

        buffer[i] += previous_buffer[i];

    }



    

    for (i = 0; i < 8; i++) {

        if (gains_ptr->now[i] || gains_ptr->now[i + 1])

            interpolate(q, &buffer[q->gain_size_factor * i],

                        gains_ptr->now[i], gains_ptr->now[i + 1]);

    }



    

    memcpy(previous_buffer, buffer+q->samples_per_channel,

           sizeof(float)*q->samples_per_channel);

}

static void FUNC_0(COOKContext *VAR_0, cook_gains *VAR_1,

                            float* VAR_2)

{

    const float VAR_3 = VAR_0->pow2tab[VAR_1->previous[0] + 63];

    float *VAR_4 = VAR_0->mono_mdct_output;

    int VAR_5;



    

    for(VAR_5=0 ; VAR_5<VAR_0->samples_per_channel ; VAR_5++) {

        VAR_4[VAR_5] *= VAR_3;

        VAR_4[VAR_5] += VAR_2[VAR_5];

    }



    

    for (VAR_5 = 0; VAR_5 < 8; VAR_5++) {

        if (VAR_1->now[VAR_5] || VAR_1->now[VAR_5 + 1])

            interpolate(VAR_0, &VAR_4[VAR_0->gain_size_factor * VAR_5],

                        VAR_1->now[VAR_5], VAR_1->now[VAR_5 + 1]);

    }



    

    memcpy(VAR_2, VAR_4+VAR_0->samples_per_channel,

           sizeof(float)*VAR_0->samples_per_channel);

}

static void FUNC_0(COOKContext *VAR_0, cook_gains *VAR_1,
float* VAR_2)
{ const float VAR_3 = VAR_0->pow2tab[VAR_1->previous[0] + 63]; float *VAR_4 = VAR_0->mono_mdct_output; int VAR_5; for(VAR_5=0 ; VAR_5<VAR_0->samples_per_channel ; VAR_5++) { VAR_4[VAR_5] *= VAR_3; VAR_4[VAR_5] += VAR_2[VAR_5]; } for (VAR_5 = 0; VAR_5 < 8; VAR_5++) { if (VAR_1->now[VAR_5] || VAR_1->now[VAR_5 + 1])
interpolate(VAR_0, &VAR_4[VAR_0->gain_size_factor * VAR_5],
VAR_1->now[VAR_5], VAR_1->now[VAR_5 + 1]); } memcpy(VAR_2, VAR_4+VAR_0->samples_per_channel,
sizeof(float)*VAR_0->samples_per_channel); }