The reduction writes to out_val_0. But the conditions are still done on clip_count, if the reduction writes to out_val_0 instead of clip_count, then all clip_count occurrences need to be changed, or write to clip_count
Example:

Uncomment reductions and run the compile script.