#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*/ lin_solve_computation(int, int, int);
int kernel1() {
  while (1) {
#pragma acr grid(4)
#pragma acr monitor(int temporary_array[i][j], max, solve_to_char)
#pragma acr alternative low(parameter, N = 5)
#pragma acr alternative medium(parameter, N = 10)
#pragma acr alternative high(function, lin_solve_computation = do_nothing)
#pragma acr strategy direct(1, high)
#pragma acr strategy direct(2, medium)
#pragma acr strategy direct(3, low)
#pragma acr strategy direct(55, low)
#pragma acr strategy direct(254, low)
    for (int k = 0; k < 15; ++k)
      for (int i = 0; i < 10; ++i)
        for (int j = 0; j < 15; ++j)
          lin_solve_computation(k, i, j);
  }
#pragma acr destroy
}


x86 assembly (clang, -O0):
<kernel1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jge    118d <kernel1+0x7d>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    117a <kernel1+0x6a>
movl   $0x0,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jge    1167 <kernel1+0x57>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <lin_solve_computation@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <kernel1+0x31>
jmp    116c <kernel1+0x5c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <kernel1+0x20>
jmp    117f <kernel1+0x6f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <kernel1+0xf>
jmp    1118 <kernel1+0x8>

x86 assembly (clang, -O2):
<kernel1>:
push   %rbp
push   %rbx
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x2,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x3,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x5,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x6,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x7,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x8,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x9,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0xa,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0xb,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0xc,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0xd,%edx
call   1030 <lin_solve_computation@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0xe,%edx
call   1030 <lin_solve_computation@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1140 <kernel1+0x30>
add    $0x1,%ebx
cmp    $0xf,%ebx
jne    1130 <kernel1+0x20>
jmp    1120 <kernel1+0x10>

LLVM IR (-O0):
define i32 @kernel1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0, %32
store i32 0, i32* %1
br label %5
5: ; preds = %29, %4
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 15
br i1 %7, label %8, label %32
8: ; preds = %5
store i32 0, i32* %2
br label %9
9: ; preds = %25, %8
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %28
12: ; preds = %9
store i32 0, i32* %3
br label %13
13: ; preds = %21, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 15
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = call i32 @lin_solve_computation(i32 %17, i32 %18, i32 %19)
br label %21
21: ; preds = %16
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %13
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %9
28: ; preds = %9
br label %29
29: ; preds = %28
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %5
32: ; preds = %5
br label %4
}

LLVM IR (-O2):
define i32 @kernel1() {
br label %1
1: ; preds = %23, %0
br label %2
2: ; preds = %1, %23
%3 = phi i32 [ 0, %1 ], [ %24, %23 ]
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %21, %4 ]
%6 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 0)
%7 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 1)
%8 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 2)
%9 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 3)
%10 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 4)
%11 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 5)
%12 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 6)
%13 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 7)
%14 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 8)
%15 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 9)
%16 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 10)
%17 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 11)
%18 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 12)
%19 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 13)
%20 = tail call i32 @lin_solve_computation(i32 %3, i32 %5, i32 14)
%21 = add nuw nsw i32 %5, 1
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %4
23: ; preds = %4
%24 = add nuw nsw i32 %3, 1
%25 = icmp eq i32 %24, 15
br i1 %25, label %1, label %2
}