process_wait (void * handle, guint32 timeout, gboolean alertable)
{
  long unsigned int D.11829;
  guint32 D.11832;
  long int handle.0;
  signed int D.11834;
  _Bool D.11835;
  long int D.11836;
  long int D.11837;
  struct _WapiHandle_process * process_handle.1;
  int D.11843;
  int D.11848;
  int D.11849;
  _Bool D.11852;
  union MonoSemType * D.11857;
  unsigned int D.11858;
  unsigned int D.11859;
  int * D.11863;
  int D.11864;
  int D.11872;
  unsigned int D.11876;
  unsigned int D.11881;
  int D.11884;
  _Bool D.11887;
  long int D.11888;
  long int D.11889;
  int iftmp.2;
  unsigned char D.11896;
  unsigned char D.11897;
  unsigned char D.11898;
  signed char D.11899;
  signed char D.11900;
  int D.11903;
  int D.11904;
  unsigned int D.11905;
  int D.11907;
  unsigned int D.11908;
  unsigned int D.11909;
  long int D.11910;
  struct WapiFileTime * D.11911;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  pid_t pid;
  pid_t ret;
  int status;
  guint32 start;
  guint32 now;
  struct MonoProcess * mp;
  gboolean spin;
  void * current_thread;
  static const char __func__[13] = "process_wait";

  try
    {
      D.11829 = pthread_self ();
      current_thread = _wapi_thread_handle_from_id (D.11829);
      if (current_thread == 0B) goto <D.11830>; else goto <D.11831>;
      <D.11830>:
      SetLastError (6);
      D.11832 = 4294967295;
      return D.11832;
      <D.11831>:
      handle.0 = (long int) handle;
      D.11834 = (signed int) handle.0;
      D.11835 = D.11834 < 0;
      D.11836 = (long int) D.11835;
      D.11837 = __builtin_expect (D.11836, 0);
      if (D.11837 != 0) goto <D.11838>; else goto <D.11839>;
      <D.11838>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "processes.c", 2912, "(GPOINTER_TO_UINT (handle) & _WAPI_PROCESS_UNHANDLED) != _WAPI_PROCESS_UNHANDLED");
      <D.11839>:
      ok = _wapi_lookup_handle (handle, 9, &process_handle);
      if (ok == 0) goto <D.11840>; else goto <D.11841>;
      <D.11840>:
      monoeg_g_log (0B, 16, "%s: error looking up process handle %p", &__func__, handle);
      D.11832 = 4294967295;
      return D.11832;
      <D.11841>:
      process_handle.1 = process_handle;
      D.11843 = process_handle.1->exited;
      if (D.11843 != 0) goto <D.11844>; else goto <D.11845>;
      <D.11844>:
      D.11832 = 0;
      return D.11832;
      <D.11845>:
      process_handle.1 = process_handle;
      pid = process_handle.1->id;
      process_handle.1 = process_handle;
      mp = process_handle.1->mono_process;
      if (mp != 0B) goto <D.11846>; else goto <D.11847>;
      <D.11846>:
      process_handle.1 = process_handle;
      D.11848 = process_handle.1->self;
      D.11849 = _wapi_getpid ();
      if (D.11848 != D.11849) goto <D.11850>; else goto <D.11851>;
      <D.11850>:
      mp = 0B;
      <D.11851>:
      <D.11847>:
      start = mono_msec_ticks ();
      now = start;
      D.11852 = mp == 0B;
      spin = (gboolean) D.11852;
      <D.11827>:
      if (mp != 0B) goto <D.11853>; else goto <D.11854>;
      <D.11853>:
      if (timeout != 4294967295) goto <D.11855>; else goto <D.11856>;
      <D.11855>:
      D.11857 = &mp->exit_sem;
      D.11858 = start - now;
      D.11859 = D.11858 + timeout;
      ret = mono_sem_timedwait (D.11857, D.11859, alertable);
      goto <D.11860>;
      <D.11856>:
      D.11857 = &mp->exit_sem;
      ret = mono_sem_wait (D.11857, alertable);
      <D.11860>:
      if (ret == -1) goto <D.11861>; else goto <D.11862>;
      <D.11861>:
      D.11863 = __errno_location ();
      D.11864 = *D.11863;
      if (D.11864 != 4) goto <D.11865>; else goto <D.11866>;
      <D.11865>:
      D.11863 = __errno_location ();
      D.11864 = *D.11863;
      if (D.11864 != 110) goto <D.11867>; else goto <D.11868>;
      <D.11867>:
      <D.11868>:
      <D.11866>:
      <D.11862>:
      if (ret == 0) goto <D.11869>; else goto <D.11870>;
      <D.11869>:
      D.11857 = &mp->exit_sem;
      mono_sem_post (D.11857);
      goto <D.11826>;
      <D.11870>:
      goto <D.11871>;
      <D.11854>:
      D.11872 = is_pid_valid (pid);
      if (D.11872 == 0) goto <D.11826>; else goto <D.11873>;
      <D.11873>:
      <D.11871>:
      if (timeout == 0) goto <D.11874>; else goto <D.11875>;
      <D.11874>:
      D.11832 = 258;
      return D.11832;
      <D.11875>:
      now = mono_msec_ticks ();
      D.11876 = now - start;
      if (D.11876 >= timeout) goto <D.11877>; else goto <D.11878>;
      <D.11877>:
      D.11832 = 258;
      return D.11832;
      <D.11878>:
      if (spin != 0) goto <D.11879>; else goto <D.11880>;
      <D.11879>:
      D.11858 = start - now;
      D.11859 = D.11858 + timeout;
      D.11881 = MIN_EXPR <D.11859, 100>;
      _wapi_handle_spin (D.11881);
      <D.11880>:
      if (alertable != 0) goto <D.11882>; else goto <D.11883>;
      <D.11882>:
      D.11884 = _wapi_thread_apc_pending (current_thread);
      if (D.11884 != 0) goto <D.11885>; else goto <D.11886>;
      <D.11885>:
      D.11832 = 192;
      return D.11832;
      <D.11886>:
      <D.11883>:
      goto <D.11827>;
      <D.11826>:
      ret = _wapi_handle_lock_shared_handles ();
      D.11887 = ret != 0;
      D.11888 = (long int) D.11887;
      D.11889 = __builtin_expect (D.11888, 0);
      if (D.11889 != 0) goto <D.11890>; else goto <D.11891>;
      <D.11890>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "processes.c", 3006, "ret == 0");
      <D.11891>:
      if (mp != 0B) goto <D.11893>; else goto <D.11894>;
      <D.11893>:
      iftmp.2 = mp->status;
      goto <D.11895>;
      <D.11894>:
      iftmp.2 = 0;
      <D.11895>:
      status = iftmp.2;
      D.11896 = (unsigned char) status;
      D.11897 = D.11896 & 127;
      D.11898 = D.11897 + 1;
      D.11899 = (signed char) D.11898;
      D.11900 = D.11899 >> 1;
      if (D.11900 > 0) goto <D.11901>; else goto <D.11902>;
      <D.11901>:
      process_handle.1 = process_handle;
      D.11903 = status & 127;
      D.11904 = D.11903 + 128;
      D.11905 = (unsigned int) D.11904;
      process_handle.1->exitstatus = D.11905;
      goto <D.11906>;
      <D.11902>:
      process_handle.1 = process_handle;
      D.11907 = status >> 8;
      D.11908 = (unsigned int) D.11907;
      D.11909 = D.11908 & 255;
      process_handle.1->exitstatus = D.11909;
      <D.11906>:
      D.11910 = time (0B);
      process_handle.1 = process_handle;
      D.11911 = &process_handle.1->exit_time;
      _wapi_time_t_to_filetime (D.11910, D.11911);
      process_handle.1 = process_handle;
      process_handle.1->exited = 1;
      _wapi_shared_handle_set_signal_state (handle, 1);
      _wapi_handle_unlock_shared_handles ();
      D.11832 = 0;
      return D.11832;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


is_pid_valid (pid_t pid)
{
  int D.11914;
  gboolean D.11917;
  gboolean result;
  gchar * dir;

  result = 0;
  dir = monoeg_g_strdup_printf ("/proc/%d", pid);
  D.11914 = access (dir, 0);
  if (D.11914 == 0) goto <D.11915>; else goto <D.11916>;
  <D.11915>:
  result = 1;
  <D.11916>:
  monoeg_g_free (dir);
  D.11917 = result;
  return D.11917;
}


_wapi_handle_spin (guint32 ms)
{
  _Bool D.11919;
  long int D.11920;
  long int D.11921;
  unsigned int D.11924;
  long int D.11925;
  struct timespec sleepytime;

  try
    {
      D.11919 = ms > 999;
      D.11920 = (long int) D.11919;
      D.11921 = __builtin_expect (D.11920, 0);
      if (D.11921 != 0) goto <D.11922>; else goto <D.11923>;
      <D.11922>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 326, "ms < 1000");
      <D.11923>:
      sleepytime.tv_sec = 0;
      D.11924 = ms * 1000000;
      D.11925 = (long int) D.11924;
      sleepytime.tv_nsec = D.11925;
      nanosleep (&sleepytime, 0B);
    }
  finally
    {
      sleepytime = {CLOBBER};
    }
}


_wapi_handle_lock_shared_handles ()
{
  int D.11926;

  D.11926 = _wapi_shm_sem_lock (3);
  return D.11926;
}


_wapi_shared_handle_set_signal_state (void * handle, gboolean state)
{
  long int handle.3;
  int iftmp.4;
  <unnamed type> D.11934;
  <unnamed type> D.11936;
  <unnamed type> D.11938;
  <unnamed type> D.11940;
  _Bool D.11942;
  long int D.11943;
  long int D.11944;
  unsigned int D.11947;
  struct _WapiHandleUnshared * D.11948;
  long unsigned int D.11949;
  long unsigned int D.11950;
  long unsigned int D.11951;
  struct _WapiHandleSharedLayout * _wapi_shared_layout.5;
  unsigned int D.11953;
  guint32 idx;
  struct _WapiHandleUnshared * handle_data;
  struct _WapiHandle_shared_ref * ref;
  struct _WapiHandleShared * shared_data;

  handle.3 = (long int) handle;
  idx = (guint32) handle.3;
  if (idx > 4194303) goto <D.11929>; else goto <D.11930>;
  <D.11929>:
  return;
  <D.11930>:
  D.11934 = _wapi_handle_type (handle);
  if (D.11934 != 9) goto <D.11935>; else goto <D.11932>;
  <D.11935>:
  D.11936 = _wapi_handle_type (handle);
  if (D.11936 != 11) goto <D.11937>; else goto <D.11932>;
  <D.11937>:
  D.11938 = _wapi_handle_type (handle);
  if (D.11938 != 12) goto <D.11939>; else goto <D.11932>;
  <D.11939>:
  D.11940 = _wapi_handle_type (handle);
  if (D.11940 != 13) goto <D.11941>; else goto <D.11932>;
  <D.11941>:
  iftmp.4 = 1;
  goto <D.11933>;
  <D.11932>:
  iftmp.4 = 0;
  <D.11933>:
  D.11942 = iftmp.4 != 0;
  D.11943 = (long int) D.11942;
  D.11944 = __builtin_expect (D.11943, 0);
  if (D.11944 != 0) goto <D.11945>; else goto <D.11946>;
  <D.11945>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "../../mono/io-layer/handles-private.h", 201, "_WAPI_SHARED_HANDLE(_wapi_handle_type (handle))");
  <D.11946>:
  D.11947 = idx / 256;
  D.11948 = _wapi_private_handles[D.11947];
  D.11949 = (long unsigned int) idx;
  D.11950 = D.11949 & 255;
  D.11951 = D.11950 * 200;
  handle_data = D.11948 + D.11951;
  ref = &handle_data->u.shared;
  _wapi_shared_layout.5 = _wapi_shared_layout;
  D.11953 = ref->offset;
  shared_data = &_wapi_shared_layout.5->handles[D.11953];
  shared_data->signalled = state;
}


_wapi_handle_type (void * handle)
{
  long int handle.6;
  unsigned int D.11960;
  struct _WapiHandleUnshared * D.11961;
  WapiHandleType D.11962;
  unsigned int D.11963;
  struct _WapiHandleUnshared * D.11964;
  long unsigned int D.11965;
  long unsigned int D.11966;
  long unsigned int D.11967;
  struct _WapiHandleUnshared * D.11968;
  guint32 idx;

  handle.6 = (long int) handle;
  idx = (guint32) handle.6;
  if (idx > 4194303) goto <D.11956>; else goto <D.11958>;
  <D.11958>:
  if (idx > 268435455) goto <D.11956>; else goto <D.11959>;
  <D.11959>:
  D.11960 = idx / 256;
  D.11961 = _wapi_private_handles[D.11960];
  if (D.11961 == 0B) goto <D.11956>; else goto <D.11957>;
  <D.11956>:
  D.11962 = 0;
  return D.11962;
  <D.11957>:
  D.11963 = idx / 256;
  D.11964 = _wapi_private_handles[D.11963];
  D.11965 = (long unsigned int) idx;
  D.11966 = D.11965 & 255;
  D.11967 = D.11966 * 200;
  D.11968 = D.11964 + D.11967;
  D.11962 = D.11968->type;
  return D.11962;
}


_wapi_handle_unlock_shared_handles ()
{
  int D.11970;

  D.11970 = _wapi_shm_sem_unlock (3);
  return D.11970;
}


process_close (void * handle, void * data)
{
  struct MonoProcess * D.11972;
  int D.11975;
  int D.11976;
  gint32 * D.11979;
  struct _WapiHandle_process * process_handle;

  process_handle = data;
  D.11972 = process_handle->mono_process;
  if (D.11972 != 0B) goto <D.11973>; else goto <D.11974>;
  <D.11973>:
  D.11975 = process_handle->self;
  D.11976 = _wapi_getpid ();
  if (D.11975 == D.11976) goto <D.11977>; else goto <D.11978>;
  <D.11977>:
  D.11972 = process_handle->mono_process;
  D.11979 = &D.11972->handle_count;
  InterlockedDecrement (D.11979);
  <D.11978>:
  <D.11974>:
  mono_processes_cleanup ();
}


InterlockedDecrement (volatile gint32 * val)
{
  gint32 D.11980;
  unsigned int D.11981;

  D.11981 = __sync_sub_and_fetch_4 (val, 1);
  D.11980 = (gint32) D.11981;
  return D.11980;
}


mono_processes_cleanup ()
{
  int D.11983;
  int D.11986;
  void * D.11989;
  int D.11997;
  unsigned int spin.7;
  struct MonoProcess * mono_processes.8;
  struct MonoProcess * D.12007;
  int mono_processes_read_lock.9;
  union MonoSemType * D.12018;
  struct MonoProcess * mp;
  struct MonoProcess * prev;
  struct MonoProcess * candidate;
  void * unref_handle;
  int spin;

  prev = 0B;
  candidate = 0B;
  D.11983 = InterlockedCompareExchange (&mono_processes_cleaning_up, 1, 0);
  if (D.11983 != 0) goto <D.11984>; else goto <D.11985>;
  <D.11984>:
  return;
  <D.11985>:
  mp = mono_processes;
  goto <D.11780>;
  <D.11781>:
  D.11986 = mp->pid;
  if (D.11986 == 0) goto <D.11987>; else goto <D.11988>;
  <D.11987>:
  D.11989 = mp->handle;
  if (D.11989 != 0B) goto <D.11990>; else goto <D.11991>;
  <D.11990>:
  pthread_mutex_lock (&mono_processes_mutex);
  unref_handle = mp->handle;
  mp->handle = 0B;
  pthread_mutex_unlock (&mono_processes_mutex);
  if (unref_handle != 0B) goto <D.11992>; else goto <D.11993>;
  <D.11992>:
  _wapi_handle_unref (unref_handle);
  <D.11993>:
  // predicted unlikely by continue predictor.
  goto <D.11780>;
  <D.11991>:
  <D.11988>:
  mp = mp->next;
  <D.11780>:
  if (mp != 0B) goto <D.11781>; else goto <D.11782>;
  <D.11782>:
  mp = mono_processes;
  spin = 0;
  goto <D.11784>;
  <D.11785>:
  D.11997 = mp->handle_count;
  if (D.11997 == 0) goto <D.11998>; else goto <D.11994>;
  <D.11998>:
  D.11986 = mp->pid;
  if (D.11986 == 0) goto <D.11995>; else goto <D.11994>;
  <D.11994>:
  if (candidate != 0B) goto <D.11995>; else goto <D.11996>;
  <D.11995>:
  if (spin > 0) goto <D.11999>; else goto <D.12000>;
  <D.11999>:
  spin.7 = (unsigned int) spin;
  _wapi_handle_spin (spin.7);
  spin = spin << 1;
  <D.12000>:
  pthread_mutex_lock (&mono_processes_mutex);
  if (candidate == 0B) goto <D.12002>; else goto <D.12003>;
  <D.12002>:
  mono_processes.8 = mono_processes;
  if (mp == mono_processes.8) goto <D.12005>; else goto <D.12006>;
  <D.12005>:
  D.12007 = mp->next;
  mono_processes = D.12007;
  goto <D.12008>;
  <D.12006>:
  D.12007 = mp->next;
  prev->next = D.12007;
  <D.12008>:
  candidate = mp;
  <D.12003>:
  mono_memory_barrier ();
  mono_processes_read_lock.9 = mono_processes_read_lock;
  if (mono_processes_read_lock.9 != 0) goto <D.12010>; else goto <D.12011>;
  <D.12010>:
  if (spin == 0) goto <D.12012>; else goto <D.12013>;
  <D.12012>:
  spin = 1;
  goto <D.12014>;
  <D.12013>:
  if (spin > 7) goto <D.12015>; else goto <D.12016>;
  <D.12015>:
  pthread_mutex_unlock (&mono_processes_mutex);
  goto <D.11783>;
  <D.12016>:
  <D.12014>:
  goto <D.12017>;
  <D.12011>:
  mp = candidate->next;
  D.12018 = &candidate->exit_sem;
  sem_destroy (D.12018);
  monoeg_g_free (candidate);
  candidate = 0B;
  <D.12017>:
  pthread_mutex_unlock (&mono_processes_mutex);
  // predicted unlikely by continue predictor.
  goto <D.11784>;
  <D.11996>:
  spin = 0;
  prev = mp;
  mp = mp->next;
  <D.11784>:
  if (mp != 0B) goto <D.11785>; else goto <D.11783>;
  <D.11783>:
  InterlockedDecrement (&mono_processes_cleaning_up);
}


