#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_flags;
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
};
typedef int /*<<< orphan*/ sigset_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
int EINTR;
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGQUIT;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ _exit(int);
int errno;
int /*<<< orphan*/ execl(char *, char *, char *, char const *, char *);
scalar_t__ fork();
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ sigaction(int /*<<< orphan*/, struct sigaction *,
                     struct sigaction *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
scalar_t__ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
scalar_t__ waitpid(scalar_t__, int *, int /*<<< orphan*/);
int apue_system(const char *cmdstring) {
  pid_t pid;
  int status;
  struct sigaction ignore, saveintr, savequit;
  sigset_t chldmask, savemask;
  if (cmdstring == NULL)
    return 1;
  ignore.sa_handler = SIG_IGN;
  sigemptyset(&ignore.sa_mask);
  ignore.sa_flags = 0;
  if (sigaction(SIGINT, &ignore, &saveintr) < 0)
    return -1;
  if (sigaction(SIGQUIT, &ignore, &savequit) < 0)
    return -1;
  sigemptyset(&chldmask);
  sigaddset(&chldmask, SIGCHLD);
  if (sigprocmask(SIG_BLOCK, &chldmask, &savemask) < 0)
    return -1;
  if ((pid = fork()) < 0) {
    status = -1;
  } else if (pid == 0) {
    sigaction(SIGINT, &saveintr, NULL);
    sigaction(SIGQUIT, &savequit, NULL);
    sigprocmask(SIG_SETMASK, &savemask, NULL);
    printf("before calling shell: %s\n", cmdstring);
    execl("/bin/sh", "sh", "-c", cmdstring, (char *)0);
    _exit(127);
  } else {
    while (waitpid(pid, &status, 0) < 0) {
      if (errno != EINTR) {
        printf("wait cmd failed, errno = %d\n", errno);
        status = -1;
        break;
      }
    }
  }
  if (sigaction(SIGINT, &saveintr, NULL) < 0)
    return -1;
  if (sigaction(SIGQUIT, &savequit, NULL) < 0)
    return -1;
  if (sigprocmask(SIG_SETMASK, &savemask, NULL) < 0)
    return -1;
  return (status);
}


x86 assembly (clang, -O0):
<apue_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b3 <apue_system+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
call   1070 <sigemptyset@plt>
movq   $0x0,-0x30(%rbp)
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1050 <sigaction@plt>
cmp    $0x0,%rax
jge    1200 <apue_system+0x70>
movl   $0xffffffff,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1050 <sigaction@plt>
cmp    $0x0,%rax
jge    122c <apue_system+0x9c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
lea    -0x54(%rbp),%rdi
call   1070 <sigemptyset@plt>
mov    0x2d94(%rip),%rax
mov    (%rax),%esi
lea    -0x54(%rbp),%rdi
call   10a0 <sigaddset@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
jge    1273 <apue_system+0xe3>
movl   $0xffffffff,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
mov    $0x0,%al
call   10b0 <fork@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jge    1294 <apue_system+0x104>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1388 <apue_system+0x1f8>
cmpq   $0x0,-0x18(%rbp)
jne    1320 <apue_system+0x190>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <sigaction@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <sigaction@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    -0x10(%rbp),%rsi
lea    0xd14(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rcx
lea    0xd1c(%rip),%rdi
lea    0xd1a(%rip),%rsi
lea    0xd16(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1090 <execl@plt>
mov    $0x7f,%edi
call   1040 <_exit@plt>
jmp    1325 <apue_system+0x195>
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
cmp    $0x0,%rax
jge    137e <apue_system+0x1ee>
mov    0x2c73(%rip),%rax
mov    (%rax),%eax
mov    0x2c5a(%rip),%rcx
cmp    (%rcx),%eax
je     1379 <apue_system+0x1e9>
mov    0x2c5b(%rip),%rax
mov    (%rax),%esi
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x1c(%rbp)
jmp    137e <apue_system+0x1ee>
jmp    1325 <apue_system+0x195>
jmp    1383 <apue_system+0x1f3>
jmp    1388 <apue_system+0x1f8>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
lea    -0x40(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <sigaction@plt>
cmp    $0x0,%rax
jge    13b4 <apue_system+0x224>
movl   $0xffffffff,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
mov    0x2c25(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <sigaction@plt>
cmp    $0x0,%rax
jge    13e0 <apue_system+0x250>
movl   $0xffffffff,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
cmp    $0x0,%rax
jge    140c <apue_system+0x27c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1412 <apue_system+0x282>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apue_system>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
test   %rdi,%rdi
je     1305 <apue_system+0x175>
mov    %rdi,%rbx
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
lea    0x18(%rsp),%rdi
call   1070 <sigemptyset@plt>
movq   $0x0,0x10(%rsp)
mov    0x2e17(%rip),%r12
mov    (%r12),%edi
lea    0x10(%rsp),%rsi
lea    0x38(%rsp),%rdx
call   1050 <sigaction@plt>
mov    $0xffffffff,%r14d
test   %rax,%rax
js     130b <apue_system+0x17b>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
lea    0x28(%rsp),%rdx
call   1050 <sigaction@plt>
test   %rax,%rax
js     130b <apue_system+0x17b>
lea    0x24(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <sigemptyset@plt>
mov    0x2da8(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   10a0 <sigaddset@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rdx
mov    %rbp,%rsi
call   1030 <sigprocmask@plt>
test   %rax,%rax
js     130b <apue_system+0x17b>
xor    %eax,%eax
call   10b0 <fork@plt>
test   %rax,%rax
js     12a7 <apue_system+0x117>
je     131d <apue_system+0x18d>
mov    %rax,%rbp
lea    0x8(%rsp),%r13
mov    0x2d46(%rip),%rbx
mov    0x2d2f(%rip),%r15
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r13,%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
test   %rax,%rax
jns    12af <apue_system+0x11f>
mov    (%rbx),%esi
cmp    (%r15),%esi
je     1280 <apue_system+0xf0>
lea    0xd85(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0xffffffff,0x8(%rsp)
ff
mov    (%r12),%edi
lea    0x38(%rsp),%rsi
xor    %edx,%edx
call   1050 <sigaction@plt>
test   %rax,%rax
js     130b <apue_system+0x17b>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
lea    0x28(%rsp),%rsi
xor    %edx,%edx
call   1050 <sigaction@plt>
test   %rax,%rax
js     130b <apue_system+0x17b>
mov    0x2cf3(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    $0xffffffff,%r14d
test   %rax,%rax
js     130b <apue_system+0x17b>
mov    0x8(%rsp),%r14d
jmp    130b <apue_system+0x17b>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r12),%edi
lea    0x38(%rsp),%rsi
xor    %edx,%edx
call   1050 <sigaction@plt>
mov    0x2cac(%rip),%rax
mov    (%rax),%edi
lea    0x28(%rsp),%rsi
xor    %edx,%edx
call   1050 <sigaction@plt>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
lea    0xca2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcab(%rip),%rdi
lea    0xca9(%rip),%rsi
lea    0xca5(%rip),%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1090 <execl@plt>
mov    $0x7f,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGCHLD = global i32 0
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
@.str = [26 x i8] c"before calling shell: %s\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [3 x i8] c"sh\00"
@.str.3 = [3 x i8] c"-c\00"
@errno = global i32 0
@EINTR = global i32 0
@.str.4 = [29 x i8] c"wait cmd failed, errno = %d\0A\00"
define i32 @apue_system(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.sigaction
%7 = alloca %struct.sigaction
%8 = alloca %struct.sigaction
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %88
14: ; preds = %1
%15 = load i32, i32* @SIG_IGN
%16 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %6, i32 0, i32 2
store i32 %15, i32* %16
%17 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %6, i32 0, i32 1
%18 = call i32 @sigemptyset(i32* %17)
%19 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %6, i32 0, i32 0
store i64 0, i64* %19
%20 = load i32, i32* @SIGINT
%21 = call i64 @sigaction(i32 %20, %struct.sigaction* %6, %struct.sigaction* %7)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %14
store i32 -1, i32* %2
br label %88
24: ; preds = %14
%25 = load i32, i32* @SIGQUIT
%26 = call i64 @sigaction(i32 %25, %struct.sigaction* %6, %struct.sigaction* %8)
%27 = icmp slt i64 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 -1, i32* %2
br label %88
29: ; preds = %24
%30 = call i32 @sigemptyset(i32* %9)
%31 = load i32, i32* @SIGCHLD
%32 = call i32 @sigaddset(i32* %9, i32 %31)
%33 = load i32, i32* @SIG_BLOCK
%34 = call i64 @sigprocmask(i32 %33, i32* %9, i32* %10)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %29
store i32 -1, i32* %2
br label %88
37: ; preds = %29
%38 = call i64 (...) @fork()
store i64 %38, i64* %4
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %37
store i32 -1, i32* %5
br label %71
41: ; preds = %37
%42 = load i64, i64* %4
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %56
44: ; preds = %41
%45 = load i32, i32* @SIGINT
%46 = call i64 @sigaction(i32 %45, %struct.sigaction* %7, %struct.sigaction* null)
%47 = load i32, i32* @SIGQUIT
%48 = call i64 @sigaction(i32 %47, %struct.sigaction* %8, %struct.sigaction* null)
%49 = load i32, i32* @SIG_SETMASK
%50 = call i64 @sigprocmask(i32 %49, i32* %10, i32* null)
%51 = load i8*, i8** %3
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %51)
%53 = load i8*, i8** %3
%54 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %53, i8* null)
%55 = call i32 @_exit(i32 127)
unreachable
56: ; preds = %41
br label %57
57: ; preds = %68, %56
%58 = load i64, i64* %4
%59 = call i64 @waitpid(i64 %58, i32* %5, i32 0)
%60 = icmp slt i64 %59, 0
br i1 %60, label %61, label %69
61: ; preds = %57
%62 = load i32, i32* @errno
%63 = load i32, i32* @EINTR
%64 = icmp ne i32 %62, %63
br i1 %64, label %65, label %68
65: ; preds = %61
%66 = load i32, i32* @errno
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %66)
store i32 -1, i32* %5
br label %69
68: ; preds = %61
br label %57
69: ; preds = %65, %57
br label %70
70: ; preds = %69
br label %71
71: ; preds = %70, %40
%72 = load i32, i32* @SIGINT
%73 = call i64 @sigaction(i32 %72, %struct.sigaction* %7, %struct.sigaction* null)
%74 = icmp slt i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %71
store i32 -1, i32* %2
br label %88
76: ; preds = %71
%77 = load i32, i32* @SIGQUIT
%78 = call i64 @sigaction(i32 %77, %struct.sigaction* %8, %struct.sigaction* null)
%79 = icmp slt i64 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %76
store i32 -1, i32* %2
br label %88
81: ; preds = %76
%82 = load i32, i32* @SIG_SETMASK
%83 = call i64 @sigprocmask(i32 %82, i32* %10, i32* null)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %81
store i32 -1, i32* %2
br label %88
86: ; preds = %81
%87 = load i32, i32* %5
store i32 %87, i32* %2
br label %88
88: ; preds = %86, %85, %80, %75, %36, %28, %23, %13
%89 = load i32, i32* %2
ret i32 %89
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
@SIGINT = global i32 0
@SIGQUIT = global i32 0
@SIGCHLD = global i32 0
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
@.str = [26 x i8] c"before calling shell: %s\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@.str.2 = [3 x i8] c"sh\00"
@.str.3 = [3 x i8] c"-c\00"
@errno = global i32 0
@EINTR = global i32 0
@.str.4 = [29 x i8] c"wait cmd failed, errno = %d\0A\00"
define i32 @apue_system(i8* %0) {
%2 = alloca i32
%3 = alloca %struct.sigaction
%4 = alloca %struct.sigaction
%5 = alloca %struct.sigaction
%6 = alloca i32
%7 = alloca i32
%8 = bitcast i32* %2 to i8*
%9 = bitcast %struct.sigaction* %3 to i8*
%10 = bitcast %struct.sigaction* %4 to i8*
%11 = bitcast %struct.sigaction* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = icmp eq i8* %0, null
br i1 %14, label %74, label %15
15: ; preds = %1
%16 = load i32, i32* @SIG_IGN
%17 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
store i32 %16, i32* %17
%18 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
%19 = call i32 @sigemptyset(i32* %18)
%20 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store i64 0, i64* %20
%21 = load i32, i32* @SIGINT
%22 = call i64 @sigaction(i32 %21, %struct.sigaction* %3, %struct.sigaction* %4)
%23 = icmp slt i64 %22, 0
br i1 %23, label %74, label %24
24: ; preds = %15
%25 = load i32, i32* @SIGQUIT
%26 = call i64 @sigaction(i32 %25, %struct.sigaction* %3, %struct.sigaction* %5)
%27 = icmp slt i64 %26, 0
br i1 %27, label %74, label %28
28: ; preds = %24
%29 = call i32 @sigemptyset(i32* %6)
%30 = load i32, i32* @SIGCHLD
%31 = call i32 @sigaddset(i32* %6, i32 %30)
%32 = load i32, i32* @SIG_BLOCK
%33 = call i64 @sigprocmask(i32 %32, i32* %6, i32* %7)
%34 = icmp slt i64 %33, 0
br i1 %34, label %74, label %35
35: ; preds = %28
%36 = call i64 (...) @fork()
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 -1, i32* %2
br label %60
39: ; preds = %35
%40 = icmp eq i64 %36, 0
br i1 %40, label %41, label %51
41: ; preds = %39
%42 = load i32, i32* @SIGINT
%43 = call i64 @sigaction(i32 %42, %struct.sigaction* %4, %struct.sigaction* null)
%44 = load i32, i32* @SIGQUIT
%45 = call i64 @sigaction(i32 %44, %struct.sigaction* %5, %struct.sigaction* null)
%46 = load i32, i32* @SIG_SETMASK
%47 = call i64 @sigprocmask(i32 %46, i32* %7, i32* null)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%49 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* null)
%50 = call i32 @_exit(i32 127)
unreachable
51: ; preds = %39, %54
%52 = call i64 @waitpid(i64 %36, i32* %2, i32 0)
%53 = icmp slt i64 %52, 0
br i1 %53, label %54, label %60
54: ; preds = %51
%55 = load i32, i32* @errno
%56 = load i32, i32* @EINTR
%57 = icmp eq i32 %55, %56
br i1 %57, label %51, label %58
58: ; preds = %54
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %55)
store i32 -1, i32* %2
br label %60
60: ; preds = %51, %58, %38
%61 = load i32, i32* @SIGINT
%62 = call i64 @sigaction(i32 %61, %struct.sigaction* %4, %struct.sigaction* null)
%63 = icmp slt i64 %62, 0
br i1 %63, label %74, label %64
64: ; preds = %60
%65 = load i32, i32* @SIGQUIT
%66 = call i64 @sigaction(i32 %65, %struct.sigaction* %5, %struct.sigaction* null)
%67 = icmp slt i64 %66, 0
br i1 %67, label %74, label %68
68: ; preds = %64
%69 = load i32, i32* @SIG_SETMASK
%70 = call i64 @sigprocmask(i32 %69, i32* %7, i32* null)
%71 = icmp slt i64 %70, 0
%72 = load i32, i32* %2
%73 = select i1 %71, i32 -1, i32 %72
br label %74
74: ; preds = %68, %64, %60, %28, %24, %15, %1
%75 = phi i32 [ 1, %1 ], [ -1, %15 ], [ -1, %24 ], [ -1, %28 ], [ -1, %60 ], [ -1, %64 ], [ %73, %68 ]
ret i32 %75
}