static void celt_search_for_intensity(OpusPsyContext *s, CeltFrame *f)
{
    int i, best_band = CELT_MAX_BANDS - 1;
    float dist, best_dist = FLT_MAX;
    /* TODO: fix, make some heuristic up here using the lambda value */
    float end_band = 0;
    for (i = f->end_band; i >= end_band; i--) {
        f->intensity_stereo = i;
        bands_dist(s, f, &dist);
        if (best_dist > dist) {
            best_dist = dist;
            best_band = i;
        }
    }
    f->intensity_stereo = best_band;
    s->avg_is_band = (s->avg_is_band + f->intensity_stereo)/2.0f;
}
static void celt_search_for_intensity(OpusPsyContext *s, CeltFrame *f)
{
    int i, best_band = CELT_MAX_BANDS - 1;
    float dist, best_dist = FLT_MAX;
    
    float end_band = 0;
    for (i = f->end_band; i >= end_band; i--) {
        f->intensity_stereo = i;
        bands_dist(s, f, &dist);
        if (best_dist > dist) {
            best_dist = dist;
            best_band = i;
        }
    }
    f->intensity_stereo = best_band;
    s->avg_is_band = (s->avg_is_band + f->intensity_stereo)/2.0f;
}
static void FUNC_0(OpusPsyContext *VAR_0, CeltFrame *VAR_1)
{
    int VAR_2, VAR_3 = CELT_MAX_BANDS - 1;
    float VAR_4, VAR_5 = FLT_MAX;
    
    float VAR_6 = 0;
    for (VAR_2 = VAR_1->VAR_6; VAR_2 >= VAR_6; VAR_2--) {
        VAR_1->intensity_stereo = VAR_2;
        bands_dist(VAR_0, VAR_1, &VAR_4);
        if (VAR_5 > VAR_4) {
            VAR_5 = VAR_4;
            VAR_3 = VAR_2;
        }
    }
    VAR_1->intensity_stereo = VAR_3;
    VAR_0->avg_is_band = (VAR_0->avg_is_band + VAR_1->intensity_stereo)/2.0f;
}
static void FUNC_0(OpusPsyContext *VAR_0, CeltFrame *VAR_1)
{ int VAR_2, VAR_3 = CELT_MAX_BANDS - 1; float VAR_4, VAR_5 = FLT_MAX; float VAR_6 = 0; for (VAR_2 = VAR_1->VAR_6; VAR_2 >= VAR_6; VAR_2--) { VAR_1->intensity_stereo = VAR_2; bands_dist(VAR_0, VAR_1, &VAR_4); if (VAR_5 > VAR_4) { VAR_5 = VAR_4; VAR_3 = VAR_2; } } VAR_1->intensity_stereo = VAR_3; VAR_0->avg_is_band = (VAR_0->avg_is_band + VAR_1->intensity_stereo)/2.0f; }