#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;
  int N = 256;
  int A[N];
  int B[N];
  for (i = 0; i < N; i++) {
    A[i] = i;
    B[i] = i + 5;
  }
#pragma scop
  {
#pragma species kernel A[2 : N - 1] | chunk(0 : 1)->B[2 : N - 1] | chunk(0 : 1)
    for (i = 2; i < N - 1; i = i + 2) {
      B[i] = A[i];
      B[i + 1] = A[i + 1];
    }
#pragma species endkernel example06_k1
  }
#pragma endscop
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x100,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ad <main+0x9d>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rdx
mov    %esi,(%rcx,%rdx,4)
mov    -0x8(%rbp),%edx
add    $0x5,%edx
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x64>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1201 <main+0xf1>
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq -0x8(%rbp),%rdx
mov    (%rcx,%rdx,4),%esi
movslq -0x8(%rbp),%rdx
mov    %esi,(%rax,%rdx,4)
mov    -0x8(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    11b4 <main+0xa4>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%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 i8*
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i32 256, i32* %3
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %4
%10 = alloca i32, i64 %8
store i64 %8, i64* %5
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = alloca i32, i64 %12
store i64 %12, i64* %6
store i32 0, i32* %2
br label %14
14: ; preds = %28, %0
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = load i32, i32* %2
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %10, i64 %21
store i32 %19, i32* %22
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 5
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %13, i64 %26
store i32 %24, i32* %27
br label %28
28: ; preds = %18
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %14
31: ; preds = %14
store i32 2, i32* %2
br label %32
32: ; preds = %54, %31
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = sub nsw i32 %34, 1
%36 = icmp slt i32 %33, %35
br i1 %36, label %37, label %57
37: ; preds = %32
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %10, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %13, i64 %43
store i32 %41, i32* %44
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %10, i64 %47
%49 = load i32, i32* %48
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %13, i64 %52
store i32 %49, i32* %53
br label %54
54: ; preds = %37
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 2
store i32 %56, i32* %2
br label %32
57: ; preds = %32
%58 = load i32, i32* @stdout
%59 = call i32 @fflush(i32 %58)
store i32 0, i32* %1
%60 = load i8*, i8** %4
%61 = load i32, i32* %1
ret i32 %61
}

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
}