ves_icall_System_IO_MonoIO_CreateDirectory (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.19946;
  unsigned int D.19949;
  int D.19950;
  MonoBoolean D.19951;
  gboolean ret;

  *error = 0;
  D.19946 = mono_string_chars (path);
  ret = CreateDirectory (D.19946, 0B);
  if (ret == 0) goto <D.19947>; else goto <D.19948>;
  <D.19947>:
  D.19949 = GetLastError ();
  D.19950 = (int) D.19949;
  *error = D.19950;
  <D.19948>:
  D.19951 = (MonoBoolean) ret;
  return D.19951;
}


ves_icall_System_IO_MonoIO_RemoveDirectory (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.19953;
  unsigned int D.19956;
  int D.19957;
  MonoBoolean D.19958;
  gboolean ret;

  *error = 0;
  D.19953 = mono_string_chars (path);
  ret = RemoveDirectory (D.19953);
  if (ret == 0) goto <D.19954>; else goto <D.19955>;
  <D.19954>:
  D.19956 = GetLastError ();
  D.19957 = (int) D.19956;
  *error = D.19957;
  <D.19955>:
  D.19958 = (MonoBoolean) ret;
  return D.19958;
}


ves_icall_System_IO_MonoIO_GetFileSystemEntries (struct MonoString * path, struct MonoString * path_with_pattern, gint attrs, gint mask, gint32 * error)
{
  unsigned int D.19960;
  mono_unichar2 * D.19961;
  unsigned int D.19962;
  int D.19965;
  unsigned int D.19969;
  int D.19970;
  mono_unichar2 * D.19971;
  unsigned int D.19974;
  _Bool D.19975;
  _Bool D.19976;
  _Bool D.19977;
  unsigned int D.19981;
  unsigned int D.19982;
  short unsigned int D.19985;
  unsigned int D.19986;
  unsigned int mask.0;
  unsigned int D.19988;
  unsigned int attrs.1;
  int D.19994;
  int D.19995;
  unsigned int D.19998;
  int D.19999;
  struct MonoClass * D.20001;
  unsigned int D.20002;
  unsigned int i.2;
  void * * D.20004;
  unsigned int i.3;
  unsigned int D.20006;
  void * * D.20007;
  void * D.20008;
  struct MonoString * D.20009;
  unsigned int i.4;
  int D.20013;
  struct MonoArray * D.20016;
  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.19960 = convert_attrs (mask);
      mask = (gint) D.19960;
      D.19961 = mono_string_chars (path);
      D.19962 = get_file_attributes (D.19961);
      attributes = (gint32) D.19962;
      if (attributes != -1) goto <D.19963>; else goto <D.19964>;
      <D.19963>:
      D.19965 = attributes & 16;
      if (D.19965 == 0) goto <D.19966>; else goto <D.19967>;
      <D.19966>:
      *error = 123;
      goto leave;
      <D.19967>:
      goto <D.19968>;
      <D.19964>:
      D.19969 = GetLastError ();
      D.19970 = (int) D.19969;
      *error = D.19970;
      goto leave;
      <D.19968>:
      D.19971 = mono_string_chars (path_with_pattern);
      find_handle = FindFirstFile (D.19971, &data);
      if (find_handle == 4294967295B) goto <D.19972>; else goto <D.19973>;
      <D.19972>:
      {
        gint32 find_error;

        D.19974 = GetLastError ();
        find_error = (gint32) D.19974;
        D.19975 = find_error == 2;
        D.19976 = find_error == 18;
        D.19977 = D.19975 | D.19976;
        if (D.19977 != 0) goto leave; else goto <D.19978>;
        <D.19978>:
        *error = find_error;
        goto leave;
      }
      <D.19973>:
      utf8_path = get_search_dir (path_with_pattern);
      names = monoeg_g_ptr_array_new ();
      <D.19683>:
      D.19981 = BIT_FIELD_REF <data, 32, 352>;
      D.19982 = D.19981;
      if (D.19982 == 46) goto <D.19979>; else goto <D.19983>;
      <D.19983>:
      D.19981 = BIT_FIELD_REF <data, 32, 352>;
      D.19982 = D.19981;
      if (D.19982 == 3014702) goto <D.19984>; else goto <D.19980>;
      <D.19984>:
      D.19985 = data.cFileName[2];
      if (D.19985 == 0) goto <D.19979>; else goto <D.19980>;
      <D.19979>:
      // predicted unlikely by continue predictor.
      goto <D.19682>;
      <D.19980>:
      D.19986 = data.dwFileAttributes;
      mask.0 = (unsigned int) mask;
      D.19988 = D.19986 & mask.0;
      attrs.1 = (unsigned int) attrs;
      if (D.19988 == attrs.1) goto <D.19990>; else goto <D.19991>;
      <D.19990>:
      utf8_result = monoeg_g_utf16_to_utf8 (&data.cFileName, -1, 0B, 0B, 0B);
      if (utf8_result == 0B) goto <D.19992>; else goto <D.19993>;
      <D.19992>:
      // predicted unlikely by continue predictor.
      goto <D.19682>;
      <D.19993>:
      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.19991>:
      <D.19682>:
      D.19994 = FindNextFile (find_handle, &data);
      if (D.19994 != 0) goto <D.19683>; else goto <D.19684>;
      <D.19684>:
      D.19995 = FindClose (find_handle);
      if (D.19995 == 0) goto <D.19996>; else goto <D.19997>;
      <D.19996>:
      D.19998 = GetLastError ();
      D.19999 = (int) D.19998;
      *error = D.19999;
      result = 0B;
      goto <D.20000>;
      <D.19997>:
      D.20001 = mono_defaults.string_class;
      D.20002 = names->len;
      result = mono_array_new (domain, D.20001, D.20002);
      i = 0;
      goto <D.19687>;
      <D.19686>:
      {
        void * * __p;

        i.2 = (unsigned int) i;
        __p = mono_array_addr_with_size (result, 4, i.2);
        D.20004 = names->pdata;
        i.3 = (unsigned int) i;
        D.20006 = i.3 * 4;
        D.20007 = D.20004 + D.20006;
        D.20008 = *D.20007;
        D.20009 = mono_string_new (domain, D.20008);
        mono_gc_wbarrier_set_arrayref (result, __p, D.20009);
      }
      i = i + 1;
      <D.19687>:
      i.4 = (unsigned int) i;
      D.20002 = names->len;
      if (i.4 < D.20002) goto <D.19686>; else goto <D.19688>;
      <D.19688>:
      <D.20000>:
      i = 0;
      goto <D.19690>;
      <D.19689>:
      D.20004 = names->pdata;
      i.3 = (unsigned int) i;
      D.20006 = i.3 * 4;
      D.20007 = D.20004 + D.20006;
      D.20008 = *D.20007;
      monoeg_g_free (D.20008);
      i = i + 1;
      <D.19690>:
      i.4 = (unsigned int) i;
      D.20002 = names->len;
      if (i.4 < D.20002) goto <D.19689>; else goto <D.19691>;
      <D.19691>:
      monoeg_g_ptr_array_free (names, 1);
      monoeg_g_free (utf8_path);
      leave:
      if (result == 0B) goto <D.20011>; else goto <D.20012>;
      <D.20011>:
      D.20013 = *error;
      if (D.20013 == 0) goto <D.20014>; else goto <D.20015>;
      <D.20014>:
      D.20001 = mono_defaults.string_class;
      result = mono_array_new (domain, D.20001, 0);
      <D.20015>:
      <D.20012>:
      D.20016 = result;
      return D.20016;
    }
  finally
    {
      data = {CLOBBER};
    }
}


