ves_icall_System_IO_MonoIO_CreateDirectory (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.17395;
  unsigned int D.17398;
  int D.17399;
  MonoBoolean D.17400;
  gboolean ret;

  *error = 0;
  D.17395 = mono_string_chars (path);
  ret = CreateDirectory (D.17395, 0B);
  if (ret == 0) goto <D.17396>; else goto <D.17397>;
  <D.17396>:
  D.17398 = GetLastError ();
  D.17399 = (int) D.17398;
  *error = D.17399;
  <D.17397>:
  D.17400 = (MonoBoolean) ret;
  return D.17400;
}


ves_icall_System_IO_MonoIO_RemoveDirectory (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.17402;
  unsigned int D.17405;
  int D.17406;
  MonoBoolean D.17407;
  gboolean ret;

  *error = 0;
  D.17402 = mono_string_chars (path);
  ret = RemoveDirectory (D.17402);
  if (ret == 0) goto <D.17403>; else goto <D.17404>;
  <D.17403>:
  D.17405 = GetLastError ();
  D.17406 = (int) D.17405;
  *error = D.17406;
  <D.17404>:
  D.17407 = (MonoBoolean) ret;
  return D.17407;
}


ves_icall_System_IO_MonoIO_GetFileSystemEntries (struct MonoString * path, struct MonoString * path_with_pattern, gint attrs, gint mask, gint32 * error)
{
  unsigned int D.17409;
  mono_unichar2 * D.17410;
  unsigned int D.17411;
  int D.17414;
  unsigned int D.17418;
  int D.17419;
  mono_unichar2 * D.17420;
  unsigned int D.17423;
  _Bool D.17424;
  _Bool D.17425;
  _Bool D.17426;
  unsigned int D.17430;
  unsigned int D.17431;
  short unsigned int D.17434;
  unsigned int D.17435;
  unsigned int mask.0;
  unsigned int D.17437;
  unsigned int attrs.1;
  int D.17443;
  int D.17444;
  unsigned int D.17447;
  int D.17448;
  unsigned int D.17450;
  struct MonoClass * D.17451;
  unsigned int i.2;
  void * * D.17453;
  unsigned int i.3;
  unsigned int D.17455;
  void * * D.17456;
  void * D.17457;
  struct MonoString * D.17458;
  unsigned int i.4;
  int D.17462;
  struct MonoArray * D.17465;
  struct MonoDomain * domain;
  struct MonoArray * result;
  int i;
  struct WIN32_FIND_DATA data;
  void * find_handle;
  struct GPtrArray * names;
  gchar * utf8_path;
  gchar * utf8_result;
  gchar * full_name;
  gint32 attributes;
  void leave = <<< error >>>;

  try
    {
      result = 0B;
      *error = 0;
      domain = mono_domain_get ();
      D.17409 = convert_attrs (mask);
      mask = (gint) D.17409;
      D.17410 = mono_string_chars (path);
      D.17411 = get_file_attributes (D.17410);
      attributes = (gint32) D.17411;
      if (attributes != -1) goto <D.17412>; else goto <D.17413>;
      <D.17412>:
      D.17414 = attributes & 16;
      if (D.17414 == 0) goto <D.17415>; else goto <D.17416>;
      <D.17415>:
      *error = 123;
      goto leave;
      <D.17416>:
      goto <D.17417>;
      <D.17413>:
      D.17418 = GetLastError ();
      D.17419 = (int) D.17418;
      *error = D.17419;
      goto leave;
      <D.17417>:
      D.17420 = mono_string_chars (path_with_pattern);
      find_handle = FindFirstFile (D.17420, &data);
      if (find_handle == 4294967295B) goto <D.17421>; else goto <D.17422>;
      <D.17421>:
      {
        gint32 find_error;

        D.17423 = GetLastError ();
        find_error = (gint32) D.17423;
        D.17424 = find_error == 2;
        D.17425 = find_error == 18;
        D.17426 = D.17424 | D.17425;
        if (D.17426 != 0) goto leave; else goto <D.17427>;
        <D.17427>:
        *error = find_error;
        goto leave;
      }
      <D.17422>:
      utf8_path = get_search_dir (path_with_pattern);
      names = monoeg_g_ptr_array_new ();
      <D.17134>:
      D.17430 = BIT_FIELD_REF <data, 32, 352>;
      D.17431 = D.17430;
      if (D.17431 == 46) goto <D.17428>; else goto <D.17432>;
      <D.17432>:
      D.17430 = BIT_FIELD_REF <data, 32, 352>;
      D.17431 = D.17430;
      if (D.17431 == 3014702) goto <D.17433>; else goto <D.17429>;
      <D.17433>:
      D.17434 = data.cFileName[2];
      if (D.17434 == 0) goto <D.17428>; else goto <D.17429>;
      <D.17428>:
      // predicted unlikely by continue predictor.
      goto <D.17133>;
      <D.17429>:
      D.17435 = data.dwFileAttributes;
      mask.0 = (unsigned int) mask;
      D.17437 = D.17435 & mask.0;
      attrs.1 = (unsigned int) attrs;
      if (D.17437 == attrs.1) goto <D.17439>; else goto <D.17440>;
      <D.17439>:
      utf8_result = monoeg_g_utf16_to_utf8 (&data.cFileName, -1, 0B, 0B, 0B);
      if (utf8_result == 0B) goto <D.17441>; else goto <D.17442>;
      <D.17441>:
      // predicted unlikely by continue predictor.
      goto <D.17133>;
      <D.17442>:
      full_name = monoeg_g_build_path ("/", utf8_path, utf8_result, 0B);
      monoeg_g_ptr_array_add (names, full_name);
      monoeg_g_free (utf8_result);
      <D.17440>:
      <D.17133>:
      D.17443 = FindNextFile (find_handle, &data);
      if (D.17443 != 0) goto <D.17134>; else goto <D.17135>;
      <D.17135>:
      D.17444 = FindClose (find_handle);
      if (D.17444 == 0) goto <D.17445>; else goto <D.17446>;
      <D.17445>:
      D.17447 = GetLastError ();
      D.17448 = (int) D.17447;
      *error = D.17448;
      result = 0B;
      goto <D.17449>;
      <D.17446>:
      D.17450 = names->len;
      D.17451 = mono_defaults.string_class;
      result = mono_array_new (domain, D.17451, D.17450);
      i = 0;
      goto <D.17138>;
      <D.17137>:
      {
        void * * __p;

        i.2 = (unsigned int) i;
        __p = mono_array_addr_with_size (result, 4, i.2);
        D.17453 = names->pdata;
        i.3 = (unsigned int) i;
        D.17455 = i.3 * 4;
        D.17456 = D.17453 + D.17455;
        D.17457 = *D.17456;
        D.17458 = mono_string_new (domain, D.17457);
        mono_gc_wbarrier_set_arrayref (result, __p, D.17458);
      }
      i = i + 1;
      <D.17138>:
      i.4 = (unsigned int) i;
      D.17450 = names->len;
      if (i.4 < D.17450) goto <D.17137>; else goto <D.17139>;
      <D.17139>:
      <D.17449>:
      i = 0;
      goto <D.17141>;
      <D.17140>:
      D.17453 = names->pdata;
      i.3 = (unsigned int) i;
      D.17455 = i.3 * 4;
      D.17456 = D.17453 + D.17455;
      D.17457 = *D.17456;
      monoeg_g_free (D.17457);
      i = i + 1;
      <D.17141>:
      i.4 = (unsigned int) i;
      D.17450 = names->len;
      if (i.4 < D.17450) goto <D.17140>; else goto <D.17142>;
      <D.17142>:
      monoeg_g_ptr_array_free (names, 1);
      monoeg_g_free (utf8_path);
      leave:
      if (result == 0B) goto <D.17460>; else goto <D.17461>;
      <D.17460>:
      D.17462 = *error;
      if (D.17462 == 0) goto <D.17463>; else goto <D.17464>;
      <D.17463>:
      D.17451 = mono_defaults.string_class;
      result = mono_array_new (domain, D.17451, 0);
      <D.17464>:
      <D.17461>:
      D.17465 = result;
      return D.17465;
    }
  finally
    {
      data = {CLOBBER};
    }
}


