#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, int, int, double *, double *, double **,
                              double **, double **, double **);
int /*<<< orphan*/ kernel_2mm(int, int, int, int, double, double, 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 ni = 800;
  int nj = 900;
  int nk = 1100;
  int nl = 1200;
  double alpha;
  double beta;
  double(*tmp)[800 + 0][900 + 0];
  tmp = (double(*)[800 + 0][900 + 0])
      polybench_alloc_data((800 + 0) * (900 + 0), sizeof(double));
  ;
  double(*A)[800 + 0][1100 + 0];
  A = (double(*)[800 + 0][1100 + 0])
      polybench_alloc_data((800 + 0) * (1100 + 0), sizeof(double));
  ;
  double(*B)[1100 + 0][900 + 0];
  B = (double(*)[1100 + 0][900 + 0])
      polybench_alloc_data((1100 + 0) * (900 + 0), sizeof(double));
  ;
  double(*C)[900 + 0][1200 + 0];
  C = (double(*)[900 + 0][1200 + 0])
      polybench_alloc_data((900 + 0) * (1200 + 0), sizeof(double));
  ;
  double(*D)[800 + 0][1200 + 0];
  D = (double(*)[800 + 0][1200 + 0])
      polybench_alloc_data((800 + 0) * (1200 + 0), sizeof(double));
  ;
  init_array(ni, nj, nk, nl, &alpha, &beta, *A, *B, *C, *D);
  ;
  kernel_2mm(ni, nj, nk, nl, alpha, beta, *tmp, *A, *B, *C, *D);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(ni, nl, *D);
  free((void *)tmp);
  ;
  free((void *)A);
  ;
  free((void *)B);
  ;
  free((void *)C);
  ;
  free((void *)D);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x78,%rsp
movl   $0x0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x320,-0x1c(%rbp)
movl   $0x384,-0x20(%rbp)
movl   $0x44c,-0x24(%rbp)
movl   $0x4b0,-0x28(%rbp)
mov    $0xafc80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x40(%rbp)
mov    $0xd6d80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x48(%rbp)
mov    $0xf1b30,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x50(%rbp)
mov    $0x107ac0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x58(%rbp)
mov    $0xea600,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,-0x60(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x48(%rbp),%rbx
mov    -0x50(%rbp),%r11
mov    -0x58(%rbp),%r10
mov    -0x60(%rbp),%rax
lea    -0x30(%rbp),%r8
lea    -0x38(%rbp),%r9
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <init_array@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x50(%rbp),%r11
mov    -0x58(%rbp),%r10
mov    -0x60(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1080 <kernel_2mm@plt>
cmpl   $0x2a,-0x10(%rbp)
jle    12a0 <main+0x140>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd7d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12a0 <main+0x140>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x60(%rbp),%rdx
call   1040 <print_array@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,(%rsp)
mov    %edi,%r13d
mov    $0xafc80,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0xd6d80,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r12
mov    $0xf1b30,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    $0x107ac0,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%rbp
mov    $0xea600,%edi
mov    $0x8,%esi
call   1060 <polybench_alloc_data@plt>
mov    %rax,%r15
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
mov    $0x320,%edi
mov    $0x384,%esi
mov    $0x44c,%edx
mov    $0x4b0,%ecx
push   %rax
push   %rbp
push   %rbx
push   %r12
call   1050 <init_array@plt>
add    $0x20,%rsp
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
sub    $0x8,%rsp
mov    $0x320,%edi
mov    $0x384,%esi
mov    $0x44c,%edx
mov    $0x4b0,%ecx
mov    %r14,%r8
mov    %r12,%r9
push   %r15
push   %rbp
push   %rbx
call   1070 <kernel_2mm@plt>
add    $0x20,%rsp
cmp    $0x2b,%r13d
jl     1246 <main+0xf6>
mov    (%rsp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
jne    1246 <main+0xf6>
mov    $0x320,%edi
mov    $0x4b0,%esi
mov    %r15,%rdx
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>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
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 i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca [800 x [900 x double]]*
%13 = alloca [800 x [1100 x double]]*
%14 = alloca [1100 x [900 x double]]*
%15 = alloca [900 x [1200 x double]]*
%16 = alloca [800 x [1200 x double]]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 800, i32* %6
store i32 900, i32* %7
store i32 1100, i32* %8
store i32 1200, i32* %9
%17 = call i64 @polybench_alloc_data(i32 720000, i32 8)
%18 = inttoptr i64 %17 to [800 x [900 x double]]*
store [800 x [900 x double]]* %18, [800 x [900 x double]]** %12
%19 = call i64 @polybench_alloc_data(i32 880000, i32 8)
%20 = inttoptr i64 %19 to [800 x [1100 x double]]*
store [800 x [1100 x double]]* %20, [800 x [1100 x double]]** %13
%21 = call i64 @polybench_alloc_data(i32 990000, i32 8)
%22 = inttoptr i64 %21 to [1100 x [900 x double]]*
store [1100 x [900 x double]]* %22, [1100 x [900 x double]]** %14
%23 = call i64 @polybench_alloc_data(i32 1080000, i32 8)
%24 = inttoptr i64 %23 to [900 x [1200 x double]]*
store [900 x [1200 x double]]* %24, [900 x [1200 x double]]** %15
%25 = call i64 @polybench_alloc_data(i32 960000, i32 8)
%26 = inttoptr i64 %25 to [800 x [1200 x double]]*
store [800 x [1200 x double]]* %26, [800 x [1200 x double]]** %16
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = load [800 x [1100 x double]]*, [800 x [1100 x double]]** %13
%32 = getelementptr inbounds [800 x [1100 x double]], [800 x [1100 x double]]* %31, i64 0, i64 0
%33 = bitcast [1100 x double]* %32 to double**
%34 = load [1100 x [900 x double]]*, [1100 x [900 x double]]** %14
%35 = getelementptr inbounds [1100 x [900 x double]], [1100 x [900 x double]]* %34, i64 0, i64 0
%36 = bitcast [900 x double]* %35 to double**
%37 = load [900 x [1200 x double]]*, [900 x [1200 x double]]** %15
%38 = getelementptr inbounds [900 x [1200 x double]], [900 x [1200 x double]]* %37, i64 0, i64 0
%39 = bitcast [1200 x double]* %38 to double**
%40 = load [800 x [1200 x double]]*, [800 x [1200 x double]]** %16
%41 = getelementptr inbounds [800 x [1200 x double]], [800 x [1200 x double]]* %40, i64 0, i64 0
%42 = bitcast [1200 x double]* %41 to double**
%43 = call i32 @init_array(i32 %27, i32 %28, i32 %29, i32 %30, double* %10, double* %11, double** %33, double** %36, double** %39, double** %42)
%44 = load i32, i32* %6
%45 = load i32, i32* %7
%46 = load i32, i32* %8
%47 = load i32, i32* %9
%48 = load double, double* %10
%49 = load double, double* %11
%50 = load [800 x [900 x double]]*, [800 x [900 x double]]** %12
%51 = getelementptr inbounds [800 x [900 x double]], [800 x [900 x double]]* %50, i64 0, i64 0
%52 = bitcast [900 x double]* %51 to double**
%53 = load [800 x [1100 x double]]*, [800 x [1100 x double]]** %13
%54 = getelementptr inbounds [800 x [1100 x double]], [800 x [1100 x double]]* %53, i64 0, i64 0
%55 = bitcast [1100 x double]* %54 to double**
%56 = load [1100 x [900 x double]]*, [1100 x [900 x double]]** %14
%57 = getelementptr inbounds [1100 x [900 x double]], [1100 x [900 x double]]* %56, i64 0, i64 0
%58 = bitcast [900 x double]* %57 to double**
%59 = load [900 x [1200 x double]]*, [900 x [1200 x double]]** %15
%60 = getelementptr inbounds [900 x [1200 x double]], [900 x [1200 x double]]* %59, i64 0, i64 0
%61 = bitcast [1200 x double]* %60 to double**
%62 = load [800 x [1200 x double]]*, [800 x [1200 x double]]** %16
%63 = getelementptr inbounds [800 x [1200 x double]], [800 x [1200 x double]]* %62, i64 0, i64 0
%64 = bitcast [1200 x double]* %63 to double**
%65 = call i32 @kernel_2mm(i32 %44, i32 %45, i32 %46, i32 %47, double %48, double %49, double** %52, double** %55, double** %58, double** %61, double** %64)
%66 = load i32, i32* %4
%67 = icmp sgt i32 %66, 42
br i1 %67, label %68, label %81
68: ; preds = %2
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 0
%71 = load i8*, i8** %70
%72 = call i32 @strcmp(i8* %71, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%73 = icmp ne i32 %72, 0
br i1 %73, label %81, label %74
74: ; preds = %68
%75 = load i32, i32* %6
%76 = load i32, i32* %9
%77 = load [800 x [1200 x double]]*, [800 x [1200 x double]]** %16
%78 = getelementptr inbounds [800 x [1200 x double]], [800 x [1200 x double]]* %77, i64 0, i64 0
%79 = bitcast [1200 x double]* %78 to double**
%80 = call i32 @print_array(i32 %75, i32 %76, double** %79)
br label %81
81: ; preds = %74, %68, %2
%82 = load [800 x [900 x double]]*, [800 x [900 x double]]** %12
%83 = bitcast [800 x [900 x double]]* %82 to i8*
%84 = call i32 @free(i8* %83)
%85 = load [800 x [1100 x double]]*, [800 x [1100 x double]]** %13
%86 = bitcast [800 x [1100 x double]]* %85 to i8*
%87 = call i32 @free(i8* %86)
%88 = load [1100 x [900 x double]]*, [1100 x [900 x double]]** %14
%89 = bitcast [1100 x [900 x double]]* %88 to i8*
%90 = call i32 @free(i8* %89)
%91 = load [900 x [1200 x double]]*, [900 x [1200 x double]]** %15
%92 = bitcast [900 x [1200 x double]]* %91 to i8*
%93 = call i32 @free(i8* %92)
%94 = load [800 x [1200 x double]]*, [800 x [1200 x double]]** %16
%95 = bitcast [800 x [1200 x double]]* %94 to i8*
%96 = call i32 @free(i8* %95)
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 720000, i32 8)
%8 = tail call i64 @polybench_alloc_data(i32 880000, i32 8)
%9 = tail call i64 @polybench_alloc_data(i32 990000, i32 8)
%10 = tail call i64 @polybench_alloc_data(i32 1080000, i32 8)
%11 = tail call i64 @polybench_alloc_data(i32 960000, i32 8)
%12 = inttoptr i64 %8 to double**
%13 = inttoptr i64 %9 to double**
%14 = inttoptr i64 %10 to double**
%15 = inttoptr i64 %11 to double**
%16 = call i32 @init_array(i32 800, i32 900, i32 1100, i32 1200, double* %3, double* %4, double** %12, double** %13, double** %14, double** %15)
%17 = load double, double* %3
%18 = load double, double* %4
%19 = inttoptr i64 %7 to double**
%20 = call i32 @kernel_2mm(i32 800, i32 900, i32 1100, i32 1200, double %17, double %18, double** %19, double** %12, double** %13, double** %14, double** %15)
%21 = icmp sgt i32 %0, 42
br i1 %21, label %22, label %28
22: ; preds = %2
%23 = load i8*, i8** %1
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @print_array(i32 800, i32 1200, double** %15)
br label %28
28: ; preds = %26, %22, %2
%29 = inttoptr i64 %7 to i8*
%30 = call i32 @free(i8* %29)
%31 = inttoptr i64 %8 to i8*
%32 = call i32 @free(i8* %31)
%33 = inttoptr i64 %9 to i8*
%34 = call i32 @free(i8* %33)
%35 = inttoptr i64 %10 to i8*
%36 = call i32 @free(i8* %35)
%37 = inttoptr i64 %11 to i8*
%38 = call i32 @free(i8* %37)
ret i32 0
}