#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_num_threads();
main() {
  int A = 0;
#pragma omp parallel if (foo() > 10) shared(A)
  { A = omp_get_num_threads(); }
  if (A != 1)
    abort();
#pragma omp parallel if (foo() == 10) num_threads(3) shared(A)
  { A = omp_get_num_threads(); }
  if (A != 3)
    abort();
#pragma omp parallel if (foo() == 10) num_threads(foo()) shared(A)
  { A = omp_get_num_threads(); }
  if (A != 10)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1151 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     116c <main+0x4c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     1187 <main+0x67>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
cmp    $0x1,%eax
jne    1149 <main+0x29>
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
cmp    $0x3,%eax
jne    1149 <main+0x29>
xor    %eax,%eax
call   1040 <omp_get_num_threads@plt>
cmp    $0xa,%eax
jne    1149 <main+0x29>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @omp_get_num_threads()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 (...) @omp_get_num_threads()
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 3
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
%15 = call i32 (...) @omp_get_num_threads()
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @omp_get_num_threads()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @omp_get_num_threads()
%7 = icmp eq i32 %6, 3
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 (...) @omp_get_num_threads()
%12 = icmp eq i32 %11, 10
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}