#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, int);
void foo(void) {
#pragma omp parallel
#pragma omp for simd collapse(2)
  for (int i = 0; i < 16; ++i)
    for (int j = 0; j < 16; ++j)
      bar(i, j);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1166 <foo+0x56>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1153 <foo+0x43>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <foo+0x20>
jmp    1158 <foo+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0x9,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0xa,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0xb,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0xc,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0xd,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0xe,%esi
call   1030 <bar@plt>
mov    %ebx,%edi
mov    $0xf,%esi
call   1030 <bar@plt>
add    $0x1,%ebx
cmp    $0x10,%ebx
jne    1120 <foo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %21
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @bar(i32 %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %3
21: ; preds = %3
ret void
}

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