mono_portability_helpers_init ()
{
  int __mono_io_portability_helpers.0;
  long unsigned int D.17379;
  long unsigned int D.17380;
  gchar * * D.17381;
  gchar * D.17382;
  int D.17383;
  int __mono_io_portability_helpers.1;
  int D.17388;
  int __mono_io_portability_helpers.2;
  int D.17393;
  int __mono_io_portability_helpers.3;
  const gchar * env;

  __mono_io_portability_helpers.0 = __mono_io_portability_helpers;
  if (__mono_io_portability_helpers.0 != 1) goto <D.17373>; else goto <D.17374>;
  <D.17373>:
  return;
  <D.17374>:
  __mono_io_portability_helpers = 0;
  env = monoeg_g_getenv ("MONO_IOMAP");
  if (env != 0B) goto <D.17375>; else goto <D.17376>;
  <D.17375>:
  {
    gchar * * options;
    int i;

    options = monoeg_g_strsplit (env, ":", 0);
    if (options == 0B) goto <D.17377>; else goto <D.17378>;
    <D.17377>:
    return;
    <D.17378>:
    i = 0;
    goto <D.17288>;
    <D.17287>:
    D.17379 = (long unsigned int) i;
    D.17380 = D.17379 * 8;
    D.17381 = options + D.17380;
    D.17382 = *D.17381;
    D.17383 = strncasecmp (D.17382, "drive", 5);
    if (D.17383 == 0) goto <D.17384>; else goto <D.17385>;
    <D.17384>:
    __mono_io_portability_helpers.0 = __mono_io_portability_helpers;
    __mono_io_portability_helpers.1 = __mono_io_portability_helpers.0 | 2;
    __mono_io_portability_helpers = __mono_io_portability_helpers.1;
    goto <D.17387>;
    <D.17385>:
    D.17379 = (long unsigned int) i;
    D.17380 = D.17379 * 8;
    D.17381 = options + D.17380;
    D.17382 = *D.17381;
    D.17388 = strncasecmp (D.17382, "case", 4);
    if (D.17388 == 0) goto <D.17389>; else goto <D.17390>;
    <D.17389>:
    __mono_io_portability_helpers.0 = __mono_io_portability_helpers;
    __mono_io_portability_helpers.2 = __mono_io_portability_helpers.0 | 4;
    __mono_io_portability_helpers = __mono_io_portability_helpers.2;
    goto <D.17392>;
    <D.17390>:
    D.17379 = (long unsigned int) i;
    D.17380 = D.17379 * 8;
    D.17381 = options + D.17380;
    D.17382 = *D.17381;
    D.17393 = strncasecmp (D.17382, "all", 3);
    if (D.17393 == 0) goto <D.17394>; else goto <D.17395>;
    <D.17394>:
    __mono_io_portability_helpers.0 = __mono_io_portability_helpers;
    __mono_io_portability_helpers.3 = __mono_io_portability_helpers.0 | 6;
    __mono_io_portability_helpers = __mono_io_portability_helpers.3;
    <D.17395>:
    <D.17392>:
    <D.17387>:
    i = i + 1;
    <D.17288>:
    D.17379 = (long unsigned int) i;
    D.17380 = D.17379 * 8;
    D.17381 = options + D.17380;
    D.17382 = *D.17381;
    if (D.17382 != 0B) goto <D.17287>; else goto <D.17289>;
    <D.17289>:
  }
  <D.17376>:
}


mono_portability_find_file (const gchar * pathname, gboolean last_exists)
{
  char D.17401;
  gchar * D.17402;
  struct GString * report.4;
  struct GString * report;
  gchar * ret;

  try
    {
      report = 0B;
      if (pathname == 0B) goto <D.17398>; else goto <D.17400>;
      <D.17400>:
      D.17401 = *pathname;
      if (D.17401 == 0) goto <D.17398>; else goto <D.17399>;
      <D.17398>:
      D.17402 = 0B;
      return D.17402;
      <D.17399>:
      ret = mono_portability_find_file_internal (&report, pathname, last_exists);
      report.4 = report;
      if (report.4 != 0B) goto <D.17404>; else goto <D.17405>;
      <D.17404>:
      report.4 = report;
      monoeg_g_string_free (report.4, 1);
      <D.17405>:
      D.17402 = ret;
      return D.17402;
    }
  finally
    {
      report = {CLOBBER};
    }
}


