#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*/ Kernel_vector(size_t const, size_t const, size_t const,
                                 float *, float *, float *);
int /*<<< orphan*/ free(float *);
scalar_t__ ov_malloc(size_t const);
int /*<<< orphan*/ printf(char *, ...);
double wallt();
int main(int argc, char *argv[]) {
  printf("OV_PLATFORM: %s\n", "GCC"
                              " COMPILER SSE 2");
  printf("OV_FLOAT_WIDTH %d\n", 4);
  printf("OV_ALIGN %d\n", (4 * 4));
  size_t const n1 = 320;
  size_t const n2 = 320;
  size_t const n3 = 320;
  ;
  size_t const size = n1 * n2 * n3;
  size_t const sizebytes = size * sizeof(float);
  float *P = (float *)ov_malloc(sizebytes);
  float *U0 = (float *)ov_malloc(sizebytes);
  float *U1 = (float *)ov_malloc(sizebytes);
  for (size_t i = 0; i < size; i++) {
    P[i] = 1500.0f;
    U0[i] = 0.0f;
    U1[i] = 0.0f;
  }
  Kernel_vector(n1, n2, n3, P, U0, U1);
  Kernel_vector(n1, n2, n3, P, U1, U0);
  double t0 = wallt();
  int const niter = 1;
  for (int iter = 0; iter < niter; iter++) {
    Kernel_vector(n1, n2, n3, P, U0, U1);
    Kernel_vector(n1, n2, n3, P, U1, U0);
  }
  double t1 = wallt();
  double msamples = niter * 2l * (size / 1000000.0);
  printf("%.1lf Msamples/s\n", msamples / (t1 - t0));
  free(U1);
  free(U0);
  free(P);
  printf("Success.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movq   $0x140,-0x18(%rbp)
movq   $0x140,-0x20(%rbp)
movq   $0x140,-0x28(%rbp)
movq   $0x1f40000,-0x30(%rbp)
01
movq   $0x7d00000,-0x38(%rbp)
07
mov    $0x7d00000,%edi
call   1060 <ov_malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x7d00000,%edi
call   1060 <ov_malloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0x7d00000,%edi
call   1060 <ov_malloc@plt>
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
cmpq   $0x1f40000,-0x58(%rbp)
01
jae    1252 <main+0x102>
mov    -0x40(%rbp),%rax
mov    -0x58(%rbp),%rcx
movss  0xdec(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
mov    -0x58(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
mov    -0x58(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    11fe <main+0xae>
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
mov    $0x140,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1050 <Kernel_vector@plt>
mov    -0x40(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    $0x140,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1050 <Kernel_vector@plt>
mov    $0x0,%al
call   1070 <wallt@plt>
movsd  %xmm0,-0x60(%rbp)
movl   $0x1,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
cmpl   $0x1,-0x68(%rbp)
jge    12f4 <main+0x1a4>
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    -0x50(%rbp),%r9
mov    $0x140,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1050 <Kernel_vector@plt>
mov    -0x40(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    $0x140,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1050 <Kernel_vector@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    12a4 <main+0x154>
mov    $0x0,%al
call   1070 <wallt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xcf8(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
subsd  -0x60(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xd29(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea8(%rip),%rdi
lea    0xeb2(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x7d00000,%edi
call   1070 <ov_malloc@plt>
mov    %rax,%r14
mov    $0x7d00000,%edi
call   1070 <ov_malloc@plt>
mov    %rax,%r15
mov    $0x7d00000,%edi
call   1070 <ov_malloc@plt>
mov    %rax,%rbx
lea    0x7d00000(%r14),%rax
lea    0x7d00000(%r15),%rsi
lea    0x7d00000(%rbx),%rdi
cmp    %rsi,%r14
setb   %r9b
cmp    %rax,%r15
setb   %dl
cmp    %rdi,%r14
setb   %cl
cmp    %rax,%rbx
setb   %r8b
cmp    %rdi,%r15
setb   %al
cmp    %rsi,%rbx
setb   %sil
test   %dl,%r9b
jne    1283 <main+0x123>
and    %r8b,%cl
jne    1283 <main+0x123>
and    %sil,%al
jne    1283 <main+0x123>
mov    $0xc,%eax
movapd 0xddd(%rip),%xmm0
xorps  %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
movupd %xmm0,-0x30(%r14,%rax,4)
movupd %xmm0,-0x20(%r14,%rax,4)
movups %xmm1,-0x30(%r15,%rax,4)
movups %xmm1,-0x20(%r15,%rax,4)
movups %xmm1,-0x30(%rbx,%rax,4)
movups %xmm1,-0x20(%rbx,%rax,4)
movupd %xmm0,-0x10(%r14,%rax,4)
movupd %xmm0,(%r14,%rax,4)
movups %xmm1,-0x10(%r15,%rax,4)
movups %xmm1,(%r15,%rax,4)
movups %xmm1,-0x10(%rbx,%rax,4)
movups %xmm1,(%rbx,%rax,4)
add    $0x10,%rax
cmp    $0x1f4000c,%rax
jne    1230 <main+0xd0>
jmp    12cd <main+0x16d>
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
movl   $0x44bb8000,-0x4(%r14,%rax,4)
bb 44
movl   $0x0,-0x4(%r15,%rax,4)
movl   $0x0,-0x4(%rbx,%rax,4)
movl   $0x44bb8000,(%r14,%rax,4)
44
movl   $0x0,(%r15,%rax,4)
movl   $0x0,(%rbx,%rax,4)
add    $0x2,%rax
cmp    $0x1f40001,%rax
jne    1290 <main+0x130>
mov    $0x140,%edi
mov    $0x140,%esi
mov    $0x140,%edx
mov    %r14,%rcx
mov    %r15,%r8
mov    %rbx,%r9
call   1060 <Kernel_vector@plt>
mov    $0x140,%edi
mov    $0x140,%esi
mov    $0x140,%edx
mov    %r14,%rcx
mov    %rbx,%r8
mov    %r15,%r9
call   1060 <Kernel_vector@plt>
xor    %eax,%eax
call   1080 <wallt@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x140,%edi
mov    $0x140,%esi
mov    $0x140,%edx
mov    %r14,%rcx
mov    %r15,%r8
mov    %rbx,%r9
call   1060 <Kernel_vector@plt>
mov    $0x140,%edi
mov    $0x140,%esi
mov    $0x140,%edx
mov    %r14,%rcx
mov    %rbx,%r8
mov    %r15,%r9
call   1060 <Kernel_vector@plt>
xor    %eax,%eax
call   1080 <wallt@plt>
subsd  0x8(%rsp),%xmm0
movsd  0xcad(%rip),%xmm1
divsd  %xmm0,%xmm1
lea    0xcee(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xcd6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"OV_PLATFORM: %s\0A\00"
@.str.1 = [19 x i8] c"GCC COMPILER SSE 2\00"
@.str.2 = [19 x i8] c"OV_FLOAT_WIDTH %d\0A\00"
@.str.3 = [13 x i8] c"OV_ALIGN %d\0A\00"
@.str.4 = [18 x i8] c"%.1lf Msamples/s\0A\00"
@.str.5 = [10 x i8] c"Success.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca i64
%15 = alloca double
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 4)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 16)
store i64 320, i64* %6
store i64 320, i64* %7
store i64 320, i64* %8
store i64 32768000, i64* %9
store i64 131072000, i64* %10
%23 = call i64 @ov_malloc(i64 131072000)
%24 = inttoptr i64 %23 to float*
store float* %24, float** %11
%25 = call i64 @ov_malloc(i64 131072000)
%26 = inttoptr i64 %25 to float*
store float* %26, float** %12
%27 = call i64 @ov_malloc(i64 131072000)
%28 = inttoptr i64 %27 to float*
store float* %28, float** %13
store i64 0, i64* %14
br label %29
29: ; preds = %42, %2
%30 = load i64, i64* %14
%31 = icmp ult i64 %30, 32768000
br i1 %31, label %32, label %45
32: ; preds = %29
%33 = load float*, float** %11
%34 = load i64, i64* %14
%35 = getelementptr inbounds float, float* %33, i64 %34
store float 1.500000e+03, float* %35
%36 = load float*, float** %12
%37 = load i64, i64* %14
%38 = getelementptr inbounds float, float* %36, i64 %37
store float 0.000000e+00, float* %38
%39 = load float*, float** %13
%40 = load i64, i64* %14
%41 = getelementptr inbounds float, float* %39, i64 %40
store float 0.000000e+00, float* %41
br label %42
42: ; preds = %32
%43 = load i64, i64* %14
%44 = add i64 %43, 1
store i64 %44, i64* %14
br label %29
45: ; preds = %29
%46 = load float*, float** %11
%47 = load float*, float** %12
%48 = load float*, float** %13
%49 = call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %46, float* %47, float* %48)
%50 = load float*, float** %11
%51 = load float*, float** %13
%52 = load float*, float** %12
%53 = call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %50, float* %51, float* %52)
%54 = call double (...) @wallt()
store double %54, double* %15
store i32 1, i32* %16
store i32 0, i32* %17
br label %55
55: ; preds = %67, %45
%56 = load i32, i32* %17
%57 = icmp slt i32 %56, 1
br i1 %57, label %58, label %70
58: ; preds = %55
%59 = load float*, float** %11
%60 = load float*, float** %12
%61 = load float*, float** %13
%62 = call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %59, float* %60, float* %61)
%63 = load float*, float** %11
%64 = load float*, float** %13
%65 = load float*, float** %12
%66 = call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %63, float* %64, float* %65)
br label %67
67: ; preds = %58
%68 = load i32, i32* %17
%69 = add nsw i32 %68, 1
store i32 %69, i32* %17
br label %55
70: ; preds = %55
%71 = call double (...) @wallt()
store double %71, double* %18
store double 6.553600e+01, double* %19
%72 = load double, double* %19
%73 = load double, double* %18
%74 = load double, double* %15
%75 = fsub double %73, %74
%76 = fdiv double %72, %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %76)
%78 = load float*, float** %13
%79 = call i32 @free(float* %78)
%80 = load float*, float** %12
%81 = call i32 @free(float* %80)
%82 = load float*, float** %11
%83 = call i32 @free(float* %82)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"OV_PLATFORM: %s\0A\00"
@.str.1 = [19 x i8] c"GCC COMPILER SSE 2\00"
@.str.2 = [19 x i8] c"OV_FLOAT_WIDTH %d\0A\00"
@.str.3 = [13 x i8] c"OV_ALIGN %d\0A\00"
@.str.4 = [18 x i8] c"%.1lf Msamples/s\0A\00"
@str = [9 x i8] c"Success.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 4)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 16)
%6 = tail call i64 @ov_malloc(i64 131072000)
%7 = inttoptr i64 %6 to float*
%8 = inttoptr i64 %6 to i8*
%9 = tail call i64 @ov_malloc(i64 131072000)
%10 = inttoptr i64 %9 to float*
%11 = inttoptr i64 %9 to i8*
%12 = tail call i64 @ov_malloc(i64 131072000)
%13 = inttoptr i64 %12 to float*
%14 = inttoptr i64 %12 to i8*
%15 = getelementptr float, float* %7, i64 32768000
%16 = bitcast float* %15 to i8*
%17 = getelementptr float, float* %10, i64 32768000
%18 = bitcast float* %17 to i8*
%19 = getelementptr float, float* %13, i64 32768000
%20 = bitcast float* %19 to i8*
%21 = icmp ult i8* %8, %18
%22 = icmp ult i8* %11, %16
%23 = and i1 %21, %22
%24 = icmp ult i8* %8, %20
%25 = icmp ult i8* %14, %16
%26 = and i1 %24, %25
%27 = or i1 %23, %26
%28 = icmp ult i8* %11, %20
%29 = icmp ult i8* %14, %18
%30 = and i1 %28, %29
%31 = or i1 %27, %30
br i1 %31, label %75, label %32
32: ; preds = %2, %32
%33 = phi i64 [ %59, %32 ], [ 0, %2 ]
%34 = getelementptr inbounds float, float* %7, i64 %33
%35 = bitcast float* %34 to <4 x float>*
store <4 x float> <float 1.500000e+03, float 1.500000e+03, float 1.500000e+03, float 1.500000e+03>, <4 x float>* %35
%36 = getelementptr inbounds float, float* %34, i64 4
%37 = bitcast float* %36 to <4 x float>*
store <4 x float> <float 1.500000e+03, float 1.500000e+03, float 1.500000e+03, float 1.500000e+03>, <4 x float>* %37
%38 = getelementptr inbounds float, float* %10, i64 %33
%39 = bitcast float* %38 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %39
%40 = getelementptr inbounds float, float* %38, i64 4
%41 = bitcast float* %40 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %41
%42 = getelementptr inbounds float, float* %13, i64 %33
%43 = bitcast float* %42 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %43
%44 = getelementptr inbounds float, float* %42, i64 4
%45 = bitcast float* %44 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %45
%46 = or i64 %33, 8
%47 = getelementptr inbounds float, float* %7, i64 %46
%48 = bitcast float* %47 to <4 x float>*
store <4 x float> <float 1.500000e+03, float 1.500000e+03, float 1.500000e+03, float 1.500000e+03>, <4 x float>* %48
%49 = getelementptr inbounds float, float* %47, i64 4
%50 = bitcast float* %49 to <4 x float>*
store <4 x float> <float 1.500000e+03, float 1.500000e+03, float 1.500000e+03, float 1.500000e+03>, <4 x float>* %50
%51 = getelementptr inbounds float, float* %10, i64 %46
%52 = bitcast float* %51 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %52
%53 = getelementptr inbounds float, float* %51, i64 4
%54 = bitcast float* %53 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %54
%55 = getelementptr inbounds float, float* %13, i64 %46
%56 = bitcast float* %55 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %56
%57 = getelementptr inbounds float, float* %55, i64 4
%58 = bitcast float* %57 to <4 x float>*
store <4 x float> zeroinitializer, <4 x float>* %58
%59 = add nuw nsw i64 %33, 16
%60 = icmp eq i64 %59, 32768000
br i1 %60, label %61, label %32
61: ; preds = %32, %75
%62 = tail call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %7, float* %10, float* %13)
%63 = tail call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %7, float* %13, float* %10)
%64 = tail call double (...) @wallt()
%65 = tail call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %7, float* %10, float* %13)
%66 = tail call i32 @Kernel_vector(i64 320, i64 320, i64 320, float* %7, float* %13, float* %10)
%67 = tail call double (...) @wallt()
%68 = fsub double %67, %64
%69 = fdiv double 6.553600e+01, %68
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), double %69)
%71 = tail call i32 @free(float* %13)
%72 = tail call i32 @free(float* %10)
%73 = tail call i32 @free(float* %7)
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
75: ; preds = %2, %75
%76 = phi i64 [ %84, %75 ], [ 0, %2 ]
%77 = getelementptr inbounds float, float* %7, i64 %76
store float 1.500000e+03, float* %77
%78 = getelementptr inbounds float, float* %10, i64 %76
store float 0.000000e+00, float* %78
%79 = getelementptr inbounds float, float* %13, i64 %76
store float 0.000000e+00, float* %79
%80 = or i64 %76, 1
%81 = getelementptr inbounds float, float* %7, i64 %80
store float 1.500000e+03, float* %81
%82 = getelementptr inbounds float, float* %10, i64 %80
store float 0.000000e+00, float* %82
%83 = getelementptr inbounds float, float* %13, i64 %80
store float 0.000000e+00, float* %83
%84 = add nuw nsw i64 %76, 2
%85 = icmp eq i64 %84, 32768000
br i1 %85, label %61, label %75
}