frac32buffer in
frac32 cut
frac32 res
frac32buffer out
frac32buffer res
frac32.u.map res
frac32.u.map Rdrive
frac32.u.map Ftreshold
frac32.u.map Rtreshold
frac32.u.map.gain Fdrive
frac32.u.map.gain slope
bool32.tgl hp
frac32.s.map.pitch cut
int32_t pos;
int32_t spd;
int32_t v27 = 1 << 27;
int32_t prv;
int32_t th;
int32_t lp;
int32_t frq;
MTOF(param_cut + inlet_cut, frq)
frq = frq >> 1;
int32_t damp = (int32_t)((v27 - __USAT(param_res + inlet_res, 27) * 0.99)) << 3;
int32_t Damp = (int32_t)(v27 - ((v27 - __USAT(param_Rdrive, 27) * 0.99))) << 3;
int32_t Rtreshold = param_Rtreshold;
Rtreshold = ___SMMUL(Rtreshold << 3, Rtreshold << 2);
int32_t Ftreshold = param_Ftreshold << 1;
int32_t in;
int32_t ts = __SSAT(inlet_in, 28);
int32_t tsq31 = ts << 3;
int32_t tsq31p3 = ___SMMUL(tsq31, ___SMMUL(tsq31, tsq31));
in = ts + (ts >> 1) - (tsq31p3);
lp += ___SMMUL((in - lp) << 1, frq << 1) << 1;
int32_t Tmp;
if (param_hp == 0) {
Tmp = lp - in;
} else if (param_hp == 1) {
Tmp = -lp;
}
int32_t LP = in + (___SMMUL(Tmp, param_slope));
spd += ___SMMUL((LP - pos), frq) << 3;
int32_t tmp = ___SMMUL(spd, __USAT(Damp, 30)) << 1;
spd -= ___SMMUL(tmp, ___SMMUL(tmp, tmp) << 5) << 7;
th = spd;
th = th > 0 ? th : -th;
th = th > Rtreshold ? __USAT(th - Rtreshold, 26) << 4 : 0;
spd -= ___SMMUL(spd, __USAT(th, 30));
pos += spd;
th = pos;
th = th > 0 ? th : -th;
th = th > Ftreshold ? __USAT(th - Ftreshold, 26) << 4 : 0;
pos -= ___SMMUL(pos, __USAT(th, 30));
int32_t dp = LP - pos;
dp = dp > 0 ? dp : -dp;
dp = ___SMMUL(dp, param_Fdrive) << 1;
dp = ___SMMUL(dp, ___SMMUL(dp, dp) << 5) << 5;
pos -= ___SMMUL(pos, __USAT(dp, 26)) << 5;
pos -= ___SMMUL(pos, __USAT(damp, 30));
outlet_out = pos - (param_hp > 0 ? in : 0);
outlet_res = -(spd - prv) << 1;
prv = spd;