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

/* Variables and functions */
int asprintf(char **, char *, char *, ...);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ det_fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
scalar_t__ setenv(char *, char *, int);
int /*<<< orphan*/ stderr;
size_t strcspn(char *, char *);
scalar_t__ unsetenv(char *);
char *get_backtrace_human_readable(void *bt, char *bt_symbol) {
  char *syscom;
  char *output;
  int p = strcspn(bt_symbol, "( ");
  int num_bytes = asprintf(
      &syscom, "addr2line %p -i -s -p -C -e %.*s | sed 's/ .inlined by. //'",
      bt, p, bt_symbol);
  {
    if (num_bytes <= 0) {
      det_fprintf(
          stderr, "asprintf in %s:%d failed\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/GPUOpen-ProfessionalCompute-Tools/clARMOR/"
          "refs/heads/master/src/utils/util_functions.c",
          340);
      exit(-1);
    }
  };
  if (syscom == NULL)
    return NULL;
  char *save_environ = NULL;
  char *old_environ = getenv("LD_PRELOAD");
  if (old_environ != NULL) {
    num_bytes = asprintf(&save_environ, "%s", old_environ);
    {
      if (num_bytes <= 0) {
        det_fprintf(
            stderr, "asprintf in %s:%d failed\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/GPUOpen-ProfessionalCompute-Tools/"
            "clARMOR/refs/heads/master/src/utils/util_functions.c",
            350);
        exit(-1);
      }
    };
  }
  if (unsetenv("LD_PRELOAD")) {
    det_fprintf(stderr,
                "Failed to unset LD_PRELOAD when getting function name.\n");
    if (save_environ != NULL)
      free(save_environ);
    if (syscom != NULL)
      free(syscom);
    return NULL;
  }
  FILE *function_name = popen(syscom, "re");
  output = (char *)calloc(4096, sizeof(char));
  if ((fgets(output, 4096, function_name) != NULL))
    output[strcspn(output, "\n")] = '\0';
  output[4095] = '\0';
  pclose(function_name);
  if (save_environ != NULL) {
    if (setenv("LD_PRELOAD", save_environ, 1))
      det_fprintf(
          stderr,
          "Failed to reset LD_PRELOAD to %s when getting function name.\n",
          save_environ);
    free(save_environ);
  }
  if (syscom != NULL)
    free(syscom);
  return output;
}


