#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 option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ *member_2;
  int /*<<< orphan*/ const member_1;
};
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int WEXITSTATUS(int);
int /*<<< orphan*/ WIFEXITED(int);
int /*<<< orphan*/ err(int, char *, ...);
int /*<<< orphan*/ execvp(char *, char **);
int fork();
int getopt_long(int, char **, char *, struct option const *,
                int /*<<< orphan*/ *);
scalar_t__ getpgrp();
scalar_t__ getpid();
#define no_argument 128
size_t optind;
int /*<<< orphan*/ puts(char *);
scalar_t__ setsid();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage(char *, int /*<<< orphan*/);
int wait(int *);
int main(int argc, char **argv) {
  int ch;
  pid_t pid;
  int status = 0;
  static const struct option longopts[] = {{"ctty", no_argument, NULL, 'c'},
                                           {"wait", no_argument, NULL, 'w'},
                                           {"help", no_argument, NULL, 'h'},
                                           {"version", no_argument, NULL, 'V'},
                                           {NULL, 0, NULL, 0}};
  while ((ch = getopt_long(argc, argv, "+cwhvV", longopts, NULL)) != -1) {
    switch (ch) {
    case 'c':
      break;
    case 'w':
      status = 1;
      break;
    case 'V':
    case 'v':
      puts("0.1");
      return EXIT_SUCCESS;
    case 'h':
      usage(argv[0], stdout);
    default:
      usage(argv[0], stderr);
    }
  }
  if (argc < 2) {
    usage(argv[0], stderr);
  }
  if (getpgrp() == getpid()) {
    pid = fork();
    switch (pid) {
    case -1:
      err(EXIT_FAILURE, "fork");
    case 0:
      break;
    default:
      if (!status) {
        return EXIT_SUCCESS;
      }
      if (wait(&status) != pid) {
        err(EXIT_FAILURE, "wait");
      }
      if (WIFEXITED(status)) {
        return WEXITSTATUS(status);
      }
      err(status, "child %d did not exit normally", pid);
    }
  }
  if (setsid() < 0) {
    err(EXIT_FAILURE, "setsid failed");
  }
  execvp(argv[optind], argv + optind);
  err(EXIT_FAILURE, "failed to execute %s", argv[optind]);
}


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)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdx
lea    0x2b5e(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <getopt_long@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     128e <main+0xce>
mov    -0x14(%rbp),%eax
add    $0xffffffaa,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x21,%eax
ja     1274 <main+0xb4>
mov    -0x28(%rbp),%rax
lea    0xdd8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1289 <main+0xc9>
movl   $0x1,-0x1c(%rbp)
jmp    1289 <main+0xc9>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1414 <main+0x254>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2d53(%rip),%rax
mov    (%rax),%esi
call   1080 <usage@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2d4e(%rip),%rax
mov    (%rax),%esi
call   1080 <usage@plt>
jmp    11dd <main+0x1d>
cmpl   $0x2,-0x8(%rbp)
jge    12ad <main+0xed>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2d2a(%rip),%rax
mov    (%rax),%esi
call   1080 <usage@plt>
mov    $0x0,%al
call   10a0 <getpgrp@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jne    1397 <main+0x1d7>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0xffffffff,%eax
je     12fd <main+0x13d>
jmp    12ed <main+0x12d>
mov    -0x34(%rbp),%eax
test   %eax,%eax
je     1314 <main+0x154>
jmp    1319 <main+0x159>
mov    0x2cc4(%rip),%rax
mov    (%rax),%edi
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    1392 <main+0x1d2>
cmpl   $0x0,-0x1c(%rbp)
jne    1334 <main+0x174>
mov    0x2c8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1414 <main+0x254>
lea    -0x1c(%rbp),%rdi
call   10d0 <wait@plt>
cmp    -0x18(%rbp),%eax
je     135d <main+0x19d>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
lea    0xd37(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
mov    -0x1c(%rbp),%edi
call   10c0 <WIFEXITED@plt>
cmp    $0x0,%eax
je     137e <main+0x1be>
mov    -0x1c(%rbp),%edi
call   1090 <WEXITSTATUS@plt>
mov    %eax,-0x4(%rbp)
jmp    1414 <main+0x254>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%edx
lea    0xd24(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
jmp    1397 <main+0x1d7>
mov    $0x0,%al
call   1060 <setsid@plt>
cmp    $0x0,%rax
jge    13bf <main+0x1ff>
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
lea    0xd16(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
mov    -0x10(%rbp),%rax
mov    0x2c16(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2c04(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   10b0 <execvp@plt>
mov    0x2bd6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x2be1(%rip),%rcx
mov    (%rcx),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xccf(%rip),%rsi
mov    $0x0,%al
call   1070 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    $0x1,%al
mov    %eax,0xc(%rsp)
lea    0xeb8(%rip),%r14
lea    0x2b62(%rip),%r15
mov    0x2ddb(%rip),%r13
lea    0xe04(%rip),%r12
jmp    121d <main+0x5d>
xchg   %ax,%ax
mov    (%rbx),%rdi
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
call   1080 <usage@plt>
mov    (%rbx),%rdi
mov    0x0(%r13),%esi
call   1080 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1050 <getopt_long@plt>
lea    -0x56(%rax),%ecx
cmp    $0x21,%ecx
ja     1255 <main+0x95>
movslq (%r12,%rcx,4),%rax
add    %r12,%rax
jmp    *%rax
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
movl   $0x0,0xc(%rsp)
jmp    121d <main+0x5d>
cmp    $0xffffffff,%eax
jne    1211 <main+0x51>
mov    0x10(%rsp),%rax
mov    %eax,0x8(%rsp)
cmp    $0x1,%ebp
jg     1274 <main+0xb4>
mov    (%rbx),%rdi
mov    0x0(%r13),%esi
call   1080 <usage@plt>
xor    %eax,%eax
call   10a0 <getpgrp@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1040 <getpid@plt>
cmp    %rax,%rbp
jne    12b7 <main+0xf7>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
je     12b7 <main+0xf7>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1339 <main+0x179>
mov    0x2d21(%rip),%rax
mov    (%rax),%edi
lea    0xdfa(%rip),%rsi
xor    %eax,%eax
call   1070 <err@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <setsid@plt>
test   %rax,%rax
jns    12dc <main+0x11c>
mov    0x2cfc(%rip),%rax
mov    (%rax),%edi
lea    0xdf9(%rip),%rsi
xor    %eax,%eax
call   1070 <err@plt>
mov    0x2cfd(%rip),%r14
mov    (%r14),%rax
lea    (%rbx,%rax,8),%rsi
mov    (%rbx,%rax,8),%rdi
call   10b0 <execvp@plt>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rax
mov    (%rbx,%rax,8),%rdx
lea    0xdd2(%rip),%rsi
xor    %eax,%eax
call   1070 <err@plt>
jmp    1328 <main+0x168>
lea    0xd8c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2c92(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
testb  $0x1,0xc(%rsp)
jne    131f <main+0x15f>
lea    0x8(%rsp),%rdi
call   10d0 <wait@plt>
cmp    %ebp,%eax
je     1365 <main+0x1a5>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
lea    0xd2f(%rip),%rsi
xor    %eax,%eax
call   1070 <err@plt>
mov    0x8(%rsp),%edi
call   10c0 <WIFEXITED@plt>
mov    0x8(%rsp),%edi
test   %eax,%eax
je     137f <main+0x1bf>
call   1090 <WEXITSTATUS@plt>
mov    %eax,%ebp
jmp    1328 <main+0x168>
lea    0xd29(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <err@plt>
jmp    12b7 <main+0xf7>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32*, i32 }
@main.longopts = internal constant [5 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 99 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8 -128, i32* null, i32 119 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32* null, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8 -128, i32* null, i32 86 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"ctty\00"
@.str.1 = [5 x i8] c"wait\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [8 x i8] c"version\00"
@.str.4 = [7 x i8] c"+cwhvV\00"
@.str.5 = [4 x i8] c"0.1\00"
@EXIT_SUCCESS = global i32 0
@stdout = global i32 0
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.6 = [5 x i8] c"fork\00"
@.str.7 = [31 x i8] c"child %d did not exit normally\00"
@.str.8 = [14 x i8] c"setsid failed\00"
@optind = global i64 0
@.str.9 = [21 x i8] c"failed to execute %s\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
br label %9
9: ; preds = %33, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt_long(i32 %10, i8** %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([5 x %struct.option], [5 x %struct.option]* @main.longopts, i64 0, i64 0), i32* null)
store i32 %12, i32* %6
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %34
14: ; preds = %9
%15 = load i32, i32* %6
switch i32 %15, label %27 [
i32 99, label %16
i32 119, label %17
i32 86, label %18
i32 118, label %18
i32 104, label %21
]
16: ; preds = %14
br label %33
17: ; preds = %14
store i32 1, i32* %8
br label %33
18: ; preds = %14, %14
%19 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32, i32* @EXIT_SUCCESS
store i32 %20, i32* %3
br label %99
21: ; preds = %14
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = load i32, i32* @stdout
%26 = call i32 @usage(i8* %24, i32 %25)
br label %27
27: ; preds = %14, %21
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = load i32, i32* @stderr
%32 = call i32 @usage(i8* %30, i32 %31)
br label %33
33: ; preds = %27, %17, %16
br label %9
34: ; preds = %9
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 2
br i1 %36, label %37, label %43
37: ; preds = %34
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = load i32, i32* @stderr
%42 = call i32 @usage(i8* %40, i32 %41)
br label %43
43: ; preds = %37, %34
%44 = call i64 (...) @getpgrp()
%45 = call i64 (...) @getpid()
%46 = icmp eq i64 %44, %45
br i1 %46, label %47, label %78
47: ; preds = %43
%48 = call i32 (...) @fork()
store i32 %48, i32* %7
%49 = load i32, i32* %7
switch i32 %49, label %54 [
i32 -1, label %50
i32 0, label %53
]
50: ; preds = %47
%51 = load i32, i32* @EXIT_FAILURE
%52 = call i32 (i32, i8*, ...) @err(i32 %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %53
53: ; preds = %47, %50
br label %77
54: ; preds = %47
%55 = load i32, i32* %8
%56 = icmp ne i32 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = load i32, i32* @EXIT_SUCCESS
store i32 %58, i32* %3
br label %99
59: ; preds = %54
%60 = call i32 @wait(i32* %8)
%61 = load i32, i32* %7
%62 = icmp ne i32 %60, %61
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 (i32, i8*, ...) @err(i32 %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %66
66: ; preds = %63, %59
%67 = load i32, i32* %8
%68 = call i32 @WIFEXITED(i32 %67)
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %66
%71 = load i32, i32* %8
%72 = call i32 @WEXITSTATUS(i32 %71)
store i32 %72, i32* %3
br label %99
73: ; preds = %66
%74 = load i32, i32* %8
%75 = load i32, i32* %7
%76 = call i32 (i32, i8*, ...) @err(i32 %74, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %75)
br label %77
77: ; preds = %73, %53
br label %78
78: ; preds = %77, %43
%79 = call i64 (...) @setsid()
%80 = icmp slt i64 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %78
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 (i32, i8*, ...) @err(i32 %82, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %84
84: ; preds = %81, %78
%85 = load i8**, i8*** %5
%86 = load i64, i64* @optind
%87 = getelementptr inbounds i8*, i8** %85, i64 %86
%88 = load i8*, i8** %87
%89 = load i8**, i8*** %5
%90 = load i64, i64* @optind
%91 = getelementptr inbounds i8*, i8** %89, i64 %90
%92 = call i32 @execvp(i8* %88, i8** %91)
%93 = load i32, i32* @EXIT_FAILURE
%94 = load i8**, i8*** %5
%95 = load i64, i64* @optind
%96 = getelementptr inbounds i8*, i8** %94, i64 %95
%97 = load i8*, i8** %96
%98 = call i32 (i32, i8*, ...) @err(i32 %93, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %97)
br label %99
99: ; preds = %84, %70, %57, %18
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32*, i32 }
@main.longopts = internal constant [5 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 -128, i32* null, i32 99 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8 -128, i32* null, i32 119 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8 -128, i32* null, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8 -128, i32* null, i32 86 }, %struct.option zeroinitializer]
@.str = [5 x i8] c"ctty\00"
@.str.1 = [5 x i8] c"wait\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [8 x i8] c"version\00"
@.str.4 = [7 x i8] c"+cwhvV\00"
@.str.5 = [4 x i8] c"0.1\00"
@EXIT_SUCCESS = global i32 0
@stdout = global i32 0
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
@.str.6 = [5 x i8] c"fork\00"
@.str.7 = [31 x i8] c"child %d did not exit normally\00"
@.str.8 = [14 x i8] c"setsid failed\00"
@optind = global i64 0
@.str.9 = [21 x i8] c"failed to execute %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %8, %2
%6 = phi i1 [ true, %2 ], [ false, %8 ]
%7 = phi i32 [ 0, %2 ], [ 1, %8 ]
br label %8
8: ; preds = %10, %5
%9 = tail call i32 @getopt_long(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %struct.option* getelementptr inbounds ([5 x %struct.option], [5 x %struct.option]* @main.longopts, i64 0, i64 0), i32* null)
switch i32 %9, label %18 [
i32 -1, label %22
i32 99, label %10
i32 119, label %5
i32 86, label %11
i32 118, label %11
i32 104, label %14
]
10: ; preds = %8, %18
br label %8
11: ; preds = %8, %8
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* @EXIT_SUCCESS
br label %71
14: ; preds = %8
%15 = load i8*, i8** %1
%16 = load i32, i32* @stdout
%17 = tail call i32 @usage(i8* %15, i32 %16)
br label %18
18: ; preds = %8, %14
%19 = load i8*, i8** %1
%20 = load i32, i32* @stderr
%21 = tail call i32 @usage(i8* %19, i32 %20)
br label %10
22: ; preds = %8
store i32 %7, i32* %3
%23 = icmp slt i32 %0, 2
br i1 %23, label %24, label %28
24: ; preds = %22
%25 = load i8*, i8** %1
%26 = load i32, i32* @stderr
%27 = tail call i32 @usage(i8* %25, i32 %26)
br label %28
28: ; preds = %24, %22
%29 = tail call i64 (...) @getpgrp()
%30 = tail call i64 (...) @getpid()
%31 = icmp eq i64 %29, %30
br i1 %31, label %32, label %55
32: ; preds = %28
%33 = tail call i32 (...) @fork()
switch i32 %33, label %37 [
i32 -1, label %34
i32 0, label %55
]
34: ; preds = %32
%35 = load i32, i32* @EXIT_FAILURE
%36 = tail call i32 (i32, i8*, ...) @err(i32 %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %55
37: ; preds = %32
br i1 %6, label %38, label %40
38: ; preds = %37
%39 = load i32, i32* @EXIT_SUCCESS
br label %71
40: ; preds = %37
%41 = call i32 @wait(i32* %3)
%42 = icmp eq i32 %41, %33
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 (i32, i8*, ...) @err(i32 %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %43, %40
%47 = load i32, i32* %3
%48 = call i32 @WIFEXITED(i32 %47)
%49 = icmp eq i32 %48, 0
%50 = load i32, i32* %3
br i1 %49, label %53, label %51
51: ; preds = %46
%52 = call i32 @WEXITSTATUS(i32 %50)
br label %71
53: ; preds = %46
%54 = call i32 (i32, i8*, ...) @err(i32 %50, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i32 %33)
br label %55
55: ; preds = %32, %34, %53, %28
%56 = call i64 (...) @setsid()
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 (i32, i8*, ...) @err(i32 %59, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %61
61: ; preds = %58, %55
%62 = load i64, i64* @optind
%63 = getelementptr inbounds i8*, i8** %1, i64 %62
%64 = load i8*, i8** %63
%65 = call i32 @execvp(i8* %64, i8** %63)
%66 = load i32, i32* @EXIT_FAILURE
%67 = load i64, i64* @optind
%68 = getelementptr inbounds i8*, i8** %1, i64 %67
%69 = load i8*, i8** %68
%70 = call i32 (i32, i8*, ...) @err(i32 %66, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* %69)
br label %71
71: ; preds = %61, %51, %38, %11
%72 = phi i32 [ %13, %11 ], [ %52, %51 ], [ 0, %61 ], [ %39, %38 ]
ret i32 %72
}