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