mono_portability_find_file_internal (struct GString * * report, const gchar * pathname, gboolean last_exists)
{
  <unnamed type> D.17408;
  unsigned int D.17409;
  _Bool D.17410;
  gchar * D.17413;
  int D.17418;
  int __mono_io_portability_helpers.5;
  int D.17422;
  const short unsigned int * * D.17425;
  const short unsigned int * D.17426;
  char D.17427;
  long unsigned int D.17428;
  long unsigned int D.17429;
  const short unsigned int * D.17430;
  short unsigned int D.17431;
  int D.17432;
  int D.17433;
  gchar * D.17436;
  char D.17437;
  long unsigned int D.17440;
  const void * D.17441;
  int D.17442;
  long unsigned int D.17443;
  sizetype D.17444;
  sizetype D.17445;
  gchar * D.17446;
  sizetype D.17451;
  gchar * D.17452;
  char D.17453;
  int D.17458;
  int D.17465;
  long unsigned int D.17470;
  long unsigned int D.17471;
  gchar * * D.17472;
  gchar * D.17473;
  int D.17476;
  long unsigned int D.17477;
  long unsigned int D.17478;
  int D.17343;
  int iftmp.6;
  int D.17342;
  const char[1] * D.17484;
  unsigned char D.17485;
  int D.17486;
  unsigned char D.17487;
  int D.17488;
  const unsigned char * D.17493;
  unsigned char D.17494;
  int D.17495;
  const unsigned char * D.17496;
  unsigned char D.17497;
  int D.17498;
  const unsigned char * D.17503;
  unsigned char D.17504;
  int D.17505;
  const unsigned char * D.17506;
  unsigned char D.17507;
  int D.17508;
  const unsigned char * D.17513;
  unsigned char D.17514;
  int D.17515;
  const unsigned char * D.17516;
  unsigned char D.17517;
  int D.17518;
  gchar * D.17520;
  unsigned char D.17521;
  int component.7;
  long unsigned int D.17527;
  long unsigned int D.17528;
  gchar * * D.17529;
  gchar * D.17530;
  int component.8;
  long unsigned int D.17539;
  long unsigned int D.17540;
  gchar * * D.17541;
  int D.17354;
  int iftmp.9;
  int D.17353;
  unsigned char D.17548;
  int D.17549;
  const unsigned char * D.17554;
  unsigned char D.17555;
  int D.17556;
  const unsigned char * D.17561;
  unsigned char D.17562;
  int D.17563;
  const unsigned char * D.17568;
  unsigned char D.17569;
  int D.17570;
  int component.10;
  long unsigned int D.17575;
  long unsigned int D.17576;
  gchar * * D.17577;
  gchar * D.17578;
  int component.11;
  long unsigned int D.17585;
  long unsigned int D.17586;
  gchar * * D.17587;
  int component.12;
  long unsigned int D.17590;
  long unsigned int D.17591;
  gchar * * D.17592;
  gchar * D.17593;
  _Bool D.17594;
  long int D.17595;
  long int D.17596;
  int D.17602;
  long unsigned int D.17604;
  long unsigned int D.17605;
  gchar * * D.17606;
  gchar * D.17607;
  gchar * * D.17610;
  int D.17619;
  int D.17370;
  gchar * new_pathname;
  gchar * * components;
  gchar * * new_components;
  int num_components;
  int component;
  struct DIR * scanning;
  size_t len;
  gboolean drive_stripped;
  gboolean do_report;

  num_components = 0;
  component = 0;
  scanning = 0B;
  drive_stripped = 0;
  D.17408 = mono_profiler_get_events ();
  D.17409 = D.17408 & 262144;
  D.17410 = D.17409 != 0;
  do_report = (gboolean) D.17410;
  if (0 != 0) goto <D.17411>; else goto <D.17412>;
  <D.17411>:
  D.17413 = 0B;
  return D.17413;
  <D.17412>:
  if (do_report != 0) goto <D.17414>; else goto <D.17415>;
  <D.17414>:
  append_report (report, " - Requested file path: \'%s\'\n", pathname);
  <D.17415>:
  new_pathname = monoeg_strdup (pathname);
  if (last_exists != 0) goto <D.17416>; else goto <D.17417>;
  <D.17416>:
  D.17418 = access (new_pathname, 0);
  if (D.17418 == 0) goto <D.17419>; else goto <D.17420>;
  <D.17419>:
  D.17413 = new_pathname;
  return D.17413;
  <D.17420>:
  <D.17417>:
  monoeg_g_strdelimit (new_pathname, "\\", 47);
  __mono_io_portability_helpers.5 = __mono_io_portability_helpers;
  D.17422 = __mono_io_portability_helpers.5 & 2;
  if (D.17422 != 0) goto <D.17423>; else goto <D.17424>;
  <D.17423>:
  D.17425 = __ctype_b_loc ();
  D.17426 = *D.17425;
  D.17427 = *new_pathname;
  D.17428 = (long unsigned int) D.17427;
  D.17429 = D.17428 * 2;
  D.17430 = D.17426 + D.17429;
  D.17431 = *D.17430;
  D.17432 = (int) D.17431;
  D.17433 = D.17432 & 1024;
  if (D.17433 != 0) goto <D.17434>; else goto <D.17435>;
  <D.17434>:
  D.17436 = new_pathname + 1;
  D.17437 = *D.17436;
  if (D.17437 == 58) goto <D.17438>; else goto <D.17439>;
  <D.17438>:
  {
    int len;

    D.17440 = strlen (new_pathname);
    len = (int) D.17440;
    D.17441 = new_pathname + 2;
    D.17442 = len + -2;
    D.17443 = (long unsigned int) D.17442;
    memmove (new_pathname, D.17441, D.17443);
    D.17444 = (sizetype) len;
    D.17445 = D.17444 + 18446744073709551614;
    D.17446 = new_pathname + D.17445;
    *D.17446 = 0;
    if (do_report != 0) goto <D.17447>; else goto <D.17448>;
    <D.17447>:
    append_report (report, " - Stripped drive letter.\n");
    drive_stripped = 1;
    <D.17448>:
  }
  <D.17439>:
  <D.17435>:
  <D.17424>:
  len = strlen (new_pathname);
  if (len > 1) goto <D.17449>; else goto <D.17450>;
  <D.17449>:
  D.17451 = len + 18446744073709551615;
  D.17452 = new_pathname + D.17451;
  D.17453 = *D.17452;
  if (D.17453 == 47) goto <D.17454>; else goto <D.17455>;
  <D.17454>:
  D.17451 = len + 18446744073709551615;
  D.17452 = new_pathname + D.17451;
  *D.17452 = 0;
  <D.17455>:
  <D.17450>:
  if (last_exists != 0) goto <D.17456>; else goto <D.17457>;
  <D.17456>:
  D.17458 = access (new_pathname, 0);
  if (D.17458 == 0) goto <D.17459>; else goto <D.17460>;
  <D.17459>:
  if (do_report != 0) goto <D.17461>; else goto <D.17462>;
  <D.17461>:
  if (drive_stripped != 0) goto <D.17463>; else goto <D.17464>;
  <D.17463>:
  do_mono_profiler_iomap (report, pathname, new_pathname);
  <D.17464>:
  <D.17462>:
  D.17413 = new_pathname;
  return D.17413;
  <D.17460>:
  <D.17457>:
  __mono_io_portability_helpers.5 = __mono_io_portability_helpers;
  D.17465 = __mono_io_portability_helpers.5 & 4;
  if (D.17465 == 0) goto <D.17466>; else goto <D.17467>;
  <D.17466>:
  monoeg_g_free (new_pathname);
  D.17413 = 0B;
  return D.17413;
  <D.17467>:
  components = monoeg_g_strsplit (new_pathname, "/", 0);
  if (components == 0B) goto <D.17468>; else goto <D.17469>;
  <D.17468>:
  monoeg_g_free (new_pathname);
  D.17413 = 0B;
  return D.17413;
  <D.17469>:
  goto <D.17333>;
  <D.17332>:
  num_components = num_components + 1;
  <D.17333>:
  D.17470 = (long unsigned int) num_components;
  D.17471 = D.17470 * 8;
  D.17472 = components + D.17471;
  D.17473 = *D.17472;
  if (D.17473 != 0B) goto <D.17332>; else goto <D.17334>;
  <D.17334>:
  monoeg_g_free (new_pathname);
  if (num_components == 0) goto <D.17474>; else goto <D.17475>;
  <D.17474>:
  D.17413 = 0B;
  return D.17413;
  <D.17475>:
  D.17476 = num_components + 1;
  D.17477 = (long unsigned int) D.17476;
  D.17478 = D.17477 * 8;
  new_components = monoeg_malloc0 (D.17478);
  if (num_components > 1) goto <D.17479>; else goto <D.17480>;
  <D.17479>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 0;
    if (__s2_len <= 3) goto <D.17482>; else goto <D.17483>;
    <D.17482>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = *components;
      D.17484 = "";
      D.17485 = MEM[(const unsigned char *)D.17484];
      D.17486 = (int) D.17485;
      D.17487 = *__s2;
      D.17488 = (int) D.17487;
      __result = D.17486 - D.17488;
      {
        if (__s2_len != 0) goto <D.17489>; else goto <D.17490>;
        <D.17489>:
        if (__result == 0) goto <D.17491>; else goto <D.17492>;
        <D.17491>:
        D.17493 = &MEM[(void *)"" + 1B];
        D.17494 = *D.17493;
        D.17495 = (int) D.17494;
        D.17496 = __s2 + 1;
        D.17497 = *D.17496;
        D.17498 = (int) D.17497;
        __result = D.17495 - D.17498;
        if (__s2_len > 1) goto <D.17499>; else goto <D.17500>;
        <D.17499>:
        if (__result == 0) goto <D.17501>; else goto <D.17502>;
        <D.17501>:
        D.17503 = &MEM[(void *)"" + 2B];
        D.17504 = *D.17503;
        D.17505 = (int) D.17504;
        D.17506 = __s2 + 2;
        D.17507 = *D.17506;
        D.17508 = (int) D.17507;
        __result = D.17505 - D.17508;
        if (__s2_len > 2) goto <D.17509>; else goto <D.17510>;
        <D.17509>:
        if (__result == 0) goto <D.17511>; else goto <D.17512>;
        <D.17511>:
        D.17513 = &MEM[(void *)"" + 3B];
        D.17514 = *D.17513;
        D.17515 = (int) D.17514;
        D.17516 = __s2 + 3;
        D.17517 = *D.17516;
        D.17518 = (int) D.17517;
        __result = D.17515 - D.17518;
        <D.17512>:
        <D.17510>:
        <D.17502>:
        <D.17500>:
        <D.17492>:
        <D.17490>:
      }
      D.17342 = __result;
    }
    iftmp.6 = -D.17342;
    goto <D.17519>;
    <D.17483>:
    D.17520 = *components;
    D.17521 = MEM[(const unsigned char * {ref-all})D.17520];
    iftmp.6 = (int) D.17521;
    <D.17519>:
    D.17343 = iftmp.6;
  }
  if (D.17343 == 0) goto <D.17522>; else goto <D.17523>;
  <D.17522>:
  scanning = opendir ("/");
  if (scanning == 0B) goto <D.17524>; else goto <D.17525>;
  <D.17524>:
  monoeg_g_strfreev (new_components);
  monoeg_g_strfreev (components);
  D.17413 = 0B;
  return D.17413;
  <D.17525>:
  component.7 = component;
  component = component.7 + 1;
  D.17527 = (long unsigned int) component.7;
  D.17528 = D.17527 * 8;
  D.17529 = new_components + D.17528;
  D.17530 = monoeg_strdup ("");
  *D.17529 = D.17530;
  goto <D.17531>;
  <D.17523>:
  {
    struct DIR * current;
    gchar * entry;

    current = opendir (".");
    if (current == 0B) goto <D.17532>; else goto <D.17533>;
    <D.17532>:
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17533>:
    D.17520 = *components;
    entry = find_in_dir (current, D.17520);
    if (entry == 0B) goto <D.17534>; else goto <D.17535>;
    <D.17534>:
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17535>:
    scanning = opendir (entry);
    if (scanning == 0B) goto <D.17536>; else goto <D.17537>;
    <D.17536>:
    monoeg_g_free (entry);
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17537>:
    component.8 = component;
    component = component.8 + 1;
    D.17539 = (long unsigned int) component.8;
    D.17540 = D.17539 * 8;
    D.17541 = new_components + D.17540;
    *D.17541 = entry;
  }
  <D.17531>:
  goto <D.17542>;
  <D.17480>:
  if (last_exists != 0) goto <D.17543>; else goto <D.17544>;
  <D.17543>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 0;
    if (__s2_len <= 3) goto <D.17546>; else goto <D.17547>;
    <D.17546>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = *components;
      D.17484 = "";
      D.17485 = MEM[(const unsigned char *)D.17484];
      D.17486 = (int) D.17485;
      D.17548 = *__s2;
      D.17549 = (int) D.17548;
      __result = D.17486 - D.17549;
      {
        if (__s2_len != 0) goto <D.17550>; else goto <D.17551>;
        <D.17550>:
        if (__result == 0) goto <D.17552>; else goto <D.17553>;
        <D.17552>:
        D.17493 = &MEM[(void *)"" + 1B];
        D.17494 = *D.17493;
        D.17495 = (int) D.17494;
        D.17554 = __s2 + 1;
        D.17555 = *D.17554;
        D.17556 = (int) D.17555;
        __result = D.17495 - D.17556;
        if (__s2_len > 1) goto <D.17557>; else goto <D.17558>;
        <D.17557>:
        if (__result == 0) goto <D.17559>; else goto <D.17560>;
        <D.17559>:
        D.17503 = &MEM[(void *)"" + 2B];
        D.17504 = *D.17503;
        D.17505 = (int) D.17504;
        D.17561 = __s2 + 2;
        D.17562 = *D.17561;
        D.17563 = (int) D.17562;
        __result = D.17505 - D.17563;
        if (__s2_len > 2) goto <D.17564>; else goto <D.17565>;
        <D.17564>:
        if (__result == 0) goto <D.17566>; else goto <D.17567>;
        <D.17566>:
        D.17513 = &MEM[(void *)"" + 3B];
        D.17514 = *D.17513;
        D.17515 = (int) D.17514;
        D.17568 = __s2 + 3;
        D.17569 = *D.17568;
        D.17570 = (int) D.17569;
        __result = D.17515 - D.17570;
        <D.17567>:
        <D.17565>:
        <D.17560>:
        <D.17558>:
        <D.17553>:
        <D.17551>:
      }
      D.17353 = __result;
    }
    iftmp.9 = -D.17353;
    goto <D.17571>;
    <D.17547>:
    D.17520 = *components;
    D.17521 = MEM[(const unsigned char * {ref-all})D.17520];
    iftmp.9 = (int) D.17521;
    <D.17571>:
    D.17354 = iftmp.9;
  }
  if (D.17354 == 0) goto <D.17572>; else goto <D.17573>;
  <D.17572>:
  component.10 = component;
  component = component.10 + 1;
  D.17575 = (long unsigned int) component.10;
  D.17576 = D.17575 * 8;
  D.17577 = new_components + D.17576;
  D.17578 = monoeg_strdup ("");
  *D.17577 = D.17578;
  goto <D.17579>;
  <D.17573>:
  {
    struct DIR * current;
    gchar * entry;

    current = opendir (".");
    if (current == 0B) goto <D.17580>; else goto <D.17581>;
    <D.17580>:
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17581>:
    D.17520 = *components;
    entry = find_in_dir (current, D.17520);
    if (entry == 0B) goto <D.17582>; else goto <D.17583>;
    <D.17582>:
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17583>:
    component.11 = component;
    component = component.11 + 1;
    D.17585 = (long unsigned int) component.11;
    D.17586 = D.17585 * 8;
    D.17587 = new_components + D.17586;
    *D.17587 = entry;
  }
  <D.17579>:
  goto <D.17588>;
  <D.17544>:
  component.12 = component;
  component = component.12 + 1;
  D.17590 = (long unsigned int) component.12;
  D.17591 = D.17590 * 8;
  D.17592 = new_components + D.17591;
  D.17520 = *components;
  D.17593 = monoeg_strdup (D.17520);
  *D.17592 = D.17593;
  <D.17588>:
  <D.17542>:
  D.17594 = component != 1;
  D.17595 = (long int) D.17594;
  D.17596 = __builtin_expect (D.17595, 0);
  if (D.17596 != 0) goto <D.17597>; else goto <D.17598>;
  <D.17597>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "mono-io-portability.c", 343, "component == 1");
  <D.17598>:
  goto <D.17360>;
  <D.17359>:
  {
    gchar * entry;
    gchar * path_so_far;

    if (last_exists == 0) goto <D.17601>; else goto <D.17599>;
    <D.17601>:
    D.17602 = num_components + -1;
    if (D.17602 == component) goto <D.17603>; else goto <D.17599>;
    <D.17603>:
    D.17604 = (long unsigned int) component;
    D.17605 = D.17604 * 8;
    D.17606 = components + D.17605;
    D.17607 = *D.17606;
    entry = monoeg_strdup (D.17607);
    closedir (scanning);
    goto <D.17600>;
    <D.17599>:
    D.17604 = (long unsigned int) component;
    D.17605 = D.17604 * 8;
    D.17606 = components + D.17605;
    D.17607 = *D.17606;
    entry = find_in_dir (scanning, D.17607);
    if (entry == 0B) goto <D.17608>; else goto <D.17609>;
    <D.17608>:
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17609>:
    <D.17600>:
    D.17604 = (long unsigned int) component;
    D.17605 = D.17604 * 8;
    D.17610 = new_components + D.17605;
    *D.17610 = entry;
    D.17602 = num_components + -1;
    if (D.17602 > component) goto <D.17611>; else goto <D.17612>;
    <D.17611>:
    path_so_far = monoeg_g_strjoinv ("/", new_components);
    scanning = opendir (path_so_far);
    monoeg_g_free (path_so_far);
    if (scanning == 0B) goto <D.17613>; else goto <D.17614>;
    <D.17613>:
    monoeg_g_strfreev (new_components);
    monoeg_g_strfreev (components);
    D.17413 = 0B;
    return D.17413;
    <D.17614>:
    <D.17612>:
  }
  component = component + 1;
  <D.17360>:
  if (component < num_components) goto <D.17359>; else goto <D.17361>;
  <D.17361>:
  monoeg_g_strfreev (components);
  new_pathname = monoeg_g_strjoinv ("/", new_components);
  monoeg_g_strfreev (new_components);
  if (last_exists != 0) goto <D.17618>; else goto <D.17615>;
  <D.17618>:
  D.17619 = access (new_pathname, 0);
  if (D.17619 == 0) goto <D.17616>; else goto <D.17615>;
  <D.17615>:
  if (last_exists == 0) goto <D.17616>; else goto <D.17617>;
  <D.17616>:
  if (do_report != 0) goto <D.17620>; else goto <D.17621>;
  <D.17620>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.17370 = __builtin_strcmp (pathname, new_pathname);
  }
  if (D.17370 != 0) goto <D.17622>; else goto <D.17623>;
  <D.17622>:
  do_mono_profiler_iomap (report, pathname, new_pathname);
  <D.17623>:
  <D.17621>:
  D.17413 = new_pathname;
  return D.17413;
  <D.17617>:
  monoeg_g_free (new_pathname);
  D.17413 = 0B;
  return D.17413;
}


