#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ systemid_path;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_WARNING;
int /*<<< orphan*/ R_OK;
int STDERR_FILENO;
int STDOUT_FILENO;
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int /*<<< orphan*/ WNOHANG;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ parse_systemid_path(char *, int);
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
char *realloc(char *, int);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int /*<<< orphan*/ set_signal_handlers();
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
scalar_t__ strlen(char *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ unset_signal_handlers();
int waitpid(int, int *, int /*<<< orphan*/);
int rhn_do_action(void) {
  int child;
  int retval;
  int fds[2];
  char systemid_path[512] = {0};
  if (access("/etc/sysconfig/rhn/up2date", R_OK)) {
    syslog(LOG_DEBUG, "%s does not exist or is unreadable",
           "/etc/sysconfig/rhn/up2date");
    return -1;
  }
  if (parse_systemid_path(systemid_path, sizeof(systemid_path))) {
    syslog(LOG_DEBUG, "%s does not contain valid systemIdPath entry",
           "/etc/sysconfig/rhn/up2date");
    return -1;
  }
  if (access(systemid_path, R_OK)) {
    syslog(LOG_DEBUG, "%s does not exist or is unreadable", systemid_path);
    return -1;
  }
  if (pipe(fds) != 0) {
    syslog(LOG_ERR, "Could not create pipe for forking process; %m");
    return -1;
  }
  if ((child = fork()) == 0) {
    char *args[] = {NULL, NULL};
    close(fds[0]);
    if (fds[1] != STDOUT_FILENO) {
      dup2(fds[1], STDOUT_FILENO);
      close(fds[1]);
    }
    dup2(STDOUT_FILENO, STDERR_FILENO);
    syslog(LOG_DEBUG, "running program %s", "/usr/sbin/rhn_check");
    unset_signal_handlers();
    args[0] = "/usr/sbin/rhn_check";
    execv("/usr/sbin/rhn_check", args);
    set_signal_handlers();
    syslog(LOG_ERR, "could not execute %s : %s", "/usr/sbin/rhn_check",
           strerror(errno));
    exit(errno);
  } else if (child > 0) {
    int ret = 1;
    char *buf, buffer[10];
    int bufsize = 0;
    buf = malloc(sizeof(buffer));
    if (buf == NULL) {
      syslog(LOG_ERR, "out of memory");
      return -1;
    } else {
      bufsize = sizeof(buffer);
    }
    memset(buf, '\0', bufsize);
    close(fds[1]);
    while (ret > 0) {
      struct timeval tv;
      fd_set rset;
      memset(buffer, '\0', sizeof(buffer));
      tv.tv_sec = 2;
      tv.tv_usec = 0;
      FD_ZERO(&rset);
      FD_SET(fds[0], &rset);
      ret = select(fds[0] + 1, &rset, NULL, NULL, &tv);
      if (ret < 0) {
        syslog(LOG_ERR, "error in select(): %m");
        printf("returning -1\n");
        free(buf);
        close(fds[0]);
        return -1;
      } else if (ret > 0) {
        int chars;
        chars = read(fds[0], buffer, sizeof(buffer) - 1);
        if (chars > 0) {
          bufsize += chars;
          buf = realloc(buf, bufsize);
          strcat(buf, buffer);
        } else {
          ret = 0;
        }
      }
      if (ret == 0) {
        ret = waitpid(child, &retval, WNOHANG);
        if (ret == child) {
          if (strlen(buffer) > 0)
            syslog(LOG_INFO, "%s returned: %s", "/usr/sbin/rhn_check", buf);
          free(buf);
          close(fds[0]);
          if (WIFEXITED(retval))
            return WEXITSTATUS(retval);
          return -1;
        } else if (ret == 0) {
          ret = 1;
          continue;
        }
      }
    }
    syslog(LOG_WARNING, "caught exceptional exit status from child program");
    (void)waitpid(child, &retval, 0);
    free(buf);
    close(fds[0]);
    return -2;
  } else {
    syslog(LOG_ERR, "Could not fork process %s: %m", "/usr/sbin/rhn_check");
    close(fds[0]);
    close(fds[1]);
    return -1;
  }
  close(fds[0]);
  close(fds[1]);
  return 0;
}


x86 assembly (clang, -O0):
<rhn_do_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
lea    -0x220(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1080 <memset@plt>
mov    0x2cf3(%rip),%rax
mov    (%rax),%esi
lea    0xd32(%rip),%rdi
call   1140 <access@plt>
cmp    $0x0,%rax
je     1307 <rhn_do_action+0x67>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
lea    0xd2e(%rip),%rsi
lea    0xd0c(%rip),%rdx
mov    $0x0,%al
call   1100 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
lea    -0x220(%rbp),%rdi
mov    $0x200,%esi
call   1070 <parse_systemid_path@plt>
cmp    $0x0,%rax
je     134c <rhn_do_action+0xac>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
lea    0xd0c(%rip),%rsi
lea    0xcc7(%rip),%rdx
mov    $0x0,%al
call   1100 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
lea    -0x220(%rbp),%rdi
mov    0x2c5e(%rip),%rax
mov    (%rax),%esi
call   1140 <access@plt>
cmp    $0x0,%rax
je     1395 <rhn_do_action+0xf5>
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
lea    -0x220(%rbp),%rdx
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
lea    -0x14(%rbp),%rdi
call   10a0 <pipe@plt>
cmp    $0x0,%rax
je     13cb <rhn_do_action+0x12b>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
lea    0xcb3(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
mov    $0x0,%al
call   11c0 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    14d0 <rhn_do_action+0x230>
lea    -0x230(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1080 <memset@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x10(%rbp),%eax
mov    0x2bed(%rip),%rcx
cmp    (%rcx),%eax
je     1424 <rhn_do_action+0x184>
mov    -0x10(%rbp),%edi
mov    0x2bdb(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
mov    -0x10(%rbp),%edi
call   1090 <close@plt>
mov    0x2bc5(%rip),%rax
mov    (%rax),%edi
mov    0x2b8c(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
mov    0x2b6e(%rip),%rax
mov    (%rax),%edi
lea    0xc4e(%rip),%rsi
lea    0xc5a(%rip),%rdx
mov    $0x0,%al
call   1100 <syslog@plt>
mov    $0x0,%al
call   11a0 <unset_signal_handlers@plt>
lea    0xc45(%rip),%rax
mov    %rax,-0x230(%rbp)
lea    -0x230(%rbp),%rsi
lea    0xc30(%rip),%rdi
call   11b0 <execv@plt>
mov    $0x0,%al
call   10c0 <set_signal_handlers@plt>
mov    0x2b09(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x26c(%rbp)
mov    0x2b2a(%rip),%rax
mov    (%rax),%edi
call   1180 <strerror@plt>
mov    -0x26c(%rbp),%edi
mov    %eax,%ecx
lea    0xc0c(%rip),%rsi
lea    0xbf1(%rip),%rdx
mov    $0x0,%al
call   1100 <syslog@plt>
mov    0x2aff(%rip),%rax
mov    (%rax),%edi
call   1170 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jle    17cb <rhn_do_action+0x52b>
movl   $0x1,-0x234(%rbp)
movl   $0x0,-0x250(%rbp)
mov    $0xa,%edi
call   10f0 <malloc@plt>
mov    %rax,-0x240(%rbp)
cmpq   $0x0,-0x240(%rbp)
jne    1530 <rhn_do_action+0x290>
mov    0x2a84(%rip),%rax
mov    (%rax),%edi
lea    0xbbd(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
movl   $0xa,-0x250(%rbp)
mov    -0x240(%rbp),%rdi
mov    -0x250(%rbp),%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    -0x10(%rbp),%edi
call   1090 <close@plt>
cmpl   $0x0,-0x234(%rbp)
jle    1786 <rhn_do_action+0x4e6>
lea    -0x24a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <memset@plt>
movl   $0x2,-0x260(%rbp)
movq   $0x0,-0x258(%rbp)
lea    -0x264(%rbp),%rdi
call   10d0 <FD_ZERO@plt>
mov    -0x14(%rbp),%edi
lea    -0x264(%rbp),%rsi
call   1190 <FD_SET@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
lea    -0x264(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x260(%rbp),%r8
mov    %rcx,%rdx
call   10e0 <select@plt>
mov    %eax,-0x234(%rbp)
cmpl   $0x0,-0x234(%rbp)
jge    161c <rhn_do_action+0x37c>
mov    0x29b8(%rip),%rax
mov    (%rax),%edi
lea    0xaff(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
lea    0xb07(%rip),%rdi
call   1060 <printf@plt>
mov    -0x240(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
cmpl   $0x0,-0x234(%rbp)
jle    16a2 <rhn_do_action+0x402>
mov    -0x14(%rbp),%edi
lea    -0x24a(%rbp),%rsi
mov    $0x9,%edx
call   10b0 <read@plt>
mov    %eax,-0x268(%rbp)
cmpl   $0x0,-0x268(%rbp)
jle    1693 <rhn_do_action+0x3f3>
mov    -0x268(%rbp),%eax
add    -0x250(%rbp),%eax
mov    %eax,-0x250(%rbp)
mov    -0x240(%rbp),%rdi
mov    -0x250(%rbp),%esi
call   1110 <realloc@plt>
mov    %rax,-0x240(%rbp)
mov    -0x240(%rbp),%rdi
lea    -0x24a(%rbp),%rsi
call   1150 <strcat@plt>
jmp    169d <rhn_do_action+0x3fd>
movl   $0x0,-0x234(%rbp)
jmp    16a2 <rhn_do_action+0x402>
jmp    16a7 <rhn_do_action+0x407>
cmpl   $0x0,-0x234(%rbp)
jne    1781 <rhn_do_action+0x4e1>
mov    -0x8(%rbp),%edi
mov    0x2922(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
call   1130 <waitpid@plt>
mov    %eax,-0x234(%rbp)
mov    -0x234(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    175b <rhn_do_action+0x4bb>
lea    -0x24a(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jle    1719 <rhn_do_action+0x479>
mov    0x28ad(%rip),%rax
mov    (%rax),%edi
mov    -0x240(%rbp),%rcx
lea    0xa01(%rip),%rsi
lea    0x99a(%rip),%rdx
mov    $0x0,%al
call   1100 <syslog@plt>
mov    -0x240(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0xc(%rbp),%edi
call   1160 <WIFEXITED@plt>
cmp    $0x0,%rax
je     174f <rhn_do_action+0x4af>
mov    -0xc(%rbp),%edi
call   1120 <WEXITSTATUS@plt>
mov    %eax,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
movl   $0xffffffff,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
cmpl   $0x0,-0x234(%rbp)
jne    1777 <rhn_do_action+0x4d7>
movl   $0x1,-0x234(%rbp)
jmp    1556 <rhn_do_action+0x2b6>
jmp    177c <rhn_do_action+0x4dc>
jmp    1781 <rhn_do_action+0x4e1>
jmp    1556 <rhn_do_action+0x2b6>
mov    0x284b(%rip),%rax
mov    (%rax),%edi
lea    0x986(%rip),%rsi
mov    $0x0,%al
call   1100 <syslog@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1130 <waitpid@plt>
mov    -0x240(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1800 <rhn_do_action+0x560>
mov    0x27c6(%rip),%rax
mov    (%rax),%edi
lea    0x973(%rip),%rsi
lea    0x8ca(%rip),%rdx
mov    $0x0,%al
call   1100 <syslog@plt>
mov    -0x14(%rbp),%edi
call   1090 <close@plt>
mov    -0x10(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rhn_do_action>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
lea    0x30(%rsp),%rdi
mov    $0x200,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x2cef(%rip),%rbx
mov    (%rbx),%esi
lea    0xd2e(%rip),%rdi
call   1140 <access@plt>
test   %rax,%rax
je     12ee <rhn_do_action+0x4e>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xd2f(%rip),%rsi
jmp    1312 <rhn_do_action+0x72>
lea    0x30(%rsp),%rdi
mov    $0x200,%esi
call   1070 <parse_systemid_path@plt>
test   %rax,%rax
je     1337 <rhn_do_action+0x97>
mov    0x2ca7(%rip),%rax
mov    (%rax),%edi
lea    0xd2c(%rip),%rsi
lea    0xce7(%rip),%rdx
xor    %eax,%eax
call   1100 <syslog@plt>
mov    $0xffffffff,%eax
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%esi
lea    0x30(%rsp),%rdi
call   1140 <access@plt>
test   %rax,%rax
je     135f <rhn_do_action+0xbf>
mov    0x2c61(%rip),%rax
mov    (%rax),%edi
lea    0xcc3(%rip),%rsi
lea    0x30(%rsp),%rdx
jmp    1319 <rhn_do_action+0x79>
lea    0x4(%rsp),%rdi
call   10a0 <pipe@plt>
test   %rax,%rax
je     1387 <rhn_do_action+0xe7>
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
lea    0xced(%rip),%rsi
xor    %eax,%eax
call   1100 <syslog@plt>
jmp    1320 <rhn_do_action+0x80>
xor    %eax,%eax
call   11c0 <fork@plt>
test   %eax,%eax
je     15c4 <rhn_do_action+0x324>
jle    14a8 <rhn_do_action+0x208>
mov    %eax,%ebp
mov    $0xa,%r12d
mov    $0xa,%edi
call   10f0 <malloc@plt>
test   %rax,%rax
je     14d5 <rhn_do_action+0x235>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <memset@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
lea    0x26(%rsp),%r15
lea    0x20(%rsp),%rbx
jmp    1403 <rhn_do_action+0x163>
add    %eax,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
call   1110 <realloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
call   1150 <strcat@plt>
test   %r13d,%r13d
jle    1523 <rhn_do_action+0x283>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <memset@plt>
movl   $0x2,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    %rbx,%rdi
call   10d0 <FD_ZERO@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
call   1190 <FD_SET@plt>
mov    0x4(%rsp),%edi
add    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x10(%rsp),%r8
call   10e0 <select@plt>
test   %eax,%eax
js     14ea <rhn_do_action+0x24a>
je     1475 <rhn_do_action+0x1d5>
mov    %eax,%r13d
mov    0x4(%rsp),%edi
mov    %r15,%rsi
mov    $0x9,%edx
call   10b0 <read@plt>
test   %eax,%eax
jg     13de <rhn_do_action+0x13e>
mov    0x2b64(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
lea    0xc(%rsp),%rsi
call   1130 <waitpid@plt>
cmp    %ebp,%eax
je     1563 <rhn_do_action+0x2c3>
mov    %eax,%r13d
test   %eax,%eax
jne    13fa <rhn_do_action+0x15a>
mov    $0x1,%r13d
jmp    13fa <rhn_do_action+0x15a>
mov    0x2ae9(%rip),%rax
mov    (%rax),%edi
lea    0xc88(%rip),%rsi
lea    0xbed(%rip),%rdx
xor    %eax,%eax
call   1100 <syslog@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
jmp    1519 <rhn_do_action+0x279>
mov    0x2abc(%rip),%rax
mov    (%rax),%edi
lea    0xbf5(%rip),%rsi
jmp    137e <rhn_do_action+0xde>
mov    0x2aa7(%rip),%rax
mov    (%rax),%edi
lea    0xbee(%rip),%rsi
xor    %eax,%eax
call   1100 <syslog@plt>
lea    0xc56(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
jmp    1320 <rhn_do_action+0x80>
mov    0x2aae(%rip),%rax
mov    (%rax),%edi
lea    0xbdb(%rip),%rsi
xor    %eax,%eax
call   1100 <syslog@plt>
lea    0xc(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1130 <waitpid@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    $0xfffffffe,%eax
jmp    1325 <rhn_do_action+0x85>
lea    0x26(%rsp),%rdi
call   1050 <strlen@plt>
test   %rax,%rax
jle    1593 <rhn_do_action+0x2f3>
mov    0x2a2f(%rip),%rax
mov    (%rax),%edi
lea    0xb7c(%rip),%rsi
lea    0xb23(%rip),%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1100 <syslog@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    0xc(%rsp),%edi
call   1160 <WIFEXITED@plt>
test   %rax,%rax
je     1320 <rhn_do_action+0x80>
mov    0xc(%rsp),%edi
call   1120 <WEXITSTATUS@plt>
jmp    1325 <rhn_do_action+0x85>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
mov    0x2a10(%rip),%rbx
mov    (%rbx),%esi
cmp    %esi,%edi
je     15f6 <rhn_do_action+0x356>
call   1060 <dup2@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
mov    (%rbx),%edi
mov    0x29c3(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
mov    0x29a5(%rip),%rax
mov    (%rax),%edi
lea    0xa85(%rip),%rsi
lea    0xa91(%rip),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1100 <syslog@plt>
xor    %eax,%eax
call   11a0 <unset_signal_handlers@plt>
mov    %rbx,0x10(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   11b0 <execv@plt>
xor    %eax,%eax
call   10c0 <set_signal_handlers@plt>
mov    0x294c(%rip),%rax
mov    (%rax),%ebp
mov    0x2973(%rip),%r14
mov    (%r14),%edi
call   1180 <strerror@plt>
lea    0xa5c(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1100 <syslog@plt>
mov    (%r14),%edi
call   1170 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@.str = [27 x i8] c"/etc/sysconfig/rhn/up2date\00"
@R_OK = global i32 0
@LOG_DEBUG = global i32 0
@.str.1 = [35 x i8] c"%s does not exist or is unreadable\00"
@.str.2 = [45 x i8] c"%s does not contain valid systemIdPath entry\00"
@LOG_ERR = global i32 0
@.str.3 = [46 x i8] c"Could not create pipe for forking process; %m\00"
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
@.str.4 = [19 x i8] c"running program %s\00"
@.str.5 = [20 x i8] c"/usr/sbin/rhn_check\00"
@.str.6 = [26 x i8] c"could not execute %s : %s\00"
@errno = global i32 0
@.str.7 = [14 x i8] c"out of memory\00"
@.str.8 = [22 x i8] c"error in select(): %m\00"
@.str.9 = [14 x i8] c"returning -1\0A\00"
@WNOHANG = global i32 0
@LOG_INFO = global i32 0
@.str.10 = [16 x i8] c"%s returned: %s\00"
@LOG_WARNING = global i32 0
@.str.11 = [50 x i8] c"caught exceptional exit status from child program\00"
@.str.12 = [30 x i8] c"Could not fork process %s: %m\00"
define i32 @rhn_do_action() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca [512 x i8]
%6 = alloca [2 x i8*]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [10 x i8]
%10 = alloca i32
%11 = alloca %struct.timeval
%12 = alloca i32
%13 = alloca i32
%14 = bitcast [512 x i8]* %5 to i8*
%15 = load i32, i32* @R_OK
%16 = call i64 @access(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %0
%19 = load i32, i32* @LOG_DEBUG
%20 = call i32 (i32, i8*, ...) @syslog(i32 %19, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %206
21: ; preds = %0
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%23 = call i64 @parse_systemid_path(i8* %22, i32 512)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* @LOG_DEBUG
%27 = call i32 (i32, i8*, ...) @syslog(i32 %26, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %206
28: ; preds = %21
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%30 = load i32, i32* @R_OK
%31 = call i64 @access(i8* %29, i32 %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %28
%34 = load i32, i32* @LOG_DEBUG
%35 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%36 = call i32 (i32, i8*, ...) @syslog(i32 %34, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %35)
store i32 -1, i32* %1
br label %206
37: ; preds = %28
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%39 = call i64 @pipe(i32* %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* @LOG_ERR
%43 = call i32 (i32, i8*, ...) @syslog(i32 %42, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %1
br label %206
44: ; preds = %37
%45 = call i32 (...) @fork()
store i32 %45, i32* %2
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %81
47: ; preds = %44
%48 = bitcast [2 x i8*]* %6 to i8*
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%50 = load i32, i32* %49
%51 = call i32 @close(i32 %50)
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%53 = load i32, i32* %52
%54 = load i32, i32* @STDOUT_FILENO
%55 = icmp ne i32 %53, %54
br i1 %55, label %56, label %64
56: ; preds = %47
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%58 = load i32, i32* %57
%59 = load i32, i32* @STDOUT_FILENO
%60 = call i32 @dup2(i32 %58, i32 %59)
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%62 = load i32, i32* %61
%63 = call i32 @close(i32 %62)
br label %64
64: ; preds = %56, %47
%65 = load i32, i32* @STDOUT_FILENO
%66 = load i32, i32* @STDERR_FILENO
%67 = call i32 @dup2(i32 %65, i32 %66)
%68 = load i32, i32* @LOG_DEBUG
%69 = call i32 (i32, i8*, ...) @syslog(i32 %68, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%70 = call i32 (...) @unset_signal_handlers()
%71 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %71
%72 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%73 = call i32 @execv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %72)
%74 = call i32 (...) @set_signal_handlers()
%75 = load i32, i32* @LOG_ERR
%76 = load i32, i32* @errno
%77 = call i32 @strerror(i32 %76)
%78 = call i32 (i32, i8*, ...) @syslog(i32 %75, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %77)
%79 = load i32, i32* @errno
%80 = call i32 @exit(i32 %79)
unreachable
81: ; preds = %44
%82 = load i32, i32* %2
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %197
84: ; preds = %81
store i32 1, i32* %7
store i32 0, i32* %10
%85 = call i8* @malloc(i32 10)
store i8* %85, i8** %8
%86 = load i8*, i8** %8
%87 = icmp eq i8* %86, null
br i1 %87, label %88, label %91
88: ; preds = %84
%89 = load i32, i32* @LOG_ERR
%90 = call i32 (i32, i8*, ...) @syslog(i32 %89, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %1
br label %206
91: ; preds = %84
store i32 10, i32* %10
br label %92
92: ; preds = %91
%93 = load i8*, i8** %8
%94 = load i32, i32* %10
%95 = call i32 @memset(i8* %93, i8 signext 0, i32 %94)
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%97 = load i32, i32* %96
%98 = call i32 @close(i32 %97)
br label %99
99: ; preds = %186, %183, %92
%100 = load i32, i32* %7
%101 = icmp sgt i32 %100, 0
br i1 %101, label %102, label %187
102: ; preds = %99
%103 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%104 = call i32 @memset(i8* %103, i8 signext 0, i32 10)
%105 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
store i32 2, i32* %105
%106 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i64 0, i64* %106
%107 = call i32 @FD_ZERO(i32* %12)
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%109 = load i32, i32* %108
%110 = call i32 @FD_SET(i32 %109, i32* %12)
%111 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%112 = load i32, i32* %111
%113 = add nsw i32 %112, 1
%114 = call i32 @select(i32 %113, i32* %12, i32* null, i32* null, %struct.timeval* %11)
store i32 %114, i32* %7
%115 = load i32, i32* %7
%116 = icmp slt i32 %115, 0
br i1 %116, label %117, label %126
117: ; preds = %102
%118 = load i32, i32* @LOG_ERR
%119 = call i32 (i32, i8*, ...) @syslog(i32 %118, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%120 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
%121 = load i8*, i8** %8
%122 = call i32 @free(i8* %121)
%123 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%124 = load i32, i32* %123
%125 = call i32 @close(i32 %124)
store i32 -1, i32* %1
br label %206
126: ; preds = %102
%127 = load i32, i32* %7
%128 = icmp sgt i32 %127, 0
br i1 %128, label %129, label %148
129: ; preds = %126
%130 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%131 = load i32, i32* %130
%132 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%133 = call i32 @read(i32 %131, i8* %132, i32 9)
store i32 %133, i32* %13
%134 = load i32, i32* %13
%135 = icmp sgt i32 %134, 0
br i1 %135, label %136, label %146
136: ; preds = %129
%137 = load i32, i32* %13
%138 = load i32, i32* %10
%139 = add nsw i32 %138, %137
store i32 %139, i32* %10
%140 = load i8*, i8** %8
%141 = load i32, i32* %10
%142 = call i8* @realloc(i8* %140, i32 %141)
store i8* %142, i8** %8
%143 = load i8*, i8** %8
%144 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%145 = call i32 @strcat(i8* %143, i8* %144)
br label %147
146: ; preds = %129
store i32 0, i32* %7
br label %147
147: ; preds = %146, %136
br label %148
148: ; preds = %147, %126
br label %149
149: ; preds = %148
%150 = load i32, i32* %7
%151 = icmp eq i32 %150, 0
br i1 %151, label %152, label %186
152: ; preds = %149
%153 = load i32, i32* %2
%154 = load i32, i32* @WNOHANG
%155 = call i32 @waitpid(i32 %153, i32* %3, i32 %154)
store i32 %155, i32* %7
%156 = load i32, i32* %7
%157 = load i32, i32* %2
%158 = icmp eq i32 %156, %157
br i1 %158, label %159, label %180
159: ; preds = %152
%160 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%161 = call i64 @strlen(i8* %160)
%162 = icmp sgt i64 %161, 0
br i1 %162, label %163, label %167
163: ; preds = %159
%164 = load i32, i32* @LOG_INFO
%165 = load i8*, i8** %8
%166 = call i32 (i32, i8*, ...) @syslog(i32 %164, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %165)
br label %167
167: ; preds = %163, %159
%168 = load i8*, i8** %8
%169 = call i32 @free(i8* %168)
%170 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%171 = load i32, i32* %170
%172 = call i32 @close(i32 %171)
%173 = load i32, i32* %3
%174 = call i64 @WIFEXITED(i32 %173)
%175 = icmp ne i64 %174, 0
br i1 %175, label %176, label %179
176: ; preds = %167
%177 = load i32, i32* %3
%178 = call i32 @WEXITSTATUS(i32 %177)
store i32 %178, i32* %1
br label %206
179: ; preds = %167
store i32 -1, i32* %1
br label %206
180: ; preds = %152
%181 = load i32, i32* %7
%182 = icmp eq i32 %181, 0
br i1 %182, label %183, label %184
183: ; preds = %180
store i32 1, i32* %7
br label %99
184: ; preds = %180
br label %185
185: ; preds = %184
br label %186
186: ; preds = %185, %149
br label %99
187: ; preds = %99
%188 = load i32, i32* @LOG_WARNING
%189 = call i32 (i32, i8*, ...) @syslog(i32 %188, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
%190 = load i32, i32* %2
%191 = call i32 @waitpid(i32 %190, i32* %3, i32 0)
%192 = load i8*, i8** %8
%193 = call i32 @free(i8* %192)
%194 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%195 = load i32, i32* %194
%196 = call i32 @close(i32 %195)
store i32 -2, i32* %1
br label %206
197: ; preds = %81
%198 = load i32, i32* @LOG_ERR
%199 = call i32 (i32, i8*, ...) @syslog(i32 %198, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%200 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%201 = load i32, i32* %200
%202 = call i32 @close(i32 %201)
%203 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%204 = load i32, i32* %203
%205 = call i32 @close(i32 %204)
store i32 -1, i32* %1
br label %206
206: ; preds = %197, %187, %179, %176, %117, %88, %41, %33, %25, %18
%207 = load i32, i32* %1
ret i32 %207
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@.str = [27 x i8] c"/etc/sysconfig/rhn/up2date\00"
@R_OK = global i32 0
@LOG_DEBUG = global i32 0
@.str.1 = [35 x i8] c"%s does not exist or is unreadable\00"
@.str.2 = [45 x i8] c"%s does not contain valid systemIdPath entry\00"
@LOG_ERR = global i32 0
@.str.3 = [46 x i8] c"Could not create pipe for forking process; %m\00"
@STDOUT_FILENO = global i32 0
@STDERR_FILENO = global i32 0
@.str.4 = [19 x i8] c"running program %s\00"
@.str.5 = [20 x i8] c"/usr/sbin/rhn_check\00"
@.str.6 = [26 x i8] c"could not execute %s : %s\00"
@errno = global i32 0
@.str.7 = [14 x i8] c"out of memory\00"
@.str.8 = [22 x i8] c"error in select(): %m\00"
@WNOHANG = global i32 0
@LOG_INFO = global i32 0
@.str.10 = [16 x i8] c"%s returned: %s\00"
@LOG_WARNING = global i32 0
@.str.11 = [50 x i8] c"caught exceptional exit status from child program\00"
@.str.12 = [30 x i8] c"Could not fork process %s: %m\00"
@str = [13 x i8] c"returning -1\00"
define i32 @rhn_do_action() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [512 x i8]
%4 = alloca [2 x i8*]
%5 = alloca [10 x i8]
%6 = alloca %struct.timeval
%7 = alloca i32
%8 = bitcast i32* %1 to i8*
%9 = bitcast [2 x i32]* %2 to i8*
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%11 = load i32, i32* @R_OK
%12 = tail call i64 @access(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %0
%15 = load i32, i32* @LOG_DEBUG
%16 = tail call i32 (i32, i8*, ...) @syslog(i32 %15, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %165
17: ; preds = %0
%18 = call i64 @parse_systemid_path(i8* %10, i32 512)
%19 = icmp eq i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* @LOG_DEBUG
%22 = call i32 (i32, i8*, ...) @syslog(i32 %21, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %165
23: ; preds = %17
%24 = load i32, i32* @R_OK
%25 = call i64 @access(i8* %10, i32 %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %23
%28 = load i32, i32* @LOG_DEBUG
%29 = call i32 (i32, i8*, ...) @syslog(i32 %28, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %165
30: ; preds = %23
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%32 = call i64 @pipe(i32* %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %30
%35 = load i32, i32* @LOG_ERR
%36 = call i32 (i32, i8*, ...) @syslog(i32 %35, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
br label %165
37: ; preds = %30
%38 = call i32 (...) @fork()
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %69
40: ; preds = %37
%41 = bitcast [2 x i8*]* %4 to i8*
%42 = load i32, i32* %31
%43 = call i32 @close(i32 %42)
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%45 = load i32, i32* %44
%46 = load i32, i32* @STDOUT_FILENO
%47 = icmp eq i32 %45, %46
br i1 %47, label %53, label %48
48: ; preds = %40
%49 = call i32 @dup2(i32 %45, i32 %46)
%50 = load i32, i32* %44
%51 = call i32 @close(i32 %50)
%52 = load i32, i32* @STDOUT_FILENO
br label %53
53: ; preds = %48, %40
%54 = phi i32 [ %52, %48 ], [ %45, %40 ]
%55 = load i32, i32* @STDERR_FILENO
%56 = call i32 @dup2(i32 %54, i32 %55)
%57 = load i32, i32* @LOG_DEBUG
%58 = call i32 (i32, i8*, ...) @syslog(i32 %57, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%59 = call i32 (...) @unset_signal_handlers()
%60 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %60
%61 = call i32 @execv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %60)
%62 = call i32 (...) @set_signal_handlers()
%63 = load i32, i32* @LOG_ERR
%64 = load i32, i32* @errno
%65 = call i32 @strerror(i32 %64)
%66 = call i32 (i32, i8*, ...) @syslog(i32 %63, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %65)
%67 = load i32, i32* @errno
%68 = call i32 @exit(i32 %67)
unreachable
69: ; preds = %37
%70 = icmp sgt i32 %38, 0
br i1 %70, label %71, label %157
71: ; preds = %69
%72 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%73 = call dereferenceable_or_null(10) i8* @malloc(i32 10)
%74 = icmp eq i8* %73, null
br i1 %74, label %75, label %78
75: ; preds = %71
%76 = load i32, i32* @LOG_ERR
%77 = call i32 (i32, i8*, ...) @syslog(i32 %76, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %155
78: ; preds = %71
%79 = call i32 @memset(i8* %73, i8 signext 0, i32 10)
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%81 = load i32, i32* %80
%82 = call i32 @close(i32 %81)
%83 = bitcast %struct.timeval* %6 to i8*
%84 = bitcast i32* %7 to i8*
%85 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%86 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
br label %87
87: ; preds = %78, %143
%88 = phi i32 [ 10, %78 ], [ %146, %143 ]
%89 = phi i8* [ %73, %78 ], [ %145, %143 ]
%90 = call i32 @memset(i8* %72, i8 signext 0, i32 10)
store i32 2, i32* %85
store i64 0, i64* %86
%91 = call i32 @FD_ZERO(i32* %7)
%92 = load i32, i32* %31
%93 = call i32 @FD_SET(i32 %92, i32* %7)
%94 = load i32, i32* %31
%95 = add nsw i32 %94, 1
%96 = call i32 @select(i32 %95, i32* %7, i32* null, i32* null, %struct.timeval* %6)
%97 = icmp slt i32 %96, 0
br i1 %97, label %98, label %105
98: ; preds = %87
%99 = load i32, i32* @LOG_ERR
%100 = call i32 (i32, i8*, ...) @syslog(i32 %99, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%102 = call i32 @free(i8* %89)
%103 = load i32, i32* %31
%104 = call i32 @close(i32 %103)
br label %141
105: ; preds = %87
%106 = icmp eq i32 %96, 0
br i1 %106, label %115, label %107
107: ; preds = %105
%108 = load i32, i32* %31
%109 = call i32 @read(i32 %108, i8* %72, i32 9)
%110 = icmp sgt i32 %109, 0
br i1 %110, label %111, label %115
111: ; preds = %107
%112 = add nsw i32 %109, %88
%113 = call i8* @realloc(i8* %89, i32 %112)
%114 = call i32 @strcat(i8* %113, i8* %72)
br label %137
115: ; preds = %105, %107
%116 = load i32, i32* @WNOHANG
%117 = call i32 @waitpid(i32 %38, i32* %1, i32 %116)
%118 = icmp eq i32 %117, %38
br i1 %118, label %119, label %135
119: ; preds = %115
%120 = call i64 @strlen(i8* %72)
%121 = icmp sgt i64 %120, 0
br i1 %121, label %122, label %125
122: ; preds = %119
%123 = load i32, i32* @LOG_INFO
%124 = call i32 (i32, i8*, ...) @syslog(i32 %123, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %89)
br label %125
125: ; preds = %122, %119
%126 = call i32 @free(i8* %89)
%127 = load i32, i32* %31
%128 = call i32 @close(i32 %127)
%129 = load i32, i32* %1
%130 = call i64 @WIFEXITED(i32 %129)
%131 = icmp eq i64 %130, 0
br i1 %131, label %141, label %132
132: ; preds = %125
%133 = load i32, i32* %1
%134 = call i32 @WEXITSTATUS(i32 %133)
br label %141
135: ; preds = %115
%136 = icmp eq i32 %117, 0
br i1 %136, label %143, label %137
137: ; preds = %111, %135
%138 = phi i32 [ %88, %135 ], [ %112, %111 ]
%139 = phi i8* [ %89, %135 ], [ %113, %111 ]
%140 = phi i32 [ %117, %135 ], [ %96, %111 ]
br label %143
141: ; preds = %98, %132, %125
%142 = phi i32 [ -1, %125 ], [ %134, %132 ], [ -1, %98 ]
br label %155
143: ; preds = %135, %137
%144 = phi i32 [ %140, %137 ], [ 1, %135 ]
%145 = phi i8* [ %139, %137 ], [ %89, %135 ]
%146 = phi i32 [ %138, %137 ], [ %88, %135 ]
%147 = icmp sgt i32 %144, 0
br i1 %147, label %87, label %148
148: ; preds = %143
%149 = load i32, i32* @LOG_WARNING
%150 = call i32 (i32, i8*, ...) @syslog(i32 %149, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.11, i64 0, i64 0))
%151 = call i32 @waitpid(i32 %38, i32* %1, i32 0)
%152 = call i32 @free(i8* %145)
%153 = load i32, i32* %31
%154 = call i32 @close(i32 %153)
br label %155
155: ; preds = %141, %148, %75
%156 = phi i32 [ -1, %75 ], [ -2, %148 ], [ %142, %141 ]
br label %165
157: ; preds = %69
%158 = load i32, i32* @LOG_ERR
%159 = call i32 (i32, i8*, ...) @syslog(i32 %158, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%160 = load i32, i32* %31
%161 = call i32 @close(i32 %160)
%162 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%163 = load i32, i32* %162
%164 = call i32 @close(i32 %163)
br label %165
165: ; preds = %157, %155, %34, %27, %20, %14
%166 = phi i32 [ -1, %14 ], [ -1, %20 ], [ -1, %27 ], [ -1, %34 ], [ %156, %155 ], [ -1, %157 ]
ret i32 %166
}