#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, double *, double *, double **, double **,
                              double *);
int /*<<< orphan*/ kernel_gesummv(int, double, double, 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 = 1300;
  double alpha;
  double beta;
  double(*A)[1300 + 0][1300 + 0];
  A = (double(*)[1300 + 0][1300 + 0])
      polybench_alloc_data((1300 + 0) * (1300 + 0), sizeof(double));
  ;
  double(*B)[1300 + 0][1300 + 0];
  B = (double(*)[1300 + 0][1300 + 0])
      polybench_alloc_data((1300 + 0) * (1300 + 0), sizeof(double));
  ;
  double(*tmp)[1300 + 0];
  tmp = (double(*)[1300 + 0]) polybench_alloc_data(1300 + 0, sizeof(double));
  ;
  double(*x)[1300 + 0];
  x = (double(*)[1300 + 0]) polybench_alloc_data(1300 + 0, sizeof(double));
  ;
  double(*y)[1300 + 0];
  y = (double(*)[1300 + 0]) polybench_alloc_data(1300 + 0, sizeof(double));
  ;
  init_array(n, &alpha, &beta, *A, *B, *x);
  ;
  kernel_gesummv(n, alpha, beta, *A, *B, *tmp, *x, *y);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *y);
  free((void *)A);
  ;
  free((void *)B);
  ;
  free((void *)tmp);
  ;
  free((void *)x);
  ;
  free((void *)y);
  ;
  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   $0x514,-0x14(%rbp)
mov    $0x19c990,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x30(%rbp)
mov    $0x19c990,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x38(%rbp)
mov    $0x514,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x40(%rbp)
mov    $0x514,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x48(%rbp)
mov    $0x514,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1060 <init_array@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
call   1040 <kernel_gesummv@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    1250 <main+0xf0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdca(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1250 <main+0xf0>
mov    -0x14(%rbp),%edi
mov    -0x50(%rbp),%rsi
call   1050 <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>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%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   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,(%rsp)
mov    %edi,%r13d
mov    $0x19c990,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0x19c990,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    $0x514,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r12
mov    $0x514,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbp
mov    $0x514,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r15
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x514,%edi
mov    %r14,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
call   1060 <init_array@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x514,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    %r15,%r9
call   1040 <kernel_gesummv@plt>
cmp    $0x2b,%r13d
jl     1220 <main+0xd0>
mov    (%rsp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
jne    1220 <main+0xd0>
mov    $0x514,%edi
mov    %r15,%rsi
call   1050 <print_array@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%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 double
%8 = alloca double
%9 = alloca [1300 x [1300 x double]]*
%10 = alloca [1300 x [1300 x double]]*
%11 = alloca [1300 x double]*
%12 = alloca [1300 x double]*
%13 = alloca [1300 x double]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1300, i32* %6
%14 = call i64 @polybench_alloc_data(i32 1690000, i32 8)
%15 = inttoptr i64 %14 to [1300 x [1300 x double]]*
store [1300 x [1300 x double]]* %15, [1300 x [1300 x double]]** %9
%16 = call i64 @polybench_alloc_data(i32 1690000, i32 8)
%17 = inttoptr i64 %16 to [1300 x [1300 x double]]*
store [1300 x [1300 x double]]* %17, [1300 x [1300 x double]]** %10
%18 = call i64 @polybench_alloc_data(i32 1300, i32 8)
%19 = inttoptr i64 %18 to [1300 x double]*
store [1300 x double]* %19, [1300 x double]** %11
%20 = call i64 @polybench_alloc_data(i32 1300, i32 8)
%21 = inttoptr i64 %20 to [1300 x double]*
store [1300 x double]* %21, [1300 x double]** %12
%22 = call i64 @polybench_alloc_data(i32 1300, i32 8)
%23 = inttoptr i64 %22 to [1300 x double]*
store [1300 x double]* %23, [1300 x double]** %13
%24 = load i32, i32* %6
%25 = load [1300 x [1300 x double]]*, [1300 x [1300 x double]]** %9
%26 = getelementptr inbounds [1300 x [1300 x double]], [1300 x [1300 x double]]* %25, i64 0, i64 0
%27 = bitcast [1300 x double]* %26 to double**
%28 = load [1300 x [1300 x double]]*, [1300 x [1300 x double]]** %10
%29 = getelementptr inbounds [1300 x [1300 x double]], [1300 x [1300 x double]]* %28, i64 0, i64 0
%30 = bitcast [1300 x double]* %29 to double**
%31 = load [1300 x double]*, [1300 x double]** %12
%32 = getelementptr inbounds [1300 x double], [1300 x double]* %31, i64 0, i64 0
%33 = call i32 @init_array(i32 %24, double* %7, double* %8, double** %27, double** %30, double* %32)
%34 = load i32, i32* %6
%35 = load double, double* %7
%36 = load double, double* %8
%37 = load [1300 x [1300 x double]]*, [1300 x [1300 x double]]** %9
%38 = getelementptr inbounds [1300 x [1300 x double]], [1300 x [1300 x double]]* %37, i64 0, i64 0
%39 = bitcast [1300 x double]* %38 to double**
%40 = load [1300 x [1300 x double]]*, [1300 x [1300 x double]]** %10
%41 = getelementptr inbounds [1300 x [1300 x double]], [1300 x [1300 x double]]* %40, i64 0, i64 0
%42 = bitcast [1300 x double]* %41 to double**
%43 = load [1300 x double]*, [1300 x double]** %11
%44 = getelementptr inbounds [1300 x double], [1300 x double]* %43, i64 0, i64 0
%45 = load [1300 x double]*, [1300 x double]** %12
%46 = getelementptr inbounds [1300 x double], [1300 x double]* %45, i64 0, i64 0
%47 = load [1300 x double]*, [1300 x double]** %13
%48 = getelementptr inbounds [1300 x double], [1300 x double]* %47, i64 0, i64 0
%49 = call i32 @kernel_gesummv(i32 %34, double %35, double %36, double** %39, double** %42, double* %44, double* %46, double* %48)
%50 = load i32, i32* %4
%51 = icmp sgt i32 %50, 42
br i1 %51, label %52, label %63
52: ; preds = %2
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 0
%55 = load i8*, i8** %54
%56 = call i32 @strcmp(i8* %55, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %63, label %58
58: ; preds = %52
%59 = load i32, i32* %6
%60 = load [1300 x double]*, [1300 x double]** %13
%61 = getelementptr inbounds [1300 x double], [1300 x double]* %60, i64 0, i64 0
%62 = call i32 @print_array(i32 %59, double* %61)
br label %63
63: ; preds = %58, %52, %2
%64 = load [1300 x [1300 x double]]*, [1300 x [1300 x double]]** %9
%65 = bitcast [1300 x [1300 x double]]* %64 to i8*
%66 = call i32 @free(i8* %65)
%67 = load [1300 x [1300 x double]]*, [1300 x [1300 x double]]** %10
%68 = bitcast [1300 x [1300 x double]]* %67 to i8*
%69 = call i32 @free(i8* %68)
%70 = load [1300 x double]*, [1300 x double]** %11
%71 = bitcast [1300 x double]* %70 to i8*
%72 = call i32 @free(i8* %71)
%73 = load [1300 x double]*, [1300 x double]** %12
%74 = bitcast [1300 x double]* %73 to i8*
%75 = call i32 @free(i8* %74)
%76 = load [1300 x double]*, [1300 x double]** %13
%77 = bitcast [1300 x double]* %76 to i8*
%78 = call i32 @free(i8* %77)
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 1690000, i32 8)
%8 = tail call i64 @polybench_alloc_data(i32 1690000, i32 8)
%9 = tail call i64 @polybench_alloc_data(i32 1300, i32 8)
%10 = inttoptr i64 %9 to [1300 x double]*
%11 = tail call i64 @polybench_alloc_data(i32 1300, i32 8)
%12 = inttoptr i64 %11 to [1300 x double]*
%13 = tail call i64 @polybench_alloc_data(i32 1300, i32 8)
%14 = inttoptr i64 %13 to [1300 x double]*
%15 = inttoptr i64 %7 to double**
%16 = inttoptr i64 %8 to double**
%17 = getelementptr inbounds [1300 x double], [1300 x double]* %12, i64 0, i64 0
%18 = call i32 @init_array(i32 1300, double* %3, double* %4, double** %15, double** %16, double* %17)
%19 = load double, double* %3
%20 = load double, double* %4
%21 = getelementptr inbounds [1300 x double], [1300 x double]* %10, i64 0, i64 0
%22 = getelementptr inbounds [1300 x double], [1300 x double]* %14, i64 0, i64 0
%23 = call i32 @kernel_gesummv(i32 1300, double %19, double %20, double** %15, double** %16, double* %21, double* %17, double* %22)
%24 = icmp sgt i32 %0, 42
br i1 %24, label %25, label %31
25: ; preds = %2
%26 = load i8*, i8** %1
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @print_array(i32 1300, double* %22)
br label %31
31: ; preds = %29, %25, %2
%32 = inttoptr i64 %7 to i8*
%33 = call i32 @free(i8* %32)
%34 = inttoptr i64 %8 to i8*
%35 = call i32 @free(i8* %34)
%36 = inttoptr i64 %9 to i8*
%37 = call i32 @free(i8* %36)
%38 = inttoptr i64 %11 to i8*
%39 = call i32 @free(i8* %38)
%40 = inttoptr i64 %13 to i8*
%41 = call i32 @free(i8* %40)
ret i32 0
}