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

/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int chdir(char *);
int close(int);
int dup(int /*<<< orphan*/);
int dup2(int, int /*<<< orphan*/);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int setsid();
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int fd;
  pid_t pid;
  if (argc < 3) {
    fputs("Usage: solitary directory command [args ..]\n", stderr);
    exit(EX_USAGE);
  }
  argv++;
  if (chdir(*argv) == -1)
    err(EX_OSERR, "chdir failed");
  if ((fd = open("/dev/null", O_RDONLY)) == -1)
    err(EX_OSERR, "open failed");
  if (dup2(fd, STDIN_FILENO) == -1)
    err(EX_OSERR, "dup2 failed");
  if (close(fd) == -1)
    err(EX_OSERR, "close failed");
  if ((fd = open("/dev/null", O_WRONLY)) == -1)
    err(EX_OSERR, "open failed");
  if (dup2(fd, STDOUT_FILENO) == -1)
    err(EX_OSERR, "dup2 failed");
  if (close(fd) == -1)
    err(EX_OSERR, "close failed");
  if ((pid = fork()) == -1)
    err(EX_OSERR, "fork failed");
  if (pid > 0)
    exit(0);
  if (setsid() == -1)
    err(EX_OSERR, "setsid failed");
  if ((fd = dup(STDOUT_FILENO)) == -1)
    err(EX_OSERR, "dup failed");
  if (dup2(fd, STDERR_FILENO) == -1)
    err(EX_OSERR, "dup2 failed");
  if (close(fd) == -1)
    err(EX_OSERR, "close failed");
  argv++;
  execvp(*argv, argv);
  err(EX_OSERR, "exec failed");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11f3 <main+0x43>
