volatile int entropy; int interval(int a, int b) { int tmp = entropy; if (tmp <= a) { tmp = a; } if (tmp >= b) { tmp = b; } return tmp; }