#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 scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ EIO;
int /*<<< orphan*/ PTRACE_CONT;
int /*<<< orphan*/ PTRACE_SINGLESTEP;
scalar_t__ SIGSTOP;
scalar_t__ SIGTRAP;
scalar_t__ WIFEXITED(int);
int /*<<< orphan*/ WIFSTOPPED(int);
scalar_t__ WSTOPSIG(int);
int /*<<< orphan*/ __WALL;
int /*<<< orphan*/ child(int);
scalar_t__ errno;
scalar_t__ fork();
int /*<<< orphan*/ ksft_exit_skip();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ ptrace(int /*<<< orphan*/, scalar_t__, int /*<<< orphan*/ *,
                  int /*<<< orphan*/ *);
scalar_t__ waitpid(scalar_t__, int *, int /*<<< orphan*/);
bool run_test(int cpu) {
  int status;
  pid_t pid = fork();
  pid_t wpid;
  if (pid < 0) {
    perror("fork() failed");
    return false;
  }
  if (pid == 0) {
    child(cpu);
  }
  wpid = waitpid(pid, &status, __WALL);
  if (wpid != pid) {
    perror("waitpid() failed");
    return false;
  }
  if (!WIFSTOPPED(status)) {
    printf("child did not stop\n");
    return false;
  }
  if (WSTOPSIG(status) != SIGSTOP) {
    printf("child did not stop with SIGSTOP\n");
    return false;
  }
  if (ptrace(PTRACE_SINGLESTEP, pid, NULL, NULL) < 0) {
    if (errno == EIO) {
      printf("ptrace(PTRACE_SINGLESTEP) not supported on this architecture\n");
      ksft_exit_skip();
    }
    perror("ptrace(PTRACE_SINGLESTEP) failed");
    return false;
  }
  wpid = waitpid(pid, &status, __WALL);
  if (wpid != pid) {
    perror("waitpid() failed");
    return false;
  }
  if (WIFEXITED(status)) {
    printf("child did not single-step\n");
    return false;
  }
  if (!WIFSTOPPED(status)) {
    printf("child did not stop\n");
    return false;
  }
  if (WSTOPSIG(status) != SIGTRAP) {
    printf("child did not stop with SIGTRAP\n");
    return false;
  }
  if (ptrace(PTRACE_CONT, pid, NULL, NULL) < 0) {
    perror("ptrace(PTRACE_CONT) failed");
    return false;
  }
  wpid = waitpid(pid, &status, __WALL);
  if (wpid != pid) {
    perror("waitpid() failed");
    return false;
  }
  if (!WIFEXITED(status)) {
    printf("child did not exit after PTRACE_CONT\n");
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    11d9 <run_test+0x39>
lea    0xe38(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
cmpq   $0x0,-0x18(%rbp)
jne    11ec <run_test+0x4c>
mov    -0x8(%rbp),%edi
call   1030 <child@plt>
mov    -0x18(%rbp),%rdi
mov    0x2dd1(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
call   1080 <waitpid@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     122c <run_test+0x8c>
lea    0xdf3(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0xc(%rbp),%edi
call   1060 <WIFSTOPPED@plt>
cmp    $0x0,%eax
jne    1255 <run_test+0xb5>
lea    0xddb(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0xc(%rbp),%edi
call   10b0 <WSTOPSIG@plt>
mov    0x2d4c(%rip),%rcx
cmp    (%rcx),%rax
je     1285 <run_test+0xe5>
lea    0xdbf(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1070 <ptrace@plt>
cmp    $0x0,%rax
jge    12ed <run_test+0x14d>
mov    0x2d21(%rip),%rax
mov    (%rax),%rax
mov    0x2d27(%rip),%rcx
cmp    (%rcx),%rax
jne    12d5 <run_test+0x135>
lea    0xd8b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <ksft_exit_skip@plt>
lea    0xdb6(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0x18(%rbp),%rdi
mov    0x2cd0(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
call   1080 <waitpid@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     132d <run_test+0x18d>
lea    0xcf2(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0xc(%rbp),%edi
call   10a0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1357 <run_test+0x1b7>
lea    0xd6d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0xc(%rbp),%edi
call   1060 <WIFSTOPPED@plt>
cmp    $0x0,%eax
jne    1380 <run_test+0x1e0>
lea    0xcb0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0xc(%rbp),%edi
call   10b0 <WSTOPSIG@plt>
mov    0x2c31(%rip),%rcx
cmp    (%rcx),%rax
je     13b0 <run_test+0x210>
lea    0xd2f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    0x2c01(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1070 <ptrace@plt>
cmp    $0x0,%rax
jge    13eb <run_test+0x24b>
lea    0xd15(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0x18(%rbp),%rdi
mov    0x2bd2(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
call   1080 <waitpid@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     142b <run_test+0x28b>
lea    0xbf4(%rip),%rdi
call   1090 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
mov    -0xc(%rbp),%edi
call   10a0 <WIFEXITED@plt>
cmp    $0x0,%rax
jne    1455 <run_test+0x2b5>
lea    0xcc6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    145c <run_test+0x2bc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   10c0 <fork@plt>
test   %rax,%rax
js     1306 <run_test+0x166>
mov    %rax,%r14
jne    11c8 <run_test+0x28>
mov    %ebp,%edi
call   1030 <child@plt>
mov    0x2df9(%rip),%rbp
mov    0x0(%rbp),%edx
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1080 <waitpid@plt>
cmp    %r14,%rax
jne    12f8 <run_test+0x158>
mov    0xc(%rsp),%edi
call   1060 <WIFSTOPPED@plt>
test   %eax,%eax
je     12df <run_test+0x13f>
mov    0xc(%rsp),%edi
call   10b0 <WSTOPSIG@plt>
mov    0x2da7(%rip),%rcx
cmp    (%rcx),%rax
jne    125f <run_test+0xbf>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1070 <ptrace@plt>
test   %rax,%rax
js     131d <run_test+0x17d>
mov    0x0(%rbp),%edx
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1080 <waitpid@plt>
cmp    %r14,%rax
jne    12f8 <run_test+0x158>
mov    0xc(%rsp),%edi
call   10a0 <WIFEXITED@plt>
test   %rax,%rax
je     1268 <run_test+0xc8>
lea    0xe59(%rip),%rdi
jmp    12e6 <run_test+0x146>
lea    0xea4(%rip),%rdi
jmp    12e6 <run_test+0x146>
mov    0xc(%rsp),%edi
call   1060 <WIFSTOPPED@plt>
test   %eax,%eax
je     12df <run_test+0x13f>
mov    0xc(%rsp),%edi
call   10b0 <WSTOPSIG@plt>
mov    0x2d3b(%rip),%rcx
cmp    (%rcx),%rax
jne    1314 <run_test+0x174>
mov    0x2d23(%rip),%rax
mov    (%rax),%edi
xor    %ebx,%ebx
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1070 <ptrace@plt>
test   %rax,%rax
js     1354 <run_test+0x1b4>
mov    0x0(%rbp),%edx
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   1080 <waitpid@plt>
cmp    %r14,%rax
jne    12f8 <run_test+0x158>
mov    0xc(%rsp),%edi
call   10a0 <WIFEXITED@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    12ed <run_test+0x14d>
lea    0xd91(%rip),%rdi
jmp    12e6 <run_test+0x146>
lea    0xd75(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xd0f(%rip),%rdi
call   1090 <perror@plt>
jmp    12eb <run_test+0x14b>
lea    0xcf3(%rip),%rdi
call   1090 <perror@plt>
jmp    12ed <run_test+0x14d>
lea    0xd78(%rip),%rdi
jmp    12e6 <run_test+0x146>
mov    0x2cac(%rip),%rax
mov    (%rax),%rax
mov    0x2cb2(%rip),%rcx
cmp    (%rcx),%rax
jne    1346 <run_test+0x1a6>
lea    0xd93(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <ksft_exit_skip@plt>
lea    0xcd2(%rip),%rdi
call   1090 <perror@plt>
jmp    12eb <run_test+0x14b>
lea    0xce5(%rip),%rdi
call   1090 <perror@plt>
jmp    12ed <run_test+0x14d>

LLVM IR (-O0):
@.str = [14 x i8] c"fork() failed\00"
@__WALL = global i32 0
@.str.1 = [17 x i8] c"waitpid() failed\00"
@.str.2 = [20 x i8] c"child did not stop\0A\00"
@SIGSTOP = global i64 0
@.str.3 = [33 x i8] c"child did not stop with SIGSTOP\0A\00"
@PTRACE_SINGLESTEP = global i32 0
@errno = global i64 0
@EIO = global i64 0
@.str.4 = [62 x i8] c"ptrace(PTRACE_SINGLESTEP) not supported on this architecture\0A\00"
@.str.5 = [33 x i8] c"ptrace(PTRACE_SINGLESTEP) failed\00"
@.str.6 = [27 x i8] c"child did not single-step\0A\00"
@SIGTRAP = global i64 0
@.str.7 = [33 x i8] c"child did not stop with SIGTRAP\0A\00"
@PTRACE_CONT = global i32 0
@.str.8 = [27 x i8] c"ptrace(PTRACE_CONT) failed\00"
@.str.9 = [38 x i8] c"child did not exit after PTRACE_CONT\0A\00"
define i32 @run_test(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
%7 = call i64 (...) @fork()
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %105
12: ; preds = %1
%13 = load i64, i64* %5
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = call i32 @child(i32 %16)
br label %18
18: ; preds = %15, %12
%19 = load i64, i64* %5
%20 = load i32, i32* @__WALL
%21 = call i64 @waitpid(i64 %19, i32* %4, i32 %20)
store i64 %21, i64* %6
%22 = load i64, i64* %6
%23 = load i64, i64* %5
%24 = icmp ne i64 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %18
%26 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %105
27: ; preds = %18
%28 = load i32, i32* %4
%29 = call i32 @WIFSTOPPED(i32 %28)
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %105
33: ; preds = %27
%34 = load i32, i32* %4
%35 = call i64 @WSTOPSIG(i32 %34)
%36 = load i64, i64* @SIGSTOP
%37 = icmp ne i64 %35, %36
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %105
40: ; preds = %33
%41 = load i32, i32* @PTRACE_SINGLESTEP
%42 = load i64, i64* %5
%43 = call i64 @ptrace(i32 %41, i64 %42, i32* null, i32* null)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %54
45: ; preds = %40
%46 = load i64, i64* @errno
%47 = load i64, i64* @EIO
%48 = icmp eq i64 %46, %47
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%51 = call i32 (...) @ksft_exit_skip()
br label %52
52: ; preds = %49, %45
%53 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %2
br label %105
54: ; preds = %40
%55 = load i64, i64* %5
%56 = load i32, i32* @__WALL
%57 = call i64 @waitpid(i64 %55, i32* %4, i32 %56)
store i64 %57, i64* %6
%58 = load i64, i64* %6
%59 = load i64, i64* %5
%60 = icmp ne i64 %58, %59
br i1 %60, label %61, label %63
61: ; preds = %54
%62 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %105
63: ; preds = %54
%64 = load i32, i32* %4
%65 = call i64 @WIFEXITED(i32 %64)
%66 = icmp ne i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %105
69: ; preds = %63
%70 = load i32, i32* %4
%71 = call i32 @WIFSTOPPED(i32 %70)
%72 = icmp ne i32 %71, 0
br i1 %72, label %75, label %73
73: ; preds = %69
%74 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %105
75: ; preds = %69
%76 = load i32, i32* %4
%77 = call i64 @WSTOPSIG(i32 %76)
%78 = load i64, i64* @SIGTRAP
%79 = icmp ne i64 %77, %78
br i1 %79, label %80, label %82
80: ; preds = %75
%81 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %2
br label %105
82: ; preds = %75
%83 = load i32, i32* @PTRACE_CONT
%84 = load i64, i64* %5
%85 = call i64 @ptrace(i32 %83, i64 %84, i32* null, i32* null)
%86 = icmp slt i64 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %82
%88 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %105
89: ; preds = %82
%90 = load i64, i64* %5
%91 = load i32, i32* @__WALL
%92 = call i64 @waitpid(i64 %90, i32* %4, i32 %91)
store i64 %92, i64* %6
%93 = load i64, i64* %6
%94 = load i64, i64* %5
%95 = icmp ne i64 %93, %94
br i1 %95, label %96, label %98
96: ; preds = %89
%97 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %105
98: ; preds = %89
%99 = load i32, i32* %4
%100 = call i64 @WIFEXITED(i32 %99)
%101 = icmp ne i64 %100, 0
br i1 %101, label %104, label %102
102: ; preds = %98
%103 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %2
br label %105
104: ; preds = %98
store i32 1, i32* %2
br label %105
105: ; preds = %104, %102, %96, %87, %80, %73, %67, %61, %52, %38, %31, %25, %10
%106 = load i32, i32* %2
ret i32 %106
}

LLVM IR (-O2):
@.str = [14 x i8] c"fork() failed\00"
@__WALL = global i32 0
@.str.1 = [17 x i8] c"waitpid() failed\00"
@SIGSTOP = global i64 0
@PTRACE_SINGLESTEP = global i32 0
@errno = global i64 0
@EIO = global i64 0
@.str.5 = [33 x i8] c"ptrace(PTRACE_SINGLESTEP) failed\00"
@SIGTRAP = global i64 0
@PTRACE_CONT = global i32 0
@.str.8 = [27 x i8] c"ptrace(PTRACE_CONT) failed\00"
@str.10 = [19 x i8] c"child did not stop\00"
@str.11 = [37 x i8] c"child did not exit after PTRACE_CONT\00"
@str.12 = [32 x i8] c"child did not stop with SIGTRAP\00"
@str.13 = [26 x i8] c"child did not single-step\00"
@str.14 = [61 x i8] c"ptrace(PTRACE_SINGLESTEP) not supported on this architecture\00"
@str.15 = [32 x i8] c"child did not stop with SIGSTOP\00"
define i32 @run_test(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i64 (...) @fork()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %87
8: ; preds = %1
%9 = icmp eq i64 %4, 0
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @child(i32 %0)
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* @__WALL
%14 = call i64 @waitpid(i64 %4, i32* %2, i32 %13)
%15 = icmp eq i64 %14, %4
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %87
18: ; preds = %12
%19 = load i32, i32* %2
%20 = call i32 @WIFSTOPPED(i32 %19)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
br label %87
24: ; preds = %18
%25 = load i32, i32* %2
%26 = call i64 @WSTOPSIG(i32 %25)
%27 = load i64, i64* @SIGSTOP
%28 = icmp eq i64 %26, %27
br i1 %28, label %31, label %29
29: ; preds = %24
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.15, i64 0, i64 0))
br label %87
31: ; preds = %24
%32 = load i32, i32* @PTRACE_SINGLESTEP
%33 = call i64 @ptrace(i32 %32, i64 %4, i32* null, i32* null)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %44
35: ; preds = %31
%36 = load i64, i64* @errno
%37 = load i64, i64* @EIO
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.14, i64 0, i64 0))
%41 = call i32 (...) @ksft_exit_skip()
br label %42
42: ; preds = %39, %35
%43 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
br label %87
44: ; preds = %31
%45 = load i32, i32* @__WALL
%46 = call i64 @waitpid(i64 %4, i32* %2, i32 %45)
%47 = icmp eq i64 %46, %4
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %87
50: ; preds = %44
%51 = load i32, i32* %2
%52 = call i64 @WIFEXITED(i32 %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %50
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0))
br label %87
56: ; preds = %50
%57 = load i32, i32* %2
%58 = call i32 @WIFSTOPPED(i32 %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.10, i64 0, i64 0))
br label %87
62: ; preds = %56
%63 = load i32, i32* %2
%64 = call i64 @WSTOPSIG(i32 %63)
%65 = load i64, i64* @SIGTRAP
%66 = icmp eq i64 %64, %65
br i1 %66, label %69, label %67
67: ; preds = %62
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
br label %87
69: ; preds = %62
%70 = load i32, i32* @PTRACE_CONT
%71 = call i64 @ptrace(i32 %70, i64 %4, i32* null, i32* null)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %87
75: ; preds = %69
%76 = load i32, i32* @__WALL
%77 = call i64 @waitpid(i64 %4, i32* %2, i32 %76)
%78 = icmp eq i64 %77, %4
br i1 %78, label %81, label %79
79: ; preds = %75
%80 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %87
81: ; preds = %75
%82 = load i32, i32* %2
%83 = call i64 @WIFEXITED(i32 %82)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %81
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.11, i64 0, i64 0))
br label %87
87: ; preds = %81, %85, %79, %73, %67, %60, %54, %48, %42, %29, %22, %16, %6
%88 = phi i32 [ 0, %6 ], [ 0, %16 ], [ 0, %29 ], [ 0, %42 ], [ 0, %48 ], [ 0, %54 ], [ 0, %67 ], [ 0, %73 ], [ 0, %79 ], [ 0, %85 ], [ 0, %60 ], [ 0, %22 ], [ 1, %81 ]
ret i32 %88
}