#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 */
char EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
char fscanf(int /*<<< orphan*/ *, char *, char *);
int getLength(char *);
scalar_t__ isalpha(char);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ realloc(char *, int);
char *readWordFromFile(FILE *in, int *checker) {
  char *tmpWord = NULL;
  int tmpWordSize = 0;
  int sizeOfWord = 0;
  int len = 0;
  char ch, tmpChar;
  while ((ch = fscanf(in, "%c", &tmpChar)) != EOF && (!isalpha(tmpChar)))
    ;
  if (ch == EOF) {
    *checker = EOF;
    return NULL;
  }
  sizeOfWord++;
  tmpWordSize = sizeOfWord;
  tmpWord = (char *)malloc(sizeof(char) * (tmpWordSize));
  if (tmpWord == NULL) {
    printf("Unable To allocate memory for inital tmpWord Array Store.");
    exit(1);
  }
  tmpWord[len++] = tmpChar;
  while ((ch = fscanf(in, "%c", &tmpChar)) != EOF) {
    if (isalpha(tmpChar)) {
      if (len >= tmpWordSize) {
        tmpWordSize = tmpWordSize * 2;
        tmpWord = (char *)realloc(tmpWord, sizeof(char) * (tmpWordSize));
        if (tmpWord == NULL) {
          printf("Unable to Allocate Addition Memory for wordArray "
                 "Reallocation.\n");
          exit(1);
        }
      }
      tmpWord[len++] = tmpChar;
    } else {
      break;
    }
  }
  if (len < tmpWordSize)
    tmpWord[len] = '\0';
  else {
    tmpWordSize = tmpWordSize * 2;
    tmpWord = (char *)realloc(tmpWord, sizeof(char) * (tmpWordSize));
    if (tmpWord == NULL) {
      printf("Unable to realloc memory to place the string terminator.\n");
      exit(1);
    }
    tmpWord[len] = '\0';
  }
  char *newWord = NULL;
  int lenOfNewWord = getLength(tmpWord);
  newWord = (char *)malloc(sizeof(char) * (lenOfNewWord + 1));
  if (newWord == NULL) {
    printf("Unable to allocate memory for the new array.\n");
    exit(1);
  }
  int i = 0;
  while (tmpWord[i] != '\0') {
    newWord[i] = tmpWord[i];
    i++;
  }
  newWord[i] = '\0';
  free(tmpWord);
  if (ch == EOF) {
    *checker = EOF;
  }
  return newWord;
}


