#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 /*<<< orphan*/ *fgets(char *, int const, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *getenv(char *);
scalar_t__ malloc(int const);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ memset(char *, char, int const);
int /*<<< orphan*/ *popen(char *, char *);
scalar_t__ realloc(char **, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
char **getExternalPaths() {
  FILE *fp;
  const int line_size = 256;
  const char *home_dir = getenv("USERPROFILE");
  char current_drive[line_size];
  if (home_dir == NULL) {
    fprintf(stderr, "Error: getExternalPaths: getenv failed\n");
    return 0;
  }
  memset(current_drive, '\0', line_size);
  for (int i = 0; i < line_size; i++)
    if (home_dir[i] == ':') {
      memcpy(current_drive, &home_dir[0], i + 1);
      break;
    }
  fp = popen("wmic logicaldisk get caption", "r");
  if (fp == NULL) {
    fprintf(stderr, "Error: getExternalPaths: unable to popen command\n");
    return 0;
  }
  char **paths = (char **)malloc(1);
  paths[0] = (char *)malloc(line_size);
  int i = 0;
  fgets(paths[0], line_size, fp);
  for (i = 0; fgets(paths[i], line_size, fp) != NULL; i++) {
    for (int j = 0; j < line_size; j++) {
      if (paths[i][j] <= ' ') {
        paths[i][j] = '\0';
        break;
      }
    }
    if (!strcmp(paths[i], current_drive))
      i--;
    else {
      paths = (char **)realloc(paths, i + 1);
      paths[i + 1] = (char *)malloc(line_size);
    }
  }
  paths[i][0] = '\0';
  return paths;
}


x86 assembly (clang, -O0):
<getExternalPaths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x100,-0x14(%rbp)
lea    0xe57(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
mov    %rsp,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11ed <getExternalPaths+0x5d>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    0xe38(%rip),%rsi
call   1070 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x2c(%rbp)
jmp    13f9 <getExternalPaths+0x269>
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movl   $0x0,-0x30(%rbp)
cmpl   $0x100,-0x30(%rbp)
jge    1257 <getExternalPaths+0xc7>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1244 <getExternalPaths+0xb4>
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%edx
add    $0x1,%edx
lea    -0x140(%rbp),%rdi
call   1080 <memcpy@plt>
jmp    1257 <getExternalPaths+0xc7>
jmp    1249 <getExternalPaths+0xb9>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1207 <getExternalPaths+0x77>
lea    0xdd6(%rip),%rdi
lea    0xdec(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    12a2 <getExternalPaths+0x112>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    0xdca(%rip),%rsi
call   1070 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x2c(%rbp)
jmp    13f9 <getExternalPaths+0x269>
mov    $0x1,%edi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x100,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x3c(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     13db <getExternalPaths+0x24b>
movl   $0x0,-0x40(%rbp)
cmpl   $0x100,-0x40(%rbp)
jge    1368 <getExternalPaths+0x1d8>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jg     1355 <getExternalPaths+0x1c5>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x40(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1368 <getExternalPaths+0x1d8>
jmp    135a <getExternalPaths+0x1ca>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1312 <getExternalPaths+0x182>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x140(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1397 <getExternalPaths+0x207>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    13c8 <getExternalPaths+0x238>
mov    -0x38(%rbp),%rdi
mov    -0x3c(%rbp),%esi
add    $0x1,%esi
call   10a0 <realloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x100,%edi
call   1090 <malloc@plt>
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    13cd <getExternalPaths+0x23d>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12e7 <getExternalPaths+0x157>
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movb   $0x0,(%rax)
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getExternalPaths>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
lea    0xe58(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11fa <getExternalPaths+0x6a>
mov    %rax,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
mov    $0x3,%edx
nopl   0x0(%rax)
cmpb   $0x3a,-0x3(%rbx,%rdx,1)
je     120f <getExternalPaths+0x7f>
cmpb   $0x3a,-0x2(%rbx,%rdx,1)
je     1215 <getExternalPaths+0x85>
cmpb   $0x3a,-0x1(%rbx,%rdx,1)
je     121b <getExternalPaths+0x8b>
cmpb   $0x3a,(%rbx,%rdx,1)
je     121f <getExternalPaths+0x8f>
add    $0x4,%rdx
cmp    $0x103,%rdx
jne    11d0 <getExternalPaths+0x40>
jmp    122d <getExternalPaths+0x9d>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
jmp    1380 <getExternalPaths+0x1f0>
add    $0xfffffffffffffffd,%rdx
jmp    121f <getExternalPaths+0x8f>
add    $0xfffffffffffffffe,%rdx
jmp    121f <getExternalPaths+0x8f>
add    $0xffffffffffffffff,%rdx
add    $0x1,%edx
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1080 <memcpy@plt>
lea    0xe00(%rip),%rdi
lea    0xe16(%rip),%rsi
call   10b0 <popen@plt>
test   %rax,%rax
je     1370 <getExternalPaths+0x1e0>
mov    %rax,%r14
mov    $0x1,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    $0x100,%edi
call   1090 <malloc@plt>
mov    %rax,0x0(%r13)
mov    %rax,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    0x0(%r13),%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     138a <getExternalPaths+0x1fa>
xor    %r12d,%r12d
mov    %rsp,%r15
mov    %r13,%rbx
jmp    12ec <getExternalPaths+0x15c>
nopl   0x0(%rax)
movslq %r12d,%rbp
lea    0x1(%rbp),%rbx
lea    0x1(%rbp),%r12d
mov    %r13,%rdi
mov    %r12d,%esi
call   10a0 <realloc@plt>
mov    %rax,%r13
mov    $0x100,%edi
call   1090 <malloc@plt>
mov    %rax,%rdi
mov    %rax,0x8(%r13,%rbp,8)
lea    0x0(,%rbx,8),%rbx
add    %r13,%rbx
mov    $0x100,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     138d <getExternalPaths+0x1fd>
mov    (%rbx),%rdi
mov    $0x3,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x20,-0x3(%rdi,%rax,1)
jle    1330 <getExternalPaths+0x1a0>
cmpb   $0x21,-0x2(%rdi,%rax,1)
jl     1340 <getExternalPaths+0x1b0>
cmpb   $0x21,-0x1(%rdi,%rax,1)
jl     1346 <getExternalPaths+0x1b6>
cmpb   $0x21,(%rdi,%rax,1)
jl     134a <getExternalPaths+0x1ba>
add    $0x4,%rax
cmp    $0x103,%rax
jne    1300 <getExternalPaths+0x170>
jmp    1353 <getExternalPaths+0x1c3>
nopl   0x0(%rax)
add    $0xfffffffffffffffd,%rax
jmp    134a <getExternalPaths+0x1ba>
cs nopw 0x0(%rax,%rax,1)
add    $0xfffffffffffffffe,%rax
jmp    134a <getExternalPaths+0x1ba>
add    $0xffffffffffffffff,%rax
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
mov    (%rbx),%rdi
mov    %r15,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    12a0 <getExternalPaths+0x110>
movslq %r12d,%rbx
mov    0x0(%r13,%rbx,8),%rdi
jmp    12cb <getExternalPaths+0x13b>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
lea    0xcd3(%rip),%rsi
call   1070 <fprintf@plt>
xor    %r13d,%r13d
jmp    1393 <getExternalPaths+0x203>
mov    %r13,%rbx
mov    (%rbx),%rax
movb   $0x0,(%rax)
mov    %r13,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"USERPROFILE\00"
@stderr = global i32 0
@.str.1 = [40 x i8] c"Error: getExternalPaths: getenv failed\0A\00"
@.str.2 = [29 x i8] c"wmic logicaldisk get caption\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [50 x i8] c"Error: getExternalPaths: unable to popen command\0A\00"
define i8** @getExternalPaths() {
%1 = alloca i8**
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i32
store i32 256, i32* %3
%11 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %4
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i8, i64 256
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
store i8** null, i8*** %1
store i32 1, i32* %6
br label %135
19: ; preds = %0
%20 = call i32 @memset(i8* %13, i8 signext 0, i32 256)
store i32 0, i32* %7
br label %21
21: ; preds = %39, %19
%22 = load i32, i32* %7
%23 = icmp slt i32 %22, 256
br i1 %23, label %24, label %42
24: ; preds = %21
%25 = load i8*, i8** %4
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 58
br i1 %31, label %32, label %38
32: ; preds = %24
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
%37 = call i32 @memcpy(i8* %13, i8* %34, i32 %36)
br label %42
38: ; preds = %24
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %21
42: ; preds = %32, %21
%43 = call i32* @popen(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %43, i32** %2
%44 = load i32*, i32** %2
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
store i8** null, i8*** %1
store i32 1, i32* %6
br label %135
49: ; preds = %42
%50 = call i64 @malloc(i32 1)
%51 = inttoptr i64 %50 to i8**
store i8** %51, i8*** %8
%52 = call i64 @malloc(i32 256)
%53 = inttoptr i64 %52 to i8*
%54 = load i8**, i8*** %8
%55 = getelementptr inbounds i8*, i8** %54, i64 0
store i8* %53, i8** %55
store i32 0, i32* %9
%56 = load i8**, i8*** %8
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = load i32*, i32** %2
%60 = call i32* @fgets(i8* %58, i32 256, i32* %59)
store i32 0, i32* %9
br label %61
61: ; preds = %124, %49
%62 = load i8**, i8*** %8
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
%67 = load i32*, i32** %2
%68 = call i32* @fgets(i8* %66, i32 256, i32* %67)
%69 = icmp ne i32* %68, null
br i1 %69, label %70, label %127
70: ; preds = %61
store i32 0, i32* %10
br label %71
71: ; preds = %96, %70
%72 = load i32, i32* %10
%73 = icmp slt i32 %72, 256
br i1 %73, label %74, label %99
74: ; preds = %71
%75 = load i8**, i8*** %8
%76 = load i32, i32* %9
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
%79 = load i8*, i8** %78
%80 = load i32, i32* %10
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp sle i32 %84, 32
br i1 %85, label %86, label %95
86: ; preds = %74
%87 = load i8**, i8*** %8
%88 = load i32, i32* %9
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8*, i8** %87, i64 %89
%91 = load i8*, i8** %90
%92 = load i32, i32* %10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
store i8 0, i8* %94
br label %99
95: ; preds = %74
br label %96
96: ; preds = %95
%97 = load i32, i32* %10
%98 = add nsw i32 %97, 1
store i32 %98, i32* %10
br label %71
99: ; preds = %86, %71
%100 = load i8**, i8*** %8
%101 = load i32, i32* %9
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8*, i8** %100, i64 %102
%104 = load i8*, i8** %103
%105 = call i32 @strcmp(i8* %104, i8* %13)
%106 = icmp ne i32 %105, 0
br i1 %106, label %110, label %107
107: ; preds = %99
%108 = load i32, i32* %9
%109 = add nsw i32 %108, -1
store i32 %109, i32* %9
br label %123
110: ; preds = %99
%111 = load i8**, i8*** %8
%112 = load i32, i32* %9
%113 = add nsw i32 %112, 1
%114 = call i64 @realloc(i8** %111, i32 %113)
%115 = inttoptr i64 %114 to i8**
store i8** %115, i8*** %8
%116 = call i64 @malloc(i32 256)
%117 = inttoptr i64 %116 to i8*
%118 = load i8**, i8*** %8
%119 = load i32, i32* %9
%120 = add nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8*, i8** %118, i64 %121
store i8* %117, i8** %122
br label %123
123: ; preds = %110, %107
br label %124
124: ; preds = %123
%125 = load i32, i32* %9
%126 = add nsw i32 %125, 1
store i32 %126, i32* %9
br label %61
127: ; preds = %61
%128 = load i8**, i8*** %8
%129 = load i32, i32* %9
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8*, i8** %128, i64 %130
%132 = load i8*, i8** %131
%133 = getelementptr inbounds i8, i8* %132, i64 0
store i8 0, i8* %133
%134 = load i8**, i8*** %8
store i8** %134, i8*** %1
store i32 1, i32* %6
br label %135
135: ; preds = %127, %46, %16
%136 = load i8*, i8** %5
%137 = load i8**, i8*** %1
ret i8** %137
}

LLVM IR (-O2):
@.str = [12 x i8] c"USERPROFILE\00"
@stderr = global i32 0
@.str.1 = [40 x i8] c"Error: getExternalPaths: getenv failed\0A\00"
@.str.2 = [29 x i8] c"wmic logicaldisk get caption\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [50 x i8] c"Error: getExternalPaths: unable to popen command\0A\00"
define i8** @getExternalPaths() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %115
8: ; preds = %0
%9 = call i32 @memset(i8* %3, i8 signext 0, i32 256)
br label %10
10: ; preds = %35, %8
%11 = phi i64 [ 0, %8 ], [ %36, %35 ]
%12 = getelementptr inbounds i8, i8* %1, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 58
br i1 %14, label %15, label %20
15: ; preds = %30, %25, %20, %10
%16 = phi i64 [ %11, %10 ], [ %21, %20 ], [ %26, %25 ], [ %31, %30 ]
%17 = trunc i64 %16 to i32
%18 = add nuw nsw i32 %17, 1
%19 = call i32 @memcpy(i8* %3, i8* %1, i32 %18)
br label %38
20: ; preds = %10
%21 = or i64 %11, 1
%22 = getelementptr inbounds i8, i8* %1, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 58
br i1 %24, label %15, label %25
25: ; preds = %20
%26 = or i64 %11, 2
%27 = getelementptr inbounds i8, i8* %1, i64 %26
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 58
br i1 %29, label %15, label %30
30: ; preds = %25
%31 = or i64 %11, 3
%32 = getelementptr inbounds i8, i8* %1, i64 %31
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 58
br i1 %34, label %15, label %35
35: ; preds = %30
%36 = add nuw nsw i64 %11, 4
%37 = icmp eq i64 %36, 256
br i1 %37, label %38, label %10
38: ; preds = %35, %15
%39 = call i32* @popen(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
br label %115
44: ; preds = %38
%45 = call i64 @malloc(i32 1)
%46 = inttoptr i64 %45 to i8**
%47 = call i64 @malloc(i32 256)
%48 = inttoptr i64 %47 to i8*
store i8* %48, i8** %46
%49 = call i32* @fgets(i8* %48, i32 256, i32* %39)
%50 = load i8*, i8** %46
%51 = call i32* @fgets(i8* %50, i32 256, i32* %39)
%52 = icmp eq i32* %51, null
br i1 %52, label %111, label %53
53: ; preds = %44, %103
%54 = phi i8** [ %108, %103 ], [ %46, %44 ]
%55 = phi i32 [ %105, %103 ], [ 0, %44 ]
%56 = phi i8** [ %107, %103 ], [ %46, %44 ]
%57 = load i8*, i8** %54
br label %58
58: ; preds = %83, %53
%59 = phi i64 [ 0, %53 ], [ %84, %83 ]
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = load i8, i8* %60
%62 = icmp slt i8 %61, 33
br i1 %62, label %63, label %68
63: ; preds = %78, %73, %68, %58
%64 = phi i64 [ %59, %58 ], [ %69, %68 ], [ %74, %73 ], [ %79, %78 ]
%65 = and i64 %64, 4294967295
%66 = getelementptr inbounds i8, i8* %57, i64 %65
store i8 0, i8* %66
%67 = load i8*, i8** %54
br label %86
68: ; preds = %58
%69 = or i64 %59, 1
%70 = getelementptr inbounds i8, i8* %57, i64 %69
%71 = load i8, i8* %70
%72 = icmp slt i8 %71, 33
br i1 %72, label %63, label %73
73: ; preds = %68
%74 = or i64 %59, 2
%75 = getelementptr inbounds i8, i8* %57, i64 %74
%76 = load i8, i8* %75
%77 = icmp slt i8 %76, 33
br i1 %77, label %63, label %78
78: ; preds = %73
%79 = or i64 %59, 3
%80 = getelementptr inbounds i8, i8* %57, i64 %79
%81 = load i8, i8* %80
%82 = icmp slt i8 %81, 33
br i1 %82, label %63, label %83
83: ; preds = %78
%84 = add nuw nsw i64 %59, 4
%85 = icmp eq i64 %84, 256
br i1 %85, label %86, label %58
86: ; preds = %83, %63
%87 = phi i8* [ %67, %63 ], [ %57, %83 ]
%88 = call i32 @strcmp(i8* dereferenceable(1) %87, i8* %3)
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %95
90: ; preds = %86
%91 = sext i32 %55 to i64
%92 = getelementptr inbounds i8*, i8** %56, i64 %91
%93 = load i8*, i8** %92
%94 = sext i32 %55 to i64
br label %103
95: ; preds = %86
%96 = add nsw i32 %55, 1
%97 = call i64 @realloc(i8** %56, i32 %96)
%98 = inttoptr i64 %97 to i8**
%99 = call i64 @malloc(i32 256)
%100 = inttoptr i64 %99 to i8*
%101 = sext i32 %96 to i64
%102 = getelementptr inbounds i8*, i8** %98, i64 %101
store i8* %100, i8** %102
br label %103
103: ; preds = %90, %95
%104 = phi i64 [ %94, %90 ], [ %101, %95 ]
%105 = phi i32 [ %55, %90 ], [ %96, %95 ]
%106 = phi i8* [ %93, %90 ], [ %100, %95 ]
%107 = phi i8** [ %56, %90 ], [ %98, %95 ]
%108 = getelementptr inbounds i8*, i8** %107, i64 %104
%109 = call i32* @fgets(i8* %106, i32 256, i32* %39)
%110 = icmp eq i32* %109, null
br i1 %110, label %111, label %53
111: ; preds = %103, %44
%112 = phi i8** [ %46, %44 ], [ %107, %103 ]
%113 = phi i8** [ %46, %44 ], [ %108, %103 ]
%114 = load i8*, i8** %113
store i8 0, i8* %114
br label %115
115: ; preds = %111, %41, %5
%116 = phi i8** [ null, %5 ], [ null, %41 ], [ %112, %111 ]
ret i8** %116
}