File: mystere.c - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off

01: #include <stdio.h>
02: #include <stdlib.h>
03: #include <math.h>
04: #include <inttypes.h>
05: 
06: int32_t mystere(uint32_t n)
07: {
08:     n &= 0xFF;
09:     if (!n) return -21;
10:     if ((& 0xC0) == 0x40) n &= 0xBF;
11:     if ((& 0x1F) > 16) return mystere((^ 0x1F) + 1);
12:     if (& 0x1C) return mystere(- 4) + 12;
13:     if ((& 0xC3) == 0xC0) return mystere(& 0xBF) - 1;
14:     if ((& 3) == 1) return mystere(- 1) + 2 + ((>> 7) * (((& 0x40) >> 6) + 1));
15:     if ((& 3) == 2) return mystere(- 1) + 3 + ((((& 0xC0) == 0x80) << 1) - ((!(& 0xC0)) * (((& 0x20) >> 5) + 1)));
16:     if ((& 3) == 3) return mystere(- 1) + 4 - ((!(& 0xE0)) + (((& 0xC0) == 0x80) << 1));
17:     return mystere(0) - 3 + (((& 0xE0) == 0xA0) << 1);
18: }
19: 
20: int main(void)
21: {
22:     uint32_t i;
23:     int16_t *buf = malloc(10584320);
24:     int16_t *= buf;
25:     FILE *= fopen("mystere.bin", "wb");
26:     for (= 0; i < 320; i++)
27:     {
28:         uint32_t j;
29:         for (= 0; j < 8269; j++)
30:         {
31:             double n = sin((double)(j) * 0.062689 * pow(2, (double)mystere(i) / 12.0)) * 16384.0;
32:             double s[2];
33:             n *= exp((double)* -5E-5);
34:             if (& 0x100) n *= exp(-(double)(& 0xFF) * 0.1);
35:             if (< 441) n *= (double)(j) * 0.002268;
36:             if (> 7828) n *= (double)(8269 - j) * 0.002268;
37:             s[0] = s[1] = n;
38:             if ((- buf) > 1999) { s[0] += (double)p[-2000] * 0.3; s[1] += (double)p[-2000] * 0.3; }
39:             if (> 1) { s[0] += (double)p[-33076] * 0.125; s[1] += (double)p[-33076] * 0.375; }
40:             if (> 2) { s[0] += (double)p[-49614] * 0.1875; s[1] += (double)p[-49614] *  0.0625; }
41:             *p++ = (int16_t)s[0]; *p++ = (int16_t)s[1];
42:         }
43:     }
44:     fwrite(buf, 1, 10584320, f);
45:     return 0;
46: }