#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  int i, l;
  float factor = 0;
  float A[700];
  float B[700];
  float C[700];
  for (i = 0; i < 700; i++) {
    A[i] = i * 2.3;
    B[i] = i + 6.0;
  }
#pragma scop
#pragma species kernel A[0 : 699] | element ^ B[0 : 699] |                     \
                                                element->C[0 : 699] | element
  for (i = 0; i < 700; i++) {
    factor = 0.5;
    for (l = 0; l < 3; l++) {
      factor = factor + 0.2 * factor;
    }
    C[i] = factor * A[i] + factor * B[i];
  }
#pragma species endkernel example4
#pragma endscop
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20e0,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2bc,-0x8(%rbp)
jge    1190 <main+0x80>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0xb00(%rbp,%rax,4)
ff ff
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x15f0(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <main+0x21>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2bc,-0x8(%rbp)
jge    1242 <main+0x132>
movss  0xe54(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    11fb <main+0xeb>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b8 <main+0xa8>
movss  -0x10(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movss  -0xb00(%rbp,%rax,4),%xmm2
ff ff
movss  -0x10(%rbp),%xmm1
movslq -0x8(%rbp),%rax
mulss  -0x15f0(%rbp,%rax,4),%xmm1
ff ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x20e0(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1197 <main+0x87>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
add    $0x20e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca [700 x float]
%6 = alloca [700 x float]
%7 = alloca [700 x float]
store i32 0, i32* %1
store float 0.000000e+00, float* %4
store i32 0, i32* %2
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 700
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 2.300000e+00
%15 = fptrunc double %14 to float
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [700 x float], [700 x float]* %5, i64 0, i64 %17
store float %15, float* %18
%19 = load i32, i32* %2
%20 = sitofp i32 %19 to double
%21 = fadd double %20, 6.000000e+00
%22 = fptrunc double %21 to float
%23 = load i32, i32* %2
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [700 x float], [700 x float]* %6, i64 0, i64 %24
store float %22, float* %25
br label %26
26: ; preds = %11
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %8
29: ; preds = %8
store i32 0, i32* %2
br label %30
30: ; preds = %63, %29
%31 = load i32, i32* %2
%32 = icmp slt i32 %31, 700
br i1 %32, label %33, label %66
33: ; preds = %30
store float 5.000000e-01, float* %4
store i32 0, i32* %3
br label %34
34: ; preds = %44, %33
%35 = load i32, i32* %3
%36 = icmp slt i32 %35, 3
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = load float, float* %4
%39 = fpext float %38 to double
%40 = load float, float* %4
%41 = fpext float %40 to double
%42 = call double @llvm.fmuladd.f64(double 2.000000e-01, double %41, double %39)
%43 = fptrunc double %42 to float
store float %43, float* %4
br label %44
44: ; preds = %37
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %34
47: ; preds = %34
%48 = load float, float* %4
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [700 x float], [700 x float]* %5, i64 0, i64 %50
%52 = load float, float* %51
%53 = load float, float* %4
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [700 x float], [700 x float]* %6, i64 0, i64 %55
%57 = load float, float* %56
%58 = fmul float %53, %57
%59 = call float @llvm.fmuladd.f32(float %48, float %52, float %58)
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [700 x float], [700 x float]* %7, i64 0, i64 %61
store float %59, float* %62
br label %63
63: ; preds = %47
%64 = load i32, i32* %2
%65 = add nsw i32 %64, 1
store i32 %65, i32* %2
br label %30
66: ; preds = %30
%67 = load i32, i32* @stdout
%68 = call i32 @fflush(i32 %67)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret i32 0
}