#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 */
char *append3(char *, char *, char const *);
int /*<<< orphan*/ check_retval(int, char *);
char *getenv(char *);
int setenv(char *, char *, int const);
int /*<<< orphan*/ unsetenv(char *);
void update_environment(char *base_path) {
  int r;
  const int overwrite = 1;
  char *pin_ld_library_path = 0;
  char *new_ld_library_path = 0;
  const char *pin_runtime_dir = "runtime";
  const char *stl_lib_dir = "stl";
  char *ld_library_path = 0;
  char *ld_assume_kernel = 0;
  char *base_path32 = 0;
  char *pin_runtime_libs32 = 0;
  char *pin_stl_libs32 = 0;
  char *incoming_ld_preload = 0;
  char *incoming_ld_bind_now = 0;
  base_path32 = append3(base_path, "/", "ia32");
  pin_runtime_libs32 = append3(base_path32, "/", pin_runtime_dir);
  pin_stl_libs32 = append3(base_path32, "/", stl_lib_dir);
  ld_library_path = getenv("LD_LIBRARY_PATH");
  pin_ld_library_path = ld_library_path;
  pin_ld_library_path = append3(pin_ld_library_path, ":", pin_stl_libs32);
  pin_ld_library_path = append3(pin_runtime_libs32, ":", pin_ld_library_path);
  new_ld_library_path = ld_library_path;
  new_ld_library_path = append3(new_ld_library_path, ":", pin_stl_libs32);
  r = setenv("PIN_LD_RESTORE_REQUIRED", "t", overwrite);
  check_retval(r, "setenv PIN_LD_RESTORE_REQUIRED");
  r = setenv("PIN_VM_LD_LIBRARY_PATH", pin_ld_library_path, overwrite);
  check_retval(r, "setenv PIN_VM_LD_LIBRARY_PATH");
  if (ld_library_path) {
    r = setenv("PIN_APP_LD_LIBRARY_PATH", ld_library_path, overwrite);
    check_retval(r, "setenv PIN_APP_LD_LIBRARY_PATH");
  }
  r = setenv("LD_LIBRARY_PATH", new_ld_library_path, overwrite);
  check_retval(r, "setenv LD_LIBRARY_PATH");
  ld_assume_kernel = getenv("LD_ASSUME_KERNEL");
  if (ld_assume_kernel) {
    r = setenv("PIN_APP_LD_ASSUME_KERNEL", ld_assume_kernel, overwrite);
    check_retval(r, "setenv PIN_APP_LD_ASSUME_KERNEL");
    unsetenv("LD_ASSUME_KERNEL");
  }
  incoming_ld_bind_now = getenv("LD_BIND_NOW");
  if (incoming_ld_bind_now) {
    r = setenv("PIN_APP_LD_BIND_NOW", incoming_ld_bind_now, overwrite);
    check_retval(r, "setenv PIN_APP_LD_BIND_NOW");
    unsetenv("LD_BIND_NOW");
  }
  incoming_ld_preload = getenv("LD_PRELOAD");
  if (incoming_ld_preload) {
    r = setenv("PIN_APP_LD_PRELOAD", incoming_ld_preload, overwrite);
    check_retval(r, "setenv PIN_APP_LD_PRELOAD");
    unsetenv("LD_PRELOAD");
  }
}


