main (gint argc, gchar * * argv)
{
  gchar * D.5973;
  gint D.5974;
  char * optarg.0;
  long unsigned int D.5977;
  long unsigned int D.5978;
  gchar * * D.5979;
  gchar * D.5980;
  char D.5981;
  gchar * * D.5986;
  long unsigned int D.5987;
  long unsigned int D.5988;
  gchar * * D.5989;
  int D.5990;
  gchar * D.5995;
  char D.5996;
  int D.5998;
  struct Test * (*<Te7f>) () D.6003;
  const gchar * D.6005;
  long unsigned int D.6016;
  long unsigned int D.6017;
  gchar * * D.6018;
  gchar * D.6019;
  struct Group * D.6020;
  int D.6023;
  int global_passed.1;
  double D.6029;
  int global_tests.2;
  double D.6031;
  double D.6032;
  char * iftmp.3;
  double D.6039;
  gint i;
  gint j;
  gint c;
  gint iterations;
  struct StringArray * tests_to_run;
  gdouble time_start;
  gboolean report_time;
  gboolean quiet;
  gboolean global_failure;
  gboolean no_final_time_labels;
  gboolean debug;
  static struct option long_options[7] = {{.name=(const char *) "help", .has_arg=0, .flag=0B, .val=104}, {.name=(const char *) "time", .has_arg=0, .flag=0B, .val=116}, {.name=(const char *) "quiet", .has_arg=0, .flag=0B, .val=113}, {.name=(const char *) "iterations", .has_arg=1, .flag=0B, .val=105}, {.name=(const char *) "debug", .has_arg=0, .flag=0B, .val=100}, {.name=(const char *) "no-labels", .has_arg=0, .flag=0B, .val=110}, {.name=0B, .has_arg=0, .flag=0B, .val=0}};

  iterations = 1;
  tests_to_run = 0B;
  report_time = 0;
  quiet = 0;
  global_failure = 0;
  no_final_time_labels = 0;
  debug = 0;
  goto <D.5931>;
  <D.5930>:
  switch (c) <default: <D.5976>, case 100: <D.5929>, case 104: <D.5923>, case 105: <D.5926>, case 110: <D.5928>, case 113: <D.5927>, case 116: <D.5924>>
  <D.5923>:
  D.5973 = *argv;
  print_help (D.5973);
  D.5974 = 1;
  return D.5974;
  <D.5924>:
  report_time = 1;
  goto <D.5925>;
  <D.5926>:
  optarg.0 = optarg;
  iterations = atoi (optarg.0);
  goto <D.5925>;
  <D.5927>:
  quiet = 1;
  goto <D.5925>;
  <D.5928>:
  no_final_time_labels = 1;
  goto <D.5925>;
  <D.5929>:
  debug = 1;
  goto <D.5925>;
  <D.5976>:
  <D.5925>:
  <D.5931>:
  c = getopt_long (argc, argv, "dhtqni:", &long_options, 0B);
  if (c != -1) goto <D.5930>; else goto <D.5932>;
  <D.5932>:
  i = optind;
  goto <D.5935>;
  <D.5934>:
  D.5977 = (long unsigned int) i;
  D.5978 = D.5977 * 8;
  D.5979 = argv + D.5978;
  D.5980 = *D.5979;
  D.5981 = *D.5980;
  if (D.5981 == 45) goto <D.5982>; else goto <D.5983>;
  <D.5982>:
  // predicted unlikely by continue predictor.
  goto <D.5933>;
  <D.5983>:
  D.5977 = (long unsigned int) i;
  D.5978 = D.5977 * 8;
  D.5979 = argv + D.5978;
  D.5980 = *D.5979;
  tests_to_run = string_array_append (tests_to_run, D.5980);
  <D.5933>:
  i = i + 1;
  <D.5935>:
  if (i < argc) goto <D.5934>; else goto <D.5936>;
  <D.5936>:
  time_start = get_timestamp ();
  j = 0;
  goto <D.5968>;
  <D.5967>:
  {
    gboolean run;
    gchar * tests;
    gchar * group;

    run = 1;
    tests = 0B;
    group = 0B;
    if (tests_to_run != 0B) goto <D.5984>; else goto <D.5985>;
    <D.5984>:
    {
      gint k;

      run = 0;
      k = 0;
      goto <D.5956>;
      <D.5955>:
      {
        gchar * user;
        const gchar * table;
        size_t user_len;
        size_t table_len;

        D.5986 = tests_to_run->strings;
        D.5987 = (long unsigned int) k;
        D.5988 = D.5987 * 8;
        D.5989 = D.5986 + D.5988;
        user = *D.5989;
        table = test_groups[j].name;
        user_len = strlen (user);
        table_len = strlen (table);
        D.5990 = strncmp (user, table, table_len);
        if (D.5990 == 0) goto <D.5991>; else goto <D.5992>;
        <D.5991>:
        if (user_len > table_len) goto <D.5993>; else goto <D.5994>;
        <D.5993>:
        D.5995 = user + table_len;
        D.5996 = *D.5995;
        if (D.5996 != 58) goto <D.5954>; else goto <D.5997>;
        <D.5997>:
        <D.5994>:
        run = 1;
        D.5986 = tests_to_run->strings;
        D.5987 = (long unsigned int) k;
        D.5988 = D.5987 * 8;
        D.5989 = D.5986 + D.5988;
        group = *D.5989;
        goto <D.5954>;
        <D.5992>:
      }
      k = k + 1;
      <D.5956>:
      D.5998 = tests_to_run->length;
      if (D.5998 > k) goto <D.5955>; else goto <D.5954>;
      <D.5954>:
    }
    <D.5985>:
    if (run != 0) goto <D.5999>; else goto <D.6000>;
    <D.5999>:
    {
      gboolean passed;
      gchar * * split;

      split = 0B;
      if (debug != 0) goto <D.6002>; else goto <D.6001>;
      <D.6002>:
      D.6003 = test_groups[j].handler;
      if (D.6003 != fake_tests_init) goto <D.6004>; else goto <D.6001>;
      <D.6004>:
      D.6005 = test_groups[j].name;
      printf ("Skipping %s, in driver debug mode\n", D.6005);
      // predicted unlikely by continue predictor.
      goto <D.5959>;
      <D.6001>:
      if (debug == 0) goto <D.6006>; else goto <D.6007>;
      <D.6006>:
      D.6003 = test_groups[j].handler;
      if (D.6003 == fake_tests_init) goto <D.6008>; else goto <D.6009>;
      <D.6008>:
      // predicted unlikely by continue predictor.
      goto <D.5959>;
      <D.6009>:
      <D.6007>:
      if (group != 0B) goto <D.6010>; else goto <D.6011>;
      <D.6010>:
      split = eg_strsplit (group, ":", -1);
      if (split != 0B) goto <D.6012>; else goto <D.6013>;
      <D.6012>:
      {
        gint m;

        m = 0;
        goto <D.5966>;
        <D.5965>:
        if (m == 1) goto <D.6014>; else goto <D.6015>;
        <D.6014>:
        D.6016 = (long unsigned int) m;
        D.6017 = D.6016 * 8;
        D.6018 = split + D.6017;
        D.6019 = *D.6018;
        tests = __strdup (D.6019);
        goto <D.5964>;
        <D.6015>:
        m = m + 1;
        <D.5966>:
        D.6016 = (long unsigned int) m;
        D.6017 = D.6016 * 8;
        D.6018 = split + D.6017;
        D.6019 = *D.6018;
        if (D.6019 != 0B) goto <D.5965>; else goto <D.5964>;
        <D.5964>:
        eg_strfreev (split);
      }
      <D.6013>:
      <D.6011>:
      D.6020 = &test_groups[j];
      passed = run_group (D.6020, iterations, quiet, report_time, tests);
      if (tests != 0B) goto <D.6021>; else goto <D.6022>;
      <D.6021>:
      monoeg_g_free (tests);
      <D.6022>:
      D.6023 = passed | global_failure;
      if (D.6023 == 0) goto <D.6024>; else goto <D.6025>;
      <D.6024>:
      global_failure = 1;
      <D.6025>:
    }
    <D.6000>:
  }
  <D.5959>:
  j = j + 1;
  <D.5968>:
  D.6005 = test_groups[j].name;
  if (D.6005 != 0B) goto <D.5967>; else goto <D.5969>;
  <D.5969>:
  if (quiet == 0) goto <D.6026>; else goto <D.6027>;
  <D.6026>:
  {
    gdouble pass_percentage;

    global_passed.1 = global_passed;
    D.6029 = (double) global_passed.1;
    global_tests.2 = global_tests;
    D.6031 = (double) global_tests.2;
    D.6032 = D.6029 / D.6031;
    pass_percentage = D.6032 * 1.0e+2;
    printf ("=============================\n");
    global_tests.2 = global_tests;
    global_passed.1 = global_passed;
    if (global_failure != 0) goto <D.6034>; else goto <D.6035>;
    <D.6034>:
    iftmp.3 = "FAILED";
    goto <D.6036>;
    <D.6035>:
    iftmp.3 = "OK";
    <D.6036>:
    printf ("Overall result: %s : %d / %d (%g%%)\n", iftmp.3, global_passed.1, global_tests.2, pass_percentage);
  }
  <D.6027>:
  if (report_time != 0) goto <D.6037>; else goto <D.6038>;
  <D.6037>:
  {
    gdouble duration;

    D.6039 = get_timestamp ();
    duration = D.6039 - time_start;
    if (no_final_time_labels != 0) goto <D.6040>; else goto <D.6041>;
    <D.6040>:
    printf ("%g\n", duration);
    goto <D.6042>;
    <D.6041>:
    printf ("%s Total Time: %g\n", "EGlib", duration);
    <D.6042>:
  }
  <D.6038>:
  if (tests_to_run != 0B) goto <D.6043>; else goto <D.6044>;
  <D.6043>:
  string_array_free (tests_to_run);
  <D.6044>:
  global_tests.2 = global_tests;
  global_passed.1 = global_passed;
  D.5974 = global_tests.2 - global_passed.1;
  return D.5974;
}


