monoeg_g_spawn_command_line_sync (const gchar * command_line, gchar * * standard_output, gchar * * standard_error, gint * exit_status, struct GError * * error)
{
  int D.6735;
  gboolean D.6738;
  int D.6741;
  int D.6746;
  int D.6751;
  int D.6752;
  int D.6759;
  int D.6760;
  int D.6761;
  gchar * * argv.0;
  gchar * D.6763;
  int D.6764;
  int * D.6779;
  int D.6780;
  int status.1;
  int D.6782;
  int D.6787;
  int D.6788;
  pid_t pid;
  gchar * * argv;
  gint argc;
  int stdout_pipe[2];
  int stderr_pipe[2];
  int status;
  int res;

  try
    {
      stdout_pipe[0] = -1;
      stdout_pipe[1] = -1;
      stderr_pipe[0] = -1;
      stderr_pipe[1] = -1;
      D.6735 = monoeg_g_shell_parse_argv (command_line, &argc, &argv, error);
      if (D.6735 == 0) goto <D.6736>; else goto <D.6737>;
      <D.6736>:
      D.6738 = 0;
      return D.6738;
      <D.6737>:
      if (standard_output != 0B) goto <D.6739>; else goto <D.6740>;
      <D.6739>:
      D.6741 = create_pipe (&stdout_pipe, error);
      if (D.6741 == 0) goto <D.6742>; else goto <D.6743>;
      <D.6742>:
      D.6738 = 0;
      return D.6738;
      <D.6743>:
      <D.6740>:
      if (standard_error != 0B) goto <D.6744>; else goto <D.6745>;
      <D.6744>:
      D.6746 = create_pipe (&stderr_pipe, error);
      if (D.6746 == 0) goto <D.6747>; else goto <D.6748>;
      <D.6747>:
      if (standard_output != 0B) goto <D.6749>; else goto <D.6750>;
      <D.6749>:
      D.6751 = stdout_pipe[0];
      close (D.6751);
      D.6752 = stdout_pipe[1];
      close (D.6752);
      <D.6750>:
      D.6738 = 0;
      return D.6738;
      <D.6748>:
      <D.6745>:
      pid = fork ();
      if (pid == 0) goto <D.6753>; else goto <D.6754>;
      <D.6753>:
      {
        gint i;

        if (standard_output != 0B) goto <D.6755>; else goto <D.6756>;
        <D.6755>:
        D.6751 = stdout_pipe[0];
        close (D.6751);
        D.6752 = stdout_pipe[1];
        dup2 (D.6752, 1);
        <D.6756>:
        if (standard_error != 0B) goto <D.6757>; else goto <D.6758>;
        <D.6757>:
        D.6759 = stderr_pipe[0];
        close (D.6759);
        D.6760 = stderr_pipe[1];
        dup2 (D.6760, 2);
        <D.6758>:
        D.6761 = getdtablesize ();
        i = D.6761 + -1;
        goto <D.6690>;
        <D.6689>:
        close (i);
        i = i + -1;
        <D.6690>:
        if (i > 2) goto <D.6689>; else goto <D.6691>;
        <D.6691>:
        argv.0 = argv;
        D.6763 = *argv.0;
        D.6764 = monoeg_g_path_is_absolute (D.6763);
        if (D.6764 == 0) goto <D.6765>; else goto <D.6766>;
        <D.6765>:
        {
          gchar * arg0;

          argv.0 = argv;
          D.6763 = *argv.0;
          arg0 = monoeg_g_find_program_in_path (D.6763);
          if (arg0 == 0B) goto <D.6767>; else goto <D.6768>;
          <D.6767>:
          exit (1);
          <D.6768>:
          argv.0 = argv;
          *argv.0 = arg0;
        }
        <D.6766>:
        argv.0 = argv;
        D.6763 = *argv.0;
        argv.0 = argv;
        execv (D.6763, argv.0);
        exit (1);
      }
      <D.6754>:
      argv.0 = argv;
      monoeg_g_strfreev (argv.0);
      if (standard_output != 0B) goto <D.6769>; else goto <D.6770>;
      <D.6769>:
      D.6752 = stdout_pipe[1];
      close (D.6752);
      <D.6770>:
      if (standard_error != 0B) goto <D.6771>; else goto <D.6772>;
      <D.6771>:
      D.6760 = stderr_pipe[1];
      close (D.6760);
      <D.6772>:
      if (standard_output != 0B) goto <D.6773>; else goto <D.6775>;
      <D.6775>:
      if (standard_error != 0B) goto <D.6773>; else goto <D.6774>;
      <D.6773>:
      D.6751 = stdout_pipe[0];
      D.6759 = stderr_pipe[0];
      res = read_pipes (D.6751, standard_output, D.6759, standard_error, error);
      if (res != 0) goto <D.6776>; else goto <D.6777>;
      <D.6776>:
      waitpid (pid, &status, 1);
      D.6738 = 0;
      return D.6738;
      <D.6777>:
      <D.6774>:
      <D.6693>:
      res = waitpid (pid, &status, 0);
      if (res == -1) goto <D.6778>; else goto <D.6694>;
      <D.6778>:
      D.6779 = __errno_location ();
      D.6780 = *D.6779;
      if (D.6780 == 4) goto <D.6693>; else goto <D.6694>;
      <D.6694>:
      status.1 = status;
      D.6782 = status.1 & 127;
      if (D.6782 == 0) goto <D.6783>; else goto <D.6784>;
      <D.6783>:
      if (exit_status != 0B) goto <D.6785>; else goto <D.6786>;
      <D.6785>:
      status.1 = status;
      D.6787 = status.1 >> 8;
      D.6788 = D.6787 & 255;
      *exit_status = D.6788;
      <D.6786>:
      <D.6784>:
      D.6738 = 1;
      return D.6738;
    }
  finally
    {
      argv = {CLOBBER};
      argc = {CLOBBER};
      stdout_pipe = {CLOBBER};
      stderr_pipe = {CLOBBER};
      status = {CLOBBER};
    }
}


