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

  handle = OpenProcess (2035711, 1, pid);
  if (handle == 0B) goto <D.16436>; else goto <D.16437>;
  <D.16436>:
  D.16438 = 0B;
  return D.16438;
  <D.16437>:
  D.16438 = handle;
  return D.16438;
}


ves_icall_System_Diagnostics_Process_GetPid_internal ()
{
  guint32 D.16440;

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


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.16445;
  struct MonoClass * D.16446;
  struct MonoImage * system_assembly.1;
  int D.16448;
  unsigned int needed.2;
  struct MonoClass * D.16452;
  struct MonoDomain * D.16453;
  void * D.16454;
  unsigned int D.16455;
  unsigned int D.16458;
  unsigned int num_added.3;
  struct MonoClass * D.16465;
  struct MonoDomain * D.16466;
  char * D.16467;
  struct MonoObject * D.16468;
  struct MonoArray * D.16469;
  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.16443>; else goto <D.16444>;
      <D.16443>:
      D.16445 = this->vtable;
      D.16446 = D.16445->klass;
      system_assembly.1 = D.16446->image;
      system_assembly = system_assembly.1;
      <D.16444>:
      D.16448 = EnumProcessModules (process, &mods, 4096, &needed);
      if (D.16448 != 0) goto <D.16449>; else goto <D.16450>;
      <D.16449>:
      needed.2 = needed;
      count = needed.2 / 4;
      D.16452 = mono_get_object_class ();
      D.16453 = mono_domain_get ();
      temp_arr = mono_array_new (D.16453, D.16452, count);
      i = 0;
      goto <D.16266>;
      <D.16265>:
      D.16454 = mods[i];
      D.16455 = GetModuleBaseName (process, D.16454, &modname, 260);
      if (D.16455 != 0) goto <D.16456>; else goto <D.16457>;
      <D.16456>:
      D.16454 = mods[i];
      D.16458 = GetModuleFileNameEx (process, D.16454, &filename, 260);
      if (D.16458 != 0) goto <D.16459>; else goto <D.16460>;
      <D.16459>:
      {
        struct MonoObject * module;

        D.16454 = mods[i];
        module = process_add_module (process, D.16454, &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.16460>:
      <D.16457>:
      i = i + 1;
      <D.16266>:
      if (i < count) goto <D.16265>; else goto <D.16267>;
      <D.16267>:
      <D.16450>:
      if (count == num_added) goto <D.16462>; else goto <D.16463>;
      <D.16462>:
      arr = temp_arr;
      goto <D.16464>;
      <D.16463>:
      D.16465 = mono_get_object_class ();
      D.16466 = mono_domain_get ();
      arr = mono_array_new (D.16466, D.16465, num_added);
      i = 0;
      goto <D.16270>;
      <D.16269>:
      {
        void * * __p;

        __p = mono_array_addr_with_size (arr, 4, i);
        D.16467 = mono_array_addr_with_size (temp_arr, 4, i);
        D.16468 = MEM[(struct MonoObject * *)D.16467];
        mono_gc_wbarrier_set_arrayref (arr, __p, D.16468);
      }
      i = i + 1;
      <D.16270>:
      if (i < num_added) goto <D.16269>; else goto <D.16271>;
      <D.16271>:
      <D.16464>:
      D.16469 = arr;
      return D.16469;
    }
  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.16473;
  void * D.16476;
  void * D.16477;
  unsigned int D.16478;
  unsigned int D.16479;
  unsigned int D.16480;
  struct MonoObject * D.16481;
  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.16473 = unicode_chars (filename);
      process_set_field_string (filever, "filename", filename, D.16473);
      ok = GetModuleInformation (process, mod, &modinfo, 12);
      if (ok != 0) goto <D.16474>; else goto <D.16475>;
      <D.16474>:
      D.16476 = modinfo.lpBaseOfDll;
      process_set_field_intptr (item, "baseaddr", D.16476);
      D.16477 = modinfo.EntryPoint;
      process_set_field_intptr (item, "entryaddr", D.16477);
      D.16478 = modinfo.SizeOfImage;
      process_set_field_int (item, "memory_size", D.16478);
      <D.16475>:
      D.16479 = unicode_chars (filename);
      process_set_field_string (item, "filename", filename, D.16479);
      D.16480 = unicode_chars (modulename);
      process_set_field_string (item, "modulename", modulename, D.16480);
      process_set_field_object (item, "version_info", filever);
      D.16481 = item;
      return D.16481;
    }
  finally
    {
      modinfo = {CLOBBER};
    }
}


