bool32 trig
int32 i1
int32 o
int32 a
frac32.s.map prob
int32_t val;
int ntrig;
int mtrig;
int otrig;
int prob1;
int prob2;
int latch1;
int latch2;
val = (int32_t)(GenerateRandomNumber()) >> 4;
ntrig = 0;
mtrig = 0;
otrig = 0;
prob1 = 0;
prob2 = 0;
latch1 = 0;
latch2 = 0;
if ((inlet_trig > 0) && !ntrig) {
val = (int32_t)(GenerateRandomNumber()) >> 4;
ntrig = 1;
} else if (!(inlet_trig > 0))
ntrig = 0;
prob1 = ((val >= param_prob)) ? inlet_i1 : 0;
prob2 = ((val < param_prob)) ? inlet_i1 : 0;
if ((prob1 != 0) && !mtrig) {
latch1 = prob1;
mtrig = 1;
} else
mtrig = 0;
outlet_o = latch1 - 1;
if ((prob2 != 0) && !otrig) {
latch2 = prob2;
otrig = 1;
} else
otrig = 0;
outlet_a = latch2 - 1;