InterlockedCompareExchange (volatile gint32 * dest, gint32 exch, gint32 comp)
{
  gint32 D.12020;
  unsigned int comp.10;
  unsigned int exch.11;
  unsigned int D.12023;

  comp.10 = (unsigned int) comp;
  exch.11 = (unsigned int) exch;
  D.12023 = __sync_val_compare_and_swap_4 (dest, comp.10, exch.11);
  D.12020 = (gint32) D.12023;
  return D.12020;
}


mono_memory_barrier ()
{
  __sync_synchronize ();
}


ShellExecuteEx (struct WapiShellExecuteInfo * sei)
{
  gboolean D.12027;
  const gunichar2 * D.12028;
  const gunichar2 * utf16_quote.12;
  const gunichar2 * iftmp.13;
  const gunichar2 * D.12033;
  const gunichar2 * D.12039;
  unsigned int D.12042;
  gunichar2 * handler_utf16.14;
  gchar * handler.15;
  char * handler.16;
  gchar * handler.17;
  gchar * handler.18;
  gchar * handler.19;
  gunichar2 * handler_utf16.20;
  const gunichar2 * utf16_space.21;
  const gunichar2 * iftmp.22;
  unsigned int D.12071;
  void * D.12074;
  <unnamed type> D.12075;
  unsigned int D.12076;
  gboolean ret;
  struct WapiProcessInformation process_info;
  gunichar2 * args;

  try
    {
      if (sei == 0B) goto <D.12025>; else goto <D.12026>;
      <D.12025>:
      SetLastError (87);
      D.12027 = 0;
      return D.12027;
      <D.12026>:
      D.12028 = sei->lpFile;
      if (D.12028 == 0B) goto <D.12029>; else goto <D.12030>;
      <D.12029>:
      D.12027 = 1;
      return D.12027;
      <D.12030>:
      utf16_quote.12 = utf16_quote;
      D.12028 = sei->lpFile;
      utf16_quote.12 = utf16_quote;
      D.12033 = sei->lpParameters;
      if (D.12033 != 0B) goto <D.12034>; else goto <D.12035>;
      <D.12034>:
      iftmp.13 = utf16_space;
      goto <D.12036>;
      <D.12035>:
      iftmp.13 = 0B;
      <D.12036>:
      D.12033 = sei->lpParameters;
      args = utf16_concat (utf16_quote.12, D.12028, utf16_quote.12, iftmp.13, D.12033, 0B);
      if (args == 0B) goto <D.12037>; else goto <D.12038>;
      <D.12037>:
      SetLastError (13);
      D.12027 = 0;
      return D.12027;
      <D.12038>:
      D.12039 = sei->lpDirectory;
      ret = CreateProcess (0B, args, 0B, 0B, 1, 1024, 0B, D.12039, 0B, &process_info);
      monoeg_g_free (args);
      if (ret == 0) goto <D.12040>; else goto <D.12041>;
      <D.12040>:
      D.12042 = GetLastError ();
      if (D.12042 == 14) goto <D.12043>; else goto <D.12044>;
      <D.12043>:
      D.12027 = ret;
      return D.12027;
      <D.12044>:
      <D.12041>:
      if (ret == 0) goto <D.12045>; else goto <D.12046>;
      <D.12045>:
      {
        static char * handler;
        static gunichar2 * handler_utf16;

        handler_utf16.14 = handler_utf16;
        if (handler_utf16.14 == -1B) goto <D.12048>; else goto <D.12049>;
        <D.12048>:
        D.12027 = 0;
        return D.12027;
        <D.12049>:
        handler.15 = monoeg_g_find_program_in_path ("xdg-open");
        handler = handler.15;
        handler.16 = handler;
        if (handler.16 == 0B) goto <D.12052>; else goto <D.12053>;
        <D.12052>:
        handler.17 = monoeg_g_find_program_in_path ("gnome-open");
        handler = handler.17;
        handler.16 = handler;
        if (handler.16 == 0B) goto <D.12055>; else goto <D.12056>;
        <D.12055>:
        handler.18 = monoeg_g_find_program_in_path ("kfmclient");
        handler = handler.18;
        handler.16 = handler;
        if (handler.16 == 0B) goto <D.12058>; else goto <D.12059>;
        <D.12058>:
        handler_utf16 = -1B;
        D.12027 = 0;
        return D.12027;
        <D.12059>:
        {
          char * old;

          old = handler;
          handler.19 = monoeg_g_strconcat (old, " exec", 0B);
          handler = handler.19;
          monoeg_g_free (old);
        }
        <D.12056>:
        <D.12053>:
        handler.16 = handler;
        handler_utf16.20 = monoeg_g_utf8_to_utf16 (handler.16, -1, 0B, 0B, 0B);
        handler_utf16 = handler_utf16.20;
        handler.16 = handler;
        monoeg_g_free (handler.16);
        handler_utf16.14 = handler_utf16;
        utf16_space.21 = utf16_space;
        utf16_quote.12 = utf16_quote;
        D.12028 = sei->lpFile;
        utf16_quote.12 = utf16_quote;
        D.12033 = sei->lpParameters;
        if (D.12033 != 0B) goto <D.12064>; else goto <D.12065>;
        <D.12064>:
        iftmp.22 = utf16_space;
        goto <D.12066>;
        <D.12065>:
        iftmp.22 = 0B;
        <D.12066>:
        D.12033 = sei->lpParameters;
        args = utf16_concat (handler_utf16.14, utf16_space.21, utf16_quote.12, D.12028, utf16_quote.12, iftmp.22, D.12033, 0B);
        if (args == 0B) goto <D.12067>; else goto <D.12068>;
        <D.12067>:
        SetLastError (13);
        D.12027 = 0;
        return D.12027;
        <D.12068>:
        D.12039 = sei->lpDirectory;
        ret = CreateProcess (0B, args, 0B, 0B, 1, 1024, 0B, D.12039, 0B, &process_info);
        monoeg_g_free (args);
        if (ret == 0) goto <D.12069>; else goto <D.12070>;
        <D.12069>:
        D.12071 = GetLastError ();
        if (D.12071 != 14) goto <D.12072>; else goto <D.12073>;
        <D.12072>:
        SetLastError (13);
        <D.12073>:
        D.12027 = 0;
        return D.12027;
        <D.12070>:
        D.12074 = process_info.hProcess;
        CloseHandle (D.12074);
        process_info.hProcess = 0B;
      }
      <D.12046>:
      D.12075 = sei->fMask;
      D.12076 = D.12075 & 64;
      if (D.12076 != 0) goto <D.12077>; else goto <D.12078>;
      <D.12077>:
      D.12074 = process_info.hProcess;
      sei->hProcess = D.12074;
      goto <D.12079>;
      <D.12078>:
      D.12074 = process_info.hProcess;
      CloseHandle (D.12074);
      <D.12079>:
      D.12027 = ret;
      return D.12027;
    }
  finally
    {
      process_info = {CLOBBER};
    }
}


utf16_concat (const gunichar2 * first)
{
  int D.12082;
  int D.12083;
  int D.12084;
  long unsigned int D.12085;
  long unsigned int D.12086;
  gunichar2 * D.12089;
  long unsigned int D.12090;
  long unsigned int D.12091;
  gunichar2 * D.12092;
  int i.23;
  long unsigned int D.12094;
  long unsigned int D.12095;
  gunichar2 * D.12096;
  short unsigned int D.12097;
  int i.24;
  long unsigned int D.12099;
  long unsigned int D.12100;
  gunichar2 * D.12101;
  short unsigned int D.12102;
  struct  args[1];
  int total;
  int i;
  const gunichar2 * s;
  gunichar2 * ret;

  try
    {
      total = 0;
      __builtin_va_start (&args, 0);
      D.12082 = len16 (first);
      total = D.12082 + total;
      s = VA_ARG (&args, 0B, 0B);
      goto <D.11309>;
      <D.11308>:
      D.12083 = len16 (s);
      total = D.12083 + total;
      s = VA_ARG (&args, 0B, 0B);
      <D.11309>:
      if (s != 0B) goto <D.11308>; else goto <D.11310>;
      <D.11310>:
      __builtin_va_end (&args);
      D.12084 = total + 1;
      D.12085 = (long unsigned int) D.12084;
      D.12086 = D.12085 * 2;
      ret = monoeg_malloc (D.12086);
      if (ret == 0B) goto <D.12087>; else goto <D.12088>;
      <D.12087>:
      D.12089 = 0B;
      return D.12089;
      <D.12088>:
      D.12090 = (long unsigned int) total;
      D.12091 = D.12090 * 2;
      D.12092 = ret + D.12091;
      *D.12092 = 0;
      i = 0;
      s = first;
      goto <D.11312>;
      <D.11311>:
      i.23 = i;
      i = i.23 + 1;
      D.12094 = (long unsigned int) i.23;
      D.12095 = D.12094 * 2;
      D.12096 = ret + D.12095;
      D.12097 = *s;
      *D.12096 = D.12097;
      s = s + 2;
      <D.11312>:
      D.12097 = *s;
      if (D.12097 != 0) goto <D.11311>; else goto <D.11313>;
      <D.11313>:
      __builtin_va_start (&args, 0);
      s = VA_ARG (&args, 0B, 0B);
      goto <D.11319>;
      <D.11318>:
      {
        const gunichar2 * p;

        p = s;
        goto <D.11316>;
        <D.11315>:
        i.24 = i;
        i = i.24 + 1;
        D.12099 = (long unsigned int) i.24;
        D.12100 = D.12099 * 2;
        D.12101 = ret + D.12100;
        D.12102 = *p;
        *D.12101 = D.12102;
        p = p + 2;
        <D.11316>:
        D.12102 = *p;
        if (D.12102 != 0) goto <D.11315>; else goto <D.11317>;
        <D.11317>:
      }
      s = VA_ARG (&args, 0B, 0B);
      <D.11319>:
      if (s != 0B) goto <D.11318>; else goto <D.11320>;
      <D.11320>:
      __builtin_va_end (&args);
      D.12089 = ret;
      return D.12089;
    }
  finally
    {
      args = {CLOBBER};
    }
}


len16 (const gunichar2 * str)
{
  const gunichar2 * str.25;
  short unsigned int D.12106;
  int D.12107;
  int len;

  len = 0;
  goto <D.11298>;
  <D.11297>:
  len = len + 1;
  <D.11298>:
  str.25 = str;
  str = str.25 + 2;
  D.12106 = *str.25;
  if (D.12106 != 0) goto <D.11297>; else goto <D.11299>;
  <D.11299>:
  D.12107 = len;
  return D.12107;
}


CreateProcessWithLogonW (const gunichar2 * username, const gunichar2 * domain, const gunichar2 * password, const guint32 logonFlags, const gunichar2 * appname, const gunichar2 * cmdline, guint32 create_flags, void * env, const gunichar2 * cwd, struct WapiStartupInfo * startup, struct WapiProcessInformation * process_info)
{
  gboolean D.12109;

  D.12109 = CreateProcess (appname, cmdline, 0B, 0B, 0, create_flags, env, cwd, startup, process_info);
  return D.12109;
}


