ves_icall_System_Diagnostics_Process_GetProcess_internal (guint32 pid)
{
  void * D.18989;
  void * handle;

  handle = OpenProcess (2035711, 1, pid);
  if (handle == 0B) goto <D.18987>; else goto <D.18988>;
  <D.18987>:
  D.18989 = 0B;
  return D.18989;
  <D.18988>:
  D.18989 = handle;
  return D.18989;
}


ves_icall_System_Diagnostics_Process_GetPid_internal ()
{
  guint32 D.18991;

  D.18991 = GetCurrentProcessId ();
  return D.18991;
}


ves_icall_System_Diagnostics_Process_Process_free_internal (struct MonoObject * this, void * process)
{
  CloseProcess (process);
}


ves_icall_System_Diagnostics_Process_GetModules_internal (struct MonoObject * this, void * process)
{
  struct MonoImage * system_assembly.0;
  struct MonoVTable * D.18996;
  struct MonoClass * D.18997;
  struct MonoImage * system_assembly.1;
  int D.18999;
  unsigned int needed.2;
  struct MonoDomain * D.19003;
  struct MonoClass * D.19004;
  void * D.19005;
  unsigned int D.19006;
  unsigned int D.19009;
  unsigned int num_added.3;
  struct MonoDomain * D.19016;
  struct MonoClass * D.19017;
  char * D.19018;
  struct MonoObject * D.19019;
  struct MonoArray * D.19020;
  struct MonoArray * temp_arr;
  struct MonoArray * arr;
  void * mods[1024];
  gunichar2 filename[260];
  gunichar2 modname[260];
  DWORD needed;
  guint32 count;
  guint32 i;
  guint32 num_added;

  try
    {
      temp_arr = 0B;
      count = 0;
      num_added = 0;
      system_assembly.0 = system_assembly;
      if (system_assembly.0 == 0B) goto <D.18994>; else goto <D.18995>;
      <D.18994>:
      D.18996 = this->vtable;
      D.18997 = D.18996->klass;
      system_assembly.1 = D.18997->image;
      system_assembly = system_assembly.1;
      <D.18995>:
      D.18999 = EnumProcessModules (process, &mods, 4096, &needed);
      if (D.18999 != 0) goto <D.19000>; else goto <D.19001>;
      <D.19000>:
      needed.2 = needed;
      count = needed.2 / 4;
      D.19003 = mono_domain_get ();
      D.19004 = mono_get_object_class ();
      temp_arr = mono_array_new (D.19003, D.19004, count);
      i = 0;
      goto <D.18815>;
      <D.18814>:
      D.19005 = mods[i];
      D.19006 = GetModuleBaseName (process, D.19005, &modname, 260);
      if (D.19006 != 0) goto <D.19007>; else goto <D.19008>;
      <D.19007>:
      D.19005 = mods[i];
      D.19009 = GetModuleFileNameEx (process, D.19005, &filename, 260);
      if (D.19009 != 0) goto <D.19010>; else goto <D.19011>;
      <D.19010>:
      {
        struct MonoObject * module;

        D.19005 = mods[i];
        module = process_add_module (process, D.19005, &filename, &modname);
        {
          void * * __p;

          num_added.3 = num_added;
          num_added = num_added.3 + 1;
          __p = mono_array_addr_with_size (temp_arr, 4, num_added.3);
          mono_gc_wbarrier_set_arrayref (temp_arr, __p, module);
        }
      }
      <D.19011>:
      <D.19008>:
      i = i + 1;
      <D.18815>:
      if (i < count) goto <D.18814>; else goto <D.18816>;
      <D.18816>:
      <D.19001>:
      if (count == num_added) goto <D.19013>; else goto <D.19014>;
      <D.19013>:
      arr = temp_arr;
      goto <D.19015>;
      <D.19014>:
      D.19016 = mono_domain_get ();
      D.19017 = mono_get_object_class ();
      arr = mono_array_new (D.19016, D.19017, num_added);
      i = 0;
      goto <D.18819>;
      <D.18818>:
      {
        void * * __p;

        __p = mono_array_addr_with_size (arr, 4, i);
        D.19018 = mono_array_addr_with_size (temp_arr, 4, i);
        D.19019 = MEM[(struct MonoObject * *)D.19018];
        mono_gc_wbarrier_set_arrayref (arr, __p, D.19019);
      }
      i = i + 1;
      <D.18819>:
      if (i < num_added) goto <D.18818>; else goto <D.18820>;
      <D.18820>:
      <D.19015>:
      D.19020 = arr;
      return D.19020;
    }
  finally
    {
      mods = {CLOBBER};
      filename = {CLOBBER};
      modname = {CLOBBER};
      needed = {CLOBBER};
    }
}


process_add_module (void * process, void * mod, gunichar2 * filename, gunichar2 * modulename)
{
  struct MonoImage * system_assembly.4;
  unsigned int D.19024;
  void * D.19027;
  void * D.19028;
  unsigned int D.19029;
  unsigned int D.19030;
  unsigned int D.19031;
  struct MonoObject * D.19032;
  struct MonoClass * proc_class;
  struct MonoClass * filever_class;
  struct MonoObject * item;
  struct MonoObject * filever;
  struct MonoDomain * domain;
  struct MODULEINFO modinfo;
  BOOL ok;

  try
    {
      domain = mono_domain_get ();
      system_assembly.4 = system_assembly;
      proc_class = mono_class_from_name (system_assembly.4, "System.Diagnostics", "ProcessModule");
      item = mono_object_new (domain, proc_class);
      system_assembly.4 = system_assembly;
      filever_class = mono_class_from_name (system_assembly.4, "System.Diagnostics", "FileVersionInfo");
      filever = mono_object_new (domain, filever_class);
      process_get_fileversion (filever, filename);
      D.19024 = unicode_chars (filename);
      process_set_field_string (filever, "filename", filename, D.19024);
      ok = GetModuleInformation (process, mod, &modinfo, 12);
      if (ok != 0) goto <D.19025>; else goto <D.19026>;
      <D.19025>:
      D.19027 = modinfo.lpBaseOfDll;
      process_set_field_intptr (item, "baseaddr", D.19027);
      D.19028 = modinfo.EntryPoint;
      process_set_field_intptr (item, "entryaddr", D.19028);
      D.19029 = modinfo.SizeOfImage;
      process_set_field_int (item, "memory_size", D.19029);
      <D.19026>:
      D.19030 = unicode_chars (filename);
      process_set_field_string (item, "filename", filename, D.19030);
      D.19031 = unicode_chars (modulename);
      process_set_field_string (item, "modulename", modulename, D.19031);
      process_set_field_object (item, "version_info", filever);
      D.19032 = item;
      return D.19032;
    }
  finally
    {
      modinfo = {CLOBBER};
    }
}


