#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*/ SIGKILL;
int /*<<< orphan*/ SIGTERM;
int atoi(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ print_help(char *);
int setpgid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
int main(int argc, char *argv[]) {
  int timeout, pid, ret, i;
  if (argc != 3) {
    print_help(argv[0]);
    return 1;
  }
  timeout = atoi(argv[1]);
  pid = atoi(argv[2]);
  if (timeout < 0) {
    fprintf(stderr, "Invalid timeout '%s'\n", argv[1]);
    print_help(argv[0]);
    return 1;
  }
  if (pid <= 1) {
    fprintf(stderr, "Invalid pid '%s'\n", argv[2]);
    print_help(argv[0]);
    return 1;
  }
  ret = setpgid(0, 0);
  if (ret)
    fprintf(stderr,
            "setpgid() failed: %s"
            "\n",
            strerror(errno));
  if (timeout)
    sleep(timeout);
  fprintf(stderr, "Test timed out, sending SIGTERM!"
                  "\n");
  fprintf(
      stderr,
      "If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1"
      "\n");
  ret = kill(-pid, SIGTERM);
  if (ret) {
    fprintf(stderr,
            "kill(%i) failed: %s"
            "\n",
            -pid, strerror(errno));
    return 1;
  }
  usleep(100000);
  i = 10;
  while (!kill(-pid, 0) && i-- > 0) {
    fprintf(stderr,
            "Test is still running... %i"
            "\n",
            i + 1);
    sleep(1);
  }
  if (!kill(-pid, 0)) {
    fprintf(stderr, "Test is still running, sending SIGKILL"
                    "\n");
    ret = kill(-pid, SIGKILL);
    if (ret) {
      fprintf(stderr,
              "kill(%i) failed: %s"
              "\n",
              -pid, strerror(errno));
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11b8 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <print_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    145d <main+0x2dd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1219 <main+0x99>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <print_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    145d <main+0x2dd>
cmpl   $0x1,-0x18(%rbp)
jg     125a <main+0xda>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xddb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <print_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    145d <main+0x2dd>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <setpgid@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     129e <main+0x11e>
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    %rax,%rdx
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     12b0 <main+0x130>
mov    -0x14(%rbp),%edi
call   1090 <sleep@plt>
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
lea    0xd7e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
sub    -0x18(%rbp),%edi
mov    0x2cfe(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1343 <main+0x1c3>
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2cb7(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%edx
mov    %rax,%rcx
lea    0xd77(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145d <main+0x2dd>
mov    $0x186a0,%edi
call   10a0 <usleep@plt>
movl   $0xa,-0x20(%rbp)
xor    %edi,%edi
sub    -0x18(%rbp),%edi
xor    %esi,%esi
call   1040 <kill@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2d(%rbp)
jne    1384 <main+0x204>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
cmp    $0x0,%eax
setg   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    1394 <main+0x214>
jmp    13c0 <main+0x240>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%edx
add    $0x1,%edx
lea    0xd12(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1090 <sleep@plt>
jmp    1354 <main+0x1d4>
xor    %edi,%edi
sub    -0x18(%rbp),%edi
xor    %esi,%esi
call   1040 <kill@plt>
cmp    $0x0,%eax
jne    1456 <main+0x2d6>
mov    0x2bfc(%rip),%rax
mov    (%rax),%edi
lea    0xcf4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %edi,%edi
sub    -0x18(%rbp),%edi
mov    0x2bd0(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1451 <main+0x2d1>
mov    0x2bc5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    0x2ba9(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%edx
mov    %rax,%rcx
lea    0xc69(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145d <main+0x2dd>
jmp    1456 <main+0x2d6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    11e7 <main+0x67>
mov    0x8(%rbp),%r12
mov    %r12,%rdi
call   1050 <atoi@plt>
mov    %eax,%r15d
mov    0x10(%rbp),%rbx
mov    %rbx,%rdi
call   1050 <atoi@plt>
test   %r15d,%r15d
js     11cd <main+0x4d>
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1200 <main+0x80>
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdx
jmp    11e0 <main+0x60>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
lea    0xe23(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%rdi
call   1060 <print_help@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
xor    %esi,%esi
call   1070 <setpgid@plt>
test   %eax,%eax
je     1237 <main+0xb7>
mov    0x2dc4(%rip),%rax
mov    (%rax),%ebx
mov    0x2db3(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
lea    0xdfd(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %r15d,%r15d
je     1244 <main+0xc4>
mov    %r15d,%edi
call   1090 <sleep@plt>
mov    0x2d8d(%rip),%r12
mov    (%r12),%edi
lea    0xde8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r12),%edi
lea    0xdf8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
neg    %r14d
mov    0x2d6f(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   1040 <kill@plt>
test   %eax,%eax
je     12b4 <main+0x134>
mov    (%r12),%ebx
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
lea    0xe07(%rip),%rsi
mov    %ebx,%edi
mov    %r14d,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    11f0 <main+0x70>
mov    $0x186a0,%edi
call   10a0 <usleep@plt>
xor    %ebp,%ebp
mov    %r14d,%edi
xor    %esi,%esi
call   1040 <kill@plt>
test   %eax,%eax
jne    1312 <main+0x192>
mov    $0xa,%ebx
lea    0xde2(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%r12),%edi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1090 <sleep@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1040 <kill@plt>
test   %eax,%eax
jne    1312 <main+0x192>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     12e0 <main+0x160>
mov    %r14d,%edi
xor    %esi,%esi
call   1040 <kill@plt>
test   %eax,%eax
jne    11f5 <main+0x75>
mov    (%r12),%edi
lea    0xdaa(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2c89(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   1040 <kill@plt>
test   %eax,%eax
jne    1287 <main+0x107>
jmp    11f5 <main+0x75>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Invalid timeout '%s'\0A\00"
@.str.1 = [18 x i8] c"Invalid pid '%s'\0A\00"
@.str.2 = [22 x i8] c"setpgid() failed: %s\0A\00"
@errno = global i32 0
@.str.3 = [34 x i8] c"Test timed out, sending SIGTERM!\0A\00"
@.str.4 = [71 x i8] c"If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1\0A\00"
@SIGTERM = global i32 0
@.str.5 = [21 x i8] c"kill(%i) failed: %s\0A\00"
@.str.6 = [29 x i8] c"Test is still running... %i\0A\00"
@.str.7 = [40 x i8] c"Test is still running, sending SIGKILL\0A\00"
@SIGKILL = global i32 0
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @print_help(i8* %15)
store i32 1, i32* %3
br label %126
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %6
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %7
%26 = load i32, i32* %6
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %38
28: ; preds = %17
%29 = load i32, i32* @stderr
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 @print_help(i8* %36)
store i32 1, i32* %3
br label %126
38: ; preds = %17
%39 = load i32, i32* %7
%40 = icmp sle i32 %39, 1
br i1 %40, label %41, label %51
41: ; preds = %38
%42 = load i32, i32* @stderr
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %45)
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 0
%49 = load i8*, i8** %48
%50 = call i32 @print_help(i8* %49)
store i32 1, i32* %3
br label %126
51: ; preds = %38
%52 = call i32 @setpgid(i32 0, i32 0)
store i32 %52, i32* %8
%53 = load i32, i32* %8
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = load i32, i32* @stderr
%57 = load i32, i32* @errno
%58 = call i8* @strerror(i32 %57)
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %55, %51
%61 = load i32, i32* %6
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i32, i32* %6
%65 = call i32 @sleep(i32 %64)
br label %66
66: ; preds = %63, %60
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%69 = load i32, i32* @stderr
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%71 = load i32, i32* %7
%72 = sub nsw i32 0, %71
%73 = load i32, i32* @SIGTERM
%74 = call i32 @kill(i32 %72, i32 %73)
store i32 %74, i32* %8
%75 = load i32, i32* %8
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %84
77: ; preds = %66
%78 = load i32, i32* @stderr
%79 = load i32, i32* %7
%80 = sub nsw i32 0, %79
%81 = load i32, i32* @errno
%82 = call i8* @strerror(i32 %81)
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %80, i8* %82)
store i32 1, i32* %3
br label %126
84: ; preds = %66
%85 = call i32 @usleep(i32 100000)
store i32 10, i32* %9
br label %86
86: ; preds = %97, %84
%87 = load i32, i32* %7
%88 = sub nsw i32 0, %87
%89 = call i32 @kill(i32 %88, i32 0)
%90 = icmp ne i32 %89, 0
br i1 %90, label %95, label %91
91: ; preds = %86
%92 = load i32, i32* %9
%93 = add nsw i32 %92, -1
store i32 %93, i32* %9
%94 = icmp sgt i32 %92, 0
br label %95
95: ; preds = %91, %86
%96 = phi i1 [ false, %86 ], [ %94, %91 ]
br i1 %96, label %97, label %103
97: ; preds = %95
%98 = load i32, i32* @stderr
%99 = load i32, i32* %9
%100 = add nsw i32 %99, 1
%101 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %100)
%102 = call i32 @sleep(i32 1)
br label %86
103: ; preds = %95
%104 = load i32, i32* %7
%105 = sub nsw i32 0, %104
%106 = call i32 @kill(i32 %105, i32 0)
%107 = icmp ne i32 %106, 0
br i1 %107, label %125, label %108
108: ; preds = %103
%109 = load i32, i32* @stderr
%110 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%111 = load i32, i32* %7
%112 = sub nsw i32 0, %111
%113 = load i32, i32* @SIGKILL
%114 = call i32 @kill(i32 %112, i32 %113)
store i32 %114, i32* %8
%115 = load i32, i32* %8
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %124
117: ; preds = %108
%118 = load i32, i32* @stderr
%119 = load i32, i32* %7
%120 = sub nsw i32 0, %119
%121 = load i32, i32* @errno
%122 = call i8* @strerror(i32 %121)
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %120, i8* %122)
store i32 1, i32* %3
br label %126
124: ; preds = %108
br label %125
125: ; preds = %124, %103
store i32 0, i32* %3
br label %126
126: ; preds = %125, %117, %77, %41, %28, %12
%127 = load i32, i32* %3
ret i32 %127
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Invalid timeout '%s'\0A\00"
@.str.1 = [18 x i8] c"Invalid pid '%s'\0A\00"
@.str.2 = [22 x i8] c"setpgid() failed: %s\0A\00"
@errno = global i32 0
@.str.3 = [34 x i8] c"Test timed out, sending SIGTERM!\0A\00"
@.str.4 = [71 x i8] c"If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1\0A\00"
@SIGTERM = global i32 0
@.str.5 = [21 x i8] c"kill(%i) failed: %s\0A\00"
@.str.6 = [29 x i8] c"Test is still running... %i\0A\00"
@.str.7 = [40 x i8] c"Test is still running, sending SIGKILL\0A\00"
@SIGKILL = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @print_help(i8* %5)
br label %81
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = icmp slt i32 %10, 0
br i1 %14, label %15, label %20
15: ; preds = %7
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
%18 = load i8*, i8** %1
%19 = tail call i32 @print_help(i8* %18)
br label %81
20: ; preds = %7
%21 = icmp slt i32 %13, 2
br i1 %21, label %22, label %27
22: ; preds = %20
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%25 = load i8*, i8** %1
%26 = tail call i32 @print_help(i8* %25)
br label %81
27: ; preds = %20
%28 = tail call i32 @setpgid(i32 0, i32 0)
%29 = icmp eq i32 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = load i32, i32* @errno
%33 = tail call i8* @strerror(i32 %32)
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %30, %27
%36 = icmp eq i32 %10, 0
br i1 %36, label %39, label %37
37: ; preds = %35
%38 = tail call i32 @sleep(i32 %10)
br label %39
39: ; preds = %37, %35
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%44 = sub nsw i32 0, %13
%45 = load i32, i32* @SIGTERM
%46 = tail call i32 @kill(i32 %44, i32 %45)
%47 = icmp eq i32 %46, 0
br i1 %47, label %53, label %48
48: ; preds = %39
%49 = load i32, i32* @stderr
%50 = load i32, i32* @errno
%51 = tail call i8* @strerror(i32 %50)
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %44, i8* %51)
br label %81
53: ; preds = %39
%54 = tail call i32 @usleep(i32 100000)
%55 = tail call i32 @kill(i32 %44, i32 0)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %67
57: ; preds = %53, %57
%58 = phi i32 [ %59, %57 ], [ 10, %53 ]
%59 = add nsw i32 %58, -1
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %58)
%62 = tail call i32 @sleep(i32 1)
%63 = tail call i32 @kill(i32 %44, i32 0)
%64 = icmp eq i32 %63, 0
%65 = icmp ugt i32 %58, 1
%66 = and i1 %64, %65
br i1 %66, label %57, label %67
67: ; preds = %57, %53
%68 = tail call i32 @kill(i32 %44, i32 0)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %81
70: ; preds = %67
%71 = load i32, i32* @stderr
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%73 = load i32, i32* @SIGKILL
%74 = tail call i32 @kill(i32 %44, i32 %73)
%75 = icmp eq i32 %74, 0
br i1 %75, label %81, label %76
76: ; preds = %70
%77 = load i32, i32* @stderr
%78 = load i32, i32* @errno
%79 = tail call i8* @strerror(i32 %78)
%80 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %44, i8* %79)
br label %81
81: ; preds = %67, %70, %76, %48, %22, %15, %4
%82 = phi i32 [ 1, %4 ], [ 1, %15 ], [ 1, %22 ], [ 1, %48 ], [ 1, %76 ], [ 0, %70 ], [ 0, %67 ]
ret i32 %82
}