mov    0x2df1(%rip),%rax
mov    (%rax),%esi
lea    0xe20(%rip),%rdi
call   1060 <fputs@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    1229 <main+0x79>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xe09(%rip),%rsi
call   1090 <err@plt>
mov    0x2db0(%rip),%rax
mov    (%rax),%esi
lea    0xe01(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    125f <main+0xaf>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
lea    0xdea(%rip),%rsi
call   1090 <err@plt>
mov    -0x14(%rbp),%edi
mov    0x2d47(%rip),%rax
mov    (%rax),%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    128e <main+0xde>
mov    0x2d38(%rip),%rax
mov    (%rax),%edi
lea    0xdc7(%rip),%rsi
call   1090 <err@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
cmp    $0xffffffff,%eax
jne    12b4 <main+0x104>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
lea    0xdad(%rip),%rsi
call   1090 <err@plt>
mov    0x2ce5(%rip),%rax
mov    (%rax),%esi
lea    0xd76(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    12ea <main+0x13a>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    0xd5f(%rip),%rsi
call   1090 <err@plt>
mov    -0x14(%rbp),%edi
mov    0x2cfc(%rip),%rax
mov    (%rax),%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1319 <main+0x169>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
lea    0xd3c(%rip),%rsi
call   1090 <err@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
cmp    $0xffffffff,%eax
jne    133f <main+0x18f>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
lea    0xd22(%rip),%rsi
call   1090 <err@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1367 <main+0x1b7>
mov    0x2c5f(%rip),%rax
mov    (%rax),%edi
lea    0xd07(%rip),%rsi
call   1090 <err@plt>
cmpl   $0x0,-0x18(%rbp)
jle    1378 <main+0x1c8>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1080 <setsid@plt>
cmp    $0xffffffff,%eax
jne    139d <main+0x1ed>
mov    0x2c29(%rip),%rax
mov    (%rax),%edi
lea    0xcdd(%rip),%rsi
call   1090 <err@plt>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
call   1050 <dup@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    13cc <main+0x21c>
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    0xcbc(%rip),%rsi
call   1090 <err@plt>
mov    -0x14(%rbp),%edi
mov    0x2bea(%rip),%rax
mov    (%rax),%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    13fb <main+0x24b>
mov    0x2bcb(%rip),%rax
mov    (%rax),%edi
lea    0xc5a(%rip),%rsi
call   1090 <err@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
cmp    $0xffffffff,%eax
jne    1421 <main+0x271>
mov    0x2ba5(%rip),%rax
mov    (%rax),%edi
lea    0xc40(%rip),%rsi
call   1090 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <execvp@plt>
mov    0x2b74(%rip),%rax
mov    (%rax),%edi
lea    0xc41(%rip),%rsi
call   1090 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jle    13c4 <main+0x214>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    11e3 <main+0x33>
mov    0x2de3(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
call   1090 <err@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%esi
lea    0xe47(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1214 <main+0x64>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xe35(%rip),%rsi
call   1090 <err@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    123e <main+0x8e>
mov    0x2d88(%rip),%rax
mov    (%rax),%edi
lea    0xe17(%rip),%rsi
call   1090 <err@plt>
mov    %ebp,%edi
call   1070 <close@plt>
cmp    $0xffffffff,%eax
jne    125f <main+0xaf>
mov    0x2d67(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
call   1090 <err@plt>
mov    0x2d3a(%rip),%rax
mov    (%rax),%esi
lea    0xdcb(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    1290 <main+0xe0>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
lea    0xdb9(%rip),%rsi
call   1090 <err@plt>
mov    0x2d59(%rip),%r14
mov    (%r14),%esi
mov    %ebp,%edi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    12bb <main+0x10b>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
lea    0xd9a(%rip),%rsi
call   1090 <err@plt>
mov    %ebp,%edi
call   1070 <close@plt>
cmp    $0xffffffff,%eax
jne    12dc <main+0x12c>
mov    0x2cea(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
call   1090 <err@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
cmp    $0xffffffff,%eax
je     12f3 <main+0x143>
test   %eax,%eax
jle    1308 <main+0x158>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    0x2cbe(%rip),%rax
mov    (%rax),%edi
lea    0xd66(%rip),%rsi
call   1090 <err@plt>
xor    %eax,%eax
call   1080 <setsid@plt>
cmp    $0xffffffff,%eax
jne    1329 <main+0x179>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
lea    0xd51(%rip),%rsi
call   1090 <err@plt>
mov    (%r14),%edi
call   1050 <dup@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
jne    134d <main+0x19d>
mov    0x2c79(%rip),%rax
mov    (%rax),%edi
lea    0xd3b(%rip),%rsi
call   1090 <err@plt>
mov    0x2c6c(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1377 <main+0x1c7>
mov    0x2c4f(%rip),%rax
mov    (%rax),%edi
lea    0xcde(%rip),%rsi
call   1090 <err@plt>
mov    %ebp,%edi
call   1070 <close@plt>
cmp    $0xffffffff,%eax
jne    1398 <main+0x1e8>
mov    0x2c2e(%rip),%rax
mov    (%rax),%edi
lea    0xcc9(%rip),%rsi
call   1090 <err@plt>
mov    0x10(%rbx),%rdi
add    $0x10,%rbx
mov    %rbx,%rsi
call   10b0 <execvp@plt>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
lea    0xcd6(%rip),%rsi
call   1090 <err@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2bfd(%rip),%rax
mov    (%rax),%esi
lea    0xc2c(%rip),%rdi
call   1060 <fputs@plt>
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: solitary directory command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
@EX_OSERR = global i32 0
@.str.1 = [13 x i8] c"chdir failed\00"
@.str.2 = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
@.str.3 = [12 x i8] c"open failed\00"
@STDIN_FILENO = global i32 0
@.str.4 = [12 x i8] c"dup2 failed\00"
@.str.5 = [13 x i8] c"close failed\00"
@O_WRONLY = global i32 0
@STDOUT_FILENO = global i32 0
@.str.6 = [12 x i8] c"fork failed\00"
@.str.7 = [14 x i8] c"setsid failed\00"
@.str.8 = [11 x i8] c"dup failed\00"
@STDERR_FILENO = global i32 0
@.str.9 = [12 x i8] c"exec failed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fputs(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EX_USAGE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i32 1
store i8** %17, i8*** %5
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = call i32 @chdir(i8* %19)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load i32, i32* @EX_OSERR
%24 = call i32 @err(i32 %23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %22, %15
%26 = load i32, i32* @O_RDONLY
%27 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %26)
store i32 %27, i32* %6
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* @EX_OSERR
%31 = call i32 @err(i32 %30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %29, %25
%33 = load i32, i32* %6
%34 = load i32, i32* @STDIN_FILENO
%35 = call i32 @dup2(i32 %33, i32 %34)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i32, i32* @EX_OSERR
%39 = call i32 @err(i32 %38, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %40
40: ; preds = %37, %32
%41 = load i32, i32* %6
%42 = call i32 @close(i32 %41)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %47
44: ; preds = %40
%45 = load i32, i32* @EX_OSERR
%46 = call i32 @err(i32 %45, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %47
47: ; preds = %44, %40
%48 = load i32, i32* @O_WRONLY
%49 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %48)
store i32 %49, i32* %6
%50 = icmp eq i32 %49, -1
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = load i32, i32* @EX_OSERR
%53 = call i32 @err(i32 %52, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %54
54: ; preds = %51, %47
%55 = load i32, i32* %6
%56 = load i32, i32* @STDOUT_FILENO
%57 = call i32 @dup2(i32 %55, i32 %56)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %62
59: ; preds = %54
%60 = load i32, i32* @EX_OSERR
%61 = call i32 @err(i32 %60, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %62
62: ; preds = %59, %54
%63 = load i32, i32* %6
%64 = call i32 @close(i32 %63)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %69
66: ; preds = %62
%67 = load i32, i32* @EX_OSERR
%68 = call i32 @err(i32 %67, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %69
69: ; preds = %66, %62
%70 = call i32 (...) @fork()
store i32 %70, i32* %7
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i32, i32* @EX_OSERR
%74 = call i32 @err(i32 %73, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %75
75: ; preds = %72, %69
%76 = load i32, i32* %7
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %75
%79 = call i32 @exit(i32 0)
unreachable
80: ; preds = %75
%81 = call i32 (...) @setsid()
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = load i32, i32* @EX_OSERR
%85 = call i32 @err(i32 %84, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %86
86: ; preds = %83, %80
%87 = load i32, i32* @STDOUT_FILENO
%88 = call i32 @dup(i32 %87)
store i32 %88, i32* %6
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %93
90: ; preds = %86
%91 = load i32, i32* @EX_OSERR
%92 = call i32 @err(i32 %91, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %93
93: ; preds = %90, %86
%94 = load i32, i32* %6
%95 = load i32, i32* @STDERR_FILENO
%96 = call i32 @dup2(i32 %94, i32 %95)
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %101
98: ; preds = %93
%99 = load i32, i32* @EX_OSERR
%100 = call i32 @err(i32 %99, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %101
101: ; preds = %98, %93
%102 = load i32, i32* %6
%103 = call i32 @close(i32 %102)
%104 = icmp eq i32 %103, -1
br i1 %104, label %105, label %108
105: ; preds = %101
%106 = load i32, i32* @EX_OSERR
%107 = call i32 @err(i32 %106, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %108
108: ; preds = %105, %101
%109 = load i8**, i8*** %5
%110 = getelementptr inbounds i8*, i8** %109, i32 1
store i8** %110, i8*** %5
%111 = load i8**, i8*** %5
%112 = load i8*, i8** %111
%113 = load i8**, i8*** %5
%114 = call i32 @execvp(i8* %112, i8** %113)
%115 = load i32, i32* @EX_OSERR
%116 = call i32 @err(i32 %115, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%117 = load i32, i32* %3
ret i32 %117
}

LLVM IR (-O2):
@.str = [45 x i8] c"Usage: solitary directory command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
@EX_OSERR = global i32 0
@.str.1 = [13 x i8] c"chdir failed\00"
@.str.2 = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
@.str.3 = [12 x i8] c"open failed\00"
@STDIN_FILENO = global i32 0
@.str.4 = [12 x i8] c"dup2 failed\00"
@.str.5 = [13 x i8] c"close failed\00"
@O_WRONLY = global i32 0
@STDOUT_FILENO = global i32 0
@.str.6 = [12 x i8] c"fork failed\00"
@.str.7 = [14 x i8] c"setsid failed\00"
@.str.8 = [11 x i8] c"dup failed\00"
@STDERR_FILENO = global i32 0
@.str.9 = [12 x i8] c"exec failed\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EX_USAGE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @chdir(i8* %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* @EX_OSERR
%16 = tail call i32 @err(i32 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %14, %9
%18 = load i32, i32* @O_RDONLY
%19 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* @EX_OSERR
%23 = tail call i32 @err(i32 %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* @STDIN_FILENO
%26 = tail call i32 @dup2(i32 %19, i32 %25)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* @EX_OSERR
%30 = tail call i32 @err(i32 %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %28, %24
%32 = tail call i32 @close(i32 %19)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32, i32* @EX_OSERR
%36 = tail call i32 @err(i32 %35, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %34, %31
%38 = load i32, i32* @O_WRONLY
%39 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = icmp eq i32 %39, -1
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* @EX_OSERR
%43 = tail call i32 @err(i32 %42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %44
44: ; preds = %41, %37
%45 = load i32, i32* @STDOUT_FILENO
%46 = tail call i32 @dup2(i32 %39, i32 %45)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = load i32, i32* @EX_OSERR
%50 = tail call i32 @err(i32 %49, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %51
51: ; preds = %48, %44
%52 = tail call i32 @close(i32 %39)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = load i32, i32* @EX_OSERR
%56 = tail call i32 @err(i32 %55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %57
57: ; preds = %54, %51
%58 = tail call i32 (...) @fork()
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %63
60: ; preds = %57
%61 = load i32, i32* @EX_OSERR
%62 = tail call i32 @err(i32 %61, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
br label %67
63: ; preds = %57
%64 = icmp sgt i32 %58, 0
br i1 %64, label %65, label %67
65: ; preds = %63
%66 = tail call i32 @exit(i32 0)
unreachable
67: ; preds = %60, %63
%68 = tail call i32 (...) @setsid()
%69 = icmp eq i32 %68, -1
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i32, i32* @EX_OSERR
%72 = tail call i32 @err(i32 %71, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %73
73: ; preds = %70, %67
%74 = load i32, i32* @STDOUT_FILENO
%75 = tail call i32 @dup(i32 %74)
%76 = icmp eq i32 %75, -1
br i1 %76, label %77, label %80
77: ; preds = %73
%78 = load i32, i32* @EX_OSERR
%79 = tail call i32 @err(i32 %78, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %80
80: ; preds = %77, %73
%81 = load i32, i32* @STDERR_FILENO
%82 = tail call i32 @dup2(i32 %75, i32 %81)
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %87
84: ; preds = %80
%85 = load i32, i32* @EX_OSERR
%86 = tail call i32 @err(i32 %85, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %87
87: ; preds = %84, %80
%88 = tail call i32 @close(i32 %75)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = load i32, i32* @EX_OSERR
%92 = tail call i32 @err(i32 %91, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %93
93: ; preds = %90, %87
%94 = getelementptr inbounds i8*, i8** %1, i64 2
%95 = load i8*, i8** %94
%96 = tail call i32 @execvp(i8* %95, i8** %94)
%97 = load i32, i32* @EX_OSERR
%98 = tail call i32 @err(i32 %97, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}