CreateProcess (const gunichar2 * appname, const gunichar2 * cmdline, struct WapiSecurityAttributes * process_attrs, struct WapiSecurityAttributes * thread_attrs, gboolean inherit_handles, guint32 create_flags, void * new_environ, const gunichar2 * cwd, struct WapiStartupInfo * startup, struct WapiProcessInformation * process_info)
{
  const short unsigned int * * D.12125;
  const short unsigned int * D.12126;
  char D.12127;
  long unsigned int D.12128;
  long unsigned int D.12129;
  const short unsigned int * D.12130;
  short unsigned int D.12131;
  int D.12132;
  int D.12133;
  gchar * D.12136;
  char D.12137;
  gchar * D.12140;
  long unsigned int D.12141;
  long unsigned int D.12142;
  long unsigned int D.12143;
  sizetype D.12144;
  gchar * D.12145;
  char D.12146;
  int D.12149;
  int D.12153;
  char D.12159;
  sizetype D.12161;
  gchar * D.12162;
  char D.12163;
  unsigned int D.12167;
  sizetype D.12168;
  gchar * D.12169;
  char D.12170;
  long unsigned int D.12172;
  long unsigned int D.12173;
  const short unsigned int * D.12174;
  short unsigned int D.12175;
  int D.12176;
  int D.12177;
  gchar * D.12178;
  unsigned int D.12179;
  long unsigned int D.12180;
  sizetype D.12181;
  gchar * D.12182;
  long unsigned int D.12185;
  long unsigned int D.12186;
  const short unsigned int * D.12187;
  short unsigned int D.12188;
  int D.12189;
  int D.12190;
  long unsigned int D.12193;
  char D.12200;
  long unsigned int D.12201;
  long unsigned int D.12202;
  const short unsigned int * D.12203;
  short unsigned int D.12204;
  int D.12205;
  int D.12206;
  gchar * D.12209;
  char D.12210;
  gchar * D.12213;
  long unsigned int D.12214;
  long unsigned int D.12215;
  long unsigned int D.12216;
  sizetype D.12217;
  gchar * D.12218;
  int D.12221;
  int D.12225;
  int D.12230;
  const gunichar2 * utf16_space.26;
  char D.12244;
  struct GError * gerr.27;
  gchar * D.12249;
  <unnamed type> D.12253;
  unsigned int D.12254;
  void * D.12256;
  long int D.12257;
  void * D.12258;
  long int D.12259;
  void * D.12260;
  long int D.12261;
  void * D.12262;
  long int D.12263;
  void * D.12264;
  long int D.12265;
  void * D.12266;
  long int D.12267;
  short unsigned int D.12272;
  unsigned int D.12273;
  long unsigned int D.12274;
  long unsigned int D.12275;
  long unsigned int D.12276;
  long unsigned int D.12277;
  gchar * * D.12278;
  gchar * D.12279;
  char * * environ.28;
  long unsigned int D.12282;
  long unsigned int D.12283;
  char * * D.12284;
  char * D.12285;
  gchar * D.12286;
  long int handle.29;
  unsigned int D.12290;
  unsigned int D.12291;
  struct _WapiHandleUnshared * D.12292;
  long unsigned int D.12293;
  long unsigned int D.12294;
  long unsigned int D.12295;
  unsigned int D.12296;
  gchar * D.12297;
  int D.12298;
  int D.12301;
  _Bool D.12302;
  long int D.12303;
  long int D.12304;
  int D.12311;
  int D.12316;
  int D.12317;
  int i.30;
  int D.12321;
  gchar * * argv.31;
  gchar * D.12325;
  struct _WapiHandle_process * process_handle_data.32;
  union MonoSemType * D.12329;
  int D.12330;
  int * D.12333;
  int D.12334;
  char * D.12335;
  int D.12337;
  struct MonoProcess * mono_processes.33;
  unsigned int pid.34;
  gboolean D.12360;
  gchar * cmd;
  gchar * prog;
  gchar * full_prog;
  gchar * args;
  gchar * args_after_prog;
  gchar * dir;
  gchar * * env_strings;
  gchar * * argv;
  guint32 i;
  guint32 env_count;
  gboolean ret;
  void * handle;
  struct _WapiHandle_process process_handle;
  struct _WapiHandle_process * process_handle_data;
  struct GError * gerr;
  int in_fd;
  int out_fd;
  int err_fd;
  pid_t pid;
  int thr_ret;
  int startup_pipe[2];
  int dummy;
  struct MonoProcess * mono_process;
  gboolean fork_failed;
  void free_strings = <<< error >>>;
  static const char __func__[14] = "CreateProcess";
  void cleanup = <<< error >>>;

  try
    {
      cmd = 0B;
      prog = 0B;
      full_prog = 0B;
      args = 0B;
      args_after_prog = 0B;
      dir = 0B;
      env_strings = 0B;
      argv = 0B;
      env_count = 0;
      ret = 0;
      process_handle = {};
      gerr = 0B;
      startup_pipe[0] = -1;
      startup_pipe[1] = -1;
      fork_failed = 0;
      mono_once (&process_ops_once, process_ops_init);
      mono_once (&process_sig_chld_once, process_add_sigchld_handler);
      if (appname != 0B) goto <D.12111>; else goto <D.12112>;
      <D.12111>:
      cmd = mono_unicode_to_external (appname);
      if (cmd == 0B) goto <D.12113>; else goto <D.12114>;
      <D.12113>:
      SetLastError (3);
      goto free_strings;
      <D.12114>:
      switchDirectorySeparators (cmd);
      <D.12112>:
      if (cmdline != 0B) goto <D.12115>; else goto <D.12116>;
      <D.12115>:
      args = mono_unicode_to_external (cmdline);
      if (args == 0B) goto <D.12117>; else goto <D.12118>;
      <D.12117>:
      SetLastError (3);
      goto free_strings;
      <D.12118>:
      <D.12116>:
      if (cwd != 0B) goto <D.12119>; else goto <D.12120>;
      <D.12119>:
      dir = mono_unicode_to_external (cwd);
      if (dir == 0B) goto <D.12121>; else goto <D.12122>;
      <D.12121>:
      SetLastError (3);
      goto free_strings;
      <D.12122>:
      switchDirectorySeparators (dir);
      <D.12120>:
      if (cmd != 0B) goto <D.12123>; else goto <D.12124>;
      <D.12123>:
      {
        gchar * unquoted;

        D.12125 = __ctype_b_loc ();
        D.12126 = *D.12125;
        D.12127 = *cmd;
        D.12128 = (long unsigned int) D.12127;
        D.12129 = D.12128 * 2;
        D.12130 = D.12126 + D.12129;
        D.12131 = *D.12130;
        D.12132 = (int) D.12131;
        D.12133 = D.12132 & 4;
        if (D.12133 != 0) goto <D.12134>; else goto <D.12135>;
        <D.12134>:
        D.12136 = cmd + 1;
        D.12137 = *D.12136;
        if (D.12137 == 58) goto <D.12138>; else goto <D.12139>;
        <D.12138>:
        D.12140 = cmd + 2;
        D.12141 = __strlen_g (cmd);
        D.12142 = D.12141 + 18446744073709551614;
        memmove (cmd, D.12140, D.12142);
        D.12143 = __strlen_g (cmd);
        D.12144 = D.12143 + 18446744073709551614;
        D.12145 = cmd + D.12144;
        *D.12145 = 0;
        <D.12139>:
        <D.12135>:
        unquoted = monoeg_g_shell_unquote (cmd, 0B);
        D.12146 = *unquoted;
        if (D.12146 == 47) goto <D.12147>; else goto <D.12148>;
        <D.12147>:
        prog = monoeg_strdup (unquoted);
        D.12149 = is_executable (prog);
        if (D.12149 == 0) goto <D.12150>; else goto <D.12151>;
        <D.12150>:
        monoeg_g_free (unquoted);
        SetLastError (2);
        goto free_strings;
        <D.12151>:
        goto <D.12152>;
        <D.12148>:
        {
          char * curdir;

          curdir = monoeg_g_get_current_dir ();
          prog = monoeg_g_strdup_printf ("%s/%s", curdir, unquoted);
          monoeg_g_free (curdir);
          D.12153 = is_executable (prog);
          if (D.12153 == 0) goto <D.12154>; else goto <D.12155>;
          <D.12154>:
          monoeg_g_free (unquoted);
          SetLastError (2);
          goto free_strings;
          <D.12155>:
        }
        <D.12152>:
        monoeg_g_free (unquoted);
        args_after_prog = args;
      }
      goto <D.12156>;
      <D.12124>:
      {
        gchar * token;
        char quote;

        token = 0B;
        args = monoeg_g_strchug (args);
        args_after_prog = args;
        D.12159 = *args;
        if (D.12159 == 34) goto <D.12157>; else goto <D.12160>;
        <D.12160>:
        D.12159 = *args;
        if (D.12159 == 39) goto <D.12157>; else goto <D.12158>;
        <D.12157>:
        quote = *args;
        i = 1;
        goto <D.11416>;
        <D.11415>:
        i = i + 1;
        <D.11416>:
        D.12161 = (sizetype) i;
        D.12162 = args + D.12161;
        D.12163 = *D.12162;
        if (D.12163 != 0) goto <D.12164>; else goto <D.11417>;
        <D.12164>:
        D.12161 = (sizetype) i;
        D.12162 = args + D.12161;
        D.12163 = *D.12162;
        if (D.12163 != quote) goto <D.11415>; else goto <D.11417>;
        <D.11417>:
        D.12167 = i + 1;
        D.12168 = (sizetype) D.12167;
        D.12169 = args + D.12168;
        D.12170 = *D.12169;
        if (D.12170 == 0) goto <D.12165>; else goto <D.12171>;
        <D.12171>:
        D.12125 = __ctype_b_loc ();
        D.12126 = *D.12125;
        D.12167 = i + 1;
        D.12168 = (sizetype) D.12167;
        D.12169 = args + D.12168;
        D.12170 = *D.12169;
        D.12172 = (long unsigned int) D.12170;
        D.12173 = D.12172 * 2;
        D.12174 = D.12126 + D.12173;
        D.12175 = *D.12174;
        D.12176 = (int) D.12175;
        D.12177 = D.12176 & 32;
        if (D.12177 != 0) goto <D.12165>; else goto <D.12166>;
        <D.12165>:
        D.12178 = args + 1;
        D.12179 = i + 4294967295;
        D.12180 = (long unsigned int) D.12179;
        token = monoeg_g_strndup (D.12178, D.12180);
        D.12161 = (sizetype) i;
        D.12181 = D.12161 + 1;
        D.12182 = args + D.12181;
        args_after_prog = monoeg_g_strchug (D.12182);
        <D.12166>:
        <D.12158>:
        if (token == 0B) goto <D.12183>; else goto <D.12184>;
        <D.12183>:
        i = 0;
        goto <D.11420>;
        <D.11419>:
        D.12125 = __ctype_b_loc ();
        D.12126 = *D.12125;
        D.12161 = (sizetype) i;
        D.12162 = args + D.12161;
        D.12163 = *D.12162;
        D.12185 = (long unsigned int) D.12163;
        D.12186 = D.12185 * 2;
        D.12187 = D.12126 + D.12186;
        D.12188 = *D.12187;
        D.12189 = (int) D.12188;
        D.12190 = D.12189 & 32;
        if (D.12190 != 0) goto <D.12191>; else goto <D.12192>;
        <D.12191>:
        D.12193 = (long unsigned int) i;
        token = monoeg_g_strndup (args, D.12193);
        D.12161 = (sizetype) i;
        D.12181 = D.12161 + 1;
        args_after_prog = args + D.12181;
        goto <D.11418>;
        <D.12192>:
        i = i + 1;
        <D.11420>:
        D.12161 = (sizetype) i;
        D.12162 = args + D.12161;
        D.12163 = *D.12162;
        if (D.12163 != 0) goto <D.11419>; else goto <D.11418>;
        <D.11418>:
        <D.12184>:
        if (token == 0B) goto <D.12194>; else goto <D.12195>;
        <D.12194>:
        D.12159 = *args;
        if (D.12159 != 0) goto <D.12196>; else goto <D.12197>;
        <D.12196>:
        token = monoeg_strdup (args);
        args_after_prog = 0B;
        <D.12197>:
        <D.12195>:
        if (token == 0B) goto <D.12198>; else goto <D.12199>;
        <D.12198>:
        SetLastError (3);
        goto free_strings;
        <D.12199>:
        switchDirectorySeparators (token);
        D.12125 = __ctype_b_loc ();
        D.12126 = *D.12125;
        D.12200 = *token;
        D.12201 = (long unsigned int) D.12200;
        D.12202 = D.12201 * 2;
        D.12203 = D.12126 + D.12202;
        D.12204 = *D.12203;
        D.12205 = (int) D.12204;
        D.12206 = D.12205 & 4;
        if (D.12206 != 0) goto <D.12207>; else goto <D.12208>;
        <D.12207>:
        D.12209 = token + 1;
        D.12210 = *D.12209;
        if (D.12210 == 58) goto <D.12211>; else goto <D.12212>;
        <D.12211>:
        D.12213 = token + 2;
        D.12214 = __strlen_g (token);
        D.12215 = D.12214 + 18446744073709551614;
        memmove (token, D.12213, D.12215);
        D.12216 = __strlen_g (token);
        D.12217 = D.12216 + 18446744073709551614;
        D.12218 = token + D.12217;
        *D.12218 = 0;
        <D.12212>:
        <D.12208>:
        D.12200 = *token;
        if (D.12200 == 47) goto <D.12219>; else goto <D.12220>;
        <D.12219>:
        prog = monoeg_strdup (token);
        D.12221 = is_executable (prog);
        if (D.12221 == 0) goto <D.12222>; else goto <D.12223>;
        <D.12222>:
        monoeg_g_free (token);
        SetLastError (2);
        goto free_strings;
        <D.12223>:
        goto <D.12224>;
        <D.12220>:
        {
          char * curdir;

          curdir = monoeg_g_get_current_dir ();
          prog = monoeg_g_strdup_printf ("%s/%s", curdir, token);
          monoeg_g_free (curdir);
          D.12225 = is_executable (prog);
          if (D.12225 == 0) goto <D.12226>; else goto <D.12227>;
          <D.12226>:
          monoeg_g_free (prog);
          prog = monoeg_g_find_program_in_path (token);
          if (prog == 0B) goto <D.12228>; else goto <D.12229>;
          <D.12228>:
          monoeg_g_free (token);
          SetLastError (2);
          goto free_strings;
          <D.12229>:
          <D.12227>:
        }
        <D.12224>:
        monoeg_g_free (token);
      }
      <D.12156>:
      D.12230 = is_managed_binary (prog);
      if (D.12230 != 0) goto <D.12231>; else goto <D.12232>;
      <D.12231>:
      {
        gunichar2 * newapp;
        gunichar2 * newcmd;
        gsize bytes_ignored;

        try
          {
            newapp = mono_unicode_from_external ("mono", &bytes_ignored);
            if (newapp != 0B) goto <D.12233>; else goto <D.12234>;
            <D.12233>:
            if (appname != 0B) goto <D.12235>; else goto <D.12236>;
            <D.12235>:
            utf16_space.26 = utf16_space;
            utf16_space.26 = utf16_space;
            newcmd = utf16_concat (newapp, utf16_space.26, appname, utf16_space.26, cmdline, 0B);
            goto <D.12238>;
            <D.12236>:
            utf16_space.26 = utf16_space;
            newcmd = utf16_concat (newapp, utf16_space.26, cmdline, 0B);
            <D.12238>:
            monoeg_g_free (newapp);
            if (newcmd != 0B) goto <D.12239>; else goto <D.12240>;
            <D.12239>:
            ret = CreateProcess (0B, newcmd, process_attrs, thread_attrs, inherit_handles, create_flags, new_environ, cwd, startup, process_info);
            monoeg_g_free (newcmd);
            goto free_strings;
            <D.12240>:
            <D.12234>:
          }
        finally
          {
            bytes_ignored = {CLOBBER};
          }
      }
      <D.12232>:
      if (args_after_prog != 0B) goto <D.12243>; else goto <D.12241>;
      <D.12243>:
      D.12244 = *args_after_prog;
      if (D.12244 != 0) goto <D.12245>; else goto <D.12241>;
      <D.12245>:
      {
        gchar * qprog;

        qprog = monoeg_g_shell_quote (prog);
        full_prog = monoeg_g_strconcat (qprog, " ", args_after_prog, 0B);
        monoeg_g_free (qprog);
      }
      goto <D.12242>;
      <D.12241>:
      full_prog = monoeg_g_shell_quote (prog);
      <D.12242>:
      ret = monoeg_g_shell_parse_argv (full_prog, 0B, &argv, &gerr);
      if (ret == 0) goto <D.12246>; else goto <D.12247>;
      <D.12246>:
      gerr.27 = gerr;
      D.12249 = gerr.27->message;
      monoeg_g_log (0B, 32, "CreateProcess: %s\n", D.12249);
      gerr.27 = gerr;
      monoeg_g_error_free (gerr.27);
      gerr = 0B;
      goto free_strings;
      <D.12247>:
      if (startup != 0B) goto <D.12252>; else goto <D.12250>;
      <D.12252>:
      D.12253 = startup->dwFlags;
      D.12254 = D.12253 & 256;
      if (D.12254 != 0) goto <D.12255>; else goto <D.12250>;
      <D.12255>:
      D.12256 = startup->hStdInput;
      D.12257 = (long int) D.12256;
      in_fd = (int) D.12257;
      D.12258 = startup->hStdOutput;
      D.12259 = (long int) D.12258;
      out_fd = (int) D.12259;
      D.12260 = startup->hStdError;
      D.12261 = (long int) D.12260;
      err_fd = (int) D.12261;
      goto <D.12251>;
      <D.12250>:
      D.12262 = GetStdHandle (-10);
      D.12263 = (long int) D.12262;
      in_fd = (int) D.12263;
      D.12264 = GetStdHandle (-11);
      D.12265 = (long int) D.12264;
      out_fd = (int) D.12265;
      D.12266 = GetStdHandle (-12);
      D.12267 = (long int) D.12266;
      err_fd = (int) D.12267;
      <D.12251>:
      monoeg_g_strlcpy (&process_handle.proc_name, prog, 255);
      process_set_defaults (&process_handle);
      handle = _wapi_handle_new (9, &process_handle);
      if (handle == -1B) goto <D.12268>; else goto <D.12269>;
      <D.12268>:
      monoeg_g_log (0B, 16, "%s: error creating process handle", &__func__);
      ret = 0;
      SetLastError (14);
      goto free_strings;
      <D.12269>:
      if (new_environ != 0B) goto <D.12270>; else goto <D.12271>;
      <D.12270>:
      {
        gunichar2 * new_environp;

        new_environp = new_environ;
        goto <D.11432>;
        <D.11431>:
        env_count = env_count + 1;
        goto <D.11429>;
        <D.11428>:
        new_environp = new_environp + 2;
        <D.11429>:
        D.12272 = *new_environp;
        if (D.12272 != 0) goto <D.11428>; else goto <D.11430>;
        <D.11430>:
        new_environp = new_environp + 2;
        <D.11432>:
        D.12272 = *new_environp;
        if (D.12272 != 0) goto <D.11431>; else goto <D.11433>;
        <D.11433>:
        D.12273 = env_count + 2;
        D.12274 = (long unsigned int) D.12273;
        D.12275 = D.12274 * 8;
        env_strings = monoeg_malloc0 (D.12275);
        env_count = 0;
        new_environp = new_environ;
        goto <D.11438>;
        <D.11437>:
        D.12276 = (long unsigned int) env_count;
        D.12277 = D.12276 * 8;
        D.12278 = env_strings + D.12277;
        D.12279 = mono_unicode_to_external (new_environp);
        *D.12278 = D.12279;
        env_count = env_count + 1;
        goto <D.11435>;
        <D.11434>:
        new_environp = new_environp + 2;
        <D.11435>:
        D.12272 = *new_environp;
        if (D.12272 != 0) goto <D.11434>; else goto <D.11436>;
        <D.11436>:
        new_environp = new_environp + 2;
        <D.11438>:
        D.12272 = *new_environp;
        if (D.12272 != 0) goto <D.11437>; else goto <D.11439>;
        <D.11439>:
      }
      goto <D.12280>;
      <D.12271>:
      i = 0;
      goto <D.11441>;
      <D.11440>:
      env_count = env_count + 1;
      i = i + 1;
      <D.11441>:
      environ.28 = environ;
      D.12282 = (long unsigned int) i;
      D.12283 = D.12282 * 8;
      D.12284 = environ.28 + D.12283;
      D.12285 = *D.12284;
      if (D.12285 != 0B) goto <D.11440>; else goto <D.11442>;
      <D.11442>:
      D.12273 = env_count + 2;
      D.12274 = (long unsigned int) D.12273;
      D.12275 = D.12274 * 8;
      env_strings = monoeg_malloc0 (D.12275);
      env_count = 0;
      i = 0;
      goto <D.11444>;
      <D.11443>:
      D.12276 = (long unsigned int) env_count;
      D.12277 = D.12276 * 8;
      D.12278 = env_strings + D.12277;
      environ.28 = environ;
      D.12282 = (long unsigned int) i;
      D.12283 = D.12282 * 8;
      D.12284 = environ.28 + D.12283;
      D.12285 = *D.12284;
      D.12286 = monoeg_strdup (D.12285);
      *D.12278 = D.12286;
      env_count = env_count + 1;
      i = i + 1;
      <D.11444>:
      environ.28 = environ;
      D.12282 = (long unsigned int) i;
      D.12283 = D.12282 * 8;
      D.12284 = environ.28 + D.12283;
      D.12285 = *D.12284;
      if (D.12285 != 0B) goto <D.11443>; else goto <D.11445>;
      <D.11445>:
      <D.12280>:
      if (env_strings != 0B) goto <D.12287>; else goto <D.12288>;
      <D.12287>:
      {
        struct _WapiHandleUnshared * handle_data;
        struct _WapiHandle_shared_ref * ref;

        handle.29 = (long int) handle;
        D.12290 = (unsigned int) handle.29;
        D.12291 = D.12290 / 256;
        D.12292 = _wapi_private_handles[D.12291];
        handle.29 = (long int) handle;
        D.12290 = (unsigned int) handle.29;
        D.12293 = (long unsigned int) D.12290;
        D.12294 = D.12293 & 255;
        D.12295 = D.12294 * 200;
        handle_data = D.12292 + D.12295;
        ref = &handle_data->u.shared;
        D.12276 = (long unsigned int) env_count;
        D.12277 = D.12276 * 8;
        D.12278 = env_strings + D.12277;
        D.12296 = ref->offset;
        D.12297 = monoeg_g_strdup_printf ("_WAPI_PROCESS_HANDLE_OFFSET=%d", D.12296);
        *D.12278 = D.12297;
      }
      <D.12288>:
      D.12298 = pipe (&startup_pipe);
      if (D.12298 == -1) goto <D.12299>; else goto <D.12300>;
      <D.12299>:
      startup_pipe[1] = -1;
      D.12301 = startup_pipe[1];
      startup_pipe[0] = D.12301;
      <D.12300>:
      thr_ret = _wapi_handle_lock_shared_handles ();
      D.12302 = thr_ret != 0;
      D.12303 = (long int) D.12302;
      D.12304 = __builtin_expect (D.12303, 0);
      if (D.12304 != 0) goto <D.12305>; else goto <D.12306>;
      <D.12305>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "processes.c", 965, "thr_ret == 0");
      <D.12306>:
      pid = fork ();
      if (pid == -1) goto <D.12307>; else goto <D.12308>;
      <D.12307>:
      SetLastError (14);
      ret = 0;
      fork_failed = 1;
      goto cleanup;
      <D.12308>:
      if (pid == 0) goto <D.12309>; else goto <D.12310>;
      <D.12309>:
      D.12311 = startup_pipe[0];
      if (D.12311 != -1) goto <D.12312>; else goto <D.12313>;
      <D.12312>:
      {
        ssize_t _i;

        D.12311 = startup_pipe[0];
        _i = read (D.12311, &dummy, 1);
        D.12311 = startup_pipe[0];
        close (D.12311);
        D.12301 = startup_pipe[1];
        close (D.12301);
      }
      <D.12313>:
      dup2 (in_fd, 0);
      dup2 (out_fd, 1);
      dup2 (err_fd, 2);
      if (inherit_handles != 1) goto <D.12314>; else goto <D.12315>;
      <D.12314>:
      <D.12315>:
      D.12316 = getdtablesize ();
      D.12317 = D.12316 + -1;
      i = (guint32) D.12317;
      goto <D.11451>;
      <D.11450>:
      i.30 = (int) i;
      close (i.30);
      i = i + 4294967295;
      <D.11451>:
      if (i > 2) goto <D.11450>; else goto <D.11452>;
      <D.11452>:
      if (dir != 0B) goto <D.12319>; else goto <D.12320>;
      <D.12319>:
      D.12321 = chdir (dir);
      if (D.12321 == -1) goto <D.12322>; else goto <D.12323>;
      <D.12322>:
      _exit (-1);
      <D.12323>:
      <D.12320>:
      argv.31 = argv;
      D.12325 = *argv.31;
      argv.31 = argv;
      execve (D.12325, argv.31, env_strings);
      _exit (-1);
      <D.12310>:
      ret = _wapi_lookup_handle (handle, 9, &process_handle_data);
      if (ret == 0) goto <D.12326>; else goto <D.12327>;
      <D.12326>:
      monoeg_g_log (0B, 16, "%s: error looking up process handle %p", &__func__, handle);
      _wapi_handle_unref (handle);
      goto cleanup;
      <D.12327>:
      process_handle_data.32 = process_handle_data;
      process_handle_data.32->id = pid;
      mono_process = monoeg_malloc0 (64);
      mono_process->pid = pid;
      mono_process->handle_count = 1;
      D.12329 = &mono_process->exit_sem;
      D.12330 = sem_init (D.12329, 0, 0);
      if (D.12330 != 0) goto <D.12331>; else goto <D.12332>;
      <D.12331>:
      D.12333 = __errno_location ();
      D.12334 = *D.12333;
      D.12335 = strerror (D.12334);
      monoeg_g_log (0B, 16, "%s: could not create exit semaphore for process.", D.12335);
      monoeg_g_free (mono_process);
      goto <D.12336>;
      <D.12332>:
      _wapi_handle_ref (handle);
      mono_process->handle = handle;
      process_handle_data.32 = process_handle_data;
      D.12337 = _wapi_getpid ();
      process_handle_data.32->self = D.12337;
      process_handle_data.32 = process_handle_data;
      process_handle_data.32->mono_process = mono_process;
      pthread_mutex_lock (&mono_processes_mutex);
      mono_processes.33 = mono_processes;
      mono_process->next = mono_processes.33;
      mono_processes = mono_process;
      pthread_mutex_unlock (&mono_processes_mutex);
      <D.12336>:
      if (process_info != 0B) goto <D.12339>; else goto <D.12340>;
      <D.12339>:
      process_info->hProcess = handle;
      pid.34 = (unsigned int) pid;
      process_info->dwProcessId = pid.34;
      process_info->hThread = -1B;
      process_info->dwThreadId = 0;
      <D.12340>:
      cleanup:
      _wapi_handle_unlock_shared_handles ();
      if (fork_failed != 0) goto <D.12342>; else goto <D.12343>;
      <D.12342>:
      _wapi_handle_unref (handle);
      <D.12343>:
      D.12301 = startup_pipe[1];
      if (D.12301 != -1) goto <D.12344>; else goto <D.12345>;
      <D.12344>:
      {
        ssize_t _i;

        D.12301 = startup_pipe[1];
        _i = write (D.12301, &startup_pipe, 1);
        D.12311 = startup_pipe[0];
        close (D.12311);
        D.12301 = startup_pipe[1];
        close (D.12301);
      }
      <D.12345>:
      free_strings:
      if (cmd != 0B) goto <D.12346>; else goto <D.12347>;
      <D.12346>:
      monoeg_g_free (cmd);
      <D.12347>:
      if (full_prog != 0B) goto <D.12348>; else goto <D.12349>;
      <D.12348>:
      monoeg_g_free (full_prog);
      <D.12349>:
      if (prog != 0B) goto <D.12350>; else goto <D.12351>;
      <D.12350>:
      monoeg_g_free (prog);
      <D.12351>:
      if (args != 0B) goto <D.12352>; else goto <D.12353>;
      <D.12352>:
      monoeg_g_free (args);
      <D.12353>:
      if (dir != 0B) goto <D.12354>; else goto <D.12355>;
      <D.12354>:
      monoeg_g_free (dir);
      <D.12355>:
      if (env_strings != 0B) goto <D.12356>; else goto <D.12357>;
      <D.12356>:
      monoeg_g_strfreev (env_strings);
      <D.12357>:
      argv.31 = argv;
      if (argv.31 != 0B) goto <D.12358>; else goto <D.12359>;
      <D.12358>:
      argv.31 = argv;
      monoeg_g_strfreev (argv.31);
      <D.12359>:
      mono_processes_cleanup ();
      D.12360 = ret;
      return D.12360;
    }
  finally
    {
      argv = {CLOBBER};
      process_handle = {CLOBBER};
      process_handle_data = {CLOBBER};
      gerr = {CLOBBER};
      startup_pipe = {CLOBBER};
      dummy = {CLOBBER};
    }
}


