#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 ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *find_chroot_base(char const *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *getenv(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
scalar_t__ isspace(char);
char *malloc(size_t);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ stderr;
char *str_replace(char *, char *, char *);
int strlen(char *);
char *strstr(char *, char *);
void conf_fakeenv(const char *exepath) {
  char *chroot_base = find_chroot_base(exepath);
  FILE *conf_file;
  char *conf_fname;
  char *linebuf;
  size_t linebuf_size;
  ssize_t len;
  asprintf(&conf_fname, "%s/dynpk.config", chroot_base);
  assert(conf_fname != NULL);
  conf_file = fopen(conf_fname, "r");
  if (conf_file == NULL) {
    fprintf(stderr, "wrap error: Couldn't open \"%s\"\n", conf_fname);
    exit(1);
  }
  free(conf_fname);
  linebuf_size = 200;
  linebuf = malloc(linebuf_size);
  assert(linebuf != NULL);
  while ((len = getline(&linebuf, &linebuf_size, conf_file)) != -1) {
    char *line, *equals, *varname, *val;
    if (len == 0)
      continue;
    line = linebuf;
    while (*line != '\0' && isspace(*line))
      line++;
    if (line[0] == '#' || line[0] == '\0')
      continue;
    equals = strstr(line, "=");
    if (equals == NULL) {
      fprintf(stderr, "wrap error: No '=' in line \"%s\"\n", line);
      exit(1);
    }
    *equals = '\0';
    varname = line;
    val = equals + 1;
    if (*val == '\0') {
      fprintf(stderr, "wrap error: Nothing after '='\n");
      exit(1);
    }
    int l = strlen(val);
    if (val[l - 1] == '\n')
      val[l - 1] = '\0';
    val = str_replace(val, "$FAKECHROOT_BASE", chroot_base);
    if (getenv("WRAP_DEBUG") != NULL)
      printf("Setting \"%s\" to \"%s\"\n", varname, val);
    setenv(varname, val, 1);
    free(val);
  }
  free(linebuf);
  fclose(conf_file);
}


