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