#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 */
struct sigaction {
  scalar_t__ sa_handler;
};
typedef int pid_t;

/* Variables and functions */
int EINTR;
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ SIGCHLD;
void *SIG_DFL;
scalar_t__ SIG_IGN;
int WEXITSTATUS(int);
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ close(int);
int errno;
int /*<<< orphan*/ execvp(char *, char **);
scalar_t__ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fork();
int pipe(int *);
int read(int, int *, int);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             struct sigaction *);
int waitpid(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, int *, int);
int spawnvp(int mode, char *path, char *argv[]) {
  pid_t pid;
  int err;
  int status;
  struct sigaction oldAction;
  struct sigaction newAction;
  int status_pipe[2];
  if (pipe(status_pipe) == -1)
    return -1;
  if (fcntl(status_pipe[1], F_SETFD, FD_CLOEXEC)) {
    close(status_pipe[0]);
    close(status_pipe[1]);
    return -1;
  }
  oldAction.sa_handler = SIG_DFL;
  if (mode == 0) {
    sigaction(SIGCHLD, NULL, &oldAction);
    if (oldAction.sa_handler == SIG_IGN) {
      newAction = oldAction;
      newAction.sa_handler = SIG_DFL;
      sigaction(SIGCHLD, &newAction, NULL);
    }
  }
  err = pid = fork();
  if (pid == 0) {
    close(status_pipe[0]);
    execvp(path, argv);
    write(status_pipe[1], &errno, sizeof errno);
    _exit(127);
  }
  close(status_pipe[1]);
  if (err != -1)
    err = read(status_pipe[0], &errno, sizeof errno);
  if (err != -1) {
    if (err > 0) {
      err = errno;
      waitpid(pid, NULL, 0);
      errno = err;
      err = -1;
    } else if (mode == 0) {
      do {
        err = waitpid(pid, &status, 0);
      } while (err == -1 && errno == EINTR);
      if (err == pid)
        err = WEXITSTATUS(status);
    }
  }
  if (oldAction.sa_handler == SIG_IGN)
    sigaction(SIGCHLD, &oldAction, NULL);
  close(status_pipe[0]);
  return err;
}