print_help (char * s)
{
  struct Test * (*<Te7f>) () D.6046;
  const gchar * D.6049;
  gint i;

  printf ("Usage: %s [OPTION]... [TESTGROUP]...\n\n", s);
  printf ("OPTIONS are:\n");
  printf ("  -h, --help          show this help\n");
  printf ("  -t, --time          time the tests\n");
  printf ("  -i, --iterations    number of times to run tests\n");
  printf ("  -q, --quiet         do not print test results; final time always prints\n");
  printf ("  -n, --no-labels     print final time without labels, nice for scripts\n");
  printf ("  -d, --debug         do not run tests, debug the driver itself for valgrind\n\n");
  printf ("TESTGROUPS available:\n");
  i = 0;
  goto <D.5905>;
  <D.5904>:
  D.6046 = test_groups[i].handler;
  if (D.6046 != fake_tests_init) goto <D.6047>; else goto <D.6048>;
  <D.6047>:
  D.6049 = test_groups[i].name;
  printf ("  %s\n", D.6049);
  <D.6048>:
  i = i + 1;
  <D.5905>:
  D.6049 = test_groups[i].name;
  if (D.6049 != 0B) goto <D.5904>; else goto <D.5906>;
  <D.5906>:
  printf ("\n");
}


atoi (const char * __nptr)
{
  int D.6050;
  long int D.6051;

  D.6051 = strtol (__nptr, 0B, 10);
  D.6050 = (int) D.6051;
  return D.6050;
}


