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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x7d0,-0x14(%rbp)
mov    $0x7d0,%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    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <init_array@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1070 <kernel_durbin@plt>
cmpl   $0x2a,-0x8(%rbp)
jle    11f1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe29(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11f1 <main+0x91>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1040 <print_array@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebp
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,%r14
mov    $0x7d0,%edi
mov    %rbx,%rsi
call   1050 <init_array@plt>
mov    $0x7d0,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <kernel_durbin@plt>
cmp    $0x2b,%ebp
jl     11b7 <main+0x67>
mov    (%r15),%rax
cmpb   $0x0,(%rax)
jne    11b7 <main+0x67>
mov    $0x7d0,%edi
mov    %r14,%rsi
call   1040 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 double]*
%8 = alloca [2000 x double]*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2000, i32* %6
%9 = call i64 @polybench_alloc_data(i64 2000, i32 8)
%10 = inttoptr i64 %9 to [2000 x double]*
store [2000 x double]* %10, [2000 x double]** %7
%11 = call i64 @polybench_alloc_data(i64 2000, i32 8)
%12 = inttoptr i64 %11 to [2000 x double]*
store [2000 x double]* %12, [2000 x double]** %8
%13 = load i32, i32* %6
%14 = load [2000 x double]*, [2000 x double]** %7
%15 = getelementptr inbounds [2000 x double], [2000 x double]* %14, i64 0, i64 0
%16 = call i32 @init_array(i32 %13, double* %15)
%17 = load i32, i32* %6
%18 = load [2000 x double]*, [2000 x double]** %7
%19 = getelementptr inbounds [2000 x double], [2000 x double]* %18, i64 0, i64 0
%20 = load [2000 x double]*, [2000 x double]** %8
%21 = getelementptr inbounds [2000 x double], [2000 x double]* %20, i64 0, i64 0
%22 = call i32 @kernel_durbin(i32 %17, double* %19, double* %21)
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 42
br i1 %24, label %25, label %36
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %36, label %31
31: ; preds = %25
%32 = load i32, i32* %6
%33 = load [2000 x double]*, [2000 x double]** %8
%34 = getelementptr inbounds [2000 x double], [2000 x double]* %33, i64 0, i64 0
%35 = call i32 @print_array(i32 %32, double* %34)
br label %36
36: ; preds = %31, %25, %2
%37 = load [2000 x double]*, [2000 x double]** %7
%38 = bitcast [2000 x double]* %37 to i8*
%39 = call i32 @free(i8* %38)
%40 = load [2000 x double]*, [2000 x double]** %8
%41 = bitcast [2000 x double]* %40 to i8*
%42 = call i32 @free(i8* %41)
ret i32 0
}

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