static void audiogen(void *data, enum AVSampleFormat sample_fmt,

                     int channels, int sample_rate, int nb_samples)

{

    int i, ch, k;

    double v, f, a, ampa;

    double tabf1[SWR_CH_MAX];

    double tabf2[SWR_CH_MAX];

    double taba[SWR_CH_MAX];

    unsigned static rnd;



#define PUT_SAMPLE set(data, ch, k, channels, sample_fmt, v);

#define uint_rand(x) (x = x * 1664525 + 1013904223)

#define dbl_rand(x) (uint_rand(x)*2.0 / (double)UINT_MAX - 1)

    k = 0;



    /* 1 second of single freq sinus at 1000 Hz */

    a = 0;

    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {

        v = sin(a) * 0.30;

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

        a += M_PI * 1000.0 * 2.0 / sample_rate;

    }



    /* 1 second of varying frequency between 100 and 10000 Hz */

    a = 0;

    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {

        v = sin(a) * 0.30;

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

        f  = 100.0 + (((10000.0 - 100.0) * i) / sample_rate);

        a += M_PI * f * 2.0 / sample_rate;

    }



    /* 0.5 second of low amplitude white noise */

    for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {

        v = dbl_rand(rnd) * 0.30;

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

    }



    /* 0.5 second of high amplitude white noise */

    for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {

        v = dbl_rand(rnd);

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

    }



    /* 1 second of unrelated ramps for each channel */

    for (ch = 0; ch < channels; ch++) {

        taba[ch]  = 0;

        tabf1[ch] = 100 + uint_rand(rnd) % 5000;

        tabf2[ch] = 100 + uint_rand(rnd) % 5000;

    }

    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {

        for (ch = 0; ch < channels; ch++) {

            v = sin(taba[ch]) * 0.30;

            PUT_SAMPLE

            f = tabf1[ch] + (((tabf2[ch] - tabf1[ch]) * i) / sample_rate);

            taba[ch] += M_PI * f * 2.0 / sample_rate;

        }

    }



    /* 2 seconds of 500 Hz with varying volume */

    a    = 0;

    ampa = 0;

    for (i = 0; i < 2 * sample_rate && k < nb_samples; i++, k++) {

        for (ch = 0; ch < channels; ch++) {

            double amp = (1.0 + sin(ampa)) * 0.15;

            if (ch & 1)

                amp = 0.30 - amp;

            v = sin(a) * amp;

            PUT_SAMPLE

            a    += M_PI * 500.0 * 2.0 / sample_rate;

            ampa += M_PI *  2.0 / sample_rate;

        }

    }

}

static void audiogen(void *data, enum AVSampleFormat sample_fmt,

                     int channels, int sample_rate, int nb_samples)

{

    int i, ch, k;

    double v, f, a, ampa;

    double tabf1[SWR_CH_MAX];

    double tabf2[SWR_CH_MAX];

    double taba[SWR_CH_MAX];

    unsigned static rnd;



#define PUT_SAMPLE set(data, ch, k, channels, sample_fmt, v);

#define uint_rand(x) (x = x * 1664525 + 1013904223)

#define dbl_rand(x) (uint_rand(x)*2.0 / (double)UINT_MAX - 1)

    k = 0;



    

    a = 0;

    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {

        v = sin(a) * 0.30;

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

        a += M_PI * 1000.0 * 2.0 / sample_rate;

    }



    

    a = 0;

    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {

        v = sin(a) * 0.30;

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

        f  = 100.0 + (((10000.0 - 100.0) * i) / sample_rate);

        a += M_PI * f * 2.0 / sample_rate;

    }



    

    for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {

        v = dbl_rand(rnd) * 0.30;

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

    }



    

    for (i = 0; i < sample_rate / 2 && k < nb_samples; i++, k++) {

        v = dbl_rand(rnd);

        for (ch = 0; ch < channels; ch++)

            PUT_SAMPLE

    }



    

    for (ch = 0; ch < channels; ch++) {

        taba[ch]  = 0;

        tabf1[ch] = 100 + uint_rand(rnd) % 5000;

        tabf2[ch] = 100 + uint_rand(rnd) % 5000;

    }

    for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) {

        for (ch = 0; ch < channels; ch++) {

            v = sin(taba[ch]) * 0.30;

            PUT_SAMPLE

            f = tabf1[ch] + (((tabf2[ch] - tabf1[ch]) * i) / sample_rate);

            taba[ch] += M_PI * f * 2.0 / sample_rate;

        }

    }



    

    a    = 0;

    ampa = 0;

    for (i = 0; i < 2 * sample_rate && k < nb_samples; i++, k++) {

        for (ch = 0; ch < channels; ch++) {

            double amp = (1.0 + sin(ampa)) * 0.15;

            if (ch & 1)

                amp = 0.30 - amp;

            v = sin(a) * amp;

            PUT_SAMPLE

            a    += M_PI * 500.0 * 2.0 / sample_rate;

            ampa += M_PI *  2.0 / sample_rate;

        }

    }

}