process_add_sigchld_handler ()
{
  int D.12365;
  _Bool D.12366;
  long int D.12367;
  long int D.12368;
  struct sigaction sa;

  try
    {
      sa.__sigaction_handler.sa_sigaction = mono_sigchld_signal_handler;
      sigemptyset (&sa.sa_mask);
      sa.sa_flags = 5;
      D.12365 = sigaction (17, &sa, &previous_chld_sa);
      D.12366 = D.12365 == -1;
      D.12367 = (long int) D.12366;
      D.12368 = __builtin_expect (D.12367, 0);
      if (D.12368 != 0) goto <D.12369>; else goto <D.12370>;
      <D.12369>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "processes.c", 2887, "sigaction (SIGCHLD, &sa, &previous_chld_sa) != -1");
      <D.12370>:
    }
  finally
    {
      sa = {CLOBBER};
    }
}


mono_sigchld_signal_handler (int _dummy, struct siginfo_t * info, void * context)
{
  int * D.12372;
  int D.12373;
  int D.12375;
  int status.35;
  union MonoSemType * D.12379;
  int status;
  int pid;
  struct MonoProcess * p;

  try
    {
      InterlockedIncrement (&mono_processes_read_lock);
      <D.11805>:
      <D.11799>:
      pid = waitpid (-1, &status, 1);
      if (pid == -1) goto <D.12371>; else goto <D.11800>;
      <D.12371>:
      D.12372 = __errno_location ();
      D.12373 = *D.12372;
      if (D.12373 == 4) goto <D.11799>; else goto <D.11800>;
      <D.11800>:
      if (pid <= 0) goto <D.11801>; else goto <D.12374>;
      <D.12374>:
      p = mono_processes;
      goto <D.11804>;
      <D.11803>:
      D.12375 = p->pid;
      if (D.12375 == pid) goto <D.12376>; else goto <D.12377>;
      <D.12376>:
      p->pid = 0;
      status.35 = status;
      p->status = status.35;
      D.12379 = &p->exit_sem;
      mono_sem_post (D.12379);
      goto <D.11802>;
      <D.12377>:
      p = p->next;
      <D.11804>:
      if (p != 0B) goto <D.11803>; else goto <D.11802>;
      <D.11802>:
      goto <D.11805>;
      <D.11801>:
      InterlockedDecrement (&mono_processes_read_lock);
    }
  finally
    {
      status = {CLOBBER};
    }
}


InterlockedIncrement (volatile gint32 * val)
{
  gint32 D.12380;
  unsigned int D.12381;

  D.12381 = __sync_add_and_fetch_4 (val, 1);
  D.12380 = (gint32) D.12381;
  return D.12380;
}


process_ops_init ()
{
  _wapi_handle_register_capabilities (9, 9);
}


switchDirectorySeparators (gchar * path)
{
  gchar * D.12383;
  char D.12384;
  long unsigned int D.12387;
  sizetype D.12390;
  gchar * D.12391;
  char D.12392;
  size_t i;
  size_t pathLength;

  pathLength = __strlen_g (path);
  i = 0;
  goto <D.11372>;
  <D.11371>:
  D.12383 = path + i;
  D.12384 = *D.12383;
  if (D.12384 == 92) goto <D.12385>; else goto <D.12386>;
  <D.12385>:
  D.12387 = pathLength + 18446744073709551615;
  if (D.12387 > i) goto <D.12388>; else goto <D.12389>;
  <D.12388>:
  D.12390 = i + 1;
  D.12391 = path + D.12390;
  D.12392 = *D.12391;
  if (D.12392 != 39) goto <D.12393>; else goto <D.12394>;
  <D.12393>:
  D.12383 = path + i;
  *D.12383 = 47;
  <D.12394>:
  <D.12389>:
  <D.12386>:
  i = i + 1;
  <D.11372>:
  if (i < pathLength) goto <D.11371>; else goto <D.11373>;
  <D.11373>:
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __nothrow__, __leaf__))
memmove (void * __dest, const void * __src, size_t __len)
{
  void * D.12395;
  long unsigned int D.12396;

  D.12396 = __builtin_object_size (__dest, 0);
  D.12395 = __builtin___memmove_chk (__dest, __src, __len, D.12396);
  return D.12395;
}


