#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*/ abort();
int omp_get_default_device();
scalar_t__ omp_get_level();
int omp_get_num_devices();
int /*<<< orphan*/ omp_is_initial_device();
void foo(int f) {
  int d = f ? omp_get_num_devices() : omp_get_default_device();
  int h = 5;
#pragma omp target device(d)
  if (omp_get_level() != 0)
    abort();
#pragma omp target if (v > 1)
  if (omp_get_level() != 0 || !omp_is_initial_device())
    abort();
#pragma omp target device(d) if (v > 1)
  if (omp_get_level() != 0 || !omp_is_initial_device())
    abort();
#pragma omp target if (v <= 1)
  if (omp_get_level() != 0 || (f && !omp_is_initial_device()))
    abort();
#pragma omp target device(d) if (v <= 1)
  if (omp_get_level() != 0 || (f && !omp_is_initial_device()))
    abort();
#pragma omp target if (0)
  if (omp_get_level() != 0 || !omp_is_initial_device())
    abort();
#pragma omp target device(d) if (0)
  if (omp_get_level() != 0 || !omp_is_initial_device())
    abort();
#pragma omp target if (1)
  if (omp_get_level() != 0 || (f && !omp_is_initial_device()))
    abort();
#pragma omp target device(d) if (1)
  if (omp_get_level() != 0 || (f && !omp_is_initial_device()))
    abort();
#pragma omp target data device(d) map(to : h)
  {
#pragma omp target device(d)
    if (omp_get_level() != 0 || (f && !omp_is_initial_device()) || h++ != 5)
      abort();
#pragma omp target update device(d) from(h)
  }
#pragma omp target data if (v > 1) map(to : h)
  {
#pragma omp target if (v > 1)
    if (omp_get_level() != 0 || !omp_is_initial_device() || h++ != 6)
      abort();
#pragma omp target update if (v > 1) from(h)
  }
#pragma omp target data device(d) if (v > 1) map(to : h)
  {
#pragma omp target device(d) if (v > 1)
    if (omp_get_level() != 0 || !omp_is_initial_device() || h++ != 7)
      abort();
#pragma omp target update device(d) if (v > 1) from(h)
  }
#pragma omp target data if (v <= 1) map(to : h)
  {
#pragma omp target if (v <= 1)
    if (omp_get_level() != 0 || (f && !omp_is_initial_device()) || h++ != 8)
      abort();
#pragma omp target update if (v <= 1) from(h)
  }
#pragma omp target data device(d) if (v <= 1) map(to : h)
  {
#pragma omp target device(d) if (v <= 1)
    if (omp_get_level() != 0 || (f && !omp_is_initial_device()) || h++ != 9)
      abort();
#pragma omp target update device(d) if (v <= 1) from(h)
  }
#pragma omp target data if (0) map(to : h)
  {
#pragma omp target if (0)
    if (omp_get_level() != 0 || !omp_is_initial_device() || h++ != 10)
      abort();
#pragma omp target update if (0) from(h)
  }
#pragma omp target data device(d) if (0) map(to : h)
  {
#pragma omp target device(d) if (0)
    if (omp_get_level() != 0 || !omp_is_initial_device() || h++ != 11)
      abort();
#pragma omp target update device(d) if (0) from(h)
  }
#pragma omp target data if (1) map(to : h)
  {
#pragma omp target if (1)
    if (omp_get_level() != 0 || (f && !omp_is_initial_device()) || h++ != 12)
      abort();
#pragma omp target update if (1) from(h)
  }
#pragma omp target data device(d) if (1) map(to : h)
  {
#pragma omp target device(d) if (1)
    if (omp_get_level() != 0 || (f && !omp_is_initial_device()) || h++ != 13)
      abort();
#pragma omp target update device(d) if (1) from(h)
  }
  if (h != 14)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1174 <foo+0x24>
mov    $0x0,%al
call   1060 <omp_get_num_devices@plt>
mov    %eax,-0x10(%rbp)
jmp    117e <foo+0x2e>
mov    $0x0,%al
call   1040 <omp_get_default_device@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
je     11a3 <foo+0x53>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    11c4 <foo+0x74>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    11cb <foo+0x7b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    11ec <foo+0x9c>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    11f3 <foo+0xa3>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    121e <foo+0xce>
cmpl   $0x0,-0x4(%rbp)
je     1225 <foo+0xd5>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    1225 <foo+0xd5>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    1250 <foo+0x100>
cmpl   $0x0,-0x4(%rbp)
je     1257 <foo+0x107>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    1257 <foo+0x107>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    1278 <foo+0x128>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    127f <foo+0x12f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    12a0 <foo+0x150>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    12a7 <foo+0x157>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    12d2 <foo+0x182>
cmpl   $0x0,-0x4(%rbp)
je     12d9 <foo+0x189>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    12d9 <foo+0x189>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    1304 <foo+0x1b4>
cmpl   $0x0,-0x4(%rbp)
je     130b <foo+0x1bb>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
jne    130b <foo+0x1bb>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    134a <foo+0x1fa>
cmpl   $0x0,-0x4(%rbp)
je     1336 <foo+0x1e6>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     134a <foo+0x1fa>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x5,%eax
je     1351 <foo+0x201>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    1386 <foo+0x236>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     1386 <foo+0x236>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x6,%eax
je     138d <foo+0x23d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    13c2 <foo+0x272>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     13c2 <foo+0x272>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x7,%eax
je     13c9 <foo+0x279>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    1408 <foo+0x2b8>
cmpl   $0x0,-0x4(%rbp)
je     13f4 <foo+0x2a4>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     1408 <foo+0x2b8>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x8,%eax
je     140f <foo+0x2bf>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    144e <foo+0x2fe>
cmpl   $0x0,-0x4(%rbp)
je     143a <foo+0x2ea>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     144e <foo+0x2fe>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x9,%eax
je     1455 <foo+0x305>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    148a <foo+0x33a>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     148a <foo+0x33a>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0xa,%eax
je     1491 <foo+0x341>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    14c6 <foo+0x376>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     14c6 <foo+0x376>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0xb,%eax
je     14cd <foo+0x37d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    150c <foo+0x3bc>
cmpl   $0x0,-0x4(%rbp)
je     14f8 <foo+0x3a8>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     150c <foo+0x3bc>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0xc,%eax
je     1513 <foo+0x3c3>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <omp_get_level@plt>
cmp    $0x0,%rax
jne    1552 <foo+0x402>
cmpl   $0x0,-0x4(%rbp)
je     153e <foo+0x3ee>
mov    $0x0,%al
call   1070 <omp_is_initial_device@plt>
cmp    $0x0,%eax
je     1552 <foo+0x402>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0xd,%eax
je     1559 <foo+0x409>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0xe,-0xc(%rbp)
je     156a <foo+0x41a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
test   %edi,%edi
je     1160 <foo+0x10>
call   1060 <omp_get_num_devices@plt>
jmp    1165 <foo+0x15>
call   1040 <omp_get_default_device@plt>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
test   %ebx,%ebx
je     11f6 <foo+0xa6>
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
jne    1204 <foo+0xb4>
jmp    13b6 <foo+0x266>
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
test   %ebx,%ebx
je     12a4 <foo+0x154>
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
jne    12c2 <foo+0x172>
jmp    13b6 <foo+0x266>
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
test   %ebx,%ebx
je     1340 <foo+0x1f0>
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
jne    134a <foo+0x1fa>
jmp    13b6 <foo+0x266>
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
test   %ebx,%ebx
je     13ac <foo+0x25c>
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
xor    %eax,%eax
call   1050 <omp_get_level@plt>
test   %rax,%rax
jne    13b6 <foo+0x266>
xor    %eax,%eax
call   1070 <omp_is_initial_device@plt>
test   %eax,%eax
je     13b6 <foo+0x266>
pop    %rbx
ret
call   1050 <omp_get_level@plt>
test   %rax,%rax
je     13aa <foo+0x25a>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @omp_get_num_devices()
br label %11
9: ; preds = %1
%10 = call i32 (...) @omp_get_default_device()
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
store i32 %12, i32* %3
store i32 5, i32* %4
%13 = call i64 (...) @omp_get_level()
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %11
%18 = call i64 (...) @omp_get_level()
%19 = icmp ne i64 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = call i32 (...) @omp_is_initial_device()
%22 = icmp ne i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20, %17
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %20
%26 = call i64 (...) @omp_get_level()
%27 = icmp ne i64 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = call i32 (...) @omp_is_initial_device()
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %28, %25
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %28
%34 = call i64 (...) @omp_get_level()
%35 = icmp ne i64 %34, 0
br i1 %35, label %42, label %36
36: ; preds = %33
%37 = load i32, i32* %2
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = call i32 (...) @omp_is_initial_device()
%41 = icmp ne i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39, %33
%43 = call i32 (...) @abort()
unreachable
44: ; preds = %39, %36
%45 = call i64 (...) @omp_get_level()
%46 = icmp ne i64 %45, 0
br i1 %46, label %53, label %47
47: ; preds = %44
%48 = load i32, i32* %2
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = call i32 (...) @omp_is_initial_device()
%52 = icmp ne i32 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %50, %44
%54 = call i32 (...) @abort()
unreachable
55: ; preds = %50, %47
%56 = call i64 (...) @omp_get_level()
%57 = icmp ne i64 %56, 0
br i1 %57, label %61, label %58
58: ; preds = %55
%59 = call i32 (...) @omp_is_initial_device()
%60 = icmp ne i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %58, %55
%62 = call i32 (...) @abort()
unreachable
63: ; preds = %58
%64 = call i64 (...) @omp_get_level()
%65 = icmp ne i64 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %63
%67 = call i32 (...) @omp_is_initial_device()
%68 = icmp ne i32 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %66, %63
%70 = call i32 (...) @abort()
unreachable
71: ; preds = %66
%72 = call i64 (...) @omp_get_level()
%73 = icmp ne i64 %72, 0
br i1 %73, label %80, label %74
74: ; preds = %71
%75 = load i32, i32* %2
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %82
77: ; preds = %74
%78 = call i32 (...) @omp_is_initial_device()
%79 = icmp ne i32 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %77, %71
%81 = call i32 (...) @abort()
unreachable
82: ; preds = %77, %74
%83 = call i64 (...) @omp_get_level()
%84 = icmp ne i64 %83, 0
br i1 %84, label %91, label %85
85: ; preds = %82
%86 = load i32, i32* %2
%87 = icmp ne i32 %86, 0
br i1 %87, label %88, label %93
88: ; preds = %85
%89 = call i32 (...) @omp_is_initial_device()
%90 = icmp ne i32 %89, 0
br i1 %90, label %93, label %91
91: ; preds = %88, %82
%92 = call i32 (...) @abort()
unreachable
93: ; preds = %88, %85
%94 = call i64 (...) @omp_get_level()
%95 = icmp ne i64 %94, 0
br i1 %95, label %106, label %96
96: ; preds = %93
%97 = load i32, i32* %2
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %96
%100 = call i32 (...) @omp_is_initial_device()
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %106
102: ; preds = %99, %96
%103 = load i32, i32* %4
%104 = add nsw i32 %103, 1
store i32 %104, i32* %4
%105 = icmp ne i32 %103, 5
br i1 %105, label %106, label %108
106: ; preds = %102, %99, %93
%107 = call i32 (...) @abort()
unreachable
108: ; preds = %102
%109 = call i64 (...) @omp_get_level()
%110 = icmp ne i64 %109, 0
br i1 %110, label %118, label %111
111: ; preds = %108
%112 = call i32 (...) @omp_is_initial_device()
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %118
114: ; preds = %111
%115 = load i32, i32* %4
%116 = add nsw i32 %115, 1
store i32 %116, i32* %4
%117 = icmp ne i32 %115, 6
br i1 %117, label %118, label %120
118: ; preds = %114, %111, %108
%119 = call i32 (...) @abort()
unreachable
120: ; preds = %114
%121 = call i64 (...) @omp_get_level()
%122 = icmp ne i64 %121, 0
br i1 %122, label %130, label %123
123: ; preds = %120
%124 = call i32 (...) @omp_is_initial_device()
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %130
126: ; preds = %123
%127 = load i32, i32* %4
%128 = add nsw i32 %127, 1
store i32 %128, i32* %4
%129 = icmp ne i32 %127, 7
br i1 %129, label %130, label %132
130: ; preds = %126, %123, %120
%131 = call i32 (...) @abort()
unreachable
132: ; preds = %126
%133 = call i64 (...) @omp_get_level()
%134 = icmp ne i64 %133, 0
br i1 %134, label %145, label %135
135: ; preds = %132
%136 = load i32, i32* %2
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %141
138: ; preds = %135
%139 = call i32 (...) @omp_is_initial_device()
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %145
141: ; preds = %138, %135
%142 = load i32, i32* %4
%143 = add nsw i32 %142, 1
store i32 %143, i32* %4
%144 = icmp ne i32 %142, 8
br i1 %144, label %145, label %147
145: ; preds = %141, %138, %132
%146 = call i32 (...) @abort()
unreachable
147: ; preds = %141
%148 = call i64 (...) @omp_get_level()
%149 = icmp ne i64 %148, 0
br i1 %149, label %160, label %150
150: ; preds = %147
%151 = load i32, i32* %2
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %156
153: ; preds = %150
%154 = call i32 (...) @omp_is_initial_device()
%155 = icmp ne i32 %154, 0
br i1 %155, label %156, label %160
156: ; preds = %153, %150
%157 = load i32, i32* %4
%158 = add nsw i32 %157, 1
store i32 %158, i32* %4
%159 = icmp ne i32 %157, 9
br i1 %159, label %160, label %162
160: ; preds = %156, %153, %147
%161 = call i32 (...) @abort()
unreachable
162: ; preds = %156
%163 = call i64 (...) @omp_get_level()
%164 = icmp ne i64 %163, 0
br i1 %164, label %172, label %165
165: ; preds = %162
%166 = call i32 (...) @omp_is_initial_device()
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %172
168: ; preds = %165
%169 = load i32, i32* %4
%170 = add nsw i32 %169, 1
store i32 %170, i32* %4
%171 = icmp ne i32 %169, 10
br i1 %171, label %172, label %174
172: ; preds = %168, %165, %162
%173 = call i32 (...) @abort()
unreachable
174: ; preds = %168
%175 = call i64 (...) @omp_get_level()
%176 = icmp ne i64 %175, 0
br i1 %176, label %184, label %177
177: ; preds = %174
%178 = call i32 (...) @omp_is_initial_device()
%179 = icmp ne i32 %178, 0
br i1 %179, label %180, label %184
180: ; preds = %177
%181 = load i32, i32* %4
%182 = add nsw i32 %181, 1
store i32 %182, i32* %4
%183 = icmp ne i32 %181, 11
br i1 %183, label %184, label %186
184: ; preds = %180, %177, %174
%185 = call i32 (...) @abort()
unreachable
186: ; preds = %180
%187 = call i64 (...) @omp_get_level()
%188 = icmp ne i64 %187, 0
br i1 %188, label %199, label %189
189: ; preds = %186
%190 = load i32, i32* %2
%191 = icmp ne i32 %190, 0
br i1 %191, label %192, label %195
192: ; preds = %189
%193 = call i32 (...) @omp_is_initial_device()
%194 = icmp ne i32 %193, 0
br i1 %194, label %195, label %199
195: ; preds = %192, %189
%196 = load i32, i32* %4
%197 = add nsw i32 %196, 1
store i32 %197, i32* %4
%198 = icmp ne i32 %196, 12
br i1 %198, label %199, label %201
199: ; preds = %195, %192, %186
%200 = call i32 (...) @abort()
unreachable
201: ; preds = %195
%202 = call i64 (...) @omp_get_level()
%203 = icmp ne i64 %202, 0
br i1 %203, label %214, label %204
204: ; preds = %201
%205 = load i32, i32* %2
%206 = icmp ne i32 %205, 0
br i1 %206, label %207, label %210
207: ; preds = %204
%208 = call i32 (...) @omp_is_initial_device()
%209 = icmp ne i32 %208, 0
br i1 %209, label %210, label %214
210: ; preds = %207, %204
%211 = load i32, i32* %4
%212 = add nsw i32 %211, 1
store i32 %212, i32* %4
%213 = icmp ne i32 %211, 13
br i1 %213, label %214, label %216
214: ; preds = %210, %207, %201
%215 = call i32 (...) @abort()
unreachable
216: ; preds = %210
%217 = load i32, i32* %4
%218 = icmp ne i32 %217, 14
br i1 %218, label %219, label %221
219: ; preds = %216
%220 = call i32 (...) @abort()
unreachable
221: ; preds = %216
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @omp_get_num_devices()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @omp_get_default_device()
br label %7
7: ; preds = %5, %3
%8 = tail call i64 (...) @omp_get_level()
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = tail call i64 (...) @omp_get_level()
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = tail call i32 (...) @omp_is_initial_device()
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15, %12
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %15
%21 = tail call i64 (...) @omp_get_level()
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = tail call i32 (...) @omp_is_initial_device()
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23, %20
%27 = tail call i32 (...) @abort()
unreachable
28: ; preds = %23
%29 = tail call i64 (...) @omp_get_level()
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
br i1 %2, label %37, label %32
32: ; preds = %31
%33 = tail call i32 (...) @omp_is_initial_device()
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %40
35: ; preds = %32, %28
%36 = tail call i32 (...) @abort()
unreachable
37: ; preds = %31
%38 = tail call i64 (...) @omp_get_level()
%39 = icmp eq i64 %38, 0
br i1 %39, label %48, label %46
40: ; preds = %32
%41 = tail call i64 (...) @omp_get_level()
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = tail call i32 (...) @omp_is_initial_device()
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %40, %43, %37
%47 = tail call i32 (...) @abort()
unreachable
48: ; preds = %37, %43
%49 = tail call i64 (...) @omp_get_level()
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = tail call i32 (...) @omp_is_initial_device()
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51, %48
%55 = tail call i32 (...) @abort()
unreachable
56: ; preds = %51
%57 = tail call i64 (...) @omp_get_level()
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = tail call i32 (...) @omp_is_initial_device()
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %59, %56
%63 = tail call i32 (...) @abort()
unreachable
64: ; preds = %59
%65 = tail call i64 (...) @omp_get_level()
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %71
67: ; preds = %64
br i1 %2, label %73, label %68
68: ; preds = %67
%69 = tail call i32 (...) @omp_is_initial_device()
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %76
71: ; preds = %68, %64
%72 = tail call i32 (...) @abort()
unreachable
73: ; preds = %67
%74 = tail call i64 (...) @omp_get_level()
%75 = icmp eq i64 %74, 0
br i1 %75, label %84, label %82
76: ; preds = %68
%77 = tail call i64 (...) @omp_get_level()
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = tail call i32 (...) @omp_is_initial_device()
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %87
82: ; preds = %76, %79, %73
%83 = tail call i32 (...) @abort()
unreachable
84: ; preds = %73
%85 = tail call i64 (...) @omp_get_level()
%86 = icmp eq i64 %85, 0
br i1 %86, label %95, label %93
87: ; preds = %79
%88 = tail call i64 (...) @omp_get_level()
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %93
90: ; preds = %87
%91 = tail call i32 (...) @omp_is_initial_device()
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %87, %90, %84
%94 = tail call i32 (...) @abort()
unreachable
95: ; preds = %84, %90
%96 = tail call i64 (...) @omp_get_level()
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %95
%99 = tail call i32 (...) @omp_is_initial_device()
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %98, %95
%102 = tail call i32 (...) @abort()
unreachable
103: ; preds = %98
%104 = tail call i64 (...) @omp_get_level()
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %103
%107 = tail call i32 (...) @omp_is_initial_device()
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %111
109: ; preds = %106, %103
%110 = tail call i32 (...) @abort()
unreachable
111: ; preds = %106
%112 = tail call i64 (...) @omp_get_level()
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %118
114: ; preds = %111
br i1 %2, label %120, label %115
115: ; preds = %114
%116 = tail call i32 (...) @omp_is_initial_device()
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %115, %111
%119 = tail call i32 (...) @abort()
unreachable
120: ; preds = %114
%121 = tail call i64 (...) @omp_get_level()
%122 = icmp eq i64 %121, 0
br i1 %122, label %131, label %129
123: ; preds = %115
%124 = tail call i64 (...) @omp_get_level()
%125 = icmp eq i64 %124, 0
br i1 %125, label %126, label %129
126: ; preds = %123
%127 = tail call i32 (...) @omp_is_initial_device()
%128 = icmp eq i32 %127, 0
br i1 %128, label %129, label %131
129: ; preds = %123, %126, %120
%130 = tail call i32 (...) @abort()
unreachable
131: ; preds = %120, %126
%132 = tail call i64 (...) @omp_get_level()
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %131
%135 = tail call i32 (...) @omp_is_initial_device()
%136 = icmp eq i32 %135, 0
br i1 %136, label %137, label %139
137: ; preds = %134, %131
%138 = tail call i32 (...) @abort()
unreachable
139: ; preds = %134
%140 = tail call i64 (...) @omp_get_level()
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %145
142: ; preds = %139
%143 = tail call i32 (...) @omp_is_initial_device()
%144 = icmp eq i32 %143, 0
br i1 %144, label %145, label %147
145: ; preds = %142, %139
%146 = tail call i32 (...) @abort()
unreachable
147: ; preds = %142
%148 = tail call i64 (...) @omp_get_level()
%149 = icmp eq i64 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %147
br i1 %2, label %156, label %151
151: ; preds = %150
%152 = tail call i32 (...) @omp_is_initial_device()
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %159
154: ; preds = %151, %147
%155 = tail call i32 (...) @abort()
unreachable
156: ; preds = %150
%157 = tail call i64 (...) @omp_get_level()
%158 = icmp eq i64 %157, 0
br i1 %158, label %167, label %165
159: ; preds = %151
%160 = tail call i64 (...) @omp_get_level()
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %165
162: ; preds = %159
%163 = tail call i32 (...) @omp_is_initial_device()
%164 = icmp eq i32 %163, 0
br i1 %164, label %165, label %167
165: ; preds = %159, %162, %156
%166 = tail call i32 (...) @abort()
unreachable
167: ; preds = %156, %162
ret void
}