monoeg_g_getenv (const gchar * variable)
{
  const gchar * D.8798;

  D.8798 = getenv (variable);
  return D.8798;
}


monoeg_g_setenv (const gchar * variable, const gchar * value, gboolean overwrite)
{
  gboolean D.8800;
  int D.8801;
  _Bool D.8802;

  D.8801 = setenv (variable, value, overwrite);
  D.8802 = D.8801 == 0;
  D.8800 = (gboolean) D.8802;
  return D.8800;
}


monoeg_g_unsetenv (const gchar * variable)
{
  unsetenv (variable);
}


monoeg_g_win32_getlocale ()
{
  gchar * D.8804;

  D.8804 = 0B;
  return D.8804;
}


monoeg_g_path_is_absolute (const char * filename)
{
  gboolean D.8808;
  char D.8809;
  _Bool D.8810;

  if (filename == 0B) goto <D.8806>; else goto <D.8807>;
  <D.8806>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gmisc-unix.c", 70, "filename != NULL");
  D.8808 = 0;
  return D.8808;
  <D.8807>:
  D.8809 = *filename;
  D.8810 = D.8809 == 47;
  D.8808 = (gboolean) D.8810;
  return D.8808;
}


monoeg_g_get_home_dir ()
{
  const gchar * D.8812;

  get_pw_data ();
  D.8812 = home_dir;
  return D.8812;
}


get_pw_data ()
{
  const gchar * user_name.0;
  unsigned int D.8819;
  int D.8820;
  char * D.8823;
  gchar * home_dir.1;
  char * D.8825;
  gchar * user_name.2;
  const gchar * home_dir.3;
  const gchar * home_dir.4;
  const gchar * user_name.5;
  struct passwd pw;
  struct passwd * result;
  char buf[4096];

  try
    {
      user_name.0 = user_name;
      if (user_name.0 != 0B) goto <D.8815>; else goto <D.8816>;
      <D.8815>:
      return;
      <D.8816>:
      pthread_mutex_lock (&pw_lock);
      user_name.0 = user_name;
      if (user_name.0 != 0B) goto <D.8817>; else goto <D.8818>;
      <D.8817>:
      pthread_mutex_unlock (&pw_lock);
      return;
      <D.8818>:
      D.8819 = getuid ();
      D.8820 = getpwuid_r (D.8819, &pw, &buf, 4096, &result);
      if (D.8820 == 0) goto <D.8821>; else goto <D.8822>;
      <D.8821>:
      D.8823 = pw.pw_dir;
      home_dir.1 = monoeg_strdup (D.8823);
      home_dir = home_dir.1;
      D.8825 = pw.pw_name;
      user_name.2 = monoeg_strdup (D.8825);
      user_name = user_name.2;
      <D.8822>:
      home_dir.3 = home_dir;
      if (home_dir.3 == 0B) goto <D.8828>; else goto <D.8829>;
      <D.8828>:
      home_dir.4 = monoeg_g_getenv ("HOME");
      home_dir = home_dir.4;
      <D.8829>:
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.8831>; else goto <D.8832>;
      <D.8831>:
      user_name.5 = monoeg_g_getenv ("USER");
      user_name = user_name.5;
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.8834>; else goto <D.8835>;
      <D.8834>:
      user_name = "somebody";
      <D.8835>:
      <D.8832>:
      pthread_mutex_unlock (&pw_lock);
    }
  finally
    {
      pw = {CLOBBER};
      result = {CLOBBER};
      buf = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.8839>; else goto <D.8840>;
  <D.8839>:
  D.8841 = __strdup (str);
  return D.8841;
  <D.8840>:
  D.8841 = 0B;
  return D.8841;
}


monoeg_g_get_user_name ()
{
  const gchar * D.8843;

  get_pw_data ();
  D.8843 = user_name;
  return D.8843;
}


monoeg_g_get_tmp_dir ()
{
  const char * tmp_dir.6;
  const gchar * tmp_dir.7;
  const gchar * tmp_dir.8;
  const gchar * tmp_dir.9;
  const gchar * D.8859;

  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.8846>; else goto <D.8847>;
  <D.8846>:
  pthread_mutex_lock (&tmp_lock);
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.8848>; else goto <D.8849>;
  <D.8848>:
  tmp_dir.7 = monoeg_g_getenv ("TMPDIR");
  tmp_dir = tmp_dir.7;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.8851>; else goto <D.8852>;
  <D.8851>:
  tmp_dir.8 = monoeg_g_getenv ("TMP");
  tmp_dir = tmp_dir.8;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.8854>; else goto <D.8855>;
  <D.8854>:
  tmp_dir.9 = monoeg_g_getenv ("TEMP");
  tmp_dir = tmp_dir.9;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.8857>; else goto <D.8858>;
  <D.8857>:
  tmp_dir = "/tmp";
  <D.8858>:
  <D.8855>:
  <D.8852>:
  <D.8849>:
  pthread_mutex_unlock (&tmp_lock);
  <D.8847>:
  D.8859 = tmp_dir;
  return D.8859;
}


