#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 /*<<< orphan*/ target_stratum;
typedef int /*<<< orphan*/ target_restrict;
typedef int /*<<< orphan*/ target_path;
typedef size_t ssize_t;

/* Variables and functions */
#define EACCES 129
#define ENOENT 128
int PATH_MAX;
int errno;
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
size_t getxattr(char *, char *, char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char target_stratum[PATH_MAX];
  ssize_t len = getxattr("/proc/self/exe", "user.bedrock.stratum",
                         target_stratum, sizeof(target_stratum) - 1);
  if (len < 0) {
    fprintf(stderr, "bouncer: unable to determine target stratum\n");
    return errno;
  }
  target_stratum[len] = '\0';
  char target_path[PATH_MAX];
  len = getxattr("/proc/self/exe", "user.bedrock.localpath", target_path,
                 sizeof(target_path) - 1);
  if (len < 0) {
    fprintf(stderr, "bouncer: unable to determine target path\n");
    return errno;
  }
  target_path[len] = '\0';
  int restrict_flag = 0;
  char target_restrict[PATH_MAX];
  len = getxattr("/proc/self/exe", "user.bedrock.restrict", target_restrict,
                 sizeof(target_restrict) - 1);
  if (len >= 0) {
    restrict_flag = 1;
  }
  char *strat = "/bedrock/bin/strat";
  char *new_argv[argc + 6];
  new_argv[0] = strat;
  new_argv[1] = "--arg0";
  new_argv[2] = argv[0];
  if (restrict_flag) {
    new_argv[3] = "--restrict";
  }
  new_argv[3 + restrict_flag] = target_stratum;
  new_argv[4 + restrict_flag] = target_path;
  for (int i = 1; i < argc; i++) {
    new_argv[i + 4 + restrict_flag] = argv[i];
  }
  new_argv[argc + 4 + restrict_flag] = NULL;
  execv(strat, new_argv);
  fprintf(stderr, "bouncer: could not execute\n    %s\n", strat);
  switch (errno) {
  case EACCES:
    fprintf(stderr, "due to: permission denied (EACCES).\n");
    break;
  case ENOENT:
    fprintf(stderr, "due to: unable to find file (ENOENT).\n");
    break;
  default:
    perror("due to: execv:\n");
    break;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
sub    $0x1,%rax
mov    %eax,%ecx
lea    0xe6e(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1050 <getxattr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jae    11dc <main+0x9c>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x2c(%rbp)
jmp    1455 <main+0x315>
mov    -0x68(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    0x2e01(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x70(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x38(%rbp)
sub    $0x1,%rax
mov    %eax,%ecx
lea    0xde6(%rip),%rdi
lea    0xe30(%rip),%rsi
call   1050 <getxattr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jae    1264 <main+0x124>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
lea    0xe23(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x2c(%rbp)
jmp    1455 <main+0x315>
mov    -0x70(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x3c(%rbp)
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,%rsp
mov    %rax,-0x48(%rbp)
sub    $0x1,%rax
mov    %eax,%ecx
lea    0xd5b(%rip),%rdi
lea    0xde6(%rip),%rsi
call   1050 <getxattr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jb     12c7 <main+0x187>
movl   $0x1,-0x3c(%rbp)
lea    0xdda(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%eax
add    $0x6,%eax
mov    %eax,%ecx
lea    0xf(,%rcx,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x78(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x58(%rbp)
mov    -0x50(%rbp),%rcx
mov    %rcx,(%rax)
lea    0xdb6(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    %rcx,0x10(%rax)
cmpl   $0x0,-0x3c(%rbp)
je     132d <main+0x1ed>
mov    -0x78(%rbp),%rax
lea    0xd99(%rip),%rcx
mov    %rcx,0x18(%rax)
mov    -0x78(%rbp),%rax
mov    -0x70(%rbp),%rdx
mov    -0x68(%rbp),%rsi
mov    -0x3c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %rsi,(%rax,%rcx,8)
mov    -0x3c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1394 <main+0x254>
mov    -0x78(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x5c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdx
mov    -0x5c(%rbp),%ecx
add    $0x4,%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    135a <main+0x21a>
mov    -0x78(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0x3c(%rbp),%eax
mov    %eax,%ecx
mov    %edx,%eax
lea    0x4(%rax,%rcx,1),%eax
cltq
movq   $0x0,(%rsi,%rax,8)
mov    -0x50(%rbp),%rdi
call   1060 <execv@plt>
mov    0x2c18(%rip),%rax
mov    (%rax),%edi
mov    -0x50(%rbp),%rdx
lea    0xd00(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2bf5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x80,%eax
je     141f <main+0x2df>
jmp    13f0 <main+0x2b0>
mov    -0x7c(%rbp),%eax
sub    $0x81,%eax
jne    143b <main+0x2fb>
jmp    1403 <main+0x2c3>
mov    0x2bce(%rip),%rax
mov    (%rax),%edi
lea    0xcdd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1447 <main+0x307>
mov    0x2bb2(%rip),%rax
mov    (%rax),%edi
lea    0xce6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1447 <main+0x307>
lea    0xcfa(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,-0x30(%rbp)
mov    %edi,%r15d
mov    0x2e84(%rip),%rbx
mov    (%rbx),%eax
mov    %rsp,%r12
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
lea    -0x1(%rax),%ecx
lea    0xe74(%rip),%r13
lea    0xe7c(%rip),%rsi
mov    %r13,%rdi
mov    %r12,%rdx
call   1060 <getxattr@plt>
movb   $0x0,(%rax,%r12,1)
mov    (%rbx),%eax
mov    %rsp,%r14
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r14
mov    %r14,%rsp
lea    -0x1(%rax),%ecx
lea    0xe61(%rip),%rsi
mov    %r13,%rdi
mov    %r14,%rdx
call   1060 <getxattr@plt>
movb   $0x0,(%rax,%r14,1)
mov    (%rbx),%eax
mov    %rsp,%rdx
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rdx
mov    %rdx,%rsp
lea    -0x1(%rax),%ecx
lea    0xe48(%rip),%rsi
mov    %r13,%rdi
call   1060 <getxattr@plt>
mov    -0x30(%rbp),%rsi
lea    0x6(%r15),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rcx,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe2f(%rip),%rdx
mov    %rdx,(%rbx)
lea    0xe38(%rip),%rdx
mov    %rdx,0x8(%rbx)
mov    (%rsi),%rdx
neg    %rax
mov    %rdx,0x10(%rcx,%rax,1)
lea    0xe29(%rip),%rax
mov    %rax,0x18(%rbx)
mov    %r12,0x20(%rbx)
mov    %r14,0x28(%rbx)
cmp    $0x2,%r15d
jl     1269 <main+0x119>
lea    0x30(%rbx),%rdi
add    $0x8,%rsi
lea    -0x1(%r15),%edx
shl    $0x3,%rdx
call   1040 <memcpy@plt>
movslq %r15d,%rax
movq   $0x0,0x28(%rbx,%rax,8)
lea    0xdd5(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <execv@plt>
mov    0x2d4a(%rip),%rbx
mov    (%rbx),%edi
lea    0xddf(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2d28(%rip),%rax
mov    (%rax),%eax
cmp    $0x80,%eax
je     12c3 <main+0x173>
cmp    $0x81,%eax
jne    12e7 <main+0x197>
mov    (%rbx),%edi
lea    0xdd8(%rip),%rsi
jmp    12cc <main+0x17c>
mov    (%rbx),%edi
lea    0xdf2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf7(%rip),%rdi
call   1050 <perror@plt>
jmp    12d3 <main+0x183>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [21 x i8] c"user.bedrock.stratum\00"
@stderr = global i32 0
@.str.2 = [45 x i8] c"bouncer: unable to determine target stratum\0A\00"
@errno = global i32 0
@.str.3 = [23 x i8] c"user.bedrock.localpath\00"
@.str.4 = [42 x i8] c"bouncer: unable to determine target path\0A\00"
@.str.5 = [22 x i8] c"user.bedrock.restrict\00"
@.str.6 = [19 x i8] c"/bedrock/bin/strat\00"
@.str.7 = [7 x i8] c"--arg0\00"
@.str.8 = [11 x i8] c"--restrict\00"
@.str.9 = [35 x i8] c"bouncer: could not execute\0A %s\0A\00"
@.str.10 = [37 x i8] c"due to: permission denied (EACCES).\0A\00"
@.str.11 = [39 x i8] c"due to: unable to find file (ENOENT).\0A\00"
@.str.12 = [16 x i8] c"due to: execv:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* @PATH_MAX
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %6
%19 = alloca i8, i64 %17
store i64 %17, i64* %7
%20 = sub i64 %17, 1
%21 = trunc i64 %20 to i32
%22 = call i64 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %19, i32 %21)
store i64 %22, i64* %8
%23 = load i64, i64* %8
%24 = icmp ult i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* @errno
store i32 %28, i32* %3
store i32 1, i32* %9
br label %122
29: ; preds = %2
%30 = load i64, i64* %8
%31 = getelementptr inbounds i8, i8* %19, i64 %30
store i8 0, i8* %31
%32 = load i32, i32* @PATH_MAX
%33 = zext i32 %32 to i64
%34 = alloca i8, i64 %33
store i64 %33, i64* %10
%35 = sub i64 %33, 1
%36 = trunc i64 %35 to i32
%37 = call i64 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %34, i32 %36)
store i64 %37, i64* %8
%38 = load i64, i64* %8
%39 = icmp ult i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %29
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%43 = load i32, i32* @errno
store i32 %43, i32* %3
store i32 1, i32* %9
br label %122
44: ; preds = %29
%45 = load i64, i64* %8
%46 = getelementptr inbounds i8, i8* %34, i64 %45
store i8 0, i8* %46
store i32 0, i32* %11
%47 = load i32, i32* @PATH_MAX
%48 = zext i32 %47 to i64
%49 = alloca i8, i64 %48
store i64 %48, i64* %12
%50 = sub i64 %48, 1
%51 = trunc i64 %50 to i32
%52 = call i64 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %49, i32 %51)
store i64 %52, i64* %8
%53 = load i64, i64* %8
%54 = icmp uge i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %44
store i32 1, i32* %11
br label %56
56: ; preds = %55, %44
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %13
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 6
%59 = zext i32 %58 to i64
%60 = alloca i8*, i64 %59
store i64 %59, i64* %14
%61 = load i8*, i8** %13
%62 = getelementptr inbounds i8*, i8** %60, i64 0
store i8* %61, i8** %62
%63 = getelementptr inbounds i8*, i8** %60, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8** %63
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = getelementptr inbounds i8*, i8** %60, i64 2
store i8* %66, i8** %67
%68 = load i32, i32* %11
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %56
%71 = getelementptr inbounds i8*, i8** %60, i64 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8** %71
br label %72
72: ; preds = %70, %56
%73 = load i32, i32* %11
%74 = add nsw i32 3, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %60, i64 %75
store i8* %19, i8** %76
%77 = load i32, i32* %11
%78 = add nsw i32 4, %77
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8*, i8** %60, i64 %79
store i8* %34, i8** %80
store i32 1, i32* %15
br label %81
81: ; preds = %97, %72
%82 = load i32, i32* %15
%83 = load i32, i32* %4
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %100
85: ; preds = %81
%86 = load i8**, i8*** %5
%87 = load i32, i32* %15
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8*, i8** %86, i64 %88
%90 = load i8*, i8** %89
%91 = load i32, i32* %15
%92 = add nsw i32 %91, 4
%93 = load i32, i32* %11
%94 = add nsw i32 %92, %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %60, i64 %95
store i8* %90, i8** %96
br label %97
97: ; preds = %85
%98 = load i32, i32* %15
%99 = add nsw i32 %98, 1
store i32 %99, i32* %15
br label %81
100: ; preds = %81
%101 = load i32, i32* %4
%102 = add nsw i32 %101, 4
%103 = load i32, i32* %11
%104 = add nsw i32 %102, %103
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %60, i64 %105
store i8* null, i8** %106
%107 = load i8*, i8** %13
%108 = call i32 @execv(i8* %107, i8** %60)
%109 = load i32, i32* @stderr
%110 = load i8*, i8** %13
%111 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* %110)
%112 = load i32, i32* @errno
switch i32 %112, label %119 [
i32 129, label %113
i32 128, label %116
]
113: ; preds = %100
%114 = load i32, i32* @stderr
%115 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
br label %121
116: ; preds = %100
%117 = load i32, i32* @stderr
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
br label %121
119: ; preds = %100
%120 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %121
121: ; preds = %119, %116, %113
store i32 1, i32* %3
store i32 1, i32* %9
br label %122
122: ; preds = %121, %40, %25
%123 = load i8*, i8** %6
%124 = load i32, i32* %3
ret i32 %124
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [21 x i8] c"user.bedrock.stratum\00"
@stderr = global i32 0
@errno = global i32 0
@.str.3 = [23 x i8] c"user.bedrock.localpath\00"
@.str.5 = [22 x i8] c"user.bedrock.restrict\00"
@.str.6 = [19 x i8] c"/bedrock/bin/strat\00"
@.str.7 = [7 x i8] c"--arg0\00"
@.str.8 = [11 x i8] c"--restrict\00"
@.str.9 = [35 x i8] c"bouncer: could not execute\0A %s\0A\00"
@.str.10 = [37 x i8] c"due to: permission denied (EACCES).\0A\00"
@.str.11 = [39 x i8] c"due to: unable to find file (ENOENT).\0A\00"
@.str.12 = [16 x i8] c"due to: execv:\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = add i32 %3, -1
%7 = call i64 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
%9 = load i32, i32* @PATH_MAX
%10 = zext i32 %9 to i64
%11 = alloca i8, i64 %10
%12 = add i32 %9, -1
%13 = call i64 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %11, i32 %12)
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i32, i32* @PATH_MAX
%16 = zext i32 %15 to i64
%17 = alloca i8, i64 %16
%18 = add i32 %15, -1
%19 = call i64 @getxattr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %17, i32 %18)
%20 = add nsw i32 %0, 6
%21 = zext i32 %20 to i64
%22 = alloca i8*, i64 %21
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %22
%23 = getelementptr inbounds i8*, i8** %22, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8** %23
%24 = load i8*, i8** %1
%25 = getelementptr inbounds i8*, i8** %22, i64 2
store i8* %24, i8** %25
%26 = getelementptr inbounds i8*, i8** %22, i64 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8** %26
%27 = getelementptr inbounds i8*, i8** %22, i64 4
store i8* %5, i8** %27
%28 = getelementptr inbounds i8*, i8** %22, i64 5
store i8* %11, i8** %28
%29 = icmp sgt i32 %0, 1
br i1 %29, label %30, label %38
30: ; preds = %2
%31 = getelementptr i8*, i8** %22, i64 6
%32 = bitcast i8** %31 to i8*
%33 = getelementptr i8*, i8** %1, i64 1
%34 = bitcast i8** %33 to i8*
%35 = add nsw i32 %0, -1
%36 = zext i32 %35 to i64
%37 = shl nuw nsw i64 %36, 3
br label %38
38: ; preds = %30, %2
%39 = add nsw i32 %0, 5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %22, i64 %40
store i8* null, i8** %41
%42 = call i32 @execv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %22)
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%45 = load i32, i32* @errno
switch i32 %45, label %52 [
i32 129, label %46
i32 128, label %49
]
46: ; preds = %38
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
br label %54
49: ; preds = %38
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
br label %54
52: ; preds = %38
%53 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
br label %54
54: ; preds = %46, %49, %52
ret i32 1
}