frac32 i0
frac32 i1
frac32 i2
frac32 i3
frac32 o
int32_t prev0;
int32_t prev1;
int32_t prev2;
int32_t prev3;
int src;
if (inlet_i0 != prev0) {
src = 0;
prev0 = inlet_i0;
}
if (inlet_i1 != prev1) {
src = 1;
prev1 = inlet_i1;
}
if (inlet_i2 != prev2) {
src = 2;
prev2 = inlet_i2;
}
if (inlet_i3 != prev3) {
src = 3;
prev3 = inlet_i3;
}
switch (src) {
case 0:
outlet_o = inlet_i0;
break;
case 1:
outlet_o = inlet_i1;
break;
case 2:
outlet_o = inlet_i2;
break;
case 3:
outlet_o = inlet_i3;
break;
default:
outlet_o = inlet_i0;
break;
}