process_get_fileversion (struct MonoObject * filever, gunichar2 * filename)
{
  unsigned int verinfohandle.5;
  int D.16491;
  struct VS_FIXEDFILEINFO * ffi.6;
  unsigned int D.16495;
  unsigned int D.16496;
  short unsigned int D.16497;
  unsigned int D.16498;
  short unsigned int D.16499;
  unsigned int D.16500;
  unsigned int D.16501;
  unsigned int D.16502;
  short unsigned int D.16503;
  unsigned int D.16504;
  short unsigned int D.16505;
  unsigned int D.16506;
  unsigned int D.16507;
  unsigned int D.16508;
  short unsigned int D.16509;
  unsigned int D.16510;
  short unsigned int D.16511;
  unsigned int D.16512;
  unsigned int D.16513;
  unsigned int D.16514;
  short unsigned int D.16515;
  unsigned int D.16516;
  short unsigned int D.16517;
  unsigned int D.16518;
  unsigned int D.16519;
  unsigned int D.16520;
  unsigned int D.16521;
  int D.16522;
  int D.16523;
  int D.16524;
  int D.16525;
  int D.16526;
  int D.16527;
  int D.16530;
  unsigned int trans_size.7;
  guchar * trans_data.8;
  unsigned char D.16537;
  int D.16538;
  guchar * D.16539;
  unsigned char D.16540;
  int D.16541;
  int D.16542;
  int D.16543;
  guchar * D.16544;
  unsigned char D.16545;
  int D.16546;
  int D.16547;
  int D.16548;
  guchar * D.16549;
  unsigned char D.16550;
  int D.16551;
  int D.16552;
  int D.16553;
  unsigned int D.16554;
  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.16484>; else goto <D.16485>;
      <D.16484>:
      data = monoeg_malloc0 (datalen);
      verinfohandle.5 = verinfohandle;
      ok = GetFileVersionInfo (filename, verinfohandle.5, datalen, data);
      if (ok != 0) goto <D.16487>; else goto <D.16488>;
      <D.16487>:
      query = monoeg_g_utf8_to_utf16 ("\\", -1, 0B, 0B, 0B);
      if (query == 0B) goto <D.16489>; else goto <D.16490>;
      <D.16489>:
      monoeg_g_free (data);
      return;
      <D.16490>:
      D.16491 = VerQueryValue (data, query, &ffi, &ffi_size);
      if (D.16491 != 0) goto <D.16492>; else goto <D.16493>;
      <D.16492>:
      ffi.6 = ffi;
      D.16495 = ffi.6->dwFileVersionMS;
      D.16496 = D.16495 >> 16;
      D.16497 = (short unsigned int) D.16496;
      D.16498 = (unsigned int) D.16497;
      process_set_field_int (filever, "filemajorpart", D.16498);
      ffi.6 = ffi;
      D.16495 = ffi.6->dwFileVersionMS;
      D.16499 = (short unsigned int) D.16495;
      D.16500 = (unsigned int) D.16499;
      process_set_field_int (filever, "fileminorpart", D.16500);
      ffi.6 = ffi;
      D.16501 = ffi.6->dwFileVersionLS;
      D.16502 = D.16501 >> 16;
      D.16503 = (short unsigned int) D.16502;
      D.16504 = (unsigned int) D.16503;
      process_set_field_int (filever, "filebuildpart", D.16504);
      ffi.6 = ffi;
      D.16501 = ffi.6->dwFileVersionLS;
      D.16505 = (short unsigned int) D.16501;
      D.16506 = (unsigned int) D.16505;
      process_set_field_int (filever, "fileprivatepart", D.16506);
      ffi.6 = ffi;
      D.16507 = ffi.6->dwProductVersionMS;
      D.16508 = D.16507 >> 16;
      D.16509 = (short unsigned int) D.16508;
      D.16510 = (unsigned int) D.16509;
      process_set_field_int (filever, "productmajorpart", D.16510);
      ffi.6 = ffi;
      D.16507 = ffi.6->dwProductVersionMS;
      D.16511 = (short unsigned int) D.16507;
      D.16512 = (unsigned int) D.16511;
      process_set_field_int (filever, "productminorpart", D.16512);
      ffi.6 = ffi;
      D.16513 = ffi.6->dwProductVersionLS;
      D.16514 = D.16513 >> 16;
      D.16515 = (short unsigned int) D.16514;
      D.16516 = (unsigned int) D.16515;
      process_set_field_int (filever, "productbuildpart", D.16516);
      ffi.6 = ffi;
      D.16513 = ffi.6->dwProductVersionLS;
      D.16517 = (short unsigned int) D.16513;
      D.16518 = (unsigned int) D.16517;
      process_set_field_int (filever, "productprivatepart", D.16518);
      ffi.6 = ffi;
      D.16519 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.16520 = ffi.6->dwFileFlagsMask;
      D.16521 = D.16519 & D.16520;
      D.16522 = (int) D.16521;
      D.16523 = D.16522 & 1;
      process_set_field_bool (filever, "isdebug", D.16523);
      ffi.6 = ffi;
      D.16519 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.16520 = ffi.6->dwFileFlagsMask;
      D.16521 = D.16519 & D.16520;
      D.16522 = (int) D.16521;
      D.16524 = D.16522 & 2;
      process_set_field_bool (filever, "isprerelease", D.16524);
      ffi.6 = ffi;
      D.16519 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.16520 = ffi.6->dwFileFlagsMask;
      D.16521 = D.16519 & D.16520;
      D.16522 = (int) D.16521;
      D.16525 = D.16522 & 4;
      process_set_field_bool (filever, "ispatched", D.16525);
      ffi.6 = ffi;
      D.16519 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.16520 = ffi.6->dwFileFlagsMask;
      D.16521 = D.16519 & D.16520;
      D.16522 = (int) D.16521;
      D.16526 = D.16522 & 8;
      process_set_field_bool (filever, "isprivatebuild", D.16526);
      ffi.6 = ffi;
      D.16519 = ffi.6->dwFileFlags;
      ffi.6 = ffi;
      D.16520 = ffi.6->dwFileFlagsMask;
      D.16521 = D.16519 & D.16520;
      D.16522 = (int) D.16521;
      D.16527 = D.16522 & 32;
      process_set_field_bool (filever, "isspecialbuild", D.16527);
      <D.16493>:
      monoeg_g_free (query);
      query = monoeg_g_utf8_to_utf16 ("\\VarFileInfo\\Translation", -1, 0B, 0B, 0B);
      if (query == 0B) goto <D.16528>; else goto <D.16529>;
      <D.16528>:
      monoeg_g_free (data);
      return;
      <D.16529>:
      D.16530 = VerQueryValue (data, query, &trans_data, &trans_size);
      if (D.16530 != 0) goto <D.16531>; else goto <D.16532>;
      <D.16531>:
      trans_size.7 = trans_size;
      if (trans_size.7 > 3) goto <D.16534>; else goto <D.16535>;
      <D.16534>:
      trans_data.8 = trans_data;
      D.16537 = *trans_data.8;
      D.16538 = (int) D.16537;
      trans_data.8 = trans_data;
      D.16539 = trans_data.8 + 1;
      D.16540 = *D.16539;
      D.16541 = (int) D.16540;
      D.16542 = D.16541 << 8;
      D.16543 = D.16538 | D.16542;
      trans_data.8 = trans_data;
      D.16544 = trans_data.8 + 2;
      D.16545 = *D.16544;
      D.16546 = (int) D.16545;
      D.16547 = D.16546 << 16;
      D.16548 = D.16543 | D.16547;
      trans_data.8 = trans_data;
      D.16549 = trans_data.8 + 3;
      D.16550 = *D.16549;
      D.16551 = (int) D.16550;
      D.16552 = D.16551 << 24;
      D.16553 = D.16548 | D.16552;
      lang = (guint32) D.16553;
      D.16554 = lang & 65535;
      lang_count = VerLanguageName (D.16554, &lang_buf, 128);
      if (lang_count != 0) goto <D.16555>; else goto <D.16556>;
      <D.16555>:
      process_set_field_string (filever, "language", &lang_buf, lang_count);
      <D.16556>:
      trans_data.8 = trans_data;
      D.16539 = trans_data.8 + 1;
      D.16540 = *D.16539;
      D.16541 = (int) D.16540;
      trans_data.8 = trans_data;
      D.16537 = *trans_data.8;
      D.16538 = (int) D.16537;
      process_module_stringtable (filever, data, D.16538, D.16541);
      <D.16535>:
      goto <D.16557>;
      <D.16532>:
      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.16558>; else goto <D.16559>;
      <D.16558>:
      process_set_field_string (filever, "language", &lang_buf, lang_count);
      <D.16559>:
      <D.16557>:
      monoeg_g_free (query);
      <D.16488>:
      monoeg_g_free (data);
      <D.16485>:
    }
  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.16563;
  struct MonoClass * D.16564;
  int D.16565;
  sizetype D.16566;
  guint8 * D.16567;
  unsigned char D.16568;
  struct MonoClassField * field;

  D.16563 = obj->vtable;
  D.16564 = D.16563->klass;
  field = mono_class_get_field_from_name (D.16564, fieldname);
  D.16565 = field->offset;
  D.16566 = (sizetype) D.16565;
  D.16567 = obj + D.16566;
  D.16568 = (unsigned char) val;
  *D.16567 = D.16568;
}


