#include "loopCount.hpp" long run5Count(int n, int * ACt, int * BCr, int * SCt, int * MCt, int * PCt) { *ACt = *BCr = *SCt = *MCt = *PCt = 0; int i, j; long sum = 0; ++(*ACt); /* line 1 */ for (i = 1, ++(*ACt) ; (i <= n)&&(++(*BCr)) ; i++, ++(*PCt)) { /* line 2 */ for (j = i-1, ++(*ACt), ++(*SCt); (++(*BCr))&&(++(*SCt))&&(j<=i+3); j++, ++(*PCt)) { /* line 3 */ sum++; ++(*PCt); /* line 4 */ } } return sum; }