create_pipe (int * fds, struct GError * * error)
{
  int D.6791;
  struct GError * D.6796;
  gboolean D.6797;

  D.6791 = pipe (fds);
  if (D.6791 == -1) goto <D.6792>; else goto <D.6793>;
  <D.6792>:
  if (error != 0B) goto <D.6794>; else goto <D.6795>;
  <D.6794>:
  D.6796 = monoeg_g_error_new (0B, 1, "%s", "Error creating pipe.");
  *error = D.6796;
  <D.6795>:
  D.6797 = 0;
  return D.6797;
  <D.6793>:
  D.6797 = 1;
  return D.6797;
}


read_pipes (int outfd, gchar * * out_str, int errfd, gchar * * err_str, struct GError * * error)
{
  _Bool D.6799;
  _Bool D.6800;
  long int D.6650;
  long int iftmp.2;
  int D.6813;
  long int iftmp.3;
  unsigned long __d.4;
  long int D.6822;
  long int D.6823;
  int D.6824;
  long unsigned int D.6825;
  long int D.6826;
  long int D.6827;
  long int D.6652;
  long int iftmp.5;
  int D.6833;
  long int iftmp.6;
  unsigned long __d.7;
  long int D.6842;
  long int D.6843;
  int D.6844;
  long unsigned int D.6845;
  long int D.6846;
  long int D.6847;
  int D.6848;
  int D.6849;
  long int D.6654;
  long int iftmp.8;
  int D.6857;
  long int iftmp.9;
  unsigned long __d.10;
  long int D.6866;
  long int D.6867;
  int D.6872;
  long int D.6873;
  long int D.6656;
  long int iftmp.11;
  int D.6879;
  long int iftmp.12;
  unsigned long __d.13;
  long int D.6888;
  long int D.6889;
  int * D.6898;
  int D.6899;
  gchar * D.6902;
  gchar * D.6905;
  struct fd_set rfds;
  int res;
  gboolean out_closed;
  gboolean err_closed;
  struct GString * out;
  struct GString * err;
  gchar * buffer;
  gint nread;

  try
    {
      out = 0B;
      err = 0B;
      buffer = 0B;
      D.6799 = outfd < 0;
      out_closed = (gboolean) D.6799;
      D.6800 = errfd < 0;
      err_closed = (gboolean) D.6800;
      if (out_str != 0B) goto <D.6801>; else goto <D.6802>;
      <D.6801>:
      *out_str = 0B;
      out = monoeg_g_string_new ("");
      <D.6802>:
      if (err_str != 0B) goto <D.6803>; else goto <D.6804>;
      <D.6803>:
      *err_str = 0B;
      err = monoeg_g_string_new ("");
      <D.6804>:
      <D.6657>:
      if (out_closed != 0) goto <D.6805>; else goto <D.6806>;
      <D.6805>:
      if (err_closed != 0) goto <D.6643>; else goto <D.6807>;
      <D.6807>:
      <D.6806>:
      {
        unsigned int __i;
        struct fd_set * __arr;

        __arr = &rfds;
        __i = 0;
        goto <D.6647>;
        <D.6646>:
        __arr->fds_bits[__i] = 0;
        __i = __i + 1;
        <D.6647>:
        if (__i <= 15) goto <D.6646>; else goto <D.6648>;
        <D.6648>:
      }
      if (out_closed == 0) goto <D.6808>; else goto <D.6809>;
      <D.6808>:
      if (outfd >= 0) goto <D.6810>; else goto <D.6811>;
      <D.6810>:
      {
        long int __d;

        __d = (long int) outfd;
        D.6813 = __builtin_constant_p (__d);
        if (D.6813 != 0) goto <D.6814>; else goto <D.6815>;
        <D.6814>:
        __d.4 = (unsigned long) __d;
        if (__d.4 <= 1023) goto <D.6818>; else goto <D.6819>;
        <D.6818>:
        iftmp.3 = __d / 64;
        goto <D.6820>;
        <D.6819>:
        iftmp.3 = __fdelt_warn (__d);
        <D.6820>:
        iftmp.2 = iftmp.3;
        goto <D.6821>;
        <D.6815>:
        iftmp.2 = __fdelt_chk (__d);
        <D.6821>:
        D.6650 = iftmp.2;
      }
      D.6822 = D.6650;
      D.6823 = rfds.fds_bits[D.6822];
      D.6824 = outfd % 64;
      D.6825 = 1 << D.6824;
      D.6826 = (long int) D.6825;
      D.6827 = D.6823 | D.6826;
      rfds.fds_bits[D.6822] = D.6827;
      <D.6811>:
      <D.6809>:
      if (err_closed == 0) goto <D.6828>; else goto <D.6829>;
      <D.6828>:
      if (errfd >= 0) goto <D.6830>; else goto <D.6831>;
      <D.6830>:
      {
        long int __d;

        __d = (long int) errfd;
        D.6833 = __builtin_constant_p (__d);
        if (D.6833 != 0) goto <D.6834>; else goto <D.6835>;
        <D.6834>:
        __d.7 = (unsigned long) __d;
        if (__d.7 <= 1023) goto <D.6838>; else goto <D.6839>;
        <D.6838>:
        iftmp.6 = __d / 64;
        goto <D.6840>;
        <D.6839>:
        iftmp.6 = __fdelt_warn (__d);
        <D.6840>:
        iftmp.5 = iftmp.6;
        goto <D.6841>;
        <D.6835>:
        iftmp.5 = __fdelt_chk (__d);
        <D.6841>:
        D.6652 = iftmp.5;
      }
      D.6842 = D.6652;
      D.6843 = rfds.fds_bits[D.6842];
      D.6844 = errfd % 64;
      D.6845 = 1 << D.6844;
      D.6846 = (long int) D.6845;
      D.6847 = D.6843 | D.6846;
      rfds.fds_bits[D.6842] = D.6847;
      <D.6831>:
      <D.6829>:
      D.6848 = MAX_EXPR <errfd, outfd>;
      D.6849 = D.6848 + 1;
      res = select (D.6849, &rfds, 0B, 0B, 0B);
      if (res > 0) goto <D.6850>; else goto <D.6851>;
      <D.6850>:
      if (buffer == 0B) goto <D.6852>; else goto <D.6853>;
      <D.6852>:
      buffer = monoeg_malloc (1024);
      <D.6853>:
      if (out_closed == 0) goto <D.6854>; else goto <D.6855>;
      <D.6854>:
      {
        long int __d;

        __d = (long int) outfd;
        D.6857 = __builtin_constant_p (__d);
        if (D.6857 != 0) goto <D.6858>; else goto <D.6859>;
        <D.6858>:
        __d.10 = (unsigned long) __d;
        if (__d.10 <= 1023) goto <D.6862>; else goto <D.6863>;
        <D.6862>:
        iftmp.9 = __d / 64;
        goto <D.6864>;
        <D.6863>:
        iftmp.9 = __fdelt_warn (__d);
        <D.6864>:
        iftmp.8 = iftmp.9;
        goto <D.6865>;
        <D.6859>:
        iftmp.8 = __fdelt_chk (__d);
        <D.6865>:
        D.6654 = iftmp.8;
      }
      D.6866 = rfds.fds_bits[D.6654];
      D.6824 = outfd % 64;
      D.6825 = 1 << D.6824;
      D.6826 = (long int) D.6825;
      D.6867 = D.6866 & D.6826;
      if (D.6867 != 0) goto <D.6868>; else goto <D.6869>;
      <D.6868>:
      nread = safe_read (outfd, buffer, 1024, error);
      if (nread < 0) goto <D.6870>; else goto <D.6871>;
      <D.6870>:
      close (errfd);
      close (outfd);
      D.6872 = -1;
      return D.6872;
      <D.6871>:
      D.6873 = (long int) nread;
      monoeg_g_string_append_len (out, buffer, D.6873);
      if (nread <= 0) goto <D.6874>; else goto <D.6875>;
      <D.6874>:
      out_closed = 1;
      close (outfd);
      <D.6875>:
      <D.6869>:
      <D.6855>:
      if (err_closed == 0) goto <D.6876>; else goto <D.6877>;
      <D.6876>:
      {
        long int __d;

        __d = (long int) errfd;
        D.6879 = __builtin_constant_p (__d);
        if (D.6879 != 0) goto <D.6880>; else goto <D.6881>;
        <D.6880>:
        __d.13 = (unsigned long) __d;
        if (__d.13 <= 1023) goto <D.6884>; else goto <D.6885>;
        <D.6884>:
        iftmp.12 = __d / 64;
        goto <D.6886>;
        <D.6885>:
        iftmp.12 = __fdelt_warn (__d);
        <D.6886>:
        iftmp.11 = iftmp.12;
        goto <D.6887>;
        <D.6881>:
        iftmp.11 = __fdelt_chk (__d);
        <D.6887>:
        D.6656 = iftmp.11;
      }
      D.6888 = rfds.fds_bits[D.6656];
      D.6844 = errfd % 64;
      D.6845 = 1 << D.6844;
      D.6846 = (long int) D.6845;
      D.6889 = D.6888 & D.6846;
      if (D.6889 != 0) goto <D.6890>; else goto <D.6891>;
      <D.6890>:
      nread = safe_read (errfd, buffer, 1024, error);
      if (nread < 0) goto <D.6892>; else goto <D.6893>;
      <D.6892>:
      close (errfd);
      close (outfd);
      D.6872 = -1;
      return D.6872;
      <D.6893>:
      D.6873 = (long int) nread;
      monoeg_g_string_append_len (err, buffer, D.6873);
      if (nread <= 0) goto <D.6894>; else goto <D.6895>;
      <D.6894>:
      err_closed = 1;
      close (errfd);
      <D.6895>:
      <D.6891>:
      <D.6877>:
      <D.6851>:
      if (res > 0) goto <D.6657>; else goto <D.6896>;
      <D.6896>:
      if (res == -1) goto <D.6897>; else goto <D.6643>;
      <D.6897>:
      D.6898 = __errno_location ();
      D.6899 = *D.6898;
      if (D.6899 == 4) goto <D.6657>; else goto <D.6643>;
      <D.6643>:
      monoeg_g_free (buffer);
      if (out_str != 0B) goto <D.6900>; else goto <D.6901>;
      <D.6900>:
      D.6902 = monoeg_g_string_free (out, 0);
      *out_str = D.6902;
      <D.6901>:
      if (err_str != 0B) goto <D.6903>; else goto <D.6904>;
      <D.6903>:
      D.6905 = monoeg_g_string_free (err, 0);
      *err_str = D.6905;
      <D.6904>:
      D.6872 = 0;
      return D.6872;
    }
  finally
    {
      rfds = {CLOBBER};
    }
}