process_module_stringtable (struct MonoObject * filever, void * data, guchar lang_hi, guchar lang_lo)
{
  int D.16569;
  int D.16570;

  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "comments", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\Comments");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "companyname", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\CompanyName");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "filedescription", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\FileDescription");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "fileversion", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\FileVersion");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "internalname", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\InternalName");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "legalcopyright", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\LegalCopyright");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "legaltrademarks", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\LegalTrademarks");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "originalfilename", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\OriginalFilename");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "privatebuild", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\PrivateBuild");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "productname", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\ProductName");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "productversion", D.16570, D.16569, "\\StringFileInfo\\%02X%02X%02X%02X\\ProductVersion");
  D.16569 = (int) lang_lo;
  D.16570 = (int) lang_hi;
  process_module_string_read (filever, data, "specialbuild", D.16570, D.16569, "\\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.16571;
  int D.16572;
  int D.16575;
  unsigned int chars.9;
  unsigned int D.16579;
  gunichar2 * buffer.10;
  gchar * lang_key_utf8;
  gunichar2 * lang_key;
  gunichar2 * buffer;
  UINT chars;

  try
    {
      D.16571 = (int) lang_hi;
      D.16572 = (int) lang_lo;
      lang_key_utf8 = monoeg_g_strdup_printf (key, D.16572, D.16571, 4, 176);
      lang_key = monoeg_g_utf8_to_utf16 (lang_key_utf8, -1, 0B, 0B, 0B);
      D.16575 = VerQueryValue (data, lang_key, &buffer, &chars);
      if (D.16575 != 0) goto <D.16576>; else goto <D.16573>;
      <D.16576>:
      chars.9 = chars;
      if (chars.9 != 0) goto <D.16578>; else goto <D.16573>;
      <D.16578>:
      chars.9 = chars;
      D.16579 = chars.9 + 4294967295;
      buffer.10 = buffer;
      process_set_field_string (filever, fieldname, buffer.10, D.16579);
      goto <D.16574>;
      <D.16573>:
      process_set_field_string (filever, fieldname, "", 0);
      <D.16574>:
      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.16581;
  struct MonoClass * D.16582;
  int D.16583;
  sizetype D.16584;
  void * * D.16585;
  struct MonoClassField * field;

  D.16581 = obj->vtable;
  D.16582 = D.16581->klass;
  field = mono_class_get_field_from_name (D.16582, fieldname);
  D.16583 = field->offset;
  D.16584 = (sizetype) D.16583;
  D.16585 = obj + D.16584;
  *D.16585 = val;
}


process_set_field_int (struct MonoObject * obj, const gchar * fieldname, guint32 val)
{
  struct MonoVTable * D.16586;
  struct MonoClass * D.16587;
  int D.16588;
  sizetype D.16589;
  guint32 * D.16590;
  struct MonoClassField * field;

  D.16586 = obj->vtable;
  D.16587 = D.16586->klass;
  field = mono_class_get_field_from_name (D.16587, fieldname);
  D.16588 = field->offset;
  D.16589 = (sizetype) D.16588;
  D.16590 = obj + D.16589;
  *D.16590 = val;
}


unicode_chars (const gunichar2 * str)
{
  unsigned int D.16591;
  const gunichar2 * D.16592;
  short unsigned int D.16593;
  guint32 D.16596;
  guint32 len;

  len = 0;
  <D.16170>:
  D.16591 = len * 2;
  D.16592 = str + D.16591;
  D.16593 = *D.16592;
  if (D.16593 == 0) goto <D.16594>; else goto <D.16595>;
  <D.16594>:
  D.16596 = len;
  return D.16596;
  <D.16595>:
  len = len + 1;
  goto <D.16170>;
}


process_set_field_string (struct MonoObject * obj, const gchar * fieldname, const gunichar2 * val, guint32 len)
{
  int len.11;
  struct MonoVTable * D.16599;
  struct MonoDomain * D.16600;
  struct MonoClass * D.16601;
  int D.16602;
  sizetype D.16603;
  void * D.16604;
  struct MonoClassField * field;
  struct MonoString * string;

  len.11 = (int) len;
  D.16599 = obj->vtable;
  D.16600 = D.16599->domain;
  string = mono_string_new_utf16 (D.16600, val, len.11);
  D.16599 = obj->vtable;
  D.16601 = D.16599->klass;
  field = mono_class_get_field_from_name (D.16601, fieldname);
  D.16602 = field->offset;
  D.16603 = (sizetype) D.16602;
  D.16604 = obj + D.16603;
  mono_gc_wbarrier_generic_store (D.16604, string);
}


process_set_field_object (struct MonoObject * obj, const gchar * fieldname, struct MonoObject * data)
{
  struct MonoVTable * D.16605;
  struct MonoClass * D.16606;
  int D.16607;
  sizetype D.16608;
  void * D.16609;
  struct MonoClassField * field;

  D.16605 = obj->vtable;
  D.16606 = D.16605->klass;
  field = mono_class_get_field_from_name (D.16606, fieldname);
  D.16607 = field->offset;
  D.16608 = (sizetype) D.16607;
  D.16609 = obj + D.16608;
  mono_gc_wbarrier_generic_store (D.16609, data);
}


ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal (struct MonoObject * this, struct MonoString * filename)
{
  struct MonoImage * system_assembly.12;
  struct MonoVTable * D.16613;
  struct MonoClass * D.16614;
  struct MonoImage * system_assembly.13;
  mono_unichar2 * D.16616;
  int D.16617;
  unsigned int D.16618;
  mono_unichar2 * D.16619;

  system_assembly.12 = system_assembly;
  if (system_assembly.12 == 0B) goto <D.16611>; else goto <D.16612>;
  <D.16611>:
  D.16613 = this->vtable;
  D.16614 = D.16613->klass;
  system_assembly.13 = D.16614->image;
  system_assembly = system_assembly.13;
  <D.16612>:
  D.16616 = mono_string_chars (filename);
  process_get_fileversion (this, D.16616);
  D.16617 = mono_string_length (filename);
  D.16618 = (unsigned int) D.16617;
  D.16619 = mono_string_chars (filename);
  process_set_field_string (this, "filename", D.16619, D.16618);
}


ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (struct MonoProcessStartInfo * proc_start_info, struct MonoProcInfo * process_info)
{
  unsigned int D.16620;
  WapiShellExecuteShowFlags iftmp.14;
  <unnamed type> D.16622;
  WapiShellExecuteShowFlags iftmp.15;
  struct MonoString * D.16630;
  mono_unichar2 * D.16633;
  struct MonoString * D.16634;
  mono_unichar2 * D.16637;
  struct MonoString * D.16638;
  int D.16641;
  mono_unichar2 * D.16644;
  struct MonoString * D.16645;
  int D.16648;
  mono_unichar2 * D.16651;
  unsigned char D.16652;
  void * D.16655;
  <unnamed type> D.16657;
  unsigned int D.16658;
  unsigned int D.16661;
  unsigned int D.16662;
  void * D.16664;
  unsigned int D.16665;
  MonoBoolean D.16666;
  struct SHELLEXECUTEINFO shellex;
  gboolean ret;

  try
    {
      shellex = {};
      shellex.cbSize = 60;
      shellex.fMask = 65856;
      D.16620 = proc_start_info->window_style;
      shellex.nShow = D.16620;
      D.16622 = shellex.nShow;
      if (D.16622 != 0) goto <D.16623>; else goto <D.16624>;
      <D.16623>:
      D.16622 = shellex.nShow;
      if (D.16622 != 1) goto <D.16626>; else goto <D.16627>;
      <D.16626>:
      iftmp.15 = shellex.nShow;
      goto <D.16628>;
      <D.16627>:
      iftmp.15 = 0;
      <D.16628>:
      iftmp.14 = iftmp.15;
      goto <D.16629>;
      <D.16624>:
      iftmp.14 = 1;
      <D.16629>:
      shellex.nShow = iftmp.14;
      D.16630 = proc_start_info->filename;
      if (D.16630 != 0B) goto <D.16631>; else goto <D.16632>;
      <D.16631>:
      D.16630 = proc_start_info->filename;
      D.16633 = mono_string_chars (D.16630);
      shellex.lpFile = D.16633;
      <D.16632>:
      D.16634 = proc_start_info->arguments;
      if (D.16634 != 0B) goto <D.16635>; else goto <D.16636>;
      <D.16635>:
      D.16634 = proc_start_info->arguments;
      D.16637 = mono_string_chars (D.16634);
      shellex.lpParameters = D.16637;
      <D.16636>:
      D.16638 = proc_start_info->verb;
      if (D.16638 != 0B) goto <D.16639>; else goto <D.16640>;
      <D.16639>:
      D.16638 = proc_start_info->verb;
      D.16641 = mono_string_length (D.16638);
      if (D.16641 != 0) goto <D.16642>; else goto <D.16643>;
      <D.16642>:
      D.16638 = proc_start_info->verb;
      D.16644 = mono_string_chars (D.16638);
      shellex.lpVerb = D.16644;
      <D.16643>:
      <D.16640>:
      D.16645 = proc_start_info->working_directory;
      if (D.16645 != 0B) goto <D.16646>; else goto <D.16647>;
      <D.16646>:
      D.16645 = proc_start_info->working_directory;
      D.16648 = mono_string_length (D.16645);
      if (D.16648 != 0) goto <D.16649>; else goto <D.16650>;
      <D.16649>:
      D.16645 = proc_start_info->working_directory;
      D.16651 = mono_string_chars (D.16645);
      shellex.lpDirectory = D.16651;
      <D.16650>:
      <D.16647>:
      D.16652 = proc_start_info->error_dialog;
      if (D.16652 != 0) goto <D.16653>; else goto <D.16654>;
      <D.16653>:
      D.16655 = proc_start_info->error_dialog_parent_handle;
      shellex.hwnd = D.16655;
      goto <D.16656>;
      <D.16654>:
      D.16657 = shellex.fMask;
      D.16658 = D.16657 | 1024;
      shellex.fMask = D.16658;
      <D.16656>:
      ret = ShellExecuteEx (&shellex);
      if (ret == 0) goto <D.16659>; else goto <D.16660>;
      <D.16659>:
      D.16661 = GetLastError ();
      D.16662 = -D.16661;
      process_info->pid = D.16662;
      goto <D.16663>;
      <D.16660>:
      D.16664 = shellex.hProcess;
      process_info->process_handle = D.16664;
      process_info->thread_handle = 0B;
      D.16664 = shellex.hProcess;
      D.16665 = GetProcessId (D.16664);
      process_info->pid = D.16665;
      process_info->tid = 0;
      <D.16663>:
      D.16666 = (MonoBoolean) ret;
      return D.16666;
    }
  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.16669;
  struct MonoString * D.16672;
  gchar * spath.16;
  MonoBoolean D.16676;
  struct MonoArray * D.16677;
  unsigned int i.17;
  struct MonoArray * D.16681;
  char * D.16682;
  int D.16685;
  unsigned int D.16686;
  unsigned int D.16687;
  unsigned int len.18;
  unsigned int D.16689;
  char * D.16690;
  int D.16691;
  unsigned int D.16692;
  unsigned int D.16693;
  unsigned int D.16694;
  unsigned int D.16695;
  unsigned int D.16696;
  int D.16697;
  unsigned int D.16698;
  unsigned int D.16699;
  char * D.16700;
  char * D.16703;
  int D.16704;
  unsigned int D.16705;
  unsigned int D.16706;
  mono_unichar2 * D.16707;
  int D.16708;
  unsigned int D.16709;
  unsigned int D.16710;
  int D.16711;
  unsigned int D.16712;
  unsigned int D.16713;
  mono_unichar2 * D.16714;
  int D.16715;
  unsigned int D.16716;
  unsigned int D.16717;
  unsigned int D.16718;
  struct MonoString * D.16722;
  int D.16724;
  struct MonoString * D.16725;
  unsigned char D.16728;
  _Bool D.16729;
  const gunichar2 * iftmp.19;
  void * D.16734;
  const gunichar2 * iftmp.20;
  struct MonoString * D.16736;
  mono_unichar2 * D.16740;
  const gunichar2 * iftmp.21;
  void * D.16750;
  void * D.16751;
  void * D.16752;
  unsigned int D.16755;
  unsigned int D.16756;
  unsigned int D.16758;
  unsigned int D.16759;
  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.16669 = proc_start_info->create_no_window;
      if (D.16669 != 0) goto <D.16670>; else goto <D.16671>;
      <D.16670>:
      creation_flags = creation_flags | 134217728;
      <D.16671>:
      D.16672 = proc_start_info->filename;
      shell_path = mono_string_chars (D.16672);
      complete_path (shell_path, &spath);
      spath.16 = spath;
      if (spath.16 == 0B) goto <D.16674>; else goto <D.16675>;
      <D.16674>:
      process_info->pid = 4294967294;
      D.16676 = 0;
      return D.16676;
      <D.16675>:
      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.16677 = process_info->env_keys;
      if (D.16677 != 0B) goto <D.16678>; else goto <D.16679>;
      <D.16678>:
      {
        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.16321>;
        <D.16320>:
        i.17 = (unsigned int) i;
        D.16681 = process_info->env_values;
        D.16682 = mono_array_addr_with_size (D.16681, 4, i.17);
        ms = MEM[(struct MonoString * *)D.16682];
        if (ms == 0B) goto <D.16683>; else goto <D.16684>;
        <D.16683>:
        // predicted unlikely by continue predictor.
        goto <D.16319>;
        <D.16684>:
        D.16685 = mono_string_length (ms);
        D.16686 = (unsigned int) D.16685;
        D.16687 = D.16686 * 2;
        len.18 = (unsigned int) len;
        D.16689 = D.16687 + len.18;
        len = (gint) D.16689;
        i.17 = (unsigned int) i;
        D.16677 = process_info->env_keys;
        D.16690 = mono_array_addr_with_size (D.16677, 4, i.17);
        ms = MEM[(struct MonoString * *)D.16690];
        D.16691 = mono_string_length (ms);
        D.16692 = (unsigned int) D.16691;
        D.16693 = D.16692 * 2;
        len.18 = (unsigned int) len;
        D.16694 = D.16693 + len.18;
        len = (gint) D.16694;
        len.18 = (unsigned int) len;
        D.16695 = len.18 + 4;
        len = (gint) D.16695;
        <D.16319>:
        i = i + 1;
        <D.16321>:
        i.17 = (unsigned int) i;
        D.16677 = process_info->env_keys;
        D.16696 = mono_array_length (D.16677);
        if (i.17 < D.16696) goto <D.16320>; else goto <D.16322>;
        <D.16322>:
        equals16 = monoeg_g_utf8_to_utf16 ("=", 1, 0B, 0B, 0B);
        D.16697 = len + 1;
        D.16698 = (unsigned int) D.16697;
        D.16699 = D.16698 * 2;
        str = monoeg_malloc0 (D.16699);
        ptr = str;
        i = 0;
        goto <D.16325>;
        <D.16324>:
        i.17 = (unsigned int) i;
        D.16681 = process_info->env_values;
        D.16700 = mono_array_addr_with_size (D.16681, 4, i.17);
        value = MEM[(struct MonoString * *)D.16700];
        if (value == 0B) goto <D.16701>; else goto <D.16702>;
        <D.16701>:
        // predicted unlikely by continue predictor.
        goto <D.16323>;
        <D.16702>:
        i.17 = (unsigned int) i;
        D.16677 = process_info->env_keys;
        D.16703 = mono_array_addr_with_size (D.16677, 4, i.17);
        key = MEM[(struct MonoString * *)D.16703];
        D.16704 = mono_string_length (key);
        D.16705 = (unsigned int) D.16704;
        D.16706 = D.16705 * 2;
        D.16707 = mono_string_chars (key);
        memcpy (ptr, D.16707, D.16706);
        D.16708 = mono_string_length (key);
        D.16709 = (unsigned int) D.16708;
        D.16710 = D.16709 * 2;
        ptr = ptr + D.16710;
        memcpy (ptr, equals16, 2);
        ptr = ptr + 2;
        D.16711 = mono_string_length (value);
        D.16712 = (unsigned int) D.16711;
        D.16713 = D.16712 * 2;
        D.16714 = mono_string_chars (value);
        memcpy (ptr, D.16714, D.16713);
        D.16715 = mono_string_length (value);
        D.16716 = (unsigned int) D.16715;
        D.16717 = D.16716 * 2;
        ptr = ptr + D.16717;
        ptr = ptr + 2;
        <D.16323>:
        i = i + 1;
        <D.16325>:
        i.17 = (unsigned int) i;
        D.16677 = process_info->env_keys;
        D.16718 = mono_array_length (D.16677);
        if (i.17 < D.16718) goto <D.16324>; else goto <D.16326>;
        <D.16326>:
        monoeg_g_free (equals16);
        env_vars = str;
      }
      <D.16679>:
      D.16722 = proc_start_info->working_directory;
      if (D.16722 == 0B) goto <D.16719>; else goto <D.16723>;
      <D.16723>:
      D.16722 = proc_start_info->working_directory;
      D.16724 = mono_string_length (D.16722);
      if (D.16724 == 0) goto <D.16719>; else goto <D.16720>;
      <D.16719>:
      dir = 0B;
      goto <D.16721>;
      <D.16720>:
      D.16722 = proc_start_info->working_directory;
      dir = mono_string_chars (D.16722);
      <D.16721>:
      D.16725 = process_info->username;
      if (D.16725 != 0B) goto <D.16726>; else goto <D.16727>;
      <D.16726>:
      D.16728 = process_info->load_user_profile;
      D.16729 = D.16728 != 0;
      logon_flags = (guint32) D.16729;
      if (cmd != 0B) goto <D.16731>; else goto <D.16732>;
      <D.16731>:
      iftmp.19 = mono_string_chars (cmd);
      goto <D.16733>;
      <D.16732>:
      iftmp.19 = 0B;
      <D.16733>:
      D.16734 = process_info->password;
      D.16736 = process_info->domain;
      if (D.16736 != 0B) goto <D.16737>; else goto <D.16738>;
      <D.16737>:
      D.16736 = process_info->domain;
      iftmp.20 = mono_string_chars (D.16736);
      goto <D.16739>;
      <D.16738>:
      iftmp.20 = 0B;
      <D.16739>:
      D.16725 = process_info->username;
      D.16740 = mono_string_chars (D.16725);
      ret = CreateProcessWithLogonW (D.16740, iftmp.20, D.16734, logon_flags, shell_path, iftmp.19, creation_flags, env_vars, dir, &startinfo, &procinfo);
      goto <D.16741>;
      <D.16727>:
      if (cmd != 0B) goto <D.16743>; else goto <D.16744>;
      <D.16743>:
      iftmp.21 = mono_string_chars (cmd);
      goto <D.16745>;
      <D.16744>:
      iftmp.21 = 0B;
      <D.16745>:
      ret = CreateProcess (shell_path, iftmp.21, 0B, 0B, 1, creation_flags, env_vars, dir, &startinfo, &procinfo);
      <D.16741>:
      monoeg_g_free (env_vars);
      if (free_shell_path != 0) goto <D.16746>; else goto <D.16747>;
      <D.16746>:
      monoeg_g_free (shell_path);
      <D.16747>:
      if (ret != 0) goto <D.16748>; else goto <D.16749>;
      <D.16748>:
      D.16750 = procinfo.hProcess;
      process_info->process_handle = D.16750;
      process_info->thread_handle = 0B;
      D.16751 = procinfo.hThread;
      D.16752 = D.16751 + 4294967295;
      if (D.16752 <= 4294967293B) goto <D.16753>; else goto <D.16754>;
      <D.16753>:
      D.16751 = procinfo.hThread;
      CloseHandle (D.16751);
      <D.16754>:
      D.16755 = procinfo.dwProcessId;
      process_info->pid = D.16755;
      D.16756 = procinfo.dwThreadId;
      process_info->tid = D.16756;
      goto <D.16757>;
      <D.16749>:
      D.16758 = GetLastError ();
      D.16759 = -D.16758;
      process_info->pid = D.16759;
      <D.16757>:
      D.16676 = (MonoBoolean) ret;
      return D.16676;
    }
  finally
    {
      startinfo = {CLOBBER};
      procinfo = {CLOBBER};
      spath = {CLOBBER};
    }
}