process_get_fileversion (struct MonoObject * filever, gunichar2 * filename)
{
  unsigned int verinfohandle.5;
  int D.19042;
  struct VS_FIXEDFILEINFO * ffi.6;
  unsigned int D.19046;
  unsigned int D.19047;
  short unsigned int D.19048;
  unsigned int D.19049;
  short unsigned int D.19050;
  unsigned int D.19051;
  unsigned int D.19052;
  unsigned int D.19053;
  short unsigned int D.19054;
  unsigned int D.19055;
  short unsigned int D.19056;
  unsigned int D.19057;
  unsigned int D.19058;
  unsigned int D.19059;
  short unsigned int D.19060;
  unsigned int D.19061;
  short unsigned int D.19062;
  unsigned int D.19063;
  unsigned int D.19064;
  unsigned int D.19065;
  short unsigned int D.19066;
  unsigned int D.19067;
  short unsigned int D.19068;
  unsigned int D.19069;
  unsigned int D.19070;
  unsigned int D.19071;
  unsigned int D.19072;
  int D.19073;
  int D.19074;
  int D.19075;
  int D.19076;
  int D.19077;
  int D.19078;
  int D.19081;
  unsigned int trans_size.7;
  guchar * trans_data.8;
  unsigned char D.19088;
  int D.19089;
  guchar * D.19090;
  unsigned char D.19091;
  int D.19092;
  int D.19093;
  int D.19094;
  guchar * D.19095;
  unsigned char D.19096;
  int D.19097;
  int D.19098;
  int D.19099;
  guchar * D.19100;
  unsigned char D.19101;
  int D.19102;
  int D.19103;
  int D.19104;
  unsigned int D.19105;
  DWORD verinfohandle;
  struct VS_FIXEDFILEINFO * ffi;
  void * data;
  DWORD datalen;
  guchar * trans_data;
  gunichar2 * query;
  UINT ffi_size;
  UINT trans_size;
  BOOL ok;
  gunichar2 lang_buf[128];
  guint32 lang;
  guint32 lang_count;

  try
    {
      datalen = GetFileVersionInfoSize (filename, &verinfohandle);
      if (datalen != 0) goto <D.19035>; else goto <D.19036>;
      <D.19035>:
      data = monoeg_malloc0 (datalen);
      verinfohandle.5 = verinfohandle;
      ok = GetFileVersionInfo (filename, verinfohandle.5, datalen, data);
      if (ok != 0) goto <D.19038>; else goto <D.19039>;
      <D.19038>:
      query = monoeg_g_utf8_to_utf16 ("\\", -1, 0B, 0B, 0B);
      if (query == 0B) goto <D.19040>; else goto <D.19041>;
      <D.19040>:
      monoeg_g_free (data);
      return;
      <D.19041>:
      D.19042 = VerQueryValue (data, query, &ffi, &ffi_size);
      if (D.19042 != 0) goto <D.19043>; else goto <D.19044>;
      <D.19043>:
      ffi.6 = ffi;
      D.19046 = ffi.6->dwFileVersionMS;
      D.19047 = D.19046 >> 16;
      D.19048 = (short unsigned int) D.19047;
      D.19049 = (unsigned int) D.19048;
      process_set_field_int (filever, "filemajorpart", D.19049);
      ffi.6 = ffi;
      D.19046 = ffi.6->dwFileVersionMS;
      D.19050 = (short unsigned int) D.19046;
      D.19051 = (unsigned int) D.19050;
      process_set_field_int (filever, "fileminorpart", D.19051);
      ffi.6 = ffi;
      D.19052 = ffi.6->dwFileVersionLS;
      D.19053 = D.19052 >> 16;
      D.19054 = (short unsigned int) D.19053;
      D.19055 = (unsigned int) D.19054;
      process_set_field_int (filever, "filebuildpart", D.19055);
      ffi.6 = ffi;
      D.19052 = ffi.6->dwFileVersionLS;
      D.19056 = (short unsigned int) D.19052;
      D.19057 = (unsigned int) D.19056;
      process_set_field_int (filever, "fileprivatepart", D.19057);
      ffi.6 = ffi;
      D.19058 = ffi.6->dwProductVersionMS;
      D.19059 = D.19058 >> 16;
      D.19060 = (short unsigned int) D.19059;
      D.19061 = (unsigned int) D.19060;
      process_set_field_int (filever, "productmajorpart", D.19061);
      ffi.6 = ffi;
      D.19058 = ffi.6->dwProductVersionMS;
      D.19062 = (short unsigned int) D.19058;
      D.19063 = (unsigned int) D.19062;
      process_set_field_int (filever, "productminorpart", D.19063);
      ffi.6 = ffi;
      D.19064 = ffi.6->dwProductVersionLS;
      D.19065 = D.19064 >> 16;
      D.19066 = (short unsigned int) D.19065;
      D.19067 = (unsigned int) D.19066;
      process_set_field_int (filever, "productbuildpart", D.19067);
      ffi.6 = ffi;
      D.19064 = ffi.6->dwProductVersionLS;
      D.19068 = (short unsigned int) D.19064;
      D.19069 = (unsigned int) D.19068;
      process_set_field_int (filever, "productprivatepart", D.19069);
      ffi.6 = ffi;
      D.19070 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.19071 = ffi.6->dwFileFlagsMask;
      D.19072 = D.19070 & D.19071;
      D.19073 = (int) D.19072;
      D.19074 = D.19073 & 1;
      process_set_field_bool (filever, "isdebug", D.19074);
      ffi.6 = ffi;
      D.19070 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.19071 = ffi.6->dwFileFlagsMask;
      D.19072 = D.19070 & D.19071;
      D.19073 = (int) D.19072;
      D.19075 = D.19073 & 2;
      process_set_field_bool (filever, "isprerelease", D.19075);
      ffi.6 = ffi;
      D.19070 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.19071 = ffi.6->dwFileFlagsMask;
      D.19072 = D.19070 & D.19071;
      D.19073 = (int) D.19072;
      D.19076 = D.19073 & 4;
      process_set_field_bool (filever, "ispatched", D.19076);
      ffi.6 = ffi;
      D.19070 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.19071 = ffi.6->dwFileFlagsMask;
      D.19072 = D.19070 & D.19071;
      D.19073 = (int) D.19072;
      D.19077 = D.19073 & 8;
      process_set_field_bool (filever, "isprivatebuild", D.19077);
      ffi.6 = ffi;
      D.19070 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.19071 = ffi.6->dwFileFlagsMask;
      D.19072 = D.19070 & D.19071;
      D.19073 = (int) D.19072;
      D.19078 = D.19073 & 32;
      process_set_field_bool (filever, "isspecialbuild", D.19078);
      <D.19044>:
      monoeg_g_free (query);
      query = monoeg_g_utf8_to_utf16 ("\\VarFileInfo\\Translation", -1, 0B, 0B, 0B);
      if (query == 0B) goto <D.19079>; else goto <D.19080>;
      <D.19079>:
      monoeg_g_free (data);
      return;
      <D.19080>:
      D.19081 = VerQueryValue (data, query, &trans_data, &trans_size);
      if (D.19081 != 0) goto <D.19082>; else goto <D.19083>;
      <D.19082>:
      trans_size.7 = trans_size;
      if (trans_size.7 > 3) goto <D.19085>; else goto <D.19086>;
      <D.19085>:
      trans_data.8 = trans_data;
      D.19088 = *trans_data.8;
      D.19089 = (int) D.19088;
      trans_data.8 = trans_data;
      D.19090 = trans_data.8 + 1;
      D.19091 = *D.19090;
      D.19092 = (int) D.19091;
      D.19093 = D.19092 << 8;
      D.19094 = D.19089 | D.19093;
      trans_data.8 = trans_data;
      D.19095 = trans_data.8 + 2;
      D.19096 = *D.19095;
      D.19097 = (int) D.19096;
      D.19098 = D.19097 << 16;
      D.19099 = D.19094 | D.19098;
      trans_data.8 = trans_data;
      D.19100 = trans_data.8 + 3;
      D.19101 = *D.19100;
      D.19102 = (int) D.19101;
      D.19103 = D.19102 << 24;
      D.19104 = D.19099 | D.19103;
      lang = (guint32) D.19104;
      D.19105 = lang & 65535;
      lang_count = VerLanguageName (D.19105, &lang_buf, 128);
      if (lang_count != 0) goto <D.19106>; else goto <D.19107>;
      <D.19106>:
      process_set_field_string (filever, "language", &lang_buf, lang_count);
      <D.19107>:
      trans_data.8 = trans_data;
      D.19088 = *trans_data.8;
      trans_data.8 = trans_data;
      D.19090 = trans_data.8 + 1;
      D.19091 = *D.19090;
      process_module_stringtable (filever, data, D.19088, D.19091);
      <D.19086>:
      goto <D.19108>;
      <D.19083>:
      process_set_field_string (filever, "comments", "", 0);
      process_set_field_string (filever, "companyname", "", 0);
      process_set_field_string (filever, "filedescription", "", 0);
      process_set_field_string (filever, "fileversion", "", 0);
      process_set_field_string (filever, "internalname", "", 0);
      process_set_field_string (filever, "legalcopyright", "", 0);
      process_set_field_string (filever, "legaltrademarks", "", 0);
      process_set_field_string (filever, "originalfilename", "", 0);
      process_set_field_string (filever, "privatebuild", "", 0);
      process_set_field_string (filever, "productname", "", 0);
      process_set_field_string (filever, "productversion", "", 0);
      process_set_field_string (filever, "specialbuild", "", 0);
      lang_count = VerLanguageName (1033, &lang_buf, 128);
      if (lang_count != 0) goto <D.19109>; else goto <D.19110>;
      <D.19109>:
      process_set_field_string (filever, "language", &lang_buf, lang_count);
      <D.19110>:
      <D.19108>:
      monoeg_g_free (query);
      <D.19039>:
      monoeg_g_free (data);
      <D.19036>:
    }
  finally
    {
      verinfohandle = {CLOBBER};
      ffi = {CLOBBER};
      trans_data = {CLOBBER};
      ffi_size = {CLOBBER};
      trans_size = {CLOBBER};
      lang_buf = {CLOBBER};
    }
}


