#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__ uid_t;
typedef int pid_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ SOCK_STREAM;
scalar_t__ atoi(char const *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
scalar_t__ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
char *getenv(char *);
scalar_t__ getuid();
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ rootprocess(int);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ setuid(scalar_t__);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
scalar_t__ socketpair(int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int *);
int /*<<< orphan*/ stderr;
int strlen(char *);
int main(int argc, char *argv[]) {
  int pair[2];
  if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair))
    return 1;
  if (pair[0] < 3)
    goto error;
  pid_t pid = fork();
  switch (pid) {
  case -1:
    goto error;
  case 0: {
    int null = open("/dev/null", O_RDWR);
    if (null != -1) {
      dup2(null, 0);
      dup2(null, 1);
      dup2(null, 2);
      close(null);
    }
    close(pair[0]);
    setsid();
    rootprocess(pair[1]);
    exit(0);
  }
  }
  close(pair[1]);
  pair[1] = -1;
  char buf[21];
  snprintf(buf, sizeof(buf), "%d", pair[0]);
  setenv("VLC_ROOTWRAP_SOCK", buf, 1);
  uid_t uid = getuid();
  if (uid == 0) {
    const char *sudo = getenv("SUDO_UID");
    if (sudo)
      uid = atoi(sudo);
  }
  if (uid == 0) {
    fputs("Cannot determine unprivileged user for VLC!\n", stderr);
    exit(1);
  }
  setuid(uid);
  if (!setuid(0))
    exit(1);
  if (strlen(argv[0]) < sizeof("-wrapper"))
    goto error;
  argv[0][strlen(argv[0]) - strlen("-wrapper")] = '\0';
  (void)argc;
  if (execvp(argv[0], argv))
    perror(argv[0]);
error:
  close(pair[0]);
  if (pair[1] != -1)
    close(pair[1]);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