memmove (void * __dest, const void * __src, size_t __len)
{
  void * D.17625;
  long unsigned int D.17626;

  D.17626 = __builtin_object_size (__dest, 0);
  D.17625 = __builtin___memmove_chk (__dest, __src, __len, D.17626);
  return D.17625;
}


append_report (struct GString * * report, const gchar * format)
{
  struct GString * D.17628;
  struct GString * D.17631;
  char * ap.13;
  char * ap;

  try
    {
      D.17628 = *report;
      if (D.17628 == 0B) goto <D.17629>; else goto <D.17630>;
      <D.17629>:
      D.17631 = monoeg_g_string_new ("");
      *report = D.17631;
      <D.17630>:
      __builtin_va_start (&ap, 0);
      D.17628 = *report;
      ap.13 = ap;
      monoeg_g_string_append_vprintf (D.17628, format, ap.13);
      __builtin_va_end (&ap);
    }
  finally
    {
      ap = {CLOBBER};
    }
}


monoeg_strdup (const gchar * str)
{
  gchar * D.17635;

  if (str != 0B) goto <D.17633>; else goto <D.17634>;
  <D.17633>:
  D.17635 = __strdup (str);
  return D.17635;
  <D.17634>:
  D.17635 = 0B;
  return D.17635;
}


