#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 **);
int /*<<< orphan*/ kernel_syrk(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 = 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));
  ;
  init_array(n, m, &alpha, &beta, *C, *A);
  ;
  kernel_syrk(n, m, alpha, beta, *C, *A);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *C);
  free((void *)C);
  ;
  free((void *)A);
  ;
  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   $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    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1060 <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
call   1040 <kernel_syrk@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    1214 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe06(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1214 <main+0xb4>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1050 <print_array@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   %rbx
sub    $0x18,%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,%rbx
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    $0x4b0,%edi
mov    $0x3e8,%esi
mov    %r14,%r8
mov    %rax,%r9
call   1060 <init_array@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x4b0,%edi
mov    $0x3e8,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <kernel_syrk@plt>
cmp    $0x2b,%ebp
jl     11dd <main+0x8d>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    11dd <main+0x8d>
mov    $0x4b0,%edi
mov    %r14,%rsi
call   1050 <print_array@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
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]]*
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
%12 = call i64 @polybench_alloc_data(i32 1440000, i32 8)
%13 = inttoptr i64 %12 to [1200 x [1200 x double]]*
store [1200 x [1200 x double]]* %13, [1200 x [1200 x double]]** %10
%14 = call i64 @polybench_alloc_data(i32 1200000, i32 8)
%15 = inttoptr i64 %14 to [1200 x [1000 x double]]*
store [1200 x [1000 x double]]* %15, [1200 x [1000 x double]]** %11
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%19 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %18, i64 0, i64 0
%20 = bitcast [1200 x double]* %19 to double**
%21 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %11
%22 = getelementptr inbounds [1200 x [1000 x double]], [1200 x [1000 x double]]* %21, i64 0, i64 0
%23 = bitcast [1000 x double]* %22 to double**
%24 = call i32 @init_array(i32 %16, i32 %17, double* %8, double* %9, double** %20, double** %23)
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = load double, double* %8
%28 = load double, double* %9
%29 = load [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%30 = getelementptr inbounds [1200 x [1200 x double]], [1200 x [1200 x double]]* %29, i64 0, i64 0
%31 = bitcast [1200 x double]* %30 to double**
%32 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %11
%33 = getelementptr inbounds [1200 x [1000 x double]], [1200 x [1000 x double]]* %32, i64 0, i64 0
%34 = bitcast [1000 x double]* %33 to double**
%35 = call i32 @kernel_syrk(i32 %25, i32 %26, double %27, double %28, double** %31, 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* %6
%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 [1200 x [1200 x double]]*, [1200 x [1200 x double]]** %10
%52 = bitcast [1200 x [1200 x double]]* %51 to i8*
%53 = call i32 @free(i8* %52)
%54 = load [1200 x [1000 x double]]*, [1200 x [1000 x double]]** %11
%55 = bitcast [1200 x [1000 x double]]* %54 to i8*
%56 = call i32 @free(i8* %55)
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 = inttoptr i64 %7 to double**
%10 = inttoptr i64 %8 to double**
%11 = call i32 @init_array(i32 1200, i32 1000, double* %3, double* %4, double** %9, double** %10)
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @kernel_syrk(i32 1200, i32 1000, double %12, double %13, double** %9, double** %10)
%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** %9)
br label %22
22: ; preds = %20, %16, %2
%23 = inttoptr i64 %7 to i8*
%24 = call i32 @free(i8* %23)
%25 = inttoptr i64 %8 to i8*
%26 = call i32 @free(i8* %25)
ret i32 0
}