#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*/ doubleCapacity(char ***, int *, int *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int hash_function(char *);
scalar_t__ insertWord(char **, int *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ search(char **, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int loadDictionary(char *inFileName, char ****array, int *count,
                   int *capacity) {
  FILE *inFile;
  int i;
  char word[50];
  if ((inFile = fopen(inFileName, "r")) == NULL) {
    fprintf(stderr, "Error opening input file, %s\n", inFileName);
    return -1;
  }
  *array = (char ***)malloc(8 * sizeof(char **));
  if (*array == NULL) {
    fprintf(stderr, "Malloc of array in loadArray failed!\n");
    return -1;
  }
  for (i = 0; i < 8; i++) {
    (*array)[i] = (char **)malloc(capacity[i] * sizeof(char *));
    if ((*array)[i] == NULL) {
      fprintf(stderr, "Malloc of array in loadArray failed!\n");
      return -1;
    }
  }
  printf("Reading file %s (each . is 5000 words read)\n", inFileName);
  for (i = 0; i < 8; i++) {
    count[i] = 0;
  }
  while (fscanf(inFile, "%s", word) == 1) {
    int index = hash_function(word);
    if (index != -1) {
      if (count[index] >= capacity[index]) {
        doubleCapacity(&(*array)[index], &count[index], &capacity[index]);
      }
      if (search((*array)[index], word, count[index]) == 0) {
        if (insertWord((*array)[index], &count[index], word) == 0) {
          fprintf(stderr, "    Insert returned an error!\n");
          fclose(inFile);
          return 1;
        }
      }
    }
    if ((count[0] + count[1] + count[2] + count[3] + count[4] + count[5] +
         count[6] + count[7]) %
            5000 ==
        0) {
      printf(".");
      fflush(stdout);
    }
  }
  fclose(inFile);
  return 0;
}


x86 assembly (clang, -O0):
<loadDictionary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1210 <loadDictionary+0x60>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe05(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b1 <loadDictionary+0x301>
mov    $0x40,%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1255 <loadDictionary+0xa5>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b1 <loadDictionary+0x301>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    12db <loadDictionary+0x12b>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x34(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    12c8 <loadDictionary+0x118>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
lea    0xd6b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b1 <loadDictionary+0x301>
jmp    12cd <loadDictionary+0x11d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    125c <loadDictionary+0xac>
mov    -0x10(%rbp),%rsi
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x8,-0x34(%rbp)
jge    131b <loadDictionary+0x16b>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12f4 <loadDictionary+0x144>
jmp    1320 <loadDictionary+0x170>
mov    -0x30(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd44(%rip),%rsi
call   1060 <fscanf@plt>
cmp    $0x1,%eax
jne    14a1 <loadDictionary+0x2f1>
lea    -0x70(%rbp),%rdi
call   10d0 <hash_function@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0xffffffff,-0x74(%rbp)
je     1438 <loadDictionary+0x288>
mov    -0x20(%rbp),%rax
movslq -0x74(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x74(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jl     13a4 <loadDictionary+0x1f4>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
movslq -0x74(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
movslq -0x74(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
movslq -0x74(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
call   10a0 <doubleCapacity@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x74(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x20(%rbp),%rax
movslq -0x74(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
call   1050 <search@plt>
cmp    $0x0,%rax
jne    1433 <loadDictionary+0x283>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x74(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
movslq -0x74(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    -0x70(%rbp),%rdx
call   10c0 <insertWord@plt>
cmp    $0x0,%rax
jne    142e <loadDictionary+0x27e>
mov    0x2bd7(%rip),%rax
mov    (%rax),%edi
lea    0xc64(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    14b1 <loadDictionary+0x301>
jmp    1433 <loadDictionary+0x283>
jmp    1438 <loadDictionary+0x288>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x20(%rbp),%rcx
add    0x8(%rcx),%eax
mov    -0x20(%rbp),%rcx
add    0xc(%rcx),%eax
mov    -0x20(%rbp),%rcx
add    0x10(%rcx),%eax
mov    -0x20(%rbp),%rcx
add    0x14(%rcx),%eax
mov    -0x20(%rbp),%rcx
add    0x18(%rcx),%eax
mov    -0x20(%rbp),%rcx
add    0x1c(%rcx),%eax
mov    $0x1388,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    149c <loadDictionary+0x2ec>
lea    0xc0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2b43(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
jmp    1320 <loadDictionary+0x170>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadDictionary>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%r12
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0xe1f(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1380 <loadDictionary+0x1c0>
mov    %rax,%r14
mov    $0x40,%edi
call   1090 <malloc@plt>
mov    %rax,0x0(%r13)
test   %rax,%rax
je     1367 <loadDictionary+0x1a7>
mov    (%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0x4(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x8(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x8(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0x8(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x10(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x10(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0xc(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x18(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x18(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0x10(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x20(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x20(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0x14(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x28(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x28(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0x18(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x30(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x30(%rax)
je     1367 <loadDictionary+0x1a7>
mov    0x1c(%r12),%edi
shl    $0x3,%edi
call   1090 <malloc@plt>
mov    0x0(%r13),%rcx
mov    %rax,0x38(%rcx)
mov    0x0(%r13),%rax
cmpq   $0x0,0x38(%rax)
je     1367 <loadDictionary+0x1a7>
lea    0xd21(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
pxor   %xmm0,%xmm0
movdqu %xmm0,(%r15)
movdqu %xmm0,0x10(%r15)
lea    0xd2c(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
call   1070 <fscanf@plt>
cmp    $0x1,%eax
jne    14d8 <loadDictionary+0x318>
lea    0x10(%rsp),%rbx
jmp    1425 <loadDictionary+0x265>
mov    0x2c72(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    139a <loadDictionary+0x1da>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
lea    0xc72(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%r13),%rax
mov    (%rax,%rbx,8),%rdi
lea    0x10(%rsp),%rsi
call   1060 <search@plt>
test   %rax,%rax
je     148f <loadDictionary+0x2cf>
movdqu (%r15),%xmm0
movdqu 0x10(%r15),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
imul   $0x3afb7e91,%eax,%eax
add    $0x346dc0,%eax
ror    $0x3,%eax
cmp    $0xd1b70,%eax
jbe    1472 <loadDictionary+0x2b2>
mov    %r14,%rdi
lea    0xc64(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdx
call   1070 <fscanf@plt>
cmp    $0x1,%eax
jne    14d8 <loadDictionary+0x318>
mov    %rbx,%rdi
call   10e0 <hash_function@plt>
cmp    $0xffffffff,%eax
je     13cb <loadDictionary+0x20b>
movslq %eax,%rbx
lea    (%r15,%rbx,4),%rax
mov    %rax,0x8(%rsp)
mov    (%r15,%rbx,4),%edx
cmp    (%r12,%rbx,4),%edx
jl     13b0 <loadDictionary+0x1f0>
lea    (%r12,%rbx,4),%rdx
lea    0x0(,%rbx,8),%rdi
add    0x0(%r13),%rdi
mov    0x8(%rsp),%rsi
call   10b0 <doubleCapacity@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%edx
jmp    13b0 <loadDictionary+0x1f0>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2b55(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
jmp    1405 <loadDictionary+0x245>
mov    0x0(%r13),%rax
mov    (%rax,%rbx,8),%rdi
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   10d0 <insertWord@plt>
test   %rax,%rax
jne    13cb <loadDictionary+0x20b>
mov    0x2b2a(%rip),%rax
mov    (%rax),%edi
lea    0xbb7(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    $0x1,%ebp
jmp    139f <loadDictionary+0x1df>
mov    %r14,%rdi
call   1040 <fclose@plt>
jmp    139f <loadDictionary+0x1df>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Error opening input file, %s\0A\00"
@.str.2 = [38 x i8] c"Malloc of array in loadArray failed!\0A\00"
@.str.3 = [45 x i8] c"Reading file %s (each . is 5000 words read)\0A\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [31 x i8] c" Insert returned an error!\0A\00"
@.str.6 = [2 x i8] c".\00"
@stdout = global i32 0
define i32 @loadDictionary(i8* %0, i8**** %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8****
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca [50 x i8]
%13 = alloca i32
store i8* %0, i8** %6
store i8**** %1, i8***** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%14 = load i8*, i8** %6
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %10
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %6
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %19)
store i32 -1, i32* %5
br label %195
21: ; preds = %4
%22 = call i64 @malloc(i32 64)
%23 = inttoptr i64 %22 to i8***
%24 = load i8****, i8***** %7
store i8*** %23, i8**** %24
%25 = load i8****, i8***** %7
%26 = load i8***, i8**** %25
%27 = icmp eq i8*** %26, null
br i1 %27, label %28, label %31
28: ; preds = %21
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %5
br label %195
31: ; preds = %21
store i32 0, i32* %11
br label %32
32: ; preds = %62, %31
%33 = load i32, i32* %11
%34 = icmp slt i32 %33, 8
br i1 %34, label %35, label %65
35: ; preds = %32
%36 = load i32*, i32** %9
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %39
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 8
%43 = trunc i64 %42 to i32
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to i8**
%46 = load i8****, i8***** %7
%47 = load i8***, i8**** %46
%48 = load i32, i32* %11
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8**, i8*** %47, i64 %49
store i8** %45, i8*** %50
%51 = load i8****, i8***** %7
%52 = load i8***, i8**** %51
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8**, i8*** %52, i64 %54
%56 = load i8**, i8*** %55
%57 = icmp eq i8** %56, null
br i1 %57, label %58, label %61
58: ; preds = %35
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %5
br label %195
61: ; preds = %35
br label %62
62: ; preds = %61
%63 = load i32, i32* %11
%64 = add nsw i32 %63, 1
store i32 %64, i32* %11
br label %32
65: ; preds = %32
%66 = load i8*, i8** %6
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %66)
store i32 0, i32* %11
br label %68
68: ; preds = %76, %65
%69 = load i32, i32* %11
%70 = icmp slt i32 %69, 8
br i1 %70, label %71, label %79
71: ; preds = %68
%72 = load i32*, i32** %8
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %72, i64 %74
store i32 0, i32* %75
br label %76
76: ; preds = %71
%77 = load i32, i32* %11
%78 = add nsw i32 %77, 1
store i32 %78, i32* %11
br label %68
79: ; preds = %68
br label %80
80: ; preds = %191, %79
%81 = load i32*, i32** %10
%82 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%83 = call i32 @fscanf(i32* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %82)
%84 = icmp eq i32 %83, 1
br i1 %84, label %85, label %192
85: ; preds = %80
%86 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%87 = call i32 @hash_function(i8* %86)
store i32 %87, i32* %13
%88 = load i32, i32* %13
%89 = icmp ne i32 %88, -1
br i1 %89, label %90, label %153
90: ; preds = %85
%91 = load i32*, i32** %8
%92 = load i32, i32* %13
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %91, i64 %93
%95 = load i32, i32* %94
%96 = load i32*, i32** %9
%97 = load i32, i32* %13
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %96, i64 %98
%100 = load i32, i32* %99
%101 = icmp sge i32 %95, %100
br i1 %101, label %102, label %117
102: ; preds = %90
%103 = load i8****, i8***** %7
%104 = load i8***, i8**** %103
%105 = load i32, i32* %13
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8**, i8*** %104, i64 %106
%108 = load i32*, i32** %8
%109 = load i32, i32* %13
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %108, i64 %110
%112 = load i32*, i32** %9
%113 = load i32, i32* %13
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i32, i32* %112, i64 %114
%116 = call i32 @doubleCapacity(i8*** %107, i32* %111, i32* %115)
br label %117
117: ; preds = %102, %90
%118 = load i8****, i8***** %7
%119 = load i8***, i8**** %118
%120 = load i32, i32* %13
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8**, i8*** %119, i64 %121
%123 = load i8**, i8*** %122
%124 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%125 = load i32*, i32** %8
%126 = load i32, i32* %13
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32, i32* %125, i64 %127
%129 = load i32, i32* %128
%130 = call i64 @search(i8** %123, i8* %124, i32 %129)
%131 = icmp eq i64 %130, 0
br i1 %131, label %132, label %152
132: ; preds = %117
%133 = load i8****, i8***** %7
%134 = load i8***, i8**** %133
%135 = load i32, i32* %13
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8**, i8*** %134, i64 %136
%138 = load i8**, i8*** %137
%139 = load i32*, i32** %8
%140 = load i32, i32* %13
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32, i32* %139, i64 %141
%143 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%144 = call i64 @insertWord(i8** %138, i32* %142, i8* %143)
%145 = icmp eq i64 %144, 0
br i1 %145, label %146, label %151
146: ; preds = %132
%147 = load i32, i32* @stderr
%148 = call i32 (i32, i8*, ...) @fprintf(i32 %147, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%149 = load i32*, i32** %10
%150 = call i32 @fclose(i32* %149)
store i32 1, i32* %5
br label %195
151: ; preds = %132
br label %152
152: ; preds = %151, %117
br label %153
153: ; preds = %152, %85
%154 = load i32*, i32** %8
%155 = getelementptr inbounds i32, i32* %154, i64 0
%156 = load i32, i32* %155
%157 = load i32*, i32** %8
%158 = getelementptr inbounds i32, i32* %157, i64 1
%159 = load i32, i32* %158
%160 = add nsw i32 %156, %159
%161 = load i32*, i32** %8
%162 = getelementptr inbounds i32, i32* %161, i64 2
%163 = load i32, i32* %162
%164 = add nsw i32 %160, %163
%165 = load i32*, i32** %8
%166 = getelementptr inbounds i32, i32* %165, i64 3
%167 = load i32, i32* %166
%168 = add nsw i32 %164, %167
%169 = load i32*, i32** %8
%170 = getelementptr inbounds i32, i32* %169, i64 4
%171 = load i32, i32* %170
%172 = add nsw i32 %168, %171
%173 = load i32*, i32** %8
%174 = getelementptr inbounds i32, i32* %173, i64 5
%175 = load i32, i32* %174
%176 = add nsw i32 %172, %175
%177 = load i32*, i32** %8
%178 = getelementptr inbounds i32, i32* %177, i64 6
%179 = load i32, i32* %178
%180 = add nsw i32 %176, %179
%181 = load i32*, i32** %8
%182 = getelementptr inbounds i32, i32* %181, i64 7
%183 = load i32, i32* %182
%184 = add nsw i32 %180, %183
%185 = srem i32 %184, 5000
%186 = icmp eq i32 %185, 0
br i1 %186, label %187, label %191
187: ; preds = %153
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%189 = load i32, i32* @stdout
%190 = call i32 @fflush(i32 %189)
br label %191
191: ; preds = %187, %153
br label %80
192: ; preds = %80
%193 = load i32*, i32** %10
%194 = call i32 @fclose(i32* %193)
store i32 0, i32* %5
br label %195
195: ; preds = %192, %146, %58, %28, %17
%196 = load i32, i32* %5
ret i32 %196
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [30 x i8] c"Error opening input file, %s\0A\00"
@.str.2 = [38 x i8] c"Malloc of array in loadArray failed!\0A\00"
@.str.3 = [45 x i8] c"Reading file %s (each . is 5000 words read)\0A\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [31 x i8] c" Insert returned an error!\0A\00"
@stdout = global i32 0
define i32 @loadDictionary(i8* %0, i8**** nocapture %1, i32* %2, i32* %3) {
%5 = bitcast i32* %2 to i8*
%6 = alloca [50 x i8]
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%8 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %168
13: ; preds = %4
%14 = tail call i64 @malloc(i32 64)
%15 = inttoptr i64 %14 to i8***
store i8*** %15, i8**** %1
%16 = icmp eq i64 %14, 0
br i1 %16, label %26, label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = shl i32 %18, 3
%20 = tail call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i8**
%22 = load i8***, i8**** %1
store i8** %21, i8*** %22
%23 = load i8***, i8**** %1
%24 = load i8**, i8*** %23
%25 = icmp eq i8** %24, null
br i1 %25, label %117, label %29
26: ; preds = %13
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
br label %168
29: ; preds = %17
%30 = getelementptr inbounds i32, i32* %3, i64 1
%31 = load i32, i32* %30
%32 = shl i32 %31, 3
%33 = tail call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to i8**
%35 = load i8***, i8**** %1
%36 = getelementptr inbounds i8**, i8*** %35, i64 1
store i8** %34, i8*** %36
%37 = load i8***, i8**** %1
%38 = getelementptr inbounds i8**, i8*** %37, i64 1
%39 = load i8**, i8*** %38
%40 = icmp eq i8** %39, null
br i1 %40, label %117, label %41
41: ; preds = %29
%42 = getelementptr inbounds i32, i32* %3, i64 2
%43 = load i32, i32* %42
%44 = shl i32 %43, 3
%45 = tail call i64 @malloc(i32 %44)
%46 = inttoptr i64 %45 to i8**
%47 = load i8***, i8**** %1
%48 = getelementptr inbounds i8**, i8*** %47, i64 2
store i8** %46, i8*** %48
%49 = load i8***, i8**** %1
%50 = getelementptr inbounds i8**, i8*** %49, i64 2
%51 = load i8**, i8*** %50
%52 = icmp eq i8** %51, null
br i1 %52, label %117, label %53
53: ; preds = %41
%54 = getelementptr inbounds i32, i32* %3, i64 3
%55 = load i32, i32* %54
%56 = shl i32 %55, 3
%57 = tail call i64 @malloc(i32 %56)
%58 = inttoptr i64 %57 to i8**
%59 = load i8***, i8**** %1
%60 = getelementptr inbounds i8**, i8*** %59, i64 3
store i8** %58, i8*** %60
%61 = load i8***, i8**** %1
%62 = getelementptr inbounds i8**, i8*** %61, i64 3
%63 = load i8**, i8*** %62
%64 = icmp eq i8** %63, null
br i1 %64, label %117, label %65
65: ; preds = %53
%66 = getelementptr inbounds i32, i32* %3, i64 4
%67 = load i32, i32* %66
%68 = shl i32 %67, 3
%69 = tail call i64 @malloc(i32 %68)
%70 = inttoptr i64 %69 to i8**
%71 = load i8***, i8**** %1
%72 = getelementptr inbounds i8**, i8*** %71, i64 4
store i8** %70, i8*** %72
%73 = load i8***, i8**** %1
%74 = getelementptr inbounds i8**, i8*** %73, i64 4
%75 = load i8**, i8*** %74
%76 = icmp eq i8** %75, null
br i1 %76, label %117, label %77
77: ; preds = %65
%78 = getelementptr inbounds i32, i32* %3, i64 5
%79 = load i32, i32* %78
%80 = shl i32 %79, 3
%81 = tail call i64 @malloc(i32 %80)
%82 = inttoptr i64 %81 to i8**
%83 = load i8***, i8**** %1
%84 = getelementptr inbounds i8**, i8*** %83, i64 5
store i8** %82, i8*** %84
%85 = load i8***, i8**** %1
%86 = getelementptr inbounds i8**, i8*** %85, i64 5
%87 = load i8**, i8*** %86
%88 = icmp eq i8** %87, null
br i1 %88, label %117, label %89
89: ; preds = %77
%90 = getelementptr inbounds i32, i32* %3, i64 6
%91 = load i32, i32* %90
%92 = shl i32 %91, 3
%93 = tail call i64 @malloc(i32 %92)
%94 = inttoptr i64 %93 to i8**
%95 = load i8***, i8**** %1
%96 = getelementptr inbounds i8**, i8*** %95, i64 6
store i8** %94, i8*** %96
%97 = load i8***, i8**** %1
%98 = getelementptr inbounds i8**, i8*** %97, i64 6
%99 = load i8**, i8*** %98
%100 = icmp eq i8** %99, null
br i1 %100, label %117, label %101
101: ; preds = %89
%102 = getelementptr inbounds i32, i32* %3, i64 7
%103 = load i32, i32* %102
%104 = shl i32 %103, 3
%105 = tail call i64 @malloc(i32 %104)
%106 = inttoptr i64 %105 to i8**
%107 = load i8***, i8**** %1
%108 = getelementptr inbounds i8**, i8*** %107, i64 7
store i8** %106, i8*** %108
%109 = load i8***, i8**** %1
%110 = getelementptr inbounds i8**, i8*** %109, i64 7
%111 = load i8**, i8*** %110
%112 = icmp eq i8** %111, null
br i1 %112, label %117, label %113
113: ; preds = %101
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%115 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%116 = icmp eq i32 %115, 1
br i1 %116, label %120, label %166
117: ; preds = %101, %89, %77, %65, %53, %41, %29, %17
%118 = load i32, i32* @stderr
%119 = tail call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
br label %168
120: ; preds = %113
%121 = bitcast i32* %2 to <8 x i32>*
br label %122
122: ; preds = %120, %163
%123 = call i32 @hash_function(i8* %7)
%124 = icmp eq i32 %123, -1
br i1 %124, label %154, label %125
125: ; preds = %122
%126 = sext i32 %123 to i64
%127 = getelementptr inbounds i32, i32* %2, i64 %126
%128 = load i32, i32* %127
%129 = getelementptr inbounds i32, i32* %3, i64 %126
%130 = load i32, i32* %129
%131 = icmp slt i32 %128, %130
br i1 %131, label %137, label %132
132: ; preds = %125
%133 = load i8***, i8**** %1
%134 = getelementptr inbounds i8**, i8*** %133, i64 %126
%135 = call i32 @doubleCapacity(i8*** %134, i32* %127, i32* %129)
%136 = load i32, i32* %127
br label %137
137: ; preds = %132, %125
%138 = phi i32 [ %136, %132 ], [ %128, %125 ]
%139 = load i8***, i8**** %1
%140 = getelementptr inbounds i8**, i8*** %139, i64 %126
%141 = load i8**, i8*** %140
%142 = call i64 @search(i8** %141, i8* %7, i32 %138)
%143 = icmp eq i64 %142, 0
br i1 %143, label %144, label %154
144: ; preds = %137
%145 = load i8***, i8**** %1
%146 = getelementptr inbounds i8**, i8*** %145, i64 %126
%147 = load i8**, i8*** %146
%148 = call i64 @insertWord(i8** %147, i32* %127, i8* %7)
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %144
%151 = load i32, i32* @stderr
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%153 = call i32 @fclose(i32* %8)
br label %168
154: ; preds = %137, %144, %122
%155 = load <8 x i32>, <8 x i32>* %121
%156 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %155)
%157 = srem i32 %156, 5000
%158 = icmp eq i32 %157, 0
br i1 %158, label %159, label %163
159: ; preds = %154
%160 = call i32 @putchar(i32 46)
%161 = load i32, i32* @stdout
%162 = call i32 @fflush(i32 %161)
br label %163
163: ; preds = %154, %159
%164 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%165 = icmp eq i32 %164, 1
br i1 %165, label %122, label %166
166: ; preds = %163, %113
%167 = call i32 @fclose(i32* %8)
br label %168
168: ; preds = %150, %166, %117, %26, %10
%169 = phi i32 [ -1, %10 ], [ -1, %26 ], [ -1, %117 ], [ 0, %166 ], [ 1, %150 ]
ret i32 %169
}