x86 assembly (clang, -O0):
<update_environment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe86(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe40(%rip),%rsi
lea    0xe3b(%rip),%rdx
call   1050 <append3@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe21(%rip),%rsi
call   1050 <append3@plt>
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xe09(%rip),%rsi
call   1050 <append3@plt>
mov    %rax,-0x58(%rbp)
lea    0xe67(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x58(%rbp),%rdx
lea    0xde0(%rip),%rsi
call   1050 <append3@plt>
mov    %rax,-0x18(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xdc8(%rip),%rsi
call   1050 <append3@plt>
mov    %rax,-0x18(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x58(%rbp),%rdx
lea    0xda8(%rip),%rsi
call   1050 <append3@plt>
mov    %rax,-0x20(%rbp)
lea    0xda3(%rip),%rdi
lea    0xd93(%rip),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xd7e(%rip),%rsi
call   1060 <check_retval@plt>
mov    -0x18(%rbp),%rsi
lea    0xd94(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xd76(%rip),%rsi
call   1060 <check_retval@plt>
cmpq   $0x0,-0x38(%rbp)
je     12f7 <update_environment+0x1a7>
mov    -0x38(%rbp),%rsi
lea    0xd80(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xd62(%rip),%rsi
call   1060 <check_retval@plt>
mov    -0x20(%rbp),%rsi
lea    0xd78(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xd5a(%rip),%rsi
call   1060 <check_retval@plt>
lea    0xd74(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     136c <update_environment+0x21c>
mov    -0x40(%rbp),%rsi
lea    0xd4d(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xd2f(%rip),%rsi
call   1060 <check_retval@plt>
lea    0xd32(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0xd46(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     13ba <update_environment+0x26a>
mov    -0x68(%rbp),%rsi
lea    0xd1f(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xd01(%rip),%rsi
call   1060 <check_retval@plt>
lea    0xd04(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0xd13(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
je     1408 <update_environment+0x2b8>
mov    -0x60(%rbp),%rsi
lea    0xcec(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xcce(%rip),%rsi
call   1060 <check_retval@plt>
lea    0xcd1(%rip),%rdi
call   1070 <unsetenv@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_environment>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xead(%rip),%r14
lea    0xea8(%rip),%rdx
mov    %r14,%rsi
call   1050 <append3@plt>
mov    %rax,%rbx
lea    0xe88(%rip),%rdx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <append3@plt>
mov    %rax,%r15
lea    0xe7b(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <append3@plt>
mov    %rax,%rbx
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%r12
lea    0xe62(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <append3@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <append3@plt>
mov    %rax,%r15
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <append3@plt>
mov    %rax,%r14
lea    0xe36(%rip),%rdi
lea    0xe26(%rip),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xe17(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
lea    0xe2f(%rip),%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xe14(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
test   %r12,%r12
je     1250 <update_environment+0x100>
lea    0xe26(%rip),%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xe0b(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
lea    0xe23(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xe08(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
lea    0xe20(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     12b1 <update_environment+0x161>
lea    0xe07(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xdec(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
lea    0xded(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0xe01(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     12f0 <update_environment+0x1a0>
lea    0xde8(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xdcd(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
lea    0xdce(%rip),%rdi
call   1070 <unsetenv@plt>
lea    0xddd(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     133a <update_environment+0x1ea>
lea    0xdc4(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
lea    0xda9(%rip),%rsi
mov    %eax,%edi
call   1060 <check_retval@plt>
lea    0xdaa(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1070 <unsetenv@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"runtime\00"
@.str.1 = [4 x i8] c"stl\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [5 x i8] c"ia32\00"
@.str.4 = [16 x i8] c"LD_LIBRARY_PATH\00"
@.str.5 = [2 x i8] c":\00"
@.str.6 = [24 x i8] c"PIN_LD_RESTORE_REQUIRED\00"
@.str.7 = [2 x i8] c"t\00"
@.str.8 = [31 x i8] c"setenv PIN_LD_RESTORE_REQUIRED\00"
@.str.9 = [23 x i8] c"PIN_VM_LD_LIBRARY_PATH\00"
@.str.10 = [30 x i8] c"setenv PIN_VM_LD_LIBRARY_PATH\00"
@.str.11 = [24 x i8] c"PIN_APP_LD_LIBRARY_PATH\00"
@.str.12 = [31 x i8] c"setenv PIN_APP_LD_LIBRARY_PATH\00"
@.str.13 = [23 x i8] c"setenv LD_LIBRARY_PATH\00"
@.str.14 = [17 x i8] c"LD_ASSUME_KERNEL\00"
@.str.15 = [25 x i8] c"PIN_APP_LD_ASSUME_KERNEL\00"
@.str.16 = [32 x i8] c"setenv PIN_APP_LD_ASSUME_KERNEL\00"
@.str.17 = [12 x i8] c"LD_BIND_NOW\00"
@.str.18 = [20 x i8] c"PIN_APP_LD_BIND_NOW\00"
@.str.19 = [27 x i8] c"setenv PIN_APP_LD_BIND_NOW\00"
@.str.20 = [11 x i8] c"LD_PRELOAD\00"
@.str.21 = [19 x i8] c"PIN_APP_LD_PRELOAD\00"
@.str.22 = [26 x i8] c"setenv PIN_APP_LD_PRELOAD\00"
define void @update_environment(i8* %0) {
%2 = alloca i8*
%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 i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
store i8* %0, i8** %2
store i32 1, i32* %4
store i8* null, i8** %5
store i8* null, i8** %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i8* null, i8** %11
store i8* null, i8** %12
store i8* null, i8** %13
store i8* null, i8** %14
store i8* null, i8** %15
%16 = load i8*, i8** %2
%17 = call i8* @append3(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i8* %17, i8** %11
%18 = load i8*, i8** %11
%19 = load i8*, i8** %7
%20 = call i8* @append3(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %19)
store i8* %20, i8** %12
%21 = load i8*, i8** %11
%22 = load i8*, i8** %8
%23 = call i8* @append3(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %22)
store i8* %23, i8** %13
%24 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
store i8* %24, i8** %9
%25 = load i8*, i8** %9
store i8* %25, i8** %5
%26 = load i8*, i8** %5
%27 = load i8*, i8** %13
%28 = call i8* @append3(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %27)
store i8* %28, i8** %5
%29 = load i8*, i8** %12
%30 = load i8*, i8** %5
%31 = call i8* @append3(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %30)
store i8* %31, i8** %5
%32 = load i8*, i8** %9
store i8* %32, i8** %6
%33 = load i8*, i8** %6
%34 = load i8*, i8** %13
%35 = call i8* @append3(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %34)
store i8* %35, i8** %6
%36 = call i32 @setenv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
store i32 %36, i32* %3
%37 = load i32, i32* %3
%38 = call i32 @check_retval(i32 %37, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%39 = load i8*, i8** %5
%40 = call i32 @setenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %39, i32 1)
store i32 %40, i32* %3
%41 = load i32, i32* %3
%42 = call i32 @check_retval(i32 %41, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%43 = load i8*, i8** %9
%44 = icmp ne i8* %43, null
br i1 %44, label %45, label %50
45: ; preds = %1
%46 = load i8*, i8** %9
%47 = call i32 @setenv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %46, i32 1)
store i32 %47, i32* %3
%48 = load i32, i32* %3
%49 = call i32 @check_retval(i32 %48, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
br label %50
50: ; preds = %45, %1
%51 = load i8*, i8** %6
%52 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %51, i32 1)
store i32 %52, i32* %3
%53 = load i32, i32* %3
%54 = call i32 @check_retval(i32 %53, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
%55 = call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
store i8* %55, i8** %10
%56 = load i8*, i8** %10
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %64
58: ; preds = %50
%59 = load i8*, i8** %10
%60 = call i32 @setenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i8* %59, i32 1)
store i32 %60, i32* %3
%61 = load i32, i32* %3
%62 = call i32 @check_retval(i32 %61, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
%63 = call i32 @unsetenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %64
64: ; preds = %58, %50
%65 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
store i8* %65, i8** %15
%66 = load i8*, i8** %15
%67 = icmp ne i8* %66, null
br i1 %67, label %68, label %74
68: ; preds = %64
%69 = load i8*, i8** %15
%70 = call i32 @setenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i8* %69, i32 1)
store i32 %70, i32* %3
%71 = load i32, i32* %3
%72 = call i32 @check_retval(i32 %71, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
%73 = call i32 @unsetenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
br label %74
74: ; preds = %68, %64
%75 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
store i8* %75, i8** %14
%76 = load i8*, i8** %14
%77 = icmp ne i8* %76, null
br i1 %77, label %78, label %84
78: ; preds = %74
%79 = load i8*, i8** %14
%80 = call i32 @setenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i8* %79, i32 1)
store i32 %80, i32* %3
%81 = load i32, i32* %3
%82 = call i32 @check_retval(i32 %81, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0))
%83 = call i32 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
br label %84
84: ; preds = %78, %74
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"runtime\00"
@.str.1 = [4 x i8] c"stl\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [5 x i8] c"ia32\00"
@.str.4 = [16 x i8] c"LD_LIBRARY_PATH\00"
@.str.5 = [2 x i8] c":\00"
@.str.6 = [24 x i8] c"PIN_LD_RESTORE_REQUIRED\00"
@.str.7 = [2 x i8] c"t\00"
@.str.8 = [31 x i8] c"setenv PIN_LD_RESTORE_REQUIRED\00"
@.str.9 = [23 x i8] c"PIN_VM_LD_LIBRARY_PATH\00"
@.str.10 = [30 x i8] c"setenv PIN_VM_LD_LIBRARY_PATH\00"
@.str.11 = [24 x i8] c"PIN_APP_LD_LIBRARY_PATH\00"
@.str.12 = [31 x i8] c"setenv PIN_APP_LD_LIBRARY_PATH\00"
@.str.13 = [23 x i8] c"setenv LD_LIBRARY_PATH\00"
@.str.14 = [17 x i8] c"LD_ASSUME_KERNEL\00"
@.str.15 = [25 x i8] c"PIN_APP_LD_ASSUME_KERNEL\00"
@.str.16 = [32 x i8] c"setenv PIN_APP_LD_ASSUME_KERNEL\00"
@.str.17 = [12 x i8] c"LD_BIND_NOW\00"
@.str.18 = [20 x i8] c"PIN_APP_LD_BIND_NOW\00"
@.str.19 = [27 x i8] c"setenv PIN_APP_LD_BIND_NOW\00"
@.str.20 = [11 x i8] c"LD_PRELOAD\00"
@.str.21 = [19 x i8] c"PIN_APP_LD_PRELOAD\00"
@.str.22 = [26 x i8] c"setenv PIN_APP_LD_PRELOAD\00"
define void @update_environment(i8* %0) {
%2 = tail call i8* @append3(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i8* @append3(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @append3(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i8* @append3(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%7 = tail call i8* @append3(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%8 = tail call i8* @append3(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%9 = tail call i32 @setenv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%10 = tail call i32 @check_retval(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @setenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %7, i32 1)
%12 = tail call i32 @check_retval(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%13 = icmp eq i8* %5, null
br i1 %13, label %17, label %14
14: ; preds = %1
%15 = tail call i32 @setenv(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %5, i32 1)
%16 = tail call i32 @check_retval(i32 %15, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
br label %17
17: ; preds = %14, %1
%18 = tail call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %8, i32 1)
%19 = tail call i32 @check_retval(i32 %18, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
%20 = tail call i8* @getenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %26, label %22
22: ; preds = %17
%23 = tail call i32 @setenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i8* %20, i32 1)
%24 = tail call i32 @check_retval(i32 %23, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
%25 = tail call i32 @unsetenv(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
br label %26
26: ; preds = %22, %17
%27 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%28 = icmp eq i8* %27, null
br i1 %28, label %33, label %29
29: ; preds = %26
%30 = tail call i32 @setenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i8* %27, i32 1)
%31 = tail call i32 @check_retval(i32 %30, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.19, i64 0, i64 0))
%32 = tail call i32 @unsetenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
br label %33
33: ; preds = %29, %26
%34 = tail call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%35 = icmp eq i8* %34, null
br i1 %35, label %40, label %36
36: ; preds = %33
%37 = tail call i32 @setenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i8* %34, i32 1)
%38 = tail call i32 @check_retval(i32 %37, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0))
%39 = tail call i32 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
br label %40
40: ; preds = %36, %33
ret void
}