#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 *, double *, double *, double *, double *,
                              double *, double *);
int /*<<< orphan*/ kernel_gemver(int, double, double, double **, double *,
                                 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 = 2000;
  double alpha;
  double beta;
  double(*A)[2000 + 0][2000 + 0];
  A = (double(*)[2000 + 0][2000 + 0])
      polybench_alloc_data((2000 + 0) * (2000 + 0), sizeof(double));
  ;
  double(*u1)[2000 + 0];
  u1 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*v1)[2000 + 0];
  v1 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*u2)[2000 + 0];
  u2 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*v2)[2000 + 0];
  v2 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*w)[2000 + 0];
  w = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*x)[2000 + 0];
  x = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*y)[2000 + 0];
  y = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*z)[2000 + 0];
  z = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  init_array(n, &alpha, &beta, *A, *u1, *v1, *u2, *v2, *w, *x, *y, *z);
  ;
  kernel_gemver(n, alpha, beta, *A, *u1, *v1, *u2, *v2, *w, *x, *y, *z);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *w);
  free((void *)A);
  ;
  free((void *)u1);
  ;
  free((void *)v1);
  ;
  free((void *)u2);
  ;
  free((void *)v2);
  ;
  free((void *)w);
  ;
  free((void *)x);
  ;
  free((void *)y);
  ;
  free((void *)z);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0xa8,%rsp
