#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 uint32_t;

/* Variables and functions */
int RAND_MAX;
int /*<<< orphan*/ entropy_float(float *, int *, int *, float *, float *,
                                 float *, float *, float *, float *, float *,
                                 float *, float *, float *, float *, float *,
                                 float *, float *);
int /*<<< orphan*/ free(float *);
float *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void main() {
  uint32_t min_rows = 5000;
  uint32_t max_rows = 10000;
  uint32_t row_iterator = 5000;
  uint32_t min_cols = 5000;
  uint32_t max_cols = 10000;
  uint32_t col_iterator = 5000;
  float entropy_table = 0.0;
  float entropy_rows = 0.0;
  float entropy_cols = 0.0;
  float entropy_rowsGivencols = 0.0;
  float entropy_colsGivenRows = 0.0;
  float dependency_rowsOncols = 0.0;
  float dependency_colsOnRows = 0.0;
  float dependency_symmetrical = 0.0;
  float time_sum_all = 0.0;
  float time_sum_rows = 0.0;
  float time_sum_cols = 0.0;
  float time_entropy_table = 0.0;
  float time_entropy_rows = 0.0;
  float time_entropy_cols = 0.0;
  for (uint32_t rows = min_rows; rows <= max_rows; rows += row_iterator) {
    for (uint32_t cols = min_cols; cols <= max_cols; cols += col_iterator) {
      float *table = malloc(rows * cols * sizeof(float));
      srand(time(NULL));
      for (uint32_t row = 0; row < rows; row++) {
        for (uint32_t col = 0; col < cols; col++) {
          table[row * cols + col] = (float)rand() / (float)(RAND_MAX / 32767);
        }
      }
      entropy_float(table, &rows, &cols, &entropy_table, &entropy_rows,
                    &entropy_cols, &entropy_rowsGivencols,
                    &entropy_colsGivenRows, &dependency_rowsOncols,
                    &dependency_colsOnRows, &dependency_symmetrical,
                    &time_sum_all, &time_sum_rows, &time_sum_cols,
                    &time_entropy_table, &time_entropy_rows,
                    &time_entropy_cols);
      free(table);
      printf("Rows: %d, cols: %d\n", rows, cols);
      printf("Entropy of Table          : %1.4f\n", entropy_table);
      printf("Entropy of x-distribution : %1.4f\n", entropy_rows);
      printf("Entropy of y-distribution : %1.4f\n", entropy_cols);
      printf("Entropy of x given y      : %1.4f\n", entropy_rowsGivencols);
      printf("Entropy of y given x      : %1.4f\n", entropy_colsGivenRows);
      printf("Dependency or x on y      : %1.4f\n", dependency_rowsOncols);
      printf("Dependency of y on x      : %1.4f\n", dependency_colsOnRows);
      printf("Symmetrical Dependency    : %1.4f\n", dependency_symmetrical);
      printf("Time Sum All              : %1.4f seconds\n", time_sum_all);
      printf("Time Sum Rows             : %1.4f seconds\n", time_sum_rows);
      printf("Time Sum cols             : %1.4f seconds\n", time_sum_cols);
      printf("Time Entropy Rows         : %1.4f seconds\n", time_entropy_rows);
      printf("Time Entropy cols         : %1.4f seconds\n", time_entropy_cols);
      printf("Time Table Entropy        : %1.4f seconds\n", time_entropy_table);
      printf("\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movl   $0x1388,-0x2c(%rbp)
movl   $0x2710,-0x30(%rbp)
movl   $0x1388,-0x34(%rbp)
movl   $0x1388,-0x38(%rbp)
movl   $0x2710,-0x3c(%rbp)
movl   $0x1388,-0x40(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x5c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     155b <main+0x3eb>
mov    -0x38(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     1548 <main+0x3d8>
mov    -0x7c(%rbp),%eax
imul   -0x80(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x88(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jge    1310 <main+0x1a0>
movl   $0x0,-0x90(%rbp)
mov    -0x90(%rbp),%eax
cmp    -0x80(%rbp),%eax
jge    12f7 <main+0x187>
mov    $0x0,%al
call   1090 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2d36(%rip),%rax
mov    (%rax),%eax
mov    $0x7fff,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
mov    -0x88(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x80(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1290 <main+0x120>
jmp    12fc <main+0x18c>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1277 <main+0x107>
mov    -0x88(%rbp),%rdi
lea    -0x7c(%rbp),%rsi
lea    -0x80(%rbp),%rdx
lea    -0x44(%rbp),%rcx
lea    -0x48(%rbp),%r8
lea    -0x4c(%rbp),%r9
lea    -0x50(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0x54(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x58(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x5c(%rbp),%r13
lea    -0x60(%rbp),%r12
lea    -0x64(%rbp),%r15
lea    -0x68(%rbp),%r14
lea    -0x6c(%rbp),%rbx
lea    -0x70(%rbp),%r11
lea    -0x74(%rbp),%r10
lea    -0x78(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,(%rsp)
mov    -0xa8(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0xa0(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x98(%rbp),%rax
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15,0x28(%rsp)
mov    %r14,0x30(%rsp)
mov    %rbx,0x38(%rsp)
mov    %r11,0x40(%rsp)
mov    %r10,0x48(%rsp)
mov    %rax,0x50(%rsp)
call   1040 <entropy_float@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x7c(%rbp),%esi
mov    -0x80(%rbp),%edx
lea    0xc1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc1a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc26(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x4c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc32(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x50(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc3e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x54(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc4a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x58(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc56(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x5c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc62(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc6e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc7a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x68(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc8e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xca2(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcca(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcde(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xadf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%eax
add    -0x80(%rbp),%eax
mov    %eax,-0x80(%rbp)
jmp    1236 <main+0xc6>
jmp    154d <main+0x3dd>
mov    -0x34(%rbp),%eax
add    -0x7c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
jmp    1224 <main+0xb4>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movl   $0x0,0x44(%rsp)
movl   $0x0,0x40(%rsp)
movl   $0x0,0x3c(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0x0,0x34(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x2c(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x1388,0x8(%rsp)
mov    $0x1388,%edi
mov    0x2dd6(%rip),%r13
lea    0xfbf(%rip),%r14
lea    0xfe3(%rip),%r15
jmp    1249 <main+0xc9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%rsp),%eax
lea    0x1388(%rax),%edi
mov    %edi,0x8(%rsp)
cmp    $0x1389,%eax
jge    1504 <main+0x384>
movl   $0x1388,0xc(%rsp)
mov    $0x1388,%eax
cs nopw 0x0(%rax,%rax,1)
imul   %eax,%edi
shl    $0x2,%edi
call   1090 <malloc@plt>
mov    %rax,%r12
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
jle    1300 <main+0x180>
xor    %ebx,%ebx
mov    0xc(%rsp),%eax
jmp    1297 <main+0x117>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    %ecx,%ebx
jge    1300 <main+0x180>
test   %eax,%eax
jle    1290 <main+0x110>
xor    %ebp,%ebp
nopl   (%rax)
xor    %eax,%eax
call   10a0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movslq 0x0(%r13),%rax
imul   $0xffffffff80010003,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0xe,%ecx
add    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
divss  %xmm1,%xmm0
mov    0xc(%rsp),%eax
mov    %ebx,%ecx
imul   %eax,%ecx
movslq %ecx,%rcx
add    %rbp,%rcx
movss  %xmm0,(%r12,%rcx,4)
add    $0x1,%rbp
cmp    %eax,%ebp
jl     12a0 <main+0x120>
mov    0x8(%rsp),%ecx
jmp    1290 <main+0x110>
nopl   0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    %r12,%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x4c(%rsp),%rcx
lea    0x48(%rsp),%r8
lea    0x44(%rsp),%r9
lea    0x18(%rsp),%rax
push   %rax
lea    0x24(%rsp),%rax
push   %rax
lea    0x30(%rsp),%rax
push   %rax
lea    0x3c(%rsp),%rax
push   %rax
lea    0x48(%rsp),%rax
push   %rax
lea    0x54(%rsp),%rax
push   %rax
lea    0x60(%rsp),%rax
push   %rax
lea    0x6c(%rsp),%rax
push   %rax
lea    0x78(%rsp),%rax
push   %rax
lea    0x84(%rsp),%rax
push   %rax
lea    0x90(%rsp),%rax
push   %rax
call   1040 <entropy_float@plt>
add    $0x60,%rsp
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xc78(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movss  0x44(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc74(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x40(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc7f(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x3c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc8a(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x38(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc95(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x34(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xca0(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcab(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcb6(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcc1(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xccc(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcdf(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcf2(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd05(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1050 <putchar@plt>
mov    0xc(%rsp),%ecx
lea    0x1388(%rcx),%eax
mov    %eax,0xc(%rsp)
cmp    $0x1388,%ecx
jg     1230 <main+0xb0>
mov    0x8(%rsp),%edi
jmp    1260 <main+0xe0>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
@.str = [20 x i8] c"Rows: %d, cols: %d\0A\00"
@.str.1 = [35 x i8] c"Entropy of Table : %1.4f\0A\00"
@.str.2 = [35 x i8] c"Entropy of x-distribution : %1.4f\0A\00"
@.str.3 = [35 x i8] c"Entropy of y-distribution : %1.4f\0A\00"
@.str.4 = [35 x i8] c"Entropy of x given y : %1.4f\0A\00"
@.str.5 = [35 x i8] c"Entropy of y given x : %1.4f\0A\00"
@.str.6 = [35 x i8] c"Dependency or x on y : %1.4f\0A\00"
@.str.7 = [35 x i8] c"Dependency of y on x : %1.4f\0A\00"
@.str.8 = [35 x i8] c"Symmetrical Dependency : %1.4f\0A\00"
@.str.9 = [43 x i8] c"Time Sum All : %1.4f seconds\0A\00"
@.str.10 = [43 x i8] c"Time Sum Rows : %1.4f seconds\0A\00"
@.str.11 = [43 x i8] c"Time Sum cols : %1.4f seconds\0A\00"
@.str.12 = [43 x i8] c"Time Entropy Rows : %1.4f seconds\0A\00"
@.str.13 = [43 x i8] c"Time Entropy cols : %1.4f seconds\0A\00"
@.str.14 = [43 x i8] c"Time Table Entropy : %1.4f seconds\0A\00"
@.str.15 = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca i32
%22 = alloca i32
%23 = alloca float*
%24 = alloca i32
%25 = alloca i32
store i32 5000, i32* %1
store i32 10000, i32* %2
store i32 5000, i32* %3
store i32 5000, i32* %4
store i32 10000, i32* %5
store i32 5000, i32* %6
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
store float 0.000000e+00, float* %9
store float 0.000000e+00, float* %10
store float 0.000000e+00, float* %11
store float 0.000000e+00, float* %12
store float 0.000000e+00, float* %13
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
store float 0.000000e+00, float* %16
store float 0.000000e+00, float* %17
store float 0.000000e+00, float* %18
store float 0.000000e+00, float* %19
store float 0.000000e+00, float* %20
%26 = load i32, i32* %1
store i32 %26, i32* %21
br label %27
27: ; preds = %134, %0
%28 = load i32, i32* %21
%29 = load i32, i32* %2
%30 = icmp sle i32 %28, %29
br i1 %30, label %31, label %138
31: ; preds = %27
%32 = load i32, i32* %4
store i32 %32, i32* %22
br label %33
33: ; preds = %129, %31
%34 = load i32, i32* %22
%35 = load i32, i32* %5
%36 = icmp sle i32 %34, %35
br i1 %36, label %37, label %133
37: ; preds = %33
%38 = load i32, i32* %21
%39 = load i32, i32* %22
%40 = mul nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 4
%43 = trunc i64 %42 to i32
%44 = call float* @malloc(i32 %43)
store float* %44, float** %23
%45 = call i32 @time(i32* null)
%46 = call i32 @srand(i32 %45)
store i32 0, i32* %24
br label %47
47: ; preds = %75, %37
%48 = load i32, i32* %24
%49 = load i32, i32* %21
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %78
51: ; preds = %47
store i32 0, i32* %25
br label %52
52: ; preds = %71, %51
%53 = load i32, i32* %25
%54 = load i32, i32* %22
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %74
56: ; preds = %52
%57 = call i64 (...) @rand()
%58 = sitofp i64 %57 to float
%59 = load i32, i32* @RAND_MAX
%60 = sdiv i32 %59, 32767
%61 = sitofp i32 %60 to float
%62 = fdiv float %58, %61
%63 = load float*, float** %23
%64 = load i32, i32* %24
%65 = load i32, i32* %22
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %25
%68 = add nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float, float* %63, i64 %69
store float %62, float* %70
br label %71
71: ; preds = %56
%72 = load i32, i32* %25
%73 = add nsw i32 %72, 1
store i32 %73, i32* %25
br label %52
74: ; preds = %52
br label %75
75: ; preds = %74
%76 = load i32, i32* %24
%77 = add nsw i32 %76, 1
store i32 %77, i32* %24
br label %47
78: ; preds = %47
%79 = load float*, float** %23
%80 = call i32 @entropy_float(float* %79, i32* %21, i32* %22, float* %7, float* %8, float* %9, float* %10, float* %11, float* %12, float* %13, float* %14, float* %15, float* %16, float* %17, float* %18, float* %19, float* %20)
%81 = load float*, float** %23
%82 = call i32 @free(float* %81)
%83 = load i32, i32* %21
%84 = load i32, i32* %22
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %83, i32 %84)
%86 = load float, float* %7
%87 = fpext float %86 to double
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), double %87)
%89 = load float, float* %8
%90 = fpext float %89 to double
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %90)
%92 = load float, float* %9
%93 = fpext float %92 to double
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %93)
%95 = load float, float* %10
%96 = fpext float %95 to double
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), double %96)
%98 = load float, float* %11
%99 = fpext float %98 to double
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %99)
%101 = load float, float* %12
%102 = fpext float %101 to double
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), double %102)
%104 = load float, float* %13
%105 = fpext float %104 to double
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %105)
%107 = load float, float* %14
%108 = fpext float %107 to double
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %108)
%110 = load float, float* %15
%111 = fpext float %110 to double
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), double %111)
%113 = load float, float* %16
%114 = fpext float %113 to double
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), double %114)
%116 = load float, float* %17
%117 = fpext float %116 to double
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0), double %117)
%119 = load float, float* %19
%120 = fpext float %119 to double
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), double %120)
%122 = load float, float* %20
%123 = fpext float %122 to double
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), double %123)
%125 = load float, float* %18
%126 = fpext float %125 to double
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), double %126)
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
br label %129
129: ; preds = %78
%130 = load i32, i32* %6
%131 = load i32, i32* %22
%132 = add nsw i32 %131, %130
store i32 %132, i32* %22
br label %33
133: ; preds = %33
br label %134
134: ; preds = %133
%135 = load i32, i32* %3
%136 = load i32, i32* %21
%137 = add nsw i32 %136, %135
store i32 %137, i32* %21
br label %27
138: ; preds = %27
ret void
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
@.str = [20 x i8] c"Rows: %d, cols: %d\0A\00"
@.str.1 = [35 x i8] c"Entropy of Table : %1.4f\0A\00"
@.str.2 = [35 x i8] c"Entropy of x-distribution : %1.4f\0A\00"
@.str.3 = [35 x i8] c"Entropy of y-distribution : %1.4f\0A\00"
@.str.4 = [35 x i8] c"Entropy of x given y : %1.4f\0A\00"
@.str.5 = [35 x i8] c"Entropy of y given x : %1.4f\0A\00"
@.str.6 = [35 x i8] c"Dependency or x on y : %1.4f\0A\00"
@.str.7 = [35 x i8] c"Dependency of y on x : %1.4f\0A\00"
@.str.8 = [35 x i8] c"Symmetrical Dependency : %1.4f\0A\00"
@.str.9 = [43 x i8] c"Time Sum All : %1.4f seconds\0A\00"
@.str.10 = [43 x i8] c"Time Sum Rows : %1.4f seconds\0A\00"
@.str.11 = [43 x i8] c"Time Sum cols : %1.4f seconds\0A\00"
@.str.12 = [43 x i8] c"Time Entropy Rows : %1.4f seconds\0A\00"
@.str.13 = [43 x i8] c"Time Entropy cols : %1.4f seconds\0A\00"
@.str.14 = [43 x i8] c"Time Table Entropy : %1.4f seconds\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca i32
%16 = alloca i32
%17 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%18 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%19 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%20 = bitcast float* %4 to i8*
store float 0.000000e+00, float* %4
%21 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%22 = bitcast float* %6 to i8*
store float 0.000000e+00, float* %6
%23 = bitcast float* %7 to i8*
store float 0.000000e+00, float* %7
%24 = bitcast float* %8 to i8*
store float 0.000000e+00, float* %8
%25 = bitcast float* %9 to i8*
store float 0.000000e+00, float* %9
%26 = bitcast float* %10 to i8*
store float 0.000000e+00, float* %10
%27 = bitcast float* %11 to i8*
store float 0.000000e+00, float* %11
%28 = bitcast float* %12 to i8*
store float 0.000000e+00, float* %12
%29 = bitcast float* %13 to i8*
store float 0.000000e+00, float* %13
%30 = bitcast float* %14 to i8*
store float 0.000000e+00, float* %14
%31 = bitcast i32* %15 to i8*
%32 = bitcast i32* %16 to i8*
store i32 5000, i32* %15
br label %34
33: ; preds = %36
ret void
34: ; preds = %0, %36
%35 = phi i32 [ 5000, %0 ], [ %38, %36 ]
store i32 5000, i32* %16
br label %40
36: ; preds = %57
%37 = load i32, i32* %15
%38 = add nsw i32 %37, 5000
store i32 %38, i32* %15
%39 = icmp slt i32 %37, 5001
br i1 %39, label %34, label %33
40: ; preds = %109, %34
%41 = phi i32 [ %35, %34 ], [ %110, %109 ]
%42 = phi i32 [ 5000, %34 ], [ %107, %109 ]
%43 = shl i32 %42, 2
%44 = mul i32 %43, %41
%45 = call float* @malloc(i32 %44)
%46 = call i32 @time(i32* null)
%47 = call i32 @srand(i32 %46)
%48 = load i32, i32* %15
%49 = icmp sgt i32 %48, 0
br i1 %49, label %50, label %57
50: ; preds = %40
%51 = load i32, i32* %16
br label %52
52: ; preds = %50, %113
%53 = phi i32 [ %114, %113 ], [ %48, %50 ]
%54 = phi i32 [ %115, %113 ], [ %51, %50 ]
%55 = phi i32 [ %116, %113 ], [ 0, %50 ]
%56 = icmp sgt i32 %54, 0
br i1 %56, label %118, label %113
57: ; preds = %113, %40
%58 = call i32 @entropy_float(float* %45, i32* %15, i32* %16, float* %1, float* %2, float* %3, float* %4, float* %5, float* %6, float* %7, float* %8, float* %9, float* %10, float* %11, float* %12, float* %13, float* %14)
%59 = call i32 @free(float* %45)
%60 = load i32, i32* %15
%61 = load i32, i32* %16
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %60, i32 %61)
%63 = load float, float* %1
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), double %64)
%66 = load float, float* %2
%67 = fpext float %66 to double
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %67)
%69 = load float, float* %3
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %70)
%72 = load float, float* %4
%73 = fpext float %72 to double
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), double %73)
%75 = load float, float* %5
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), double %76)
%78 = load float, float* %6
%79 = fpext float %78 to double
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), double %79)
%81 = load float, float* %7
%82 = fpext float %81 to double
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %82)
%84 = load float, float* %8
%85 = fpext float %84 to double
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), double %85)
%87 = load float, float* %9
%88 = fpext float %87 to double
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), double %88)
%90 = load float, float* %10
%91 = fpext float %90 to double
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0), double %91)
%93 = load float, float* %11
%94 = fpext float %93 to double
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0), double %94)
%96 = load float, float* %13
%97 = fpext float %96 to double
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), double %97)
%99 = load float, float* %14
%100 = fpext float %99 to double
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0), double %100)
%102 = load float, float* %12
%103 = fpext float %102 to double
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), double %103)
%105 = call i32 @putchar(i32 10)
%106 = load i32, i32* %16
%107 = add nsw i32 %106, 5000
store i32 %107, i32* %16
%108 = icmp slt i32 %106, 5001
br i1 %108, label %109, label %36
109: ; preds = %57
%110 = load i32, i32* %15
br label %40
111: ; preds = %118
%112 = load i32, i32* %15
br label %113
113: ; preds = %111, %52
%114 = phi i32 [ %112, %111 ], [ %53, %52 ]
%115 = phi i32 [ %126, %111 ], [ %54, %52 ]
%116 = add nuw nsw i32 %55, 1
%117 = icmp slt i32 %116, %114
br i1 %117, label %52, label %57
118: ; preds = %52, %118
%119 = phi i32 [ %131, %118 ], [ 0, %52 ]
%120 = call i64 (...) @rand()
%121 = sitofp i64 %120 to float
%122 = load i32, i32* @RAND_MAX
%123 = sdiv i32 %122, 32767
%124 = sitofp i32 %123 to float
%125 = fdiv float %121, %124
%126 = load i32, i32* %16
%127 = mul nsw i32 %126, %55
%128 = add nsw i32 %127, %119
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds float, float* %45, i64 %129
store float %125, float* %130
%131 = add nuw nsw i32 %119, 1
%132 = icmp slt i32 %131, %126
br i1 %132, label %118, label %111
}