convert_attrs (MonoFileAttributes attrs)
{
  int D.20019;
  guint32 D.20022;

  D.20019 = attrs & 16384;
  if (D.20019 != 0) goto <D.20020>; else goto <D.20021>;
  <D.20020>:
  attrs = attrs | 64;
  <D.20021>:
  D.20022 = (guint32) attrs;
  return D.20022;
}


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

  try
    {
      res = GetFileAttributes (path);
      if (res != 4294967295) goto <D.20024>; else goto <D.20025>;
      <D.20024>:
      D.20026 = res;
      return D.20026;
      <D.20025>:
      D.20027 = GetLastError ();
      error = (gint32) D.20027;
      if (error != 32) goto <D.20028>; else goto <D.20029>;
      <D.20028>:
      D.20026 = res;
      return D.20026;
      <D.20029>:
      find_handle = FindFirstFile (path, &find_data);
      if (find_handle == 4294967295B) goto <D.20030>; else goto <D.20031>;
      <D.20030>:
      D.20026 = res;
      return D.20026;
      <D.20031>:
      FindClose (find_handle);
      D.20026 = find_data.dwFileAttributes;
      return D.20026;
    }
  finally
    {
      find_data = {CLOBBER};
    }
}


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

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


ves_icall_System_IO_MonoIO_FindFirst (struct MonoString * path, struct MonoString * path_with_pattern, gint32 * result_attr, gint32 * error, void * * handle)
{
  mono_unichar2 * D.20036;
  unsigned int D.20039;
  struct MonoString * D.20042;
  char * D.20043;
  struct MonoDomain * D.20044;
  int D.20045;
  unsigned int D.20048;
  int D.20051;
  unsigned int D.20052;
  int D.20053;
  struct WIN32_FIND_DATA data;
  void * find_handle;
  struct IncrementalFind * ifh;
  struct MonoString * result;

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

        D.20039 = GetLastError ();
        find_error = (gint32) D.20039;
        *handle = 0B;
        if (find_error == 2) goto <D.20040>; else goto <D.20041>;
        <D.20040>:
        D.20042 = 0B;
        return D.20042;
        <D.20041>:
        *error = find_error;
        D.20042 = 0B;
        return D.20042;
      }
      <D.20038>:
      ifh = monoeg_malloc (12);
      ifh->find_handle = find_handle;
      D.20043 = mono_string_to_utf8 (path);
      ifh->utf8_path = D.20043;
      D.20044 = mono_domain_get ();
      ifh->domain = D.20044;
      *handle = ifh;
      goto <D.19718>;
      <D.19717>:
      D.20045 = FindNextFile (find_handle, &data);
      if (D.20045 == 0) goto <D.20046>; else goto <D.20047>;
      <D.20046>:
      {
        int e;

        D.20048 = GetLastError ();
        e = (int) D.20048;
        if (e != 18) goto <D.20049>; else goto <D.20050>;
        <D.20049>:
        *error = e;
        <D.20050>:
        D.20042 = 0B;
        return D.20042;
      }
      <D.20047>:
      <D.19718>:
      D.20051 = incremental_find_check_match (ifh, &data, &result);
      if (D.20051 == 0) goto <D.19717>; else goto <D.19719>;
      <D.19719>:
      D.20052 = data.dwFileAttributes;
      D.20053 = (int) D.20052;
      *result_attr = D.20053;
      D.20042 = result;
      return D.20042;
    }
  finally
    {
      data = {CLOBBER};
      result = {CLOBBER};
    }
}


incremental_find_check_match (struct IncrementalFind * handle, struct WIN32_FIND_DATA * data, struct MonoString * * result)
{
  unsigned int D.20058;
  unsigned int D.20059;
  short unsigned int D.20062;
  gboolean D.20063;
  gunichar2[260] * D.20064;
  gchar * D.20067;
  struct MonoDomain * D.20068;
  struct MonoString * D.20069;
  gchar * utf8_result;
  gchar * full_name;

  D.20058 = BIT_FIELD_REF <*data, 32, 352>;
  D.20059 = D.20058;
  if (D.20059 == 46) goto <D.20056>; else goto <D.20060>;
  <D.20060>:
  D.20058 = BIT_FIELD_REF <*data, 32, 352>;
  D.20059 = D.20058;
  if (D.20059 == 3014702) goto <D.20061>; else goto <D.20057>;
  <D.20061>:
  D.20062 = data->cFileName[2];
  if (D.20062 == 0) goto <D.20056>; else goto <D.20057>;
  <D.20056>:
  D.20063 = 0;
  return D.20063;
  <D.20057>:
  D.20064 = &data->cFileName;
  utf8_result = monoeg_g_utf16_to_utf8 (D.20064, -1, 0B, 0B, 0B);
  if (utf8_result == 0B) goto <D.20065>; else goto <D.20066>;
  <D.20065>:
  D.20063 = 0;
  return D.20063;
  <D.20066>:
  D.20067 = handle->utf8_path;
  full_name = monoeg_g_build_path ("/", D.20067, utf8_result, 0B);
  monoeg_g_free (utf8_result);
  D.20068 = mono_domain_get ();
  D.20069 = mono_string_new (D.20068, full_name);
  *result = D.20069;
  monoeg_g_free (full_name);
  D.20063 = 1;
  return D.20063;
}


