#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*/ bar(int ***);
void foo(int a[10][10][10], int **b, int x) {
  int c[10][10][10];
#pragma omp task depend(out : a [2:4] [3:0][:7])
  bar(a);
#pragma omp task depend(inout : b[:7] [0:0][:0])
  bar(a);
#pragma omp task depend(in : c[:][:] [10:])
  bar(c);
#pragma omp task depend(out : a [2:4] [3:0][:x])
  bar(a);
#pragma omp task depend(inout : b[:x] [0:0][:0])
  bar(a);
#pragma omp task depend(in : c[:] [x - 2:x] [10:])
  bar(c);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
lea    -0xfc0(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
lea    -0xfc0(%rbp),%rdi
call   1030 <bar@plt>
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
sub    $0xfa8,%rsp
mov    %rdi,%rbx
call   1030 <bar@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <bar@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
mov    %r14,%rdi
call   1030 <bar@plt>
add    $0xfa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @foo([10 x [10 x i32]]* %0, i32** %1, i32 %2) {
%4 = alloca [10 x [10 x i32]]*
%5 = alloca i32**
%6 = alloca i32
%7 = alloca [10 x [10 x [10 x i32]]]
store [10 x [10 x i32]]* %0, [10 x [10 x i32]]** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
%8 = load [10 x [10 x i32]]*, [10 x [10 x i32]]** %4
%9 = bitcast [10 x [10 x i32]]* %8 to i32***
%10 = call i32 @bar(i32*** %9)
%11 = load [10 x [10 x i32]]*, [10 x [10 x i32]]** %4
%12 = bitcast [10 x [10 x i32]]* %11 to i32***
%13 = call i32 @bar(i32*** %12)
%14 = getelementptr inbounds [10 x [10 x [10 x i32]]], [10 x [10 x [10 x i32]]]* %7, i64 0, i64 0
%15 = bitcast [10 x [10 x i32]]* %14 to i32***
%16 = call i32 @bar(i32*** %15)
%17 = load [10 x [10 x i32]]*, [10 x [10 x i32]]** %4
%18 = bitcast [10 x [10 x i32]]* %17 to i32***
%19 = call i32 @bar(i32*** %18)
%20 = load [10 x [10 x i32]]*, [10 x [10 x i32]]** %4
%21 = bitcast [10 x [10 x i32]]* %20 to i32***
%22 = call i32 @bar(i32*** %21)
%23 = getelementptr inbounds [10 x [10 x [10 x i32]]], [10 x [10 x [10 x i32]]]* %7, i64 0, i64 0
%24 = bitcast [10 x [10 x i32]]* %23 to i32***
%25 = call i32 @bar(i32*** %24)
ret void
}

LLVM IR (-O2):
define void @foo([10 x [10 x i32]]* %0, i32** nocapture readnone %1, i32 %2) {
%4 = alloca [10 x [10 x [10 x i32]]]
%5 = bitcast [10 x [10 x [10 x i32]]]* %4 to i8*
%6 = bitcast [10 x [10 x i32]]* %0 to i32***
%7 = tail call i32 @bar(i32*** %6)
%8 = tail call i32 @bar(i32*** %6)
%9 = bitcast [10 x [10 x [10 x i32]]]* %4 to i32***
%10 = call i32 @bar(i32*** %9)
%11 = call i32 @bar(i32*** %6)
%12 = call i32 @bar(i32*** %6)
%13 = call i32 @bar(i32*** %9)
ret void
}