mov    0x2d82(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
xor    %edx,%edx
call   10c0 <socketpair@plt>
cmp    $0x0,%rax
je     1269 <main+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1486 <main+0x266>
cmpl   $0x3,-0x18(%rbp)
jge    1278 <main+0x58>
jmp    1465 <main+0x245>
xor    %eax,%eax
call   1140 <fork@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x54(%rbp)
sub    $0xffffffff,%eax
je     12a6 <main+0x86>
jmp    1296 <main+0x76>
mov    -0x54(%rbp),%eax
test   %eax,%eax
je     12ab <main+0x8b>
jmp    1317 <main+0xf7>
jmp    1465 <main+0x245>
mov    0x2d36(%rip),%rax
mov    (%rax),%esi
lea    0xd45(%rip),%rdi
call   10d0 <open@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
je     12f9 <main+0xd9>
mov    -0x20(%rbp),%edi
xor    %esi,%esi
call   1070 <dup2@plt>
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
call   1070 <dup2@plt>
mov    -0x20(%rbp),%edi
mov    $0x2,%esi
call   1070 <dup2@plt>
mov    -0x20(%rbp),%edi
call   10a0 <close@plt>
mov    -0x18(%rbp),%edi
call   10a0 <close@plt>
mov    $0x0,%al
call   10b0 <setsid@plt>
mov    -0x14(%rbp),%edi
call   1100 <rootprocess@plt>
xor    %edi,%edi
call   1120 <exit@plt>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
movl   $0xffffffff,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%ecx
mov    $0x15,%esi
lea    0xcd1(%rip),%rdx
call   1080 <snprintf@plt>
lea    -0x40(%rbp),%rsi
lea    0xcc4(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    $0x0,%al
call   1060 <getuid@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1396 <main+0x176>
lea    0xcaf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     1391 <main+0x171>
mov    -0x50(%rbp),%rdi
call   1110 <atoi@plt>
mov    %rax,-0x48(%rbp)
jmp    1396 <main+0x176>
cmpq   $0x0,-0x48(%rbp)
jne    13c0 <main+0x1a0>
mov    0x2c28(%rip),%rax
mov    (%rax),%esi
lea    0xc77(%rip),%rdi
call   1090 <fputs@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    -0x48(%rbp),%rdi
call   1130 <setuid@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1130 <setuid@plt>
cmp    $0x0,%eax
jne    13e5 <main+0x1c5>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
cltq
cmp    $0x9,%rax
jae    1402 <main+0x1e2>
jmp    1465 <main+0x245>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x64(%rbp)
lea    0xc32(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x64(%rbp),%ecx
mov    %eax,%edx
mov    -0x60(%rbp),%rax
sub    %edx,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   10f0 <execvp@plt>
cmp    $0x0,%rax
je     1460 <main+0x240>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10e0 <perror@plt>
jmp    1465 <main+0x245>
mov    -0x18(%rbp),%edi
call   10a0 <close@plt>
cmpl   $0xffffffff,-0x14(%rbp)
je     147f <main+0x25f>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    0x2d8d(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rcx
xor    %edx,%edx
call   10c0 <socketpair@plt>
test   %rax,%rax
jne    1357 <main+0x137>
cmpl   $0x3,0x8(%rsp)
jl     1340 <main+0x120>
xor    %eax,%eax
call   1140 <fork@plt>
cmp    $0xffffffff,%eax
je     1340 <main+0x120>
test   %eax,%eax
je     136f <main+0x14f>
mov    0xc(%rsp),%edi
call   10a0 <close@plt>
movl   $0xffffffff,0xc(%rsp)
ff
mov    0x8(%rsp),%ecx
lea    0xd79(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x15,%esi
call   1080 <snprintf@plt>
lea    0xd63(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
xor    %eax,%eax
call   1060 <getuid@plt>
test   %rax,%rax
jne    12e9 <main+0xc9>
lea    0xd55(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     13d3 <main+0x1b3>
mov    %rax,%rdi
call   1110 <atoi@plt>
test   %rax,%rax
je     13d3 <main+0x1b3>
mov    %rax,%rdi
call   1130 <setuid@plt>
xor    %edi,%edi
call   1130 <setuid@plt>
test   %eax,%eax
je     13e8 <main+0x1c8>
mov    (%rbx),%rdi
call   1050 <strlen@plt>
cmp    $0x9,%eax
jb     1340 <main+0x120>
mov    (%rbx),%r14
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
lea    0xd34(%rip),%rdi
call   1050 <strlen@plt>
sub    %eax,%ebp
movslq %ebp,%rax
movb   $0x0,(%r14,%rax,1)
mov    (%rbx),%rdi
mov    %rbx,%rsi
call   10f0 <execvp@plt>
test   %rax,%rax
jne    1365 <main+0x145>
mov    0x8(%rsp),%edi
call   10a0 <close@plt>
mov    0xc(%rsp),%edi
cmp    $0xffffffff,%edi
je     1357 <main+0x137>
call   10a0 <close@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    (%rbx),%rdi
call   10e0 <perror@plt>
jmp    1340 <main+0x120>
mov    0x2c72(%rip),%rax
mov    (%rax),%esi
lea    0xc81(%rip),%rdi
call   10d0 <open@plt>
cmp    $0xffffffff,%eax
je     13b3 <main+0x193>
mov    %eax,%ebx
mov    %eax,%edi
xor    %esi,%esi
call   1070 <dup2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1070 <dup2@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1070 <dup2@plt>
mov    %ebx,%edi
call   10a0 <close@plt>
mov    0x8(%rsp),%edi
call   10a0 <close@plt>
xor    %eax,%eax
call   10b0 <setsid@plt>
mov    0xc(%rsp),%edi
call   1100 <rootprocess@plt>
xor    %edi,%edi
call   1120 <exit@plt>
mov    0x2bf6(%rip),%rax
mov    (%rax),%esi
lea    0xc45(%rip),%rdi
call   1090 <fputs@plt>
mov    $0x1,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"VLC_ROOTWRAP_SOCK\00"
@.str.3 = [9 x i8] c"SUDO_UID\00"
@.str.4 = [45 x i8] c"Cannot determine unprivileged user for VLC!\0A\00"
@stderr = global i32 0
@.str.5 = [9 x i8] c"-wrapper\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca [21 x i8]
%10 = alloca i64
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* @AF_UNIX
%13 = load i32, i32* @SOCK_STREAM
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%15 = call i64 @socketpair(i32 %12, i32 %13, i32 0, i32* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %131
18: ; preds = %2
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%20 = load i32, i32* %19
%21 = icmp slt i32 %20, 3
br i1 %21, label %22, label %23
22: ; preds = %18
br label %119
23: ; preds = %18
%24 = call i32 (...) @fork()
store i32 %24, i32* %7
%25 = load i32, i32* %7
switch i32 %25, label %50 [
i32 -1, label %26
i32 0, label %27
]
26: ; preds = %23
br label %119
27: ; preds = %23
%28 = load i32, i32* @O_RDWR
%29 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %28)
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = icmp ne i32 %30, -1
br i1 %31, label %32, label %41
32: ; preds = %27
%33 = load i32, i32* %8
%34 = call i32 @dup2(i32 %33, i32 0)
%35 = load i32, i32* %8
%36 = call i32 @dup2(i32 %35, i32 1)
%37 = load i32, i32* %8
%38 = call i32 @dup2(i32 %37, i32 2)
%39 = load i32, i32* %8
%40 = call i32 @close(i32 %39)
br label %41
41: ; preds = %32, %27
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%43 = load i32, i32* %42
%44 = call i32 @close(i32 %43)
%45 = call i32 (...) @setsid()
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%47 = load i32, i32* %46
%48 = call i32 @rootprocess(i32 %47)
%49 = call i32 @exit(i32 0)
unreachable
50: ; preds = %23
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%52 = load i32, i32* %51
%53 = call i32 @close(i32 %52)
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 -1, i32* %54
%55 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%56 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%57 = load i32, i32* %56
%58 = call i32 @snprintf(i8* %55, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%60 = call i32 @setenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %59, i32 1)
%61 = call i64 (...) @getuid()
store i64 %61, i64* %10
%62 = load i64, i64* %10
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %72
64: ; preds = %50
%65 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i8* %65, i8** %11
%66 = load i8*, i8** %11
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = load i8*, i8** %11
%70 = call i64 @atoi(i8* %69)
store i64 %70, i64* %10
br label %71
71: ; preds = %68, %64
br label %72
72: ; preds = %71, %50
%73 = load i64, i64* %10
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = load i32, i32* @stderr
%77 = call i32 @fputs(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %76)
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %72
%80 = load i64, i64* %10
%81 = call i32 @setuid(i64 %80)
%82 = call i32 @setuid(i64 0)
%83 = icmp ne i32 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %79
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %79
%87 = load i8**, i8*** %5
%88 = getelementptr inbounds i8*, i8** %87, i64 0
%89 = load i8*, i8** %88
%90 = call i32 @strlen(i8* %89)
%91 = sext i32 %90 to i64
%92 = icmp ult i64 %91, 9
br i1 %92, label %93, label %94
93: ; preds = %86
br label %119
94: ; preds = %86
%95 = load i8**, i8*** %5
%96 = getelementptr inbounds i8*, i8** %95, i64 0
%97 = load i8*, i8** %96
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 0
%100 = load i8*, i8** %99
%101 = call i32 @strlen(i8* %100)
%102 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%103 = sub nsw i32 %101, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %97, i64 %104
store i8 0, i8* %105
%106 = load i32, i32* %4
%107 = load i8**, i8*** %5
%108 = getelementptr inbounds i8*, i8** %107, i64 0
%109 = load i8*, i8** %108
%110 = load i8**, i8*** %5
%111 = call i64 @execvp(i8* %109, i8** %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %118
113: ; preds = %94
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 0
%116 = load i8*, i8** %115
%117 = call i32 @perror(i8* %116)
br label %118
118: ; preds = %113, %94
br label %119
119: ; preds = %118, %93, %26, %22
%120 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%121 = load i32, i32* %120
%122 = call i32 @close(i32 %121)
%123 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%124 = load i32, i32* %123
%125 = icmp ne i32 %124, -1
br i1 %125, label %126, label %130
126: ; preds = %119
%127 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%128 = load i32, i32* %127
%129 = call i32 @close(i32 %128)
br label %130
130: ; preds = %126, %119
store i32 1, i32* %3
br label %131
131: ; preds = %130, %17
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"VLC_ROOTWRAP_SOCK\00"
@.str.3 = [9 x i8] c"SUDO_UID\00"
@.str.4 = [45 x i8] c"Cannot determine unprivileged user for VLC!\0A\00"
@stderr = global i32 0
@.str.5 = [9 x i8] c"-wrapper\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [2 x i32]
%4 = alloca [21 x i8]
%5 = bitcast [2 x i32]* %3 to i8*
%6 = load i32, i32* @AF_UNIX
%7 = load i32, i32* @SOCK_STREAM
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%9 = call i64 @socketpair(i32 %6, i32 %7, i32 0, i32* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %85
11: ; preds = %2
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 3
br i1 %13, label %77, label %14
14: ; preds = %11
%15 = call i32 (...) @fork()
switch i32 %15, label %33 [
i32 -1, label %77
i32 0, label %16
]
16: ; preds = %14
%17 = load i32, i32* @O_RDWR
%18 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %25, label %20
20: ; preds = %16
%21 = call i32 @dup2(i32 %18, i32 0)
%22 = call i32 @dup2(i32 %18, i32 1)
%23 = call i32 @dup2(i32 %18, i32 2)
%24 = call i32 @close(i32 %18)
br label %25
25: ; preds = %20, %16
%26 = load i32, i32* %8
%27 = call i32 @close(i32 %26)
%28 = call i32 (...) @setsid()
%29 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%30 = load i32, i32* %29
%31 = call i32 @rootprocess(i32 %30)
%32 = call i32 @exit(i32 0)
unreachable
33: ; preds = %14
%34 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%35 = load i32, i32* %34
%36 = call i32 @close(i32 %35)
store i32 -1, i32* %34
%37 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%38 = load i32, i32* %8
%39 = call i32 @snprintf(i8* %37, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = call i32 @setenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %37, i32 1)
%41 = call i64 (...) @getuid()
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %53
43: ; preds = %33
%44 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i8* %44, null
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = call i64 @atoi(i8* %44)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %43, %46
%50 = load i32, i32* @stderr
%51 = call i32 @fputs(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %33, %46
%54 = phi i64 [ %47, %46 ], [ %41, %33 ]
%55 = call i32 @setuid(i64 %54)
%56 = call i32 @setuid(i64 0)
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = call i32 @exit(i32 1)
unreachable
60: ; preds = %53
%61 = load i8*, i8** %1
%62 = call i32 @strlen(i8* %61)
%63 = icmp ult i32 %62, 9
br i1 %63, label %77, label %64
64: ; preds = %60
%65 = load i8*, i8** %1
%66 = call i32 @strlen(i8* %65)
%67 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%68 = sub nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %65, i64 %69
store i8 0, i8* %70
%71 = load i8*, i8** %1
%72 = call i64 @execvp(i8* %71, i8** %1)
%73 = icmp eq i64 %72, 0
br i1 %73, label %77, label %74
74: ; preds = %64
%75 = load i8*, i8** %1
%76 = call i32 @perror(i8* %75)
br label %77
77: ; preds = %64, %74, %60, %14, %11
%78 = load i32, i32* %8
%79 = call i32 @close(i32 %78)
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%81 = load i32, i32* %80
%82 = icmp eq i32 %81, -1
br i1 %82, label %85, label %83
83: ; preds = %77
%84 = call i32 @close(i32 %81)
br label %85
85: ; preds = %77, %83, %2
ret i32 1
}