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


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
mov    $0x15f900,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0x124f80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r12
mov    $0x124f80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    %rax,(%rsp)
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x4b0,%edi
mov    $0x3e8,%esi
mov    %r14,%r8
mov    %r12,%r9
call   1050 <init_array@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x4b0,%edi
mov    $0x3e8,%esi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1060 <kernel_syr2k@plt>
cmp    $0x2b,%ebp
jl     11f8 <main+0xa8>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    11f8 <main+0xa8>
mov    $0x4b0,%edi
mov    %r14,%rsi
call   1040 <print_array@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%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 double
%10 = alloca [1200 x [1200 x double]]*
%11 = alloca [1200 x [1000 x double]]*
%12 = alloca [1200 x [1000 x double]]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1200, i32* %6
store i32 1000, i32* %7
%13 = call i64 @polybench_alloc_data(i32 1440000, i32 8)
%14 = inttoptr i64 %13 to [1200 x [1200 x double]]*
store [1200 x [1200 x double]]* %14, [1200 x [1200 x double]]** %10
%15 = call i64 @polybench_alloc_data(i32 1200000, i32 8)
%16 = inttoptr i64 %15 to [1200 x [1000 x double]]*
store [1200 x [1000 x double]]* %16, [1200 x [1000 x double]]** %11
%17 = call i64 @polybench_alloc_data(i32 1200000, i32 8)
%18 = inttoptr i64 %17 to [1200 x [1000 x double]]*
store [1200 x [1000 x double]]* %18, [1200 x [1000 x double]]** %12
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%22 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %21, i64 0, i64 0
%23 = bitcast [1200 x double]* %22 to double**
%24 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %11
%25 = getelementptr inbounds [1200 x [1000 x double]], [1200 x [1000 x double]]* %24, i64 0, i64 0
%26 = bitcast [1000 x double]* %25 to double**
%27 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %12
%28 = getelementptr inbounds [1200 x [1000 x double]], [1200 x [1000 x double]]* %27, i64 0, i64 0
%29 = bitcast [1000 x double]* %28 to double**
%30 = call i32 @init_array(i32 %19, i32 %20, double* %8, double* %9, double** %23, double** %26, double** %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = load double, double* %8
%34 = load double, double* %9
%35 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%36 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %35, i64 0, i64 0
%37 = bitcast [1200 x double]* %36 to double**
%38 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %11
%39 = getelementptr inbounds [1200 x [1000 x double]], [1200 x [1000 x double]]* %38, i64 0, i64 0
%40 = bitcast [1000 x double]* %39 to double**
%41 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %12
%42 = getelementptr inbounds [1200 x [1000 x double]], [1200 x [1000 x double]]* %41, i64 0, i64 0
%43 = bitcast [1000 x double]* %42 to double**
%44 = call i32 @kernel_syr2k(i32 %31, i32 %32, double %33, double %34, double** %37, double** %40, double** %43)
%45 = load i32, i32* %4
%46 = icmp sgt i32 %45, 42
br i1 %46, label %47, label %59
47: ; preds = %2
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i32 @strcmp(i8* %50, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%52 = icmp ne i32 %51, 0
br i1 %52, label %59, label %53
53: ; preds = %47
%54 = load i32, i32* %6
%55 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%56 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %55, i64 0, i64 0
%57 = bitcast [1200 x double]* %56 to double**
%58 = call i32 @print_array(i32 %54, double** %57)
br label %59
59: ; preds = %53, %47, %2
%60 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%61 = bitcast [1200 x [1200 x double]]* %60 to i8*
%62 = call i32 @free(i8* %61)
%63 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %11
%64 = bitcast [1200 x [1000 x double]]* %63 to i8*
%65 = call i32 @free(i8* %64)
%66 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %12
%67 = bitcast [1200 x [1000 x double]]* %66 to i8*
%68 = call i32 @free(i8* %67)
ret i32 0
}

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