movl   $0x0,-0x1c(%rbp)
mov    %edi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movl   $0x7d0,-0x2c(%rbp)
mov    $0x3d0900,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x48(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x50(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x58(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x60(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x68(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x70(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x78(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x80(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x88(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%r15
mov    -0x68(%rbp),%r14
mov    -0x70(%rbp),%rbx
mov    -0x78(%rbp),%r11
mov    -0x80(%rbp),%r10
mov    -0x88(%rbp),%rax
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rdx
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 <init_array@plt>
mov    -0x2c(%rbp),%edi
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    -0x68(%rbp),%r9
mov    -0x70(%rbp),%rbx
mov    -0x78(%rbp),%r11
mov    -0x80(%rbp),%r10
mov    -0x88(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <kernel_gemver@plt>
cmpl   $0x2a,-0x20(%rbp)
jle    1305 <main+0x1a5>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xd15(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1305 <main+0x1a5>
mov    -0x2c(%rbp),%edi
mov    -0x70(%rbp),%rsi
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>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xa8,%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    $0x68,%rsp
mov    %rsi,0x38(%rsp)
mov    %edi,0x14(%rsp)
mov    $0x3d0900,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbp
mov    %rax,0x20(%rsp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r12
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,0x30(%rsp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,0x40(%rsp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,0x18(%rsp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r13
mov    %rax,0x8(%rsp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    %rax,0x28(%rsp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r15
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r14
lea    0x60(%rsp),%rsi
lea    0x58(%rsp),%rdx
mov    $0x7d0,%edi
mov    %rbp,%rcx
mov    %r12,%rbp
mov    %r12,%r8
mov    0x30(%rsp),%r12
mov    %r12,%r9
push   %rax
push   %r15
push   %rbx
push   %r13
mov    0x38(%rsp),%r13
push   %r13
mov    0x68(%rsp),%rbx
push   %rbx
call   1060 <init_array@plt>
add    $0x30,%rsp
movsd  0x60(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
mov    $0x7d0,%edi
mov    0x20(%rsp),%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
mov    %r13,%r9
mov    %r14,0x48(%rsp)
push   %r14
mov    %r15,0x58(%rsp)
push   %r15
push   0x38(%rsp)
push   0x20(%rsp)
call   1050 <kernel_gemver@plt>
add    $0x20,%rsp
cmpl   $0x2b,0x14(%rsp)
jl     12be <main+0x16e>
mov    0x38(%rsp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
jne    12be <main+0x16e>
mov    $0x7d0,%edi
mov    0x8(%rsp),%rsi
call   1040 <print_array@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x68,%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 [2000 x [2000 x double]]*
%10 = alloca [2000 x double]*
%11 = alloca [2000 x double]*
%12 = alloca [2000 x double]*
%13 = alloca [2000 x double]*
%14 = alloca [2000 x double]*
%15 = alloca [2000 x double]*
%16 = alloca [2000 x double]*
%17 = alloca [2000 x double]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2000, i32* %6
%18 = call i64 @polybench_alloc_data(i32 4000000, i32 8)
%19 = inttoptr i64 %18 to [2000 x [2000 x double]]*
store [2000 x [2000 x double]]* %19, [2000 x [2000 x double]]** %9
%20 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%21 = inttoptr i64 %20 to [2000 x double]*
store [2000 x double]* %21, [2000 x double]** %10
%22 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%23 = inttoptr i64 %22 to [2000 x double]*
store [2000 x double]* %23, [2000 x double]** %11
%24 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%25 = inttoptr i64 %24 to [2000 x double]*
store [2000 x double]* %25, [2000 x double]** %12
%26 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%27 = inttoptr i64 %26 to [2000 x double]*
store [2000 x double]* %27, [2000 x double]** %13
%28 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%29 = inttoptr i64 %28 to [2000 x double]*
store [2000 x double]* %29, [2000 x double]** %14
%30 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%31 = inttoptr i64 %30 to [2000 x double]*
store [2000 x double]* %31, [2000 x double]** %15
%32 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%33 = inttoptr i64 %32 to [2000 x double]*
store [2000 x double]* %33, [2000 x double]** %16
%34 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%35 = inttoptr i64 %34 to [2000 x double]*
store [2000 x double]* %35, [2000 x double]** %17
%36 = load i32, i32* %6
%37 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %9
%38 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %37, i64 0, i64 0
%39 = bitcast [2000 x double]* %38 to double**
%40 = load [2000 x double]*, [2000 x double]** %10
%41 = getelementptr inbounds [2000 x double], [2000 x double]* %40, i64 0, i64 0
%42 = load [2000 x double]*, [2000 x double]** %11
%43 = getelementptr inbounds [2000 x double], [2000 x double]* %42, i64 0, i64 0
%44 = load [2000 x double]*, [2000 x double]** %12
%45 = getelementptr inbounds [2000 x double], [2000 x double]* %44, i64 0, i64 0
%46 = load [2000 x double]*, [2000 x double]** %13
%47 = getelementptr inbounds [2000 x double], [2000 x double]* %46, i64 0, i64 0
%48 = load [2000 x double]*, [2000 x double]** %14
%49 = getelementptr inbounds [2000 x double], [2000 x double]* %48, i64 0, i64 0
%50 = load [2000 x double]*, [2000 x double]** %15
%51 = getelementptr inbounds [2000 x double], [2000 x double]* %50, i64 0, i64 0
%52 = load [2000 x double]*, [2000 x double]** %16
%53 = getelementptr inbounds [2000 x double], [2000 x double]* %52, i64 0, i64 0
%54 = load [2000 x double]*, [2000 x double]** %17
%55 = getelementptr inbounds [2000 x double], [2000 x double]* %54, i64 0, i64 0
%56 = call i32 @init_array(i32 %36, double* %7, double* %8, double** %39, double* %41, double* %43, double* %45, double* %47, double* %49, double* %51, double* %53, double* %55)
%57 = load i32, i32* %6
%58 = load double, double* %7
%59 = load double, double* %8
%60 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %9
%61 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %60, i64 0, i64 0
%62 = bitcast [2000 x double]* %61 to double**
%63 = load [2000 x double]*, [2000 x double]** %10
%64 = getelementptr inbounds [2000 x double], [2000 x double]* %63, i64 0, i64 0
%65 = load [2000 x double]*, [2000 x double]** %11
%66 = getelementptr inbounds [2000 x double], [2000 x double]* %65, i64 0, i64 0
%67 = load [2000 x double]*, [2000 x double]** %12
%68 = getelementptr inbounds [2000 x double], [2000 x double]* %67, i64 0, i64 0
%69 = load [2000 x double]*, [2000 x double]** %13
%70 = getelementptr inbounds [2000 x double], [2000 x double]* %69, i64 0, i64 0
%71 = load [2000 x double]*, [2000 x double]** %14
%72 = getelementptr inbounds [2000 x double], [2000 x double]* %71, i64 0, i64 0
%73 = load [2000 x double]*, [2000 x double]** %15
%74 = getelementptr inbounds [2000 x double], [2000 x double]* %73, i64 0, i64 0
%75 = load [2000 x double]*, [2000 x double]** %16
%76 = getelementptr inbounds [2000 x double], [2000 x double]* %75, i64 0, i64 0
%77 = load [2000 x double]*, [2000 x double]** %17
%78 = getelementptr inbounds [2000 x double], [2000 x double]* %77, i64 0, i64 0
%79 = call i32 @kernel_gemver(i32 %57, double %58, double %59, double** %62, double* %64, double* %66, double* %68, double* %70, double* %72, double* %74, double* %76, double* %78)
%80 = load i32, i32* %4
%81 = icmp sgt i32 %80, 42
br i1 %81, label %82, label %93
82: ; preds = %2
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 0
%85 = load i8*, i8** %84
%86 = call i32 @strcmp(i8* %85, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%87 = icmp ne i32 %86, 0
br i1 %87, label %93, label %88
88: ; preds = %82
%89 = load i32, i32* %6
%90 = load [2000 x double]*, [2000 x double]** %14
%91 = getelementptr inbounds [2000 x double], [2000 x double]* %90, i64 0, i64 0
%92 = call i32 @print_array(i32 %89, double* %91)
br label %93
93: ; preds = %88, %82, %2
%94 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %9
%95 = bitcast [2000 x [2000 x double]]* %94 to i8*
%96 = call i32 @free(i8* %95)
%97 = load [2000 x double]*, [2000 x double]** %10
%98 = bitcast [2000 x double]* %97 to i8*
%99 = call i32 @free(i8* %98)
%100 = load [2000 x double]*, [2000 x double]** %11
%101 = bitcast [2000 x double]* %100 to i8*
%102 = call i32 @free(i8* %101)
%103 = load [2000 x double]*, [2000 x double]** %12
%104 = bitcast [2000 x double]* %103 to i8*
%105 = call i32 @free(i8* %104)
%106 = load [2000 x double]*, [2000 x double]** %13
%107 = bitcast [2000 x double]* %106 to i8*
%108 = call i32 @free(i8* %107)
%109 = load [2000 x double]*, [2000 x double]** %14
%110 = bitcast [2000 x double]* %109 to i8*
%111 = call i32 @free(i8* %110)
%112 = load [2000 x double]*, [2000 x double]** %15
%113 = bitcast [2000 x double]* %112 to i8*
%114 = call i32 @free(i8* %113)
%115 = load [2000 x double]*, [2000 x double]** %16
%116 = bitcast [2000 x double]* %115 to i8*
%117 = call i32 @free(i8* %116)
%118 = load [2000 x double]*, [2000 x double]** %17
%119 = bitcast [2000 x double]* %118 to i8*
%120 = call i32 @free(i8* %119)
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 4000000, i32 8)
%8 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%9 = inttoptr i64 %8 to [2000 x double]*
%10 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%11 = inttoptr i64 %10 to [2000 x double]*
%12 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%13 = inttoptr i64 %12 to [2000 x double]*
%14 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%15 = inttoptr i64 %14 to [2000 x double]*
%16 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%17 = inttoptr i64 %16 to [2000 x double]*
%18 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%19 = inttoptr i64 %18 to [2000 x double]*
%20 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%21 = inttoptr i64 %20 to [2000 x double]*
%22 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%23 = inttoptr i64 %22 to [2000 x double]*
%24 = inttoptr i64 %7 to double**
%25 = getelementptr inbounds [2000 x double], [2000 x double]* %9, i64 0, i64 0
%26 = getelementptr inbounds [2000 x double], [2000 x double]* %11, i64 0, i64 0
%27 = getelementptr inbounds [2000 x double], [2000 x double]* %13, i64 0, i64 0
%28 = getelementptr inbounds [2000 x double], [2000 x double]* %15, i64 0, i64 0
%29 = getelementptr inbounds [2000 x double], [2000 x double]* %17, i64 0, i64 0
%30 = getelementptr inbounds [2000 x double], [2000 x double]* %19, i64 0, i64 0
%31 = getelementptr inbounds [2000 x double], [2000 x double]* %21, i64 0, i64 0
%32 = getelementptr inbounds [2000 x double], [2000 x double]* %23, i64 0, i64 0
%33 = call i32 @init_array(i32 2000, double* %3, double* %4, double** %24, double* %25, double* %26, double* %27, double* %28, double* %29, double* %30, double* %31, double* %32)
%34 = load double, double* %3
%35 = load double, double* %4
%36 = call i32 @kernel_gemver(i32 2000, double %34, double %35, double** %24, double* %25, double* %26, double* %27, double* %28, double* %29, double* %30, double* %31, double* %32)
%37 = icmp sgt i32 %0, 42
br i1 %37, label %38, label %44
38: ; preds = %2
%39 = load i8*, i8** %1
%40 = load i8, i8* %39
%41 = icmp eq i8 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 @print_array(i32 2000, double* %29)
br label %44
44: ; preds = %42, %38, %2
%45 = inttoptr i64 %7 to i8*
%46 = call i32 @free(i8* %45)
%47 = inttoptr i64 %8 to i8*
%48 = call i32 @free(i8* %47)
%49 = inttoptr i64 %10 to i8*
%50 = call i32 @free(i8* %49)
%51 = inttoptr i64 %12 to i8*
%52 = call i32 @free(i8* %51)
%53 = inttoptr i64 %14 to i8*
%54 = call i32 @free(i8* %53)
%55 = inttoptr i64 %16 to i8*
%56 = call i32 @free(i8* %55)
%57 = inttoptr i64 %18 to i8*
%58 = call i32 @free(i8* %57)
%59 = inttoptr i64 %20 to i8*
%60 = call i32 @free(i8* %59)
%61 = inttoptr i64 %22 to i8*
%62 = call i32 @free(i8* %61)
ret i32 0
}