convert_attrs (MonoFileAttributes attrs)
{
  int D.17468;
  guint32 D.17471;

  D.17468 = attrs & 16384;
  if (D.17468 != 0) goto <D.17469>; else goto <D.17470>;
  <D.17469>:
  attrs = attrs | 64;
  <D.17470>:
  D.17471 = (guint32) attrs;
  return D.17471;
}


get_file_attributes (const gunichar2 * path)
{
  guint32 D.17475;
  unsigned int D.17476;
  guint32 res;
  struct WIN32_FIND_DATA find_data;
  void * find_handle;
  gint32 error;

  try
    {
      res = GetFileAttributes (path);
      if (res != 4294967295) goto <D.17473>; else goto <D.17474>;
      <D.17473>:
      D.17475 = res;
      return D.17475;
      <D.17474>:
      D.17476 = GetLastError ();
      error = (gint32) D.17476;
      if (error != 32) goto <D.17477>; else goto <D.17478>;
      <D.17477>:
      D.17475 = res;
      return D.17475;
      <D.17478>:
      find_handle = FindFirstFile (path, &find_data);
      if (find_handle == 4294967295B) goto <D.17479>; else goto <D.17480>;
      <D.17479>:
      D.17475 = res;
      return D.17475;
      <D.17480>:
      FindClose (find_handle);
      D.17475 = find_data.dwFileAttributes;
      return D.17475;
    }
  finally
    {
      find_data = {CLOBBER};
    }
}


get_search_dir (struct MonoString * pattern)
{
  gchar * D.17483;
  gchar * p;
  gchar * result;

  p = mono_string_to_utf8 (pattern);
  result = monoeg_g_path_get_dirname (p);
  monoeg_g_free (p);
  D.17483 = result;
  return D.17483;
}


ves_icall_System_IO_MonoIO_FindFirst (struct MonoString * path, struct MonoString * path_with_pattern, gint32 * result_attr, gint32 * error, void * * handle)
{
  mono_unichar2 * D.17485;
  unsigned int D.17488;
  struct MonoString * D.17491;
  char * D.17492;
  struct MonoDomain * D.17493;
  int D.17494;
  unsigned int D.17497;
  int D.17500;
  unsigned int D.17501;
  int D.17502;
  struct WIN32_FIND_DATA data;
  void * find_handle;
  struct IncrementalFind * ifh;
  struct MonoString * result;

  try
    {
      *error = 0;
      D.17485 = mono_string_chars (path_with_pattern);
      find_handle = FindFirstFile (D.17485, &data);
      if (find_handle == 4294967295B) goto <D.17486>; else goto <D.17487>;
      <D.17486>:
      {
        gint32 find_error;

        D.17488 = GetLastError ();
        find_error = (gint32) D.17488;
        *handle = 0B;
        if (find_error == 2) goto <D.17489>; else goto <D.17490>;
        <D.17489>:
        D.17491 = 0B;
        return D.17491;
        <D.17490>:
        *error = find_error;
        D.17491 = 0B;
        return D.17491;
      }
      <D.17487>:
      ifh = monoeg_malloc (12);
      ifh->find_handle = find_handle;
      D.17492 = mono_string_to_utf8 (path);
      ifh->utf8_path = D.17492;
      D.17493 = mono_domain_get ();
      ifh->domain = D.17493;
      *handle = ifh;
      goto <D.17169>;
      <D.17168>:
      D.17494 = FindNextFile (find_handle, &data);
      if (D.17494 == 0) goto <D.17495>; else goto <D.17496>;
      <D.17495>:
      {
        int e;

        D.17497 = GetLastError ();
        e = (int) D.17497;
        if (e != 18) goto <D.17498>; else goto <D.17499>;
        <D.17498>:
        *error = e;
        <D.17499>:
        D.17491 = 0B;
        return D.17491;
      }
      <D.17496>:
      <D.17169>:
      D.17500 = incremental_find_check_match (ifh, &data, &result);
      if (D.17500 == 0) goto <D.17168>; else goto <D.17170>;
      <D.17170>:
      D.17501 = data.dwFileAttributes;
      D.17502 = (int) D.17501;
      *result_attr = D.17502;
      D.17491 = result;
      return D.17491;
    }
  finally
    {
      data = {CLOBBER};
      result = {CLOBBER};
    }
}


incremental_find_check_match (struct IncrementalFind * handle, struct WIN32_FIND_DATA * data, struct MonoString * * result)
{
  unsigned int D.17507;
  unsigned int D.17508;
  short unsigned int D.17511;
  gboolean D.17512;
  gunichar2[260] * D.17513;
  gchar * D.17516;
  struct MonoDomain * D.17517;
  struct MonoString * D.17518;
  gchar * utf8_result;
  gchar * full_name;

  D.17507 = BIT_FIELD_REF <*data, 32, 352>;
  D.17508 = D.17507;
  if (D.17508 == 46) goto <D.17505>; else goto <D.17509>;
  <D.17509>:
  D.17507 = BIT_FIELD_REF <*data, 32, 352>;
  D.17508 = D.17507;
  if (D.17508 == 3014702) goto <D.17510>; else goto <D.17506>;
  <D.17510>:
  D.17511 = data->cFileName[2];
  if (D.17511 == 0) goto <D.17505>; else goto <D.17506>;
  <D.17505>:
  D.17512 = 0;
  return D.17512;
  <D.17506>:
  D.17513 = &data->cFileName;
  utf8_result = monoeg_g_utf16_to_utf8 (D.17513, -1, 0B, 0B, 0B);
  if (utf8_result == 0B) goto <D.17514>; else goto <D.17515>;
  <D.17514>:
  D.17512 = 0;
  return D.17512;
  <D.17515>:
  D.17516 = handle->utf8_path;
  full_name = monoeg_g_build_path ("/", D.17516, utf8_result, 0B);
  monoeg_g_free (utf8_result);
  D.17517 = mono_domain_get ();
  D.17518 = mono_string_new (D.17517, full_name);
  *result = D.17518;
  monoeg_g_free (full_name);
  D.17512 = 1;
  return D.17512;
}


