#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_symm(int, int, double, double, double **, double **,
                               double **);
scalar_t__ polybench_alloc_data(int, int);
int /*<<< orphan*/ print_array(int, int, double **);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int m = 1000;
  int n = 1200;
  double alpha;
  double beta;
  double(*C)[1000 + 0][1200 + 0];
  C = (double(*)[1000 + 0][1200 + 0])
      polybench_alloc_data((1000 + 0) * (1200 + 0), sizeof(double));
  ;
  double(*A)[1000 + 0][1000 + 0];
  A = (double(*)[1000 + 0][1000 + 0])
      polybench_alloc_data((1000 + 0) * (1000 + 0), sizeof(double));
  ;
  double(*B)[1000 + 0][1200 + 0];
  B = (double(*)[1000 + 0][1200 + 0])
      polybench_alloc_data((1000 + 0) * (1200 + 0), sizeof(double));
  ;
  init_array(m, n, &alpha, &beta, *C, *A, *B);
  ;
  kernel_symm(m, n, alpha, beta, *C, *A, *B);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(m, 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   $0x3e8,-0x14(%rbp)
movl   $0x4b0,-0x18(%rbp)
mov    $0x124f80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x30(%rbp)
mov    $0xf4240,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x38(%rbp)
mov    $0x124f80,%edi
mov    $0x8,%esi
call   1070 <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   1080 <kernel_symm@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    1236 <main+0xd6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xde7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1236 <main+0xd6>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x30(%rbp),%rdx
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    $0x124f80,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r12
mov    $0xf4240,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0x124f80,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    %rax,(%rsp)
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x3e8,%edi
mov    $0x4b0,%esi
mov    %r12,%r8
mov    %r14,%r9
call   1050 <init_array@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x3e8,%edi
mov    $0x4b0,%esi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
call   1070 <kernel_symm@plt>
cmp    $0x2b,%ebp
jl     11fd <main+0xad>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    11fd <main+0xad>
mov    $0x3e8,%edi
mov    $0x4b0,%esi
mov    %r12,%rdx
call   1040 <print_array@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r14,%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 [1000 x [1200 x double]]*
%11 = alloca [1000 x [1000 x double]]*
%12 = alloca [1000 x [1200 x double]]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %6
store i32 1200, i32* %7
%13 = call i64 @polybench_alloc_data(i32 1200000, i32 8)
%14 = inttoptr i64 %13 to [1000 x [1200 x double]]*
store [1000 x [1200 x double]]* %14, [1000 x [1200 x double]]** %10
%15 = call i64 @polybench_alloc_data(i32 1000000, i32 8)
%16 = inttoptr i64 %15 to [1000 x [1000 x double]]*
store [1000 x [1000 x double]]* %16, [1000 x [1000 x double]]** %11
%17 = call i64 @polybench_alloc_data(i32 1200000, i32 8)
%18 = inttoptr i64 %17 to [1000 x [1200 x double]]*
store [1000 x [1200 x double]]* %18, [1000 x [1200 x double]]** %12
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %10
%22 = getelementptr inbounds [1000 x [1200 x double]], [1000 x [1200 x double]]* %21, i64 0, i64 0
%23 = bitcast [1200 x double]* %22 to double**
%24 = load [1000 x [1000 x double]]*, [1000 x [1000 x double]]** %11
%25 = getelementptr inbounds [1000 x [1000 x double]], [1000 x [1000 x double]]* %24, i64 0, i64 0
%26 = bitcast [1000 x double]* %25 to double**
%27 = load [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %12
%28 = getelementptr inbounds [1000 x [1200 x double]], [1000 x [1200 x double]]* %27, i64 0, i64 0
%29 = bitcast [1200 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 [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %10
%36 = getelementptr inbounds [1000 x [1200 x double]], [1000 x [1200 x double]]* %35, i64 0, i64 0
%37 = bitcast [1200 x double]* %36 to double**
%38 = load [1000 x [1000 x double]]*, [1000 x [1000 x double]]** %11
%39 = getelementptr inbounds [1000 x [1000 x double]], [1000 x [1000 x double]]* %38, i64 0, i64 0
%40 = bitcast [1000 x double]* %39 to double**
%41 = load [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %12
%42 = getelementptr inbounds [1000 x [1200 x double]], [1000 x [1200 x double]]* %41, i64 0, i64 0
%43 = bitcast [1200 x double]* %42 to double**
%44 = call i32 @kernel_symm(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 %60
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 %60, label %53
53: ; preds = %47
%54 = load i32, i32* %6
%55 = load i32, i32* %7
%56 = load [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %10
%57 = getelementptr inbounds [1000 x [1200 x double]], [1000 x [1200 x double]]* %56, i64 0, i64 0
%58 = bitcast [1200 x double]* %57 to double**
%59 = call i32 @print_array(i32 %54, i32 %55, double** %58)
br label %60
60: ; preds = %53, %47, %2
%61 = load [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %10
%62 = bitcast [1000 x [1200 x double]]* %61 to i8*
%63 = call i32 @free(i8* %62)
%64 = load [1000 x [1000 x double]]*, [1000 x [1000 x double]]** %11
%65 = bitcast [1000 x [1000 x double]]* %64 to i8*
%66 = call i32 @free(i8* %65)
%67 = load [1000 x [1200 x double]]*, [1000 x [1200 x double]]** %12
%68 = bitcast [1000 x [1200 x double]]* %67 to i8*
%69 = call i32 @free(i8* %68)
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 1200000, i32 8)
%8 = tail call i64 @polybench_alloc_data(i32 1000000, 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 1000, i32 1200, double* %3, double* %4, double** %10, double** %11, double** %12)
%14 = load double, double* %3
%15 = load double, double* %4
%16 = call i32 @kernel_symm(i32 1000, i32 1200, 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 1000, 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
}