frac32 select
frac32 fine
bool32 rnd
int32 o1
int32 o2
int32 o3
int32 o4
frac32.u.map select
frac32.s.map fine
bool32.tgl rnd
combo options
int i;
int T[13] = {1, 5, 15, 35, 70, 126, 210, 330, 495, 715, 1001, 1365, 1820};
int32_t C[4];
int options;
int32_t q = attr_options;
uint8_t *c;
// int c[attr_options<<2];
bool rnd;
static uint8_t _array[attr_options << 2] __attribute__((section(".sdram")));
c = &_array[0];
for (i = 0; i < 13; i++) {
if (T[i] == attr_options) {
options = i + 4;
}
}
rnd = 1;
for (i = 0; i < 4; i++) {
c[i] = i;
}
int j;
for (i = 1; i < q; i++) {
int k = i << 2;
for (j = 0; j < 4; j++) {
c[k + j] = c[k + j - 4];
}
c[k + 3] += 1;
while ((c[k + 3] >= options) || (c[k + 2] >= options - 1) ||
(c[k + 1] >= options - 2)) {
if (c[k + 3] >= options) {
c[k + 2] += 1;
c[k + 3] = c[k + 2] + 1;
}
if (c[k + 2] >= (options - 1)) {
c[k + 1] += 1;
c[k + 2] = c[k + 1] + 1;
c[k + 3] = c[k + 2] + 1;
}
if (c[k + 1] >= (options - 2)) {
c[k] += 1;
c[k + 1] = c[k + 0] + 1;
c[k + 2] = c[k + 1] + 1;
c[k + 3] = c[k + 2] + 1;
}
}
}
int RND = param_rnd || inlet_rnd;
if (RND < 1) {
int32_t set = ((param_fine + inlet_fine >> 8) + param_select + inlet_select) &
((1 << 27) - 1);
int pst = ___SMMUL(((q) << 1), set << 4) << 2;
outlet_o1 = c[pst];
outlet_o2 = c[pst + 1];
outlet_o3 = c[pst + 2];
outlet_o4 = c[pst + 3];
rnd = 1;
} else if (RND > 0) {
if (rnd > 0) {
rnd = 0;
for (i = 0; i < 4; i++) {
C[i] = -1;
}
bool tmp;
for (i = 0; i < 4; i++) {
tmp = 0;
while (tmp == 0) {
C[i] = (int32_t)(GenerateRandomNumber() % options);
tmp = ((C[i] == C[(i + 1) & 3]) || (C[i] == C[(i + 2) & 3]) ||
(C[i] == C[(i + 3) & 3])) > 0
? 0
: 1;
}
}
// int T[4];
// T[0]=
}
outlet_o1 = C[0];
outlet_o2 = C[1];
outlet_o3 = C[2];
outlet_o4 = C[3];
}