ves_icall_System_IO_MonoIO_FindNext (void * handle, gint32 * result_attr, gint32 * error)
{
  void * D.20071;
  int D.20072;
  unsigned int D.20075;
  struct MonoString * D.20078;
  int D.20079;
  unsigned int D.20080;
  int D.20081;
  struct IncrementalFind * ifh;
  struct WIN32_FIND_DATA data;
  struct MonoString * result;

  try
    {
      ifh = handle;
      *error = 0;
      <D.19729>:
      D.20071 = ifh->find_handle;
      D.20072 = FindNextFile (D.20071, &data);
      if (D.20072 == 0) goto <D.20073>; else goto <D.20074>;
      <D.20073>:
      {
        int e;

        D.20075 = GetLastError ();
        e = (int) D.20075;
        if (e != 18) goto <D.20076>; else goto <D.20077>;
        <D.20076>:
        *error = e;
        <D.20077>:
        D.20078 = 0B;
        return D.20078;
      }
      <D.20074>:
      D.20079 = incremental_find_check_match (ifh, &data, &result);
      if (D.20079 == 0) goto <D.19729>; else goto <D.19730>;
      <D.19730>:
      D.20080 = data.dwFileAttributes;
      D.20081 = (int) D.20080;
      *result_attr = D.20081;
      D.20078 = result;
      return D.20078;
    }
  finally
    {
      data = {CLOBBER};
      result = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_FindClose (void * handle)
{
  void * D.20084;
  int D.20085;
  unsigned int D.20088;
  gchar * D.20090;
  int D.20091;
  struct IncrementalFind * ifh;
  gint32 error;

  ifh = handle;
  D.20084 = ifh->find_handle;
  D.20085 = FindClose (D.20084);
  if (D.20085 == 0) goto <D.20086>; else goto <D.20087>;
  <D.20086>:
  D.20088 = GetLastError ();
  error = (gint32) D.20088;
  goto <D.20089>;
  <D.20087>:
  error = 0;
  <D.20089>:
  D.20090 = ifh->utf8_path;
  monoeg_g_free (D.20090);
  monoeg_g_free (ifh);
  D.20091 = error;
  return D.20091;
}


ves_icall_System_IO_MonoIO_GetCurrentDirectory (gint32 * error)
{
  unsigned int len.5;
  unsigned int D.20094;
  unsigned int len.6;
  unsigned int D.20096;
  unsigned int res_len.7;
  unsigned int D.20100;
  unsigned int res_len.8;
  unsigned int D.20102;
  unsigned int old_res_len.9;
  _Bool D.20104;
  gunichar2 * D.20107;
  short unsigned int D.20108;
  struct MonoDomain * D.20109;
  unsigned int D.20111;
  int D.20112;
  struct MonoString * D.20113;
  struct MonoString * result;
  gunichar2 * buf;
  int len;
  int res_len;

  len = 261;
  len.5 = (unsigned int) len;
  D.20094 = len.5 * 2;
  buf = monoeg_malloc (D.20094);
  *error = 0;
  result = 0B;
  len.6 = (unsigned int) len;
  D.20096 = GetCurrentDirectory (len.6, buf);
  res_len = (int) D.20096;
  if (res_len > len) goto <D.20097>; else goto <D.20098>;
  <D.20097>:
  {
    int old_res_len;

    old_res_len = res_len;
    monoeg_g_free (buf);
    res_len.7 = (unsigned int) res_len;
    D.20100 = res_len.7 * 2;
    buf = monoeg_malloc (D.20100);
    res_len.8 = (unsigned int) res_len;
    D.20102 = GetCurrentDirectory (res_len.8, buf);
    old_res_len.9 = (unsigned int) old_res_len;
    D.20104 = D.20102 == old_res_len.9;
    res_len = (int) D.20104;
  }
  <D.20098>:
  if (res_len != 0) goto <D.20105>; else goto <D.20106>;
  <D.20105>:
  len = 0;
  goto <D.19745>;
  <D.19744>:
  len = len + 1;
  <D.19745>:
  len.5 = (unsigned int) len;
  D.20094 = len.5 * 2;
  D.20107 = buf + D.20094;
  D.20108 = *D.20107;
  if (D.20108 != 0) goto <D.19744>; else goto <D.19746>;
  <D.19746>:
  D.20109 = mono_domain_get ();
  result = mono_string_new_utf16 (D.20109, buf, len);
  goto <D.20110>;
  <D.20106>:
  D.20111 = GetLastError ();
  D.20112 = (int) D.20111;
  *error = D.20112;
  <D.20110>:
  monoeg_g_free (buf);
  D.20113 = result;
  return D.20113;
}


ves_icall_System_IO_MonoIO_SetCurrentDirectory (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.20115;
  unsigned int D.20118;
  int D.20119;
  MonoBoolean D.20120;
  gboolean ret;

  *error = 0;
  D.20115 = mono_string_chars (path);
  ret = SetCurrentDirectory (D.20115);
  if (ret == 0) goto <D.20116>; else goto <D.20117>;
  <D.20116>:
  D.20118 = GetLastError ();
  D.20119 = (int) D.20118;
  *error = D.20119;
  <D.20117>:
  D.20120 = (MonoBoolean) ret;
  return D.20120;
}


ves_icall_System_IO_MonoIO_MoveFile (struct MonoString * path, struct MonoString * dest, gint32 * error)
{
  mono_unichar2 * D.20122;
  mono_unichar2 * D.20123;
  unsigned int D.20126;
  int D.20127;
  MonoBoolean D.20128;
  gboolean ret;

  *error = 0;
  D.20122 = mono_string_chars (path);
  D.20123 = mono_string_chars (dest);
  ret = MoveFile (D.20122, D.20123);
  if (ret == 0) goto <D.20124>; else goto <D.20125>;
  <D.20124>:
  D.20126 = GetLastError ();
  D.20127 = (int) D.20126;
  *error = D.20127;
  <D.20125>:
  D.20128 = (MonoBoolean) ret;
  return D.20128;
}


ves_icall_System_IO_MonoIO_ReplaceFile (struct MonoString * sourceFileName, struct MonoString * destinationFileName, struct MonoString * destinationBackupFileName, MonoBoolean ignoreMetadataErrors, gint32 * error)
{
  unsigned int D.20140;
  int D.20141;
  MonoBoolean D.20142;
  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.20130>; else goto <D.20131>;
  <D.20130>:
  utf16_sourceFileName = mono_string_chars (sourceFileName);
  <D.20131>:
  if (destinationFileName != 0B) goto <D.20132>; else goto <D.20133>;
  <D.20132>:
  utf16_destinationFileName = mono_string_chars (destinationFileName);
  <D.20133>:
  if (destinationBackupFileName != 0B) goto <D.20134>; else goto <D.20135>;
  <D.20134>:
  utf16_destinationBackupFileName = mono_string_chars (destinationBackupFileName);
  <D.20135>:
  *error = 0;
  if (ignoreMetadataErrors != 0) goto <D.20136>; else goto <D.20137>;
  <D.20136>:
  replaceFlags = replaceFlags | 2;
  <D.20137>:
  ret = ReplaceFile (utf16_destinationFileName, utf16_sourceFileName, utf16_destinationBackupFileName, replaceFlags, 0B, 0B);
  if (ret == 0) goto <D.20138>; else goto <D.20139>;
  <D.20138>:
  D.20140 = GetLastError ();
  D.20141 = (int) D.20140;
  *error = D.20141;
  <D.20139>:
  D.20142 = (MonoBoolean) ret;
  return D.20142;
}


ves_icall_System_IO_MonoIO_CopyFile (struct MonoString * path, struct MonoString * dest, MonoBoolean overwrite, gint32 * error)
{
  mono_unichar2 * D.20144;
  mono_unichar2 * D.20145;
  _Bool D.20146;
  int D.20147;
  unsigned int D.20150;
  int D.20151;
  MonoBoolean D.20152;
  gboolean ret;

  *error = 0;
  D.20144 = mono_string_chars (path);
  D.20145 = mono_string_chars (dest);
  D.20146 = overwrite == 0;
  D.20147 = (int) D.20146;
  ret = CopyFile (D.20144, D.20145, D.20147);
  if (ret == 0) goto <D.20148>; else goto <D.20149>;
  <D.20148>:
  D.20150 = GetLastError ();
  D.20151 = (int) D.20150;
  *error = D.20151;
  <D.20149>:
  D.20152 = (MonoBoolean) ret;
  return D.20152;
}


ves_icall_System_IO_MonoIO_DeleteFile (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.20154;
  unsigned int D.20157;
  int D.20158;
  MonoBoolean D.20159;
  gboolean ret;

  *error = 0;
  D.20154 = mono_string_chars (path);
  ret = DeleteFile (D.20154);
  if (ret == 0) goto <D.20155>; else goto <D.20156>;
  <D.20155>:
  D.20157 = GetLastError ();
  D.20158 = (int) D.20157;
  *error = D.20158;
  <D.20156>:
  D.20159 = (MonoBoolean) ret;
  return D.20159;
}


ves_icall_System_IO_MonoIO_GetFileAttributes (struct MonoString * path, gint32 * error)
{
  mono_unichar2 * D.20161;
  unsigned int D.20162;
  unsigned int D.20165;
  int D.20166;
  gint32 D.20167;
  gint32 ret;

  *error = 0;
  D.20161 = mono_string_chars (path);
  D.20162 = get_file_attributes (D.20161);
  ret = (gint32) D.20162;
  if (ret == -1) goto <D.20163>; else goto <D.20164>;
  <D.20163>:
  D.20165 = GetLastError ();
  D.20166 = (int) D.20165;
  *error = D.20166;
  <D.20164>:
  D.20167 = ret;
  return D.20167;
}


ves_icall_System_IO_MonoIO_SetFileAttributes (struct MonoString * path, gint32 attrs, gint32 * error)
{
  mono_unichar2 * D.20169;
  unsigned int D.20170;
  unsigned int D.20173;
  int D.20174;
  MonoBoolean D.20175;
  gboolean ret;

  *error = 0;
  D.20169 = mono_string_chars (path);
  D.20170 = convert_attrs (attrs);
  ret = SetFileAttributes (D.20169, D.20170);
  if (ret == 0) goto <D.20171>; else goto <D.20172>;
  <D.20171>:
  D.20173 = GetLastError ();
  D.20174 = (int) D.20173;
  *error = D.20174;
  <D.20172>:
  D.20175 = (MonoBoolean) ret;
  return D.20175;
}


ves_icall_System_IO_MonoIO_GetFileType (void * handle, gint32 * error)
{
  <unnamed type> D.20177;
  unsigned int D.20180;
  int D.20181;
  gint32 D.20182;
  gboolean ret;

  *error = 0;
  D.20177 = GetFileType (handle);
  ret = (gboolean) D.20177;
  if (ret == 0) goto <D.20178>; else goto <D.20179>;
  <D.20178>:
  D.20180 = GetLastError ();
  D.20181 = (int) D.20180;
  *error = D.20181;
  <D.20179>:
  D.20182 = ret;
  return D.20182;
}


ves_icall_System_IO_MonoIO_GetFileStat (struct MonoString * path, struct MonoIOStat * stat, gint32 * error)
{
  mono_unichar2 * D.20184;
  unsigned int D.20188;
  int D.20189;
  MonoBoolean D.20190;
  gboolean result;
  struct WIN32_FILE_ATTRIBUTE_DATA data;

  try
    {
      *error = 0;
      D.20184 = mono_string_chars (path);
      result = get_file_attributes_ex (D.20184, &data);
      if (result != 0) goto <D.20185>; else goto <D.20186>;
      <D.20185>:
      convert_win32_file_attribute_data (&data, stat);
      goto <D.20187>;
      <D.20186>:
      D.20188 = GetLastError ();
      D.20189 = (int) D.20188;
      *error = D.20189;
      memset (stat, 0, 40);
      <D.20187>:
      D.20190 = (MonoBoolean) result;
      return D.20190;
    }
  finally
    {
      data = {CLOBBER};
    }
}


get_file_attributes_ex (const gunichar2 * path, struct WIN32_FILE_ATTRIBUTE_DATA * data)
{
  gboolean D.20195;
  unsigned int D.20196;
  unsigned int D.20201;
  unsigned int D.20202;
  unsigned int D.20203;
  gboolean res;
  struct WIN32_FIND_DATA find_data;
  void * find_handle;
  gint32 error;

  try
    {
      res = GetFileAttributesEx (path, 0, data);
      if (res != 0) goto <D.20193>; else goto <D.20194>;
      <D.20193>:
      D.20195 = 1;
      return D.20195;
      <D.20194>:
      D.20196 = GetLastError ();
      error = (gint32) D.20196;
      if (error != 32) goto <D.20197>; else goto <D.20198>;
      <D.20197>:
      D.20195 = 0;
      return D.20195;
      <D.20198>:
      find_handle = FindFirstFile (path, &find_data);
      if (find_handle == 4294967295B) goto <D.20199>; else goto <D.20200>;
      <D.20199>:
      D.20195 = 0;
      return D.20195;
      <D.20200>:
      FindClose (find_handle);
      D.20201 = find_data.dwFileAttributes;
      data->dwFileAttributes = D.20201;
      data->ftCreationTime = find_data.ftCreationTime;
      data->ftLastAccessTime = find_data.ftLastAccessTime;
      data->ftLastWriteTime = find_data.ftLastWriteTime;
      D.20202 = find_data.nFileSizeHigh;
      data->nFileSizeHigh = D.20202;
      D.20203 = find_data.nFileSizeLow;
      data->nFileSizeLow = D.20203;
      D.20195 = 1;
      return D.20195;
    }
  finally
    {
      find_data = {CLOBBER};
    }
}


convert_win32_file_attribute_data (const struct WIN32_FILE_ATTRIBUTE_DATA * data, struct MonoIOStat * stat)
{
  unsigned int D.20206;
  int D.20207;
  const struct WapiFileTime * D.20208;
  long long int D.20209;
  const struct WapiFileTime * D.20210;
  long long int D.20211;
  const struct WapiFileTime * D.20212;
  long long int D.20213;
  unsigned int D.20214;
  long long int D.20215;
  long long int D.20216;
  unsigned int D.20217;
  long long int D.20218;
  long long int D.20219;

  D.20206 = data->dwFileAttributes;
  D.20207 = (int) D.20206;
  stat->attributes = D.20207;
  D.20208 = &data->ftCreationTime;
  D.20209 = convert_filetime (D.20208);
  stat->creation_time = D.20209;
  D.20210 = &data->ftLastAccessTime;
  D.20211 = convert_filetime (D.20210);
  stat->last_access_time = D.20211;
  D.20212 = &data->ftLastWriteTime;
  D.20213 = convert_filetime (D.20212);
  stat->last_write_time = D.20213;
  D.20214 = data->nFileSizeHigh;
  D.20215 = (long long int) D.20214;
  D.20216 = D.20215 << 32;
  D.20217 = data->nFileSizeLow;
  D.20218 = (long long int) D.20217;
  D.20219 = D.20216 | D.20218;
  stat->length = D.20219;
}


convert_filetime (const struct FILETIME * filetime)
{
  unsigned int D.20220;
  unsigned int D.20221;
  long long unsigned int D.20222;
  gint64 D.20223;
  guint64 ticks;

  D.20220 = filetime->dwHighDateTime;
  ticks = (guint64) D.20220;
  ticks = ticks << 32;
  D.20221 = filetime->dwLowDateTime;
  D.20222 = (long long unsigned int) D.20221;
  ticks = D.20222 + ticks;
  D.20223 = (gint64) ticks;
  return D.20223;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.20227;
  int D.20232;
  void * D.20234;
  unsigned int D.20235;

  D.20227 = __builtin_constant_p (__len);
  if (D.20227 != 0) goto <D.20228>; else goto <D.20229>;
  <D.20228>:
  if (__len == 0) goto <D.20230>; else goto <D.20231>;
  <D.20230>:
  D.20232 = __builtin_constant_p (__ch);
  if (D.20232 == 0) goto <D.20225>; else goto <D.20233>;
  <D.20233>:
  if (__ch != 0) goto <D.20225>; else goto <D.20226>;
  <D.20225>:
  __warn_memset_zero_len ();
  D.20234 = __dest;
  return D.20234;
  <D.20226>:
  <D.20231>:
  <D.20229>:
  D.20235 = __builtin_object_size (__dest, 0);
  D.20234 = __builtin___memset_chk (__dest, __ch, __len, D.20235);
  return D.20234;
}


ves_icall_System_IO_MonoIO_Open (struct MonoString * filename, gint32 mode, gint32 access_mode, gint32 share, gint32 options, gint32 * error)
{
  int D.20239;
  int D.20243;
  int D.20246;
  int D.20249;
  int D.20252;
  int D.20255;
  unsigned int attributes.10;
  unsigned int D.20261;
  unsigned int D.20263;
  int D.20266;
  <unnamed type> access_mode.11;
  unsigned int D.20270;
  <unnamed type> share.12;
  unsigned int D.20272;
  <unnamed type> mode.13;
  unsigned int D.20274;
  unsigned int attributes.14;
  unsigned int D.20278;
  int D.20279;
  void * D.20280;
  void * ret;
  int attributes;
  int attrs;
  gunichar2 * chars;

  chars = mono_string_chars (filename);
  *error = 0;
  if (options != 0) goto <D.20237>; else goto <D.20238>;
  <D.20237>:
  D.20239 = options & 16384;
  if (D.20239 != 0) goto <D.20240>; else goto <D.20241>;
  <D.20240>:
  attributes = 64;
  goto <D.20242>;
  <D.20241>:
  attributes = 128;
  <D.20242>:
  D.20243 = options & 67108864;
  if (D.20243 != 0) goto <D.20244>; else goto <D.20245>;
  <D.20244>:
  attributes = attributes | 67108864;
  <D.20245>:
  D.20246 = options & 134217728;
  if (D.20246 != 0) goto <D.20247>; else goto <D.20248>;
  <D.20247>:
  attributes = attributes | 134217728;
  <D.20248>:
  D.20249 = options & 268435456;
  if (D.20249 != 0) goto <D.20250>; else goto <D.20251>;
  <D.20250>:
  attributes = attributes | 268435456;
  <D.20251>:
  D.20252 = options & 1;
  if (D.20252 != 0) goto <D.20253>; else goto <D.20254>;
  <D.20253>:
  attributes = attributes | 256;
  <D.20254>:
  D.20255 = options & 1073741824;
  if (D.20255 != 0) goto <D.20256>; else goto <D.20257>;
  <D.20256>:
  attributes = attributes | 1073741824;
  <D.20257>:
  if (options < 0) goto <D.20258>; else goto <D.20259>;
  <D.20258>:
  attributes.10 = (unsigned int) attributes;
  D.20261 = attributes.10 | 2147483648;
  attributes = (int) D.20261;
  <D.20259>:
  goto <D.20262>;
  <D.20238>:
  attributes = 128;
  <D.20262>:
  D.20263 = get_file_attributes (chars);
  attrs = (int) D.20263;
  if (attrs != -1) goto <D.20264>; else goto <D.20265>;
  <D.20264>:
  D.20266 = attrs & 16;
  if (D.20266 != 0) goto <D.20267>; else goto <D.20268>;
  <D.20267>:
  attributes = attributes | 33554432;
  <D.20268>:
  <D.20265>:
  access_mode.11 = (<unnamed type>) access_mode;
  D.20270 = convert_access (access_mode.11);
  share.12 = (<unnamed type>) share;
  D.20272 = convert_share (share.12);
  mode.13 = (<unnamed type>) mode;
  D.20274 = convert_mode (mode.13);
  attributes.14 = (unsigned int) attributes;
  ret = CreateFile (chars, D.20270, D.20272, 0B, D.20274, attributes.14, 0B);
  if (ret == 4294967295B) goto <D.20276>; else goto <D.20277>;
  <D.20276>:
  D.20278 = GetLastError ();
  D.20279 = (int) D.20278;
  *error = D.20279;
  <D.20277>:
  D.20280 = ret;
  return D.20280;
}


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

  switch (mono_access) <default: <D.19608>, case 1: <D.19604>, case 2: <D.19606>, case 3: <D.19607>>
  <D.19604>:
  access = 2147483648;
  goto <D.19605>;
  <D.19606>:
  access = 1073741824;
  goto <D.19605>;
  <D.19607>:
  access = 3221225472;
  goto <D.19605>;
  <D.19608>:
  monoeg_g_log (0B, 16, "System.IO.FileAccess has unknown value 0x%x", mono_access);
  access = 2147483648;
  <D.19605>:
  D.20282 = access;
  return D.20282;
}


convert_share (MonoFileShare mono_share)
{
  unsigned int D.20284;
  unsigned int D.20287;
  unsigned int D.20290;
  unsigned int D.20293;
  guint32 D.20296;
  guint32 share;

  share = 0;
  D.20284 = mono_share & 1;
  if (D.20284 != 0) goto <D.20285>; else goto <D.20286>;
  <D.20285>:
  share = share | 1;
  <D.20286>:
  D.20287 = mono_share & 2;
  if (D.20287 != 0) goto <D.20288>; else goto <D.20289>;
  <D.20288>:
  share = share | 2;
  <D.20289>:
  D.20290 = mono_share & 4;
  if (D.20290 != 0) goto <D.20291>; else goto <D.20292>;
  <D.20291>:
  share = share | 4;
  <D.20292>:
  D.20293 = mono_share & 4294967288;
  if (D.20293 != 0) goto <D.20294>; else goto <D.20295>;
  <D.20294>:
  monoeg_g_log (0B, 16, "System.IO.FileShare has unknown value 0x%x", mono_share);
  share = 0;
  <D.20295>:
  D.20296 = share;
  return D.20296;
}


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

  switch (mono_mode) <default: <D.19599>, case 1: <D.19592>, case 2: <D.19594>, case 3: <D.19595>, case 4: <D.19596>, case 5: <D.19597>, case 6: <D.19598>>
  <D.19592>:
  mode = 1;
  goto <D.19593>;
  <D.19594>:
  mode = 2;
  goto <D.19593>;
  <D.19595>:
  mode = 3;
  goto <D.19593>;
  <D.19596>:
  mode = 4;
  goto <D.19593>;
  <D.19597>:
  mode = 5;
  goto <D.19593>;
  <D.19598>:
  mode = 4;
  goto <D.19593>;
  <D.19599>:
  monoeg_g_log (0B, 16, "System.IO.FileMode has unknown value 0x%x", mono_mode);
  mode = 3;
  <D.19593>:
  D.20298 = mode;
  return D.20298;
}


