#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 */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ PTRACE_DETACH;
int /*<<< orphan*/ PTRACE_TRACEME;
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ SIGSTOP;
scalar_t__ SIGTRAP;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWGRP;
int S_IWUSR;
scalar_t__ WIFSTOPPED(int);
scalar_t__ WSTOPSIG(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dprintf(int, char *, scalar_t__);
int errno;
int execvp(char *, char **);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ kill(scalar_t__, int /*<<< orphan*/);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int ptrace(int /*<<< orphan*/, scalar_t__, int /*<<< orphan*/,
           int /*<<< orphan*/);
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ stderr;
char *strerror(int);
int /*<<< orphan*/ waitpid(scalar_t__, int *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd;
  if (argc < 3) {
    printf("Typical usage: %s logfile -- program [args...] &\n", argv[0]);
    return EXIT_FAILURE;
  }
  fd = open(argv[1], O_TRUNC | O_WRONLY | O_CREAT,
            S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
  if (fd < 0) {
    fprintf(stderr, "Error opening %s.\n", argv[1]);
    return errno;
  }
  pid_t pid = fork();
  if (pid) {
    int status;
    waitpid(pid, &status, 0);
    dprintf(fd, "%d", pid);
    close(fd);
    if (WIFSTOPPED(status) && WSTOPSIG(status) == SIGTRAP) {
      ptrace(PTRACE_DETACH, pid, 0, SIGSTOP);
      return EXIT_SUCCESS;
    } else {
      fprintf(stderr, "Child stopped unexpectedly\n");
      kill(pid, SIGKILL);
      return EXIT_FAILURE;
    }
  } else {
    close(fd);
    setsid();
    int status = ptrace(PTRACE_TRACEME, 0, 0, 0);
    if (status == -1) {
      fprintf(stderr, "Trace request failed with error: %s\n", strerror(errno));
      return EXIT_FAILURE;
    }
    status = execvp(argv[3], &argv[3]);
    if (status == -1) {
      fprintf(stderr, "Exec of %s failed with error: %s\n", argv[3],
              strerror(errno));
    }
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


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)
jge    1224 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdf2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1465 <main+0x285>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
mov    0x2d1c(%rip),%rax
or     (%rax),%esi
mov    0x2db3(%rip),%rax
or     (%rax),%esi
mov    0x2d3a(%rip),%rax
mov    (%rax),%edx
mov    0x2d71(%rip),%rax
or     (%rax),%edx
mov    0x2d40(%rip),%rax
or     (%rax),%edx
mov    0x2d67(%rip),%rax
or     (%rax),%edx
mov    0x2d26(%rip),%rax
or     (%rax),%edx
call   10c0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12b6 <main+0xd6>
mov    0x2d2b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd94(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2cfc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1465 <main+0x285>
mov    $0x0,%al
call   1100 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1388 <main+0x1a8>
mov    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rdx
lea    0xd5c(%rip),%rsi
call   1050 <dprintf@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x24(%rbp),%edi
call   1090 <WIFSTOPPED@plt>
cmp    $0x0,%rax
je     134e <main+0x16e>
mov    -0x24(%rbp),%edi
call   10f0 <WSTOPSIG@plt>
mov    0x2c59(%rip),%rcx
cmp    (%rcx),%rax
jne    134e <main+0x16e>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
mov    0x2c34(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
call   10a0 <ptrace@plt>
mov    0x2c34(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1465 <main+0x285>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
lea    0xcea(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    0x2c10(%rip),%rax
mov    (%rax),%esi
call   1080 <kill@plt>
mov    0x2c12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1465 <main+0x285>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    $0x0,%al
call   1060 <setsid@plt>
mov    0x2c12(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   10a0 <ptrace@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    13f9 <main+0x219>
mov    0x2bf7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2bdb(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x2c(%rbp),%edi
mov    %rax,%rdx
lea    0xc83(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2ba1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1465 <main+0x285>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
call   10d0 <execvp@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    1459 <main+0x279>
mov    0x2b96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    0x2b6e(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rdx
mov    %rax,%rcx
lea    0xc37(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2b30(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1204 <main+0x24>
mov    (%rbx),%rsi
lea    0xe06(%rip),%rdi
call   1030 <printf@plt>
jmp    13d0 <main+0x1f0>
mov    0x2de5(%rip),%rax
mov    0x2d46(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ddb(%rip),%rax
or     (%rax),%esi
mov    0x2d62(%rip),%rax
mov    0x2d9b(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2d68(%rip),%rax
or     (%rax),%edx
mov    0x2d8f(%rip),%rax
or     (%rax),%edx
mov    0x8(%rbx),%rdi
mov    0x2d4a(%rip),%rax
or     (%rax),%edx
call   10c0 <open@plt>
test   %eax,%eax
js     12e4 <main+0x104>
mov    %eax,%ebp
xor    %eax,%eax
call   1100 <fork@plt>
test   %rax,%rax
je     1338 <main+0x158>
mov    %rax,%r14
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
xor    %edx,%edx
call   10b0 <waitpid@plt>
lea    0xdbd(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
call   1050 <dprintf@plt>
mov    %ebp,%edi
call   1040 <close@plt>
mov    0xc(%rsp),%edi
call   1090 <WIFSTOPPED@plt>
test   %rax,%rax
je     130b <main+0x12b>
mov    0xc(%rsp),%edi
call   10f0 <WSTOPSIG@plt>
mov    0x2cb9(%rip),%rcx
cmp    (%rcx),%rax
jne    130b <main+0x12b>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
mov    0x2c9c(%rip),%rax
mov    (%rax),%ecx
mov    %r14,%rsi
xor    %edx,%edx
call   10a0 <ptrace@plt>
mov    0x2c99(%rip),%rax
jmp    13d7 <main+0x1f7>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
lea    0xd3a(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2ca2(%rip),%rax
jmp    13d7 <main+0x1f7>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
lea    0xd2d(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2c57(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1080 <kill@plt>
jmp    13d0 <main+0x1f0>
mov    %ebp,%edi
call   1040 <close@plt>
xor    %eax,%eax
call   1060 <setsid@plt>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   10a0 <ptrace@plt>
cmp    $0xffffffff,%eax
je     13a6 <main+0x1c6>
mov    0x18(%rbx),%rdi
add    $0x18,%rbx
mov    %rbx,%rsi
call   10d0 <execvp@plt>
cmp    $0xffffffff,%eax
jne    13d0 <main+0x1f0>
mov    0x2c3d(%rip),%rax
mov    (%rax),%ebp
mov    (%rbx),%rbx
mov    0x2c21(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xcf4(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    13d0 <main+0x1f0>
mov    0x2c0b(%rip),%rax
mov    (%rax),%ebx
mov    0x2bf2(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xca0(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x2bb9(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Typical usage: %s logfile -- program [args...] &\0A\00"
@EXIT_FAILURE = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IROTH = global i32 0
@stderr = global i32 0
@.str.1 = [19 x i8] c"Error opening %s.\0A\00"
@errno = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@SIGTRAP = global i64 0
@PTRACE_DETACH = global i32 0
@SIGSTOP = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.3 = [28 x i8] c"Child stopped unexpectedly\0A\00"
@SIGKILL = global i32 0
@PTRACE_TRACEME = global i32 0
@.str.4 = [37 x i8] c"Trace request failed with error: %s\0A\00"
@.str.5 = [34 x i8] c"Exec of %s failed with 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 i64
%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 slt i32 %10, 3
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
store i32 %17, i32* %3
br label %112
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = load i32, i32* @O_TRUNC
%23 = load i32, i32* @O_WRONLY
%24 = or i32 %22, %23
%25 = load i32, i32* @O_CREAT
%26 = or i32 %24, %25
%27 = load i32, i32* @S_IRUSR
%28 = load i32, i32* @S_IWUSR
%29 = or i32 %27, %28
%30 = load i32, i32* @S_IRGRP
%31 = or i32 %29, %30
%32 = load i32, i32* @S_IWGRP
%33 = or i32 %31, %32
%34 = load i32, i32* @S_IROTH
%35 = or i32 %33, %34
%36 = call i32 @open(i8* %21, i32 %26, i32 %35)
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %46
39: ; preds = %18
%40 = load i32, i32* @stderr
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %43)
%45 = load i32, i32* @errno
store i32 %45, i32* %3
br label %112
46: ; preds = %18
%47 = call i64 (...) @fork()
store i64 %47, i64* %7
%48 = load i64, i64* %7
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %79
50: ; preds = %46
%51 = load i64, i64* %7
%52 = call i32 @waitpid(i64 %51, i32* %8, i32 0)
%53 = load i32, i32* %6
%54 = load i64, i64* %7
%55 = call i32 @dprintf(i32 %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 %54)
%56 = load i32, i32* %6
%57 = call i32 @close(i32 %56)
%58 = load i32, i32* %8
%59 = call i64 @WIFSTOPPED(i32 %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %72
61: ; preds = %50
%62 = load i32, i32* %8
%63 = call i64 @WSTOPSIG(i32 %62)
%64 = load i64, i64* @SIGTRAP
%65 = icmp eq i64 %63, %64
br i1 %65, label %66, label %72
66: ; preds = %61
%67 = load i32, i32* @PTRACE_DETACH
%68 = load i64, i64* %7
%69 = load i32, i32* @SIGSTOP
%70 = call i32 @ptrace(i32 %67, i64 %68, i32 0, i32 %69)
%71 = load i32, i32* @EXIT_SUCCESS
store i32 %71, i32* %3
br label %112
72: ; preds = %61, %50
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%75 = load i64, i64* %7
%76 = load i32, i32* @SIGKILL
%77 = call i32 @kill(i64 %75, i32 %76)
%78 = load i32, i32* @EXIT_FAILURE
store i32 %78, i32* %3
br label %112
79: ; preds = %46
%80 = load i32, i32* %6
%81 = call i32 @close(i32 %80)
%82 = call i32 (...) @setsid()
%83 = load i32, i32* @PTRACE_TRACEME
%84 = call i32 @ptrace(i32 %83, i64 0, i32 0, i32 0)
store i32 %84, i32* %9
%85 = load i32, i32* %9
%86 = icmp eq i32 %85, -1
br i1 %86, label %87, label %93
87: ; preds = %79
%88 = load i32, i32* @stderr
%89 = load i32, i32* @errno
%90 = call i8* @strerror(i32 %89)
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %90)
%92 = load i32, i32* @EXIT_FAILURE
store i32 %92, i32* %3
br label %112
93: ; preds = %79
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 3
%96 = load i8*, i8** %95
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 3
%99 = call i32 @execvp(i8* %96, i8** %98)
store i32 %99, i32* %9
%100 = load i32, i32* %9
%101 = icmp eq i32 %100, -1
br i1 %101, label %102, label %110
102: ; preds = %93
%103 = load i32, i32* @stderr
%104 = load i8**, i8*** %5
%105 = getelementptr inbounds i8*, i8** %104, i64 3
%106 = load i8*, i8** %105
%107 = load i32, i32* @errno
%108 = call i8* @strerror(i32 %107)
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %106, i8* %108)
br label %110
110: ; preds = %102, %93
%111 = load i32, i32* @EXIT_FAILURE
store i32 %111, i32* %3
br label %112
112: ; preds = %110, %87, %72, %66, %39, %12
%113 = load i32, i32* %3
ret i32 %113
}

LLVM IR (-O2):
@.str = [50 x i8] c"Typical usage: %s logfile -- program [args...] &\0A\00"
@EXIT_FAILURE = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IROTH = global i32 0
@stderr = global i32 0
@.str.1 = [19 x i8] c"Error opening %s.\0A\00"
@errno = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@SIGTRAP = global i64 0
@PTRACE_DETACH = global i32 0
@SIGSTOP = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.3 = [28 x i8] c"Child stopped unexpectedly\0A\00"
@SIGKILL = global i32 0
@PTRACE_TRACEME = global i32 0
@.str.4 = [37 x i8] c"Trace request failed with error: %s\0A\00"
@.str.5 = [34 x i8] c"Exec of %s failed with error: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
br label %85
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i32, i32* @O_TRUNC
%13 = load i32, i32* @O_WRONLY
%14 = or i32 %13, %12
%15 = load i32, i32* @O_CREAT
%16 = or i32 %14, %15
%17 = load i32, i32* @S_IRUSR
%18 = load i32, i32* @S_IWUSR
%19 = or i32 %18, %17
%20 = load i32, i32* @S_IRGRP
%21 = or i32 %19, %20
%22 = load i32, i32* @S_IWGRP
%23 = or i32 %21, %22
%24 = load i32, i32* @S_IROTH
%25 = or i32 %23, %24
%26 = tail call i32 @open(i8* %11, i32 %16, i32 %25)
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %9
%29 = load i32, i32* @stderr
%30 = load i8*, i8** %10
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load i32, i32* @errno
br label %85
33: ; preds = %9
%34 = tail call i64 (...) @fork()
%35 = icmp eq i64 %34, 0
br i1 %35, label %61, label %36
36: ; preds = %33
%37 = bitcast i32* %3 to i8*
%38 = call i32 @waitpid(i64 %34, i32* %3, i32 0)
%39 = call i32 @dprintf(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 %34)
%40 = call i32 @close(i32 %26)
%41 = load i32, i32* %3
%42 = call i64 @WIFSTOPPED(i32 %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %53, label %44
44: ; preds = %36
%45 = load i32, i32* %3
%46 = call i64 @WSTOPSIG(i32 %45)
%47 = load i64, i64* @SIGTRAP
%48 = icmp eq i64 %46, %47
br i1 %48, label %49, label %53
49: ; preds = %44
%50 = load i32, i32* @PTRACE_DETACH
%51 = load i32, i32* @SIGSTOP
%52 = call i32 @ptrace(i32 %50, i64 %34, i32 0, i32 %51)
br label %58
53: ; preds = %44, %36
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* @SIGKILL
%57 = call i32 @kill(i64 %34, i32 %56)
br label %58
58: ; preds = %53, %49
%59 = phi i32* [ @EXIT_SUCCESS, %49 ], [ @EXIT_FAILURE, %53 ]
%60 = load i32, i32* %59
br label %85
61: ; preds = %33
%62 = tail call i32 @close(i32 %26)
%63 = tail call i32 (...) @setsid()
%64 = load i32, i32* @PTRACE_TRACEME
%65 = tail call i32 @ptrace(i32 %64, i64 0, i32 0, i32 0)
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %72
67: ; preds = %61
%68 = load i32, i32* @stderr
%69 = load i32, i32* @errno
%70 = tail call i8* @strerror(i32 %69)
%71 = tail call i32 (i32, i8*, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %70)
br label %83
72: ; preds = %61
%73 = getelementptr inbounds i8*, i8** %1, i64 3
%74 = load i8*, i8** %73
%75 = tail call i32 @execvp(i8* %74, i8** %73)
%76 = icmp eq i32 %75, -1
br i1 %76, label %77, label %83
77: ; preds = %72
%78 = load i32, i32* @stderr
%79 = load i8*, i8** %73
%80 = load i32, i32* @errno
%81 = tail call i8* @strerror(i32 %80)
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i8* %79, i8* %81)
br label %83
83: ; preds = %72, %77, %67
%84 = load i32, i32* @EXIT_FAILURE
br label %85
85: ; preds = %58, %83, %28, %5
%86 = phi i32 [ %8, %5 ], [ %32, %28 ], [ %60, %58 ], [ %84, %83 ]
ret i32 %86
}