static unsigned short countdown; static unsigned short *bufr; static unsigned long maxidx; static unsigned long off; static unsigned long shift_val; void f() { unsigned long v; if(--countdown > 0) return; countdown = 4; v = v - off; if( v < off) return; v = v >> shift_val; if(v > maxidx) return; bufr[v]++; }