x86 assembly (clang, -O0):
<get_backtrace_human_readable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   1070 <strcspn@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    -0x20(%rbp),%rdi
lea    0xe0a(%rip),%rsi
mov    $0x0,%al
call   10a0 <asprintf@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jg     123a <get_backtrace_human_readable+0x7a>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
lea    0xe22(%rip),%rsi
lea    0xe35(%rip),%rdx
mov    $0x154,%ecx
mov    $0x0,%al
call   10e0 <det_fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1252 <get_backtrace_human_readable+0x92>
movq   $0x0,-0x8(%rbp)
jmp    1410 <get_backtrace_human_readable+0x250>
movq   $0x0,-0x38(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     12ca <get_backtrace_human_readable+0x10a>
mov    -0x40(%rbp),%rdx
lea    -0x38(%rbp),%rdi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   10a0 <asprintf@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jg     12c5 <get_backtrace_human_readable+0x105>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
lea    0xd97(%rip),%rsi
lea    0xdaa(%rip),%rdx
mov    $0x15e,%ecx
mov    $0x0,%al
call   10e0 <det_fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
jmp    12ca <get_backtrace_human_readable+0x10a>
lea    0xe39(%rip),%rdi
call   10c0 <unsetenv@plt>
cmp    $0x0,%rax
je     132c <get_backtrace_human_readable+0x16c>
mov    0x2cf9(%rip),%rax
mov    (%rax),%edi
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   10e0 <det_fprintf@plt>
cmpq   $0x0,-0x38(%rbp)
je     130b <get_backtrace_human_readable+0x14b>
mov    -0x38(%rbp),%rdi
call   1040 <free@plt>
cmpq   $0x0,-0x20(%rbp)
je     131f <get_backtrace_human_readable+0x15f>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1410 <get_backtrace_human_readable+0x250>
mov    -0x20(%rbp),%rdi
lea    0xe19(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,-0x48(%rbp)
mov    $0x1000,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x1000,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1392 <get_backtrace_human_readable+0x1d2>
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xdcc(%rip),%rsi
call   1070 <strcspn@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
movb   $0x0,0xfff(%rax)
mov    -0x48(%rbp),%rdi
call   1060 <pclose@plt>
cmpq   $0x0,-0x38(%rbp)
je     13f4 <get_backtrace_human_readable+0x234>
mov    -0x38(%rbp),%rsi
lea    0xd4e(%rip),%rdi
mov    $0x1,%edx
call   1050 <setenv@plt>
cmp    $0x0,%rax
je     13eb <get_backtrace_human_readable+0x22b>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xd6f(%rip),%rsi
mov    $0x0,%al
call   10e0 <det_fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1040 <free@plt>
cmpq   $0x0,-0x20(%rbp)
je     1408 <get_backtrace_human_readable+0x248>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_backtrace_human_readable>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe2c(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcspn@plt>
lea    0xe20(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    %r14,%rdx
mov    %eax,%ecx
mov    %rbx,%r8
xor    %eax,%eax
call   10a0 <asprintf@plt>
test   %eax,%eax
jle    1353 <get_backtrace_human_readable+0x193>
cmpq   $0x0,0x10(%rsp)
je     128f <get_backtrace_human_readable+0xcf>
movq   $0x0,0x8(%rsp)
lea    0xeef(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1243 <get_backtrace_human_readable+0x83>
lea    0xee9(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <asprintf@plt>
test   %eax,%eax
jle    1371 <get_backtrace_human_readable+0x1b1>
lea    0xec0(%rip),%rdi
call   10c0 <unsetenv@plt>
test   %rax,%rax
je     1296 <get_backtrace_human_readable+0xd6>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
xor    %eax,%eax
call   10e0 <det_fprintf@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     127a <get_backtrace_human_readable+0xba>
call   1040 <free@plt>
mov    0x10(%rsp),%rdi
xor    %ebx,%ebx
test   %rdi,%rdi
jne    1343 <get_backtrace_human_readable+0x183>
jmp    1348 <get_backtrace_human_readable+0x188>
xor    %ebx,%ebx
jmp    1348 <get_backtrace_human_readable+0x188>
mov    0x10(%rsp),%rdi
lea    0xeae(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,%r14
mov    $0x1000,%edi
mov    $0x1,%esi
call   1090 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1000,%esi
mov    %r14,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     12e4 <get_backtrace_human_readable+0x124>
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
movb   $0x0,0xfff(%rbx)
mov    %r14,%rdi
call   1060 <pclose@plt>
mov    0x8(%rsp),%rsi
test   %rsi,%rsi
je     1339 <get_backtrace_human_readable+0x179>
lea    0xe06(%rip),%rdi
mov    $0x1,%edx
call   1050 <setenv@plt>
test   %rax,%rax
je     132f <get_backtrace_human_readable+0x16f>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rdx
lea    0xe2b(%rip),%rsi
xor    %eax,%eax
call   10e0 <det_fprintf@plt>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
mov    0x10(%rsp),%rdi
test   %rdi,%rdi
je     1348 <get_backtrace_human_readable+0x188>
call   1040 <free@plt>
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2c86(%rip),%rax
mov    (%rax),%edi
lea    0xcdc(%rip),%rsi
lea    0xcef(%rip),%rdx
mov    $0x154,%ecx
jmp    138d <get_backtrace_human_readable+0x1cd>
mov    0x2c68(%rip),%rax
mov    (%rax),%edi
lea    0xcbe(%rip),%rsi
lea    0xcd1(%rip),%rdx
mov    $0x15e,%ecx
xor    %eax,%eax
call   10e0 <det_fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"( \00"
@.str.1 = [60 x i8] c"addr2line %p -i -s -p -C -e %.*s | sed 's/ .inlined by. //'\00"
@stderr = global i32 0
@.str.2 = [26 x i8] c"asprintf in %s:%d failed\0A\00"
@.str.3 = [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GPUOpen-ProfessionalCompute-Tools/clARMOR/refs/heads/master/src/utils/util_functions.c\00"
@.str.4 = [11 x i8] c"LD_PRELOAD\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [56 x i8] c"Failed to unset LD_PRELOAD when getting function name.\0A\00"
@.str.7 = [3 x i8] c"re\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [62 x i8] c"Failed to reset LD_PRELOAD to %s when getting function name.\0A\00"
define i8* @get_backtrace_human_readable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%13 = load i8*, i8** %5
%14 = call i64 @strcspn(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = trunc i64 %14 to i32
store i32 %15, i32* %8
%16 = load i8*, i8** %4
%17 = load i32, i32* %8
%18 = load i8*, i8** %5
%19 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %6, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i8* %16, i32 %17, i8* %18)
store i32 %19, i32* %9
%20 = load i32, i32* %9
%21 = icmp sle i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @det_fprintf(i32 %23, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.3, i64 0, i64 0), i32 340)
%25 = call i32 @exit(i32 -1)
unreachable
26: ; preds = %2
%27 = load i8*, i8** %6
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %30
29: ; preds = %26
store i8* null, i8** %3
br label %102
30: ; preds = %26
store i8* null, i8** %10
%31 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
store i8* %31, i8** %11
%32 = load i8*, i8** %11
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %44
34: ; preds = %30
%35 = load i8*, i8** %11
%36 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %35)
store i32 %36, i32* %9
%37 = load i32, i32* %9
%38 = icmp sle i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @det_fprintf(i32 %40, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.3, i64 0, i64 0), i32 350)
%42 = call i32 @exit(i32 -1)
unreachable
43: ; preds = %34
br label %44
44: ; preds = %43, %30
%45 = call i64 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %62
47: ; preds = %44
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @det_fprintf(i32 %48, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%50 = load i8*, i8** %10
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = load i8*, i8** %10
%54 = call i32 @free(i8* %53)
br label %55
55: ; preds = %52, %47
%56 = load i8*, i8** %6
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %6
%60 = call i32 @free(i8* %59)
br label %61
61: ; preds = %58, %55
store i8* null, i8** %3
br label %102
62: ; preds = %44
%63 = load i8*, i8** %6
%64 = call i32* @popen(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %64, i32** %12
%65 = call i64 @calloc(i32 4096, i32 1)
%66 = inttoptr i64 %65 to i8*
store i8* %66, i8** %7
%67 = load i8*, i8** %7
%68 = load i32*, i32** %12
%69 = call i32* @fgets(i8* %67, i32 4096, i32* %68)
%70 = icmp ne i32* %69, null
br i1 %70, label %71, label %76
71: ; preds = %62
%72 = load i8*, i8** %7
%73 = load i8*, i8** %7
%74 = call i64 @strcspn(i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%75 = getelementptr inbounds i8, i8* %72, i64 %74
store i8 0, i8* %75
br label %76
76: ; preds = %71, %62
%77 = load i8*, i8** %7
%78 = getelementptr inbounds i8, i8* %77, i64 4095
store i8 0, i8* %78
%79 = load i32*, i32** %12
%80 = call i32 @pclose(i32* %79)
%81 = load i8*, i8** %10
%82 = icmp ne i8* %81, null
br i1 %82, label %83, label %94
83: ; preds = %76
%84 = load i8*, i8** %10
%85 = call i64 @setenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %84, i32 1)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %91
87: ; preds = %83
%88 = load i32, i32* @stderr
%89 = load i8*, i8** %10
%90 = call i32 (i32, i8*, ...) @det_fprintf(i32 %88, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %87, %83
%92 = load i8*, i8** %10
%93 = call i32 @free(i8* %92)
br label %94
94: ; preds = %91, %76
%95 = load i8*, i8** %6
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %100
97: ; preds = %94
%98 = load i8*, i8** %6
%99 = call i32 @free(i8* %98)
br label %100
100: ; preds = %97, %94
%101 = load i8*, i8** %7
store i8* %101, i8** %3
br label %102
102: ; preds = %100, %61, %29
%103 = load i8*, i8** %3
ret i8* %103
}

LLVM IR (-O2):
@.str = [3 x i8] c"( \00"
@.str.1 = [60 x i8] c"addr2line %p -i -s -p -C -e %.*s | sed 's/ .inlined by. //'\00"
@stderr = global i32 0
@.str.2 = [26 x i8] c"asprintf in %s:%d failed\0A\00"
@.str.3 = [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/GPUOpen-ProfessionalCompute-Tools/clARMOR/refs/heads/master/src/utils/util_functions.c\00"
@.str.4 = [11 x i8] c"LD_PRELOAD\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [56 x i8] c"Failed to unset LD_PRELOAD when getting function name.\0A\00"
@.str.7 = [3 x i8] c"re\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [62 x i8] c"Failed to reset LD_PRELOAD to %s when getting function name.\0A\00"
define i8* @get_backtrace_human_readable(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast i8** %3 to i8*
%6 = tail call i64 @strcspn(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = trunc i64 %6 to i32
%8 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %7, i8* %1)
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @det_fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.3, i64 0, i64 0), i32 340)
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = icmp eq i8* %15, null
br i1 %16, label %75, label %17
17: ; preds = %14
%18 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%19 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i8* %19, null
br i1 %20, label %28, label %21
21: ; preds = %17
%22 = call i32 (i8**, i8*, i8*, ...) @asprintf(i8** %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%23 = icmp slt i32 %22, 1
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @det_fprintf(i32 %25, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str.3, i64 0, i64 0), i32 350)
%27 = call i32 @exit(i32 -1)
unreachable
28: ; preds = %21, %17
%29 = call i64 @unsetenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %41, label %31
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @det_fprintf(i32 %32, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%34 = load i8*, i8** %4
%35 = icmp eq i8* %34, null
br i1 %35, label %38, label %36
36: ; preds = %31
%37 = call i32 @free(i8* %34)
br label %38
38: ; preds = %36, %31
%39 = load i8*, i8** %3
%40 = icmp eq i8* %39, null
br i1 %40, label %73, label %69
41: ; preds = %28
%42 = load i8*, i8** %3
%43 = call i32* @popen(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%44 = call i64 @calloc(i32 4096, i32 1)
%45 = inttoptr i64 %44 to i8*
%46 = call i32* @fgets(i8* %45, i32 4096, i32* %43)
%47 = icmp eq i32* %46, null
br i1 %47, label %51, label %48
48: ; preds = %41
%49 = call i64 @strcspn(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%50 = getelementptr inbounds i8, i8* %45, i64 %49
store i8 0, i8* %50
br label %51
51: ; preds = %48, %41
%52 = getelementptr inbounds i8, i8* %45, i64 4095
store i8 0, i8* %52
%53 = call i32 @pclose(i32* %43)
%54 = load i8*, i8** %4
%55 = icmp eq i8* %54, null
br i1 %55, label %66, label %56
56: ; preds = %51
%57 = call i64 @setenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %54, i32 1)
%58 = icmp eq i64 %57, 0
br i1 %58, label %63, label %59
59: ; preds = %56
%60 = load i32, i32* @stderr
%61 = load i8*, i8** %4
%62 = call i32 (i32, i8*, ...) @det_fprintf(i32 %60, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i8* %61)
br label %63
63: ; preds = %59, %56
%64 = load i8*, i8** %4
%65 = call i32 @free(i8* %64)
br label %66
66: ; preds = %63, %51
%67 = load i8*, i8** %3
%68 = icmp eq i8* %67, null
br i1 %68, label %73, label %69
69: ; preds = %66, %38
%70 = phi i8* [ %39, %38 ], [ %67, %66 ]
%71 = phi i8* [ null, %38 ], [ %45, %66 ]
%72 = call i32 @free(i8* %70)
br label %73
73: ; preds = %69, %66, %38
%74 = phi i8* [ null, %38 ], [ %45, %66 ], [ %71, %69 ]
br label %75
75: ; preds = %14, %73
%76 = phi i8* [ %74, %73 ], [ null, %14 ]
ret i8* %76
}