Reconstruction from execution with capability of reconstructing simple IF statement and IO:
if ((i*n+j)%20 == 0) fprintf(stderr, "\n")
instrumented to:
if ((TnsMemIter(i)*TnsMemC(n) + TnsMemIter(j))% TnsMemC(20) == TnsMemC(0))  fprintf(stderr, "\n");

The approach might still not work if the IF statement is like the following: