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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
movl   $0x0,-0x1c(%rbp)
mov    %edi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movl   $0x320,-0x2c(%rbp)
movl   $0x384,-0x30(%rbp)
movl   $0x3e8,-0x34(%rbp)
movl   $0x44c,-0x38(%rbp)
movl   $0x4b0,-0x3c(%rbp)
mov    $0xafc80,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x48(%rbp)
mov    $0xc3500,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x50(%rbp)
mov    $0xdbba0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x58(%rbp)
mov    $0xf1b30,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x60(%rbp)
mov    $0x107ac0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x68(%rbp)
mov    $0x142440,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x70(%rbp)
mov    $0xd6d80,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x78(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
mov    -0x50(%rbp),%r9
mov    -0x58(%rbp),%r11
mov    -0x68(%rbp),%r10
mov    -0x70(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1050 <init_array@plt>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x3c(%rbp),%r8d
mov    -0x48(%rbp),%r9
mov    -0x50(%rbp),%r15
mov    -0x58(%rbp),%r14
mov    -0x60(%rbp),%rbx
mov    -0x68(%rbp),%r11
mov    -0x70(%rbp),%r10
mov    -0x78(%rbp),%rax
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1060 <kernel_3mm@plt>
cmpl   $0x2a,-0x20(%rbp)
jle    12dc <main+0x17c>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xd41(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12dc <main+0x17c>
mov    -0x2c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    -0x78(%rbp),%rdx
call   1040 <print_array@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>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,0x18(%rsp)
mov    %edi,0xc(%rsp)
mov    $0xafc80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    $0xc3500,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0xdbba0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,0x20(%rsp)
mov    $0xf1b30,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,0x28(%rsp)
mov    $0x107ac0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r15
mov    $0x142440,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r13
mov    $0xd6d80,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r12
sub    $0x8,%rsp
mov    $0x320,%edi
mov    $0x384,%esi
mov    $0x3e8,%edx
mov    $0x44c,%ecx
mov    $0x4b0,%r8d
mov    %r14,%r9
push   %r13
push   %r15
mov    0x38(%rsp),%rbp
push   %rbp
call   1050 <init_array@plt>
add    $0x20,%rsp
mov    $0x320,%edi
mov    $0x384,%esi
mov    $0x3e8,%edx
mov    $0x44c,%ecx
mov    $0x4b0,%r8d
mov    %rbx,0x30(%rsp)
mov    %rbx,%r9
mov    0x28(%rsp),%rbx
mov    %r12,0x10(%rsp)
push   %r12
push   %r13
push   %r15
push   %rbx
push   %rbp
push   %r14
call   1060 <kernel_3mm@plt>
add    $0x30,%rsp
cmpl   $0x2b,0xc(%rsp)
jl     1284 <main+0x134>
mov    0x18(%rsp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
jne    1284 <main+0x134>
mov    $0x320,%edi
mov    $0x44c,%esi
mov    0x10(%rsp),%rdx
call   1040 <print_array@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x38,%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 i32
%11 = alloca [800 x [900 x double]]*
%12 = alloca [800 x [1000 x double]]*
%13 = alloca [1000 x [900 x double]]*
%14 = alloca [900 x [1100 x double]]*
%15 = alloca [900 x [1200 x double]]*
%16 = alloca [1200 x [1100 x double]]*
%17 = alloca [800 x [1100 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 1000, i32* %8
store i32 1100, i32* %9
store i32 1200, i32* %10
%18 = call i64 @polybench_alloc_data(i32 720000, i32 8)
%19 = inttoptr i64 %18 to [800 x [900 x double]]*
store [800 x [900 x double]]* %19, [800 x [900 x double]]** %11
%20 = call i64 @polybench_alloc_data(i32 800000, i32 8)
%21 = inttoptr i64 %20 to [800 x [1000 x double]]*
store [800 x [1000 x double]]* %21, [800 x [1000 x double]]** %12
%22 = call i64 @polybench_alloc_data(i32 900000, i32 8)
%23 = inttoptr i64 %22 to [1000 x [900 x double]]*
store [1000 x [900 x double]]* %23, [1000 x [900 x double]]** %13
%24 = call i64 @polybench_alloc_data(i32 990000, i32 8)
%25 = inttoptr i64 %24 to [900 x [1100 x double]]*
store [900 x [1100 x double]]* %25, [900 x [1100 x double]]** %14
%26 = call i64 @polybench_alloc_data(i32 1080000, i32 8)
%27 = inttoptr i64 %26 to [900 x [1200 x double]]*
store [900 x [1200 x double]]* %27, [900 x [1200 x double]]** %15
%28 = call i64 @polybench_alloc_data(i32 1320000, i32 8)
%29 = inttoptr i64 %28 to [1200 x [1100 x double]]*
store [1200 x [1100 x double]]* %29, [1200 x [1100 x double]]** %16
%30 = call i64 @polybench_alloc_data(i32 880000, i32 8)
%31 = inttoptr i64 %30 to [800 x [1100 x double]]*
store [800 x [1100 x double]]* %31, [800 x [1100 x double]]** %17
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = load i32, i32* %9
%36 = load i32, i32* %10
%37 = load [800 x [1000 x double]]*, [800 x [1000 x double]]** %12
%38 = getelementptr inbounds [800 x [1000 x double]], [800 x [1000 x double]]* %37, i64 0, i64 0
%39 = bitcast [1000 x double]* %38 to double**
%40 = load [1000 x [900 x double]]*, [1000 x [900 x double]]** %13
%41 = getelementptr inbounds [1000 x [900 x double]], [1000 x [900 x double]]* %40, i64 0, i64 0
%42 = bitcast [900 x double]* %41 to double**
%43 = load [900 x [1200 x double]]*, [900 x [1200 x double]]** %15
%44 = getelementptr inbounds [900 x [1200 x double]], [900 x [1200 x double]]* %43, i64 0, i64 0
%45 = bitcast [1200 x double]* %44 to double**
%46 = load [1200 x [1100 x double]]*, [1200 x [1100 x double]]** %16
%47 = getelementptr inbounds [1200 x [1100 x double]], [1200 x [1100 x double]]* %46, i64 0, i64 0
%48 = bitcast [1100 x double]* %47 to double**
%49 = call i32 @init_array(i32 %32, i32 %33, i32 %34, i32 %35, i32 %36, double** %39, double** %42, double** %45, double** %48)
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = load i32, i32* %10
%55 = load [800 x [900 x double]]*, [800 x [900 x double]]** %11
%56 = getelementptr inbounds [800 x [900 x double]], [800 x [900 x double]]* %55, i64 0, i64 0
%57 = bitcast [900 x double]* %56 to double**
%58 = load [800 x [1000 x double]]*, [800 x [1000 x double]]** %12
%59 = getelementptr inbounds [800 x [1000 x double]], [800 x [1000 x double]]* %58, i64 0, i64 0
%60 = bitcast [1000 x double]* %59 to double**
%61 = load [1000 x [900 x double]]*, [1000 x [900 x double]]** %13
%62 = getelementptr inbounds [1000 x [900 x double]], [1000 x [900 x double]]* %61, i64 0, i64 0
%63 = bitcast [900 x double]* %62 to double**
%64 = load [900 x [1100 x double]]*, [900 x [1100 x double]]** %14
%65 = getelementptr inbounds [900 x [1100 x double]], [900 x [1100 x double]]* %64, i64 0, i64 0
%66 = bitcast [1100 x double]* %65 to double**
%67 = load [900 x [1200 x double]]*, [900 x [1200 x double]]** %15
%68 = getelementptr inbounds [900 x [1200 x double]], [900 x [1200 x double]]* %67, i64 0, i64 0
%69 = bitcast [1200 x double]* %68 to double**
%70 = load [1200 x [1100 x double]]*, [1200 x [1100 x double]]** %16
%71 = getelementptr inbounds [1200 x [1100 x double]], [1200 x [1100 x double]]* %70, i64 0, i64 0
%72 = bitcast [1100 x double]* %71 to double**
%73 = load [800 x [1100 x double]]*, [800 x [1100 x double]]** %17
%74 = getelementptr inbounds [800 x [1100 x double]], [800 x [1100 x double]]* %73, i64 0, i64 0
%75 = bitcast [1100 x double]* %74 to double**
%76 = call i32 @kernel_3mm(i32 %50, i32 %51, i32 %52, i32 %53, i32 %54, double** %57, double** %60, double** %63, double** %66, double** %69, double** %72, double** %75)
%77 = load i32, i32* %4
%78 = icmp sgt i32 %77, 42
br i1 %78, label %79, label %92
79: ; preds = %2
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = call i32 @strcmp(i8* %82, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%84 = icmp ne i32 %83, 0
br i1 %84, label %92, label %85
85: ; preds = %79
%86 = load i32, i32* %6
%87 = load i32, i32* %9
%88 = load [800 x [1100 x double]]*, [800 x [1100 x double]]** %17
%89 = getelementptr inbounds [800 x [1100 x double]], [800 x [1100 x double]]* %88, i64 0, i64 0
%90 = bitcast [1100 x double]* %89 to double**
%91 = call i32 @print_array(i32 %86, i32 %87, double** %90)
br label %92
92: ; preds = %85, %79, %2
%93 = load [800 x [900 x double]]*, [800 x [900 x double]]** %11
%94 = bitcast [800 x [900 x double]]* %93 to i8*
%95 = call i32 @free(i8* %94)
%96 = load [800 x [1000 x double]]*, [800 x [1000 x double]]** %12
%97 = bitcast [800 x [1000 x double]]* %96 to i8*
%98 = call i32 @free(i8* %97)
%99 = load [1000 x [900 x double]]*, [1000 x [900 x double]]** %13
%100 = bitcast [1000 x [900 x double]]* %99 to i8*
%101 = call i32 @free(i8* %100)
%102 = load [900 x [1100 x double]]*, [900 x [1100 x double]]** %14
%103 = bitcast [900 x [1100 x double]]* %102 to i8*
%104 = call i32 @free(i8* %103)
%105 = load [900 x [1200 x double]]*, [900 x [1200 x double]]** %15
%106 = bitcast [900 x [1200 x double]]* %105 to i8*
%107 = call i32 @free(i8* %106)
%108 = load [1200 x [1100 x double]]*, [1200 x [1100 x double]]** %16
%109 = bitcast [1200 x [1100 x double]]* %108 to i8*
%110 = call i32 @free(i8* %109)
%111 = load [800 x [1100 x double]]*, [800 x [1100 x double]]** %17
%112 = bitcast [800 x [1100 x double]]* %111 to i8*
%113 = call i32 @free(i8* %112)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @polybench_alloc_data(i32 720000, i32 8)
%4 = tail call i64 @polybench_alloc_data(i32 800000, i32 8)
%5 = tail call i64 @polybench_alloc_data(i32 900000, i32 8)
%6 = tail call i64 @polybench_alloc_data(i32 990000, i32 8)
%7 = tail call i64 @polybench_alloc_data(i32 1080000, i32 8)
%8 = tail call i64 @polybench_alloc_data(i32 1320000, i32 8)
%9 = tail call i64 @polybench_alloc_data(i32 880000, i32 8)
%10 = inttoptr i64 %4 to double**
%11 = inttoptr i64 %5 to double**
%12 = inttoptr i64 %7 to double**
%13 = inttoptr i64 %8 to double**
%14 = tail call i32 @init_array(i32 800, i32 900, i32 1000, i32 1100, i32 1200, double** %10, double** %11, double** %12, double** %13)
%15 = inttoptr i64 %3 to double**
%16 = inttoptr i64 %6 to double**
%17 = inttoptr i64 %9 to double**
%18 = tail call i32 @kernel_3mm(i32 800, i32 900, i32 1000, i32 1100, i32 1200, double** %15, double** %10, double** %11, double** %16, double** %12, double** %13, double** %17)
%19 = icmp sgt i32 %0, 42
br i1 %19, label %20, label %26
20: ; preds = %2
%21 = load i8*, i8** %1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = tail call i32 @print_array(i32 800, i32 1100, double** %17)
br label %26
26: ; preds = %24, %20, %2
%27 = inttoptr i64 %3 to i8*
%28 = tail call i32 @free(i8* %27)
%29 = inttoptr i64 %4 to i8*
%30 = tail call i32 @free(i8* %29)
%31 = inttoptr i64 %5 to i8*
%32 = tail call i32 @free(i8* %31)
%33 = inttoptr i64 %6 to i8*
%34 = tail call i32 @free(i8* %33)
%35 = inttoptr i64 %7 to i8*
%36 = tail call i32 @free(i8* %35)
%37 = inttoptr i64 %8 to i8*
%38 = tail call i32 @free(i8* %37)
%39 = inttoptr i64 %9 to i8*
%40 = tail call i32 @free(i8* %39)
ret i32 0
}