#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 */

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ errno;
int execvpe(char *, char **, char **);
int fexecve(int, char **, char **);
int getpid();
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
char *strerror(int /*<<< orphan*/);
int main(void) {
  printf("ExecHelper tests - pid %d\n\n", getpid());
  extern char **environ;
  int ret;
  printf("\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
         "++\n");
  printf(
      "Attempting to execute /usr/bin/ristretto via a file descriptor... \n");
  int execfd = open("/usr/bin/ristretto", O_RDONLY);
  char *fargv[] = {"/home/steve/Downloads", "~/Documents/Administratif/CNI",
                   NULL};
  ret = fexecve(execfd, fargv, environ);
  if (ret)
    printf("Failed: %s\n", strerror(errno));
  else
    printf("Success!\n");
  printf("\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
         "++\n");
  printf("Attempting to execute /usr/bin/vlc with forbidden parameters... \n");
  char *argv[] = {"/usr/bin/vlc",
                  "/tmp/test.mp3",
                  "/tmp/test-managed.mp3",
                  "~/Documents/Administratif/Lol",
                  "../../../../tmp/test-managed.mp3",
                  NULL};
  ret = execvpe("vlc", argv, environ);
  if (ret)
    printf("Failed: %s\n", strerror(errno));
  else
    printf("Success!\n");
  printf("\n\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
         "++\n");
  printf(
      "Attempting to execute /usr/bin/vlc with only allowed parameters... \n");
  char *argv2[] = {"/usr/bin/vlc", "/tmp/test.mp3", "../../foo.mp3",
                   "~/Documents/AuthorisedFiles/Test.mp3", NULL};
  ret = execvpe("totem", argv2, environ);
  if (ret)
    printf("Failed: %s\n", strerror(errno));
  else
    printf("Success!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%esi
lea    0xee2(%rip),%rdi
call   1080 <open@plt>
mov    %eax,-0xc(%rbp)
mov    0x2c1c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2c19(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2c16(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    0x2de4(%rip),%rax
mov    (%rax),%rdx
call   1070 <fexecve@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1235 <main+0xc5>
mov    0x2db8(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    %rax,%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1243 <main+0xd3>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1060 <memset@plt>
lea    0xed0(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xefe(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x60(%rbp),%rsi
mov    0x2d2f(%rip),%rax
mov    (%rax),%rdx
lea    0xe94(%rip),%rdi
call   1040 <execvpe@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12f1 <main+0x181>
mov    0x2cfc(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    %rax,%rsi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12ff <main+0x18f>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    0xe11(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    0xe10(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xe94(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xe97(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    -0x90(%rbp),%rsi
mov    0x2c72(%rip),%rax
mov    (%rax),%rdx
lea    0xea0(%rip),%rdi
call   1040 <execvpe@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     13ae <main+0x23e>
mov    0x2c3f(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
mov    %rax,%rsi
lea    0xd4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13bc <main+0x24c>
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe76(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xfec(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%esi
lea    0xe61(%rip),%rdi
call   1080 <open@plt>
mov    0x2c39(%rip),%rcx
mov    %rcx,0x70(%rsp)
movaps 0x2c1d(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
mov    0x2e01(%rip),%r14
mov    (%r14),%rdx
lea    0x60(%rsp),%rsi
mov    %eax,%edi
call   1070 <fexecve@plt>
test   %eax,%eax
je     1213 <main+0xa3>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xe5c(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    121f <main+0xaf>
lea    0xff6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf60(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
lea    0xe29(%rip),%r15
mov    %r15,0x30(%rsp)
lea    0xe2a(%rip),%rbx
mov    %rbx,0x38(%rsp)
lea    0xe55(%rip),%rax
mov    %rax,0x40(%rsp)
lea    0xe20(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0xe32(%rip),%rax
mov    %rax,0x50(%rsp)
mov    (%r14),%rdx
lea    0xdf3(%rip),%rdi
lea    0x30(%rsp),%rsi
call   1050 <execvpe@plt>
test   %eax,%eax
je     12b4 <main+0x144>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xdbb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    12c0 <main+0x150>
lea    0xf55(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,0x20(%rsp)
mov    %r15,(%rsp)
mov    %rbx,0x8(%rsp)
lea    0xdd8(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xdda(%rip),%rax
mov    %rax,0x18(%rsp)
mov    (%r14),%rdx
lea    0xdf0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <execvpe@plt>
test   %eax,%eax
je     1339 <main+0x1c9>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
call   1090 <strerror@plt>
lea    0xd36(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1345 <main+0x1d5>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"ExecHelper tests - pid %d\0A\0A\00"
@.str.1 = [71 x i8] c"\0A\0A+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\0A\00"
@.str.2 = [68 x i8] c"Attempting to execute /usr/bin/ristretto via a file descriptor... \0A\00"
@.str.3 = [19 x i8] c"/usr/bin/ristretto\00"
@O_RDONLY = global i32 0
@.str.4 = [22 x i8] c"/home/steve/Downloads\00"
@.str.5 = [30 x i8] c"~/Documents/Administratif/CNI\00"
@__const.main.fargv = [3 x i8*] [i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i32 0, i32 0), i8* null]
@environ = external global i8**
@.str.6 = [12 x i8] c"Failed: %s\0A\00"
@errno = global i32 0
@.str.7 = [10 x i8] c"Success!\0A\00"
@.str.8 = [66 x i8] c"Attempting to execute /usr/bin/vlc with forbidden parameters... \0A\00"
@.str.9 = [13 x i8] c"/usr/bin/vlc\00"
@.str.10 = [14 x i8] c"/tmp/test.mp3\00"
@.str.11 = [22 x i8] c"/tmp/test-managed.mp3\00"
@.str.12 = [30 x i8] c"~/Documents/Administratif/Lol\00"
@.str.13 = [33 x i8] c"../../../../tmp/test-managed.mp3\00"
@.str.14 = [4 x i8] c"vlc\00"
@.str.15 = [69 x i8] c"Attempting to execute /usr/bin/vlc with only allowed parameters... \0A\00"
@.str.16 = [14 x i8] c"../../foo.mp3\00"
@.str.17 = [37 x i8] c"~/Documents/AuthorisedFiles/Test.mp3\00"
@.str.18 = [6 x i8] c"totem\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x i8*]
%5 = alloca [6 x i8*]
%6 = alloca [5 x i8*]
store i32 0, i32* %1
%7 = call i32 (...) @getpid()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @O_RDONLY
%12 = call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %11)
store i32 %12, i32* %3
%13 = bitcast [3 x i8*]* %4 to i8*
%14 = load i32, i32* %3
%15 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%16 = load i8**, i8*** @environ
%17 = call i32 @fexecve(i32 %14, i8** %15, i8** %16)
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %0
%21 = load i32, i32* @errno
%22 = call i8* @strerror(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %22)
br label %26
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.8, i64 0, i64 0))
%29 = bitcast [6 x i8*]* %5 to i8*
%30 = bitcast i8* %29 to [6 x i8*]*
%31 = getelementptr inbounds [6 x i8*], [6 x i8*]* %30, i32 0, i32 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i32 0, i32 0), i8** %31
%32 = getelementptr inbounds [6 x i8*], [6 x i8*]* %30, i32 0, i32 1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i32 0, i32 0), i8** %32
%33 = getelementptr inbounds [6 x i8*], [6 x i8*]* %30, i32 0, i32 2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i32 0, i32 0), i8** %33
%34 = getelementptr inbounds [6 x i8*], [6 x i8*]* %30, i32 0, i32 3
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i32 0, i32 0), i8** %34
%35 = getelementptr inbounds [6 x i8*], [6 x i8*]* %30, i32 0, i32 4
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i32 0, i32 0), i8** %35
%36 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 0
%37 = load i8**, i8*** @environ
%38 = call i32 @execvpe(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8** %36, i8** %37)
store i32 %38, i32* %2
%39 = load i32, i32* %2
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %26
%42 = load i32, i32* @errno
%43 = call i8* @strerror(i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %43)
br label %47
45: ; preds = %26
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %47
47: ; preds = %45, %41
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.15, i64 0, i64 0))
%50 = bitcast [5 x i8*]* %6 to i8*
%51 = bitcast i8* %50 to [5 x i8*]*
%52 = getelementptr inbounds [5 x i8*], [5 x i8*]* %51, i32 0, i32 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i32 0, i32 0), i8** %52
%53 = getelementptr inbounds [5 x i8*], [5 x i8*]* %51, i32 0, i32 1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i32 0, i32 0), i8** %53
%54 = getelementptr inbounds [5 x i8*], [5 x i8*]* %51, i32 0, i32 2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i32 0, i32 0), i8** %54
%55 = getelementptr inbounds [5 x i8*], [5 x i8*]* %51, i32 0, i32 3
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.17, i32 0, i32 0), i8** %55
%56 = getelementptr inbounds [5 x i8*], [5 x i8*]* %6, i64 0, i64 0
%57 = load i8**, i8*** @environ
%58 = call i32 @execvpe(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i8** %56, i8** %57)
store i32 %58, i32* %2
%59 = load i32, i32* %2
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %65
61: ; preds = %47
%62 = load i32, i32* @errno
%63 = call i8* @strerror(i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %63)
br label %67
65: ; preds = %47
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"ExecHelper tests - pid %d\0A\0A\00"
@.str.3 = [19 x i8] c"/usr/bin/ristretto\00"
@O_RDONLY = global i32 0
@.str.4 = [22 x i8] c"/home/steve/Downloads\00"
@.str.5 = [30 x i8] c"~/Documents/Administratif/CNI\00"
@__const.main.fargv = [3 x i8*] [i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i32 0, i32 0), i8* null]
@environ = external global i8**
@.str.6 = [12 x i8] c"Failed: %s\0A\00"
@errno = global i32 0
@.str.9 = [13 x i8] c"/usr/bin/vlc\00"
@.str.10 = [14 x i8] c"/tmp/test.mp3\00"
@.str.11 = [22 x i8] c"/tmp/test-managed.mp3\00"
@.str.12 = [30 x i8] c"~/Documents/Administratif/Lol\00"
@.str.13 = [33 x i8] c"../../../../tmp/test-managed.mp3\00"
@.str.14 = [4 x i8] c"vlc\00"
@.str.16 = [14 x i8] c"../../foo.mp3\00"
@.str.17 = [37 x i8] c"~/Documents/AuthorisedFiles/Test.mp3\00"
@.str.18 = [6 x i8] c"totem\00"
@str.19 = [67 x i8] c"Attempting to execute /usr/bin/ristretto via a file descriptor... \00"
@str.22 = [65 x i8] c"Attempting to execute /usr/bin/vlc with forbidden parameters... \00"
@str.24 = [70 x i8] c"\0A\0A+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\00"
@str.25 = [68 x i8] c"Attempting to execute /usr/bin/vlc with only allowed parameters... \00"
@str.26 = [9 x i8] c"Success!\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = alloca [6 x i8*]
%3 = alloca [5 x i8*]
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.24, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.19, i64 0, i64 0))
%8 = load i32, i32* @O_RDONLY
%9 = tail call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = bitcast [3 x i8*]* %1 to i8*
%11 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%12 = load i8**, i8*** @environ
%13 = call i32 @fexecve(i32 %9, i8** %11, i8** %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %0
%16 = load i32, i32* @errno
%17 = call i8* @strerror(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %17)
br label %21
19: ; preds = %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.26, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.24, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.22, i64 0, i64 0))
%24 = bitcast [6 x i8*]* %2 to i8*
%25 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 4
%26 = bitcast i8** %25 to i8*
%27 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8** %27
%28 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8** %28
%29 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i8** %29
%30 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0), i8** %30
%31 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 4
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8** %31
%32 = load i8**, i8*** @environ
%33 = call i32 @execvpe(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8** %27, i8** %32)
%34 = icmp eq i32 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %21
%36 = load i32, i32* @errno
%37 = call i8* @strerror(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %37)
br label %41
39: ; preds = %21
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.26, i64 0, i64 0))
br label %41
41: ; preds = %39, %35
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.24, i64 0, i64 0))
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.25, i64 0, i64 0))
%44 = bitcast [5 x i8*]* %3 to i8*
%45 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
%46 = bitcast i8** %45 to i64*
store i64 0, i64* %46
%47 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8** %47
%48 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8** %48
%49 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i8** %49
%50 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.17, i64 0, i64 0), i8** %50
%51 = load i8**, i8*** @environ
%52 = call i32 @execvpe(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i8** %47, i8** %51)
%53 = icmp eq i32 %52, 0
br i1 %53, label %58, label %54
54: ; preds = %41
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %56)
br label %60
58: ; preds = %41
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.26, i64 0, i64 0))
br label %60
60: ; preds = %58, %54
ret i32 0
}