#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 */

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
int WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int /*<<< orphan*/ alarm(long);
void *atoi(int /*<<< orphan*/);
int /*<<< orphan*/ cpu_intensive();
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int getopt(int, char **, char *);
int getpid();
int kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ usage();
int wait(int *);
int main(int argc, char **argv) {
  int c, i, pid, children = 0;
  int nb_cpu = 0;
  long timeout = 0;
  while ((c = getopt(argc, argv, "c:t:")) != -1) {
    switch (c) {
    case 'c':
      nb_cpu = atoi(optarg);
      printf("nbcpu= %d \n", nb_cpu);
      break;
    case 't':
      timeout = atoi(optarg);
      printf("timeout= %d \n", timeout);
      break;
    default:
      usage();
      exit(0);
      return 0;
    }
  }
  while (nb_cpu) {
    switch (pid = fork()) {
    case 0:
      alarm(timeout);
      exit(cpu_intensive());
    case -1:
      err(stderr, "fork failed: %s\n", strerror(errno));
      break;
    default:
      ++children;
    }
    --nb_cpu;
  }
  while (children) {
    int status, ret;
    if ((pid = wait(&status)) > 0) {
      --children;
      if (WIFEXITED(status)) {
        if ((ret = WEXITSTATUS(status)) == 0) {
          printf("worker %i returned normally\n", pid);
        } else {
          printf("worker %i returned error %i\n", pid, ret);
          if (signal(SIGUSR1, SIG_IGN) == SIG_ERR)
            printf("handler error: %s\n", strerror(errno));
          if (kill(-1 * getpid(), SIGUSR1) == -1)
            printf("kill error: %s\n", strerror(errno));
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdc6(%rip),%rdx
call   10c0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     12d3 <main+0xd3>
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x63,%eax
je     1270 <main+0x70>
jmp    125f <main+0x5f>
mov    -0x3c(%rbp),%eax
sub    $0x74,%eax
je     1297 <main+0x97>
jmp    12c0 <main+0xc0>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
call   10d0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ce <main+0xce>
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
call   10d0 <atoi@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ce <main+0xce>
mov    $0x0,%al
call   10a0 <usage@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
jmp    122c <main+0x2c>
jmp    12d8 <main+0xd8>
cmpl   $0x0,-0x24(%rbp)
je     136e <main+0x16e>
xor    %eax,%eax
call   1120 <fork@plt>
mov    %eax,-0x1c(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x40(%rbp)
sub    $0xffffffff,%eax
je     1326 <main+0x126>
jmp    12ff <main+0xff>
mov    -0x40(%rbp),%eax
test   %eax,%eax
jne    1357 <main+0x157>
jmp    130f <main+0x10f>
mov    -0x30(%rbp),%rdi
call   1050 <alarm@plt>
mov    $0x0,%al
call   1090 <cpu_intensive@plt>
mov    %eax,%edi
call   10f0 <exit@plt>
mov    0x2c9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    0x2c7f(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    -0x44(%rbp),%edi
mov    %rax,%rdx
lea    0xcd2(%rip),%rsi
call   1080 <err@plt>
jmp    1360 <main+0x160>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    12d8 <main+0xd8>
jmp    1373 <main+0x173>
cmpl   $0x0,-0x20(%rbp)
je     1488 <main+0x288>
lea    -0x34(%rbp),%rdi
call   1110 <wait@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1483 <main+0x283>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x34(%rbp),%edi
call   10e0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     147e <main+0x27e>
mov    -0x34(%rbp),%edi
call   10b0 <WEXITSTATUS@plt>
mov    %eax,-0x38(%rbp)
cmp    $0x0,%eax
jne    13d7 <main+0x1d7>
mov    -0x1c(%rbp),%esi
lea    0xc65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1479 <main+0x279>
mov    -0x1c(%rbp),%esi
mov    -0x38(%rbp),%edx
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%edi
mov    0x2bdd(%rip),%rax
mov    (%rax),%esi
call   1060 <signal@plt>
mov    0x2bb7(%rip),%rcx
cmp    (%rcx),%rax
jne    1431 <main+0x231>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    %rax,%rsi
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
imul   $0xffffffff,%eax,%edi
mov    0x2b9b(%rip),%rax
mov    (%rax),%esi
call   1070 <kill@plt>
cmp    $0xffffffff,%eax
jne    1474 <main+0x274>
mov    0x2b5c(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    %rax,%rsi
lea    0xc10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1479 <main+0x279>
jmp    147e <main+0x27e>
jmp    1483 <main+0x283>
jmp    1373 <main+0x173>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
lea    0xde9(%rip),%r12
mov    0x2dda(%rip),%r13
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    124d <main+0x4d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%r13),%edi
call   10d0 <atoi@plt>
mov    %rax,%r14
lea    0xdce(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   10c0 <getopt@plt>
cmp    $0x74,%eax
je     1230 <main+0x30>
cmp    $0x63,%eax
jne    1282 <main+0x82>
mov    0x0(%r13),%edi
call   10d0 <atoi@plt>
mov    %rax,%rbx
lea    0xd8e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    124d <main+0x4d>
cmp    $0xffffffff,%eax
jne    13ee <main+0x1ee>
test   %ebx,%ebx
je     13dd <main+0x1dd>
mov    0x2d2e(%rip),%r13
lea    0xd7e(%rip),%r15
xor    %r12d,%r12d
jmp    12d4 <main+0xd4>
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%r13),%ebp
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rax,%rdx
call   1080 <err@plt>
add    $0xffffffff,%ebx
je     12ee <main+0xee>
xor    %eax,%eax
call   1120 <fork@plt>
cmp    $0xffffffff,%eax
je     12b0 <main+0xb0>
test   %eax,%eax
je     13fc <main+0x1fc>
add    $0x1,%r12d
jmp    12cf <main+0xcf>
test   %r12d,%r12d
je     13dd <main+0x1dd>
lea    0x4(%rsp),%rbx
lea    0xd2d(%rip),%r13
mov    0x2cd6(%rip),%r14
mov    0x2caf(%rip),%r15
jmp    1329 <main+0x129>
mov    %r13,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
nop
test   %r12d,%r12d
je     13dd <main+0x1dd>
mov    %rbx,%rdi
call   1110 <wait@plt>
test   %eax,%eax
jle    1320 <main+0x120>
mov    %eax,%ebp
add    $0xffffffff,%r12d
mov    0x4(%rsp),%edi
call   10e0 <WIFEXITED@plt>
test   %rax,%rax
je     1320 <main+0x120>
mov    0x4(%rsp),%edi
call   10b0 <WEXITSTATUS@plt>
test   %eax,%eax
je     1313 <main+0x113>
lea    0xcf0(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r14),%edi
mov    0x2c66(%rip),%rax
mov    (%rax),%esi
call   1060 <signal@plt>
cmp    (%r15),%rax
jne    139d <main+0x19d>
mov    0x2c33(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xcd7(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
neg    %eax
mov    (%r14),%esi
mov    %eax,%edi
call   1070 <kill@plt>
cmp    $0xffffffff,%eax
jne    1320 <main+0x120>
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xcaf(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1320 <main+0x120>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   10a0 <usage@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
mov    %r14,%rdi
call   1050 <alarm@plt>
xor    %eax,%eax
call   1090 <cpu_intensive@plt>
mov    %eax,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"c:t:\00"
@optarg = global i32 0
@.str.1 = [12 x i8] c"nbcpu= %d \0A\00"
@.str.2 = [14 x i8] c"timeout= %d \0A\00"
@stderr = global i32 0
@.str.3 = [17 x i8] c"fork failed: %s\0A\00"
@errno = global i32 0
@.str.4 = [29 x i8] c"worker %i returned normally\0A\00"
@.str.5 = [29 x i8] c"worker %i returned error %i\0A\00"
@SIGUSR1 = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str.6 = [19 x i8] c"handler error: %s\0A\00"
@.str.7 = [16 x i8] c"kill error: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %10
store i64 0, i64* %11
br label %14
14: ; preds = %36, %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @getopt(i32 %15, i8** %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %17, i32* %6
%18 = icmp ne i32 %17, -1
br i1 %18, label %19, label %37
19: ; preds = %14
%20 = load i32, i32* %6
switch i32 %20, label %33 [
i32 99, label %21
i32 116, label %27
]
21: ; preds = %19
%22 = load i32, i32* @optarg
%23 = call i8* @atoi(i32 %22)
%24 = ptrtoint i8* %23 to i32
store i32 %24, i32* %10
%25 = load i32, i32* %10
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %36
27: ; preds = %19
%28 = load i32, i32* @optarg
%29 = call i8* @atoi(i32 %28)
%30 = ptrtoint i8* %29 to i64
store i64 %30, i64* %11
%31 = load i64, i64* %11
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 %31)
br label %36
33: ; preds = %19
%34 = call i32 (...) @usage()
%35 = call i32 @exit(i32 0)
unreachable
36: ; preds = %27, %21
br label %14
37: ; preds = %14
br label %38
38: ; preds = %56, %37
%39 = load i32, i32* %10
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %59
41: ; preds = %38
%42 = call i32 (...) @fork()
store i32 %42, i32* %8
switch i32 %42, label %53 [
i32 0, label %43
i32 -1, label %48
]
43: ; preds = %41
%44 = load i64, i64* %11
%45 = call i32 @alarm(i64 %44)
%46 = call i32 (...) @cpu_intensive()
%47 = call i32 @exit(i32 %46)
unreachable
48: ; preds = %41
%49 = load i32, i32* @stderr
%50 = load i32, i32* @errno
%51 = call i8* @strerror(i32 %50)
%52 = call i32 @err(i32 %49, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %51)
br label %56
53: ; preds = %41
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %56
56: ; preds = %53, %48
%57 = load i32, i32* %10
%58 = add nsw i32 %57, -1
store i32 %58, i32* %10
br label %38
59: ; preds = %38
br label %60
60: ; preds = %105, %59
%61 = load i32, i32* %9
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %106
63: ; preds = %60
%64 = call i32 @wait(i32* %12)
store i32 %64, i32* %8
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %105
66: ; preds = %63
%67 = load i32, i32* %9
%68 = add nsw i32 %67, -1
store i32 %68, i32* %9
%69 = load i32, i32* %12
%70 = call i64 @WIFEXITED(i32 %69)
%71 = icmp ne i64 %70, 0
br i1 %71, label %72, label %104
72: ; preds = %66
%73 = load i32, i32* %12
%74 = call i32 @WEXITSTATUS(i32 %73)
store i32 %74, i32* %13
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %79
76: ; preds = %72
%77 = load i32, i32* %8
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %77)
br label %103
79: ; preds = %72
%80 = load i32, i32* %8
%81 = load i32, i32* %13
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %80, i32 %81)
%83 = load i32, i32* @SIGUSR1
%84 = load i32, i32* @SIG_IGN
%85 = call i64 @signal(i32 %83, i32 %84)
%86 = load i64, i64* @SIG_ERR
%87 = icmp eq i64 %85, %86
br i1 %87, label %88, label %92
88: ; preds = %79
%89 = load i32, i32* @errno
%90 = call i8* @strerror(i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %88, %79
%93 = call i32 (...) @getpid()
%94 = mul nsw i32 -1, %93
%95 = load i32, i32* @SIGUSR1
%96 = call i32 @kill(i32 %94, i32 %95)
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %102
98: ; preds = %92
%99 = load i32, i32* @errno
%100 = call i8* @strerror(i32 %99)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %100)
br label %102
102: ; preds = %98, %92
br label %103
103: ; preds = %102, %76
br label %104
104: ; preds = %103, %66
br label %105
105: ; preds = %104, %63
br label %60
106: ; preds = %60
%107 = load i32, i32* %3
ret i32 %107
}

LLVM IR (-O2):
@.str = [5 x i8] c"c:t:\00"
@optarg = global i32 0
@.str.1 = [12 x i8] c"nbcpu= %d \0A\00"
@.str.2 = [14 x i8] c"timeout= %d \0A\00"
@stderr = global i32 0
@.str.3 = [17 x i8] c"fork failed: %s\0A\00"
@errno = global i32 0
@.str.4 = [29 x i8] c"worker %i returned normally\0A\00"
@.str.5 = [29 x i8] c"worker %i returned error %i\0A\00"
@SIGUSR1 = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
@.str.6 = [19 x i8] c"handler error: %s\0A\00"
@.str.7 = [16 x i8] c"kill error: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
br label %4
4: ; preds = %12, %2
%5 = phi i32 [ %16, %12 ], [ 0, %2 ]
%6 = phi i64 [ %8, %12 ], [ 0, %2 ]
br label %7
7: ; preds = %4, %18
%8 = phi i64 [ %21, %18 ], [ %6, %4 ]
%9 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %9, label %23 [
i32 -1, label %10
i32 99, label %12
i32 116, label %18
]
10: ; preds = %7
%11 = icmp eq i32 %5, 0
br i1 %11, label %88, label %30
12: ; preds = %7
%13 = load i32, i32* @optarg
%14 = tail call i8* @atoi(i32 %13)
%15 = ptrtoint i8* %14 to i64
%16 = trunc i64 %15 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %4
18: ; preds = %7
%19 = load i32, i32* @optarg
%20 = tail call i8* @atoi(i32 %19)
%21 = ptrtoint i8* %20 to i64
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 %21)
br label %7
23: ; preds = %7
%24 = tail call i32 (...) @usage()
%25 = tail call i32 @exit(i32 0)
unreachable
26: ; preds = %45
%27 = icmp eq i32 %46, 0
br i1 %27, label %88, label %28
28: ; preds = %26
%29 = bitcast i32* %3 to i8*
br label %49
30: ; preds = %10, %45
%31 = phi i32 [ %47, %45 ], [ %5, %10 ]
%32 = phi i32 [ %46, %45 ], [ 0, %10 ]
%33 = tail call i32 (...) @fork()
switch i32 %33, label %43 [
i32 0, label %34
i32 -1, label %38
]
34: ; preds = %30
%35 = tail call i32 @alarm(i64 %8)
%36 = tail call i32 (...) @cpu_intensive()
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %30
%39 = load i32, i32* @stderr
%40 = load i32, i32* @errno
%41 = tail call i8* @strerror(i32 %40)
%42 = tail call i32 @err(i32 %39, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %41)
br label %45
43: ; preds = %30
%44 = add nsw i32 %32, 1
br label %45
45: ; preds = %43, %38
%46 = phi i32 [ %44, %43 ], [ %32, %38 ]
%47 = add nsw i32 %31, -1
%48 = icmp eq i32 %47, 0
br i1 %48, label %26, label %30
49: ; preds = %28, %85
%50 = phi i32 [ %46, %28 ], [ %86, %85 ]
%51 = call i32 @wait(i32* %3)
%52 = icmp sgt i32 %51, 0
br i1 %52, label %53, label %85
53: ; preds = %49
%54 = add nsw i32 %50, -1
%55 = load i32, i32* %3
%56 = call i64 @WIFEXITED(i32 %55)
%57 = icmp eq i64 %56, 0
br i1 %57, label %85, label %58
58: ; preds = %53
%59 = load i32, i32* %3
%60 = call i32 @WEXITSTATUS(i32 %59)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %51)
br label %85
64: ; preds = %58
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %51, i32 %60)
%66 = load i32, i32* @SIGUSR1
%67 = load i32, i32* @SIG_IGN
%68 = call i64 @signal(i32 %66, i32 %67)
%69 = load i64, i64* @SIG_ERR
%70 = icmp eq i64 %68, %69
br i1 %70, label %71, label %75
71: ; preds = %64
%72 = load i32, i32* @errno
%73 = call i8* @strerror(i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %73)
br label %75
75: ; preds = %71, %64
%76 = call i32 (...) @getpid()
%77 = sub nsw i32 0, %76
%78 = load i32, i32* @SIGUSR1
%79 = call i32 @kill(i32 %77, i32 %78)
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %85
81: ; preds = %75
%82 = load i32, i32* @errno
%83 = call i8* @strerror(i32 %82)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %83)
br label %85
85: ; preds = %53, %75, %81, %62, %49
%86 = phi i32 [ %54, %62 ], [ %54, %81 ], [ %54, %75 ], [ %54, %53 ], [ %50, %49 ]
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %49
88: ; preds = %85, %10, %26
ret i32 0
}