complete_path (const gunichar2 * appname, gchar * * completed)
{
  int D.16762;
  gchar * D.16765;
  gboolean D.16766;
  int D.16767;
  int D.16770;
  gchar * D.16773;
  gchar * D.16776;
  gchar * utf8app;
  gchar * utf8appmemory;
  gchar * found;

  utf8app = monoeg_g_utf16_to_utf8 (appname, -1, 0B, 0B, 0B);
  utf8appmemory = utf8app;
  D.16762 = monoeg_g_path_is_absolute (utf8app);
  if (D.16762 != 0) goto <D.16763>; else goto <D.16764>;
  <D.16763>:
  D.16765 = quote_path (utf8app);
  *completed = D.16765;
  monoeg_g_free (utf8appmemory);
  D.16766 = 1;
  return D.16766;
  <D.16764>:
  D.16767 = monoeg_g_file_test (utf8app, 8);
  if (D.16767 != 0) goto <D.16768>; else goto <D.16769>;
  <D.16768>:
  D.16770 = monoeg_g_file_test (utf8app, 4);
  if (D.16770 == 0) goto <D.16771>; else goto <D.16772>;
  <D.16771>:
  D.16773 = quote_path (utf8app);
  *completed = D.16773;
  monoeg_g_free (utf8appmemory);
  D.16766 = 1;
  return D.16766;
  <D.16772>:
  <D.16769>:
  found = monoeg_g_find_program_in_path (utf8app);
  if (found == 0B) goto <D.16774>; else goto <D.16775>;
  <D.16774>:
  *completed = 0B;
  monoeg_g_free (utf8appmemory);
  D.16766 = 0;
  return D.16766;
  <D.16775>:
  D.16776 = quote_path (found);
  *completed = D.16776;
  monoeg_g_free (found);
  monoeg_g_free (utf8appmemory);
  D.16766 = 1;
  return D.16766;
}


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

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


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

  D.16781 = __builtin_object_size (__dest, 0);
  D.16780 = __builtin___memcpy_chk (__dest, __src, __len, D.16781);
  return D.16780;
}


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

  if (ms < 0) goto <D.16783>; else goto <D.16784>;
  <D.16783>:
  ret = WaitForSingleObjectEx (process, 4294967295, 1);
  goto <D.16785>;
  <D.16784>:
  ms.22 = (unsigned int) ms;
  ret = WaitForSingleObjectEx (process, ms.22, 1);
  <D.16785>:
  if (ret == 0) goto <D.16787>; else goto <D.16788>;
  <D.16787>:
  D.16789 = 1;
  return D.16789;
  <D.16788>:
  D.16789 = 0;
  return D.16789;
}


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

  if (ms < 0) goto <D.16791>; else goto <D.16792>;
  <D.16791>:
  ret = WaitForInputIdle (process, 4294967295);
  goto <D.16793>;
  <D.16792>:
  ms.23 = (unsigned int) ms;
  ret = WaitForInputIdle (process, ms.23);
  <D.16793>:
  D.16796 = ret == 0;
  D.16795 = (MonoBoolean) D.16796;
  return D.16795;
}


