int32 nominator
int32 maxcount
frac32 repeatA
frac32 startA
frac32 widthA
frac32 repeatB
frac32 startB
frac32 widthB
bool32 A
bool32 nA
bool32 B
bool32 nB
bool32 X
bool32 nX
bool32 O
bool32 nO
int32_t a;
int32_t repeatA = ___SMMUL(inlet_repeatA << 3, inlet_maxcount << 2);
int32_t repeatB = ___SMMUL(inlet_repeatB << 3, inlet_maxcount << 2);
a = inlet_count - ___SMMUL(inlet_startA << 3, repeatA << 2);
int32_t r;
if (a >= 0)
r = ((unsigned int)a) / repeatA;
else
r = -(((unsigned int)(repeatA - a)) / repeatA);
int32_t Rem = a - (r * repeatA);
outlet_A = Rem < ___SMMUL(inlet_widthA << 3, repeatA << 2) ? 1 : 0;
outlet_nA = !outlet_A;
a = a + ___SMMUL(inlet_startB << 3, repeatB << 2);
if (a >= 0)
r = ((unsigned int)a) / repeatB;
else
r = -(((unsigned int)(repeatB - a)) / repeatB);
Rem = a - (r * repeatB);
outlet_B = Rem < ___SMMUL(inlet_widthB << 3, repeatB << 2) ? 1 : 0;
outlet_nB = !outlet_B;
outlet_X = outlet_A & outlet_B;
outlet_nX = !outlet_X;
outlet_O = outlet_A || outlet_B;
outlet_nO = !outlet_O;