#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 */

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ init_array(int, int, double *, double **);
int /*<<< orphan*/ kernel_covariance(int, int, double, double **, double **,
                                     double *);
scalar_t__ polybench_alloc_data(int, int);
int /*<<< orphan*/ print_array(int, double **);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int n = 1400;
  int m = 1200;
  double float_n;
  double(*data)[1400 + 0][1200 + 0];
  data = (double(*)[1400 + 0][1200 + 0])
      polybench_alloc_data((1400 + 0) * (1200 + 0), sizeof(double));
  ;
  double(*cov)[1200 + 0][1200 + 0];
  cov = (double(*)[1200 + 0][1200 + 0])
      polybench_alloc_data((1200 + 0) * (1200 + 0), sizeof(double));
  ;
  double(*mean)[1200 + 0];
  mean = (double(*)[1200 + 0]) polybench_alloc_data(1200 + 0, sizeof(double));
  ;
  init_array(m, n, &float_n, *data);
  ;
  kernel_covariance(m, n, float_n, *data, *cov, *mean);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(m, *cov);
  free((void *)data);
  ;
  free((void *)cov);
  ;
  free((void *)mean);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x578,-0x14(%rbp)
movl   $0x4b0,-0x18(%rbp)
mov    $0x19a280,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x28(%rbp)
mov    $0x15f900,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x30(%rbp)
mov    $0x4b0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x28(%rbp),%rcx
lea    -0x20(%rbp),%rdx
call   1050 <init_array@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
call   1080 <kernel_covariance@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    121e <main+0xbe>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdfc(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    121e <main+0xbe>
mov    -0x18(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    $0x19a280,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    $0x15f900,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0x4b0,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r12
lea    0x8(%rsp),%rdx
mov    $0x4b0,%edi
mov    $0x578,%esi
mov    %rbx,%rcx
call   1050 <init_array@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x4b0,%edi
mov    $0x578,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r12,%r8
call   1070 <kernel_covariance@plt>
cmp    $0x2b,%ebp
jl     11e6 <main+0x96>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    11e6 <main+0x96>
mov    $0x4b0,%edi
mov    %r14,%rsi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca [1400 x [1200 x double]]*
%10 = alloca [1200 x [1200 x double]]*
%11 = alloca [1200 x double]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1400, i32* %6
store i32 1200, i32* %7
%12 = call i64 @polybench_alloc_data(i32 1680000, i32 8)
%13 = inttoptr i64 %12 to [1400 x [1200 x double]]*
store [1400 x [1200 x double]]* %13, [1400 x [1200 x double]]** %9
%14 = call i64 @polybench_alloc_data(i32 1440000, i32 8)
%15 = inttoptr i64 %14 to [1200 x [1200 x double]]*
store [1200 x [1200 x double]]* %15, [1200 x [1200 x double]]** %10
%16 = call i64 @polybench_alloc_data(i32 1200, i32 8)
%17 = inttoptr i64 %16 to [1200 x double]*
store [1200 x double]* %17, [1200 x double]** %11
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = load [1400 x [1200 x double]]*, [1400 x [1200 x double]]** %9
%21 = getelementptr inbounds [1400 x [1200 x double]], [1400 x [1200 x double]]* %20, i64 0, i64 0
%22 = bitcast [1200 x double]* %21 to double**
%23 = call i32 @init_array(i32 %18, i32 %19, double* %8, double** %22)
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = load double, double* %8
%27 = load [1400 x [1200 x double]]*, [1400 x [1200 x double]]** %9
%28 = getelementptr inbounds [1400 x [1200 x double]], [1400 x [1200 x double]]* %27, i64 0, i64 0
%29 = bitcast [1200 x double]* %28 to double**
%30 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%31 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %30, i64 0, i64 0
%32 = bitcast [1200 x double]* %31 to double**
%33 = load [1200 x double]*, [1200 x double]** %11
%34 = getelementptr inbounds [1200 x double], [1200 x double]* %33, i64 0, i64 0
%35 = call i32 @kernel_covariance(i32 %24, i32 %25, double %26, double** %29, double** %32, double* %34)
%36 = load i32, i32* %4
%37 = icmp sgt i32 %36, 42
br i1 %37, label %38, label %50
38: ; preds = %2
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 0
%41 = load i8*, i8** %40
%42 = call i32 @strcmp(i8* %41, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%43 = icmp ne i32 %42, 0
br i1 %43, label %50, label %44
44: ; preds = %38
%45 = load i32, i32* %7
%46 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%47 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %46, i64 0, i64 0
%48 = bitcast [1200 x double]* %47 to double**
%49 = call i32 @print_array(i32 %45, double** %48)
br label %50
50: ; preds = %44, %38, %2
%51 = load [1400 x [1200 x double]]*, [1400 x [1200 x double]]** %9
%52 = bitcast [1400 x [1200 x double]]* %51 to i8*
%53 = call i32 @free(i8* %52)
%54 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%55 = bitcast [1200 x [1200 x double]]* %54 to i8*
%56 = call i32 @free(i8* %55)
%57 = load [1200 x double]*, [1200 x double]** %11
%58 = bitcast [1200 x double]* %57 to i8*
%59 = call i32 @free(i8* %58)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = tail call i64 @polybench_alloc_data(i32 1680000, i32 8)
%6 = tail call i64 @polybench_alloc_data(i32 1440000, i32 8)
%7 = tail call i64 @polybench_alloc_data(i32 1200, i32 8)
%8 = inttoptr i64 %7 to [1200 x double]*
%9 = inttoptr i64 %5 to double**
%10 = call i32 @init_array(i32 1200, i32 1400, double* %3, double** %9)
%11 = load double, double* %3
%12 = inttoptr i64 %6 to double**
%13 = getelementptr inbounds [1200 x double], [1200 x double]* %8, i64 0, i64 0
%14 = call i32 @kernel_covariance(i32 1200, i32 1400, double %11, double** %9, double** %12, double* %13)
%15 = icmp sgt i32 %0, 42
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i8*, i8** %1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @print_array(i32 1200, double** %12)
br label %22
22: ; preds = %20, %16, %2
%23 = inttoptr i64 %5 to i8*
%24 = call i32 @free(i8* %23)
%25 = inttoptr i64 %6 to i8*
%26 = call i32 @free(i8* %25)
%27 = inttoptr i64 %7 to i8*
%28 = call i32 @free(i8* %27)
ret i32 0
}