__attribute__((__gnu_inline__))
__strlen_g (const char * __str)
{
  size_t D.12398;
  long int __ptr.36;
  long int __str.37;
  long int D.12401;
  char * __ptr;
  char * __tmp;

  __ptr = 0B;
  __tmp = __str;
  __asm__ __volatile__("   la    0,0
0: srst  %0,%1
   jo    0b
" : "=&a" __ptr, "=&a" __tmp : "0" __ptr, "1" __tmp : "0", "memory", "cc");
  __ptr.36 = (long int) __ptr;
  __str.37 = (long int) __str;
  D.12401 = __ptr.36 - __str.37;
  D.12398 = (size_t) D.12401;
  return D.12398;
}


is_executable (const char * prog)
{
  int D.12403;
  gboolean D.12406;
  int D.12407;
  unsigned int D.12410;
  unsigned int D.12411;
  struct stat buf;

  try
    {
      D.12403 = access (prog, 1);
      if (D.12403 != 0) goto <D.12404>; else goto <D.12405>;
      <D.12404>:
      D.12406 = 0;
      return D.12406;
      <D.12405>:
      D.12407 = stat (prog, &buf);
      if (D.12407 != 0) goto <D.12408>; else goto <D.12409>;
      <D.12408>:
      D.12406 = 0;
      return D.12406;
      <D.12409>:
      D.12410 = buf.st_mode;
      D.12411 = D.12410 & 61440;
      if (D.12411 == 32768) goto <D.12412>; else goto <D.12413>;
      <D.12412>:
      D.12406 = 1;
      return D.12406;
      <D.12413>:
      D.12406 = 0;
      return D.12406;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


__attribute__((__gnu_inline__, __leaf__, __nothrow__))
stat (const char * __path, struct stat * __statbuf)
{
  int D.12416;

  D.12416 = __xstat (1, __path, __statbuf);
  return D.12416;
}


is_managed_binary (const gchar * filename)
{
  int * D.12418;
  gboolean D.12421;
  long int D.12423;
  unsigned char D.12425;
  unsigned char D.12427;
  long int D.12430;
  int D.12432;
  int D.12433;
  int D.12434;
  int D.12435;
  unsigned char D.12436;
  int D.12437;
  int D.12438;
  int D.12439;
  unsigned char D.12440;
  int D.12441;
  int D.12442;
  int D.12443;
  long int D.12444;
  long int D.12447;
  long int D.12453;
  long int D.12455;
  long int D.12458;
  long int D.12460;
  unsigned char * D.12461;
  unsigned char * D.12462;
  int original_errno;
  int file;
  off_t new_offset;
  unsigned char buffer[8];
  off_t file_size;
  off_t optional_header_offset;
  off_t pe_header_offset;
  gboolean managed;
  int num_read;
  guint32 first_word;
  guint32 second_word;
  void leave = <<< error >>>;

  try
    {
      D.12418 = __errno_location ();
      original_errno = *D.12418;
      file = open (filename, 0);
      managed = 0;
      if (file < 0) goto <D.12419>; else goto <D.12420>;
      <D.12419>:
      D.12418 = __errno_location ();
      *D.12418 = original_errno;
      D.12421 = 0;
      return D.12421;
      <D.12420>:
      file_size = lseek (file, 0, 2);
      lseek (file, 0, 0);
      if (file_size <= 63) goto leave; else goto <D.12422>;
      <D.12422>:
      D.12423 = read (file, &buffer, 2);
      num_read = (int) D.12423;
      if (num_read != 2) goto leave; else goto <D.12424>;
      <D.12424>:
      D.12425 = buffer[0];
      if (D.12425 != 77) goto leave; else goto <D.12426>;
      <D.12426>:
      D.12427 = buffer[1];
      if (D.12427 != 90) goto leave; else goto <D.12428>;
      <D.12428>:
      new_offset = lseek (file, 60, 0);
      if (new_offset != 60) goto leave; else goto <D.12429>;
      <D.12429>:
      D.12430 = read (file, &buffer, 4);
      num_read = (int) D.12430;
      if (num_read != 4) goto leave; else goto <D.12431>;
      <D.12431>:
      D.12425 = buffer[0];
      D.12432 = (int) D.12425;
      D.12427 = buffer[1];
      D.12433 = (int) D.12427;
      D.12434 = D.12433 << 8;
      D.12435 = D.12432 | D.12434;
      D.12436 = buffer[2];
      D.12437 = (int) D.12436;
      D.12438 = D.12437 << 16;
      D.12439 = D.12435 | D.12438;
      D.12440 = buffer[3];
      D.12441 = (int) D.12440;
      D.12442 = D.12441 << 24;
      D.12443 = D.12439 | D.12442;
      pe_header_offset = (off_t) D.12443;
      D.12444 = pe_header_offset + 23;
      if (D.12444 >= file_size) goto leave; else goto <D.12445>;
      <D.12445>:
      new_offset = lseek (file, pe_header_offset, 0);
      if (new_offset != pe_header_offset) goto leave; else goto <D.12446>;
      <D.12446>:
      D.12447 = read (file, &buffer, 4);
      num_read = (int) D.12447;
      if (num_read != 4) goto leave; else goto <D.12448>;
      <D.12448>:
      D.12425 = buffer[0];
      if (D.12425 != 80) goto leave; else goto <D.12449>;
      <D.12449>:
      D.12427 = buffer[1];
      if (D.12427 != 69) goto leave; else goto <D.12450>;
      <D.12450>:
      D.12436 = buffer[2];
      if (D.12436 != 0) goto leave; else goto <D.12451>;
      <D.12451>:
      D.12440 = buffer[3];
      if (D.12440 != 0) goto leave; else goto <D.12452>;
      <D.12452>:
      D.12453 = pe_header_offset + 20;
      new_offset = lseek (file, D.12453, 0);
      D.12453 = pe_header_offset + 20;
      if (D.12453 != new_offset) goto leave; else goto <D.12454>;
      <D.12454>:
      D.12455 = read (file, &buffer, 2);
      num_read = (int) D.12455;
      if (num_read != 2) goto leave; else goto <D.12456>;
      <D.12456>:
      D.12425 = buffer[0];
      D.12432 = (int) D.12425;
      D.12427 = buffer[1];
      D.12433 = (int) D.12427;
      D.12434 = D.12433 << 8;
      D.12435 = D.12432 | D.12434;
      if (D.12435 <= 215) goto leave; else goto <D.12457>;
      <D.12457>:
      optional_header_offset = pe_header_offset + 24;
      D.12458 = optional_header_offset + 208;
      new_offset = lseek (file, D.12458, 0);
      D.12458 = optional_header_offset + 208;
      if (D.12458 != new_offset) goto leave; else goto <D.12459>;
      <D.12459>:
      D.12460 = read (file, &buffer, 8);
      num_read = (int) D.12460;
      D.12461 = &buffer[0];
      first_word = MEM[(guint32 *)D.12461];
      D.12462 = &buffer[4];
      second_word = MEM[(guint32 *)D.12462];
      if (num_read != 8) goto leave; else goto <D.12463>;
      <D.12463>:
      if (first_word == 0) goto leave; else goto <D.12464>;
      <D.12464>:
      if (second_word == 0) goto leave; else goto <D.12465>;
      <D.12465>:
      managed = 1;
      leave:
      close (file);
      D.12418 = __errno_location ();
      *D.12418 = original_errno;
      D.12421 = managed;
      return D.12421;
    }
  finally
    {
      buffer = {CLOBBER};
    }
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
open (const char * __path, int __oflag)
{
  int D.12468;
  int D.12471;
  int D.12476;
  int D.12478;
  int D.12479;
  int D.12482;
  int D.12483;

  D.12468 = __builtin_va_arg_pack_len ();
  if (D.12468 > 1) goto <D.12469>; else goto <D.12470>;
  <D.12469>:
  __open_too_many_args ();
  <D.12470>:
  D.12471 = __builtin_constant_p (__oflag);
  if (D.12471 != 0) goto <D.12472>; else goto <D.12473>;
  <D.12472>:
  D.12476 = __oflag & 64;
  if (D.12476 != 0) goto <D.12474>; else goto <D.12477>;
  <D.12477>:
  D.12478 = __oflag & 4259840;
  if (D.12478 == 4259840) goto <D.12474>; else goto <D.12475>;
  <D.12474>:
  D.12479 = __builtin_va_arg_pack_len ();
  if (D.12479 <= 0) goto <D.12480>; else goto <D.12481>;
  <D.12480>:
  __open_missing_mode ();
  D.12482 = __open_2 (__path, __oflag);
  return D.12482;
  <D.12481>:
  <D.12475>:
  D.12482 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.12482;
  <D.12473>:
  D.12483 = __builtin_va_arg_pack_len ();
  if (D.12483 <= 0) goto <D.12484>; else goto <D.12485>;
  <D.12484>:
  D.12482 = __open_2 (__path, __oflag);
  return D.12482;
  <D.12485>:
  D.12482 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.12482;
}


process_set_defaults (struct _WapiHandle_process * process_handle)
{
  long int D.12487;
  struct WapiFileTime * D.12488;

  process_handle->min_working_set = 204800;
  process_handle->max_working_set = 1413120;
  D.12487 = time (0B);
  D.12488 = &process_handle->create_time;
  _wapi_time_t_to_filetime (D.12487, D.12488);
}


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

  if (str != 0B) goto <D.12489>; else goto <D.12490>;
  <D.12489>:
  D.12491 = __strdup (str);
  return D.12491;
  <D.12490>:
  D.12491 = 0B;
  return D.12491;
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
read (int __fd, void * __buf, size_t __nbytes)
{
  long unsigned int D.12493;
  int D.12496;
  ssize_t D.12499;
  long unsigned int D.12500;
  long unsigned int D.12501;
  long unsigned int D.12504;

  D.12493 = __builtin_object_size (__buf, 0);
  if (D.12493 != 18446744073709551615) goto <D.12494>; else goto <D.12495>;
  <D.12494>:
  D.12496 = __builtin_constant_p (__nbytes);
  if (D.12496 == 0) goto <D.12497>; else goto <D.12498>;
  <D.12497>:
  D.12500 = __builtin_object_size (__buf, 0);
  D.12499 = __read_chk (__fd, __buf, __nbytes, D.12500);
  return D.12499;
  <D.12498>:
  D.12501 = __builtin_object_size (__buf, 0);
  if (D.12501 < __nbytes) goto <D.12502>; else goto <D.12503>;
  <D.12502>:
  D.12504 = __builtin_object_size (__buf, 0);
  D.12499 = __read_chk_warn (__fd, __buf, __nbytes, D.12504);
  return D.12499;
  <D.12503>:
  <D.12495>:
  D.12499 = __read_alias (__fd, __buf, __nbytes);
  return D.12499;
}


_wapi_process_duplicate ()
{
  void * current_process.38;
  void * D.12507;

  mono_once (&process_current_once, process_set_current);
  current_process.38 = current_process;
  _wapi_handle_ref (current_process.38);
  D.12507 = current_process;
  return D.12507;
}


process_set_current ()
{
  int D.12511;
  unsigned int D.12512;
  void * D.12513;
  void * current_process.39;
  struct _WapiHandle_process * process_handlep.40;
  int D.12518;
  int D.12521;
  void * D.12525;
  pid_t pid;
  const char * handle_env;
  struct _WapiHandle_process process_handle;
  static const char __func__[20] = "process_set_current";

  try
    {
      pid = _wapi_getpid ();
      process_handle = {};
      mono_once (&process_ops_once, process_ops_init);
      handle_env = monoeg_g_getenv ("_WAPI_PROCESS_HANDLE_OFFSET");
      monoeg_g_unsetenv ("_WAPI_PROCESS_HANDLE_OFFSET");
      if (handle_env != 0B) goto <D.12509>; else goto <D.12510>;
      <D.12509>:
      {
        struct _WapiHandle_process * process_handlep;
        gchar * procname;
        gboolean ok;

        try
          {
            procname = 0B;
            D.12511 = atoi (handle_env);
            D.12512 = (unsigned int) D.12511;
            D.12513 = _wapi_handle_new_from_offset (9, D.12512, 1);
            current_process = D.12513;
            current_process.39 = current_process;
            ok = _wapi_lookup_handle (current_process.39, 9, &process_handlep);
            if (ok != 0) goto <D.12515>; else goto <D.12516>;
            <D.12515>:
            process_handlep.40 = process_handlep;
            D.12518 = process_handlep.40->id;
            if (D.12518 == pid) goto <D.12519>; else goto <D.12520>;
            <D.12519>:
            process_handlep.40 = process_handlep;
            procname = &process_handlep.40->proc_name;
            D.12521 = strcmp (procname, "mono");
            if (D.12521 == 0) goto <D.12522>; else goto <D.12523>;
            <D.12522>:
            process_handlep.40 = process_handlep;
            process_set_name (process_handlep.40);
            goto <D.12524>;
            <D.12523>:
            <D.12524>:
            return;
            <D.12520>:
            current_process.39 = current_process;
            _wapi_handle_unref (current_process.39);
            <D.12516>:
          }
        finally
          {
            process_handlep = {CLOBBER};
          }
      }
      <D.12510>:
      process_handle.id = pid;
      process_set_defaults (&process_handle);
      process_set_name (&process_handle);
      D.12525 = _wapi_handle_new (9, &process_handle);
      current_process = D.12525;
      current_process.39 = current_process;
      if (current_process.39 == -1B) goto <D.12526>; else goto <D.12527>;
      <D.12526>:
      monoeg_g_log (0B, 16, "%s: error creating process handle", &__func__);
      return;
      <D.12527>:
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


__attribute__((__gnu_inline__, __pure__, __leaf__, __nothrow__))
atoi (const char * __nptr)
{
  int D.12533;
  long int D.12534;

  D.12534 = strtol (__nptr, 0B, 10);
  D.12533 = (int) D.12534;
  return D.12533;
}


__attribute__((__gnu_inline__, nothrow, leaf, pure))
strcmp (const char * __s1, const char * __s2)
{
  int iftmp.41;
  int iftmp.42;
  int D.12544;
  char * __p1;
  char * __p2;
  int __ret;

  __p1 = __s1;
  __p2 = __s2;
  __asm__ __volatile__("   slr   0,0
0: clst  %1,%2
   jo    0b
   ipm   %0
   srl   %0,28" : "=d" __ret, "=&a" __p1, "=&a" __p2 : "1" __p1, "2" __p2 : "0", "memory", "cc");
  if (__ret != 0) goto <D.12537>; else goto <D.12538>;
  <D.12537>:
  if (__ret == 1) goto <D.12540>; else goto <D.12541>;
  <D.12540>:
  iftmp.42 = -1;
  goto <D.12542>;
  <D.12541>:
  iftmp.42 = 1;
  <D.12542>:
  iftmp.41 = iftmp.42;
  goto <D.12543>;
  <D.12538>:
  iftmp.41 = 0;
  <D.12543>:
  __ret = iftmp.41;
  D.12544 = __ret;
  return D.12544;
}


process_set_name (struct _WapiHandle_process * process_handle)
{
  gchar[256] * D.12550;
  gchar * D.12551;
  gchar * progname;
  gchar * utf8_progname;
  gchar * slash;

  progname = monoeg_g_get_prgname ();
  utf8_progname = mono_utf8_from_external (progname);
  if (utf8_progname != 0B) goto <D.12546>; else goto <D.12547>;
  <D.12546>:
  slash = strrchr (utf8_progname, 47);
  if (slash != 0B) goto <D.12548>; else goto <D.12549>;
  <D.12548>:
  D.12550 = &process_handle->proc_name;
  D.12551 = slash + 1;
  monoeg_g_strlcpy (D.12550, D.12551, 255);
  goto <D.12552>;
  <D.12549>:
  D.12550 = &process_handle->proc_name;
  monoeg_g_strlcpy (D.12550, utf8_progname, 255);
  <D.12552>:
  monoeg_g_free (utf8_progname);
  <D.12547>:
}


GetCurrentProcess ()
{
  void * D.12553;

  mono_once (&process_current_once, process_set_current);
  D.12553 = 4294967295B;
  return D.12553;
}


GetProcessId (void * handle)
{
  long int handle.43;
  signed int D.12556;
  guint32 D.12559;
  unsigned int D.12560;
  struct _WapiHandle_process * process_handle.44;
  int D.12564;
  struct _WapiHandle_process * process_handle;
  gboolean ok;

  try
    {
      handle.43 = (long int) handle;
      D.12556 = (signed int) handle.43;
      if (D.12556 < 0) goto <D.12557>; else goto <D.12558>;
      <D.12557>:
      handle.43 = (long int) handle;
      D.12560 = (unsigned int) handle.43;
      D.12559 = D.12560 & 2147483647;
      return D.12559;
      <D.12558>:
      ok = _wapi_lookup_handle (handle, 9, &process_handle);
      if (ok == 0) goto <D.12561>; else goto <D.12562>;
      <D.12561>:
      SetLastError (6);
      D.12559 = 0;
      return D.12559;
      <D.12562>:
      process_handle.44 = process_handle;
      D.12564 = process_handle.44->id;
      D.12559 = (guint32) D.12564;
      return D.12559;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


GetCurrentProcessId ()
{
  guint32 D.12567;
  void * current_process.45;

  mono_once (&process_current_once, process_set_current);
  current_process.45 = current_process;
  D.12567 = GetProcessId (current_process.45);
  return D.12567;
}


EnumProcesses (guint32 * pids, guint32 len, guint32 * needed)
{
  gboolean D.12572;
  const short unsigned int * * D.12573;
  const short unsigned int * D.12574;
  char D.12575;
  long unsigned int D.12576;
  long unsigned int D.12577;
  const short unsigned int * D.12578;
  short unsigned int D.12579;
  int D.12580;
  int D.12581;
  char[256] * D.12584;
  long int D.12585;
  char * endptr.46;
  char D.12587;
  unsigned int i.47;
  long unsigned int D.12591;
  long unsigned int D.12592;
  guint32 * D.12593;
  unsigned int pid.48;
  unsigned int D.12596;
  guint32 fit;
  guint32 i;
  struct DIR * dir;
  struct dirent * entry;

  mono_once (&process_current_once, process_set_current);
  dir = opendir ("/proc");
  if (dir == 0B) goto <D.12570>; else goto <D.12571>;
  <D.12570>:
  D.12572 = 0;
  return D.12572;
  <D.12571>:
  i = 0;
  fit = len / 4;
  goto <D.11502>;
  <D.11503>:
  {
    pid_t pid;
    char * endptr;

    try
      {
        D.12573 = __ctype_b_loc ();
        D.12574 = *D.12573;
        D.12575 = entry->d_name[0];
        D.12576 = (long unsigned int) D.12575;
        D.12577 = D.12576 * 2;
        D.12578 = D.12574 + D.12577;
        D.12579 = *D.12578;
        D.12580 = (int) D.12579;
        D.12581 = D.12580 & 8;
        if (D.12581 == 0) goto <D.12582>; else goto <D.12583>;
        <D.12582>:
        // predicted unlikely by continue predictor.
        goto <D.11502>;
        <D.12583>:
        D.12584 = &entry->d_name;
        D.12585 = strtol (D.12584, &endptr, 10);
        pid = (pid_t) D.12585;
        endptr.46 = endptr;
        D.12587 = *endptr.46;
        if (D.12587 == 0) goto <D.12588>; else goto <D.12589>;
        <D.12588>:
        i.47 = i;
        i = i.47 + 1;
        D.12591 = (long unsigned int) i.47;
        D.12592 = D.12591 * 4;
        D.12593 = pids + D.12592;
        pid.48 = (unsigned int) pid;
        *D.12593 = pid.48;
        <D.12589>:
      }
    finally
      {
        endptr = {CLOBBER};
      }
  }
  <D.11502>:
  if (i < fit) goto <D.12595>; else goto <D.11504>;
  <D.12595>:
  entry = readdir (dir);
  if (entry != 0B) goto <D.11503>; else goto <D.11504>;
  <D.11504>:
  closedir (dir);
  D.12596 = i * 4;
  *needed = D.12596;
  D.12572 = 1;
  return D.12572;
}


CloseProcess (void * handle)
{
  long int handle.49;
  signed int D.12601;
  gboolean D.12604;

  handle.49 = (long int) handle;
  D.12601 = (signed int) handle.49;
  if (D.12601 < 0) goto <D.12602>; else goto <D.12603>;
  <D.12602>:
  D.12604 = 1;
  return D.12604;
  <D.12603>:
  D.12604 = CloseHandle (handle);
  return D.12604;
}


OpenProcess (guint32 req_access, gboolean inherit, guint32 pid)
{
  long unsigned int D.12606;
  void * D.12607;
  int pid.50;
  int D.12611;
  void * D.12614;
  unsigned int D.12615;
  long int D.12616;
  void * handle;

  handle = 0B;
  mono_once (&process_current_once, process_set_current);
  D.12606 = (long unsigned int) pid;
  D.12607 = (void *) D.12606;
  handle = _wapi_search_handle (9, process_open_compare, D.12607, 0B, 1);
  if (handle == 0B) goto <D.12608>; else goto <D.12609>;
  <D.12608>:
  pid.50 = (int) pid;
  D.12611 = is_pid_valid (pid.50);
  if (D.12611 != 0) goto <D.12612>; else goto <D.12613>;
  <D.12612>:
  D.12615 = pid + 2147483648;
  D.12616 = (long int) D.12615;
  D.12614 = (void *) D.12616;
  return D.12614;
  <D.12613>:
  SetLastError (127);
  D.12614 = 0B;
  return D.12614;
  <D.12609>:
  D.12614 = handle;
  return D.12614;
}


process_open_compare (void * handle, void * user_data)
{
  gboolean D.12620;
  long int user_data.51;
  int D.12624;
  pid_t wanted_pid;
  pid_t checking_pid;

  checking_pid = signal_process_if_gone (handle);
  if (checking_pid == 0) goto <D.12618>; else goto <D.12619>;
  <D.12618>:
  D.12620 = 0;
  return D.12620;
  <D.12619>:
  user_data.51 = (long int) user_data;
  wanted_pid = (pid_t) user_data.51;
  if (checking_pid == wanted_pid) goto <D.12623>; else goto <D.12622>;
  <D.12623>:
  D.12624 = _wapi_handle_issignalled (handle);
  if (D.12624 == 0) goto <D.12625>; else goto <D.12622>;
  <D.12625>:
  D.12620 = 1;
  return D.12620;
  <D.12622>:
  D.12620 = 0;
  return D.12620;
}


signal_process_if_gone (void * handle)
{
  long int handle.52;
  signed int D.12628;
  _Bool D.12629;
  long int D.12630;
  long int D.12631;
  pid_t D.12636;
  struct _WapiHandle_process * process_handle.53;
  int D.12640;
  int D.12641;
  int * D.12644;
  int D.12645;
  struct _WapiHandle_process * process_handle;
  gboolean ok;

  try
    {
      handle.52 = (long int) handle;
      D.12628 = (signed int) handle.52;
      D.12629 = D.12628 < 0;
      D.12630 = (long int) D.12629;
      D.12631 = __builtin_expect (D.12630, 0);
      if (D.12631 != 0) goto <D.12632>; else goto <D.12633>;
      <D.12632>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "processes.c", 1271, "(GPOINTER_TO_UINT (handle) & _WAPI_PROCESS_UNHANDLED) != _WAPI_PROCESS_UNHANDLED");
      <D.12633>:
      ok = _wapi_lookup_handle (handle, 9, &process_handle);
      if (ok == 0) goto <D.12634>; else goto <D.12635>;
      <D.12634>:
      D.12636 = 0;
      return D.12636;
      <D.12635>:
      process_handle.53 = process_handle;
      D.12640 = process_handle.53->id;
      D.12641 = kill (D.12640, 0);
      if (D.12641 == -1) goto <D.12642>; else goto <D.12643>;
      <D.12642>:
      D.12644 = __errno_location ();
      D.12645 = *D.12644;
      if (D.12645 == 3) goto <D.12637>; else goto <D.12646>;
      <D.12646>:
      D.12644 = __errno_location ();
      D.12645 = *D.12644;
      if (D.12645 == 1) goto <D.12637>; else goto <D.12638>;
      <D.12637>:
      _wapi_shared_handle_set_signal_state (handle, 1);
      <D.12638>:
      <D.12643>:
      process_handle.53 = process_handle;
      D.12636 = process_handle.53->id;
      return D.12636;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


_wapi_handle_issignalled (void * handle)
{
  long int handle.54;
  gboolean D.12652;
  <unnamed type> D.12655;
  <unnamed type> D.12657;
  <unnamed type> D.12659;
  <unnamed type> D.12661;
  struct _WapiHandleSharedLayout * _wapi_shared_layout.55;
  unsigned int D.12663;
  unsigned int D.12664;
  struct _WapiHandleUnshared * D.12665;
  long unsigned int D.12666;
  long unsigned int D.12667;
  long unsigned int D.12668;
  struct _WapiHandleUnshared * D.12669;
  unsigned int D.12670;
  unsigned int D.12671;
  struct _WapiHandleUnshared * D.12672;
  long unsigned int D.12673;
  long unsigned int D.12674;
  long unsigned int D.12675;
  struct _WapiHandleUnshared * D.12676;
  guint32 idx;

  handle.54 = (long int) handle;
  idx = (guint32) handle.54;
  if (idx > 4194303) goto <D.12650>; else goto <D.12651>;
  <D.12650>:
  D.12652 = 0;
  return D.12652;
  <D.12651>:
  D.12655 = _wapi_handle_type (handle);
  if (D.12655 == 9) goto <D.12653>; else goto <D.12656>;
  <D.12656>:
  D.12657 = _wapi_handle_type (handle);
  if (D.12657 == 11) goto <D.12653>; else goto <D.12658>;
  <D.12658>:
  D.12659 = _wapi_handle_type (handle);
  if (D.12659 == 12) goto <D.12653>; else goto <D.12660>;
  <D.12660>:
  D.12661 = _wapi_handle_type (handle);
  if (D.12661 == 13) goto <D.12653>; else goto <D.12654>;
  <D.12653>:
  _wapi_shared_layout.55 = _wapi_shared_layout;
  handle.54 = (long int) handle;
  D.12663 = (unsigned int) handle.54;
  D.12664 = D.12663 / 256;
  D.12665 = _wapi_private_handles[D.12664];
  handle.54 = (long int) handle;
  D.12663 = (unsigned int) handle.54;
  D.12666 = (long unsigned int) D.12663;
  D.12667 = D.12666 & 255;
  D.12668 = D.12667 * 200;
  D.12669 = D.12665 + D.12668;
  D.12670 = D.12669->u.shared.offset;
  D.12652 = _wapi_shared_layout.55->handles[D.12670].signalled;
  return D.12652;
  <D.12654>:
  D.12671 = idx / 256;
  D.12672 = _wapi_private_handles[D.12671];
  D.12673 = (long unsigned int) idx;
  D.12674 = D.12673 & 255;
  D.12675 = D.12674 * 200;
  D.12676 = D.12672 + D.12675;
  D.12652 = D.12676->signalled;
  return D.12652;
}


GetExitCodeProcess (void * process, guint32 * code)
{
  gboolean D.12680;
  long int process.56;
  unsigned int D.12682;
  signed int D.12683;
  int pid.57;
  int D.12687;
  int D.12692;
  struct _WapiHandle_process * process_handle.58;
  unsigned int D.12696;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  guint32 pid;

  try
    {
      pid = 4294967295;
      mono_once (&process_current_once, process_set_current);
      if (code == 0B) goto <D.12678>; else goto <D.12679>;
      <D.12678>:
      D.12680 = 0;
      return D.12680;
      <D.12679>:
      process.56 = (long int) process;
      D.12682 = (unsigned int) process.56;
      pid = D.12682 + 2147483648;
      process.56 = (long int) process;
      D.12683 = (signed int) process.56;
      if (D.12683 < 0) goto <D.12684>; else goto <D.12685>;
      <D.12684>:
      pid.57 = (int) pid;
      D.12687 = is_pid_valid (pid.57);
      if (D.12687 != 0) goto <D.12688>; else goto <D.12689>;
      <D.12688>:
      *code = 259;
      D.12680 = 1;
      return D.12680;
      <D.12689>:
      D.12680 = 0;
      return D.12680;
      <D.12685>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.12690>; else goto <D.12691>;
      <D.12690>:
      D.12680 = 0;
      return D.12680;
      <D.12691>:
      process_wait (process, 0, 1);
      D.12692 = _wapi_handle_issignalled (process);
      if (D.12692 == 1) goto <D.12693>; else goto <D.12694>;
      <D.12693>:
      process_handle.58 = process_handle;
      D.12696 = process_handle.58->exitstatus;
      *code = D.12696;
      goto <D.12697>;
      <D.12694>:
      *code = 259;
      <D.12697>:
      D.12680 = 1;
      return D.12680;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


GetProcessTimes (void * process, struct WapiFileTime * create_time, struct WapiFileTime * exit_time, struct WapiFileTime * kernel_time, struct WapiFileTime * user_time)
{
  gboolean D.12705;
  long int process.59;
  signed int D.12707;
  struct _WapiHandle_process * process_handle.60;
  int D.12713;
  int D.12716;
  int D.12717;
  int D.12720;
  long int D.12723;
  long int D.12724;
  long int D.12725;
  long int D.12726;
  long int D.12727;
  long int D.12728;
  long int D.12729;
  long int D.12730;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  gboolean ku_times_set;

  try
    {
      ku_times_set = 0;
      mono_once (&process_current_once, process_set_current);
      if (create_time == 0B) goto <D.12700>; else goto <D.12702>;
      <D.12702>:
      if (exit_time == 0B) goto <D.12700>; else goto <D.12703>;
      <D.12703>:
      if (kernel_time == 0B) goto <D.12700>; else goto <D.12704>;
      <D.12704>:
      if (user_time == 0B) goto <D.12700>; else goto <D.12701>;
      <D.12700>:
      D.12705 = 0;
      return D.12705;
      <D.12701>:
      process.59 = (long int) process;
      D.12707 = (signed int) process.59;
      if (D.12707 < 0) goto <D.12708>; else goto <D.12709>;
      <D.12708>:
      D.12705 = 0;
      return D.12705;
      <D.12709>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.12710>; else goto <D.12711>;
      <D.12710>:
      D.12705 = 0;
      return D.12705;
      <D.12711>:
      process_handle.60 = process_handle;
      *create_time = process_handle.60->create_time;
      D.12713 = _wapi_handle_issignalled (process);
      if (D.12713 == 1) goto <D.12714>; else goto <D.12715>;
      <D.12714>:
      process_handle.60 = process_handle;
      *exit_time = process_handle.60->exit_time;
      <D.12715>:
      process_handle.60 = process_handle;
      D.12716 = process_handle.60->id;
      D.12717 = getpid ();
      if (D.12716 == D.12717) goto <D.12718>; else goto <D.12719>;
      <D.12718>:
      {
        struct rusage time_data;

        try
          {
            D.12720 = getrusage (0, &time_data);
            if (D.12720 == 0) goto <D.12721>; else goto <D.12722>;
            <D.12721>:
            {
              gint64 tick_val;
              gint64 * tick_val_ptr;

              ku_times_set = 1;
              D.12723 = time_data.ru_utime.tv_sec;
              D.12724 = D.12723 * 10000000;
              D.12725 = time_data.ru_utime.tv_usec;
              D.12726 = D.12725 * 10;
              tick_val = D.12724 + D.12726;
              tick_val_ptr = user_time;
              *tick_val_ptr = tick_val;
              D.12727 = time_data.ru_stime.tv_sec;
              D.12728 = D.12727 * 10000000;
              D.12729 = time_data.ru_stime.tv_usec;
              D.12730 = D.12729 * 10;
              tick_val = D.12728 + D.12730;
              tick_val_ptr = kernel_time;
              *tick_val_ptr = tick_val;
            }
            <D.12722>:
          }
        finally
          {
            time_data = {CLOBBER};
          }
      }
      <D.12719>:
      if (ku_times_set == 0) goto <D.12731>; else goto <D.12732>;
      <D.12731>:
      memset (kernel_time, 0, 8);
      memset (user_time, 0, 8);
      <D.12732>:
      D.12705 = 1;
      return D.12705;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __nothrow__, __leaf__))
memset (void * __dest, int __ch, size_t __len)
{
  void * D.12735;
  long unsigned int D.12736;

  D.12736 = __builtin_object_size (__dest, 0);
  D.12735 = __builtin___memset_chk (__dest, __ch, __len, D.12736);
  return D.12735;
}


EnumProcessModules (void * process, void * * modules, guint32 size, guint32 * needed)
{
  gboolean D.12740;
  long int process.61;
  signed int D.12742;
  int D.12745;
  struct _WapiHandle_process * process_handle.62;
  unsigned int D.12753;
  unsigned int D.12754;
  unsigned int i.63;
  void * D.12756;
  long unsigned int D.12759;
  long unsigned int D.12760;
  void * * D.12761;
  void * D.12762;
  gchar * D.12764;
  int D.12765;
  sizetype D.12769;
  sizetype D.12770;
  sizetype D.12771;
  void * * D.12772;
  unsigned int D.12773;
  unsigned int i.64;
  void * D.12776;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  struct FILE * fp;
  struct GSList * mods;
  struct WapiProcModule * module;
  guint32 count;
  guint32 avail;
  int i;
  pid_t pid;
  gchar * proc_name;

  try
    {
      mods = 0B;
      avail = size / 8;
      proc_name = 0B;
      if (size <= 7) goto <D.12738>; else goto <D.12739>;
      <D.12738>:
      D.12740 = 0;
      return D.12740;
      <D.12739>:
      process.61 = (long int) process;
      D.12742 = (signed int) process.61;
      if (D.12742 < 0) goto <D.12743>; else goto <D.12744>;
      <D.12743>:
      process.61 = (long int) process;
      D.12745 = (int) process.61;
      pid = D.12745 & 2147483647;
      goto <D.12746>;
      <D.12744>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.12747>; else goto <D.12748>;
      <D.12747>:
      D.12740 = 0;
      return D.12740;
      <D.12748>:
      process_handle.62 = process_handle;
      pid = process_handle.62->id;
      process_handle.62 = process_handle;
      proc_name = &process_handle.62->proc_name;
      <D.12746>:
      fp = open_process_map (pid, "r");
      if (fp == 0B) goto <D.12750>; else goto <D.12751>;
      <D.12750>:
      *modules = 0B;
      *needed = 8;
      goto <D.12752>;
      <D.12751>:
      mods = load_modules (fp);
      fclose (fp);
      count = monoeg_g_slist_length (mods);
      D.12753 = count + 1;
      D.12754 = D.12753 * 8;
      *needed = D.12754;
      *modules = 0B;
      i = 0;
      goto <D.11642>;
      <D.11641>:
      i.63 = (unsigned int) i;
      module = monoeg_g_slist_nth_data (mods, i.63);
      D.12756 = *modules;
      if (D.12756 != 0B) goto <D.12757>; else goto <D.12758>;
      <D.12757>:
      D.12759 = (long unsigned int) i;
      D.12760 = D.12759 * 8;
      D.12761 = modules + D.12760;
      D.12762 = module->address_start;
      *D.12761 = D.12762;
      goto <D.12763>;
      <D.12758>:
      D.12764 = module->filename;
      D.12765 = match_procname_to_modulename (proc_name, D.12764);
      if (D.12765 != 0) goto <D.12766>; else goto <D.12767>;
      <D.12766>:
      D.12762 = module->address_start;
      *modules = D.12762;
      goto <D.12768>;
      <D.12767>:
      D.12769 = (sizetype) i;
      D.12770 = D.12769 + 1;
      D.12771 = D.12770 * 8;
      D.12772 = modules + D.12771;
      D.12762 = module->address_start;
      *D.12772 = D.12762;
      <D.12768>:
      <D.12763>:
      i = i + 1;
      <D.11642>:
      D.12773 = avail + 4294967295;
      i.64 = (unsigned int) i;
      if (D.12773 > i.64) goto <D.12775>; else goto <D.11643>;
      <D.12775>:
      i.64 = (unsigned int) i;
      if (i.64 < count) goto <D.11641>; else goto <D.11643>;
      <D.11643>:
      i = 0;
      goto <D.11645>;
      <D.11644>:
      i.63 = (unsigned int) i;
      D.12776 = monoeg_g_slist_nth_data (mods, i.63);
      free_procmodule (D.12776);
      i = i + 1;
      <D.11645>:
      i.64 = (unsigned int) i;
      if (i.64 < count) goto <D.11644>; else goto <D.11646>;
      <D.11646>:
      monoeg_g_slist_free (mods);
      <D.12752>:
      D.12740 = 1;
      return D.12740;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


open_process_map (int pid, const char * mode)
{
  const gchar * D.12782;
  struct FILE * D.12784;
  struct FILE * fp;
  const gchar * proc_path[3];
  int i;
  gchar * filename;

  try
    {
      fp = 0B;
      proc_path = *.LC2;
      i = 0;
      goto <D.11623>;
      <D.11622>:
      D.12782 = proc_path[i];
      filename = monoeg_g_strdup_printf (D.12782, pid);
      fp = fopen (filename, mode);
      monoeg_g_free (filename);
      i = i + 1;
      <D.11623>:
      if (fp == 0B) goto <D.12783>; else goto <D.11624>;
      <D.12783>:
      D.12782 = proc_path[i];
      if (D.12782 != 0B) goto <D.11622>; else goto <D.11624>;
      <D.11624>:
      D.12784 = fp;
      return D.12784;
    }
  finally
    {
      proc_path = {CLOBBER};
    }
}


load_modules (struct FILE * fp)
{
  const short unsigned int * * D.12787;
  const short unsigned int * D.12788;
  char D.12789;
  long unsigned int D.12790;
  long unsigned int D.12791;
  const short unsigned int * D.12792;
  short unsigned int D.12793;
  int D.12794;
  int D.12795;
  char D.12796;
  long unsigned int D.12797;
  long unsigned int D.12798;
  const short unsigned int * D.12799;
  short unsigned int D.12800;
  int D.12801;
  int D.12802;
  long unsigned int D.12805;
  char D.12808;
  long unsigned int D.12809;
  long unsigned int D.12810;
  const short unsigned int * D.12811;
  short unsigned int D.12812;
  int D.12813;
  int D.12814;
  long unsigned int D.12817;
  char D.12820;
  char D.12825;
  long unsigned int D.12826;
  long unsigned int D.12827;
  const short unsigned int * D.12828;
  short unsigned int D.12829;
  int D.12830;
  int D.12831;
  long unsigned int D.12834;
  char D.12837;
  long unsigned int D.12838;
  long unsigned int D.12839;
  const short unsigned int * D.12840;
  short unsigned int D.12841;
  int D.12842;
  int D.12843;
  long unsigned int D.12846;
  char D.12849;
  long unsigned int D.12850;
  long unsigned int D.12851;
  const short unsigned int * D.12852;
  short unsigned int D.12853;
  int D.12854;
  int D.12855;
  long unsigned int D.12858;
  char D.12861;
  long unsigned int D.12862;
  long unsigned int D.12863;
  const short unsigned int * D.12864;
  short unsigned int D.12865;
  int D.12866;
  int D.12867;
  long int D.12870;
  gchar * D.12877;
  gchar * D.12878;
  gchar * D.12879;
  gchar * D.12880;
  struct GSList * D.12881;
  char * D.12885;
  struct GSList * D.12886;
  struct GSList * ret;
  struct WapiProcModule * mod;
  gchar buf[4097];
  gchar * p;
  gchar * endp;
  gchar * start_start;
  gchar * end_start;
  gchar * prot_start;
  gchar * offset_start;
  gchar * maj_dev_start;
  gchar * min_dev_start;
  gchar * inode_start;
  gchar prot_buf[5];
  void * address_start;
  void * address_end;
  void * address_offset;
  guint32 maj_dev;
  guint32 min_dev;
  ino_t inode;
  dev_t device;

  try
    {
      ret = 0B;
      goto <D.11584>;
      <D.11603>:
      p = &buf;
      goto <D.11582>;
      <D.11581>:
      p = p + 1;
      <D.11582>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 != 0) goto <D.11581>; else goto <D.11583>;
      <D.11583>:
      start_start = p;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12796 = *start_start;
      D.12797 = (long unsigned int) D.12796;
      D.12798 = D.12797 * 2;
      D.12799 = D.12788 + D.12798;
      D.12800 = *D.12799;
      D.12801 = (int) D.12800;
      D.12802 = D.12801 & 16;
      if (D.12802 == 0) goto <D.12803>; else goto <D.12804>;
      <D.12803>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12804>:
      D.12805 = strtoul (start_start, &endp, 16);
      address_start = (void *) D.12805;
      p = endp;
      D.12789 = *p;
      if (D.12789 != 45) goto <D.12806>; else goto <D.12807>;
      <D.12806>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12807>:
      p = p + 1;
      end_start = p;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12808 = *end_start;
      D.12809 = (long unsigned int) D.12808;
      D.12810 = D.12809 * 2;
      D.12811 = D.12788 + D.12810;
      D.12812 = *D.12811;
      D.12813 = (int) D.12812;
      D.12814 = D.12813 & 16;
      if (D.12814 == 0) goto <D.12815>; else goto <D.12816>;
      <D.12815>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12816>:
      D.12817 = strtoul (end_start, &endp, 16);
      address_end = (void *) D.12817;
      p = endp;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 == 0) goto <D.12818>; else goto <D.12819>;
      <D.12818>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12819>:
      goto <D.11586>;
      <D.11585>:
      p = p + 1;
      <D.11586>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 != 0) goto <D.11585>; else goto <D.11587>;
      <D.11587>:
      prot_start = p;
      D.12820 = *prot_start;
      if (D.12820 != 114) goto <D.12821>; else goto <D.12822>;
      <D.12821>:
      D.12820 = *prot_start;
      if (D.12820 != 45) goto <D.12823>; else goto <D.12824>;
      <D.12823>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12824>:
      <D.12822>:
      memcpy (&prot_buf, prot_start, 4);
      prot_buf[4] = 0;
      goto <D.11589>;
      <D.11588>:
      p = p + 1;
      <D.11589>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 == 0) goto <D.11588>; else goto <D.11590>;
      <D.11590>:
      goto <D.11592>;
      <D.11591>:
      p = p + 1;
      <D.11592>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 != 0) goto <D.11591>; else goto <D.11593>;
      <D.11593>:
      offset_start = p;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12825 = *offset_start;
      D.12826 = (long unsigned int) D.12825;
      D.12827 = D.12826 * 2;
      D.12828 = D.12788 + D.12827;
      D.12829 = *D.12828;
      D.12830 = (int) D.12829;
      D.12831 = D.12830 & 16;
      if (D.12831 == 0) goto <D.12832>; else goto <D.12833>;
      <D.12832>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12833>:
      D.12834 = strtoul (offset_start, &endp, 16);
      address_offset = (void *) D.12834;
      p = endp;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 == 0) goto <D.12835>; else goto <D.12836>;
      <D.12835>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12836>:
      goto <D.11595>;
      <D.11594>:
      p = p + 1;
      <D.11595>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 != 0) goto <D.11594>; else goto <D.11596>;
      <D.11596>:
      maj_dev_start = p;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12837 = *maj_dev_start;
      D.12838 = (long unsigned int) D.12837;
      D.12839 = D.12838 * 2;
      D.12840 = D.12788 + D.12839;
      D.12841 = *D.12840;
      D.12842 = (int) D.12841;
      D.12843 = D.12842 & 16;
      if (D.12843 == 0) goto <D.12844>; else goto <D.12845>;
      <D.12844>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12845>:
      D.12846 = strtoul (maj_dev_start, &endp, 16);
      maj_dev = (guint32) D.12846;
      p = endp;
      D.12789 = *p;
      if (D.12789 != 58) goto <D.12847>; else goto <D.12848>;
      <D.12847>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12848>:
      p = p + 1;
      min_dev_start = p;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12849 = *min_dev_start;
      D.12850 = (long unsigned int) D.12849;
      D.12851 = D.12850 * 2;
      D.12852 = D.12788 + D.12851;
      D.12853 = *D.12852;
      D.12854 = (int) D.12853;
      D.12855 = D.12854 & 16;
      if (D.12855 == 0) goto <D.12856>; else goto <D.12857>;
      <D.12856>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12857>:
      D.12858 = strtoul (min_dev_start, &endp, 16);
      min_dev = (guint32) D.12858;
      p = endp;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 == 0) goto <D.12859>; else goto <D.12860>;
      <D.12859>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12860>:
      goto <D.11598>;
      <D.11597>:
      p = p + 1;
      <D.11598>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 != 0) goto <D.11597>; else goto <D.11599>;
      <D.11599>:
      inode_start = p;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12861 = *inode_start;
      D.12862 = (long unsigned int) D.12861;
      D.12863 = D.12862 * 2;
      D.12864 = D.12788 + D.12863;
      D.12865 = *D.12864;
      D.12866 = (int) D.12865;
      D.12867 = D.12866 & 16;
      if (D.12867 == 0) goto <D.12868>; else goto <D.12869>;
      <D.12868>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12869>:
      D.12870 = strtol (inode_start, &endp, 10);
      inode = (ino_t) D.12870;
      p = endp;
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 == 0) goto <D.12871>; else goto <D.12872>;
      <D.12871>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12872>:
      device = gnu_dev_makedev (maj_dev, min_dev);
      if (device == 0) goto <D.12873>; else goto <D.12874>;
      <D.12873>:
      if (inode == 0) goto <D.12875>; else goto <D.12876>;
      <D.12875>:
      // predicted unlikely by continue predictor.
      goto <D.11584>;
      <D.12876>:
      <D.12874>:
      goto <D.11601>;
      <D.11600>:
      p = p + 1;
      <D.11601>:
      D.12787 = __ctype_b_loc ();
      D.12788 = *D.12787;
      D.12789 = *p;
      D.12790 = (long unsigned int) D.12789;
      D.12791 = D.12790 * 2;
      D.12792 = D.12788 + D.12791;
      D.12793 = *D.12792;
      D.12794 = (int) D.12793;
      D.12795 = D.12794 & 32;
      if (D.12795 != 0) goto <D.11600>; else goto <D.11602>;
      <D.11602>:
      mod = monoeg_malloc0 (56);
      mod->address_start = address_start;
      mod->address_end = address_end;
      D.12877 = monoeg_strdup (&prot_buf);
      mod->perms = D.12877;
      mod->address_offset = address_offset;
      mod->device = device;
      mod->inode = inode;
      D.12878 = monoeg_g_strchomp (p);
      D.12879 = monoeg_g_strchug (D.12878);
      D.12880 = monoeg_strdup (D.12879);
      mod->filename = D.12880;
      D.12881 = monoeg_g_slist_find_custom (ret, mod, find_procmodule);
      if (D.12881 == 0B) goto <D.12882>; else goto <D.12883>;
      <D.12882>:
      ret = monoeg_g_slist_prepend (ret, mod);
      goto <D.12884>;
      <D.12883>:
      free_procmodule (mod);
      <D.12884>:
      <D.11584>:
      D.12885 = fgets (&buf, 4097, fp);
      if (D.12885 != 0B) goto <D.11603>; else goto <D.11604>;
      <D.11604>:
      ret = monoeg_g_slist_reverse (ret);
      D.12886 = ret;
      return D.12886;
    }
  finally
    {
      buf = {CLOBBER};
      endp = {CLOBBER};
      prot_buf = {CLOBBER};
    }
}


find_procmodule (const void * a, const void * b)
{
  long unsigned int D.12890;
  long unsigned int D.12891;
  long unsigned int D.12893;
  long unsigned int D.12894;
  gint D.12896;
  struct WapiProcModule * want;
  struct WapiProcModule * compare;

  want = a;
  compare = b;
  D.12890 = want->device;
  D.12891 = compare->device;
  if (D.12890 == D.12891) goto <D.12892>; else goto <D.12889>;
  <D.12892>:
  D.12893 = want->inode;
  D.12894 = compare->inode;
  if (D.12893 == D.12894) goto <D.12895>; else goto <D.12889>;
  <D.12895>:
  D.12896 = 0;
  return D.12896;
  <D.12889>:
  D.12896 = 1;
  return D.12896;
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __nothrow__, __leaf__))
memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.12898;
  long unsigned int D.12899;

  D.12899 = __builtin_object_size (__dest, 0);
  D.12898 = __builtin___memcpy_chk (__dest, __src, __len, D.12899);
  return D.12898;
}


__attribute__((const, __gnu_inline__, __leaf__, __nothrow__))
gnu_dev_makedev (unsigned int __major, unsigned int __minor)
{
  long unsigned int D.12901;
  long unsigned int D.12902;
  long unsigned int D.12903;
  long unsigned int D.12904;
  long unsigned int D.12905;
  long unsigned int D.12906;
  long unsigned int D.12907;
  long unsigned int D.12908;
  __dev_t D.12909;
  __dev_t __dev;

  D.12901 = (long unsigned int) __major;
  D.12902 = D.12901 << 8;
  __dev = D.12902 & 1048320;
  D.12901 = (long unsigned int) __major;
  D.12903 = D.12901 << 32;
  D.12904 = D.12903 & 18446726481523507200;
  __dev = D.12904 | __dev;
  D.12905 = (long unsigned int) __minor;
  D.12906 = D.12905 & 255;
  __dev = D.12906 | __dev;
  D.12905 = (long unsigned int) __minor;
  D.12907 = D.12905 << 12;
  D.12908 = D.12907 & 17592184995840;
  __dev = D.12908 | __dev;
  D.12909 = __dev;
  return D.12909;
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
fgets (char * restrict __s, int __n, struct FILE * restrict __stream)
{
  long unsigned int D.12911;
  int D.12916;
  char * D.12918;
  long unsigned int D.12919;
  long unsigned int D.12920;
  long unsigned int D.12921;
  long unsigned int D.12924;

  D.12911 = __builtin_object_size (__s, 1);
  if (D.12911 != 18446744073709551615) goto <D.12912>; else goto <D.12913>;
  <D.12912>:
  D.12916 = __builtin_constant_p (__n);
  if (D.12916 == 0) goto <D.12914>; else goto <D.12917>;
  <D.12917>:
  if (__n <= 0) goto <D.12914>; else goto <D.12915>;
  <D.12914>:
  D.12919 = __builtin_object_size (__s, 1);
  D.12918 = __fgets_chk (__s, D.12919, __n, __stream);
  return D.12918;
  <D.12915>:
  D.12920 = (long unsigned int) __n;
  D.12921 = __builtin_object_size (__s, 1);
  if (D.12920 > D.12921) goto <D.12922>; else goto <D.12923>;
  <D.12922>:
  D.12924 = __builtin_object_size (__s, 1);
  D.12918 = __fgets_chk_warn (__s, D.12924, __n, __stream);
  return D.12918;
  <D.12923>:
  <D.12913>:
  D.12918 = __fgets_alias (__s, __n, __stream);
  return D.12918;
}


match_procname_to_modulename (gchar * procname, gchar * modulename)
{
  gboolean D.12929;
  int D.12930;
  char * D.12937;
  int D.12938;
  char * D.12947;
  int D.12948;
  int D.12952;
  char * lastsep;
  char * lastsep2;
  char * pname;
  char * mname;
  gboolean result;

  lastsep = 0B;
  lastsep2 = 0B;
  pname = 0B;
  mname = 0B;
  result = 0;
  if (procname == 0B) goto <D.12926>; else goto <D.12928>;
  <D.12928>:
  if (modulename == 0B) goto <D.12926>; else goto <D.12927>;
  <D.12926>:
  D.12929 = 0;
  return D.12929;
  <D.12927>:
  pname = mono_path_resolve_symlinks (procname);
  mname = mono_path_resolve_symlinks (modulename);
  D.12930 = strcmp (pname, mname);
  if (D.12930 == 0) goto <D.12931>; else goto <D.12932>;
  <D.12931>:
  result = 1;
  <D.12932>:
  if (result == 0) goto <D.12933>; else goto <D.12934>;
  <D.12933>:
  lastsep = strrchr (mname, 47);
  if (lastsep != 0B) goto <D.12935>; else goto <D.12936>;
  <D.12935>:
  D.12937 = lastsep + 1;
  D.12938 = strcmp (D.12937, pname);
  if (D.12938 == 0) goto <D.12939>; else goto <D.12940>;
  <D.12939>:
  result = 1;
  <D.12940>:
  <D.12936>:
  if (result == 0) goto <D.12941>; else goto <D.12942>;
  <D.12941>:
  lastsep2 = strrchr (pname, 47);
  if (lastsep2 != 0B) goto <D.12943>; else goto <D.12944>;
  <D.12943>:
  if (lastsep != 0B) goto <D.12945>; else goto <D.12946>;
  <D.12945>:
  D.12937 = lastsep + 1;
  D.12947 = lastsep2 + 1;
  D.12948 = strcmp (D.12937, D.12947);
  if (D.12948 == 0) goto <D.12949>; else goto <D.12950>;
  <D.12949>:
  result = 1;
  <D.12950>:
  goto <D.12951>;
  <D.12946>:
  D.12947 = lastsep2 + 1;
  D.12952 = strcmp (mname, D.12947);
  if (D.12952 == 0) goto <D.12953>; else goto <D.12954>;
  <D.12953>:
  result = 1;
  <D.12954>:
  <D.12951>:
  <D.12944>:
  <D.12942>:
  <D.12934>:
  monoeg_g_free (pname);
  monoeg_g_free (mname);
  D.12929 = result;
  return D.12929;
}


free_procmodule (struct WapiProcModule * mod)
{
  gchar * D.12956;
  gchar * D.12959;

  D.12956 = mod->perms;
  if (D.12956 != 0B) goto <D.12957>; else goto <D.12958>;
  <D.12957>:
  D.12956 = mod->perms;
  monoeg_g_free (D.12956);
  <D.12958>:
  D.12959 = mod->filename;
  if (D.12959 != 0B) goto <D.12960>; else goto <D.12961>;
  <D.12960>:
  D.12959 = mod->filename;
  monoeg_g_free (D.12959);
  <D.12961>:
  monoeg_g_free (mod);
}


GetModuleBaseName (void * process, void * module, gunichar2 * basename, guint32 size)
{
  guint32 D.12962;

  D.12962 = get_module_name (process, module, basename, size, 1);
  return D.12962;
}


get_module_name (void * process, void * module, gunichar2 * basename, guint32 size, gboolean base)
{
  guint32 D.12967;
  long int process.65;
  signed int D.12969;
  int D.12972;
  struct _WapiHandle_process * process_handle.66;
  gchar[256] * D.12977;
  int * D.12982;
  int D.12983;
  unsigned int i.67;
  gchar * D.12995;
  int D.12996;
  void * D.12998;
  unsigned int i.68;
  long unsigned int bytes.69;
  long unsigned int D.13010;
  long unsigned int bytes.70;
  long unsigned int D.13012;
  long unsigned int D.13015;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  pid_t pid;
  gunichar2 * procname;
  gchar * procname_ext;
  glong len;
  gsize bytes;
  struct FILE * fp;
  struct GSList * mods;
  struct WapiProcModule * found_module;
  guint32 count;
  int i;
  gchar * proc_name;

  try
    {
      procname_ext = 0B;
      mods = 0B;
      proc_name = 0B;
      mono_once (&process_current_once, process_set_current);
      size = size * 2;
      if (basename == 0B) goto <D.12964>; else goto <D.12966>;
      <D.12966>:
      if (size == 0) goto <D.12964>; else goto <D.12965>;
      <D.12964>:
      D.12967 = 0;
      return D.12967;
      <D.12965>:
      process.65 = (long int) process;
      D.12969 = (signed int) process.65;
      if (D.12969 < 0) goto <D.12970>; else goto <D.12971>;
      <D.12970>:
      process.65 = (long int) process;
      D.12972 = (int) process.65;
      pid = D.12972 & 2147483647;
      proc_name = get_process_name_from_proc (pid);
      goto <D.12973>;
      <D.12971>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.12974>; else goto <D.12975>;
      <D.12974>:
      D.12967 = 0;
      return D.12967;
      <D.12975>:
      process_handle.66 = process_handle;
      pid = process_handle.66->id;
      process_handle.66 = process_handle;
      D.12977 = &process_handle.66->proc_name;
      proc_name = monoeg_strdup (D.12977);
      <D.12973>:
      fp = open_process_map (pid, "r");
      if (fp == 0B) goto <D.12978>; else goto <D.12979>;
      <D.12978>:
      D.12982 = __errno_location ();
      D.12983 = *D.12982;
      if (D.12983 == 13) goto <D.12984>; else goto <D.12980>;
      <D.12984>:
      if (module == 0B) goto <D.12985>; else goto <D.12980>;
      <D.12985>:
      if (base == 1) goto <D.12986>; else goto <D.12980>;
      <D.12986>:
      procname_ext = get_process_name_from_proc (pid);
      goto <D.12981>;
      <D.12980>:
      monoeg_g_free (proc_name);
      D.12967 = 0;
      return D.12967;
      <D.12981>:
      goto <D.12987>;
      <D.12979>:
      mods = load_modules (fp);
      fclose (fp);
      count = monoeg_g_slist_length (mods);
      i = 0;
      goto <D.11677>;
      <D.11676>:
      i.67 = (unsigned int) i;
      found_module = monoeg_g_slist_nth_data (mods, i.67);
      if (procname_ext == 0B) goto <D.12992>; else goto <D.12993>;
      <D.12992>:
      if (module == 0B) goto <D.12994>; else goto <D.12989>;
      <D.12994>:
      D.12995 = found_module->filename;
      D.12996 = match_procname_to_modulename (proc_name, D.12995);
      if (D.12996 != 0) goto <D.12990>; else goto <D.12989>;
      <D.12989>:
      if (module != 0B) goto <D.12997>; else goto <D.12991>;
      <D.12997>:
      D.12998 = found_module->address_start;
      if (D.12998 == module) goto <D.12990>; else goto <D.12991>;
      <D.12990>:
      if (base != 0) goto <D.12999>; else goto <D.13000>;
      <D.12999>:
      D.12995 = found_module->filename;
      procname_ext = monoeg_g_path_get_basename (D.12995);
      goto <D.13001>;
      <D.13000>:
      D.12995 = found_module->filename;
      procname_ext = monoeg_strdup (D.12995);
      <D.13001>:
      <D.12991>:
      <D.12993>:
      free_procmodule (found_module);
      i = i + 1;
      <D.11677>:
      i.68 = (unsigned int) i;
      if (i.68 < count) goto <D.11676>; else goto <D.11678>;
      <D.11678>:
      if (procname_ext == 0B) goto <D.13003>; else goto <D.13004>;
      <D.13003>:
      procname_ext = get_process_name_from_proc (pid);
      <D.13004>:
      monoeg_g_slist_free (mods);
      monoeg_g_free (proc_name);
      <D.12987>:
      if (procname_ext != 0B) goto <D.13005>; else goto <D.13006>;
      <D.13005>:
      procname = mono_unicode_from_external (procname_ext, &bytes);
      if (procname == 0B) goto <D.13007>; else goto <D.13008>;
      <D.13007>:
      monoeg_g_free (procname_ext);
      D.12967 = 0;
      return D.12967;
      <D.13008>:
      bytes.69 = bytes;
      D.13010 = bytes.69 / 2;
      len = (glong) D.13010;
      bytes.69 = bytes;
      bytes.70 = bytes.69 + 2;
      bytes = bytes.70;
      D.13012 = (long unsigned int) size;
      bytes.69 = bytes;
      if (D.13012 < bytes.69) goto <D.13013>; else goto <D.13014>;
      <D.13013>:
      D.13015 = (long unsigned int) size;
      memcpy (basename, procname, D.13015);
      goto <D.13016>;
      <D.13014>:
      bytes.69 = bytes;
      memcpy (basename, procname, bytes.69);
      <D.13016>:
      monoeg_g_free (procname);
      monoeg_g_free (procname_ext);
      D.12967 = (guint32) len;
      return D.12967;
      <D.13006>:
      D.12967 = 0;
      return D.12967;
    }
  finally
    {
      process_handle = {CLOBBER};
      bytes = {CLOBBER};
    }
}


get_process_name_from_proc (pid_t pid)
{
  long int D.13019;
  gchar * D.13024;
  char * D.13027;
  char * D.13034;
  gchar * D.13039;
  long int end.71;
  long int start.72;
  long int D.13044;
  long int D.13045;
  long unsigned int D.13046;
  struct FILE * fp;
  gchar * filename;
  gchar buf[256];
  gchar * ret;

  try
    {
      filename = 0B;
      ret = 0B;
      memset (&buf, 0, 256);
      filename = monoeg_g_strdup_printf ("/proc/%d/exe", pid);
      D.13019 = readlink (filename, &buf, 255);
      if (D.13019 > 0) goto <D.13020>; else goto <D.13021>;
      <D.13020>:
      ret = monoeg_strdup (&buf);
      <D.13021>:
      monoeg_g_free (filename);
      if (ret != 0B) goto <D.13022>; else goto <D.13023>;
      <D.13022>:
      D.13024 = ret;
      return D.13024;
      <D.13023>:
      filename = monoeg_g_strdup_printf ("/proc/%d/cmdline", pid);
      fp = fopen (filename, "r");
      if (fp != 0B) goto <D.13025>; else goto <D.13026>;
      <D.13025>:
      D.13027 = fgets (&buf, 256, fp);
      if (D.13027 != 0B) goto <D.13028>; else goto <D.13029>;
      <D.13028>:
      ret = monoeg_strdup (&buf);
      <D.13029>:
      fclose (fp);
      <D.13026>:
      monoeg_g_free (filename);
      if (ret != 0B) goto <D.13030>; else goto <D.13031>;
      <D.13030>:
      D.13024 = ret;
      return D.13024;
      <D.13031>:
      filename = monoeg_g_strdup_printf ("/proc/%d/stat", pid);
      fp = fopen (filename, "r");
      if (fp != 0B) goto <D.13032>; else goto <D.13033>;
      <D.13032>:
      D.13034 = fgets (&buf, 256, fp);
      if (D.13034 != 0B) goto <D.13035>; else goto <D.13036>;
      <D.13035>:
      {
        gchar * start;
        gchar * end;

        start = __builtin_strchr (&buf, 40);
        if (start != 0B) goto <D.13037>; else goto <D.13038>;
        <D.13037>:
        D.13039 = start + 1;
        end = __builtin_strchr (D.13039, 41);
        if (end != 0B) goto <D.13040>; else goto <D.13041>;
        <D.13040>:
        D.13039 = start + 1;
        end.71 = (long int) end;
        start.72 = (long int) start;
        D.13044 = end.71 - start.72;
        D.13045 = D.13044 + -1;
        D.13046 = (long unsigned int) D.13045;
        ret = monoeg_g_strndup (D.13039, D.13046);
        <D.13041>:
        <D.13038>:
      }
      <D.13036>:
      fclose (fp);
      <D.13033>:
      monoeg_g_free (filename);
      D.13024 = ret;
      return D.13024;
    }
  finally
    {
      buf = {CLOBBER};
    }
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __leaf__, __nothrow__))
readlink (const char * restrict __path, char * restrict __buf, size_t __len)
{
  long unsigned int D.13049;
  int D.13052;
  ssize_t D.13055;
  long unsigned int D.13056;
  long unsigned int D.13057;
  long unsigned int D.13060;

  D.13049 = __builtin_object_size (__buf, 1);
  if (D.13049 != 18446744073709551615) goto <D.13050>; else goto <D.13051>;
  <D.13050>:
  D.13052 = __builtin_constant_p (__len);
  if (D.13052 == 0) goto <D.13053>; else goto <D.13054>;
  <D.13053>:
  D.13056 = __builtin_object_size (__buf, 1);
  D.13055 = __readlink_chk (__path, __buf, __len, D.13056);
  return D.13055;
  <D.13054>:
  D.13057 = __builtin_object_size (__buf, 1);
  if (D.13057 < __len) goto <D.13058>; else goto <D.13059>;
  <D.13058>:
  D.13060 = __builtin_object_size (__buf, 1);
  D.13055 = __readlink_chk_warn (__path, __buf, __len, D.13060);
  return D.13055;
  <D.13059>:
  <D.13051>:
  D.13055 = __readlink_alias (__path, __buf, __len);
  return D.13055;
}


GetModuleFileNameEx (void * process, void * module, gunichar2 * filename, guint32 size)
{
  guint32 D.13062;

  D.13062 = get_module_name (process, module, filename, size, 0);
  return D.13062;
}


GetModuleInformation (void * process, void * module, struct WapiModuleInfo * modinfo, guint32 size)
{
  gboolean D.13067;
  long int process.73;
  signed int D.13069;
  int D.13072;
  struct _WapiHandle_process * process_handle.74;
  gchar[256] * D.13077;
  unsigned int i.75;
  gchar * D.13087;
  int D.13088;
  void * D.13090;
  void * D.13091;
  long unsigned int D.13092;
  long unsigned int D.13093;
  long unsigned int D.13094;
  unsigned int D.13095;
  void * D.13096;
  unsigned int i.76;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  pid_t pid;
  struct FILE * fp;
  struct GSList * mods;
  struct WapiProcModule * found_module;
  guint32 count;
  int i;
  gboolean ret;
  gchar * proc_name;

  try
    {
      mods = 0B;
      ret = 0;
      proc_name = 0B;
      mono_once (&process_current_once, process_set_current);
      if (modinfo == 0B) goto <D.13064>; else goto <D.13066>;
      <D.13066>:
      if (size <= 23) goto <D.13064>; else goto <D.13065>;
      <D.13064>:
      D.13067 = 0;
      return D.13067;
      <D.13065>:
      process.73 = (long int) process;
      D.13069 = (signed int) process.73;
      if (D.13069 < 0) goto <D.13070>; else goto <D.13071>;
      <D.13070>:
      process.73 = (long int) process;
      D.13072 = (int) process.73;
      pid = D.13072 & 2147483647;
      proc_name = get_process_name_from_proc (pid);
      goto <D.13073>;
      <D.13071>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.13074>; else goto <D.13075>;
      <D.13074>:
      D.13067 = 0;
      return D.13067;
      <D.13075>:
      process_handle.74 = process_handle;
      pid = process_handle.74->id;
      process_handle.74 = process_handle;
      D.13077 = &process_handle.74->proc_name;
      proc_name = monoeg_strdup (D.13077);
      <D.13073>:
      fp = open_process_map (pid, "r");
      if (fp == 0B) goto <D.13078>; else goto <D.13079>;
      <D.13078>:
      monoeg_g_free (proc_name);
      D.13067 = 0;
      return D.13067;
      <D.13079>:
      mods = load_modules (fp);
      fclose (fp);
      count = monoeg_g_slist_length (mods);
      i = 0;
      goto <D.11708>;
      <D.11707>:
      i.75 = (unsigned int) i;
      found_module = monoeg_g_slist_nth_data (mods, i.75);
      if (ret == 0) goto <D.13084>; else goto <D.13085>;
      <D.13084>:
      if (module == 0B) goto <D.13086>; else goto <D.13081>;
      <D.13086>:
      D.13087 = found_module->filename;
      D.13088 = match_procname_to_modulename (proc_name, D.13087);
      if (D.13088 != 0) goto <D.13082>; else goto <D.13081>;
      <D.13081>:
      if (module != 0B) goto <D.13089>; else goto <D.13083>;
      <D.13089>:
      D.13090 = found_module->address_start;
      if (D.13090 == module) goto <D.13082>; else goto <D.13083>;
      <D.13082>:
      D.13090 = found_module->address_start;
      modinfo->lpBaseOfDll = D.13090;
      D.13091 = found_module->address_end;
      D.13092 = (long unsigned int) D.13091;
      D.13090 = found_module->address_start;
      D.13093 = (long unsigned int) D.13090;
      D.13094 = D.13092 - D.13093;
      D.13095 = (unsigned int) D.13094;
      modinfo->SizeOfImage = D.13095;
      D.13096 = found_module->address_offset;
      modinfo->EntryPoint = D.13096;
      ret = 1;
      <D.13083>:
      <D.13085>:
      free_procmodule (found_module);
      i = i + 1;
      <D.11708>:
      i.76 = (unsigned int) i;
      if (i.76 < count) goto <D.11707>; else goto <D.11709>;
      <D.11709>:
      monoeg_g_slist_free (mods);
      monoeg_g_free (proc_name);
      D.13067 = ret;
      return D.13067;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


GetProcessWorkingSetSize (void * process, size_t * min, size_t * max)
{
  gboolean D.13103;
  long int process.77;
  signed int D.13105;
  struct _WapiHandle_process * process_handle.78;
  long unsigned int D.13111;
  long unsigned int D.13112;
  struct _WapiHandle_process * process_handle;
  gboolean ok;

  try
    {
      mono_once (&process_current_once, process_set_current);
      if (min == 0B) goto <D.13100>; else goto <D.13102>;
      <D.13102>:
      if (max == 0B) goto <D.13100>; else goto <D.13101>;
      <D.13100>:
      D.13103 = 0;
      return D.13103;
      <D.13101>:
      process.77 = (long int) process;
      D.13105 = (signed int) process.77;
      if (D.13105 < 0) goto <D.13106>; else goto <D.13107>;
      <D.13106>:
      D.13103 = 0;
      return D.13103;
      <D.13107>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.13108>; else goto <D.13109>;
      <D.13108>:
      D.13103 = 0;
      return D.13103;
      <D.13109>:
      process_handle.78 = process_handle;
      D.13111 = process_handle.78->min_working_set;
      *min = D.13111;
      process_handle.78 = process_handle;
      D.13112 = process_handle.78->max_working_set;
      *max = D.13112;
      D.13103 = 1;
      return D.13103;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


SetProcessWorkingSetSize (void * process, size_t min, size_t max)
{
  long int process.79;
  signed int D.13116;
  gboolean D.13119;
  struct _WapiHandle_process * process_handle.80;
  struct _WapiHandle_process * process_handle;
  gboolean ok;

  try
    {
      mono_once (&process_current_once, process_set_current);
      process.79 = (long int) process;
      D.13116 = (signed int) process.79;
      if (D.13116 < 0) goto <D.13117>; else goto <D.13118>;
      <D.13117>:
      D.13119 = 0;
      return D.13119;
      <D.13118>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.13120>; else goto <D.13121>;
      <D.13120>:
      D.13119 = 0;
      return D.13119;
      <D.13121>:
      process_handle.80 = process_handle;
      process_handle.80->min_working_set = min;
      process_handle.80 = process_handle;
      process_handle.80->max_working_set = max;
      D.13119 = 1;
      return D.13119;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


TerminateProcess (void * process, gint32 exitCode)
{
  long int process.81;
  signed int D.13126;
  int D.13129;
  gboolean D.13133;
  struct _WapiHandle_process * process_handle.82;
  int iftmp.83;
  int * D.13141;
  int D.13142;
  _Bool D.13143;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  int signo;
  int ret;
  pid_t pid;

  try
    {
      process.81 = (long int) process;
      D.13126 = (signed int) process.81;
      if (D.13126 < 0) goto <D.13127>; else goto <D.13128>;
      <D.13127>:
      process.81 = (long int) process;
      D.13129 = (int) process.81;
      pid = D.13129 & 2147483647;
      goto <D.13130>;
      <D.13128>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.13131>; else goto <D.13132>;
      <D.13131>:
      SetLastError (6);
      D.13133 = 0;
      return D.13133;
      <D.13132>:
      process_handle.82 = process_handle;
      pid = process_handle.82->id;
      <D.13130>:
      if (exitCode == -1) goto <D.13136>; else goto <D.13137>;
      <D.13136>:
      iftmp.83 = 9;
      goto <D.13138>;
      <D.13137>:
      iftmp.83 = 15;
      <D.13138>:
      signo = iftmp.83;
      ret = kill (pid, signo);
      if (ret == -1) goto <D.13139>; else goto <D.13140>;
      <D.13139>:
      D.13141 = __errno_location ();
      D.13142 = *D.13141;
      switch (D.13142) <default: <D.11737>, case 1: <D.11735>, case 3: <D.11736>, case 22: <D.11733>>
      <D.11733>:
      SetLastError (87);
      goto <D.11734>;
      <D.11735>:
      SetLastError (5);
      goto <D.11734>;
      <D.11736>:
      SetLastError (127);
      goto <D.11734>;
      <D.11737>:
      SetLastError (31);
      <D.11734>:
      <D.13140>:
      D.13143 = ret == 0;
      D.13133 = (gboolean) D.13143;
      return D.13133;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


GetPriorityClass (void * process)
{
  long int process.84;
  signed int D.13147;
  int D.13150;
  guint32 D.13154;
  struct _WapiHandle_process * process_handle.85;
  int * D.13156;
  unsigned int pid.86;
  int D.13160;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  int ret;
  pid_t pid;

  try
    {
      process.84 = (long int) process;
      D.13147 = (signed int) process.84;
      if (D.13147 < 0) goto <D.13148>; else goto <D.13149>;
      <D.13148>:
      process.84 = (long int) process;
      D.13150 = (int) process.84;
      pid = D.13150 & 2147483647;
      goto <D.13151>;
      <D.13149>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.13152>; else goto <D.13153>;
      <D.13152>:
      SetLastError (6);
      D.13154 = 0;
      return D.13154;
      <D.13153>:
      process_handle.85 = process_handle;
      pid = process_handle.85->id;
      <D.13151>:
      D.13156 = __errno_location ();
      *D.13156 = 0;
      pid.86 = (unsigned int) pid;
      ret = getpriority (0, pid.86);
      if (ret == -1) goto <D.13158>; else goto <D.13159>;
      <D.13158>:
      D.13156 = __errno_location ();
      D.13160 = *D.13156;
      if (D.13160 != 0) goto <D.13161>; else goto <D.13162>;
      <D.13161>:
      D.13156 = __errno_location ();
      D.13160 = *D.13156;
      switch (D.13160) <default: <D.11749>, case 1: <D.11745>, case 3: <D.11748>, case 13: <D.11746>>
      <D.11745>:
      <D.11746>:
      SetLastError (5);
      goto <D.11747>;
      <D.11748>:
      SetLastError (127);
      goto <D.11747>;
      <D.11749>:
      SetLastError (31);
      <D.11747>:
      D.13154 = 0;
      return D.13154;
      <D.13162>:
      <D.13159>:
      if (ret == 0) goto <D.13163>; else goto <D.13164>;
      <D.13163>:
      D.13154 = 32;
      return D.13154;
      <D.13164>:
      if (ret < -15) goto <D.13165>; else goto <D.13166>;
      <D.13165>:
      D.13154 = 256;
      return D.13154;
      <D.13166>:
      if (ret < -10) goto <D.13167>; else goto <D.13168>;
      <D.13167>:
      D.13154 = 128;
      return D.13154;
      <D.13168>:
      if (ret < 0) goto <D.13169>; else goto <D.13170>;
      <D.13169>:
      D.13154 = 32768;
      return D.13154;
      <D.13170>:
      if (ret > 10) goto <D.13171>; else goto <D.13172>;
      <D.13171>:
      D.13154 = 64;
      return D.13154;
      <D.13172>:
      if (ret > 0) goto <D.13173>; else goto <D.13174>;
      <D.13173>:
      D.13154 = 16384;
      return D.13154;
      <D.13174>:
      D.13154 = 32;
      return D.13154;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


SetPriorityClass (void * process, guint32 priority_class)
{
  long int process.87;
  signed int D.13178;
  int D.13181;
  gboolean D.13185;
  struct _WapiHandle_process * process_handle.88;
  unsigned int pid.89;
  int * D.13190;
  int D.13191;
  _Bool D.13192;
  struct _WapiHandle_process * process_handle;
  gboolean ok;
  int ret;
  int prio;
  pid_t pid;

  try
    {
      process.87 = (long int) process;
      D.13178 = (signed int) process.87;
      if (D.13178 < 0) goto <D.13179>; else goto <D.13180>;
      <D.13179>:
      process.87 = (long int) process;
      D.13181 = (int) process.87;
      pid = D.13181 & 2147483647;
      goto <D.13182>;
      <D.13180>:
      ok = _wapi_lookup_handle (process, 9, &process_handle);
      if (ok == 0) goto <D.13183>; else goto <D.13184>;
      <D.13183>:
      SetLastError (6);
      D.13185 = 0;
      return D.13185;
      <D.13184>:
      process_handle.88 = process_handle;
      pid = process_handle.88->id;
      <D.13182>:
      switch (priority_class) <default: <D.11766>, case 32: <D.11762>, case 64: <D.11759>, case 128: <D.11764>, case 256: <D.11765>, case 16384: <D.11761>, case 32768: <D.11763>>
      <D.11759>:
      prio = 19;
      goto <D.11760>;
      <D.11761>:
      prio = 10;
      goto <D.11760>;
      <D.11762>:
      prio = 0;
      goto <D.11760>;
      <D.11763>:
      prio = -5;
      goto <D.11760>;
      <D.11764>:
      prio = -11;
      goto <D.11760>;
      <D.11765>:
      prio = -20;
      goto <D.11760>;
      <D.11766>:
      SetLastError (87);
      D.13185 = 0;
      return D.13185;
      <D.11760>:
      pid.89 = (unsigned int) pid;
      ret = setpriority (0, pid.89, prio);
      if (ret == -1) goto <D.13188>; else goto <D.13189>;
      <D.13188>:
      D.13190 = __errno_location ();
      D.13191 = *D.13190;
      switch (D.13191) <default: <D.11771>, case 1: <D.11767>, case 3: <D.11770>, case 13: <D.11768>>
      <D.11767>:
      <D.11768>:
      SetLastError (5);
      goto <D.11769>;
      <D.11770>:
      SetLastError (127);
      goto <D.11769>;
      <D.11771>:
      SetLastError (31);
      <D.11769>:
      <D.13189>:
      D.13192 = ret == 0;
      D.13185 = (gboolean) D.13192;
      return D.13185;
    }
  finally
    {
      process_handle = {CLOBBER};
    }
}


