#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 a, b, c;
  float in[16][16];
  float out[1];
  out[0] = -1;
  for (a = 0; a < 16; a++) {
    for (b = 0; b < 16; b++) {
      in[a][b] = 1.001;
    }
  }
  for (a = 0; a < 16; a++) {
#pragma scop
    {
#pragma species kernel out[0 : 0] | full ^ in[a : a, 0 : a] |                  \
                                              element->out[0 : 0] | shared
      for (b = 0; b <= a; b++) {
        out[0] = out[0] - in[a][b] * in[a][b];
      }
#pragma species endkernel example05_k1
    }
#pragma endscop
    out[0] = 1.002;
  }
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x414(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1198 <main+0x88>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1185 <main+0x75>
movslq -0x8(%rbp),%rcx
lea    -0x410(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  0xe96(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x3a>
jmp    118a <main+0x7a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x29>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1243 <main+0x133>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1225 <main+0x115>
movss  -0x414(%rbp),%xmm1
ff
movslq -0x8(%rbp),%rcx
lea    -0x410(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0x8(%rbp),%rcx
lea    -0x410(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x414(%rbp)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b0 <main+0xa0>
movss  0xdd7(%rip),%xmm0
movss  %xmm0,-0x414(%rbp)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119f <main+0x8f>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
add    $0x420,%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 i32
%5 = alloca [16 x [16 x float]]
%6 = alloca [1 x float]
store i32 0, i32* %1
%7 = getelementptr inbounds [1 x float], [1 x float]* %6, i64 0, i64 0
store float -1.000000e+00, float* %7
store i32 0, i32* %2
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 16
br i1 %10, label %11, label %29
11: ; preds = %8
store i32 0, i32* %3
br label %12
12: ; preds = %22, %11
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 16
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [16 x [16 x float]], [16 x [16 x float]]* %5, i64 0, i64 %17
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [16 x float], [16 x float]* %18, i64 0, i64 %20
store float 0x3FF00418A0000000, float* %21
br label %22
22: ; preds = %15
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %12
25: ; preds = %12
br label %26
26: ; preds = %25
%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, 16
br i1 %32, label %33, label %66
33: ; preds = %30
store i32 0, i32* %3
br label %34
34: ; preds = %58, %33
%35 = load i32, i32* %3
%36 = load i32, i32* %2
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %61
38: ; preds = %34
%39 = getelementptr inbounds [1 x float], [1 x float]* %6, i64 0, i64 0
%40 = load float, float* %39
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [16 x [16 x float]], [16 x [16 x float]]* %5, i64 0, i64 %42
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [16 x float], [16 x float]* %43, i64 0, i64 %45
%47 = load float, float* %46
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [16 x [16 x float]], [16 x [16 x float]]* %5, i64 0, i64 %49
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [16 x float], [16 x float]* %50, i64 0, i64 %52
%54 = load float, float* %53
%55 = fneg float %47
%56 = call float @llvm.fmuladd.f32(float %55, float %54, float %40)
%57 = getelementptr inbounds [1 x float], [1 x float]* %6, i64 0, i64 0
store float %56, float* %57
br label %58
58: ; preds = %38
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %34
61: ; preds = %34
%62 = getelementptr inbounds [1 x float], [1 x float]* %6, i64 0, i64 0
store float 0x3FF0083120000000, float* %62
br label %63
63: ; preds = %61
%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
}