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

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


monoeg_g_setenv (const gchar * variable, const gchar * value, gboolean overwrite)
{
  gboolean D.6188;
  int D.6189;
  _Bool D.6190;

  D.6189 = setenv (variable, value, overwrite);
  D.6190 = D.6189 == 0;
  D.6188 = (gboolean) D.6190;
  return D.6188;
}


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


monoeg_g_win32_getlocale ()
{
  gchar * D.6192;

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


monoeg_g_path_is_absolute (const char * filename)
{
  gboolean D.6196;
  char D.6197;
  _Bool D.6198;

  if (filename == 0B) goto <D.6194>; else goto <D.6195>;
  <D.6194>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gmisc-unix.c", 70, "filename != NULL");
  D.6196 = 0;
  return D.6196;
  <D.6195>:
  D.6197 = *filename;
  D.6198 = D.6197 == 47;
  D.6196 = (gboolean) D.6198;
  return D.6196;
}


monoeg_g_get_home_dir ()
{
  const gchar * D.6200;

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


get_pw_data ()
{
  const gchar * user_name.0;
  unsigned int D.6207;
  int D.6208;
  char * D.6211;
  gchar * home_dir.1;
  char * D.6213;
  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.6203>; else goto <D.6204>;
      <D.6203>:
      return;
      <D.6204>:
      pthread_mutex_lock (&pw_lock);
      user_name.0 = user_name;
      if (user_name.0 != 0B) goto <D.6205>; else goto <D.6206>;
      <D.6205>:
      pthread_mutex_unlock (&pw_lock);
      return;
      <D.6206>:
      D.6207 = getuid ();
      D.6208 = getpwuid_r (D.6207, &pw, &buf, 4096, &result);
      if (D.6208 == 0) goto <D.6209>; else goto <D.6210>;
      <D.6209>:
      D.6211 = pw.pw_dir;
      home_dir.1 = monoeg_strdup (D.6211);
      home_dir = home_dir.1;
      D.6213 = pw.pw_name;
      user_name.2 = monoeg_strdup (D.6213);
      user_name = user_name.2;
      <D.6210>:
      home_dir.3 = home_dir;
      if (home_dir.3 == 0B) goto <D.6216>; else goto <D.6217>;
      <D.6216>:
      home_dir.4 = monoeg_g_getenv ("HOME");
      home_dir = home_dir.4;
      <D.6217>:
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.6219>; else goto <D.6220>;
      <D.6219>:
      user_name.5 = monoeg_g_getenv ("USER");
      user_name = user_name.5;
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.6222>; else goto <D.6223>;
      <D.6222>:
      user_name = "somebody";
      <D.6223>:
      <D.6220>:
      pthread_mutex_unlock (&pw_lock);
    }
  finally
    {
      pw = {CLOBBER};
      result = {CLOBBER};
      buf = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.6227>; else goto <D.6228>;
  <D.6227>:
  D.6229 = __strdup (str);
  return D.6229;
  <D.6228>:
  D.6229 = 0B;
  return D.6229;
}


monoeg_g_get_user_name ()
{
  const gchar * D.6231;

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


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.6247;

  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6234>; else goto <D.6235>;
  <D.6234>:
  pthread_mutex_lock (&tmp_lock);
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6236>; else goto <D.6237>;
  <D.6236>:
  tmp_dir.7 = monoeg_g_getenv ("TMPDIR");
  tmp_dir = tmp_dir.7;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6239>; else goto <D.6240>;
  <D.6239>:
  tmp_dir.8 = monoeg_g_getenv ("TMP");
  tmp_dir = tmp_dir.8;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6242>; else goto <D.6243>;
  <D.6242>:
  tmp_dir.9 = monoeg_g_getenv ("TEMP");
  tmp_dir = tmp_dir.9;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6245>; else goto <D.6246>;
  <D.6245>:
  tmp_dir = "/tmp";
  <D.6246>:
  <D.6243>:
  <D.6240>:
  <D.6237>:
  pthread_mutex_unlock (&tmp_lock);
  <D.6235>:
  D.6247 = tmp_dir;
  return D.6247;
}