safe_read (int fd, gchar * buffer, gint count, struct GError * * error)
{
  long unsigned int D.6908;
  long int D.6909;
  int * D.6911;
  int D.6912;
  struct GError * D.6917;
  int D.6918;
  int res;

  <D.6626>:
  D.6908 = (long unsigned int) count;
  D.6909 = read (fd, buffer, D.6908);
  res = (int) D.6909;
  if (res == -1) goto <D.6910>; else goto <D.6627>;
  <D.6910>:
  D.6911 = __errno_location ();
  D.6912 = *D.6911;
  if (D.6912 == 4) goto <D.6626>; else goto <D.6627>;
  <D.6627>:
  if (res == -1) goto <D.6913>; else goto <D.6914>;
  <D.6913>:
  if (error != 0B) goto <D.6915>; else goto <D.6916>;
  <D.6915>:
  D.6917 = monoeg_g_error_new (0B, 1, "%s", "Error reading from pipe.");
  *error = D.6917;
  <D.6916>:
  <D.6914>:
  D.6918 = res;
  return D.6918;
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
read (int __fd, void * __buf, size_t __nbytes)
{
  long unsigned int D.6920;
  int D.6923;
  ssize_t D.6926;
  long unsigned int D.6927;
  long unsigned int D.6928;
  long unsigned int D.6931;

  D.6920 = __builtin_object_size (__buf, 0);
  if (D.6920 != 18446744073709551615) goto <D.6921>; else goto <D.6922>;
  <D.6921>:
  D.6923 = __builtin_constant_p (__nbytes);
  if (D.6923 == 0) goto <D.6924>; else goto <D.6925>;
  <D.6924>:
  D.6927 = __builtin_object_size (__buf, 0);
  D.6926 = __read_chk (__fd, __buf, __nbytes, D.6927);
  return D.6926;
  <D.6925>:
  D.6928 = __builtin_object_size (__buf, 0);
  if (D.6928 < __nbytes) goto <D.6929>; else goto <D.6930>;
  <D.6929>:
  D.6931 = __builtin_object_size (__buf, 0);
  D.6926 = __read_chk_warn (__fd, __buf, __nbytes, D.6931);
  return D.6926;
  <D.6930>:
  <D.6922>:
  D.6926 = __read_alias (__fd, __buf, __nbytes);
  return D.6926;
}


monoeg_g_spawn_async_with_pipes (const gchar * working_directory, gchar * * argv, gchar * * envp, GSpawnFlags flags, void (*GSpawnChildSetupFunc) (void *) child_setup, void * user_data, GPid * child_pid, gint * standard_input, gint * standard_output, gint * standard_error, struct GError * * error)
{
  gboolean D.6935;
  int D.6936;
  int D.6941;
  int D.6944;
  int D.6945;
  int D.6948;
  int D.6951;
  int D.6952;
  int D.6955;
  int D.6958;
  int D.6959;
  int pid.14;
  int pid.15;
  int D.6964;
  int D.6965;
  struct GError * D.6968;
  unsigned int D.6971;
  int pid.16;
  _Bool D.6977;
  int D.6978;
  int pid.17;
  int * D.6983;
  int err.18;
  int D.6987;
  unsigned int D.6994;
  unsigned int D.7000;
  unsigned int D.7006;
  unsigned int D.7009;
  int D.7012;
  gchar * * iftmp.19;
  unsigned int D.7014;
  int D.7024;
  unsigned int D.7026;
  gchar * D.7027;
  int status.20;
  struct GError * D.7039;
  long int D.7042;
  long int D.7046;
  char * D.7051;
  struct GError * D.7052;
  pid_t pid;
  int info_pipe[2];
  int in_pipe[2];
  int out_pipe[2];
  int err_pipe[2];
  int status;

  try
    {
      in_pipe[0] = -1;
      in_pipe[1] = -1;
      out_pipe[0] = -1;
      out_pipe[1] = -1;
      err_pipe[0] = -1;
      err_pipe[1] = -1;
      if (argv == 0B) goto <D.6933>; else goto <D.6934>;
      <D.6933>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gspawn.c", 324, "argv != NULL");
      D.6935 = 0;
      return D.6935;
      <D.6934>:
      D.6936 = create_pipe (&info_pipe, error);
      if (D.6936 == 0) goto <D.6937>; else goto <D.6938>;
      <D.6937>:
      D.6935 = 0;
      return D.6935;
      <D.6938>:
      if (standard_output != 0B) goto <D.6939>; else goto <D.6940>;
      <D.6939>:
      D.6941 = create_pipe (&out_pipe, error);
      if (D.6941 == 0) goto <D.6942>; else goto <D.6943>;
      <D.6942>:
      D.6944 = info_pipe[0];
      close (D.6944);
      D.6945 = info_pipe[1];
      close (D.6945);
      D.6935 = 0;
      return D.6935;
      <D.6943>:
      <D.6940>:
      if (standard_error != 0B) goto <D.6946>; else goto <D.6947>;
      <D.6946>:
      D.6948 = create_pipe (&err_pipe, error);
      if (D.6948 == 0) goto <D.6949>; else goto <D.6950>;
      <D.6949>:
      D.6944 = info_pipe[0];
      close (D.6944);
      D.6945 = info_pipe[1];
      close (D.6945);
      D.6951 = out_pipe[0];
      close (D.6951);
      D.6952 = out_pipe[1];
      close (D.6952);
      D.6935 = 0;
      return D.6935;
      <D.6950>:
      <D.6947>:
      if (standard_input != 0B) goto <D.6953>; else goto <D.6954>;
      <D.6953>:
      D.6955 = create_pipe (&in_pipe, error);
      if (D.6955 == 0) goto <D.6956>; else goto <D.6957>;
      <D.6956>:
      D.6944 = info_pipe[0];
      close (D.6944);
      D.6945 = info_pipe[1];
      close (D.6945);
      D.6951 = out_pipe[0];
      close (D.6951);
      D.6952 = out_pipe[1];
      close (D.6952);
      D.6958 = err_pipe[0];
      close (D.6958);
      D.6959 = err_pipe[1];
      close (D.6959);
      D.6935 = 0;
      return D.6935;
      <D.6957>:
      <D.6954>:
      pid.14 = fork ();
      pid = pid.14;
      pid.15 = pid;
      if (pid.15 == -1) goto <D.6962>; else goto <D.6963>;
      <D.6962>:
      D.6944 = info_pipe[0];
      close (D.6944);
      D.6945 = info_pipe[1];
      close (D.6945);
      D.6951 = out_pipe[0];
      close (D.6951);
      D.6952 = out_pipe[1];
      close (D.6952);
      D.6958 = err_pipe[0];
      close (D.6958);
      D.6959 = err_pipe[1];
      close (D.6959);
      D.6964 = in_pipe[0];
      close (D.6964);
      D.6965 = in_pipe[1];
      close (D.6965);
      if (error != 0B) goto <D.6966>; else goto <D.6967>;
      <D.6966>:
      D.6968 = monoeg_g_error_new (0B, 1, "%s", "Error in fork ()");
      *error = D.6968;
      <D.6967>:
      D.6935 = 0;
      return D.6935;
      <D.6963>:
      pid.15 = pid;
      if (pid.15 == 0) goto <D.6969>; else goto <D.6970>;
      <D.6969>:
      D.6971 = flags & 2;
      if (D.6971 == 0) goto <D.6972>; else goto <D.6973>;
      <D.6972>:
      pid.16 = fork ();
      pid = pid.16;
      <D.6973>:
      pid.15 = pid;
      if (pid.15 != 0) goto <D.6975>; else goto <D.6976>;
      <D.6975>:
      pid.15 = pid;
      D.6977 = pid.15 == -1;
      D.6978 = (int) D.6977;
      exit (D.6978);
      <D.6976>:
      {
        gint i;
        int fd;
        gchar * arg0;
        gchar * * actual_args;
        gint unused;

        D.6944 = info_pipe[0];
        close (D.6944);
        D.6965 = in_pipe[1];
        close (D.6965);
        D.6951 = out_pipe[0];
        close (D.6951);
        D.6958 = err_pipe[0];
        close (D.6958);
        D.6945 = info_pipe[1];
        fcntl (D.6945, 2, 1);
        D.6971 = flags & 2;
        if (D.6971 == 0) goto <D.6979>; else goto <D.6980>;
        <D.6979>:
        pid.17 = getpid ();
        pid = pid.17;
        <D.6719>:
        D.6945 = info_pipe[1];
        unused = write_all (D.6945, &pid, 4);
        if (unused == -1) goto <D.6982>; else goto <D.6720>;
        <D.6982>:
        D.6983 = __errno_location ();
        err.18 = *D.6983;
        if (err.18 == 4) goto <D.6719>; else goto <D.6720>;
        <D.6720>:
        <D.6980>:
        if (working_directory != 0B) goto <D.6985>; else goto <D.6986>;
        <D.6985>:
        D.6987 = chdir (working_directory);
        if (D.6987 == -1) goto <D.6988>; else goto <D.6989>;
        <D.6988>:
        {
          int err;

          try
            {
              D.6983 = __errno_location ();
              err.18 = *D.6983;
              err = err.18;
              <D.6722>:
              D.6945 = info_pipe[1];
              unused = write_all (D.6945, &err, 4);
              if (unused == -1) goto <D.6990>; else goto <D.6723>;
              <D.6990>:
              D.6983 = __errno_location ();
              err.18 = *D.6983;
              if (err.18 == 4) goto <D.6722>; else goto <D.6723>;
              <D.6723>:
              exit (0);
            }
          finally
            {
              err = {CLOBBER};
            }
        }
        <D.6989>:
        <D.6986>:
        if (standard_output != 0B) goto <D.6991>; else goto <D.6992>;
        <D.6991>:
        D.6952 = out_pipe[1];
        dup2 (D.6952, 1);
        goto <D.6993>;
        <D.6992>:
        D.6994 = flags & 8;
        if (D.6994 != 0) goto <D.6995>; else goto <D.6996>;
        <D.6995>:
        fd = open ("/dev/null", 1);
        dup2 (fd, 1);
        <D.6996>:
        <D.6993>:
        if (standard_error != 0B) goto <D.6997>; else goto <D.6998>;
        <D.6997>:
        D.6959 = err_pipe[1];
        dup2 (D.6959, 2);
        goto <D.6999>;
        <D.6998>:
        D.7000 = flags & 16;
        if (D.7000 != 0) goto <D.7001>; else goto <D.7002>;
        <D.7001>:
        fd = open ("/dev/null", 1);
        dup2 (fd, 2);
        <D.7002>:
        <D.6999>:
        if (standard_input != 0B) goto <D.7003>; else goto <D.7004>;
        <D.7003>:
        D.6964 = in_pipe[0];
        dup2 (D.6964, 0);
        goto <D.7005>;
        <D.7004>:
        D.7006 = flags & 32;
        if (D.7006 == 0) goto <D.7007>; else goto <D.7008>;
        <D.7007>:
        fd = open ("/dev/null", 0);
        dup2 (fd, 0);
        <D.7008>:
        <D.7005>:
        D.7009 = flags & 1;
        if (D.7009 != 0) goto <D.7010>; else goto <D.7011>;
        <D.7010>:
        D.7012 = getdtablesize ();
        i = D.7012 + -1;
        goto <D.6725>;
        <D.6724>:
        close (i);
        i = i + -1;
        <D.6725>:
        if (i > 2) goto <D.6724>; else goto <D.6726>;
        <D.6726>:
        <D.7011>:
        D.7014 = flags & 64;
        if (D.7014 != 0) goto <D.7015>; else goto <D.7016>;
        <D.7015>:
        iftmp.19 = argv + 8;
        goto <D.7017>;
        <D.7016>:
        iftmp.19 = argv;
        <D.7017>:
        actual_args = iftmp.19;
        if (envp == 0B) goto <D.7018>; else goto <D.7019>;
        <D.7018>:
        envp = environ;
        <D.7019>:
        if (child_setup != 0B) goto <D.7020>; else goto <D.7021>;
        <D.7020>:
        child_setup (user_data);
        <D.7021>:
        arg0 = *argv;
        D.7024 = monoeg_g_path_is_absolute (arg0);
        if (D.7024 == 0) goto <D.7022>; else goto <D.7025>;
        <D.7025>:
        D.7026 = flags & 4;
        if (D.7026 != 0) goto <D.7022>; else goto <D.7023>;
        <D.7022>:
        D.7027 = *argv;
        arg0 = monoeg_g_find_program_in_path (D.7027);
        if (arg0 == 0B) goto <D.7028>; else goto <D.7029>;
        <D.7028>:
        {
          int err;

          try
            {
              err = 2;
              D.6945 = info_pipe[1];
              write_all (D.6945, &err, 4);
              exit (0);
            }
          finally
            {
              err = {CLOBBER};
            }
        }
        <D.7029>:
        <D.7023>:
        execve (arg0, actual_args, envp);
        D.6945 = info_pipe[1];
        D.6983 = __errno_location ();
        write_all (D.6945, D.6983, 4);
        exit (0);
      }
      <D.6970>:
      D.6971 = flags & 2;
      if (D.6971 == 0) goto <D.7030>; else goto <D.7031>;
      <D.7030>:
      {
        int w;

        <D.6729>:
        pid.15 = pid;
        w = waitpid (pid.15, &status, 0);
        if (w == -1) goto <D.7032>; else goto <D.6730>;
        <D.7032>:
        D.6983 = __errno_location ();
        err.18 = *D.6983;
        if (err.18 == 4) goto <D.6729>; else goto <D.6730>;
        <D.6730>:
        status.20 = status;
        if (status.20 == 1) goto <D.7033>; else goto <D.7036>;
        <D.7036>:
        if (w == -1) goto <D.7033>; else goto <D.7034>;
        <D.7033>:
        D.6944 = info_pipe[0];
        close (D.6944);
        D.6945 = info_pipe[1];
        close (D.6945);
        D.6951 = out_pipe[0];
        close (D.6951);
        D.6952 = out_pipe[1];
        close (D.6952);
        D.6958 = err_pipe[0];
        close (D.6958);
        D.6959 = err_pipe[1];
        close (D.6959);
        D.6964 = in_pipe[0];
        close (D.6964);
        D.6965 = in_pipe[1];
        close (D.6965);
        if (error != 0B) goto <D.7037>; else goto <D.7038>;
        <D.7037>:
        status.20 = status;
        D.7039 = monoeg_g_error_new (0B, 1, "Error in fork (): %d", status.20);
        *error = D.7039;
        <D.7038>:
        D.6935 = 0;
        return D.6935;
        <D.7034>:
      }
      <D.7031>:
      D.6945 = info_pipe[1];
      close (D.6945);
      D.6964 = in_pipe[0];
      close (D.6964);
      D.6952 = out_pipe[1];
      close (D.6952);
      D.6959 = err_pipe[1];
      close (D.6959);
      D.6971 = flags & 2;
      if (D.6971 == 0) goto <D.7040>; else goto <D.7041>;
      <D.7040>:
      {
        int x;

        <D.6732>:
        D.6944 = info_pipe[0];
        D.7042 = read (D.6944, &pid, 4);
        x = (int) D.7042;
        if (x == -1) goto <D.7043>; else goto <D.6733>;
        <D.7043>:
        D.6983 = __errno_location ();
        err.18 = *D.6983;
        if (err.18 == 4) goto <D.6732>; else goto <D.6733>;
        <D.6733>:
      }
      <D.7041>:
      if (child_pid != 0B) goto <D.7044>; else goto <D.7045>;
      <D.7044>:
      pid.15 = pid;
      *child_pid = pid.15;
      <D.7045>:
      D.6944 = info_pipe[0];
      D.7046 = read (D.6944, &status, 4);
      if (D.7046 != 0) goto <D.7047>; else goto <D.7048>;
      <D.7047>:
      D.6944 = info_pipe[0];
      close (D.6944);
      D.6964 = in_pipe[0];
      close (D.6964);
      D.6952 = out_pipe[1];
      close (D.6952);
      D.6959 = err_pipe[1];
      close (D.6959);
      if (error != 0B) goto <D.7049>; else goto <D.7050>;
      <D.7049>:
      status.20 = status;
      status.20 = status;
      status.20 = status;
      D.7051 = strerror (status.20);
      D.7052 = monoeg_g_error_new (0B, status.20, "Error in exec (%d -> %s)", status.20, D.7051);
      *error = D.7052;
      <D.7050>:
      D.6935 = 0;
      return D.6935;
      <D.7048>:
      D.6944 = info_pipe[0];
      close (D.6944);
      if (standard_input != 0B) goto <D.7053>; else goto <D.7054>;
      <D.7053>:
      D.6965 = in_pipe[1];
      *standard_input = D.6965;
      <D.7054>:
      if (standard_output != 0B) goto <D.7055>; else goto <D.7056>;
      <D.7055>:
      D.6951 = out_pipe[0];
      *standard_output = D.6951;
      <D.7056>:
      if (standard_error != 0B) goto <D.7057>; else goto <D.7058>;
      <D.7057>:
      D.6958 = err_pipe[0];
      *standard_error = D.6958;
      <D.7058>:
      D.6935 = 1;
      return D.6935;
    }
  finally
    {
      pid = {CLOBBER};
      info_pipe = {CLOBBER};
      in_pipe = {CLOBBER};
      out_pipe = {CLOBBER};
      err_pipe = {CLOBBER};
      status = {CLOBBER};
    }
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__))
open (const char * __path, int __oflag)
{
  int D.7061;
  int D.7064;
  int D.7069;
  int D.7071;
  int D.7072;
  int D.7075;
  int D.7076;

  D.7061 = __builtin_va_arg_pack_len ();
  if (D.7061 > 1) goto <D.7062>; else goto <D.7063>;
  <D.7062>:
  __open_too_many_args ();
  <D.7063>:
  D.7064 = __builtin_constant_p (__oflag);
  if (D.7064 != 0) goto <D.7065>; else goto <D.7066>;
  <D.7065>:
  D.7069 = __oflag & 64;
  if (D.7069 != 0) goto <D.7067>; else goto <D.7070>;
  <D.7070>:
  D.7071 = __oflag & 4259840;
  if (D.7071 == 4259840) goto <D.7067>; else goto <D.7068>;
  <D.7067>:
  D.7072 = __builtin_va_arg_pack_len ();
  if (D.7072 <= 0) goto <D.7073>; else goto <D.7074>;
  <D.7073>:
  __open_missing_mode ();
  D.7075 = __open_2 (__path, __oflag);
  return D.7075;
  <D.7074>:
  <D.7068>:
  D.7075 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.7075;
  <D.7066>:
  D.7076 = __builtin_va_arg_pack_len ();
  if (D.7076 <= 0) goto <D.7077>; else goto <D.7078>;
  <D.7077>:
  D.7075 = __open_2 (__path, __oflag);
  return D.7075;
  <D.7078>:
  D.7075 = __open_alias (__path, __oflag, __builtin_va_arg_pack ());
  return D.7075;
}


write_all (int fd, const void * vbuf, size_t n)
{
  const char * D.7080;
  long unsigned int D.7081;
  long int D.7082;
  int * D.7084;
  int D.7085;
  int D.7088;
  long unsigned int D.7089;
  const char * buf;
  size_t nwritten;
  int w;

  buf = vbuf;
  nwritten = 0;
  <D.6672>:
  <D.6670>:
  D.7080 = buf + nwritten;
  D.7081 = n - nwritten;
  D.7082 = write (fd, D.7080, D.7081);
  w = (int) D.7082;
  if (w == -1) goto <D.7083>; else goto <D.6671>;
  <D.7083>:
  D.7084 = __errno_location ();
  D.7085 = *D.7084;
  if (D.7085 == 4) goto <D.6670>; else goto <D.6671>;
  <D.6671>:
  if (w == -1) goto <D.7086>; else goto <D.7087>;
  <D.7086>:
  D.7088 = -1;
  return D.7088;
  <D.7087>:
  D.7089 = (long unsigned int) w;
  nwritten = D.7089 + nwritten;
  if (nwritten < n) goto <D.6672>; else goto <D.6673>;
  <D.6673>:
  D.7088 = (int) nwritten;
  return D.7088;
}