ves_icall_System_Diagnostics_Process_ExitTime_internal (void * process)
{
  unsigned int D.16800;
  long long unsigned int D.16801;
  long long unsigned int D.16802;
  unsigned int D.16803;
  long long unsigned int D.16804;
  long long unsigned int D.16805;
  gint64 D.16806;
  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.16798>; else goto <D.16799>;
      <D.16798>:
      D.16800 = exit_time.dwHighDateTime;
      D.16801 = (long long unsigned int) D.16800;
      D.16802 = D.16801 << 32;
      D.16803 = exit_time.dwLowDateTime;
      D.16804 = (long long unsigned int) D.16803;
      D.16805 = D.16802 + D.16804;
      ticks = (gint64) D.16805;
      D.16806 = ticks;
      return D.16806;
      <D.16799>:
      D.16806 = 0;
      return D.16806;
    }
  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.16811;
  long long unsigned int D.16812;
  long long unsigned int D.16813;
  unsigned int D.16814;
  long long unsigned int D.16815;
  long long unsigned int D.16816;
  gint64 D.16817;
  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.16809>; else goto <D.16810>;
      <D.16809>:
      D.16811 = create_time.dwHighDateTime;
      D.16812 = (long long unsigned int) D.16811;
      D.16813 = D.16812 << 32;
      D.16814 = create_time.dwLowDateTime;
      D.16815 = (long long unsigned int) D.16814;
      D.16816 = D.16813 + D.16815;
      ticks = (gint64) D.16816;
      D.16817 = ticks;
      return D.16817;
      <D.16810>:
      D.16817 = 0;
      return D.16817;
    }
  finally
    {
      create_time = {CLOBBER};
      exit_time = {CLOBBER};
      kernel_time = {CLOBBER};
      user_time = {CLOBBER};
    }
}


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

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