ves_icall_System_IO_MonoIO_Close (void * handle, gint32 * error)
{
  unsigned int D.20302;
  int D.20303;
  MonoBoolean D.20304;
  gboolean ret;

  *error = 0;
  ret = CloseHandle (handle);
  if (ret == 0) goto <D.20300>; else goto <D.20301>;
  <D.20300>:
  D.20302 = GetLastError ();
  D.20303 = (int) D.20302;
  *error = D.20303;
  <D.20301>:
  D.20304 = (MonoBoolean) ret;
  return D.20304;
}


ves_icall_System_IO_MonoIO_Read (void * handle, struct MonoArray * dest, gint32 dest_offset, gint32 count, gint32 * error)
{
  _Bool D.20306;
  long int D.20307;
  long int D.20308;
  unsigned int dest_offset.15;
  unsigned int D.20314;
  unsigned int count.16;
  unsigned int D.20316;
  struct MonoException * D.20319;
  unsigned int count.17;
  unsigned int D.20323;
  int D.20324;
  gint32 D.20325;
  unsigned int n.18;
  guchar * buffer;
  gboolean result;
  guint32 n;

  try
    {
      *error = 0;
      D.20306 = dest == 0B;
      D.20307 = (long int) D.20306;
      D.20308 = __builtin_expect (D.20307, 0);
      if (D.20308 != 0) goto <D.20309>; else goto <D.20310>;
      <D.20309>:
      {
        struct MonoException * ex;

        if (dest != 0B) goto <D.20311>; else goto <D.20312>;
        <D.20311>:
        <D.20312>:
        ex = mono_get_exception_argument_null ("dest");
        mono_raise_exception (ex);
      }
      <D.20310>:
      dest_offset.15 = (unsigned int) dest_offset;
      D.20314 = mono_array_length (dest);
      count.16 = (unsigned int) count;
      D.20316 = D.20314 - count.16;
      if (dest_offset.15 > D.20316) goto <D.20317>; else goto <D.20318>;
      <D.20317>:
      D.20319 = mono_get_exception_argument ("array", "array too small. numBytes/offset wrong.");
      mono_raise_exception (D.20319);
      <D.20318>:
      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.20321>; else goto <D.20322>;
      <D.20321>:
      D.20323 = GetLastError ();
      D.20324 = (int) D.20323;
      *error = D.20324;
      D.20325 = -1;
      return D.20325;
      <D.20322>:
      n.18 = n;
      D.20325 = (gint32) n.18;
      return D.20325;
    }
  finally
    {
      n = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_Write (void * handle, struct MonoArray * src, gint32 src_offset, gint32 count, gint32 * error)
{
  _Bool D.20329;
  long int D.20330;
  long int D.20331;
  unsigned int src_offset.19;
  unsigned int D.20337;
  unsigned int count.20;
  unsigned int D.20339;
  struct MonoException * D.20342;
  unsigned int count.21;
  unsigned int D.20346;
  int D.20347;
  gint32 D.20348;
  unsigned int n.22;
  guchar * buffer;
  gboolean result;
  guint32 n;

  try
    {
      *error = 0;
      D.20329 = src == 0B;
      D.20330 = (long int) D.20329;
      D.20331 = __builtin_expect (D.20330, 0);
      if (D.20331 != 0) goto <D.20332>; else goto <D.20333>;
      <D.20332>:
      {
        struct MonoException * ex;

        if (src != 0B) goto <D.20334>; else goto <D.20335>;
        <D.20334>:
        <D.20335>:
        ex = mono_get_exception_argument_null ("src");
        mono_raise_exception (ex);
      }
      <D.20333>:
      src_offset.19 = (unsigned int) src_offset;
      D.20337 = mono_array_length (src);
      count.20 = (unsigned int) count;
      D.20339 = D.20337 - count.20;
      if (src_offset.19 > D.20339) goto <D.20340>; else goto <D.20341>;
      <D.20340>:
      D.20342 = mono_get_exception_argument ("array", "array too small. numBytes/offset wrong.");
      mono_raise_exception (D.20342);
      <D.20341>:
      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.20344>; else goto <D.20345>;
      <D.20344>:
      D.20346 = GetLastError ();
      D.20347 = (int) D.20346;
      *error = D.20347;
      D.20348 = -1;
      return D.20348;
      <D.20345>:
      n.22 = n;
      D.20348 = (gint32) n.22;
      return D.20348;
    }
  finally
    {
      n = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_Seek (void * handle, gint64 offset, gint32 origin, gint32 * error)
{
  long long int D.20352;
  int offset_hi.23;
  int D.20354;
  <unnamed type> origin.24;
  unsigned int D.20356;
  unsigned int D.20357;
  unsigned int D.20360;
  int D.20361;
  gint64 D.20362;
  int offset_hi.25;
  long long int D.20364;
  long long int D.20365;
  gint32 offset_hi;

  try
    {
      *error = 0;
      D.20352 = offset >> 32;
      offset_hi.23 = (int) D.20352;
      offset_hi = offset_hi.23;
      D.20354 = (int) offset;
      origin.24 = (<unnamed type>) origin;
      D.20356 = convert_seekorigin (origin.24);
      D.20357 = SetFilePointer (handle, D.20354, &offset_hi, D.20356);
      offset = (gint64) D.20357;
      if (offset == 4294967295) goto <D.20358>; else goto <D.20359>;
      <D.20358>:
      D.20360 = GetLastError ();
      D.20361 = (int) D.20360;
      *error = D.20361;
      <D.20359>:
      offset_hi.25 = offset_hi;
      D.20364 = (long long int) offset_hi.25;
      D.20365 = D.20364 << 32;
      D.20362 = D.20365 | offset;
      return D.20362;
    }
  finally
    {
      offset_hi = {CLOBBER};
    }
}


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

  switch (origin) <default: <D.19621>, case 0: <D.19617>, case 1: <D.19619>, case 2: <D.19620>>
  <D.19617>:
  w32origin = 0;
  goto <D.19618>;
  <D.19619>:
  w32origin = 1;
  goto <D.19618>;
  <D.19620>:
  w32origin = 2;
  goto <D.19618>;
  <D.19621>:
  monoeg_g_log (0B, 16, "System.IO.SeekOrigin has unknown value 0x%x", origin);
  w32origin = 1;
  <D.19618>:
  D.20368 = w32origin;
  return D.20368;
}


ves_icall_System_IO_MonoIO_Flush (void * handle, gint32 * error)
{
  unsigned int D.20372;
  int D.20373;
  MonoBoolean D.20374;
  gboolean ret;

  *error = 0;
  ret = FlushFileBuffers (handle);
  if (ret == 0) goto <D.20370>; else goto <D.20371>;
  <D.20370>:
  D.20372 = GetLastError ();
  D.20373 = (int) D.20372;
  *error = D.20373;
  <D.20371>:
  D.20374 = (MonoBoolean) ret;
  return D.20374;
}


ves_icall_System_IO_MonoIO_GetLength (void * handle, gint32 * error)
{
  unsigned int D.20376;
  unsigned int D.20379;
  int D.20380;
  gint64 D.20381;
  unsigned int length_hi.26;
  long long int D.20383;
  long long int D.20384;
  gint64 length;
  guint32 length_hi;

  try
    {
      *error = 0;
      D.20376 = GetFileSize (handle, &length_hi);
      length = (gint64) D.20376;
      if (length == 4294967295) goto <D.20377>; else goto <D.20378>;
      <D.20377>:
      D.20379 = GetLastError ();
      D.20380 = (int) D.20379;
      *error = D.20380;
      <D.20378>:
      length_hi.26 = length_hi;
      D.20383 = (long long int) length_hi.26;
      D.20384 = D.20383 << 32;
      D.20381 = D.20384 | length;
      return D.20381;
    }
  finally
    {
      length_hi = {CLOBBER};
    }
}


ves_icall_System_IO_MonoIO_SetLength (void * handle, gint64 length, gint32 * error)
{
  unsigned int D.20387;
  unsigned int D.20390;
  int D.20391;
  MonoBoolean D.20392;
  long long int D.20393;
  int length_hi.27;
  int D.20395;
  unsigned int D.20396;
  unsigned int D.20399;
  int D.20400;
  unsigned int D.20403;
  int D.20404;
  int D.20405;
  unsigned int D.20406;
  unsigned int D.20409;
  int D.20410;
  gint64 offset;
  gint64 offset_set;
  gint32 offset_hi;
  gint32 length_hi;
  gboolean result;

  try
    {
      *error = 0;
      offset_hi = 0;
      D.20387 = SetFilePointer (handle, 0, &offset_hi, 1);
      offset = (gint64) D.20387;
      if (offset == 4294967295) goto <D.20388>; else goto <D.20389>;
      <D.20388>:
      D.20390 = GetLastError ();
      D.20391 = (int) D.20390;
      *error = D.20391;
      D.20392 = 0;
      return D.20392;
      <D.20389>:
      D.20393 = length >> 32;
      length_hi.27 = (int) D.20393;
      length_hi = length_hi.27;
      D.20395 = (int) length;
      D.20396 = SetFilePointer (handle, D.20395, &length_hi, 0);
      offset_set = (gint64) D.20396;
      if (offset_set == 4294967295) goto <D.20397>; else goto <D.20398>;
      <D.20397>:
      D.20399 = GetLastError ();
      D.20400 = (int) D.20399;
      *error = D.20400;
      D.20392 = 0;
      return D.20392;
      <D.20398>:
      result = SetEndOfFile (handle);
      if (result == 0) goto <D.20401>; else goto <D.20402>;
      <D.20401>:
      D.20403 = GetLastError ();
      D.20404 = (int) D.20403;
      *error = D.20404;
      D.20392 = 0;
      return D.20392;
      <D.20402>:
      D.20405 = (int) offset;
      D.20406 = SetFilePointer (handle, D.20405, &offset_hi, 0);
      offset_set = (gint64) D.20406;
      if (offset_set == 4294967295) goto <D.20407>; else goto <D.20408>;
      <D.20407>:
      D.20409 = GetLastError ();
      D.20410 = (int) D.20409;
      *error = D.20410;
      D.20392 = 0;
      return D.20392;
      <D.20408>:
      D.20392 = (MonoBoolean) result;
      return D.20392;
    }
  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.20427;
  int D.20428;
  MonoBoolean D.20429;
  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.20414>; else goto <D.20415>;
  <D.20414>:
  creation_filetime = 0B;
  goto <D.20416>;
  <D.20415>:
  creation_filetime = &creation_time;
  <D.20416>:
  last_access_time.29 = last_access_time;
  if (last_access_time.29 < 0) goto <D.20418>; else goto <D.20419>;
  <D.20418>:
  last_access_filetime = 0B;
  goto <D.20420>;
  <D.20419>:
  last_access_filetime = &last_access_time;
  <D.20420>:
  last_write_time.30 = last_write_time;
  if (last_write_time.30 < 0) goto <D.20422>; else goto <D.20423>;
  <D.20422>:
  last_write_filetime = 0B;
  goto <D.20424>;
  <D.20423>:
  last_write_filetime = &last_write_time;
  <D.20424>:
  ret = SetFileTime (handle, creation_filetime, last_access_filetime, last_write_filetime);
  if (ret == 0) goto <D.20425>; else goto <D.20426>;
  <D.20425>:
  D.20427 = GetLastError ();
  D.20428 = (int) D.20427;
  *error = D.20428;
  <D.20426>:
  D.20429 = (MonoBoolean) ret;
  return D.20429;
}


ves_icall_System_IO_MonoIO_get_ConsoleOutput ()
{
  void * D.20431;

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


ves_icall_System_IO_MonoIO_get_ConsoleInput ()
{
  void * D.20433;

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


ves_icall_System_IO_MonoIO_get_ConsoleError ()
{
  void * D.20435;

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


ves_icall_System_IO_MonoIO_CreatePipe (void * * read_handle, void * * write_handle)
{
  MonoBoolean D.20439;
  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.20437>; else goto <D.20438>;
      <D.20437>:
      D.20439 = 0;
      return D.20439;
      <D.20438>:
      D.20439 = 1;
      return D.20439;
    }
  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 access.31;
  unsigned int options.32;
  MonoBoolean D.20446;
  gboolean ret;

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


ves_icall_System_IO_MonoIO_get_VolumeSeparatorChar ()
{
  gunichar2 D.20448;

  D.20448 = 47;
  return D.20448;
}


ves_icall_System_IO_MonoIO_get_DirectorySeparatorChar ()
{
  gunichar2 D.20450;

  D.20450 = 47;
  return D.20450;
}


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

  __mono_io_portability_helpers.33 = __mono_io_portability_helpers;
  if (__mono_io_portability_helpers.33 > 0) goto <D.20453>; else goto <D.20454>;
  <D.20453>:
  D.20455 = 92;
  return D.20455;
  <D.20454>:
  D.20455 = 47;
  return D.20455;
}


ves_icall_System_IO_MonoIO_get_PathSeparator ()
{
  gunichar2 D.20457;

  D.20457 = 58;
  return D.20457;
}


ves_icall_System_IO_MonoIO_get_InvalidPathChars ()
{
  struct MonoClass * D.20459;
  unsigned int n.34;
  unsigned int i.35;
  short unsigned int D.20462;
  struct MonoArray * D.20463;
  struct MonoArray * chars;
  struct MonoDomain * domain;
  int i;
  int n;

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

    i.35 = (unsigned int) i;
    __p = mono_array_addr_with_size (chars, 2, i.35);
    D.20462 = 0;
    *__p = D.20462;
  }
  i = i + 1;
  <D.19922>:
  if (i < n) goto <D.19921>; else goto <D.19923>;
  <D.19923>:
  D.20463 = chars;
  return D.20463;
}


ves_icall_System_IO_MonoIO_GetTempPath (struct MonoString * * mono_name)
{
  unsigned int D.20465;
  int D.20468;
  unsigned int D.20469;
  unsigned int D.20470;
  unsigned int ret.36;
  unsigned int D.20472;
  struct MonoDomain * D.20475;
  struct MonoString * D.20476;
  gint32 D.20477;
  gunichar2 * name;
  int ret;

  name = monoeg_malloc0 (512);
  D.20465 = GetTempPath (256, name);
  ret = (int) D.20465;
  if (ret > 255) goto <D.20466>; else goto <D.20467>;
  <D.20466>:
  monoeg_g_free (name);
  D.20468 = ret + 2;
  D.20469 = (unsigned int) D.20468;
  D.20470 = D.20469 * 2;
  name = monoeg_malloc0 (D.20470);
  ret.36 = (unsigned int) ret;
  D.20472 = GetTempPath (ret.36, name);
  ret = (int) D.20472;
  <D.20467>:
  if (ret > 0) goto <D.20473>; else goto <D.20474>;
  <D.20473>:
  D.20475 = mono_domain_get ();
  D.20476 = mono_string_new_utf16 (D.20475, name, ret);
  mono_gc_wbarrier_generic_store (mono_name, D.20476);
  <D.20474>:
  monoeg_g_free (name);
  D.20477 = ret;
  return D.20477;
}


ves_icall_System_IO_MonoIO_Lock (void * handle, gint64 position, gint64 length, gint32 * error)
{
  unsigned int D.20479;
  long long int D.20480;
  unsigned int D.20481;
  unsigned int D.20482;
  long long int D.20483;
  unsigned int D.20484;
  unsigned int D.20487;
  int D.20488;
  gboolean ret;

  *error = 0;
  D.20479 = (unsigned int) position;
  D.20480 = position >> 32;
  D.20481 = (unsigned int) D.20480;
  D.20482 = (unsigned int) length;
  D.20483 = length >> 32;
  D.20484 = (unsigned int) D.20483;
  ret = LockFile (handle, D.20479, D.20481, D.20482, D.20484);
  if (ret == 0) goto <D.20485>; else goto <D.20486>;
  <D.20485>:
  D.20487 = GetLastError ();
  D.20488 = (int) D.20487;
  *error = D.20488;
  <D.20486>:
}


ves_icall_System_IO_MonoIO_Unlock (void * handle, gint64 position, gint64 length, gint32 * error)
{
  unsigned int D.20489;
  long long int D.20490;
  unsigned int D.20491;
  unsigned int D.20492;
  long long int D.20493;
  unsigned int D.20494;
  unsigned int D.20497;
  int D.20498;
  gboolean ret;

  *error = 0;
  D.20489 = (unsigned int) position;
  D.20490 = position >> 32;
  D.20491 = (unsigned int) D.20490;
  D.20492 = (unsigned int) length;
  D.20493 = length >> 32;
  D.20494 = (unsigned int) D.20493;
  ret = UnlockFile (handle, D.20489, D.20491, D.20492, D.20494);
  if (ret == 0) goto <D.20495>; else goto <D.20496>;
  <D.20495>:
  D.20497 = GetLastError ();
  D.20498 = (int) D.20497;
  *error = D.20498;
  <D.20496>:
}


