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

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


monoeg_g_setenv (const gchar * variable, const gchar * value, gboolean overwrite)
{
  gboolean D.6216;
  int D.6217;
  _Bool D.6218;

  D.6217 = setenv (variable, value, overwrite);
  D.6218 = D.6217 == 0;
  D.6216 = (gboolean) D.6218;
  return D.6216;
}


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


monoeg_g_win32_getlocale ()
{
  gchar * D.6220;

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


monoeg_g_path_is_absolute (const char * filename)
{
  gboolean D.6224;
  char D.6225;
  _Bool D.6226;

  if (filename == 0B) goto <D.6222>; else goto <D.6223>;
  <D.6222>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gmisc-unix.c", 70, "filename != NULL");
  D.6224 = 0;
  return D.6224;
  <D.6223>:
  D.6225 = *filename;
  D.6226 = D.6225 == 47;
  D.6224 = (gboolean) D.6226;
  return D.6224;
}


monoeg_g_get_home_dir ()
{
  const gchar * D.6228;

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


get_pw_data ()
{
  const gchar * user_name.0;
  unsigned int D.6235;
  int D.6236;
  char * D.6239;
  gchar * home_dir.1;
  char * D.6241;
  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.6231>; else goto <D.6232>;
      <D.6231>:
      return;
      <D.6232>:
      pthread_mutex_lock (&pw_lock);
      user_name.0 = user_name;
      if (user_name.0 != 0B) goto <D.6233>; else goto <D.6234>;
      <D.6233>:
      pthread_mutex_unlock (&pw_lock);
      return;
      <D.6234>:
      D.6235 = getuid ();
      D.6236 = getpwuid_r (D.6235, &pw, &buf, 4096, &result);
      if (D.6236 == 0) goto <D.6237>; else goto <D.6238>;
      <D.6237>:
      D.6239 = pw.pw_dir;
      home_dir.1 = monoeg_strdup (D.6239);
      home_dir = home_dir.1;
      D.6241 = pw.pw_name;
      user_name.2 = monoeg_strdup (D.6241);
      user_name = user_name.2;
      <D.6238>:
      home_dir.3 = home_dir;
      if (home_dir.3 == 0B) goto <D.6244>; else goto <D.6245>;
      <D.6244>:
      home_dir.4 = monoeg_g_getenv ("HOME");
      home_dir = home_dir.4;
      <D.6245>:
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.6247>; else goto <D.6248>;
      <D.6247>:
      user_name.5 = monoeg_g_getenv ("USER");
      user_name = user_name.5;
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.6250>; else goto <D.6251>;
      <D.6250>:
      user_name = "somebody";
      <D.6251>:
      <D.6248>:
      pthread_mutex_unlock (&pw_lock);
    }
  finally
    {
      pw = {CLOBBER};
      result = {CLOBBER};
      buf = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.6255>; else goto <D.6256>;
  <D.6255>:
  D.6257 = __strdup (str);
  return D.6257;
  <D.6256>:
  D.6257 = 0B;
  return D.6257;
}


monoeg_g_get_user_name ()
{
  const gchar * D.6259;

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


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

  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6262>; else goto <D.6263>;
  <D.6262>:
  pthread_mutex_lock (&tmp_lock);
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6264>; else goto <D.6265>;
  <D.6264>:
  tmp_dir.7 = monoeg_g_getenv ("TMPDIR");
  tmp_dir = tmp_dir.7;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6267>; else goto <D.6268>;
  <D.6267>:
  tmp_dir.8 = monoeg_g_getenv ("TMP");
  tmp_dir = tmp_dir.8;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6270>; else goto <D.6271>;
  <D.6270>:
  tmp_dir.9 = monoeg_g_getenv ("TEMP");
  tmp_dir = tmp_dir.9;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6273>; else goto <D.6274>;
  <D.6273>:
  tmp_dir = "/tmp";
  <D.6274>:
  <D.6271>:
  <D.6268>:
  <D.6265>:
  pthread_mutex_unlock (&tmp_lock);
  <D.6263>:
  D.6275 = tmp_dir;
  return D.6275;
}


