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

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


monoeg_g_setenv (const gchar * variable, const gchar * value, gboolean overwrite)
{
  gboolean D.7052;
  int D.7053;
  _Bool D.7054;

  D.7053 = setenv (variable, value, overwrite);
  D.7054 = D.7053 == 0;
  D.7052 = (gboolean) D.7054;
  return D.7052;
}


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


monoeg_g_win32_getlocale ()
{
  gchar * D.7056;

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


monoeg_g_path_is_absolute (const char * filename)
{
  gboolean D.7060;
  char D.7061;
  _Bool D.7062;

  if (filename == 0B) goto <D.7058>; else goto <D.7059>;
  <D.7058>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gmisc-unix.c", 70, "filename != NULL");
  D.7060 = 0;
  return D.7060;
  <D.7059>:
  D.7061 = *filename;
  D.7062 = D.7061 == 47;
  D.7060 = (gboolean) D.7062;
  return D.7060;
}


monoeg_g_get_home_dir ()
{
  const gchar * D.7064;

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


get_pw_data ()
{
  const gchar * user_name.0;
  unsigned int D.7071;
  int D.7072;
  char * D.7075;
  gchar * home_dir.1;
  char * D.7077;
  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.7067>; else goto <D.7068>;
      <D.7067>:
      return;
      <D.7068>:
      pthread_mutex_lock (&pw_lock);
      user_name.0 = user_name;
      if (user_name.0 != 0B) goto <D.7069>; else goto <D.7070>;
      <D.7069>:
      pthread_mutex_unlock (&pw_lock);
      return;
      <D.7070>:
      D.7071 = getuid ();
      D.7072 = getpwuid_r (D.7071, &pw, &buf, 4096, &result);
      if (D.7072 == 0) goto <D.7073>; else goto <D.7074>;
      <D.7073>:
      D.7075 = pw.pw_dir;
      home_dir.1 = monoeg_strdup (D.7075);
      home_dir = home_dir.1;
      D.7077 = pw.pw_name;
      user_name.2 = monoeg_strdup (D.7077);
      user_name = user_name.2;
      <D.7074>:
      home_dir.3 = home_dir;
      if (home_dir.3 == 0B) goto <D.7080>; else goto <D.7081>;
      <D.7080>:
      home_dir.4 = monoeg_g_getenv ("HOME");
      home_dir = home_dir.4;
      <D.7081>:
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.7083>; else goto <D.7084>;
      <D.7083>:
      user_name.5 = monoeg_g_getenv ("USER");
      user_name = user_name.5;
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.7086>; else goto <D.7087>;
      <D.7086>:
      user_name = "somebody";
      <D.7087>:
      <D.7084>:
      pthread_mutex_unlock (&pw_lock);
    }
  finally
    {
      pw = {CLOBBER};
      result = {CLOBBER};
      buf = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.7091>; else goto <D.7092>;
  <D.7091>:
  D.7093 = __strdup (str);
  return D.7093;
  <D.7092>:
  D.7093 = 0B;
  return D.7093;
}


monoeg_g_get_user_name ()
{
  const gchar * D.7095;

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


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

  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.7098>; else goto <D.7099>;
  <D.7098>:
  pthread_mutex_lock (&tmp_lock);
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.7100>; else goto <D.7101>;
  <D.7100>:
  tmp_dir.7 = monoeg_g_getenv ("TMPDIR");
  tmp_dir = tmp_dir.7;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.7103>; else goto <D.7104>;
  <D.7103>:
  tmp_dir.8 = monoeg_g_getenv ("TMP");
  tmp_dir = tmp_dir.8;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.7106>; else goto <D.7107>;
  <D.7106>:
  tmp_dir.9 = monoeg_g_getenv ("TEMP");
  tmp_dir = tmp_dir.9;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.7109>; else goto <D.7110>;
  <D.7109>:
  tmp_dir = "/tmp";
  <D.7110>:
  <D.7107>:
  <D.7104>:
  <D.7101>:
  pthread_mutex_unlock (&tmp_lock);
  <D.7099>:
  D.7111 = tmp_dir;
  return D.7111;
}


