#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, double **, double *);
int /*<<< orphan*/ kernel_atax(int, int, 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 m = 1900;
  int n = 2100;
  double(*A)[1900 + 0][2100 + 0];
  A = (double(*)[1900 + 0][2100 + 0])
      polybench_alloc_data((1900 + 0) * (2100 + 0), sizeof(double));
  ;
  double(*x)[2100 + 0];
  x = (double(*)[2100 + 0]) polybench_alloc_data(2100 + 0, sizeof(double));
  ;
  double(*y)[2100 + 0];
  y = (double(*)[2100 + 0]) polybench_alloc_data(2100 + 0, sizeof(double));
  ;
  double(*tmp)[1900 + 0];
  tmp = (double(*)[1900 + 0]) polybench_alloc_data(1900 + 0, sizeof(double));
  ;
  init_array(m, n, *A, *x);
  ;
  kernel_atax(m, n, *A, *x, *y, *tmp);
  ;
  ;
  if (argc > 42 && !strcmp(argv[0], ""))
    print_array(n, *y);
  free((void *)A);
  ;
  free((void *)x);
  ;
  free((void *)y);
  ;
  free((void *)tmp);
  ;
  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   $0x76c,-0x14(%rbp)
movl   $0x834,-0x18(%rbp)
mov    $0x3ce1f0,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x20(%rbp)
mov    $0x834,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x28(%rbp)
mov    $0x834,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x30(%rbp)
mov    $0x76c,%edi
mov    $0x8,%esi
call   1080 <polybench_alloc_data@plt>
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1050 <init_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1060 <kernel_atax@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    1230 <main+0xd0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdea(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1230 <main+0xd0>
mov    -0x18(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1040 <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>
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,%r15
mov    %edi,%r13d
mov    $0x3ce1f0,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r14
mov    $0x834,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbx
mov    $0x834,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%r12
mov    $0x76c,%edi
mov    $0x8,%esi
call   1070 <polybench_alloc_data@plt>
mov    %rax,%rbp
mov    $0x76c,%edi
mov    $0x834,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1050 <init_array@plt>
mov    $0x76c,%edi
mov    $0x834,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %r12,%r8
mov    %rbp,%r9
call   1060 <kernel_atax@plt>
cmp    $0x2b,%r13d
jl     11f4 <main+0xa4>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    11f4 <main+0xa4>
mov    $0x834,%edi
mov    %r12,%rsi
call   1040 <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>
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 i32
%8 = alloca [1900 x [2100 x double]]*
%9 = alloca [2100 x double]*
%10 = alloca [2100 x double]*
%11 = alloca [1900 x double]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1900, i32* %6
store i32 2100, i32* %7
%12 = call i64 @polybench_alloc_data(i32 3990000, i32 8)
%13 = inttoptr i64 %12 to [1900 x [2100 x double]]*
store [1900 x [2100 x double]]* %13, [1900 x [2100 x double]]** %8
%14 = call i64 @polybench_alloc_data(i32 2100, i32 8)
%15 = inttoptr i64 %14 to [2100 x double]*
store [2100 x double]* %15, [2100 x double]** %9
%16 = call i64 @polybench_alloc_data(i32 2100, i32 8)
%17 = inttoptr i64 %16 to [2100 x double]*
store [2100 x double]* %17, [2100 x double]** %10
%18 = call i64 @polybench_alloc_data(i32 1900, i32 8)
%19 = inttoptr i64 %18 to [1900 x double]*
store [1900 x double]* %19, [1900 x double]** %11
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load [1900 x [2100 x double]]*, [1900 x [2100 x double]]** %8
%23 = getelementptr inbounds [1900 x [2100 x double]], [1900 x [2100 x double]]* %22, i64 0, i64 0
%24 = bitcast [2100 x double]* %23 to double**
%25 = load [2100 x double]*, [2100 x double]** %9
%26 = getelementptr inbounds [2100 x double], [2100 x double]* %25, i64 0, i64 0
%27 = call i32 @init_array(i32 %20, i32 %21, double** %24, double* %26)
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = load [1900 x [2100 x double]]*, [1900 x [2100 x double]]** %8
%31 = getelementptr inbounds [1900 x [2100 x double]], [1900 x [2100 x double]]* %30, i64 0, i64 0
%32 = bitcast [2100 x double]* %31 to double**
%33 = load [2100 x double]*, [2100 x double]** %9
%34 = getelementptr inbounds [2100 x double], [2100 x double]* %33, i64 0, i64 0
%35 = load [2100 x double]*, [2100 x double]** %10
%36 = getelementptr inbounds [2100 x double], [2100 x double]* %35, i64 0, i64 0
%37 = load [1900 x double]*, [1900 x double]** %11
%38 = getelementptr inbounds [1900 x double], [1900 x double]* %37, i64 0, i64 0
%39 = call i32 @kernel_atax(i32 %28, i32 %29, double** %32, double* %34, double* %36, double* %38)
%40 = load i32, i32* %4
%41 = icmp sgt i32 %40, 42
br i1 %41, label %42, label %53
42: ; preds = %2
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 0
%45 = load i8*, i8** %44
%46 = call i32 @strcmp(i8* %45, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%47 = icmp ne i32 %46, 0
br i1 %47, label %53, label %48
48: ; preds = %42
%49 = load i32, i32* %7
%50 = load [2100 x double]*, [2100 x double]** %10
%51 = getelementptr inbounds [2100 x double], [2100 x double]* %50, i64 0, i64 0
%52 = call i32 @print_array(i32 %49, double* %51)
br label %53
53: ; preds = %48, %42, %2
%54 = load [1900 x [2100 x double]]*, [1900 x [2100 x double]]** %8
%55 = bitcast [1900 x [2100 x double]]* %54 to i8*
%56 = call i32 @free(i8* %55)
%57 = load [2100 x double]*, [2100 x double]** %9
%58 = bitcast [2100 x double]* %57 to i8*
%59 = call i32 @free(i8* %58)
%60 = load [2100 x double]*, [2100 x double]** %10
%61 = bitcast [2100 x double]* %60 to i8*
%62 = call i32 @free(i8* %61)
%63 = load [1900 x double]*, [1900 x double]** %11
%64 = bitcast [1900 x double]* %63 to i8*
%65 = call i32 @free(i8* %64)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @polybench_alloc_data(i32 3990000, i32 8)
%4 = tail call i64 @polybench_alloc_data(i32 2100, i32 8)
%5 = inttoptr i64 %4 to [2100 x double]*
%6 = tail call i64 @polybench_alloc_data(i32 2100, i32 8)
%7 = inttoptr i64 %6 to [2100 x double]*
%8 = tail call i64 @polybench_alloc_data(i32 1900, i32 8)
%9 = inttoptr i64 %8 to [1900 x double]*
%10 = inttoptr i64 %3 to double**
%11 = getelementptr inbounds [2100 x double], [2100 x double]* %5, i64 0, i64 0
%12 = tail call i32 @init_array(i32 1900, i32 2100, double** %10, double* %11)
%13 = getelementptr inbounds [2100 x double], [2100 x double]* %7, i64 0, i64 0
%14 = getelementptr inbounds [1900 x double], [1900 x double]* %9, i64 0, i64 0
%15 = tail call i32 @kernel_atax(i32 1900, i32 2100, double** %10, double* %11, double* %13, double* %14)
%16 = icmp sgt i32 %0, 42
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i8*, i8** %1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @print_array(i32 2100, double* %13)
br label %23
23: ; preds = %21, %17, %2
%24 = inttoptr i64 %3 to i8*
%25 = tail call i32 @free(i8* %24)
%26 = inttoptr i64 %4 to i8*
%27 = tail call i32 @free(i8* %26)
%28 = inttoptr i64 %6 to i8*
%29 = tail call i32 @free(i8* %28)
%30 = inttoptr i64 %8 to i8*
%31 = tail call i32 @free(i8* %30)
ret i32 0
}