frac32buffer in
frac32 gain
frac32 clip
frac32 strength
frac32buffer out
frac32.u.map gain
frac32.u.map clipH
frac32.u.map clipL
frac32.u.map strength
bool32.tgl halfout
int32_t pv1;
int32_t pv2;
float32_t STR = param_strength + inlet_strength >> 3;
STR = 3 + STR / (1 << 16);
int32_t gain = __USAT(param_gain + inlet_gain, 27);
int32_t in = inlet_in;
in += ___SMMUL(in << 3, gain << 4);
int32_t A = in;
int32_t clipH = param_clipH + inlet_clip - (gain >> 2);
clipH = ___SMMUL(clipH << 3, clipH << 2);
int32_t clipL = param_clipL + inlet_clip - (gain >> 2);
clipL = ___SMMUL(clipL << 3, clipL << 2);
A = A > clipH ? clipH : A;
A = A < -clipL ? -clipL : A;
int32_t B = in - A;
int32_t r1;
if (B > 0) {
SINE2TINTERP(((int32_t)((B >> 5) * STR) << 5) + (1 << 31), r1)
} else {
SINE2TINTERP(((int32_t)((B >> 5) * STR) << 5) - (1 << 31), r1)
}
r1 = (r1 >> 2) / STR;
// r1=___SMMUL(r1>>1,(1<<27)-(param_gain>>2)<<2);
outlet_out = A - r1 >> param_halfout;