string_array_append (struct StringArray * array, gchar * string)
{
  void * D.6055;
  int D.6057;
  int D.6058;
  int D.6059;
  long unsigned int D.6060;
  long unsigned int D.6061;
  gchar * * D.6062;
  void * D.6063;
  long unsigned int D.6064;
  long unsigned int D.6065;
  sizetype D.6066;
  gchar * * D.6067;
  gchar * * D.6068;
  struct StringArray * D.6069;

  if (array == 0B) goto <D.6053>; else goto <D.6054>;
  <D.6053>:
  array = monoeg_malloc0 (16);
  array->length = 1;
  D.6055 = monoeg_malloc (16);
  array->strings = D.6055;
  goto <D.6056>;
  <D.6054>:
  D.6057 = array->length;
  D.6058 = D.6057 + 1;
  array->length = D.6058;
  D.6057 = array->length;
  D.6059 = D.6057 + 1;
  D.6060 = (long unsigned int) D.6059;
  D.6061 = D.6060 * 8;
  D.6062 = array->strings;
  D.6063 = monoeg_realloc (D.6062, D.6061);
  array->strings = D.6063;
  <D.6056>:
  D.6062 = array->strings;
  D.6057 = array->length;
  D.6064 = (long unsigned int) D.6057;
  D.6065 = D.6064 * 8;
  D.6066 = D.6065 + 18446744073709551608;
  D.6067 = D.6062 + D.6066;
  *D.6067 = string;
  D.6062 = array->strings;
  D.6057 = array->length;
  D.6064 = (long unsigned int) D.6057;
  D.6065 = D.6064 * 8;
  D.6068 = D.6062 + D.6065;
  *D.6068 = 0B;
  D.6069 = array;
  return D.6069;
}


printf (const char * restrict __fmt)
{
  int D.6071;

  D.6071 = __printf_chk (1, __fmt, __builtin_va_arg_pack ());
  return D.6071;
}


string_array_free (struct StringArray * array)
{
  gchar * * D.6073;

  D.6073 = array->strings;
  monoeg_g_free (D.6073);
  monoeg_g_free (array);
}


