#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

int a = 0;
int verbose = 0;

void incr (void)
{
  a++;
}

int function_name (void)
{
  if (verbose)
    fprintf(stderr, "FUNCTION EXECUTED. VALUE = %i\n", a);
}

int main (int argc, char **argv)
{
  int n = 10, i;
  FILE *f = fopen ("RESULT.log", "w");
  for (i = 1; i < argc; i++)
    {
      if (strcmp (argv[i], "-v") == 0)
	verbose = 1;
      else if ((n = atoi(argv[i])) <= 0)
	{
	  fprintf (stderr, "Usage: %s [-v] N\n", argv[0]);
	  exit (1);
	}
    }
	
  for (i = 0; i < n; i++)
    {
      function_name ();
      sleep(3);
    }
	
  if (a)
    fprintf (f, "MUTATION OK.\n");
  else
    fprintf (f, "MUTATION FAILED.\n");

  fclose (f);
  return !a;
}