ves_icall_System_IO_MonoIO_FindNext (void * handle, gint32 * result_attr, gint32 * error)
{
  void * D.17520;
  int D.17521;
  unsigned int D.17524;
  struct MonoString * D.17527;
  int D.17528;
  unsigned int D.17529;
  int D.17530;
  struct IncrementalFind * ifh;
  struct WIN32_FIND_DATA data;
  struct MonoString * result;

  try
    {
      ifh = handle;
      *error = 0;
      <D.17180>:
      D.17520 = ifh->find_handle;
      D.17521 = FindNextFile (D.17520, &data);
      if (D.17521 == 0) goto <D.17522>; else goto <D.17523>;
      <D.17522>:
      {
        int e;

        D.17524 = GetLastError ();
        e = (int) D.17524;
        if (e != 18) goto <D.17525>; else goto <D.17526>;
        <D.17525>:
        *error = e;
        <D.17526>:
        D.17527 = 0B;
        return D.17527;
      }
      <D.17523>:
      D.17528 = incremental_find_check_match (ifh, &data, &result);
      if (D.17528 == 0) goto <D.17180>; else goto <D.17181>;
      <D.17181>:
      D.17529 = data.dwFileAttributes;
      D.17530 = (int) D.17529;
      *result_attr = D.17530;
      D.17527 = result;
      return D.17527;
    }
  finally
    {
      data = {CLOBBER};
      result = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_FindClose (void * handle)
{
  void * D.17533;
  int D.17534;
  unsigned int D.17537;
  gchar * D.17539;
  int D.17540;
  struct IncrementalFind * ifh;
  gint32 error;

  ifh = handle;
  D.17533 = ifh->find_handle;
  D.17534 = FindClose (D.17533);
  if (D.17534 == 0) goto <D.17535>; else goto <D.17536>;
  <D.17535>:
  D.17537 = GetLastError ();
  error = (gint32) D.17537;
  goto <D.17538>;
  <D.17536>:
  error = 0;
  <D.17538>:
  D.17539 = ifh->utf8_path;
  monoeg_g_free (D.17539);
  monoeg_g_free (ifh);
  D.17540 = error;
  return D.17540;
}


ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 * error)
{
  unsigned int len.5;
  unsigned int D.17543;
  unsigned int len.6;
  unsigned int D.17545;
  unsigned int res_len.7;
  unsigned int D.17549;
  unsigned int res_len.8;
  unsigned int D.17551;
  unsigned int old_res_len.9;
  _Bool D.17553;
  gunichar2 * D.17556;
  short unsigned int D.17557;
  struct MonoDomain * D.17558;
  unsigned int D.17560;
  int D.17561;
  struct MonoString * D.17562;
  struct MonoString * result;
  gunichar2 * buf;
  int len;
  int res_len;

  len = 261;
  len.5 = (unsigned int) len;
  D.17543 = len.5 * 2;
  buf = monoeg_malloc (D.17543);
  *error = 0;
  result = 0B;
  len.6 = (unsigned int) len;
  D.17545 = GetCurrentDirectory (len.6, buf);
  res_len = (int) D.17545;
  if (res_len > len) goto <D.17546>; else goto <D.17547>;
  <D.17546>:
  {
    int old_res_len;

    old_res_len = res_len;
    monoeg_g_free (buf);
    res_len.7 = (unsigned int) res_len;
    D.17549 = res_len.7 * 2;
    buf = monoeg_malloc (D.17549);
    res_len.8 = (unsigned int) res_len;
    D.17551 = GetCurrentDirectory (res_len.8, buf);
    old_res_len.9 = (unsigned int) old_res_len;
    D.17553 = D.17551 == old_res_len.9;
    res_len = (int) D.17553;
  }
  <D.17547>:
  if (res_len != 0) goto <D.17554>; else goto <D.17555>;
  <D.17554>:
  len = 0;
  goto <D.17196>;
  <D.17195>:
  len = len + 1;
  <D.17196>:
  len.5 = (unsigned int) len;
  D.17543 = len.5 * 2;
  D.17556 = buf + D.17543;
  D.17557 = *D.17556;
  if (D.17557 != 0) goto <D.17195>; else goto <D.17197>;
  <D.17197>:
  D.17558 = mono_domain_get ();
  result = mono_string_new_utf16 (D.17558, buf, len);
  goto <D.17559>;
  <D.17555>:
  D.17560 = GetLastError ();
  D.17561 = (int) D.17560;
  *error = D.17561;
  <D.17559>:
  monoeg_g_free (buf);
  D.17562 = result;
  return D.17562;
}


ves_icall_System_IO_MonoIO_SetCurrentDirectory (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.17564;
  unsigned int D.17567;
  int D.17568;
  MonoBoolean D.17569;
  gboolean ret;

  *error = 0;
  D.17564 = mono_string_chars (path);
  ret = SetCurrentDirectory (D.17564);
  if (ret == 0) goto <D.17565>; else goto <D.17566>;
  <D.17565>:
  D.17567 = GetLastError ();
  D.17568 = (int) D.17567;
  *error = D.17568;
  <D.17566>:
  D.17569 = (MonoBoolean) ret;
  return D.17569;
}


ves_icall_System_IO_MonoIO_MoveFile (struct MonoString * path, struct MonoString * dest, gint32 * error)
{
  mono_unichar2 * D.17571;
  mono_unichar2 * D.17572;
  unsigned int D.17575;
  int D.17576;
  MonoBoolean D.17577;
  gboolean ret;

  *error = 0;
  D.17571 = mono_string_chars (dest);
  D.17572 = mono_string_chars (path);
  ret = MoveFile (D.17572, D.17571);
  if (ret == 0) goto <D.17573>; else goto <D.17574>;
  <D.17573>:
  D.17575 = GetLastError ();
  D.17576 = (int) D.17575;
  *error = D.17576;
  <D.17574>:
  D.17577 = (MonoBoolean) ret;
  return D.17577;
}


ves_icall_System_IO_MonoIO_ReplaceFile (struct MonoString * sourceFileName, struct MonoString * destinationFileName, struct MonoString * destinationBackupFileName, MonoBoolean ignoreMetadataErrors, gint32 * error)
{
  unsigned int D.17589;
  int D.17590;
  MonoBoolean D.17591;
  gboolean ret;
  gunichar2 * utf16_sourceFileName;
  gunichar2 * utf16_destinationFileName;
  gunichar2 * utf16_destinationBackupFileName;
  guint32 replaceFlags;

  utf16_sourceFileName = 0B;
  utf16_destinationFileName = 0B;
  utf16_destinationBackupFileName = 0B;
  replaceFlags = 1;
  if (sourceFileName != 0B) goto <D.17579>; else goto <D.17580>;
  <D.17579>:
  utf16_sourceFileName = mono_string_chars (sourceFileName);
  <D.17580>:
  if (destinationFileName != 0B) goto <D.17581>; else goto <D.17582>;
  <D.17581>:
  utf16_destinationFileName = mono_string_chars (destinationFileName);
  <D.17582>:
  if (destinationBackupFileName != 0B) goto <D.17583>; else goto <D.17584>;
  <D.17583>:
  utf16_destinationBackupFileName = mono_string_chars (destinationBackupFileName);
  <D.17584>:
  *error = 0;
  if (ignoreMetadataErrors != 0) goto <D.17585>; else goto <D.17586>;
  <D.17585>:
  replaceFlags = replaceFlags | 2;
  <D.17586>:
  ret = ReplaceFile (utf16_destinationFileName, utf16_sourceFileName, utf16_destinationBackupFileName, replaceFlags, 0B, 0B);
  if (ret == 0) goto <D.17587>; else goto <D.17588>;
  <D.17587>:
  D.17589 = GetLastError ();
  D.17590 = (int) D.17589;
  *error = D.17590;
  <D.17588>:
  D.17591 = (MonoBoolean) ret;
  return D.17591;
}


ves_icall_System_IO_MonoIO_CopyFile (struct MonoString * path, struct MonoString * dest, MonoBoolean overwrite, gint32 * error)
{
  _Bool D.17593;
  int D.17594;
  mono_unichar2 * D.17595;
  mono_unichar2 * D.17596;
  unsigned int D.17599;
  int D.17600;
  MonoBoolean D.17601;
  gboolean ret;

  *error = 0;
  D.17593 = overwrite == 0;
  D.17594 = (int) D.17593;
  D.17595 = mono_string_chars (dest);
  D.17596 = mono_string_chars (path);
  ret = CopyFile (D.17596, D.17595, D.17594);
  if (ret == 0) goto <D.17597>; else goto <D.17598>;
  <D.17597>:
  D.17599 = GetLastError ();
  D.17600 = (int) D.17599;
  *error = D.17600;
  <D.17598>:
  D.17601 = (MonoBoolean) ret;
  return D.17601;
}


ves_icall_System_IO_MonoIO_DeleteFile (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.17603;
  unsigned int D.17606;
  int D.17607;
  MonoBoolean D.17608;
  gboolean ret;

  *error = 0;
  D.17603 = mono_string_chars (path);
  ret = DeleteFile (D.17603);
  if (ret == 0) goto <D.17604>; else goto <D.17605>;
  <D.17604>:
  D.17606 = GetLastError ();
  D.17607 = (int) D.17606;
  *error = D.17607;
  <D.17605>:
  D.17608 = (MonoBoolean) ret;
  return D.17608;
}


ves_icall_System_IO_MonoIO_GetFileAttributes (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.17610;
  unsigned int D.17611;
  unsigned int D.17614;
  int D.17615;
  gint32 D.17616;
  gint32 ret;

  *error = 0;
  D.17610 = mono_string_chars (path);
  D.17611 = get_file_attributes (D.17610);
  ret = (gint32) D.17611;
  if (ret == -1) goto <D.17612>; else goto <D.17613>;
  <D.17612>:
  D.17614 = GetLastError ();
  D.17615 = (int) D.17614;
  *error = D.17615;
  <D.17613>:
  D.17616 = ret;
  return D.17616;
}


ves_icall_System_IO_MonoIO_SetFileAttributes (struct MonoString * path, gint32 attrs, gint32 * error)
{
  unsigned int D.17618;
  mono_unichar2 * D.17619;
  unsigned int D.17622;
  int D.17623;
  MonoBoolean D.17624;
  gboolean ret;

  *error = 0;
  D.17618 = convert_attrs (attrs);
  D.17619 = mono_string_chars (path);
  ret = SetFileAttributes (D.17619, D.17618);
  if (ret == 0) goto <D.17620>; else goto <D.17621>;
  <D.17620>:
  D.17622 = GetLastError ();
  D.17623 = (int) D.17622;
  *error = D.17623;
  <D.17621>:
  D.17624 = (MonoBoolean) ret;
  return D.17624;
}


ves_icall_System_IO_MonoIO_GetFileType (void * handle, gint32 * error)
{
  <unnamed type> D.17626;
  unsigned int D.17629;
  int D.17630;
  gint32 D.17631;
  gboolean ret;

  *error = 0;
  D.17626 = GetFileType (handle);
  ret = (gboolean) D.17626;
  if (ret == 0) goto <D.17627>; else goto <D.17628>;
  <D.17627>:
  D.17629 = GetLastError ();
  D.17630 = (int) D.17629;
  *error = D.17630;
  <D.17628>:
  D.17631 = ret;
  return D.17631;
}


ves_icall_System_IO_MonoIO_GetFileStat (struct MonoString * path, struct MonoIOStat * stat, gint32 * error)
{
  mono_unichar2 * D.17633;
  unsigned int D.17637;
  int D.17638;
  MonoBoolean D.17639;
  gboolean result;
  struct WIN32_FILE_ATTRIBUTE_DATA data;

  try
    {
      *error = 0;
      D.17633 = mono_string_chars (path);
      result = get_file_attributes_ex (D.17633, &data);
      if (result != 0) goto <D.17634>; else goto <D.17635>;
      <D.17634>:
      convert_win32_file_attribute_data (&data, stat);
      goto <D.17636>;
      <D.17635>:
      D.17637 = GetLastError ();
      D.17638 = (int) D.17637;
      *error = D.17638;
      memset (stat, 0, 36);
      <D.17636>:
      D.17639 = (MonoBoolean) result;
      return D.17639;
    }
  finally
    {
      data = {CLOBBER};
    }
}


get_file_attributes_ex (const gunichar2 * path, struct WIN32_FILE_ATTRIBUTE_DATA * data)
{
  gboolean D.17644;
  unsigned int D.17645;
  unsigned int D.17650;
  unsigned int D.17651;
  unsigned int D.17652;
  gboolean res;
  struct WIN32_FIND_DATA find_data;
  void * find_handle;
  gint32 error;

  try
    {
      res = GetFileAttributesEx (path, 0, data);
      if (res != 0) goto <D.17642>; else goto <D.17643>;
      <D.17642>:
      D.17644 = 1;
      return D.17644;
      <D.17643>:
      D.17645 = GetLastError ();
      error = (gint32) D.17645;
      if (error != 32) goto <D.17646>; else goto <D.17647>;
      <D.17646>:
      D.17644 = 0;
      return D.17644;
      <D.17647>:
      find_handle = FindFirstFile (path, &find_data);
      if (find_handle == 4294967295B) goto <D.17648>; else goto <D.17649>;
      <D.17648>:
      D.17644 = 0;
      return D.17644;
      <D.17649>:
      FindClose (find_handle);
      D.17650 = find_data.dwFileAttributes;
      data->dwFileAttributes = D.17650;
      data->ftCreationTime = find_data.ftCreationTime;
      data->ftLastAccessTime = find_data.ftLastAccessTime;
      data->ftLastWriteTime = find_data.ftLastWriteTime;
      D.17651 = find_data.nFileSizeHigh;
      data->nFileSizeHigh = D.17651;
      D.17652 = find_data.nFileSizeLow;
      data->nFileSizeLow = D.17652;
      D.17644 = 1;
      return D.17644;
    }
  finally
    {
      find_data = {CLOBBER};
    }
}


convert_win32_file_attribute_data (const struct WIN32_FILE_ATTRIBUTE_DATA * data, struct MonoIOStat * stat)
{
  unsigned int D.17655;
  int D.17656;
  const struct WapiFileTime * D.17657;
  long long int D.17658;
  const struct WapiFileTime * D.17659;
  long long int D.17660;
  const struct WapiFileTime * D.17661;
  long long int D.17662;
  unsigned int D.17663;
  long long int D.17664;
  long long int D.17665;
  unsigned int D.17666;
  long long int D.17667;
  long long int D.17668;

  D.17655 = data->dwFileAttributes;
  D.17656 = (int) D.17655;
  stat->attributes = D.17656;
  D.17657 = &data->ftCreationTime;
  D.17658 = convert_filetime (D.17657);
  stat->creation_time = D.17658;
  D.17659 = &data->ftLastAccessTime;
  D.17660 = convert_filetime (D.17659);
  stat->last_access_time = D.17660;
  D.17661 = &data->ftLastWriteTime;
  D.17662 = convert_filetime (D.17661);
  stat->last_write_time = D.17662;
  D.17663 = data->nFileSizeHigh;
  D.17664 = (long long int) D.17663;
  D.17665 = D.17664 << 32;
  D.17666 = data->nFileSizeLow;
  D.17667 = (long long int) D.17666;
  D.17668 = D.17665 | D.17667;
  stat->length = D.17668;
}


convert_filetime (const struct FILETIME * filetime)
{
  unsigned int D.17669;
  unsigned int D.17670;
  long long unsigned int D.17671;
  gint64 D.17672;
  guint64 ticks;

  D.17669 = filetime->dwHighDateTime;
  ticks = (guint64) D.17669;
  ticks = ticks << 32;
  D.17670 = filetime->dwLowDateTime;
  D.17671 = (long long unsigned int) D.17670;
  ticks = D.17671 + ticks;
  D.17672 = (gint64) ticks;
  return D.17672;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.17676;
  int D.17681;
  void * D.17683;
  unsigned int D.17684;

  D.17676 = __builtin_constant_p (__len);
  if (D.17676 != 0) goto <D.17677>; else goto <D.17678>;
  <D.17677>:
  if (__len == 0) goto <D.17679>; else goto <D.17680>;
  <D.17679>:
  D.17681 = __builtin_constant_p (__ch);
  if (D.17681 == 0) goto <D.17674>; else goto <D.17682>;
  <D.17682>:
  if (__ch != 0) goto <D.17674>; else goto <D.17675>;
  <D.17674>:
  __warn_memset_zero_len ();
  D.17683 = __dest;
  return D.17683;
  <D.17675>:
  <D.17680>:
  <D.17678>:
  D.17684 = __builtin_object_size (__dest, 0);
  D.17683 = __builtin___memset_chk (__dest, __ch, __len, D.17684);
  return D.17683;
}


ves_icall_System_IO_MonoIO_Open (struct MonoString * filename, gint32 mode, gint32 access_mode, gint32 share, gint32 options, gint32 * error)
{
  int D.17688;
  int D.17692;
  int D.17695;
  int D.17698;
  int D.17701;
  int D.17704;
  unsigned int attributes.10;
  unsigned int D.17710;
  unsigned int D.17712;
  int D.17715;
  unsigned int attributes.11;
  <unnamed type> mode.12;
  unsigned int D.17720;
  <unnamed type> share.13;
  unsigned int D.17722;
  <unnamed type> access_mode.14;
  unsigned int D.17724;
  unsigned int D.17727;
  int D.17728;
  void * D.17729;
  void * ret;
  int attributes;
  int attrs;
  gunichar2 * chars;

  chars = mono_string_chars (filename);
  *error = 0;
  if (options != 0) goto <D.17686>; else goto <D.17687>;
  <D.17686>:
  D.17688 = options & 16384;
  if (D.17688 != 0) goto <D.17689>; else goto <D.17690>;
  <D.17689>:
  attributes = 64;
  goto <D.17691>;
  <D.17690>:
  attributes = 128;
  <D.17691>:
  D.17692 = options & 67108864;
  if (D.17692 != 0) goto <D.17693>; else goto <D.17694>;
  <D.17693>:
  attributes = attributes | 67108864;
  <D.17694>:
  D.17695 = options & 134217728;
  if (D.17695 != 0) goto <D.17696>; else goto <D.17697>;
  <D.17696>:
  attributes = attributes | 134217728;
  <D.17697>:
  D.17698 = options & 268435456;
  if (D.17698 != 0) goto <D.17699>; else goto <D.17700>;
  <D.17699>:
  attributes = attributes | 268435456;
  <D.17700>:
  D.17701 = options & 1;
  if (D.17701 != 0) goto <D.17702>; else goto <D.17703>;
  <D.17702>:
  attributes = attributes | 256;
  <D.17703>:
  D.17704 = options & 1073741824;
  if (D.17704 != 0) goto <D.17705>; else goto <D.17706>;
  <D.17705>:
  attributes = attributes | 1073741824;
  <D.17706>:
  if (options < 0) goto <D.17707>; else goto <D.17708>;
  <D.17707>:
  attributes.10 = (unsigned int) attributes;
  D.17710 = attributes.10 | 2147483648;
  attributes = (int) D.17710;
  <D.17708>:
  goto <D.17711>;
  <D.17687>:
  attributes = 128;
  <D.17711>:
  D.17712 = get_file_attributes (chars);
  attrs = (int) D.17712;
  if (attrs != -1) goto <D.17713>; else goto <D.17714>;
  <D.17713>:
  D.17715 = attrs & 16;
  if (D.17715 != 0) goto <D.17716>; else goto <D.17717>;
  <D.17716>:
  attributes = attributes | 33554432;
  <D.17717>:
  <D.17714>:
  attributes.11 = (unsigned int) attributes;
  mode.12 = (<unnamed type>) mode;
  D.17720 = convert_mode (mode.12);
  share.13 = (<unnamed type>) share;
  D.17722 = convert_share (share.13);
  access_mode.14 = (<unnamed type>) access_mode;
  D.17724 = convert_access (access_mode.14);
  ret = CreateFile (chars, D.17724, D.17722, 0B, D.17720, attributes.11, 0B);
  if (ret == 4294967295B) goto <D.17725>; else goto <D.17726>;
  <D.17725>:
  D.17727 = GetLastError ();
  D.17728 = (int) D.17727;
  *error = D.17728;
  <D.17726>:
  D.17729 = ret;
  return D.17729;
}


convert_mode (MonoFileMode mono_mode)
{
  guint32 D.17731;
  guint32 mode;

  switch (mono_mode) <default: <D.17050>, case 1: <D.17043>, case 2: <D.17045>, case 3: <D.17046>, case 4: <D.17047>, case 5: <D.17048>, case 6: <D.17049>>
  <D.17043>:
  mode = 1;
  goto <D.17044>;
  <D.17045>:
  mode = 2;
  goto <D.17044>;
  <D.17046>:
  mode = 3;
  goto <D.17044>;
  <D.17047>:
  mode = 4;
  goto <D.17044>;
  <D.17048>:
  mode = 5;
  goto <D.17044>;
  <D.17049>:
  mode = 4;
  goto <D.17044>;
  <D.17050>:
  monoeg_g_log (0B, 16, "System.IO.FileMode has unknown value 0x%x", mono_mode);
  mode = 3;
  <D.17044>:
  D.17731 = mode;
  return D.17731;
}


convert_share (MonoFileShare mono_share)
{
  unsigned int D.17733;
  unsigned int D.17736;
  unsigned int D.17739;
  unsigned int D.17742;
  guint32 D.17745;
  guint32 share;

  share = 0;
  D.17733 = mono_share & 1;
  if (D.17733 != 0) goto <D.17734>; else goto <D.17735>;
  <D.17734>:
  share = share | 1;
  <D.17735>:
  D.17736 = mono_share & 2;
  if (D.17736 != 0) goto <D.17737>; else goto <D.17738>;
  <D.17737>:
  share = share | 2;
  <D.17738>:
  D.17739 = mono_share & 4;
  if (D.17739 != 0) goto <D.17740>; else goto <D.17741>;
  <D.17740>:
  share = share | 4;
  <D.17741>:
  D.17742 = mono_share & 4294967288;
  if (D.17742 != 0) goto <D.17743>; else goto <D.17744>;
  <D.17743>:
  monoeg_g_log (0B, 16, "System.IO.FileShare has unknown value 0x%x", mono_share);
  share = 0;
  <D.17744>:
  D.17745 = share;
  return D.17745;
}


convert_access (MonoFileAccess mono_access)
{
  guint32 D.17747;
  guint32 access;

  switch (mono_access) <default: <D.17059>, case 1: <D.17055>, case 2: <D.17057>, case 3: <D.17058>>
  <D.17055>:
  access = 2147483648;
  goto <D.17056>;
  <D.17057>:
  access = 1073741824;
  goto <D.17056>;
  <D.17058>:
  access = 3221225472;
  goto <D.17056>;
  <D.17059>:
  monoeg_g_log (0B, 16, "System.IO.FileAccess has unknown value 0x%x", mono_access);
  access = 2147483648;
  <D.17056>:
  D.17747 = access;
  return D.17747;
}


ves_icall_System_IO_MonoIO_Close (void * handle, gint32 * error)
{
  unsigned int D.17751;
  int D.17752;
  MonoBoolean D.17753;
  gboolean ret;

  *error = 0;
  ret = CloseHandle (handle);
  if (ret == 0) goto <D.17749>; else goto <D.17750>;
  <D.17749>:
  D.17751 = GetLastError ();
  D.17752 = (int) D.17751;
  *error = D.17752;
  <D.17750>:
  D.17753 = (MonoBoolean) ret;
  return D.17753;
}


ves_icall_System_IO_MonoIO_Read (void * handle, struct MonoArray * dest, gint32 dest_offset, gint32 count, gint32 * error)
{
  _Bool D.17755;
  long int D.17756;
  long int D.17757;
  unsigned int dest_offset.15;
  unsigned int D.17763;
  unsigned int count.16;
  unsigned int D.17765;
  struct MonoException * D.17768;
  unsigned int count.17;
  unsigned int D.17772;
  int D.17773;
  gint32 D.17774;
  unsigned int n.18;
  guchar * buffer;
  gboolean result;
  guint32 n;

  try
    {
      *error = 0;
      D.17755 = dest == 0B;
      D.17756 = (long int) D.17755;
      D.17757 = __builtin_expect (D.17756, 0);
      if (D.17757 != 0) goto <D.17758>; else goto <D.17759>;
      <D.17758>:
      {
        struct MonoException * ex;

        if (dest != 0B) goto <D.17760>; else goto <D.17761>;
        <D.17760>:
        <D.17761>:
        ex = mono_get_exception_argument_null ("dest");
        mono_raise_exception (ex);
      }
      <D.17759>:
      dest_offset.15 = (unsigned int) dest_offset;
      D.17763 = mono_array_length (dest);
      count.16 = (unsigned int) count;
      D.17765 = D.17763 - count.16;
      if (dest_offset.15 > D.17765) goto <D.17766>; else goto <D.17767>;
      <D.17766>:
      D.17768 = mono_get_exception_argument ("array", "array too small. numBytes/offset wrong.");
      mono_raise_exception (D.17768);
      <D.17767>:
      dest_offset.15 = (unsigned int) dest_offset;
      buffer = mono_array_addr_with_size (dest, 1, dest_offset.15);
      count.17 = (unsigned int) count;
      result = ReadFile (handle, buffer, count.17, &n, 0B);
      if (result == 0) goto <D.17770>; else goto <D.17771>;
      <D.17770>:
      D.17772 = GetLastError ();
      D.17773 = (int) D.17772;
      *error = D.17773;
      D.17774 = -1;
      return D.17774;
      <D.17771>:
      n.18 = n;
      D.17774 = (gint32) n.18;
      return D.17774;
    }
  finally
    {
      n = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_Write (void * handle, struct MonoArray * src, gint32 src_offset, gint32 count, gint32 * error)
{
  _Bool D.17778;
  long int D.17779;
  long int D.17780;
  unsigned int src_offset.19;
  unsigned int D.17786;
  unsigned int count.20;
  unsigned int D.17788;
  struct MonoException * D.17791;
  unsigned int count.21;
  unsigned int D.17795;
  int D.17796;
  gint32 D.17797;
  unsigned int n.22;
  guchar * buffer;
  gboolean result;
  guint32 n;

  try
    {
      *error = 0;
      D.17778 = src == 0B;
      D.17779 = (long int) D.17778;
      D.17780 = __builtin_expect (D.17779, 0);
      if (D.17780 != 0) goto <D.17781>; else goto <D.17782>;
      <D.17781>:
      {
        struct MonoException * ex;

        if (src != 0B) goto <D.17783>; else goto <D.17784>;
        <D.17783>:
        <D.17784>:
        ex = mono_get_exception_argument_null ("src");
        mono_raise_exception (ex);
      }
      <D.17782>:
      src_offset.19 = (unsigned int) src_offset;
      D.17786 = mono_array_length (src);
      count.20 = (unsigned int) count;
      D.17788 = D.17786 - count.20;
      if (src_offset.19 > D.17788) goto <D.17789>; else goto <D.17790>;
      <D.17789>:
      D.17791 = mono_get_exception_argument ("array", "array too small. numBytes/offset wrong.");
      mono_raise_exception (D.17791);
      <D.17790>:
      src_offset.19 = (unsigned int) src_offset;
      buffer = mono_array_addr_with_size (src, 1, src_offset.19);
      count.21 = (unsigned int) count;
      result = WriteFile (handle, buffer, count.21, &n, 0B);
      if (result == 0) goto <D.17793>; else goto <D.17794>;
      <D.17793>:
      D.17795 = GetLastError ();
      D.17796 = (int) D.17795;
      *error = D.17796;
      D.17797 = -1;
      return D.17797;
      <D.17794>:
      n.22 = n;
      D.17797 = (gint32) n.22;
      return D.17797;
    }
  finally
    {
      n = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_Seek (void * handle, gint64 offset, gint32 origin, gint32 * error)
{
  long long int D.17801;
  int offset_hi.23;
  <unnamed type> origin.24;
  unsigned int D.17804;
  int D.17805;
  unsigned int D.17806;
  unsigned int D.17809;
  int D.17810;
  gint64 D.17811;
  int offset_hi.25;
  long long int D.17813;
  long long int D.17814;
  gint32 offset_hi;

  try
    {
      *error = 0;
      D.17801 = offset >> 32;
      offset_hi.23 = (int) D.17801;
      offset_hi = offset_hi.23;
      origin.24 = (<unnamed type>) origin;
      D.17804 = convert_seekorigin (origin.24);
      D.17805 = (int) offset;
      D.17806 = SetFilePointer (handle, D.17805, &offset_hi, D.17804);
      offset = (gint64) D.17806;
      if (offset == 4294967295) goto <D.17807>; else goto <D.17808>;
      <D.17807>:
      D.17809 = GetLastError ();
      D.17810 = (int) D.17809;
      *error = D.17810;
      <D.17808>:
      offset_hi.25 = offset_hi;
      D.17813 = (long long int) offset_hi.25;
      D.17814 = D.17813 << 32;
      D.17811 = D.17814 | offset;
      return D.17811;
    }
  finally
    {
      offset_hi = {CLOBBER};
    }
}


convert_seekorigin (MonoSeekOrigin origin)
{
  guint32 D.17817;
  guint32 w32origin;

  switch (origin) <default: <D.17072>, case 0: <D.17068>, case 1: <D.17070>, case 2: <D.17071>>
  <D.17068>:
  w32origin = 0;
  goto <D.17069>;
  <D.17070>:
  w32origin = 1;
  goto <D.17069>;
  <D.17071>:
  w32origin = 2;
  goto <D.17069>;
  <D.17072>:
  monoeg_g_log (0B, 16, "System.IO.SeekOrigin has unknown value 0x%x", origin);
  w32origin = 1;
  <D.17069>:
  D.17817 = w32origin;
  return D.17817;
}


ves_icall_System_IO_MonoIO_Flush (void * handle, gint32 * error)
{
  unsigned int D.17821;
  int D.17822;
  MonoBoolean D.17823;
  gboolean ret;

  *error = 0;
  ret = FlushFileBuffers (handle);
  if (ret == 0) goto <D.17819>; else goto <D.17820>;
  <D.17819>:
  D.17821 = GetLastError ();
  D.17822 = (int) D.17821;
  *error = D.17822;
  <D.17820>:
  D.17823 = (MonoBoolean) ret;
  return D.17823;
}


ves_icall_System_IO_MonoIO_GetLength (void * handle, gint32 * error)
{
  unsigned int D.17825;
  unsigned int D.17828;
  int D.17829;
  gint64 D.17830;
  unsigned int length_hi.26;
  long long int D.17832;
  long long int D.17833;
  gint64 length;
  guint32 length_hi;

  try
    {
      *error = 0;
      D.17825 = GetFileSize (handle, &length_hi);
      length = (gint64) D.17825;
      if (length == 4294967295) goto <D.17826>; else goto <D.17827>;
      <D.17826>:
      D.17828 = GetLastError ();
      D.17829 = (int) D.17828;
      *error = D.17829;
      <D.17827>:
      length_hi.26 = length_hi;
      D.17832 = (long long int) length_hi.26;
      D.17833 = D.17832 << 32;
      D.17830 = D.17833 | length;
      return D.17830;
    }
  finally
    {
      length_hi = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_SetLength (void * handle, gint64 length, gint32 * error)
{
  unsigned int D.17836;
  unsigned int D.17839;
  int D.17840;
  MonoBoolean D.17841;
  long long int D.17842;
  int length_hi.27;
  int D.17844;
  unsigned int D.17845;
  unsigned int D.17848;
  int D.17849;
  unsigned int D.17852;
  int D.17853;
  int D.17854;
  unsigned int D.17855;
  unsigned int D.17858;
  int D.17859;
  gint64 offset;
  gint64 offset_set;
  gint32 offset_hi;
  gint32 length_hi;
  gboolean result;

  try
    {
      *error = 0;
      offset_hi = 0;
      D.17836 = SetFilePointer (handle, 0, &offset_hi, 1);
      offset = (gint64) D.17836;
      if (offset == 4294967295) goto <D.17837>; else goto <D.17838>;
      <D.17837>:
      D.17839 = GetLastError ();
      D.17840 = (int) D.17839;
      *error = D.17840;
      D.17841 = 0;
      return D.17841;
      <D.17838>:
      D.17842 = length >> 32;
      length_hi.27 = (int) D.17842;
      length_hi = length_hi.27;
      D.17844 = (int) length;
      D.17845 = SetFilePointer (handle, D.17844, &length_hi, 0);
      offset_set = (gint64) D.17845;
      if (offset_set == 4294967295) goto <D.17846>; else goto <D.17847>;
      <D.17846>:
      D.17848 = GetLastError ();
      D.17849 = (int) D.17848;
      *error = D.17849;
      D.17841 = 0;
      return D.17841;
      <D.17847>:
      result = SetEndOfFile (handle);
      if (result == 0) goto <D.17850>; else goto <D.17851>;
      <D.17850>:
      D.17852 = GetLastError ();
      D.17853 = (int) D.17852;
      *error = D.17853;
      D.17841 = 0;
      return D.17841;
      <D.17851>:
      D.17854 = (int) offset;
      D.17855 = SetFilePointer (handle, D.17854, &offset_hi, 0);
      offset_set = (gint64) D.17855;
      if (offset_set == 4294967295) goto <D.17856>; else goto <D.17857>;
      <D.17856>:
      D.17858 = GetLastError ();
      D.17859 = (int) D.17858;
      *error = D.17859;
      D.17841 = 0;
      return D.17841;
      <D.17857>:
      D.17841 = (MonoBoolean) result;
      return D.17841;
    }
  finally
    {
      offset_hi = {CLOBBER};
      length_hi = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_SetFileTime (void * handle, gint64 creation_time, gint64 last_access_time, gint64 last_write_time, gint32 * error)
{
  long long int creation_time.28;
  long long int last_access_time.29;
  long long int last_write_time.30;
  unsigned int D.17876;
  int D.17877;
  MonoBoolean D.17878;
  gboolean ret;
  const struct FILETIME * creation_filetime;
  const struct FILETIME * last_access_filetime;
  const struct FILETIME * last_write_filetime;

  *error = 0;
  creation_time.28 = creation_time;
  if (creation_time.28 < 0) goto <D.17863>; else goto <D.17864>;
  <D.17863>:
  creation_filetime = 0B;
  goto <D.17865>;
  <D.17864>:
  creation_filetime = &creation_time;
  <D.17865>:
  last_access_time.29 = last_access_time;
  if (last_access_time.29 < 0) goto <D.17867>; else goto <D.17868>;
  <D.17867>:
  last_access_filetime = 0B;
  goto <D.17869>;
  <D.17868>:
  last_access_filetime = &last_access_time;
  <D.17869>:
  last_write_time.30 = last_write_time;
  if (last_write_time.30 < 0) goto <D.17871>; else goto <D.17872>;
  <D.17871>:
  last_write_filetime = 0B;
  goto <D.17873>;
  <D.17872>:
  last_write_filetime = &last_write_time;
  <D.17873>:
  ret = SetFileTime (handle, creation_filetime, last_access_filetime, last_write_filetime);
  if (ret == 0) goto <D.17874>; else goto <D.17875>;
  <D.17874>:
  D.17876 = GetLastError ();
  D.17877 = (int) D.17876;
  *error = D.17877;
  <D.17875>:
  D.17878 = (MonoBoolean) ret;
  return D.17878;
}


ves_icall_System_IO_MonoIO_get_ConsoleOutput ()
{
  void * D.17880;

  D.17880 = GetStdHandle (-11);
  return D.17880;
}


ves_icall_System_IO_MonoIO_get_ConsoleInput ()
{
  void * D.17882;

  D.17882 = GetStdHandle (-10);
  return D.17882;
}


ves_icall_System_IO_MonoIO_get_ConsoleError ()
{
  void * D.17884;

  D.17884 = GetStdHandle (-12);
  return D.17884;
}


ves_icall_System_IO_MonoIO_CreatePipe (void * * read_handle, void * * write_handle)
{
  MonoBoolean D.17888;
  struct SECURITY_ATTRIBUTES attr;
  gboolean ret;

  try
    {
      attr.nLength = 12;
      attr.bInheritHandle = 1;
      attr.lpSecurityDescriptor = 0B;
      ret = CreatePipe (read_handle, write_handle, &attr, 0);
      if (ret == 0) goto <D.17886>; else goto <D.17887>;
      <D.17886>:
      D.17888 = 0;
      return D.17888;
      <D.17887>:
      D.17888 = 1;
      return D.17888;
    }
  finally
    {
      attr = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_DuplicateHandle (void * source_process_handle, void * source_handle, void * target_process_handle, void * * target_handle, gint32 access, gint32 inherit, gint32 options)
{
  unsigned int options.31;
  unsigned int access.32;
  MonoBoolean D.17895;
  gboolean ret;

  options.31 = (unsigned int) options;
  access.32 = (unsigned int) access;
  ret = DuplicateHandle (source_process_handle, source_handle, target_process_handle, target_handle, access.32, inherit, options.31);
  if (ret == 0) goto <D.17893>; else goto <D.17894>;
  <D.17893>:
  D.17895 = 0;
  return D.17895;
  <D.17894>:
  D.17895 = 1;
  return D.17895;
}


ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar ()
{
  gunichar2 D.17897;

  D.17897 = 47;
  return D.17897;
}


ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar ()
{
  gunichar2 D.17899;

  D.17899 = 47;
  return D.17899;
}


ves_icall_System_IO_MonoIO_get_AltDirectorySeparatorChar ()
{
  int __mono_io_portability_helpers.33;
  gunichar2 D.17904;

  __mono_io_portability_helpers.33 = __mono_io_portability_helpers;
  if (__mono_io_portability_helpers.33 > 0) goto <D.17902>; else goto <D.17903>;
  <D.17902>:
  D.17904 = 92;
  return D.17904;
  <D.17903>:
  D.17904 = 47;
  return D.17904;
}


ves_icall_System_IO_MonoIO_get_PathSeparator ()
{
  gunichar2 D.17906;

  D.17906 = 58;
  return D.17906;
}


ves_icall_System_IO_MonoIO_get_InvalidPathChars ()
{
  unsigned int n.34;
  struct MonoClass * D.17909;
  unsigned int i.35;
  short unsigned int D.17911;
  struct MonoArray * D.17912;
  struct MonoArray * chars;
  struct MonoDomain * domain;
  int i;
  int n;

  domain = mono_domain_get ();
  n = 1;
  n.34 = (unsigned int) n;
  D.17909 = mono_defaults.char_class;
  chars = mono_array_new (domain, D.17909, n.34);
  i = 0;
  goto <D.17373>;
  <D.17372>:
  {
    gunichar2 * __p;

    i.35 = (unsigned int) i;
    __p = mono_array_addr_with_size (chars, 2, i.35);
    D.17911 = 0;
    *__p = D.17911;
  }
  i = i + 1;
  <D.17373>:
  if (i < n) goto <D.17372>; else goto <D.17374>;
  <D.17374>:
  D.17912 = chars;
  return D.17912;
}


ves_icall_System_IO_MonoIO_GetTempPath (struct MonoString * * mono_name)
{
  unsigned int D.17914;
  int D.17917;
  unsigned int D.17918;
  unsigned int D.17919;
  unsigned int ret.36;
  unsigned int D.17921;
  struct MonoDomain * D.17924;
  struct MonoString * D.17925;
  gint32 D.17926;
  gunichar2 * name;
  int ret;

  name = monoeg_malloc0 (512);
  D.17914 = GetTempPath (256, name);
  ret = (int) D.17914;
  if (ret > 255) goto <D.17915>; else goto <D.17916>;
  <D.17915>:
  monoeg_g_free (name);
  D.17917 = ret + 2;
  D.17918 = (unsigned int) D.17917;
  D.17919 = D.17918 * 2;
  name = monoeg_malloc0 (D.17919);
  ret.36 = (unsigned int) ret;
  D.17921 = GetTempPath (ret.36, name);
  ret = (int) D.17921;
  <D.17916>:
  if (ret > 0) goto <D.17922>; else goto <D.17923>;
  <D.17922>:
  D.17924 = mono_domain_get ();
  D.17925 = mono_string_new_utf16 (D.17924, name, ret);
  mono_gc_wbarrier_generic_store (mono_name, D.17925);
  <D.17923>:
  monoeg_g_free (name);
  D.17926 = ret;
  return D.17926;
}


ves_icall_System_IO_MonoIO_Lock (void * handle, gint64 position, gint64 length, gint32 * error)
{
  long long int D.17928;
  unsigned int D.17929;
  unsigned int D.17930;
  long long int D.17931;
  unsigned int D.17932;
  unsigned int D.17933;
  unsigned int D.17936;
  int D.17937;
  gboolean ret;

  *error = 0;
  D.17928 = length >> 32;
  D.17929 = (unsigned int) D.17928;
  D.17930 = (unsigned int) length;
  D.17931 = position >> 32;
  D.17932 = (unsigned int) D.17931;
  D.17933 = (unsigned int) position;
  ret = LockFile (handle, D.17933, D.17932, D.17930, D.17929);
  if (ret == 0) goto <D.17934>; else goto <D.17935>;
  <D.17934>:
  D.17936 = GetLastError ();
  D.17937 = (int) D.17936;
  *error = D.17937;
  <D.17935>:
}


ves_icall_System_IO_MonoIO_Unlock (void * handle, gint64 position, gint64 length, gint32 * error)
{
  long long int D.17938;
  unsigned int D.17939;
  unsigned int D.17940;
  long long int D.17941;
  unsigned int D.17942;
  unsigned int D.17943;
  unsigned int D.17946;
  int D.17947;
  gboolean ret;

  *error = 0;
  D.17938 = length >> 32;
  D.17939 = (unsigned int) D.17938;
  D.17940 = (unsigned int) length;
  D.17941 = position >> 32;
  D.17942 = (unsigned int) D.17941;
  D.17943 = (unsigned int) position;
  ret = UnlockFile (handle, D.17943, D.17942, D.17940, D.17939);
  if (ret == 0) goto <D.17944>; else goto <D.17945>;
  <D.17944>:
  D.17946 = GetLastError ();
  D.17947 = (int) D.17946;
  *error = D.17947;
  <D.17945>:
}


