static void adaptive_gain_control(float *out, const float *in,

                                  const float *speech_synth,

                                  int size, float alpha, float *gain_mem)

{

    int i;

    float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;

    float mem = *gain_mem;



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

        speech_energy     += fabsf(speech_synth[i]);

        postfilter_energy += fabsf(in[i]);

    }

    gain_scale_factor = (1.0 - alpha) * speech_energy / postfilter_energy;



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

        mem = alpha * mem + gain_scale_factor;

        out[i] = in[i] * mem;

    }



    *gain_mem = mem;

}

static void adaptive_gain_control(float *out, const float *in,

                                  const float *speech_synth,

                                  int size, float alpha, float *gain_mem)

{

    int i;

    float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;

    float mem = *gain_mem;



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

        speech_energy     += fabsf(speech_synth[i]);

        postfilter_energy += fabsf(in[i]);

    }

    gain_scale_factor = (1.0 - alpha) * speech_energy / postfilter_energy;



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

        mem = alpha * mem + gain_scale_factor;

        out[i] = in[i] * mem;

    }



    *gain_mem = mem;

}

    gain_scale_factor = (1.0 - alpha) * speech_energy / postfilter_energy;
static void FUNC_0(float *VAR_0, const float *VAR_1,

                                  const float *VAR_2,

                                  int VAR_3, float VAR_4, float *VAR_5)

{

    int VAR_6;

    float VAR_7 = 0.0, VAR_8 = 0.0, VAR_9;

    float VAR_10 = *VAR_5;



    for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) {

        VAR_7     += fabsf(VAR_2[VAR_6]);

        VAR_8 += fabsf(VAR_1[VAR_6]);

    }

    VAR_9 = (1.0 - VAR_4) * VAR_7 / VAR_8;



    for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) {

        VAR_10 = VAR_4 * VAR_10 + VAR_9;

        VAR_0[VAR_6] = VAR_1[VAR_6] * VAR_10;

    }



    *VAR_5 = VAR_10;

}

static void FUNC_0(float *VAR_0, const float *VAR_1,
const float *VAR_2,
int VAR_3, float VAR_4, float *VAR_5)
{ int VAR_6; float VAR_7 = 0.0, VAR_8 = 0.0, VAR_9; float VAR_10 = *VAR_5; for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) { VAR_7     += fabsf(VAR_2[VAR_6]); VAR_8 += fabsf(VAR_1[VAR_6]); } VAR_9 = (1.0 - VAR_4) * VAR_7 / VAR_8; for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) { VAR_10 = VAR_4 * VAR_10 + VAR_9; VAR_0[VAR_6] = VAR_1[VAR_6] * VAR_10; } *VAR_5 = VAR_10; }