find_in_dir (struct DIR * current, const gchar * name)
{
  char[256] * D.17637;
  int D.17638;
  gchar * D.17641;
  struct dirent * entry;

  goto <D.17297>;
  <D.17296>:
  D.17637 = &entry->d_name;
  D.17638 = monoeg_ascii_strcasecmp (name, D.17637);
  if (D.17638 == 0) goto <D.17639>; else goto <D.17640>;
  <D.17639>:
  {
    char * ret;

    D.17637 = &entry->d_name;
    ret = monoeg_strdup (D.17637);
    closedir (current);
    D.17641 = ret;
    return D.17641;
  }
  <D.17640>:
  <D.17297>:
  entry = readdir (current);
  if (entry != 0B) goto <D.17296>; else goto <D.17298>;
  <D.17298>:
  closedir (current);
  D.17641 = 0B;
  return D.17641;
}


do_mono_profiler_iomap (struct GString * * report, const char * pathname, const char * new_pathname)
{
  struct GString * iftmp.14;
  long unsigned int D.17649;
  char * rep;
  struct GString * tmp;

  rep = 0B;
  if (report != 0B) goto <D.17644>; else goto <D.17645>;
  <D.17644>:
  iftmp.14 = *report;
  goto <D.17646>;
  <D.17645>:
  iftmp.14 = 0B;
  <D.17646>:
  tmp = iftmp.14;
  if (tmp != 0B) goto <D.17647>; else goto <D.17648>;
  <D.17647>:
  D.17649 = tmp->len;
  if (D.17649 != 0) goto <D.17650>; else goto <D.17651>;
  <D.17650>:
  rep = monoeg_g_string_free (tmp, 0);
  goto <D.17652>;
  <D.17651>:
  monoeg_g_string_free (tmp, 1);
  <D.17652>:
  *report = 0B;
  <D.17648>:
  mono_profiler_iomap (rep, pathname, new_pathname);
  monoeg_g_free (rep);
}