x86 assembly (clang, -O0):
<readWordFromFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe48(%rip),%rsi
lea    -0x2e(%rbp),%rdx
call   1050 <fscanf@plt>
mov    %al,-0x2d(%rbp)
movsbl %al,%ecx
mov    0x2e1a(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x41(%rbp)
je     11f3 <readWordFromFile+0x73>
movsbl -0x2e(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    1203 <readWordFromFile+0x83>
jmp    1208 <readWordFromFile+0x88>
jmp    11ad <readWordFromFile+0x2d>
movsbl -0x2d(%rbp),%eax
mov    0x2dd5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    123b <readWordFromFile+0xbb>
mov    0x2dc3(%rip),%rax
movsbl (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    1487 <readWordFromFile+0x307>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    127e <readWordFromFile+0xfe>
lea    0xd94(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x2e(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
lea    0xd5f(%rip),%rsi
lea    -0x2e(%rbp),%rdx
call   1050 <fscanf@plt>
mov    %al,-0x2d(%rbp)
movsbl %al,%eax
mov    0x2d31(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     134e <readWordFromFile+0x1ce>
movsbl -0x2e(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%rax
je     1344 <readWordFromFile+0x1c4>
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jl     1327 <readWordFromFile+0x1a7>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   1070 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1322 <readWordFromFile+0x1a2>
lea    0xd2a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
jmp    1327 <readWordFromFile+0x1a7>
mov    -0x2e(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1349 <readWordFromFile+0x1c9>
jmp    134e <readWordFromFile+0x1ce>
jmp    1296 <readWordFromFile+0x116>
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    136b <readWordFromFile+0x1eb>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    13b8 <readWordFromFile+0x238>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   1070 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13ac <readWordFromFile+0x22c>
lea    0xce0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movq   $0x0,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <getLength@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1404 <readWordFromFile+0x284>
lea    0xcc2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
movl   $0x0,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1444 <readWordFromFile+0x2c4>
mov    -0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x38(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    140b <readWordFromFile+0x28b>
mov    -0x38(%rbp),%rax
movslq -0x40(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x2d(%rbp),%eax
mov    0x2b84(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    147f <readWordFromFile+0x2ff>
mov    0x2b72(%rip),%rax
movsbl (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readWordFromFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
mov    %rdi,%r12
lea    0xe55(%rip),%r15
lea    0xf(%rsp),%rbp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
mov    %eax,%ebx
mov    0x2e11(%rip),%rax
cmp    (%rax),%bl
je     1380 <readWordFromFile+0x1f0>
movsbl 0xf(%rsp),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
je     11c0 <readWordFromFile+0x30>
mov    0x2df3(%rip),%rax
cmp    (%rax),%bl
jne    1201 <readWordFromFile+0x71>
xor    %r14d,%r14d
jmp    1380 <readWordFromFile+0x1f0>
mov    $0x1,%r14d
mov    $0x1,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     13a2 <readWordFromFile+0x212>
mov    %rax,%r15
mov    0xf(%rsp),%al
mov    %al,(%r15)
lea    0xdd5(%rip),%rsi
lea    0xf(%rsp),%rdx
mov    %r12,%rdi
call   1060 <fscanf@plt>
mov    %eax,%ebx
mov    0x2da7(%rip),%rax
cmp    (%rax),%bl
jne    124f <readWordFromFile+0xbf>
mov    $0x1,%ebp
jmp    1301 <readWordFromFile+0x171>
movsbl 0xf(%rsp),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
je     12f1 <readWordFromFile+0x161>
mov    %r13,0x10(%rsp)
mov    $0x1,%r13d
mov    $0x1,%ebp
mov    $0x2,%r14d
nopl   0x0(%rax,%rax,1)
movslq %ebp,%rax
cmp    %rax,%r13
jl     12a0 <readWordFromFile+0x110>
add    %ebp,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
call   1080 <realloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1399 <readWordFromFile+0x209>
movzbl 0xf(%rsp),%eax
mov    %al,(%r15,%r13,1)
mov    %r12,%rdi
lea    0xd4d(%rip),%rsi
lea    0xf(%rsp),%rdx
call   1060 <fscanf@plt>
mov    %eax,%ebx
mov    0x2d22(%rip),%rax
cmp    (%rax),%bl
je     12e5 <readWordFromFile+0x155>
movsbl 0xf(%rsp),%edi
call   1090 <isalpha@plt>
add    $0x1,%r14d
add    $0x1,%r13
test   %rax,%rax
jne    1280 <readWordFromFile+0xf0>
add    $0xffffffff,%r14d
mov    0x10(%rsp),%r13
cmp    %ebp,%r14d
jge    1301 <readWordFromFile+0x171>
jmp    1319 <readWordFromFile+0x189>
mov    $0x1,%ebp
mov    $0x1,%r14d
cmp    %ebp,%r14d
jl     1319 <readWordFromFile+0x189>
add    %ebp,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
call   1080 <realloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     13c1 <readWordFromFile+0x231>
mov    %r14d,%eax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rdi
call   10a0 <getLength@plt>
lea    0x1(%rax),%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     13b8 <readWordFromFile+0x228>
mov    %rax,%r14
mov    (%r15),%al
test   %al,%al
je     1366 <readWordFromFile+0x1d6>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%r14,%rcx,1)
movzbl 0x1(%r15,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1350 <readWordFromFile+0x1c0>
mov    %ecx,%eax
jmp    1368 <readWordFromFile+0x1d8>
xor    %eax,%eax
movb   $0x0,(%r14,%rax,1)
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x2c6c(%rip),%rax
cmp    (%rax),%bl
jne    1387 <readWordFromFile+0x1f7>
movsbl %bl,%eax
mov    %eax,0x0(%r13)
mov    %r14,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd03(%rip),%rdi
jmp    13c8 <readWordFromFile+0x238>
lea    0xc5a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xc7e(%rip),%rdi
jmp    13c8 <readWordFromFile+0x238>
lea    0xca2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i8 0
@.str.1 = [58 x i8] c"Unable To allocate memory for inital tmpWord Array Store.\00"
@.str.2 = [64 x i8] c"Unable to Allocate Addition Memory for wordArray Reallocation.\0A\00"
@.str.3 = [58 x i8] c"Unable to realloc memory to place the string terminator.\0A\00"
@.str.4 = [46 x i8] c"Unable to allocate memory for the new array.\0A\00"
define i8* @readWordFromFile(i32* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* null, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %15
15: ; preds = %29, %2
%16 = load i32*, i32** %4
%17 = call signext i8 @fscanf(i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
store i8 %17, i8* %10
%18 = sext i8 %17 to i32
%19 = load i8, i8* @EOF
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %18, %20
br i1 %21, label %22, label %27
22: ; preds = %15
%23 = load i8, i8* %11
%24 = call i64 @isalpha(i8 signext %23)
%25 = icmp ne i64 %24, 0
%26 = xor i1 %25, true
br label %27
27: ; preds = %22, %15
%28 = phi i1 [ false, %15 ], [ %26, %22 ]
br i1 %28, label %29, label %30
29: ; preds = %27
br label %15
30: ; preds = %27
%31 = load i8, i8* %10
%32 = sext i8 %31 to i32
%33 = load i8, i8* @EOF
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %32, %34
br i1 %35, label %36, label %40
36: ; preds = %30
%37 = load i8, i8* @EOF
%38 = sext i8 %37 to i32
%39 = load i32*, i32** %5
store i32 %38, i32* %39
store i8* null, i8** %3
br label %185
40: ; preds = %30
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
%43 = load i32, i32* %8
store i32 %43, i32* %7
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = mul i64 1, %45
%47 = trunc i64 %46 to i32
%48 = call i64 @malloc(i32 %47)
%49 = inttoptr i64 %48 to i8*
store i8* %49, i8** %6
%50 = load i8*, i8** %6
%51 = icmp eq i8* %50, null
br i1 %51, label %52, label %55
52: ; preds = %40
%53 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %40
%56 = load i8, i8* %11
%57 = load i8*, i8** %6
%58 = load i32, i32* %9
%59 = add nsw i32 %58, 1
store i32 %59, i32* %9
%60 = sext i32 %58 to i64
%61 = getelementptr inbounds i8, i8* %57, i64 %60
store i8 %56, i8* %61
br label %62
62: ; preds = %101, %55
%63 = load i32*, i32** %4
%64 = call signext i8 @fscanf(i32* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
store i8 %64, i8* %10
%65 = sext i8 %64 to i32
%66 = load i8, i8* @EOF
%67 = sext i8 %66 to i32
%68 = icmp ne i32 %65, %67
br i1 %68, label %69, label %102
69: ; preds = %62
%70 = load i8, i8* %11
%71 = call i64 @isalpha(i8 signext %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %100
73: ; preds = %69
%74 = load i32, i32* %9
%75 = load i32, i32* %7
%76 = icmp sge i32 %74, %75
br i1 %76, label %77, label %93
77: ; preds = %73
%78 = load i32, i32* %7
%79 = mul nsw i32 %78, 2
store i32 %79, i32* %7
%80 = load i8*, i8** %6
%81 = load i32, i32* %7
%82 = sext i32 %81 to i64
%83 = mul i64 1, %82
%84 = trunc i64 %83 to i32
%85 = call i64 @realloc(i8* %80, i32 %84)
%86 = inttoptr i64 %85 to i8*
store i8* %86, i8** %6
%87 = load i8*, i8** %6
%88 = icmp eq i8* %87, null
br i1 %88, label %89, label %92
89: ; preds = %77
%90 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %77
br label %93
93: ; preds = %92, %73
%94 = load i8, i8* %11
%95 = load i8*, i8** %6
%96 = load i32, i32* %9
%97 = add nsw i32 %96, 1
store i32 %97, i32* %9
%98 = sext i32 %96 to i64
%99 = getelementptr inbounds i8, i8* %95, i64 %98
store i8 %94, i8* %99
br label %101
100: ; preds = %69
br label %102
101: ; preds = %93
br label %62
102: ; preds = %100, %62
%103 = load i32, i32* %9
%104 = load i32, i32* %7
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %111
106: ; preds = %102
%107 = load i8*, i8** %6
%108 = load i32, i32* %9
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
store i8 0, i8* %110
br label %131
111: ; preds = %102
%112 = load i32, i32* %7
%113 = mul nsw i32 %112, 2
store i32 %113, i32* %7
%114 = load i8*, i8** %6
%115 = load i32, i32* %7
%116 = sext i32 %115 to i64
%117 = mul i64 1, %116
%118 = trunc i64 %117 to i32
%119 = call i64 @realloc(i8* %114, i32 %118)
%120 = inttoptr i64 %119 to i8*
store i8* %120, i8** %6
%121 = load i8*, i8** %6
%122 = icmp eq i8* %121, null
br i1 %122, label %123, label %126
123: ; preds = %111
%124 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%125 = call i32 @exit(i32 1)
unreachable
126: ; preds = %111
%127 = load i8*, i8** %6
%128 = load i32, i32* %9
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8, i8* %127, i64 %129
store i8 0, i8* %130
br label %131
131: ; preds = %126, %106
store i8* null, i8** %12
%132 = load i8*, i8** %6
%133 = call i32 @getLength(i8* %132)
store i32 %133, i32* %13
%134 = load i32, i32* %13
%135 = add nsw i32 %134, 1
%136 = sext i32 %135 to i64
%137 = mul i64 1, %136
%138 = trunc i64 %137 to i32
%139 = call i64 @malloc(i32 %138)
%140 = inttoptr i64 %139 to i8*
store i8* %140, i8** %12
%141 = load i8*, i8** %12
%142 = icmp eq i8* %141, null
br i1 %142, label %143, label %146
143: ; preds = %131
%144 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%145 = call i32 @exit(i32 1)
unreachable
146: ; preds = %131
store i32 0, i32* %14
br label %147
147: ; preds = %155, %146
%148 = load i8*, i8** %6
%149 = load i32, i32* %14
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8, i8* %148, i64 %150
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = icmp ne i32 %153, 0
br i1 %154, label %155, label %167
155: ; preds = %147
%156 = load i8*, i8** %6
%157 = load i32, i32* %14
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %156, i64 %158
%160 = load i8, i8* %159
%161 = load i8*, i8** %12
%162 = load i32, i32* %14
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %161, i64 %163
store i8 %160, i8* %164
%165 = load i32, i32* %14
%166 = add nsw i32 %165, 1
store i32 %166, i32* %14
br label %147
167: ; preds = %147
%168 = load i8*, i8** %12
%169 = load i32, i32* %14
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i8, i8* %168, i64 %170
store i8 0, i8* %171
%172 = load i8*, i8** %6
%173 = call i32 @free(i8* %172)
%174 = load i8, i8* %10
%175 = sext i8 %174 to i32
%176 = load i8, i8* @EOF
%177 = sext i8 %176 to i32
%178 = icmp eq i32 %175, %177
br i1 %178, label %179, label %183
179: ; preds = %167
%180 = load i8, i8* @EOF
%181 = sext i8 %180 to i32
%182 = load i32*, i32** %5
store i32 %181, i32* %182
br label %183
183: ; preds = %179, %167
%184 = load i8*, i8** %12
store i8* %184, i8** %3
br label %185
185: ; preds = %183, %36
%186 = load i8*, i8** %3
ret i8* %186
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i8 0
@.str.1 = [58 x i8] c"Unable To allocate memory for inital tmpWord Array Store.\00"
@str = [45 x i8] c"Unable to allocate memory for the new array.\00"
@str.5 = [57 x i8] c"Unable to realloc memory to place the string terminator.\00"
@str.6 = [63 x i8] c"Unable to Allocate Addition Memory for wordArray Reallocation.\00"
define i8* @readWordFromFile(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i8
br label %4
4: ; preds = %8, %2
%5 = call signext i8 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i8, i8* @EOF
%7 = icmp eq i8 %5, %6
br i1 %7, label %113, label %8
8: ; preds = %4
%9 = load i8, i8* %3
%10 = call i64 @isalpha(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %8
%13 = load i8, i8* @EOF
%14 = icmp eq i8 %5, %13
br i1 %14, label %113, label %15
15: ; preds = %12
%16 = call i64 @malloc(i32 1)
%17 = inttoptr i64 %16 to i8*
%18 = icmp eq i64 %16, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %15
%23 = load i8, i8* %3
store i8 %23, i8* %17
%24 = call signext i8 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%25 = load i8, i8* @EOF
%26 = icmp eq i8 %24, %25
br i1 %26, label %68, label %27
27: ; preds = %22
%28 = load i8, i8* %3
%29 = call i64 @isalpha(i8 signext %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %62, label %35
31: ; preds = %50
%32 = load i8, i8* %3
%33 = call i64 @isalpha(i8 signext %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %60, label %35
35: ; preds = %27, %31
%36 = phi i8* [ %51, %31 ], [ %17, %27 ]
%37 = phi i32 [ %52, %31 ], [ 1, %27 ]
%38 = phi i32 [ %55, %31 ], [ 1, %27 ]
%39 = phi i64 [ %54, %31 ], [ 1, %27 ]
%40 = sext i32 %37 to i64
%41 = icmp slt i64 %39, %40
br i1 %41, label %50, label %42
42: ; preds = %35
%43 = shl nsw i32 %37, 1
%44 = call i64 @realloc(i8* %36, i32 %43)
%45 = inttoptr i64 %44 to i8*
%46 = icmp eq i64 %44, 0
br i1 %46, label %47, label %50
47: ; preds = %42
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.6, i64 0, i64 0))
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %42, %35
%51 = phi i8* [ %45, %42 ], [ %36, %35 ]
%52 = phi i32 [ %43, %42 ], [ %37, %35 ]
%53 = load i8, i8* %3
%54 = add nuw i64 %39, 1
%55 = add nuw nsw i32 %38, 1
%56 = getelementptr inbounds i8, i8* %51, i64 %39
store i8 %53, i8* %56
%57 = call signext i8 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%58 = load i8, i8* @EOF
%59 = icmp eq i8 %57, %58
br i1 %59, label %62, label %31
60: ; preds = %31
%61 = trunc i64 %54 to i32
br label %62
62: ; preds = %50, %27, %60
%63 = phi i8* [ %51, %60 ], [ %17, %27 ], [ %51, %50 ]
%64 = phi i32 [ %52, %60 ], [ 1, %27 ], [ %52, %50 ]
%65 = phi i32 [ %61, %60 ], [ 1, %27 ], [ %55, %50 ]
%66 = phi i8 [ %57, %60 ], [ %24, %27 ], [ %57, %50 ]
%67 = icmp slt i32 %65, %64
br i1 %67, label %80, label %68
68: ; preds = %22, %62
%69 = phi i8 [ %66, %62 ], [ %24, %22 ]
%70 = phi i32 [ %65, %62 ], [ 1, %22 ]
%71 = phi i32 [ %64, %62 ], [ 1, %22 ]
%72 = phi i8* [ %63, %62 ], [ %17, %22 ]
%73 = shl nsw i32 %71, 1
%74 = call i64 @realloc(i8* %72, i32 %73)
%75 = inttoptr i64 %74 to i8*
%76 = icmp eq i64 %74, 0
br i1 %76, label %77, label %80
77: ; preds = %68
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.5, i64 0, i64 0))
%79 = call i32 @exit(i32 1)
unreachable
80: ; preds = %68, %62
%81 = phi i32 [ %65, %62 ], [ %70, %68 ]
%82 = phi i8* [ %63, %62 ], [ %75, %68 ]
%83 = phi i8 [ %66, %62 ], [ %69, %68 ]
%84 = zext i32 %81 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
store i8 0, i8* %85
%86 = call i32 @getLength(i8* %82)
%87 = add nsw i32 %86, 1
%88 = call i64 @malloc(i32 %87)
%89 = inttoptr i64 %88 to i8*
%90 = icmp eq i64 %88, 0
br i1 %90, label %94, label %91
91: ; preds = %80
%92 = load i8, i8* %82
%93 = icmp eq i8 %92, 0
br i1 %93, label %107, label %97
94: ; preds = %80
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%96 = call i32 @exit(i32 1)
unreachable
97: ; preds = %91, %97
%98 = phi i64 [ %101, %97 ], [ 0, %91 ]
%99 = phi i8 [ %103, %97 ], [ %92, %91 ]
%100 = getelementptr inbounds i8, i8* %89, i64 %98
store i8 %99, i8* %100
%101 = add nuw nsw i64 %98, 1
%102 = getelementptr inbounds i8, i8* %82, i64 %101
%103 = load i8, i8* %102
%104 = icmp eq i8 %103, 0
br i1 %104, label %105, label %97
105: ; preds = %97
%106 = and i64 %101, 4294967295
br label %107
107: ; preds = %105, %91
%108 = phi i64 [ 0, %91 ], [ %106, %105 ]
%109 = getelementptr inbounds i8, i8* %89, i64 %108
store i8 0, i8* %109
%110 = call i32 @free(i8* %82)
%111 = load i8, i8* @EOF
%112 = icmp eq i8 %83, %111
br i1 %112, label %113, label %117
113: ; preds = %4, %107, %12
%114 = phi i8 [ %5, %12 ], [ %83, %107 ], [ %5, %4 ]
%115 = phi i8* [ null, %12 ], [ %89, %107 ], [ null, %4 ]
%116 = sext i8 %114 to i32
store i32 %116, i32* %1
br label %117
117: ; preds = %113, %107
%118 = phi i8* [ %89, %107 ], [ %115, %113 ]
ret i8* %118
}