ves_icall_System_Diagnostics_Process_ProcessName_internal (void * process)
{
  struct MonoString * D.16826;
  void * mod.25;
  int len.26;
  struct MonoDomain * D.16831;
  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.16824>; else goto <D.16825>;
      <D.16824>:
      D.16826 = 0B;
      return D.16826;
      <D.16825>:
      mod.25 = mod;
      len = GetModuleBaseName (process, mod.25, &name, 260);
      if (len == 0) goto <D.16828>; else goto <D.16829>;
      <D.16828>:
      D.16826 = 0B;
      return D.16826;
      <D.16829>:
      len.26 = (int) len;
      D.16831 = mono_domain_get ();
      string = mono_string_new_utf16 (D.16831, &name, len.26);
      D.16826 = string;
      return D.16826;
    }
  finally
    {
      mod = {CLOBBER};
      name = {CLOBBER};
      needed = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_GetProcesses_internal ()
{
  unsigned int D.16834;
  unsigned int D.16835;
  unsigned int needed.27;
  unsigned int D.16840;
  struct MonoClass * D.16841;
  struct MonoDomain * D.16842;
  char * D.16843;
  struct MonoArray * D.16844;
  struct MonoArray * procs;
  gboolean ret;
  DWORD needed;
  guint32 count;
  guint32 * pids;

  try
    {
      count = 512;
      <D.16380>:
      D.16834 = count * 4;
      pids = monoeg_malloc0 (D.16834);
      D.16835 = count * 4;
      ret = EnumProcesses (pids, D.16835, &needed);
      if (ret == 0) goto <D.16836>; else goto <D.16837>;
      <D.16836>:
      {
        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.16837>:
      D.16835 = count * 4;
      needed.27 = needed;
      if (D.16835 > needed.27) goto <D.16379>; else goto <D.16839>;
      <D.16839>:
      monoeg_g_free (pids);
      pids = 0B;
      D.16840 = count * 3;
      count = D.16840 / 2;
      goto <D.16380>;
      <D.16379>:
      needed.27 = needed;
      count = needed.27 / 4;
      D.16841 = mono_get_int32_class ();
      D.16842 = mono_domain_get ();
      procs = mono_array_new (D.16842, D.16841, count);
      needed.27 = needed;
      D.16843 = mono_array_addr_with_size (procs, 4, 0);
      memcpy (D.16843, pids, needed.27);
      monoeg_g_free (pids);
      pids = 0B;
      D.16844 = procs;
      return D.16844;
    }
  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.16849;
  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.16849 = (MonoBoolean) ret;
      return D.16849;
    }
  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.16854;
  unsigned int ws_max.30;
  unsigned int ws_min.31;
  gboolean ret;
  SIZE_T ws_min;
  SIZE_T ws_max;

  try
    {
      ret = GetProcessWorkingSetSize (process, &ws_min, &ws_max);
      if (ret == 0) goto <D.16852>; else goto <D.16853>;
      <D.16852>:
      D.16854 = 0;
      return D.16854;
      <D.16853>:
      if (use_min == 1) goto <D.16855>; else goto <D.16856>;
      <D.16855>:
      ws_min = min;
      goto <D.16857>;
      <D.16856>:
      ws_max = max;
      <D.16857>:
      ws_max.30 = ws_max;
      ws_min.31 = ws_min;
      ret = SetProcessWorkingSetSize (process, ws_min.31, ws_max.30);
      D.16854 = (MonoBoolean) ret;
      return D.16854;
    }
  finally
    {
      ws_min = {CLOBBER};
      ws_max = {CLOBBER};
    }
}


ves_icall_System_Diagnostics_Process_Kill_internal (void * process, gint32 sig)
{
  MonoBoolean D.16862;
  int D.16863;
  int D.16864;

  D.16863 = -sig;
  D.16864 = TerminateProcess (process, D.16863);
  D.16862 = (MonoBoolean) D.16864;
  return D.16862;
}


ves_icall_System_Diagnostics_Process_Times (void * process, gint32 type)
{
  int D.16866;
  gint64 D.16871;
  struct FILETIME * user_time.32;
  struct FILETIME * kernel_time.33;
  long long int D.16876;
  long long int D.16877;
  struct FILETIME create_time;
  struct FILETIME exit_time;
  struct FILETIME kernel_time;
  struct FILETIME user_time;

  try
    {
      D.16866 = GetProcessTimes (process, &create_time, &exit_time, &kernel_time, &user_time);
      if (D.16866 != 0) goto <D.16867>; else goto <D.16868>;
      <D.16867>:
      if (type == 0) goto <D.16869>; else goto <D.16870>;
      <D.16869>:
      user_time.32 = &user_time;
      D.16871 = MEM[(gint64 *)user_time.32];
      return D.16871;
      <D.16870>:
      if (type == 1) goto <D.16873>; else goto <D.16874>;
      <D.16873>:
      kernel_time.33 = &kernel_time;
      D.16871 = MEM[(gint64 *)kernel_time.33];
      return D.16871;
      <D.16874>:
      kernel_time.33 = &kernel_time;
      D.16876 = MEM[(gint64 *)kernel_time.33];
      user_time.32 = &user_time;
      D.16877 = MEM[(gint64 *)user_time.32];
      D.16871 = D.16876 + D.16877;
      return D.16871;
      <D.16868>:
      D.16871 = 0;
      return D.16871;
    }
  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.16880;
  gint32 iftmp.34;
  unsigned int D.16884;
  gint32 D.16886;
  gint32 ret;

  D.16880 = GetPriorityClass (process);
  ret = (gint32) D.16880;
  if (ret == 0) goto <D.16882>; else goto <D.16883>;
  <D.16882>:
  D.16884 = GetLastError ();
  iftmp.34 = (gint32) D.16884;
  goto <D.16885>;
  <D.16883>:
  iftmp.34 = 0;
  <D.16885>:
  *error = iftmp.34;
  D.16886 = ret;
  return D.16886;
}


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

  priority_class.35 = (unsigned int) priority_class;
  ret = SetPriorityClass (process, priority_class.35);
  if (ret == 0) goto <D.16890>; else goto <D.16891>;
  <D.16890>:
  D.16892 = GetLastError ();
  iftmp.36 = (gint32) D.16892;
  goto <D.16893>;
  <D.16891>:
  iftmp.36 = 0;
  <D.16893>:
  *error = iftmp.36;
  D.16894 = (MonoBoolean) ret;
  return D.16894;
}


ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate (void * process)
{
  void * D.16896;
  void * D.16897;
  void * D.16898;
  void * ret;

  try
    {
      D.16896 = GetCurrentProcess ();
      D.16897 = GetCurrentProcess ();
      DuplicateHandle (D.16897, process, D.16896, &ret, 2032639, 1, 0);
      D.16898 = ret;
      return D.16898;
    }
  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)
{
  <unnamed type> data_type.37;
  void * pid.38;
  long long int D.16903;
  <unnamed type> perror.39;
  int perror.40;
  gint64 D.16908;
  MonoProcessError perror;
  guint64 res;

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


