#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*/ EXIT_FAILURE;
scalar_t__ ReadFileLine(int /*<<< orphan*/ *, float *, int);
int atoi(char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
float fabsf(float);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *);
int main(int argc, char *argv[]) {
  FILE *pFileBase = NULL, *pFileTest = NULL;
  char fileBaseName[100];
  char fileTestName[100];
  float error, relative_error, max_error = 0.0;
  float stored_v1, stored_v2;
  int index, line, stored_line, stored_index;
  int empty_results = 1;
  if (argc != 2) {
    printf("Checker Error: Incorrect arguments.\nUsage: ./checker <nw_size>\n");
    exit(EXIT_FAILURE);
  }
  int nw_size = atoi(argv[1]);
  float *matrixBase = (float *)calloc(nw_size, sizeof(float));
  float *matrixTest = (float *)calloc(nw_size, sizeof(float));
  sprintf(fileBaseName, "InferiorOlive_Output_Baseline.txt");
  sprintf(fileTestName, "InferiorOlive_Output.txt");
  pFileBase = fopen(fileBaseName, "r");
  if (pFileBase == NULL) {
    printf("\nCould not locate baseline results file for regression test.\n");
    exit(EXIT_FAILURE);
  }
  pFileTest = fopen(fileTestName, "r");
  if (pFileTest == NULL) {
    printf("\nCould not locate build test results.\nCheck whether the new "
           "build compiles and runs properly.\n");
    exit(EXIT_FAILURE);
  }
  line = 1;
  while ((ReadFileLine(pFileBase, &matrixBase[0], nw_size)) &&
         (ReadFileLine(pFileTest, &matrixTest[0], nw_size))) {
    for (index = 0; index < nw_size; index++) {
      error = fabsf(matrixBase[index] - matrixTest[index]);
      relative_error = fabsf(error / matrixBase[index]);
      if (relative_error > max_error) {
        max_error = relative_error;
        stored_v1 = matrixBase[index];
        stored_v2 = matrixTest[index];
        stored_line = line;
        stored_index = index;
      }
    }
    line++;
    empty_results = 0;
  }
  if (empty_results) {
    printf("Build test results file empty.\nCheck whether the new build "
           "compiles and runs properly.\n");
  } else if (max_error > 0.01) {
    printf("\nWarning! Maximum error found: %0.4f%%.\n", max_error * 100);
    printf("Maximum discrepancy was found at line %d, neuron %d:\n",
           stored_line, stored_index);
    printf("Correct value: %0.8f - Runtime value: %0.8f.", stored_v1,
           stored_v2);
  } else {
    printf("\nCheck was passed successfully!\n");
  }
  fclose(pFileBase);
  fclose(pFileTest);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10c(%rbp)
ff
movl   $0x1,-0x128(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11e4 <main+0x64>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x12c(%rbp)
mov    -0x12c(%rbp),%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x138(%rbp)
mov    -0x12c(%rbp),%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x140(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe2d(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x100(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1080 <sprintf@plt>
lea    -0x90(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1289 <main+0x109>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
lea    -0x100(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12c7 <main+0x147>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
movl   $0x1,-0x11c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x138(%rbp),%rsi
mov    -0x12c(%rbp),%edx
call   10a0 <ReadFileLine@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x141(%rbp)
je     131f <main+0x19f>
mov    -0x20(%rbp),%rdi
mov    -0x140(%rbp),%rsi
mov    -0x12c(%rbp),%edx
call   10a0 <ReadFileLine@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x141(%rbp)
mov    -0x141(%rbp),%al
test   $0x1,%al
jne    1332 <main+0x1b2>
jmp    145f <main+0x2df>
movl   $0x0,-0x118(%rbp)
mov    -0x118(%rbp),%eax
cmp    -0x12c(%rbp),%eax
jge    1441 <main+0x2c1>
mov    -0x138(%rbp),%rax
movslq -0x118(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x140(%rbp),%rax
movslq -0x118(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
movaps 0xc95(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x104(%rbp)
ff
movss  -0x104(%rbp),%xmm0
ff
mov    -0x138(%rbp),%rax
movslq -0x118(%rbp),%rcx
divss  (%rax,%rcx,4),%xmm0
movaps 0xc67(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x108(%rbp)
ff
movss  -0x108(%rbp),%xmm0
ff
ucomiss -0x10c(%rbp),%xmm0
jbe    1428 <main+0x2a8>
movss  -0x108(%rbp),%xmm0
ff
movss  %xmm0,-0x10c(%rbp)
ff
mov    -0x138(%rbp),%rax
movslq -0x118(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x110(%rbp)
ff
mov    -0x140(%rbp),%rax
movslq -0x118(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x114(%rbp)
ff
mov    -0x11c(%rbp),%eax
mov    %eax,-0x120(%rbp)
mov    -0x118(%rbp),%eax
mov    %eax,-0x124(%rbp)
jmp    142d <main+0x2ad>
mov    -0x118(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
jmp    133c <main+0x1bc>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
movl   $0x0,-0x128(%rbp)
jmp    12d1 <main+0x151>
cmpl   $0x0,-0x128(%rbp)
je     147f <main+0x2ff>
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1517 <main+0x397>
movss  -0x10c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xb6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1504 <main+0x384>
movss  0xb63(%rip),%xmm0
mulss  -0x10c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xcda(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x120(%rbp),%esi
mov    -0x124(%rbp),%edx
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x110(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x114(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xcf9(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1512 <main+0x392>
lea    0xd13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1517 <main+0x397>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
cmp    $0x2,%edi
jne    1432 <main+0x2b2>
mov    0x8(%rsi),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
mov    %ebp,%r14d
mov    %ebp,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rbp
movups 0xe4f(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xe53(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movw   $0x74,0x50(%rsp)
movups 0xe52(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movups 0xe4c(%rip),%xmm0
movups %xmm0,0xa9(%rsp)
lea    0xe4d(%rip),%rsi
lea    0x30(%rsp),%rdi
call   1070 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     143b <main+0x2bb>
lea    0xe2e(%rip),%rsi
lea    0xa0(%rsp),%rdi
call   1070 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     1444 <main+0x2c4>
mov    0x20(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   10a0 <ReadFileLine@plt>
test   %rax,%rax
je     1362 <main+0x1e2>
mov    0x18(%rsp),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   10a0 <ReadFileLine@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     1357 <main+0x1d7>
mov    %r14d,%r15d
xorps  %xmm5,%xmm5
mov    $0x1,%r13d
movaps 0xd72(%rip),%xmm6
xchg   %ax,%ax
test   %r14d,%r14d
jle    12e0 <main+0x160>
xor    %eax,%eax
jmp    12a9 <main+0x129>
nopl   0x0(%rax)
add    $0x1,%rax
cmp    %rax,%r15
je     12e0 <main+0x160>
movss  (%rbx,%rax,4),%xmm1
movss  0x0(%rbp,%rax,4),%xmm2
movaps %xmm1,%xmm0
subss  %xmm2,%xmm0
andps  %xmm6,%xmm0
divss  %xmm1,%xmm0
andps  %xmm6,%xmm0
ucomiss %xmm5,%xmm0
jbe    12a0 <main+0x120>
movaps %xmm1,%xmm3
movaps %xmm2,%xmm4
mov    %r13d,%r12d
mov    %eax,%ecx
movaps %xmm0,%xmm5
jmp    12a0 <main+0x120>
nopw   0x0(%rax,%rax,1)
movss  %xmm5,0x10(%rsp)
mov    %r12d,0x14(%rsp)
mov    %ecx,%r12d
movss  %xmm4,0x8(%rsp)
movss  %xmm3,0xc(%rsp)
mov    0x20(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   10a0 <ReadFileLine@plt>
test   %rax,%rax
je     136e <main+0x1ee>
add    $0x1,%r13d
mov    0x18(%rsp),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   10a0 <ReadFileLine@plt>
test   %rax,%rax
movss  0xc(%rsp),%xmm3
movss  0x8(%rsp),%xmm4
mov    %r12d,%ecx
mov    0x14(%rsp),%r12d
movss  0x10(%rsp),%xmm5
movaps 0xcb9(%rip),%xmm6
jne    1290 <main+0x110>
cmpq   $0x0,0x28(%rsp)
jne    1388 <main+0x208>
jmp    1362 <main+0x1e2>
xorps  %xmm5,%xmm5
cmpq   $0x0,0x28(%rsp)
jne    1388 <main+0x208>
lea    0xd9c(%rip),%rdi
jmp    1402 <main+0x282>
movss  0xc(%rsp),%xmm3
movss  0x8(%rsp),%xmm4
mov    %r12d,%ecx
mov    0x14(%rsp),%r12d
movss  0x10(%rsp),%xmm5
xorps  %xmm0,%xmm0
cvtss2sd %xmm5,%xmm0
ucomisd 0xc79(%rip),%xmm0
jbe    13fb <main+0x27b>
mulss  0xc77(%rip),%xmm5
xorps  %xmm0,%xmm0
cvtss2sd %xmm5,%xmm0
lea    0xcaa(%rip),%rdi
mov    $0x1,%al
movss  %xmm3,0xc(%rsp)
movss  %xmm4,0x8(%rsp)
mov    %ecx,%ebx
call   1050 <printf@plt>
lea    0xcb7(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xcc6(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
jmp    1407 <main+0x287>
lea    0xce3(%rip),%rdi
call   1030 <puts@plt>
mov    0x20(%rsp),%rdi
call   1040 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1040 <fclose@plt>
mov    $0x1,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdbe(%rip),%rdi
jmp    144b <main+0x2cb>
lea    0xd78(%rip),%rdi
jmp    144b <main+0x2cb>
lea    0xd11(%rip),%rdi
call   1030 <puts@plt>
mov    0x2b89(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Checker Error: Incorrect arguments.\0AUsage: ./checker <nw_size>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [34 x i8] c"InferiorOlive_Output_Baseline.txt\00"
@.str.2 = [25 x i8] c"InferiorOlive_Output.txt\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [62 x i8] c"\0ACould not locate baseline results file for regression test.\0A\00"
@.str.5 = [95 x i8] c"\0ACould not locate build test results.\0ACheck whether the new build compiles and runs properly.\0A\00"
@.str.6 = [88 x i8] c"Build test results file empty.\0ACheck whether the new build compiles and runs properly.\0A\00"
@.str.7 = [41 x i8] c"\0AWarning! Maximum error found: %0.4f%%.\0A\00"
@.str.8 = [54 x i8] c"Maximum discrepancy was found at line %d, neuron %d:\0A\00"
@.str.9 = [45 x i8] c"Correct value: %0.8f - Runtime value: %0.8f.\00"
@.str.10 = [33 x i8] c"\0ACheck was passed successfully!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca float*
%22 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store float 0.000000e+00, float* %12
store i32 1, i32* %19
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 2
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
%28 = call i32 @exit(i32 %27)
unreachable
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
store i32 %33, i32* %20
%34 = load i32, i32* %20
%35 = call i64 @calloc(i32 %34, i32 4)
%36 = inttoptr i64 %35 to float*
store float* %36, float** %21
%37 = load i32, i32* %20
%38 = call i64 @calloc(i32 %37, i32 4)
%39 = inttoptr i64 %38 to float*
store float* %39, float** %22
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%41 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%43 = call i32 @sprintf(i8* %42, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%45 = call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %45, i32** %6
%46 = load i32*, i32** %6
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %52
48: ; preds = %29
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.4, i64 0, i64 0))
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %29
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%54 = call i32* @fopen(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %54, i32** %7
%55 = load i32*, i32** %7
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %61
57: ; preds = %52
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.5, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %52
store i32 1, i32* %16
br label %62
62: ; preds = %125, %61
%63 = load i32*, i32** %6
%64 = load float*, float** %21
%65 = getelementptr inbounds float, float* %64, i64 0
%66 = load i32, i32* %20
%67 = call i64 @ReadFileLine(i32* %63, float* %65, i32 %66)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %76
69: ; preds = %62
%70 = load i32*, i32** %7
%71 = load float*, float** %22
%72 = getelementptr inbounds float, float* %71, i64 0
%73 = load i32, i32* %20
%74 = call i64 @ReadFileLine(i32* %70, float* %72, i32 %73)
%75 = icmp ne i64 %74, 0
br label %76
76: ; preds = %69, %62
%77 = phi i1 [ false, %62 ], [ %75, %69 ]
br i1 %77, label %78, label %128
78: ; preds = %76
store i32 0, i32* %15
br label %79
79: ; preds = %122, %78
%80 = load i32, i32* %15
%81 = load i32, i32* %20
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %125
83: ; preds = %79
%84 = load float*, float** %21
%85 = load i32, i32* %15
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds float, float* %84, i64 %86
%88 = load float, float* %87
%89 = load float*, float** %22
%90 = load i32, i32* %15
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds float, float* %89, i64 %91
%93 = load float, float* %92
%94 = fsub float %88, %93
%95 = call float @llvm.fabs.f32(float %94)
store float %95, float* %10
%96 = load float, float* %10
%97 = load float*, float** %21
%98 = load i32, i32* %15
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds float, float* %97, i64 %99
%101 = load float, float* %100
%102 = fdiv float %96, %101
%103 = call float @llvm.fabs.f32(float %102)
store float %103, float* %11
%104 = load float, float* %11
%105 = load float, float* %12
%106 = fcmp ogt float %104, %105
br i1 %106, label %107, label %121
107: ; preds = %83
%108 = load float, float* %11
store float %108, float* %12
%109 = load float*, float** %21
%110 = load i32, i32* %15
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds float, float* %109, i64 %111
%113 = load float, float* %112
store float %113, float* %13
%114 = load float*, float** %22
%115 = load i32, i32* %15
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds float, float* %114, i64 %116
%118 = load float, float* %117
store float %118, float* %14
%119 = load i32, i32* %16
store i32 %119, i32* %17
%120 = load i32, i32* %15
store i32 %120, i32* %18
br label %121
121: ; preds = %107, %83
br label %122
122: ; preds = %121
%123 = load i32, i32* %15
%124 = add nsw i32 %123, 1
store i32 %124, i32* %15
br label %79
125: ; preds = %79
%126 = load i32, i32* %16
%127 = add nsw i32 %126, 1
store i32 %127, i32* %16
store i32 0, i32* %19
br label %62
128: ; preds = %76
%129 = load i32, i32* %19
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %133
131: ; preds = %128
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.6, i64 0, i64 0))
br label %153
133: ; preds = %128
%134 = load float, float* %12
%135 = fpext float %134 to double
%136 = fcmp ogt double %135, 1.000000e-02
br i1 %136, label %137, label %150
137: ; preds = %133
%138 = load float, float* %12
%139 = fmul float %138, 1.000000e+02
%140 = fpext float %139 to double
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), double %140)
%142 = load i32, i32* %17
%143 = load i32, i32* %18
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %142, i32 %143)
%145 = load float, float* %13
%146 = fpext float %145 to double
%147 = load float, float* %14
%148 = fpext float %147 to double
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), double %146, double %148)
br label %152
150: ; preds = %133
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
br label %152
152: ; preds = %150, %137
br label %153
153: ; preds = %152, %131
%154 = load i32*, i32** %6
%155 = call i32 @fclose(i32* %154)
%156 = load i32*, i32** %7
%157 = call i32 @fclose(i32* %156)
ret i32 1
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str.1 = [34 x i8] c"InferiorOlive_Output_Baseline.txt\00"
@.str.2 = [25 x i8] c"InferiorOlive_Output.txt\00"
@.str.3 = [2 x i8] c"r\00"
@.str.7 = [41 x i8] c"\0AWarning! Maximum error found: %0.4f%%.\0A\00"
@.str.8 = [54 x i8] c"Maximum discrepancy was found at line %d, neuron %d:\0A\00"
@.str.9 = [45 x i8] c"Correct value: %0.8f - Runtime value: %0.8f.\00"
@str = [32 x i8] c"\0ACheck was passed successfully!\00"
@str.11 = [87 x i8] c"Build test results file empty.\0ACheck whether the new build compiles and runs properly.\00"
@str.12 = [94 x i8] c"\0ACould not locate build test results.\0ACheck whether the new build compiles and runs properly.\00"
@str.13 = [61 x i8] c"\0ACould not locate baseline results file for regression test.\00"
@str.14 = [63 x i8] c"Checker Error: Incorrect arguments.\0AUsage: ./checker <nw_size>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.14, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = tail call i64 @calloc(i32 %15, i32 4)
%17 = inttoptr i64 %16 to float*
%18 = tail call i64 @calloc(i32 %15, i32 4)
%19 = inttoptr i64 %18 to float*
%20 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %26
22: ; preds = %12
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.13, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
%25 = tail call i32 @exit(i32 %24)
unreachable
26: ; preds = %12
%27 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %37, label %29
29: ; preds = %26
%30 = tail call i64 @ReadFileLine(i32* %20, float* %17, i32 %15)
%31 = icmp eq i64 %30, 0
br i1 %31, label %92, label %32
32: ; preds = %29
%33 = icmp sgt i32 %15, 0
%34 = zext i32 %15 to i64
%35 = tail call i64 @ReadFileLine(i32* %27, float* %19, i32 %15)
%36 = icmp eq i64 %35, 0
br i1 %36, label %86, label %45
37: ; preds = %26
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @str.12, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = tail call i32 @exit(i32 %39)
unreachable
41: ; preds = %78
%42 = add nuw nsw i32 %48, 1
%43 = tail call i64 @ReadFileLine(i32* %27, float* %19, i32 %15)
%44 = icmp eq i64 %43, 0
br i1 %44, label %86, label %45
45: ; preds = %32, %41
%46 = phi float [ %79, %41 ], [ undef, %32 ]
%47 = phi float [ %80, %41 ], [ undef, %32 ]
%48 = phi i32 [ %42, %41 ], [ 1, %32 ]
%49 = phi i32 [ %81, %41 ], [ undef, %32 ]
%50 = phi i32 [ %82, %41 ], [ undef, %32 ]
%51 = phi float [ %83, %41 ], [ 0.000000e+00, %32 ]
br i1 %33, label %52, label %78
52: ; preds = %45, %70
%53 = phi i64 [ %76, %70 ], [ 0, %45 ]
%54 = phi float [ %75, %70 ], [ %51, %45 ]
%55 = phi i32 [ %74, %70 ], [ %50, %45 ]
%56 = phi i32 [ %73, %70 ], [ %49, %45 ]
%57 = phi float [ %72, %70 ], [ %47, %45 ]
%58 = phi float [ %71, %70 ], [ %46, %45 ]
%59 = getelementptr inbounds float, float* %17, i64 %53
%60 = load float, float* %59
%61 = getelementptr inbounds float, float* %19, i64 %53
%62 = load float, float* %61
%63 = fsub float %60, %62
%64 = tail call float @llvm.fabs.f32(float %63)
%65 = fdiv float %64, %60
%66 = tail call float @llvm.fabs.f32(float %65)
%67 = fcmp ogt float %66, %54
br i1 %67, label %68, label %70
68: ; preds = %52
%69 = trunc i64 %53 to i32
br label %70
70: ; preds = %52, %68
%71 = phi float [ %60, %68 ], [ %58, %52 ]
%72 = phi float [ %62, %68 ], [ %57, %52 ]
%73 = phi i32 [ %48, %68 ], [ %56, %52 ]
%74 = phi i32 [ %69, %68 ], [ %55, %52 ]
%75 = phi float [ %66, %68 ], [ %54, %52 ]
%76 = add nuw nsw i64 %53, 1
%77 = icmp eq i64 %76, %34
br i1 %77, label %78, label %52
78: ; preds = %70, %45
%79 = phi float [ %46, %45 ], [ %71, %70 ]
%80 = phi float [ %47, %45 ], [ %72, %70 ]
%81 = phi i32 [ %49, %45 ], [ %73, %70 ]
%82 = phi i32 [ %50, %45 ], [ %74, %70 ]
%83 = phi float [ %51, %45 ], [ %75, %70 ]
%84 = tail call i64 @ReadFileLine(i32* %20, float* %17, i32 %15)
%85 = icmp eq i64 %84, 0
br i1 %85, label %94, label %41
86: ; preds = %41, %32
%87 = phi float [ 0.000000e+00, %32 ], [ %83, %41 ]
%88 = phi i32 [ undef, %32 ], [ %82, %41 ]
%89 = phi i32 [ undef, %32 ], [ %81, %41 ]
%90 = phi float [ undef, %32 ], [ %80, %41 ]
%91 = phi float [ undef, %32 ], [ %79, %41 ]
br i1 %36, label %92, label %94
92: ; preds = %29, %86
%93 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @str.11, i64 0, i64 0))
br label %112
94: ; preds = %78, %86
%95 = phi float [ %87, %86 ], [ %83, %78 ]
%96 = phi i32 [ %88, %86 ], [ %82, %78 ]
%97 = phi i32 [ %89, %86 ], [ %81, %78 ]
%98 = phi float [ %90, %86 ], [ %80, %78 ]
%99 = phi float [ %91, %86 ], [ %79, %78 ]
%100 = fpext float %95 to double
%101 = fcmp ogt double %100, 1.000000e-02
br i1 %101, label %102, label %110
102: ; preds = %94
%103 = fmul float %95, 1.000000e+02
%104 = fpext float %103 to double
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), double %104)
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %97, i32 %96)
%107 = fpext float %99 to double
%108 = fpext float %98 to double
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), double %107, double %108)
br label %112
110: ; preds = %94
%111 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %112
112: ; preds = %102, %110, %92
%113 = tail call i32 @fclose(i32* %20)
%114 = tail call i32 @fclose(i32* %27)
ret i32 1
}