#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_mvt(int, double *, double *, double *, double *,
                              double **);
scalar_t__ polybench_alloc_data(int, int);
int /*<<< orphan*/ print_array(int, double *, double *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int n = 2000;
  double(*A)[2000 + 0][2000 + 0];
  A = (double(*)[2000 + 0][2000 + 0])
      polybench_alloc_data((2000 + 0) * (2000 + 0), sizeof(double));
  ;
  double(*x1)[2000 + 0];
  x1 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*x2)[2000 + 0];
  x2 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*y_1)[2000 + 0];
  y_1 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  double(*y_2)[2000 + 0];
  y_2 = (double(*)[2000 + 0]) polybench_alloc_data(2000 + 0, sizeof(double));
  ;
  init_array(n, *x1, *x2, *y_1, *y_2, *A);
  ;
  kernel_mvt(n, *x1, *x2, *y_1, *y_2, *A);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *x1, *x2);
  free((void *)A);
  ;
  free((void *)x1);
  ;
  free((void *)x2);
  ;
  free((void *)y_1);
  ;
  free((void *)y_2);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7d0,-0x14(%rbp)
mov    $0x3d0900,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x20(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x28(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x30(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x38(%rbp)
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x40(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1060 <init_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1040 <kernel_mvt@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    124a <main+0xea>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdd4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    124a <main+0xea>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1050 <print_array@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@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    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
mov    %edi,%ebp
mov    $0x3d0900,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r14
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,%rbx
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r13
mov    $0x7d0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r15
mov    $0x7d0,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %rax,%r8
mov    %r14,%r9
call   1060 <init_array@plt>
mov    $0x7d0,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1040 <kernel_mvt@plt>
cmp    $0x2b,%ebp
jl     120e <main+0xbe>
mov    (%rsp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
jne    120e <main+0xbe>
mov    $0x7d0,%edi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <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    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%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 [2000 x [2000 x double]]*
%8 = alloca [2000 x double]*
%9 = alloca [2000 x double]*
%10 = alloca [2000 x double]*
%11 = alloca [2000 x double]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2000, i32* %6
%12 = call i64 @polybench_alloc_data(i32 4000000, i32 8)
%13 = inttoptr i64 %12 to [2000 x [2000 x double]]*
store [2000 x [2000 x double]]* %13, [2000 x [2000 x double]]** %7
%14 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%15 = inttoptr i64 %14 to [2000 x double]*
store [2000 x double]* %15, [2000 x double]** %8
%16 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%17 = inttoptr i64 %16 to [2000 x double]*
store [2000 x double]* %17, [2000 x double]** %9
%18 = call i64 @polybench_alloc_data(i32 2000, i32 8)
%19 = inttoptr i64 %18 to [2000 x double]*
store [2000 x double]* %19, [2000 x double]** %10
%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]** %11
%22 = load i32, i32* %6
%23 = load [2000 x double]*, [2000 x double]** %8
%24 = getelementptr inbounds [2000 x double], [2000 x double]* %23, i64 0, i64 0
%25 = load [2000 x double]*, [2000 x double]** %9
%26 = getelementptr inbounds [2000 x double], [2000 x double]* %25, i64 0, i64 0
%27 = load [2000 x double]*, [2000 x double]** %10
%28 = getelementptr inbounds [2000 x double], [2000 x double]* %27, i64 0, i64 0
%29 = load [2000 x double]*, [2000 x double]** %11
%30 = getelementptr inbounds [2000 x double], [2000 x double]* %29, i64 0, i64 0
%31 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %7
%32 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %31, i64 0, i64 0
%33 = bitcast [2000 x double]* %32 to double**
%34 = call i32 @init_array(i32 %22, double* %24, double* %26, double* %28, double* %30, double** %33)
%35 = load i32, i32* %6
%36 = load [2000 x double]*, [2000 x double]** %8
%37 = getelementptr inbounds [2000 x double], [2000 x double]* %36, i64 0, i64 0
%38 = load [2000 x double]*, [2000 x double]** %9
%39 = getelementptr inbounds [2000 x double], [2000 x double]* %38, i64 0, i64 0
%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 [2000 x double]]*, [2000 x [2000 x double]]** %7
%45 = getelementptr inbounds [2000 x [2000 x double]], [2000 x [2000 x double]]* %44, i64 0, i64 0
%46 = bitcast [2000 x double]* %45 to double**
%47 = call i32 @kernel_mvt(i32 %35, double* %37, double* %39, double* %41, double* %43, double** %46)
%48 = load i32, i32* %4
%49 = icmp sgt i32 %48, 42
br i1 %49, label %50, label %63
50: ; preds = %2
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 0
%53 = load i8*, i8** %52
%54 = call i32 @strcmp(i8* %53, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %63, label %56
56: ; preds = %50
%57 = load i32, i32* %6
%58 = load [2000 x double]*, [2000 x double]** %8
%59 = getelementptr inbounds [2000 x double], [2000 x double]* %58, i64 0, i64 0
%60 = load [2000 x double]*, [2000 x double]** %9
%61 = getelementptr inbounds [2000 x double], [2000 x double]* %60, i64 0, i64 0
%62 = call i32 @print_array(i32 %57, double* %59, double* %61)
br label %63
63: ; preds = %56, %50, %2
%64 = load [2000 x [2000 x double]]*, [2000 x [2000 x double]]** %7
%65 = bitcast [2000 x [2000 x double]]* %64 to i8*
%66 = call i32 @free(i8* %65)
%67 = load [2000 x double]*, [2000 x double]** %8
%68 = bitcast [2000 x double]* %67 to i8*
%69 = call i32 @free(i8* %68)
%70 = load [2000 x double]*, [2000 x double]** %9
%71 = bitcast [2000 x double]* %70 to i8*
%72 = call i32 @free(i8* %71)
%73 = load [2000 x double]*, [2000 x double]** %10
%74 = bitcast [2000 x double]* %73 to i8*
%75 = call i32 @free(i8* %74)
%76 = load [2000 x double]*, [2000 x double]** %11
%77 = bitcast [2000 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 = tail call i64 @polybench_alloc_data(i32 4000000, i32 8)
%4 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%5 = inttoptr i64 %4 to [2000 x double]*
%6 = tail call i64 @polybench_alloc_data(i32 2000, i32 8)
%7 = inttoptr i64 %6 to [2000 x double]*
%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 = getelementptr inbounds [2000 x double], [2000 x double]* %5, i64 0, i64 0
%13 = getelementptr inbounds [2000 x double], [2000 x double]* %7, i64 0, i64 0
%14 = getelementptr inbounds [2000 x double], [2000 x double]* %9, i64 0, i64 0
%15 = getelementptr inbounds [2000 x double], [2000 x double]* %11, i64 0, i64 0
%16 = inttoptr i64 %3 to double**
%17 = tail call i32 @init_array(i32 2000, double* %12, double* %13, double* %14, double* %15, double** %16)
%18 = tail call i32 @kernel_mvt(i32 2000, double* %12, double* %13, double* %14, double* %15, double** %16)
%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 2000, double* %12, double* %13)
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 %6 to i8*
%32 = tail call i32 @free(i8* %31)
%33 = inttoptr i64 %8 to i8*
%34 = tail call i32 @free(i8* %33)
%35 = inttoptr i64 %10 to i8*
%36 = tail call i32 @free(i8* %35)
ret i32 0
}