#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, double **);
int /*<<< orphan*/ kernel_cholesky(int, 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 = 2000;
  double(*A)[2000 + 0][2000 + 0];
  A = (double(*)[2000 + 0][2000 + 0])
      polybench_alloc_data((2000 + 0) * (2000 + 0), sizeof(double));
  ;
  init_array(n, *A);
  ;
  kernel_cholesky(n, *A);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *A);
  free((void *)A);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7d0,-0x14(%rbp)
mov    $0x3d0900,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1060 <init_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <kernel_cholesky@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    11da <main+0x7a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe40(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    11da <main+0x7a>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x3d0900,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    $0x7d0,%edi
mov    %rax,%rsi
call   1060 <init_array@plt>
mov    $0x7d0,%edi
mov    %rbx,%rsi
call   1050 <kernel_cholesky@plt>
cmp    $0x2b,%ebp
jl     119f <main+0x4f>
mov    (%r14),%rax
cmpb   $0x0,(%rax)
jne    119f <main+0x4f>
mov    $0x7d0,%edi
mov    %rbx,%rsi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
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 [2000 x [2000 x double]]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2000, i32* %6
%8 = call i64 @polybench_alloc_data(i32 4000000, i32 8)
%9 = inttoptr i64 %8 to [2000 x [2000 x double]]*
store [2000 x [2000 x double]]* %9, [2000 x [2000 x double]]** %7
%10 = load i32, i32* %6
%11 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %7
%12 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %11, i64 0, i64 0
%13 = bitcast [2000 x double]* %12 to double**
%14 = call i32 @init_array(i32 %10, double** %13)
%15 = load i32, i32* %6
%16 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %7
%17 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %16, i64 0, i64 0
%18 = bitcast [2000 x double]* %17 to double**
%19 = call i32 @kernel_cholesky(i32 %15, double** %18)
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 42
br i1 %21, label %22, label %34
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %22
%29 = load i32, i32* %6
%30 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %7
%31 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %30, i64 0, i64 0
%32 = bitcast [2000 x double]* %31 to double**
%33 = call i32 @print_array(i32 %29, double** %32)
br label %34
34: ; preds = %28, %22, %2
%35 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %7
%36 = bitcast [2000 x [2000 x double]]* %35 to i8*
%37 = call i32 @free(i8* %36)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @polybench_alloc_data(i32 4000000, i32 8)
%4 = inttoptr i64 %3 to double**
%5 = tail call i32 @init_array(i32 2000, double** %4)
%6 = tail call i32 @kernel_cholesky(i32 2000, double** %4)
%7 = icmp sgt i32 %0, 42
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 @print_array(i32 2000, double** %4)
br label %14
14: ; preds = %12, %8, %2
%15 = inttoptr i64 %3 to i8*
%16 = tail call i32 @free(i8* %15)
ret i32 0
}