static void FUNC_0(void *VAR_0, enum AVSampleFormat VAR_1,

                     int VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5, VAR_6, VAR_7;

    double VAR_8, VAR_9, VAR_10, VAR_11;

    double VAR_12[SWR_CH_MAX];

    double VAR_13[SWR_CH_MAX];

    double VAR_14[SWR_CH_MAX];

    unsigned static VAR_15;



#define PUT_SAMPLE set(VAR_0, VAR_6, VAR_7, VAR_2, VAR_1, VAR_8);

#define uint_rand(x) (x = x * 1664525 + 1013904223)

#define dbl_rand(x) (uint_rand(x)*2.0 / (double)UINT_MAX - 1)

    VAR_7 = 0;



    

    VAR_10 = 0;

    for (VAR_5 = 0; VAR_5 < 1 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) {

        VAR_8 = sin(VAR_10) * 0.30;

        for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++)

            PUT_SAMPLE

        VAR_10 += M_PI * 1000.0 * 2.0 / VAR_3;

    }



    

    VAR_10 = 0;

    for (VAR_5 = 0; VAR_5 < 1 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) {

        VAR_8 = sin(VAR_10) * 0.30;

        for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++)

            PUT_SAMPLE

        VAR_9  = 100.0 + (((10000.0 - 100.0) * VAR_5) / VAR_3);

        VAR_10 += M_PI * VAR_9 * 2.0 / VAR_3;

    }



    

    for (VAR_5 = 0; VAR_5 < VAR_3 / 2 && VAR_7 < VAR_4; VAR_5++, VAR_7++) {

        VAR_8 = dbl_rand(VAR_15) * 0.30;

        for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++)

            PUT_SAMPLE

    }



    

    for (VAR_5 = 0; VAR_5 < VAR_3 / 2 && VAR_7 < VAR_4; VAR_5++, VAR_7++) {

        VAR_8 = dbl_rand(VAR_15);

        for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++)

            PUT_SAMPLE

    }



    

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

        VAR_14[VAR_6]  = 0;

        VAR_12[VAR_6] = 100 + uint_rand(VAR_15) % 5000;

        VAR_13[VAR_6] = 100 + uint_rand(VAR_15) % 5000;

    }

    for (VAR_5 = 0; VAR_5 < 1 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) {

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

            VAR_8 = sin(VAR_14[VAR_6]) * 0.30;

            PUT_SAMPLE

            VAR_9 = VAR_12[VAR_6] + (((VAR_13[VAR_6] - VAR_12[VAR_6]) * VAR_5) / VAR_3);

            VAR_14[VAR_6] += M_PI * VAR_9 * 2.0 / VAR_3;

        }

    }



    

    VAR_10    = 0;

    VAR_11 = 0;

    for (VAR_5 = 0; VAR_5 < 2 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) {

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

            double VAR_16 = (1.0 + sin(VAR_11)) * 0.15;

            if (VAR_6 & 1)

                VAR_16 = 0.30 - VAR_16;

            VAR_8 = sin(VAR_10) * VAR_16;

            PUT_SAMPLE

            VAR_10    += M_PI * 500.0 * 2.0 / VAR_3;

            VAR_11 += M_PI *  2.0 / VAR_3;

        }

    }

}

static void FUNC_0(void *VAR_0, enum AVSampleFormat VAR_1,
int VAR_2, int VAR_3, int VAR_4)
{ int VAR_5, VAR_6, VAR_7; double VAR_8, VAR_9, VAR_10, VAR_11; double VAR_12[SWR_CH_MAX]; double VAR_13[SWR_CH_MAX]; double VAR_14[SWR_CH_MAX]; unsigned static VAR_15; #define PUT_SAMPLE set(VAR_0, VAR_6, VAR_7, VAR_2, VAR_1, VAR_8); #define uint_rand(x) (x = x * 1664525 + 1013904223)
#define dbl_rand(x) (uint_rand(x)*2.0 / (double)UINT_MAX - 1)
VAR_7 = 0; VAR_10 = 0; for (VAR_5 = 0; VAR_5 < 1 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) { VAR_8 = sin(VAR_10) * 0.30; for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) PUT_SAMPLE
VAR_10 += M_PI * 1000.0 * 2.0 / VAR_3; } VAR_10 = 0; for (VAR_5 = 0; VAR_5 < 1 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) { VAR_8 = sin(VAR_10) * 0.30; for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) PUT_SAMPLE
VAR_9  = 100.0 + (((10000.0 - 100.0) * VAR_5) / VAR_3); VAR_10 += M_PI * VAR_9 * 2.0 / VAR_3; } for (VAR_5 = 0; VAR_5 < VAR_3 / 2 && VAR_7 < VAR_4; VAR_5++, VAR_7++) { VAR_8 = dbl_rand(VAR_15) * 0.30; for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) PUT_SAMPLE
} for (VAR_5 = 0; VAR_5 < VAR_3 / 2 && VAR_7 < VAR_4; VAR_5++, VAR_7++) { VAR_8 = dbl_rand(VAR_15); for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) PUT_SAMPLE
} for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) { VAR_14[VAR_6]  = 0; VAR_12[VAR_6] = 100 + uint_rand(VAR_15) % 5000; VAR_13[VAR_6] = 100 + uint_rand(VAR_15) % 5000; } for (VAR_5 = 0; VAR_5 < 1 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) { for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) { VAR_8 = sin(VAR_14[VAR_6]) * 0.30; PUT_SAMPLE
VAR_9 = VAR_12[VAR_6] + (((VAR_13[VAR_6] - VAR_12[VAR_6]) * VAR_5) / VAR_3); VAR_14[VAR_6] += M_PI * VAR_9 * 2.0 / VAR_3; } } VAR_10    = 0; VAR_11 = 0; for (VAR_5 = 0; VAR_5 < 2 * VAR_3 && VAR_7 < VAR_4; VAR_5++, VAR_7++) { for (VAR_6 = 0; VAR_6 < VAR_2; VAR_6++) { double VAR_16 = (1.0 + sin(VAR_11)) * 0.15; if (VAR_6 & 1)
VAR_16 = 0.30 - VAR_16; VAR_8 = sin(VAR_10) * VAR_16; PUT_SAMPLE
VAR_10    += M_PI * 500.0 * 2.0 / VAR_3; VAR_11 += M_PI *  2.0 / VAR_3; } } }