#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, j;
  int A[4][8];
  int B[4][8];
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 8; j++) {
      A[i][j] = i + j;
    }
  }
#pragma scop
#pragma species kernel A[0 : 3, 0 : 7] | element->B[0 : 3, 0 : 7] | element
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 8; j++) {
      B[i][j] = A[i][7 - j];
    }
  }
#pragma species endkernel example2
#pragma endscop
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1184 <main+0x74>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1171 <main+0x61>
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
movslq -0x8(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
jmp    1176 <main+0x66>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1200 <main+0xf0>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    11ed <main+0xdd>
movslq -0x8(%rbp),%rcx
lea    -0x90(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    $0x7,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119c <main+0x8c>
jmp    11f2 <main+0xe2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118b <main+0x7b>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
xor    %eax,%eax
add    $0x110,%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 [4 x [8 x i32]]
%5 = alloca [4 x [8 x i32]]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %30
9: ; preds = %6
store i32 0, i32* %3
br label %10
10: ; preds = %23, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %4, i64 0, i64 %18
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 %21
store i32 %16, i32* %22
br label %23
23: ; preds = %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %10
26: ; preds = %10
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %6
30: ; preds = %6
store i32 0, i32* %2
br label %31
31: ; preds = %57, %30
%32 = load i32, i32* %2
%33 = icmp slt i32 %32, 4
br i1 %33, label %34, label %60
34: ; preds = %31
store i32 0, i32* %3
br label %35
35: ; preds = %53, %34
%36 = load i32, i32* %3
%37 = icmp slt i32 %36, 8
br i1 %37, label %38, label %56
38: ; preds = %35
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %4, i64 0, i64 %40
%42 = load i32, i32* %3
%43 = sub nsw i32 7, %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [8 x i32], [8 x i32]* %41, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [4 x [8 x i32]], [4 x [8 x i32]]* %5, i64 0, i64 %48
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [8 x i32], [8 x i32]* %49, i64 0, i64 %51
store i32 %46, i32* %52
br label %53
53: ; preds = %38
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %35
56: ; preds = %35
br label %57
57: ; preds = %56
%58 = load i32, i32* %2
%59 = add nsw i32 %58, 1
store i32 %59, i32* %2
br label %31
60: ; preds = %31
%61 = load i32, i32* @stdout
%62 = call i32 @fflush(i32 %61)
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
}