test_spawn_sync ()
{
  int D.5865;
  gchar * D.5868;
  int status.0;
  gchar * out.1;
  char D.5876;
  gchar * err.2;
  gchar * out;
  gchar * err;
  gint status;
  struct GError * error;

  try
    {
      status = -1;
      error = 0B;
      D.5865 = monoeg_g_spawn_command_line_sync ("ls", &out, &err, &status, &error);
      if (D.5865 == 0) goto <D.5866>; else goto <D.5867>;
      <D.5866>:
      D.5868 = FAILED ("Error executing \'ls\'");
      return D.5868;
      <D.5867>:
      status.0 = status;
      if (status.0 != 0) goto <D.5870>; else goto <D.5871>;
      <D.5870>:
      status.0 = status;
      D.5868 = FAILED ("Status is %d", status.0);
      return D.5868;
      <D.5871>:
      out.1 = out;
      if (out.1 == 0B) goto <D.5872>; else goto <D.5875>;
      <D.5875>:
      out.1 = out;
      D.5876 = MEM[(const char *)out.1];
      if (D.5876 == 0) goto <D.5872>; else goto <D.5873>;
      <D.5872>:
      D.5868 = FAILED ("Didn\'t get any output from ls!?");
      return D.5868;
      <D.5873>:
      out.1 = out;
      monoeg_g_free (out.1);
      err.2 = err;
      monoeg_g_free (err.2);
      D.5868 = 0B;
      return D.5868;
    }
  finally
    {
      out = {CLOBBER};
      err = {CLOBBER};
      status = {CLOBBER};
      error = {CLOBBER};
    }
}


test_spawn_async ()
{
  int D.5880;
  gchar * D.5883;
  int child_pid.3;
  int stdout_fd.4;
  long int D.5890;
  char * argv[15];
  int stdout_fd;
  char buffer[512];
  pid_t child_pid;

  try
    {
      stdout_fd = -1;
      child_pid = 0;
      memset (&argv, 0, 120);
      argv[0] = "ls";
      D.5880 = monoeg_g_spawn_async_with_pipes (0B, &argv, 0B, 4, 0B, 0B, &child_pid, 0B, &stdout_fd, 0B, 0B);
      if (D.5880 == 0) goto <D.5881>; else goto <D.5882>;
      <D.5881>:
      D.5883 = FAILED ("1 Failed to run ls");
      return D.5883;
      <D.5882>:
      child_pid.3 = child_pid;
      if (child_pid.3 == 0) goto <D.5885>; else goto <D.5886>;
      <D.5885>:
      D.5883 = FAILED ("2 child pid not returned");
      return D.5883;
      <D.5886>:
      stdout_fd.4 = stdout_fd;
      if (stdout_fd.4 == -1) goto <D.5888>; else goto <D.5889>;
      <D.5888>:
      D.5883 = FAILED ("3 out fd is -1");
      return D.5883;
      <D.5889>:
      goto <D.5859>;
      <D.5858>:
      <D.5859>:
      stdout_fd.4 = stdout_fd;
      D.5890 = read (stdout_fd.4, &buffer, 512);
      if (D.5890 > 0) goto <D.5858>; else goto <D.5860>;
      <D.5860>:
      stdout_fd.4 = stdout_fd;
      close (stdout_fd.4);
      D.5883 = 0B;
      return D.5883;
    }
  finally
    {
      argv = {CLOBBER};
      stdout_fd = {CLOBBER};
      buffer = {CLOBBER};
      child_pid = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.5895;
  int D.5900;
  void * D.5902;
  long unsigned int D.5903;

  D.5895 = __builtin_constant_p (__len);
  if (D.5895 != 0) goto <D.5896>; else goto <D.5897>;
  <D.5896>:
  if (__len == 0) goto <D.5898>; else goto <D.5899>;
  <D.5898>:
  D.5900 = __builtin_constant_p (__ch);
  if (D.5900 == 0) goto <D.5893>; else goto <D.5901>;
  <D.5901>:
  if (__ch != 0) goto <D.5893>; else goto <D.5894>;
  <D.5893>:
  __warn_memset_zero_len ();
  D.5902 = __dest;
  return D.5902;
  <D.5894>:
  <D.5899>:
  <D.5897>:
  D.5903 = __builtin_object_size (__dest, 0);
  D.5902 = __builtin___memset_chk (__dest, __ch, __len, D.5903);
  return D.5902;
}


read (int __fd, void * __buf, size_t __nbytes)
{
  long unsigned int D.5905;
  int D.5908;
  ssize_t D.5911;
  long unsigned int D.5912;
  long unsigned int D.5913;
  long unsigned int D.5916;

  D.5905 = __builtin_object_size (__buf, 0);
  if (D.5905 != 18446744073709551615) goto <D.5906>; else goto <D.5907>;
  <D.5906>:
  D.5908 = __builtin_constant_p (__nbytes);
  if (D.5908 == 0) goto <D.5909>; else goto <D.5910>;
  <D.5909>:
  D.5912 = __builtin_object_size (__buf, 0);
  D.5911 = __read_chk (__fd, __buf, __nbytes, D.5912);
  return D.5911;
  <D.5910>:
  D.5913 = __builtin_object_size (__buf, 0);
  if (D.5913 < __nbytes) goto <D.5914>; else goto <D.5915>;
  <D.5914>:
  D.5916 = __builtin_object_size (__buf, 0);
  D.5911 = __read_chk_warn (__fd, __buf, __nbytes, D.5916);
  return D.5911;
  <D.5915>:
  <D.5907>:
  D.5911 = __read_alias (__fd, __buf, __nbytes);
  return D.5911;
}


spawn_tests_init ()
{
  struct Test * D.5918;

  D.5918 = &spawn_tests;
  return D.5918;
}


