#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 asprintf(char **, char *, ...);
int /*<<< orphan*/ err(int, char *, char *);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *getenv(char *);
int getopt(int, char **, char *);
char *optarg;
scalar_t__ optind;
int putenv(char *);
int setenv(char *, char *, int);
int /*<<< orphan*/ usage(int);
int /*<<< orphan*/ warn(char *, ...);
int main(int argc, char *argv[]) {
  char *ibuf, *obuf, *ebuf;
  char *preload0, *preload1;
  int i;
  ibuf = obuf = ebuf = NULL;
  while ((i = getopt(argc, argv, "e:i:o:")) != -1) {
    switch (i) {
    case 'e':
      ebuf = optarg;
      break;
    case 'i':
      ibuf = optarg;
      break;
    case 'o':
      obuf = optarg;
      break;
    case '?':
    default:
      usage(1);
      break;
    }
  }
  argc -= optind;
  argv += optind;
  if (argc == 0)
    exit(0);
  if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1)
    warn("Failed to set environment variable: %s=%s", "_STDBUF_I", ibuf);
  if (obuf != NULL && setenv("_STDBUF_O", obuf, 1) == -1)
    warn("Failed to set environment variable: %s=%s", "_STDBUF_O", obuf);
  if (ebuf != NULL && setenv("_STDBUF_E", ebuf, 1) == -1)
    warn("Failed to set environment variable: %s=%s", "_STDBUF_E", ebuf);
  preload0 = getenv("LD_PRELOAD");
  if (preload0 == NULL)
    i = asprintf(&preload1, "LD_PRELOAD="
                            "/usr/lib/libstdbuf.so");
  else
    i = asprintf(&preload1, "LD_PRELOAD=%s:%s", preload0,
                 "/usr/lib/libstdbuf.so");
  if (i < 0 || putenv(preload1) == -1)
    warn("Failed to set environment variable: LD_PRELOAD");
  preload0 = getenv("LD_32_PRELOAD");
  if (preload0 == NULL)
    i = asprintf(&preload1, "LD_32_PRELOAD="
                            "/usr/lib32/libstdbuf.so");
  else
    i = asprintf(&preload1, "LD_32_PRELOAD=%s:%s", preload0,
                 "/usr/lib32/libstdbuf.so");
  if (i < 0 || putenv(preload1) == -1)
    warn("Failed to set environment variable: LD_32_PRELOAD");
  execvp(argv[0], argv);
  err(2, "%s", argv[0]);
}


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)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe24(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x3c(%rbp)
cmp    $0xffffffff,%eax
je     1281 <main+0xe1>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
sub    $0x3f,%eax
je     126d <main+0xcd>
jmp    1201 <main+0x61>
mov    -0x40(%rbp),%eax
sub    $0x65,%eax
je     1234 <main+0x94>
jmp    1212 <main+0x72>
mov    -0x40(%rbp),%eax
sub    $0x69,%eax
je     1247 <main+0xa7>
jmp    1223 <main+0x83>
mov    -0x40(%rbp),%eax
sub    $0x6f,%eax
je     125a <main+0xba>
jmp    1272 <main+0xd2>
mov    0x2dbd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    127c <main+0xdc>
mov    0x2daa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    127c <main+0xdc>
mov    0x2d97(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    127c <main+0xdc>
jmp    1272 <main+0xd2>
mov    $0x1,%edi
call   1090 <usage@plt>
jmp    11ce <main+0x2e>
mov    0x2d58(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2d44(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    12bc <main+0x11c>
xor    %edi,%edi
call   10c0 <exit@plt>
cmpq   $0x0,-0x18(%rbp)
je     12fe <main+0x15e>
mov    -0x18(%rbp),%rsi
lea    0xd35(%rip),%rdi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0xffffffff,%eax
jne    12fe <main+0x15e>
mov    -0x18(%rbp),%rdx
lea    0xd21(%rip),%rdi
lea    0xd10(%rip),%rsi
mov    $0x0,%al
call   1040 <warn@plt>
cmpq   $0x0,-0x20(%rbp)
je     1340 <main+0x1a0>
mov    -0x20(%rbp),%rsi
lea    0xd27(%rip),%rdi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0xffffffff,%eax
jne    1340 <main+0x1a0>
mov    -0x20(%rbp),%rdx
lea    0xcdf(%rip),%rdi
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1040 <warn@plt>
cmpq   $0x0,-0x28(%rbp)
je     1382 <main+0x1e2>
mov    -0x28(%rbp),%rsi
lea    0xcef(%rip),%rdi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0xffffffff,%eax
jne    1382 <main+0x1e2>
mov    -0x28(%rbp),%rdx
lea    0xc9d(%rip),%rdi
lea    0xcca(%rip),%rsi
mov    $0x0,%al
call   1040 <warn@plt>
lea    0xd1c(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13b7 <main+0x217>
lea    -0x38(%rbp),%rdi
lea    0xca7(%rip),%rsi
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
jmp    13d7 <main+0x237>
mov    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rdi
lea    0xcaa(%rip),%rsi
lea    0xc8d(%rip),%rcx
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jl     13f3 <main+0x253>
mov    -0x38(%rbp),%rdi
call   1060 <putenv@plt>
cmp    $0xffffffff,%eax
jne    1401 <main+0x261>
lea    0xc87(%rip),%rdi
mov    $0x0,%al
call   1040 <warn@plt>
lea    0xd06(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1436 <main+0x296>
lea    -0x38(%rbp),%rdi
lea    0xc89(%rip),%rsi
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
jmp    1456 <main+0x2b6>
mov    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rdi
lea    0xc91(%rip),%rsi
lea    0xc72(%rip),%rcx
mov    $0x0,%al
call   1080 <asprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jl     1472 <main+0x2d2>
mov    -0x38(%rbp),%rdi
call   1060 <putenv@plt>
cmp    $0xffffffff,%eax
jne    1480 <main+0x2e0>
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1040 <warn@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   10b0 <execvp@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x2,%edi
lea    0xc44(%rip),%rsi
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
push   %rax
mov    %rsi,%r13
mov    %edi,%ebp
xor    %r12d,%r12d
lea    0xe46(%rip),%rbx
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    11da <main+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edi
call   1090 <usage@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    %rbx,%rdx
call   10a0 <getopt@plt>
cmp    $0x68,%eax
jg     1210 <main+0x70>
cmp    $0xffffffff,%eax
je     1232 <main+0x92>
cmp    $0x65,%eax
jne    11d0 <main+0x30>
mov    0x2dfb(%rip),%rax
mov    (%rax),%r14
jmp    11da <main+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x69,%eax
je     1226 <main+0x86>
cmp    $0x6f,%eax
jne    11d0 <main+0x30>
mov    0x2dd7(%rip),%rax
mov    (%rax),%r15
jmp    11da <main+0x3a>
mov    0x2dcb(%rip),%rax
mov    (%rax),%r12
jmp    11da <main+0x3a>
mov    0x2da7(%rip),%rax
mov    (%rax),%rbx
cmp    %ebp,%ebx
je     13e3 <main+0x243>
test   %r12,%r12
je     127a <main+0xda>
lea    0xdb7(%rip),%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0xffffffff,%eax
jne    127a <main+0xda>
lea    0xda8(%rip),%rdi
lea    0xd97(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <warn@plt>
test   %r15,%r15
je     12b0 <main+0x110>
lea    0xdb5(%rip),%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0xffffffff,%eax
jne    12b0 <main+0x110>
lea    0xd72(%rip),%rdi
lea    0xd95(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <warn@plt>
test   %r14,%r14
je     12e6 <main+0x146>
lea    0xd89(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0xffffffff,%eax
jne    12e6 <main+0x146>
lea    0xd3c(%rip),%rdi
lea    0xd69(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <warn@plt>
lea    0xdb8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1318 <main+0x178>
lea    0xd72(%rip),%rsi
lea    0xd55(%rip),%rcx
mov    %rsp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <asprintf@plt>
test   %eax,%eax
jns    132d <main+0x18d>
jmp    133b <main+0x19b>
lea    0xd30(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1080 <asprintf@plt>
test   %eax,%eax
js     133b <main+0x19b>
mov    (%rsp),%rdi
call   1060 <putenv@plt>
cmp    $0xffffffff,%eax
jne    1349 <main+0x1a9>
lea    0xd3f(%rip),%rdi
xor    %eax,%eax
call   1040 <warn@plt>
lea    0xdbe(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1377 <main+0x1d7>
lea    0xd75(%rip),%rsi
lea    0xd56(%rip),%rcx
mov    %rsp,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <asprintf@plt>
jmp    1388 <main+0x1e8>
lea    0xd32(%rip),%rsi
mov    %rsp,%rdi
xor    %eax,%eax
call   1080 <asprintf@plt>
lea    0x0(,%rbx,8),%rbx
add    %r13,%rbx
test   %eax,%eax
js     13a5 <main+0x205>
mov    (%rsp),%rdi
call   1060 <putenv@plt>
cmp    $0xffffffff,%eax
jne    13b3 <main+0x213>
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1040 <warn@plt>
mov    (%rbx),%rdi
mov    %rbx,%rsi
call   10b0 <execvp@plt>
mov    (%rbx),%rdx
lea    0xd1f(%rip),%rsi
mov    $0x2,%edi
call   1070 <err@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"e:i:o:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.1 = [10 x i8] c"_STDBUF_I\00"
@.str.2 = [42 x i8] c"Failed to set environment variable: %s=%s\00"
@.str.3 = [10 x i8] c"_STDBUF_O\00"
@.str.4 = [10 x i8] c"_STDBUF_E\00"
@.str.5 = [11 x i8] c"LD_PRELOAD\00"
@.str.6 = [33 x i8] c"LD_PRELOAD=/usr/lib/libstdbuf.so\00"
@.str.7 = [17 x i8] c"LD_PRELOAD=%s:%s\00"
@.str.8 = [22 x i8] c"/usr/lib/libstdbuf.so\00"
@.str.9 = [47 x i8] c"Failed to set environment variable: LD_PRELOAD\00"
@.str.10 = [14 x i8] c"LD_32_PRELOAD\00"
@.str.11 = [38 x i8] c"LD_32_PRELOAD=/usr/lib32/libstdbuf.so\00"
@.str.12 = [20 x i8] c"LD_32_PRELOAD=%s:%s\00"
@.str.13 = [24 x i8] c"/usr/lib32/libstdbuf.so\00"
@.str.14 = [50 x i8] c"Failed to set environment variable: LD_32_PRELOAD\00"
@.str.15 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %8
store i8* null, i8** %7
store i8* null, i8** %6
br label %12
12: ; preds = %28, %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %15, i32* %11
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %29
17: ; preds = %12
%18 = load i32, i32* %11
switch i32 %18, label %26 [
i32 101, label %19
i32 105, label %21
i32 111, label %23
i32 63, label %25
]
19: ; preds = %17
%20 = load i8*, i8** @optarg
store i8* %20, i8** %8
br label %28
21: ; preds = %17
%22 = load i8*, i8** @optarg
store i8* %22, i8** %6
br label %28
23: ; preds = %17
%24 = load i8*, i8** @optarg
store i8* %24, i8** %7
br label %28
25: ; preds = %17
br label %26
26: ; preds = %17, %25
%27 = call i32 @usage(i32 1)
br label %28
28: ; preds = %26, %23, %21, %19
br label %12
29: ; preds = %12
%30 = load i64, i64* @optind
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = sub nsw i64 %32, %30
%34 = trunc i64 %33 to i32
store i32 %34, i32* %4
%35 = load i64, i64* @optind
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 %35
store i8** %37, i8*** %5
%38 = load i32, i32* %4
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %29
%41 = call i32 @exit(i32 0)
unreachable
42: ; preds = %29
%43 = load i8*, i8** %6
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %52
45: ; preds = %42
%46 = load i8*, i8** %6
%47 = call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %46, i32 1)
%48 = icmp eq i32 %47, -1
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = load i8*, i8** %6
%51 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %50)
br label %52
52: ; preds = %49, %45, %42
%53 = load i8*, i8** %7
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %62
55: ; preds = %52
%56 = load i8*, i8** %7
%57 = call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %56, i32 1)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i8*, i8** %7
%61 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %60)
br label %62
62: ; preds = %59, %55, %52
%63 = load i8*, i8** %8
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %72
65: ; preds = %62
%66 = load i8*, i8** %8
%67 = call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %66, i32 1)
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %72
69: ; preds = %65
%70 = load i8*, i8** %8
%71 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %70)
br label %72
72: ; preds = %69, %65, %62
%73 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store i8* %73, i8** %9
%74 = load i8*, i8** %9
%75 = icmp eq i8* %74, null
br i1 %75, label %76, label %78
76: ; preds = %72
%77 = call i32 (i8**, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
store i32 %77, i32* %11
br label %81
78: ; preds = %72
%79 = load i8*, i8** %9
%80 = call i32 (i8**, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* %79, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
store i32 %80, i32* %11
br label %81
81: ; preds = %78, %76
%82 = load i32, i32* %11
%83 = icmp slt i32 %82, 0
br i1 %83, label %88, label %84
84: ; preds = %81
%85 = load i8*, i8** %10
%86 = call i32 @putenv(i8* %85)
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %90
88: ; preds = %84, %81
%89 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
br label %90
90: ; preds = %88, %84
%91 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
store i8* %91, i8** %9
%92 = load i8*, i8** %9
%93 = icmp eq i8* %92, null
br i1 %93, label %94, label %96
94: ; preds = %90
%95 = call i32 (i8**, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0))
store i32 %95, i32* %11
br label %99
96: ; preds = %90
%97 = load i8*, i8** %9
%98 = call i32 (i8**, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* %97, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0))
store i32 %98, i32* %11
br label %99
99: ; preds = %96, %94
%100 = load i32, i32* %11
%101 = icmp slt i32 %100, 0
br i1 %101, label %106, label %102
102: ; preds = %99
%103 = load i8*, i8** %10
%104 = call i32 @putenv(i8* %103)
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %108
106: ; preds = %102, %99
%107 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.14, i64 0, i64 0))
br label %108
108: ; preds = %106, %102
%109 = load i8**, i8*** %5
%110 = getelementptr inbounds i8*, i8** %109, i64 0
%111 = load i8*, i8** %110
%112 = load i8**, i8*** %5
%113 = call i32 @execvp(i8* %111, i8** %112)
%114 = load i8**, i8*** %5
%115 = getelementptr inbounds i8*, i8** %114, i64 0
%116 = load i8*, i8** %115
%117 = call i32 @err(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* %116)
%118 = load i32, i32* %3
ret i32 %118
}

LLVM IR (-O2):
@.str = [7 x i8] c"e:i:o:\00"
@optarg = global i8* null
@optind = global i64 0
@.str.1 = [10 x i8] c"_STDBUF_I\00"
@.str.2 = [42 x i8] c"Failed to set environment variable: %s=%s\00"
@.str.3 = [10 x i8] c"_STDBUF_O\00"
@.str.4 = [10 x i8] c"_STDBUF_E\00"
@.str.5 = [11 x i8] c"LD_PRELOAD\00"
@.str.6 = [33 x i8] c"LD_PRELOAD=/usr/lib/libstdbuf.so\00"
@.str.7 = [17 x i8] c"LD_PRELOAD=%s:%s\00"
@.str.8 = [22 x i8] c"/usr/lib/libstdbuf.so\00"
@.str.9 = [47 x i8] c"Failed to set environment variable: LD_PRELOAD\00"
@.str.10 = [14 x i8] c"LD_32_PRELOAD\00"
@.str.11 = [38 x i8] c"LD_32_PRELOAD=/usr/lib32/libstdbuf.so\00"
@.str.12 = [20 x i8] c"LD_32_PRELOAD=%s:%s\00"
@.str.13 = [24 x i8] c"/usr/lib32/libstdbuf.so\00"
@.str.14 = [50 x i8] c"Failed to set environment variable: LD_32_PRELOAD\00"
@.str.15 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
br label %5
5: ; preds = %18, %2
%6 = phi i8* [ %19, %18 ], [ null, %2 ]
%7 = phi i8* [ %10, %18 ], [ null, %2 ]
%8 = phi i8* [ %13, %18 ], [ null, %2 ]
br label %9
9: ; preds = %5, %20
%10 = phi i8* [ %7, %5 ], [ %21, %20 ]
%11 = phi i8* [ %8, %5 ], [ %13, %20 ]
br label %12
12: ; preds = %9, %16
%13 = phi i8* [ %11, %9 ], [ %17, %16 ]
br label %14
14: ; preds = %12, %22
%15 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %15, label %22 [
i32 -1, label %24
i32 101, label %16
i32 105, label %18
i32 111, label %20
]
16: ; preds = %14
%17 = load i8*, i8** @optarg
br label %12
18: ; preds = %14
%19 = load i8*, i8** @optarg
br label %5
20: ; preds = %14
%21 = load i8*, i8** @optarg
br label %9
22: ; preds = %14
%23 = tail call i32 @usage(i32 1)
br label %14
24: ; preds = %14
%25 = load i64, i64* @optind
%26 = trunc i64 %25 to i32
%27 = getelementptr inbounds i8*, i8** %1, i64 %25
%28 = icmp eq i32 %26, %0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = tail call i32 @exit(i32 0)
unreachable
31: ; preds = %24
%32 = icmp eq i8* %6, null
br i1 %32, label %38, label %33
33: ; preds = %31
%34 = tail call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 1)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %38
38: ; preds = %36, %33, %31
%39 = icmp eq i8* %10, null
br i1 %39, label %45, label %40
40: ; preds = %38
%41 = tail call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32 1)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = tail call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %10)
br label %45
45: ; preds = %43, %40, %38
%46 = icmp eq i8* %13, null
br i1 %46, label %52, label %47
47: ; preds = %45
%48 = tail call i32 @setenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %13, i32 1)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = tail call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %13)
br label %52
52: ; preds = %50, %47, %45
%53 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%54 = icmp eq i8* %53, null
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (i8**, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
br label %59
57: ; preds = %52
%58 = call i32 (i8**, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %59
59: ; preds = %57, %55
%60 = phi i32 [ %56, %55 ], [ %58, %57 ]
%61 = icmp slt i32 %60, 0
br i1 %61, label %66, label %62
62: ; preds = %59
%63 = load i8*, i8** %3
%64 = call i32 @putenv(i8* %63)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %68
66: ; preds = %62, %59
%67 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
br label %68
68: ; preds = %66, %62
%69 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
%70 = icmp eq i8* %69, null
br i1 %70, label %71, label %73
71: ; preds = %68
%72 = call i32 (i8**, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0))
br label %75
73: ; preds = %68
%74 = call i32 (i8**, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i8* %69, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.13, i64 0, i64 0))
br label %75
75: ; preds = %73, %71
%76 = phi i32 [ %72, %71 ], [ %74, %73 ]
%77 = icmp slt i32 %76, 0
br i1 %77, label %82, label %78
78: ; preds = %75
%79 = load i8*, i8** %3
%80 = call i32 @putenv(i8* %79)
%81 = icmp eq i32 %80, -1
br i1 %81, label %82, label %84
82: ; preds = %78, %75
%83 = call i32 (i8*, ...) @warn(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.14, i64 0, i64 0))
br label %84
84: ; preds = %82, %78
%85 = load i8*, i8** %27
%86 = call i32 @execvp(i8* %85, i8** %27)
%87 = load i8*, i8** %27
%88 = call i32 @err(i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i8* %87)
ret i32 0
}