process_set_field_bool (struct MonoObject * obj, const gchar * fieldname, gboolean val)
{
  struct MonoVTable * D.19114;
  struct MonoClass * D.19115;
  int D.19116;
  sizetype D.19117;
  guint8 * D.19118;
  unsigned char D.19119;
  struct MonoClassField * field;

  D.19114 = obj->vtable;
  D.19115 = D.19114->klass;
  field = mono_class_get_field_from_name (D.19115, fieldname);
  D.19116 = field->offset;
  D.19117 = (sizetype) D.19116;
  D.19118 = obj + D.19117;
  D.19119 = (unsigned char) val;
  *D.19118 = D.19119;
}


process_module_stringtable (struct MonoObject * filever, void * data, guchar lang_hi, guchar lang_lo)
{
  process_module_string_read (filever, data, "comments", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\Comments");
  process_module_string_read (filever, data, "companyname", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\CompanyName");
  process_module_string_read (filever, data, "filedescription", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\FileDescription");
  process_module_string_read (filever, data, "fileversion", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\FileVersion");
  process_module_string_read (filever, data, "internalname", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\InternalName");
  process_module_string_read (filever, data, "legalcopyright", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\LegalCopyright");
  process_module_string_read (filever, data, "legaltrademarks", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\LegalTrademarks");
  process_module_string_read (filever, data, "originalfilename", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\OriginalFilename");
  process_module_string_read (filever, data, "privatebuild", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\PrivateBuild");
  process_module_string_read (filever, data, "productname", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\ProductName");
  process_module_string_read (filever, data, "productversion", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\ProductVersion");
  process_module_string_read (filever, data, "specialbuild", lang_hi, lang_lo, "\\StringFileInfo\\%02X%02X%02X%02X\\SpecialBuild");
}


process_module_string_read (struct MonoObject * filever, void * data, const gchar * fieldname, guchar lang_hi, guchar lang_lo, const gchar * key)
{
  int D.19120;
  int D.19121;
  int D.19124;
  unsigned int chars.9;
  gunichar2 * buffer.10;
  unsigned int D.19129;
  gchar * lang_key_utf8;
  gunichar2 * lang_key;
  gunichar2 * buffer;
  UINT chars;

  try
    {
      D.19120 = (int) lang_lo;
      D.19121 = (int) lang_hi;
      lang_key_utf8 = monoeg_g_strdup_printf (key, D.19120, D.19121, 4, 176);
      lang_key = monoeg_g_utf8_to_utf16 (lang_key_utf8, -1, 0B, 0B, 0B);
      D.19124 = VerQueryValue (data, lang_key, &buffer, &chars);
      if (D.19124 != 0) goto <D.19125>; else goto <D.19122>;
      <D.19125>:
      chars.9 = chars;
      if (chars.9 != 0) goto <D.19127>; else goto <D.19122>;
      <D.19127>:
      buffer.10 = buffer;
      chars.9 = chars;
      D.19129 = chars.9 + 4294967295;
      process_set_field_string (filever, fieldname, buffer.10, D.19129);
      goto <D.19123>;
      <D.19122>:
      process_set_field_string (filever, fieldname, "", 0);
      <D.19123>:
      monoeg_g_free (lang_key);
      monoeg_g_free (lang_key_utf8);
    }
  finally
    {
      buffer = {CLOBBER};
      chars = {CLOBBER};
    }
}


process_set_field_intptr (struct MonoObject * obj, const gchar * fieldname, void * val)
{
  struct MonoVTable * D.19130;
  struct MonoClass * D.19131;
  int D.19132;
  sizetype D.19133;
  void * * D.19134;
  struct MonoClassField * field;

  D.19130 = obj->vtable;
  D.19131 = D.19130->klass;
  field = mono_class_get_field_from_name (D.19131, fieldname);
  D.19132 = field->offset;
  D.19133 = (sizetype) D.19132;
  D.19134 = obj + D.19133;
  *D.19134 = val;
}


process_set_field_int (struct MonoObject * obj, const gchar * fieldname, guint32 val)
{
  struct MonoVTable * D.19135;
  struct MonoClass * D.19136;
  int D.19137;
  sizetype D.19138;
  guint32 * D.19139;
  struct MonoClassField * field;

  D.19135 = obj->vtable;
  D.19136 = D.19135->klass;
  field = mono_class_get_field_from_name (D.19136, fieldname);
  D.19137 = field->offset;
  D.19138 = (sizetype) D.19137;
  D.19139 = obj + D.19138;
  *D.19139 = val;
}


unicode_chars (const gunichar2 * str)
{
  unsigned int D.19140;
  const gunichar2 * D.19141;
  short unsigned int D.19142;
  guint32 D.19145;
  guint32 len;

  len = 0;
  <D.18719>:
  D.19140 = len * 2;
  D.19141 = str + D.19140;
  D.19142 = *D.19141;
  if (D.19142 == 0) goto <D.19143>; else goto <D.19144>;
  <D.19143>:
  D.19145 = len;
  return D.19145;
  <D.19144>:
  len = len + 1;
  goto <D.18719>;
}


process_set_field_string (struct MonoObject * obj, const gchar * fieldname, const gunichar2 * val, guint32 len)
{
  struct MonoVTable * D.19147;
  struct MonoDomain * D.19148;
  int len.11;
  struct MonoClass * D.19150;
  int D.19151;
  sizetype D.19152;
  void * D.19153;
  struct MonoClassField * field;
  struct MonoString * string;

  D.19147 = obj->vtable;
  D.19148 = D.19147->domain;
  len.11 = (int) len;
  string = mono_string_new_utf16 (D.19148, val, len.11);
  D.19147 = obj->vtable;
  D.19150 = D.19147->klass;
  field = mono_class_get_field_from_name (D.19150, fieldname);
  D.19151 = field->offset;
  D.19152 = (sizetype) D.19151;
  D.19153 = obj + D.19152;
  mono_gc_wbarrier_generic_store (D.19153, string);
}


process_set_field_object (struct MonoObject * obj, const gchar * fieldname, struct MonoObject * data)
{
  struct MonoVTable * D.19154;
  struct MonoClass * D.19155;
  int D.19156;
  sizetype D.19157;
  void * D.19158;
  struct MonoClassField * field;

  D.19154 = obj->vtable;
  D.19155 = D.19154->klass;
  field = mono_class_get_field_from_name (D.19155, fieldname);
  D.19156 = field->offset;
  D.19157 = (sizetype) D.19156;
  D.19158 = obj + D.19157;
  mono_gc_wbarrier_generic_store (D.19158, data);
}


ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (struct MonoObject * this, struct MonoString * filename)
{
  struct MonoImage * system_assembly.12;
  struct MonoVTable * D.19162;
  struct MonoClass * D.19163;
  struct MonoImage * system_assembly.13;
  mono_unichar2 * D.19165;
  mono_unichar2 * D.19166;
  int D.19167;
  unsigned int D.19168;

  system_assembly.12 = system_assembly;
  if (system_assembly.12 == 0B) goto <D.19160>; else goto <D.19161>;
  <D.19160>:
  D.19162 = this->vtable;
  D.19163 = D.19162->klass;
  system_assembly.13 = D.19163->image;
  system_assembly = system_assembly.13;
  <D.19161>:
  D.19165 = mono_string_chars (filename);
  process_get_fileversion (this, D.19165);
  D.19166 = mono_string_chars (filename);
  D.19167 = mono_string_length (filename);
  D.19168 = (unsigned int) D.19167;
  process_set_field_string (this, "filename", D.19166, D.19168);
}


ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (struct MonoProcessStartInfo * proc_start_info, struct MonoProcInfo * process_info)
{
  unsigned int D.19169;
  WapiShellExecuteShowFlags iftmp.14;
  <unnamed type> D.19171;
  WapiShellExecuteShowFlags iftmp.15;
  struct MonoString * D.19179;
  mono_unichar2 * D.19182;
  struct MonoString * D.19183;
  mono_unichar2 * D.19186;
  struct MonoString * D.19187;
  int D.19190;
  mono_unichar2 * D.19193;
  struct MonoString * D.19194;
  int D.19197;
  mono_unichar2 * D.19200;
  unsigned char D.19201;
  void * D.19204;
  <unnamed type> D.19206;
  unsigned int D.19207;
  unsigned int D.19210;
  unsigned int D.19211;
  void * D.19213;
  unsigned int D.19214;
  MonoBoolean D.19215;
  struct SHELLEXECUTEINFO shellex;
  gboolean ret;

  try
    {
      shellex = {};
      shellex.cbSize = 60;
      shellex.fMask = 65856;
      D.19169 = proc_start_info->window_style;
      shellex.nShow = D.19169;
      D.19171 = shellex.nShow;
      if (D.19171 != 0) goto <D.19172>; else goto <D.19173>;
      <D.19172>:
      D.19171 = shellex.nShow;
      if (D.19171 != 1) goto <D.19175>; else goto <D.19176>;
      <D.19175>:
      iftmp.15 = shellex.nShow;
      goto <D.19177>;
      <D.19176>:
      iftmp.15 = 0;
      <D.19177>:
      iftmp.14 = iftmp.15;
      goto <D.19178>;
      <D.19173>:
      iftmp.14 = 1;
      <D.19178>:
      shellex.nShow = iftmp.14;
      D.19179 = proc_start_info->filename;
      if (D.19179 != 0B) goto <D.19180>; else goto <D.19181>;
      <D.19180>:
      D.19179 = proc_start_info->filename;
      D.19182 = mono_string_chars (D.19179);
      shellex.lpFile = D.19182;
      <D.19181>:
      D.19183 = proc_start_info->arguments;
      if (D.19183 != 0B) goto <D.19184>; else goto <D.19185>;
      <D.19184>:
      D.19183 = proc_start_info->arguments;
      D.19186 = mono_string_chars (D.19183);
      shellex.lpParameters = D.19186;
      <D.19185>:
      D.19187 = proc_start_info->verb;
      if (D.19187 != 0B) goto <D.19188>; else goto <D.19189>;
      <D.19188>:
      D.19187 = proc_start_info->verb;
      D.19190 = mono_string_length (D.19187);
      if (D.19190 != 0) goto <D.19191>; else goto <D.19192>;
      <D.19191>:
      D.19187 = proc_start_info->verb;
      D.19193 = mono_string_chars (D.19187);
      shellex.lpVerb = D.19193;
      <D.19192>:
      <D.19189>:
      D.19194 = proc_start_info->working_directory;
      if (D.19194 != 0B) goto <D.19195>; else goto <D.19196>;
      <D.19195>:
      D.19194 = proc_start_info->working_directory;
      D.19197 = mono_string_length (D.19194);
      if (D.19197 != 0) goto <D.19198>; else goto <D.19199>;
      <D.19198>:
      D.19194 = proc_start_info->working_directory;
      D.19200 = mono_string_chars (D.19194);
      shellex.lpDirectory = D.19200;
      <D.19199>:
      <D.19196>:
      D.19201 = proc_start_info->error_dialog;
      if (D.19201 != 0) goto <D.19202>; else goto <D.19203>;
      <D.19202>:
      D.19204 = proc_start_info->error_dialog_parent_handle;
      shellex.hwnd = D.19204;
      goto <D.19205>;
      <D.19203>:
      D.19206 = shellex.fMask;
      D.19207 = D.19206 | 1024;
      shellex.fMask = D.19207;
      <D.19205>:
      ret = ShellExecuteEx (&shellex);
      if (ret == 0) goto <D.19208>; else goto <D.19209>;
      <D.19208>:
      D.19210 = GetLastError ();
      D.19211 = -D.19210;
      process_info->pid = D.19211;
      goto <D.19212>;
      <D.19209>:
      D.19213 = shellex.hProcess;
      process_info->process_handle = D.19213;
      process_info->thread_handle = 0B;
      D.19213 = shellex.hProcess;
      D.19214 = GetProcessId (D.19213);
      process_info->pid = D.19214;
      process_info->tid = 0;
      <D.19212>:
      D.19215 = (MonoBoolean) ret;
      return D.19215;
    }
  finally
    {
      shellex = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_CreateProcess_internal (struct MonoProcessStartInfo * proc_start_info, void * stdin_handle, void * stdout_handle, void * stderr_handle, struct MonoProcInfo * process_info)
{
  unsigned char D.19218;
  struct MonoString * D.19221;
  gchar * spath.16;
  MonoBoolean D.19225;
  struct MonoArray * D.19226;
  struct MonoArray * D.19229;
  unsigned int i.17;
  char * D.19231;
  int D.19234;
  unsigned int D.19235;
  unsigned int D.19236;
  unsigned int len.18;
  unsigned int D.19238;
  char * D.19239;
  int D.19240;
  unsigned int D.19241;
  unsigned int D.19242;
  unsigned int D.19243;
  unsigned int D.19244;
  unsigned int D.19245;
  int D.19246;
  unsigned int D.19247;
  unsigned int D.19248;
  char * D.19249;
  char * D.19252;
  mono_unichar2 * D.19253;
  int D.19254;
  unsigned int D.19255;
  unsigned int D.19256;
  int D.19257;
  unsigned int D.19258;
  unsigned int D.19259;
  mono_unichar2 * D.19260;
  int D.19261;
  unsigned int D.19262;
  unsigned int D.19263;
  int D.19264;
  unsigned int D.19265;
  unsigned int D.19266;
  unsigned int D.19267;
  struct MonoString * D.19271;
  int D.19273;
  struct MonoString * D.19274;
  unsigned char D.19277;
  _Bool D.19278;
  mono_unichar2 * D.19279;
  const gunichar2 * iftmp.19;
  struct MonoString * D.19281;
  void * D.19285;
  const gunichar2 * iftmp.20;
  const gunichar2 * iftmp.21;
  void * D.19299;
  void * D.19300;
  void * D.19301;
  unsigned int D.19304;
  unsigned int D.19305;
  unsigned int D.19307;
  unsigned int D.19308;
  gboolean ret;
  gunichar2 * dir;
  struct STARTUPINFO startinfo;
  struct PROCESS_INFORMATION procinfo;
  gunichar2 * shell_path;
  gchar * env_vars;
  gboolean free_shell_path;
  gchar * spath;
  struct MonoString * cmd;
  guint32 creation_flags;
  guint32 logon_flags;

  try
    {
      startinfo = {};
      shell_path = 0B;
      env_vars = 0B;
      free_shell_path = 1;
      spath = 0B;
      cmd = proc_start_info->arguments;
      startinfo.cb = 68;
      startinfo.dwFlags = 256;
      startinfo.hStdInput = stdin_handle;
      startinfo.hStdOutput = stdout_handle;
      startinfo.hStdError = stderr_handle;
      creation_flags = 1024;
      D.19218 = proc_start_info->create_no_window;
      if (D.19218 != 0) goto <D.19219>; else goto <D.19220>;
      <D.19219>:
      creation_flags = creation_flags | 134217728;
      <D.19220>:
      D.19221 = proc_start_info->filename;
      shell_path = mono_string_chars (D.19221);
      complete_path (shell_path, &spath);
      spath.16 = spath;
      if (spath.16 == 0B) goto <D.19223>; else goto <D.19224>;
      <D.19223>:
      process_info->pid = 4294967294;
      D.19225 = 0;
      return D.19225;
      <D.19224>:
      spath.16 = spath;
      shell_path = monoeg_g_utf8_to_utf16 (spath.16, -1, 0B, 0B, 0B);
      spath.16 = spath;
      monoeg_g_free (spath.16);
      D.19226 = process_info->env_keys;
      if (D.19226 != 0B) goto <D.19227>; else goto <D.19228>;
      <D.19227>:
      {
        gint i;
        gint len;
        struct MonoString * ms;
        struct MonoString * key;
        struct MonoString * value;
        gunichar2 * str;
        gunichar2 * ptr;
        gunichar2 * equals16;

        len = 0;
        i = 0;
        goto <D.18870>;
        <D.18869>:
        D.19229 = process_info->env_values;
        i.17 = (unsigned int) i;
        D.19231 = mono_array_addr_with_size (D.19229, 4, i.17);
        ms = MEM[(struct MonoString * *)D.19231];
        if (ms == 0B) goto <D.19232>; else goto <D.19233>;
        <D.19232>:
        // predicted unlikely by continue predictor.
        goto <D.18868>;
        <D.19233>:
        D.19234 = mono_string_length (ms);
        D.19235 = (unsigned int) D.19234;
        D.19236 = D.19235 * 2;
        len.18 = (unsigned int) len;
        D.19238 = D.19236 + len.18;
        len = (gint) D.19238;
        D.19226 = process_info->env_keys;
        i.17 = (unsigned int) i;
        D.19239 = mono_array_addr_with_size (D.19226, 4, i.17);
        ms = MEM[(struct MonoString * *)D.19239];
        D.19240 = mono_string_length (ms);
        D.19241 = (unsigned int) D.19240;
        D.19242 = D.19241 * 2;
        len.18 = (unsigned int) len;
        D.19243 = D.19242 + len.18;
        len = (gint) D.19243;
        len.18 = (unsigned int) len;
        D.19244 = len.18 + 4;
        len = (gint) D.19244;
        <D.18868>:
        i = i + 1;
        <D.18870>:
        i.17 = (unsigned int) i;
        D.19226 = process_info->env_keys;
        D.19245 = mono_array_length (D.19226);
        if (i.17 < D.19245) goto <D.18869>; else goto <D.18871>;
        <D.18871>:
        equals16 = monoeg_g_utf8_to_utf16 ("=", 1, 0B, 0B, 0B);
        D.19246 = len + 1;
        D.19247 = (unsigned int) D.19246;
        D.19248 = D.19247 * 2;
        str = monoeg_malloc0 (D.19248);
        ptr = str;
        i = 0;
        goto <D.18874>;
        <D.18873>:
        D.19229 = process_info->env_values;
        i.17 = (unsigned int) i;
        D.19249 = mono_array_addr_with_size (D.19229, 4, i.17);
        value = MEM[(struct MonoString * *)D.19249];
        if (value == 0B) goto <D.19250>; else goto <D.19251>;
        <D.19250>:
        // predicted unlikely by continue predictor.
        goto <D.18872>;
        <D.19251>:
        D.19226 = process_info->env_keys;
        i.17 = (unsigned int) i;
        D.19252 = mono_array_addr_with_size (D.19226, 4, i.17);
        key = MEM[(struct MonoString * *)D.19252];
        D.19253 = mono_string_chars (key);
        D.19254 = mono_string_length (key);
        D.19255 = (unsigned int) D.19254;
        D.19256 = D.19255 * 2;
        memcpy (ptr, D.19253, D.19256);
        D.19257 = mono_string_length (key);
        D.19258 = (unsigned int) D.19257;
        D.19259 = D.19258 * 2;
        ptr = ptr + D.19259;
        memcpy (ptr, equals16, 2);
        ptr = ptr + 2;
        D.19260 = mono_string_chars (value);
        D.19261 = mono_string_length (value);
        D.19262 = (unsigned int) D.19261;
        D.19263 = D.19262 * 2;
        memcpy (ptr, D.19260, D.19263);
        D.19264 = mono_string_length (value);
        D.19265 = (unsigned int) D.19264;
        D.19266 = D.19265 * 2;
        ptr = ptr + D.19266;
        ptr = ptr + 2;
        <D.18872>:
        i = i + 1;
        <D.18874>:
        i.17 = (unsigned int) i;
        D.19226 = process_info->env_keys;
        D.19267 = mono_array_length (D.19226);
        if (i.17 < D.19267) goto <D.18873>; else goto <D.18875>;
        <D.18875>:
        monoeg_g_free (equals16);
        env_vars = str;
      }
      <D.19228>:
      D.19271 = proc_start_info->working_directory;
      if (D.19271 == 0B) goto <D.19268>; else goto <D.19272>;
      <D.19272>:
      D.19271 = proc_start_info->working_directory;
      D.19273 = mono_string_length (D.19271);
      if (D.19273 == 0) goto <D.19268>; else goto <D.19269>;
      <D.19268>:
      dir = 0B;
      goto <D.19270>;
      <D.19269>:
      D.19271 = proc_start_info->working_directory;
      dir = mono_string_chars (D.19271);
      <D.19270>:
      D.19274 = process_info->username;
      if (D.19274 != 0B) goto <D.19275>; else goto <D.19276>;
      <D.19275>:
      D.19277 = process_info->load_user_profile;
      D.19278 = D.19277 != 0;
      logon_flags = (guint32) D.19278;
      D.19274 = process_info->username;
      D.19279 = mono_string_chars (D.19274);
      D.19281 = process_info->domain;
      if (D.19281 != 0B) goto <D.19282>; else goto <D.19283>;
      <D.19282>:
      D.19281 = process_info->domain;
      iftmp.19 = mono_string_chars (D.19281);
      goto <D.19284>;
      <D.19283>:
      iftmp.19 = 0B;
      <D.19284>:
      D.19285 = process_info->password;
      if (cmd != 0B) goto <D.19287>; else goto <D.19288>;
      <D.19287>:
      iftmp.20 = mono_string_chars (cmd);
      goto <D.19289>;
      <D.19288>:
      iftmp.20 = 0B;
      <D.19289>:
      ret = CreateProcessWithLogonW (D.19279, iftmp.19, D.19285, logon_flags, shell_path, iftmp.20, creation_flags, env_vars, dir, &startinfo, &procinfo);
      goto <D.19290>;
      <D.19276>:
      if (cmd != 0B) goto <D.19292>; else goto <D.19293>;
      <D.19292>:
      iftmp.21 = mono_string_chars (cmd);
      goto <D.19294>;
      <D.19293>:
      iftmp.21 = 0B;
      <D.19294>:
      ret = CreateProcess (shell_path, iftmp.21, 0B, 0B, 1, creation_flags, env_vars, dir, &startinfo, &procinfo);
      <D.19290>:
      monoeg_g_free (env_vars);
      if (free_shell_path != 0) goto <D.19295>; else goto <D.19296>;
      <D.19295>:
      monoeg_g_free (shell_path);
      <D.19296>:
      if (ret != 0) goto <D.19297>; else goto <D.19298>;
      <D.19297>:
      D.19299 = procinfo.hProcess;
      process_info->process_handle = D.19299;
      process_info->thread_handle = 0B;
      D.19300 = procinfo.hThread;
      D.19301 = D.19300 + 4294967295;
      if (D.19301 <= 4294967293B) goto <D.19302>; else goto <D.19303>;
      <D.19302>:
      D.19300 = procinfo.hThread;
      CloseHandle (D.19300);
      <D.19303>:
      D.19304 = procinfo.dwProcessId;
      process_info->pid = D.19304;
      D.19305 = procinfo.dwThreadId;
      process_info->tid = D.19305;
      goto <D.19306>;
      <D.19298>:
      D.19307 = GetLastError ();
      D.19308 = -D.19307;
      process_info->pid = D.19308;
      <D.19306>:
      D.19225 = (MonoBoolean) ret;
      return D.19225;
    }
  finally
    {
      startinfo = {CLOBBER};
      procinfo = {CLOBBER};
      spath = {CLOBBER};
    }
}


complete_path (const gunichar2 * appname, gchar * * completed)
{
  int D.19311;
  gchar * D.19314;
  gboolean D.19315;
  int D.19316;
  int D.19319;
  gchar * D.19322;
  gchar * D.19325;
  gchar * utf8app;
  gchar * utf8appmemory;
  gchar * found;

  utf8app = monoeg_g_utf16_to_utf8 (appname, -1, 0B, 0B, 0B);
  utf8appmemory = utf8app;
  D.19311 = monoeg_g_path_is_absolute (utf8app);
  if (D.19311 != 0) goto <D.19312>; else goto <D.19313>;
  <D.19312>:
  D.19314 = quote_path (utf8app);
  *completed = D.19314;
  monoeg_g_free (utf8appmemory);
  D.19315 = 1;
  return D.19315;
  <D.19313>:
  D.19316 = monoeg_g_file_test (utf8app, 8);
  if (D.19316 != 0) goto <D.19317>; else goto <D.19318>;
  <D.19317>:
  D.19319 = monoeg_g_file_test (utf8app, 4);
  if (D.19319 == 0) goto <D.19320>; else goto <D.19321>;
  <D.19320>:
  D.19322 = quote_path (utf8app);
  *completed = D.19322;
  monoeg_g_free (utf8appmemory);
  D.19315 = 1;
  return D.19315;
  <D.19321>:
  <D.19318>:
  found = monoeg_g_find_program_in_path (utf8app);
  if (found == 0B) goto <D.19323>; else goto <D.19324>;
  <D.19323>:
  *completed = 0B;
  monoeg_g_free (utf8appmemory);
  D.19315 = 0;
  return D.19315;
  <D.19324>:
  D.19325 = quote_path (found);
  *completed = D.19325;
  monoeg_g_free (found);
  monoeg_g_free (utf8appmemory);
  D.19315 = 1;
  return D.19315;
}


quote_path (const gchar * path)
{
  gchar * D.19327;
  gchar * res;

  res = monoeg_g_shell_quote (path);
  D.19327 = res;
  return D.19327;
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.19329;
  unsigned int D.19330;

  D.19330 = __builtin_object_size (__dest, 0);
  D.19329 = __builtin___memcpy_chk (__dest, __src, __len, D.19330);
  return D.19329;
}


ves_icall_System_Diagnostics_Process_WaitForExit_internal (struct MonoObject * this, void * process, gint32 ms)
{
  unsigned int ms.22;
  MonoBoolean D.19338;
  guint32 ret;

  if (ms < 0) goto <D.19332>; else goto <D.19333>;
  <D.19332>:
  ret = WaitForSingleObjectEx (process, 4294967295, 1);
  goto <D.19334>;
  <D.19333>:
  ms.22 = (unsigned int) ms;
  ret = WaitForSingleObjectEx (process, ms.22, 1);
  <D.19334>:
  if (ret == 0) goto <D.19336>; else goto <D.19337>;
  <D.19336>:
  D.19338 = 1;
  return D.19338;
  <D.19337>:
  D.19338 = 0;
  return D.19338;
}


ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal (struct MonoObject * this, void * process, gint32 ms)
{
  unsigned int ms.23;
  MonoBoolean D.19344;
  _Bool D.19345;
  guint32 ret;

  if (ms < 0) goto <D.19340>; else goto <D.19341>;
  <D.19340>:
  ret = WaitForInputIdle (process, 4294967295);
  goto <D.19342>;
  <D.19341>:
  ms.23 = (unsigned int) ms;
  ret = WaitForInputIdle (process, ms.23);
  <D.19342>:
  D.19345 = ret == 0;
  D.19344 = (MonoBoolean) D.19345;
  return D.19344;
}


ves_icall_System_Diagnostics_Process_ExitTime_internal (void * process)
{
  unsigned int D.19349;
  long long unsigned int D.19350;
  long long unsigned int D.19351;
  unsigned int D.19352;
  long long unsigned int D.19353;
  long long unsigned int D.19354;
  gint64 D.19355;
  gboolean ret;
  gint64 ticks;
  struct FILETIME create_time;
  struct FILETIME exit_time;
  struct FILETIME kernel_time;
  struct FILETIME user_time;

  try
    {
      ret = GetProcessTimes (process, &create_time, &exit_time, &kernel_time, &user_time);
      if (ret == 1) goto <D.19347>; else goto <D.19348>;
      <D.19347>:
      D.19349 = exit_time.dwHighDateTime;
      D.19350 = (long long unsigned int) D.19349;
      D.19351 = D.19350 << 32;
      D.19352 = exit_time.dwLowDateTime;
      D.19353 = (long long unsigned int) D.19352;
      D.19354 = D.19351 + D.19353;
      ticks = (gint64) D.19354;
      D.19355 = ticks;
      return D.19355;
      <D.19348>:
      D.19355 = 0;
      return D.19355;
    }
  finally
    {
      create_time = {CLOBBER};
      exit_time = {CLOBBER};
      kernel_time = {CLOBBER};
      user_time = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_StartTime_internal (void * process)
{
  unsigned int D.19360;
  long long unsigned int D.19361;
  long long unsigned int D.19362;
  unsigned int D.19363;
  long long unsigned int D.19364;
  long long unsigned int D.19365;
  gint64 D.19366;
  gboolean ret;
  gint64 ticks;
  struct FILETIME create_time;
  struct FILETIME exit_time;
  struct FILETIME kernel_time;
  struct FILETIME user_time;

  try
    {
      ret = GetProcessTimes (process, &create_time, &exit_time, &kernel_time, &user_time);
      if (ret == 1) goto <D.19358>; else goto <D.19359>;
      <D.19358>:
      D.19360 = create_time.dwHighDateTime;
      D.19361 = (long long unsigned int) D.19360;
      D.19362 = D.19361 << 32;
      D.19363 = create_time.dwLowDateTime;
      D.19364 = (long long unsigned int) D.19363;
      D.19365 = D.19362 + D.19364;
      ticks = (gint64) D.19365;
      D.19366 = ticks;
      return D.19366;
      <D.19359>:
      D.19366 = 0;
      return D.19366;
    }
  finally
    {
      create_time = {CLOBBER};
      exit_time = {CLOBBER};
      kernel_time = {CLOBBER};
      user_time = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_ExitCode_internal (void * process)
{
  gint32 D.19369;
  unsigned int code.24;
  DWORD code;

  try
    {
      GetExitCodeProcess (process, &code);
      code.24 = code;
      D.19369 = (gint32) code.24;
      return D.19369;
    }
  finally
    {
      code = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_ProcessName_internal (void * process)
{
  struct MonoString * D.19375;
  void * mod.25;
  struct MonoDomain * D.19379;
  int len.26;
  struct MonoString * string;
  gboolean ok;
  void * mod;
  gunichar2 name[260];
  DWORD needed;
  guint32 len;

  try
    {
      ok = EnumProcessModules (process, &mod, 4, &needed);
      if (ok == 0) goto <D.19373>; else goto <D.19374>;
      <D.19373>:
      D.19375 = 0B;
      return D.19375;
      <D.19374>:
      mod.25 = mod;
      len = GetModuleBaseName (process, mod.25, &name, 260);
      if (len == 0) goto <D.19377>; else goto <D.19378>;
      <D.19377>:
      D.19375 = 0B;
      return D.19375;
      <D.19378>:
      D.19379 = mono_domain_get ();
      len.26 = (int) len;
      string = mono_string_new_utf16 (D.19379, &name, len.26);
      D.19375 = string;
      return D.19375;
    }
  finally
    {
      mod = {CLOBBER};
      name = {CLOBBER};
      needed = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_GetProcesses_internal ()
{
  unsigned int D.19383;
  unsigned int D.19384;
  unsigned int needed.27;
  unsigned int D.19389;
  struct MonoDomain * D.19390;
  struct MonoClass * D.19391;
  char * D.19392;
  struct MonoArray * D.19393;
  struct MonoArray * procs;
  gboolean ret;
  DWORD needed;
  guint32 count;
  guint32 * pids;

  try
    {
      count = 512;
      <D.18929>:
      D.19383 = count * 4;
      pids = monoeg_malloc0 (D.19383);
      D.19384 = count * 4;
      ret = EnumProcesses (pids, D.19384, &needed);
      if (ret == 0) goto <D.19385>; else goto <D.19386>;
      <D.19385>:
      {
        struct MonoException * exc;

        monoeg_g_free (pids);
        pids = 0B;
        exc = mono_get_exception_not_supported ("This system does not support EnumProcesses");
        mono_raise_exception (exc);
        monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "process.c", 920);
      }
      <D.19386>:
      D.19384 = count * 4;
      needed.27 = needed;
      if (D.19384 > needed.27) goto <D.18928>; else goto <D.19388>;
      <D.19388>:
      monoeg_g_free (pids);
      pids = 0B;
      D.19389 = count * 3;
      count = D.19389 / 2;
      goto <D.18929>;
      <D.18928>:
      needed.27 = needed;
      count = needed.27 / 4;
      D.19390 = mono_domain_get ();
      D.19391 = mono_get_int32_class ();
      procs = mono_array_new (D.19390, D.19391, count);
      D.19392 = mono_array_addr_with_size (procs, 4, 0);
      needed.27 = needed;
      memcpy (D.19392, pids, needed.27);
      monoeg_g_free (pids);
      pids = 0B;
      D.19393 = procs;
      return D.19393;
    }
  finally
    {
      needed = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_GetWorkingSet_internal (void * process, guint32 * min, guint32 * max)
{
  unsigned int ws_min.28;
  unsigned int ws_max.29;
  MonoBoolean D.19398;
  gboolean ret;
  SIZE_T ws_min;
  SIZE_T ws_max;

  try
    {
      ret = GetProcessWorkingSetSize (process, &ws_min, &ws_max);
      ws_min.28 = ws_min;
      *min = ws_min.28;
      ws_max.29 = ws_max;
      *max = ws_max.29;
      D.19398 = (MonoBoolean) ret;
      return D.19398;
    }
  finally
    {
      ws_min = {CLOBBER};
      ws_max = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_SetWorkingSet_internal (void * process, guint32 min, guint32 max, MonoBoolean use_min)
{
  MonoBoolean D.19403;
  unsigned int ws_min.30;
  unsigned int ws_max.31;
  gboolean ret;
  SIZE_T ws_min;
  SIZE_T ws_max;

  try
    {
      ret = GetProcessWorkingSetSize (process, &ws_min, &ws_max);
      if (ret == 0) goto <D.19401>; else goto <D.19402>;
      <D.19401>:
      D.19403 = 0;
      return D.19403;
      <D.19402>:
      if (use_min == 1) goto <D.19404>; else goto <D.19405>;
      <D.19404>:
      ws_min = min;
      goto <D.19406>;
      <D.19405>:
      ws_max = max;
      <D.19406>:
      ws_min.30 = ws_min;
      ws_max.31 = ws_max;
      ret = SetProcessWorkingSetSize (process, ws_min.30, ws_max.31);
      D.19403 = (MonoBoolean) ret;
      return D.19403;
    }
  finally
    {
      ws_min = {CLOBBER};
      ws_max = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_Kill_internal (void * process, gint32 sig)
{
  MonoBoolean D.19411;
  int D.19412;
  int D.19413;

  D.19412 = -sig;
  D.19413 = TerminateProcess (process, D.19412);
  D.19411 = (MonoBoolean) D.19413;
  return D.19411;
}


ves_icall_System_Diagnostics_Process_Times (void * process, gint32 type)
{
  int D.19415;
  gint64 D.19420;
  struct FILETIME * user_time.32;
  struct FILETIME * kernel_time.33;
  long long int D.19425;
  long long int D.19426;
  struct FILETIME create_time;
  struct FILETIME exit_time;
  struct FILETIME kernel_time;
  struct FILETIME user_time;

  try
    {
      D.19415 = GetProcessTimes (process, &create_time, &exit_time, &kernel_time, &user_time);
      if (D.19415 != 0) goto <D.19416>; else goto <D.19417>;
      <D.19416>:
      if (type == 0) goto <D.19418>; else goto <D.19419>;
      <D.19418>:
      user_time.32 = &user_time;
      D.19420 = MEM[(gint64 *)user_time.32];
      return D.19420;
      <D.19419>:
      if (type == 1) goto <D.19422>; else goto <D.19423>;
      <D.19422>:
      kernel_time.33 = &kernel_time;
      D.19420 = MEM[(gint64 *)kernel_time.33];
      return D.19420;
      <D.19423>:
      kernel_time.33 = &kernel_time;
      D.19425 = MEM[(gint64 *)kernel_time.33];
      user_time.32 = &user_time;
      D.19426 = MEM[(gint64 *)user_time.32];
      D.19420 = D.19425 + D.19426;
      return D.19420;
      <D.19417>:
      D.19420 = 0;
      return D.19420;
    }
  finally
    {
      create_time = {CLOBBER};
      exit_time = {CLOBBER};
      kernel_time = {CLOBBER};
      user_time = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_GetPriorityClass (void * process, gint32 * error)
{
  unsigned int D.19429;
  gint32 iftmp.34;
  unsigned int D.19433;
  gint32 D.19435;
  gint32 ret;

  D.19429 = GetPriorityClass (process);
  ret = (gint32) D.19429;
  if (ret == 0) goto <D.19431>; else goto <D.19432>;
  <D.19431>:
  D.19433 = GetLastError ();
  iftmp.34 = (gint32) D.19433;
  goto <D.19434>;
  <D.19432>:
  iftmp.34 = 0;
  <D.19434>:
  *error = iftmp.34;
  D.19435 = ret;
  return D.19435;
}


ves_icall_System_Diagnostics_Process_SetPriorityClass (void * process, gint32 priority_class, gint32 * error)
{
  unsigned int priority_class.35;
  gint32 iftmp.36;
  unsigned int D.19441;
  MonoBoolean D.19443;
  gboolean ret;

  priority_class.35 = (unsigned int) priority_class;
  ret = SetPriorityClass (process, priority_class.35);
  if (ret == 0) goto <D.19439>; else goto <D.19440>;
  <D.19439>:
  D.19441 = GetLastError ();
  iftmp.36 = (gint32) D.19441;
  goto <D.19442>;
  <D.19440>:
  iftmp.36 = 0;
  <D.19442>:
  *error = iftmp.36;
  D.19443 = (MonoBoolean) ret;
  return D.19443;
}


ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate (void * process)
{
  void * D.19445;
  void * D.19446;
  void * D.19447;
  void * ret;

  try
    {
      D.19445 = GetCurrentProcess ();
      D.19446 = GetCurrentProcess ();
      DuplicateHandle (D.19445, process, D.19446, &ret, 2032639, 1, 0);
      D.19447 = ret;
      return D.19447;
    }
  finally
    {
      ret = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_ProcessHandle_close (void * process)
{
  CloseHandle (process);
}


ves_icall_System_Diagnostics_Process_GetProcessData (int pid, gint32 data_type, gint32 * error)
{
  void * pid.37;
  <unnamed type> data_type.38;
  long long int D.19452;
  <unnamed type> perror.39;
  int perror.40;
  gint64 D.19457;
  MonoProcessError perror;
  guint64 res;

  try
    {
      pid.37 = (void *) pid;
      data_type.38 = (<unnamed type>) data_type;
      D.19452 = mono_process_get_data_with_error (pid.37, data_type.38, &perror);
      res = (guint64) D.19452;
      if (error != 0B) goto <D.19453>; else goto <D.19454>;
      <D.19453>:
      perror.39 = perror;
      perror.40 = (int) perror.39;
      *error = perror.40;
      <D.19454>:
      D.19457 = (gint64) res;
      return D.19457;
    }
  finally
    {
      perror = {CLOBBER};
    }
}


