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

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


monoeg_g_setenv (const gchar * variable, const gchar * value, gboolean overwrite)
{
  gboolean D.6538;
  int D.6539;
  _Bool D.6540;

  D.6539 = setenv (variable, value, overwrite);
  D.6540 = D.6539 == 0;
  D.6538 = (gboolean) D.6540;
  return D.6538;
}


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


monoeg_g_win32_getlocale ()
{
  gchar * D.6542;

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


monoeg_g_path_is_absolute (const char * filename)
{
  gboolean D.6546;
  char D.6547;
  _Bool D.6548;

  if (filename == 0B) goto <D.6544>; else goto <D.6545>;
  <D.6544>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gmisc-unix.c", 70, "filename != NULL");
  D.6546 = 0;
  return D.6546;
  <D.6545>:
  D.6547 = *filename;
  D.6548 = D.6547 == 47;
  D.6546 = (gboolean) D.6548;
  return D.6546;
}


monoeg_g_get_home_dir ()
{
  const gchar * D.6550;

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


get_pw_data ()
{
  const gchar * user_name.0;
  unsigned int D.6557;
  int D.6558;
  char * D.6561;
  gchar * home_dir.1;
  char * D.6563;
  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.6553>; else goto <D.6554>;
      <D.6553>:
      return;
      <D.6554>:
      pthread_mutex_lock (&pw_lock);
      user_name.0 = user_name;
      if (user_name.0 != 0B) goto <D.6555>; else goto <D.6556>;
      <D.6555>:
      pthread_mutex_unlock (&pw_lock);
      return;
      <D.6556>:
      D.6557 = getuid ();
      D.6558 = getpwuid_r (D.6557, &pw, &buf, 4096, &result);
      if (D.6558 == 0) goto <D.6559>; else goto <D.6560>;
      <D.6559>:
      D.6561 = pw.pw_dir;
      home_dir.1 = monoeg_strdup (D.6561);
      home_dir = home_dir.1;
      D.6563 = pw.pw_name;
      user_name.2 = monoeg_strdup (D.6563);
      user_name = user_name.2;
      <D.6560>:
      home_dir.3 = home_dir;
      if (home_dir.3 == 0B) goto <D.6566>; else goto <D.6567>;
      <D.6566>:
      home_dir.4 = monoeg_g_getenv ("HOME");
      home_dir = home_dir.4;
      <D.6567>:
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.6569>; else goto <D.6570>;
      <D.6569>:
      user_name.5 = monoeg_g_getenv ("USER");
      user_name = user_name.5;
      user_name.0 = user_name;
      if (user_name.0 == 0B) goto <D.6572>; else goto <D.6573>;
      <D.6572>:
      user_name = "somebody";
      <D.6573>:
      <D.6570>:
      pthread_mutex_unlock (&pw_lock);
    }
  finally
    {
      pw = {CLOBBER};
      result = {CLOBBER};
      buf = {CLOBBER};
    }
}


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

  if (str != 0B) goto <D.6577>; else goto <D.6578>;
  <D.6577>:
  D.6579 = __strdup (str);
  return D.6579;
  <D.6578>:
  D.6579 = 0B;
  return D.6579;
}


monoeg_g_get_user_name ()
{
  const gchar * D.6581;

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


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

  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6584>; else goto <D.6585>;
  <D.6584>:
  pthread_mutex_lock (&tmp_lock);
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6586>; else goto <D.6587>;
  <D.6586>:
  tmp_dir.7 = monoeg_g_getenv ("TMPDIR");
  tmp_dir = tmp_dir.7;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6589>; else goto <D.6590>;
  <D.6589>:
  tmp_dir.8 = monoeg_g_getenv ("TMP");
  tmp_dir = tmp_dir.8;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6592>; else goto <D.6593>;
  <D.6592>:
  tmp_dir.9 = monoeg_g_getenv ("TEMP");
  tmp_dir = tmp_dir.9;
  tmp_dir.6 = tmp_dir;
  if (tmp_dir.6 == 0B) goto <D.6595>; else goto <D.6596>;
  <D.6595>:
  tmp_dir = "/tmp";
  <D.6596>:
  <D.6593>:
  <D.6590>:
  <D.6587>:
  pthread_mutex_unlock (&tmp_lock);
  <D.6585>:
  D.6597 = tmp_dir;
  return D.6597;
}