x86 assembly (clang, -O0):
<conf_fakeenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1120 <find_chroot_base@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   10e0 <asprintf@plt>
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
mov    -0x20(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1293 <conf_fakeenv+0x83>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
movq   $0xc8,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
mov    -0x18(%rbp),%rdx
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1100 <getline@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     1491 <conf_fakeenv+0x281>
cmpl   $0x0,-0x34(%rbp)
jne    12ef <conf_fakeenv+0xdf>
jmp    12c3 <conf_fakeenv+0xb3>
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5d(%rbp)
je     1322 <conf_fakeenv+0x112>
mov    -0x40(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5d(%rbp)
mov    -0x5d(%rbp),%al
test   $0x1,%al
jne    1332 <conf_fakeenv+0x122>
jmp    1343 <conf_fakeenv+0x133>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    12f7 <conf_fakeenv+0xe7>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1363 <conf_fakeenv+0x153>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1368 <conf_fakeenv+0x158>
jmp    12c3 <conf_fakeenv+0xb3>
mov    -0x40(%rbp),%rdi
lea    0xcbf(%rip),%rsi
call   1130 <strstr@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    13ac <conf_fakeenv+0x19c>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rdx
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    13f8 <conf_fakeenv+0x1e8>
mov    0x2c02(%rip),%rax
mov    (%rax),%edi
lea    0xc6e(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
mov    -0x58(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    142f <conf_fakeenv+0x21f>
mov    -0x58(%rbp),%rax
mov    -0x5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x58(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xc36(%rip),%rsi
call   10c0 <str_replace@plt>
mov    %rax,-0x58(%rbp)
lea    0xc37(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1471 <conf_fakeenv+0x261>
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
lea    0xc24(%rip),%rdi
call   1080 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    $0x1,%edx
call   1050 <setenv@plt>
mov    -0x58(%rbp),%rdi
call   1040 <free@plt>
jmp    12c3 <conf_fakeenv+0xb3>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_fakeenv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
call   1130 <find_chroot_base@plt>
mov    %rax,%r14
lea    0xdd3(%rip),%rsi
mov    %rsp,%rdi
mov    %rax,%rdx
call   10f0 <asprintf@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
setne  %dil
call   10b0 <assert@plt>
mov    (%rsp),%rdi
lea    0xdbd(%rip),%rsi
call   1100 <fopen@plt>
test   %rax,%rax
je     13f0 <conf_fakeenv+0x1e0>
mov    %rax,%rbx
mov    (%rsp),%rdi
call   1040 <free@plt>
movq   $0xc8,0x10(%rsp)
mov    $0xc8,%edi
call   10e0 <malloc@plt>
mov    %rax,0x8(%rsp)
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   10b0 <assert@plt>
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%r12
jmp    12c0 <conf_fakeenv+0xb0>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x1,%edx
call   1050 <setenv@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1110 <getline@plt>
test   %eax,%eax
je     12c0 <conf_fakeenv+0xb0>
cmp    $0xffffffff,%eax
je     1399 <conf_fakeenv+0x189>
mov    0x8(%rsp),%r13
mov    0x0(%r13),%al
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %al,%al
je     12c0 <conf_fakeenv+0xb0>
movsbl %al,%edi
call   10a0 <isspace@plt>
test   %rax,%rax
je     130c <conf_fakeenv+0xfc>
movzbl 0x1(%r13),%eax
add    $0x1,%r13
jmp    12f0 <conf_fakeenv+0xe0>
mov    0x0(%r13),%al
test   %al,%al
je     12c0 <conf_fakeenv+0xb0>
cmp    $0x23,%al
je     12c0 <conf_fakeenv+0xb0>
mov    %r13,%rdi
mov    $0x3d,%esi
call   1080 <strchr@plt>
test   %rax,%rax
je     13ba <conf_fakeenv+0x1aa>
mov    %rax,%rbp
movb   $0x0,(%rax)
cmpb   $0x0,0x1(%rax)
je     13cf <conf_fakeenv+0x1bf>
add    $0x1,%rbp
mov    %rbp,%rdi
call   1070 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    1358 <conf_fakeenv+0x148>
movb   $0x0,-0x1(%rbp,%rax,1)
mov    %rbp,%rdi
lea    0xd10(%rip),%rsi
mov    %r14,%rdx
call   10d0 <str_replace@plt>
mov    %rax,%rbp
lea    0xd0f(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     129f <conf_fakeenv+0x8f>
lea    0xd05(%rip),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1090 <printf@plt>
jmp    129f <conf_fakeenv+0x8f>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c1f(%rip),%rax
mov    (%rax),%edi
lea    0xc68(%rip),%rsi
mov    %r13,%rdx
jmp    1404 <conf_fakeenv+0x1f4>
mov    0x2c0a(%rip),%rax
mov    (%rax),%edi
lea    0xc74(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rdx
lea    0xc0e(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s/dynpk.config\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [32 x i8] c"wrap error: Couldn't open \22%s\22\0A\00"
@.str.3 = [2 x i8] c"=\00"
@.str.4 = [33 x i8] c"wrap error: No '=' in line \22%s\22\0A\00"
@.str.5 = [31 x i8] c"wrap error: Nothing after '='\0A\00"
@.str.6 = [17 x i8] c"$FAKECHROOT_BASE\00"
@.str.7 = [11 x i8] c"WRAP_DEBUG\00"
@.str.8 = [22 x i8] c"Setting \22%s\22 to \22%s\22\0A\00"
define void @conf_fakeenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
store i8* %0, i8** %2
%14 = load i8*, i8** %2
%15 = call i8* @find_chroot_base(i8* %14)
store i8* %15, i8** %3
%16 = load i8*, i8** %3
%17 = call i32 @asprintf(i8** %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %5
%19 = icmp ne i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i8*, i8** %5
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %23, i32** %4
%24 = load i32*, i32** %4
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %31
26: ; preds = %1
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %5
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %1
%32 = load i8*, i8** %5
%33 = call i32 @free(i8* %32)
store i64 200, i64* %7
%34 = load i64, i64* %7
%35 = call i8* @malloc(i64 %34)
store i8* %35, i8** %6
%36 = load i8*, i8** %6
%37 = icmp ne i8* %36, null
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
br label %40
40: ; preds = %128, %77, %47, %31
%41 = load i32*, i32** %4
%42 = call i32 @getline(i8** %6, i64* %7, i32* %41)
store i32 %42, i32* %8
%43 = icmp ne i32 %42, -1
br i1 %43, label %44, label %134
44: ; preds = %40
%45 = load i32, i32* %8
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %44
br label %40
48: ; preds = %44
%49 = load i8*, i8** %6
store i8* %49, i8** %9
br label %50
50: ; preds = %62, %48
%51 = load i8*, i8** %9
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %60
55: ; preds = %50
%56 = load i8*, i8** %9
%57 = load i8, i8* %56
%58 = call i64 @isspace(i8 signext %57)
%59 = icmp ne i64 %58, 0
br label %60
60: ; preds = %55, %50
%61 = phi i1 [ false, %50 ], [ %59, %55 ]
br i1 %61, label %62, label %65
62: ; preds = %60
%63 = load i8*, i8** %9
%64 = getelementptr inbounds i8, i8* %63, i32 1
store i8* %64, i8** %9
br label %50
65: ; preds = %60
%66 = load i8*, i8** %9
%67 = getelementptr inbounds i8, i8* %66, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 35
br i1 %70, label %77, label %71
71: ; preds = %65
%72 = load i8*, i8** %9
%73 = getelementptr inbounds i8, i8* %72, i64 0
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %78
77: ; preds = %71, %65
br label %40
78: ; preds = %71
%79 = load i8*, i8** %9
%80 = call i8* @strstr(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %80, i8** %10
%81 = load i8*, i8** %10
%82 = icmp eq i8* %81, null
br i1 %82, label %83, label %88
83: ; preds = %78
%84 = load i32, i32* @stderr
%85 = load i8*, i8** %9
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %85)
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %78
%89 = load i8*, i8** %10
store i8 0, i8* %89
%90 = load i8*, i8** %9
store i8* %90, i8** %11
%91 = load i8*, i8** %10
%92 = getelementptr inbounds i8, i8* %91, i64 1
store i8* %92, i8** %12
%93 = load i8*, i8** %12
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %101
97: ; preds = %88
%98 = load i32, i32* @stderr
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%100 = call i32 @exit(i32 1)
unreachable
101: ; preds = %88
%102 = load i8*, i8** %12
%103 = call i32 @strlen(i8* %102)
store i32 %103, i32* %13
%104 = load i8*, i8** %12
%105 = load i32, i32* %13
%106 = sub nsw i32 %105, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %104, i64 %107
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 10
br i1 %111, label %112, label %118
112: ; preds = %101
%113 = load i8*, i8** %12
%114 = load i32, i32* %13
%115 = sub nsw i32 %114, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %113, i64 %116
store i8 0, i8* %117
br label %118
118: ; preds = %112, %101
%119 = load i8*, i8** %12
%120 = load i8*, i8** %3
%121 = call i8* @str_replace(i8* %119, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %120)
store i8* %121, i8** %12
%122 = call i32* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%123 = icmp ne i32* %122, null
br i1 %123, label %124, label %128
124: ; preds = %118
%125 = load i8*, i8** %11
%126 = load i8*, i8** %12
%127 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %125, i8* %126)
br label %128
128: ; preds = %124, %118
%129 = load i8*, i8** %11
%130 = load i8*, i8** %12
%131 = call i32 @setenv(i8* %129, i8* %130, i32 1)
%132 = load i8*, i8** %12
%133 = call i32 @free(i8* %132)
br label %40
134: ; preds = %40
%135 = load i8*, i8** %6
%136 = call i32 @free(i8* %135)
%137 = load i32*, i32** %4
%138 = call i32 @fclose(i32* %137)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s/dynpk.config\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [32 x i8] c"wrap error: Couldn't open \22%s\22\0A\00"
@.str.4 = [33 x i8] c"wrap error: No '=' in line \22%s\22\0A\00"
@.str.5 = [31 x i8] c"wrap error: Nothing after '='\0A\00"
@.str.6 = [17 x i8] c"$FAKECHROOT_BASE\00"
@.str.7 = [11 x i8] c"WRAP_DEBUG\00"
@.str.8 = [22 x i8] c"Setting \22%s\22 to \22%s\22\0A\00"
define void @conf_fakeenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = tail call i8* @find_chroot_base(i8* %0)
%6 = bitcast i8** %2 to i8*
%7 = bitcast i8** %3 to i8*
%8 = bitcast i64* %4 to i8*
%9 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%10 = load i8*, i8** %2
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %2
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %22
17: ; preds = %1
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %2
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %1
%23 = load i8*, i8** %2
%24 = call i32 @free(i8* %23)
store i64 200, i64* %4
%25 = call dereferenceable_or_null(200) i8* @malloc(i64 200)
store i8* %25, i8** %3
%26 = icmp ne i8* %25, null
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
br label %29
29: ; preds = %35, %22
%30 = call i32 @getline(i8** %3, i64* %4, i32* %15)
switch i32 %30, label %31 [
i32 -1, label %79
i32 0, label %35
]
31: ; preds = %29
%32 = load i8*, i8** %3
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %41, %31, %45, %45, %29, %76
br label %29
36: ; preds = %31, %41
%37 = phi i8 [ %43, %41 ], [ %33, %31 ]
%38 = phi i8* [ %42, %41 ], [ %32, %31 ]
%39 = call i64 @isspace(i8 signext %37)
%40 = icmp eq i64 %39, 0
br i1 %40, label %45, label %41
41: ; preds = %36
%42 = getelementptr inbounds i8, i8* %38, i64 1
%43 = load i8, i8* %42
%44 = icmp eq i8 %43, 0
br i1 %44, label %35, label %36
45: ; preds = %36
%46 = load i8, i8* %38
switch i8 %46, label %47 [
i8 35, label %35
i8 0, label %35
]
47: ; preds = %45
%48 = call i8* @strchr(i8* %38, i32 61)
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %38)
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %47
store i8 0, i8* %48
%55 = getelementptr inbounds i8, i8* %48, i64 1
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%61 = call i32 @exit(i32 1)
unreachable
62: ; preds = %54
%63 = call i32 @strlen(i8* %55)
%64 = add nsw i32 %63, -1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %55, i64 %65
%67 = load i8, i8* %66
%68 = icmp eq i8 %67, 10
br i1 %68, label %69, label %70
69: ; preds = %62
store i8 0, i8* %66
br label %70
70: ; preds = %69, %62
%71 = call i8* @str_replace(i8* %55, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%72 = call i32* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%73 = icmp eq i32* %72, null
br i1 %73, label %76, label %74
74: ; preds = %70
%75 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %38, i8* %71)
br label %76
76: ; preds = %74, %70
%77 = call i32 @setenv(i8* %38, i8* %71, i32 1)
%78 = call i32 @free(i8* %71)
br label %35
79: ; preds = %29
%80 = load i8*, i8** %3
%81 = call i32 @free(i8* %80)
%82 = call i32 @fclose(i32* %15)
ret void
}