x86 assembly (clang, -O0):
<spawnvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
jne    11e1 <spawnvp+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fd <spawnvp+0x24d>
mov    -0x3c(%rbp),%edi
mov    0x2de5(%rip),%rax
mov    (%rax),%esi
mov    0x2dd4(%rip),%rax
mov    (%rax),%edx
call   1050 <fcntl@plt>
cmp    $0x0,%rax
je     1221 <spawnvp+0x71>
mov    -0x40(%rbp),%edi
call   1070 <close@plt>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fd <spawnvp+0x24d>
mov    0x2d88(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1294 <spawnvp+0xe4>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x30(%rbp),%rdx
call   1040 <sigaction@plt>
mov    -0x30(%rbp),%rax
mov    0x2d86(%rip),%rcx
cmp    (%rcx),%rax
jne    128f <spawnvp+0xdf>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x2d3e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <sigaction@plt>
jmp    1294 <spawnvp+0xe4>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    12de <spawnvp+0x12e>
mov    -0x40(%rbp),%edi
call   1070 <close@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10c0 <execvp@plt>
mov    -0x3c(%rbp),%edi
mov    0x2cf6(%rip),%rsi
mov    $0x4,%edx
call   1060 <write@plt>
mov    $0x7f,%edi
call   1030 <_exit@plt>
mov    -0x3c(%rbp),%edi
call   1070 <close@plt>
cmpl   $0xffffffff,-0x20(%rbp)
je     1307 <spawnvp+0x157>
mov    -0x40(%rbp),%edi
mov    0x2cc6(%rip),%rsi
mov    $0x4,%edx
call   1090 <read@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
je     13c5 <spawnvp+0x215>
cmpl   $0x0,-0x20(%rbp)
jle    134d <spawnvp+0x19d>
mov    0x2c9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    -0x20(%rbp),%ecx
mov    0x2c81(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x20(%rbp)
jmp    13c0 <spawnvp+0x210>
cmpl   $0x0,-0x8(%rbp)
jne    13bb <spawnvp+0x20b>
jmp    135c <spawnvp+0x1ac>
mov    -0x1c(%rbp),%edi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x20(%rbp)
mov    %al,-0x41(%rbp)
jne    1394 <spawnvp+0x1e4>
mov    0x2c3d(%rip),%rax
mov    (%rax),%eax
mov    0x2c2c(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    135c <spawnvp+0x1ac>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    13b6 <spawnvp+0x206>
mov    -0x24(%rbp),%edi
call   10a0 <WEXITSTATUS@plt>
mov    %eax,-0x20(%rbp)
jmp    13bb <spawnvp+0x20b>
jmp    13c0 <spawnvp+0x210>
jmp    13c5 <spawnvp+0x215>
mov    -0x30(%rbp),%rax
mov    0x2c10(%rip),%rcx
cmp    (%rcx),%rax
jne    13ef <spawnvp+0x23f>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <sigaction@plt>
mov    -0x40(%rbp),%edi
call   1070 <close@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawnvp>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%rbp
mov    %edi,%r15d
mov    %rsp,%rdi
call   1080 <pipe@plt>
cmp    $0xffffffff,%eax
je     1208 <spawnvp+0x58>
mov    0x4(%rsp),%edi
mov    0x2df3(%rip),%rax
mov    (%rax),%esi
mov    0x2de2(%rip),%rax
mov    (%rax),%edx
call   1050 <fcntl@plt>
test   %rax,%rax
je     1212 <spawnvp+0x62>
mov    (%rsp),%edi
call   1070 <close@plt>
mov    $0xffffffff,%ebp
mov    0x4(%rsp),%edi
jmp    1324 <spawnvp+0x174>
mov    $0xffffffff,%ebp
jmp    1329 <spawnvp+0x179>
mov    0x2d97(%rip),%rbx
mov    (%rbx),%rax
mov    %rax,0x8(%rsp)
test   %r15d,%r15d
jne    1266 <spawnvp+0xb6>
mov    0x2dbb(%rip),%r12
mov    (%r12),%edi
lea    0x8(%rsp),%rdx
xor    %esi,%esi
call   1040 <sigaction@plt>
mov    0x8(%rsp),%rax
mov    0x2d97(%rip),%rcx
cmp    (%rcx),%rax
jne    1266 <spawnvp+0xb6>
mov    (%rbx),%rax
mov    %rax,0x18(%rsp)
mov    (%r12),%edi
lea    0x18(%rsp),%rsi
xor    %edx,%edx
call   1040 <sigaction@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %eax,%eax
je     1338 <spawnvp+0x188>
mov    %eax,%ebx
mov    0x4(%rsp),%edi
call   1070 <close@plt>
mov    $0xffffffff,%ebp
cmp    $0xffffffff,%ebx
je     12fb <spawnvp+0x14b>
mov    (%rsp),%edi
mov    0x2d2c(%rip),%r14
mov    %r14,%rsi
mov    $0x4,%edx
call   1090 <read@plt>
cmp    $0xffffffff,%eax
je     12fb <spawnvp+0x14b>
test   %eax,%eax
jle    12bd <spawnvp+0x10d>
mov    (%r14),%r15d
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    %r15d,(%r14)
jmp    12fb <spawnvp+0x14b>
mov    %eax,%ebp
test   %r15d,%r15d
jne    12fb <spawnvp+0x14b>
lea    0x14(%rsp),%r15
mov    0x2ce8(%rip),%r12
mov    %ebx,%edi
mov    %r15,%rsi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    12ec <spawnvp+0x13c>
mov    (%r12),%eax
cmp    %eax,(%r14)
je     12d0 <spawnvp+0x120>
cmp    %ebx,%ebp
jne    12fb <spawnvp+0x14b>
mov    0x14(%rsp),%edi
call   10a0 <WEXITSTATUS@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%rax
mov    0x2cd9(%rip),%rcx
cmp    (%rcx),%rax
jne    1321 <spawnvp+0x171>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1040 <sigaction@plt>
mov    (%rsp),%edi
call   1070 <close@plt>
mov    %ebp,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rsp),%edi
call   1070 <close@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10c0 <execvp@plt>
mov    0x4(%rsp),%edi
mov    0x2c6a(%rip),%rsi
mov    $0x4,%edx
call   1060 <write@plt>
mov    $0x7f,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.sigaction = type { i64 }
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@SIG_DFL = global i8* null
@SIGCHLD = global i32 0
@SIG_IGN = global i64 0
@errno = global i32 0
@EINTR = global i32 0
define i32 @spawnvp(i32 %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sigaction
%12 = alloca %struct.sigaction
%13 = alloca [2 x i32]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%15 = call i32 @pipe(i32* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 -1, i32* %4
br label %129
18: ; preds = %3
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 1
%20 = load i32, i32* %19
%21 = load i32, i32* @F_SETFD
%22 = load i32, i32* @FD_CLOEXEC
%23 = call i64 @fcntl(i32 %20, i32 %21, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %18
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%27 = load i32, i32* %26
%28 = call i32 @close(i32 %27)
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 1
%30 = load i32, i32* %29
%31 = call i32 @close(i32 %30)
store i32 -1, i32* %4
br label %129
32: ; preds = %18
%33 = load i8*, i8** @SIG_DFL
%34 = ptrtoint i8* %33 to i64
%35 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %11, i32 0, i32 0
store i64 %34, i64* %35
%36 = load i32, i32* %5
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %54
38: ; preds = %32
%39 = load i32, i32* @SIGCHLD
%40 = call i32 @sigaction(i32 %39, %struct.sigaction* null, %struct.sigaction* %11)
%41 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %11, i32 0, i32 0
%42 = load i64, i64* %41
%43 = load i64, i64* @SIG_IGN
%44 = icmp eq i64 %42, %43
br i1 %44, label %45, label %53
45: ; preds = %38
%46 = bitcast %struct.sigaction* %12 to i8*
%47 = bitcast %struct.sigaction* %11 to i8*
%48 = load i8*, i8** @SIG_DFL
%49 = ptrtoint i8* %48 to i64
%50 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %12, i32 0, i32 0
store i64 %49, i64* %50
%51 = load i32, i32* @SIGCHLD
%52 = call i32 @sigaction(i32 %51, %struct.sigaction* %12, %struct.sigaction* null)
br label %53
53: ; preds = %45, %38
br label %54
54: ; preds = %53, %32
%55 = call i32 (...) @fork()
store i32 %55, i32* %8
store i32 %55, i32* %9
%56 = load i32, i32* %8
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %69
58: ; preds = %54
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%60 = load i32, i32* %59
%61 = call i32 @close(i32 %60)
%62 = load i8*, i8** %6
%63 = load i8**, i8*** %7
%64 = call i32 @execvp(i8* %62, i8** %63)
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 1
%66 = load i32, i32* %65
%67 = call i32 @write(i32 %66, i32* @errno, i32 4)
%68 = call i32 @_exit(i32 127)
unreachable
69: ; preds = %54
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 1
%71 = load i32, i32* %70
%72 = call i32 @close(i32 %71)
%73 = load i32, i32* %9
%74 = icmp ne i32 %73, -1
br i1 %74, label %75, label %79
75: ; preds = %69
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%77 = load i32, i32* %76
%78 = call i32 @read(i32 %77, i32* @errno, i32 4)
store i32 %78, i32* %9
br label %79
79: ; preds = %75, %69
%80 = load i32, i32* %9
%81 = icmp ne i32 %80, -1
br i1 %81, label %82, label %116
82: ; preds = %79
%83 = load i32, i32* %9
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %90
85: ; preds = %82
%86 = load i32, i32* @errno
store i32 %86, i32* %9
%87 = load i32, i32* %8
%88 = call i32 @waitpid(i32 %87, i32* null, i32 0)
%89 = load i32, i32* %9
store i32 %89, i32* @errno
store i32 -1, i32* %9
br label %115
90: ; preds = %82
%91 = load i32, i32* %5
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %114
93: ; preds = %90
br label %94
94: ; preds = %104, %93
%95 = load i32, i32* %8
%96 = call i32 @waitpid(i32 %95, i32* %10, i32 0)
store i32 %96, i32* %9
br label %97
97: ; preds = %94
%98 = load i32, i32* %9
%99 = icmp eq i32 %98, -1
br i1 %99, label %100, label %104
100: ; preds = %97
%101 = load i32, i32* @errno
%102 = load i32, i32* @EINTR
%103 = icmp eq i32 %101, %102
br label %104
104: ; preds = %100, %97
%105 = phi i1 [ false, %97 ], [ %103, %100 ]
br i1 %105, label %94, label %106
106: ; preds = %104
%107 = load i32, i32* %9
%108 = load i32, i32* %8
%109 = icmp eq i32 %107, %108
br i1 %109, label %110, label %113
110: ; preds = %106
%111 = load i32, i32* %10
%112 = call i32 @WEXITSTATUS(i32 %111)
store i32 %112, i32* %9
br label %113
113: ; preds = %110, %106
br label %114
114: ; preds = %113, %90
br label %115
115: ; preds = %114, %85
br label %116
116: ; preds = %115, %79
%117 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %11, i32 0, i32 0
%118 = load i64, i64* %117
%119 = load i64, i64* @SIG_IGN
%120 = icmp eq i64 %118, %119
br i1 %120, label %121, label %124
121: ; preds = %116
%122 = load i32, i32* @SIGCHLD
%123 = call i32 @sigaction(i32 %122, %struct.sigaction* %11, %struct.sigaction* null)
br label %124
124: ; preds = %121, %116
%125 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%126 = load i32, i32* %125
%127 = call i32 @close(i32 %126)
%128 = load i32, i32* %9
store i32 %128, i32* %4
br label %129
129: ; preds = %124, %25, %17
%130 = load i32, i32* %4
ret i32 %130
}

LLVM IR (-O2):
%struct.sigaction = type { i64 }
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
@SIG_DFL = global i8* null
@SIGCHLD = global i32 0
@SIG_IGN = global i64 0
@errno = global i32 0
@EINTR = global i32 0
define i32 @spawnvp(i32 %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction
%6 = alloca %struct.sigaction
%7 = alloca [2 x i32]
%8 = bitcast i32* %4 to i8*
%9 = bitcast %struct.sigaction* %5 to i8*
%10 = bitcast %struct.sigaction* %6 to i8*
%11 = bitcast [2 x i32]* %7 to i8*
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%13 = call i32 @pipe(i32* %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %93, label %15
15: ; preds = %3
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%17 = load i32, i32* %16
%18 = load i32, i32* @F_SETFD
%19 = load i32, i32* @FD_CLOEXEC
%20 = call i64 @fcntl(i32 %17, i32 %18, i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %15
%23 = load i32, i32* %12
%24 = call i32 @close(i32 %23)
%25 = load i32, i32* %16
br label %89
26: ; preds = %15
%27 = load i8*, i8** @SIG_DFL
%28 = ptrtoint i8* %27 to i64
%29 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i64 0, i32 0
store i64 %28, i64* %29
%30 = icmp eq i32 %0, 0
br i1 %30, label %31, label %43
31: ; preds = %26
%32 = load i32, i32* @SIGCHLD
%33 = call i32 @sigaction(i32 %32, %struct.sigaction* null, %struct.sigaction* %5)
%34 = load i64, i64* %29
%35 = load i64, i64* @SIG_IGN
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %43
37: ; preds = %31
%38 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %6, i64 0, i32 0
%39 = load i8*, i8** @SIG_DFL
%40 = ptrtoint i8* %39 to i64
store i64 %40, i64* %38
%41 = load i32, i32* @SIGCHLD
%42 = call i32 @sigaction(i32 %41, %struct.sigaction* %6, %struct.sigaction* null)
br label %43
43: ; preds = %31, %37, %26
%44 = call i32 (...) @fork()
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %43
%47 = load i32, i32* %12
%48 = call i32 @close(i32 %47)
%49 = call i32 @execvp(i8* %1, i8** %2)
%50 = load i32, i32* %16
%51 = call i32 @write(i32 %50, i32* @errno, i32 4)
%52 = call i32 @_exit(i32 127)
unreachable
53: ; preds = %43
%54 = load i32, i32* %16
%55 = call i32 @close(i32 %54)
%56 = icmp eq i32 %44, -1
br i1 %56, label %79, label %57
57: ; preds = %53
%58 = load i32, i32* %12
%59 = call i32 @read(i32 %58, i32* @errno, i32 4)
%60 = icmp eq i32 %59, -1
br i1 %60, label %79, label %61
61: ; preds = %57
%62 = icmp sgt i32 %59, 0
br i1 %62, label %63, label %66
63: ; preds = %61
%64 = load i32, i32* @errno
%65 = call i32 @waitpid(i32 %44, i32* null, i32 0)
store i32 %64, i32* @errno
br label %79
66: ; preds = %61
br i1 %30, label %67, label %79
67: ; preds = %66, %67
%68 = call i32 @waitpid(i32 %44, i32* %4, i32 0)
%69 = icmp eq i32 %68, -1
%70 = load i32, i32* @errno
%71 = load i32, i32* @EINTR
%72 = icmp eq i32 %70, %71
%73 = select i1 %69, i1 %72, i1 false
br i1 %73, label %67, label %74
74: ; preds = %67
%75 = icmp eq i32 %68, %44
br i1 %75, label %76, label %79
76: ; preds = %74
%77 = load i32, i32* %4
%78 = call i32 @WEXITSTATUS(i32 %77)
br label %79
79: ; preds = %53, %63, %74, %76, %66, %57
%80 = phi i32 [ -1, %63 ], [ %78, %76 ], [ %68, %74 ], [ %59, %66 ], [ -1, %57 ], [ -1, %53 ]
%81 = load i64, i64* %29
%82 = load i64, i64* @SIG_IGN
%83 = icmp eq i64 %81, %82
br i1 %83, label %84, label %87
84: ; preds = %79
%85 = load i32, i32* @SIGCHLD
%86 = call i32 @sigaction(i32 %85, %struct.sigaction* %5, %struct.sigaction* null)
br label %87
87: ; preds = %84, %79
%88 = load i32, i32* %12
br label %89
89: ; preds = %22, %87
%90 = phi i32 [ %88, %87 ], [ %25, %22 ]
%91 = phi i32 [ %80, %87 ], [ -1, %22 ]
%92 = call i32 @close(i32 %90)
br label %93
93: ; preds = %89, %3
%94 = phi i32 [ -1, %3 ], [ %91, %89 ]
ret i32 %94
}