#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 */
typedef int /*<<< orphan*/ omp_nest_lock_t;
typedef int /*<<< orphan*/ omp_lock_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ omp_destroy_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_destroy_nest_lock(int /*<<< orphan*/ *);
scalar_t__ omp_get_dynamic();
int omp_get_max_threads();
scalar_t__ omp_get_nested();
scalar_t__ omp_get_num_procs();
int omp_get_num_threads();
int omp_get_thread_num();
double omp_get_wtick();
double omp_get_wtime();
scalar_t__ omp_in_parallel();
int /*<<< orphan*/ omp_init_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_init_nest_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_set_dynamic(int);
int /*<<< orphan*/ omp_set_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_set_nest_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_set_nested(int);
int /*<<< orphan*/ omp_set_num_threads(int);
scalar_t__ omp_test_lock(int /*<<< orphan*/ *);
int omp_test_nest_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_unset_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ omp_unset_nest_lock(int /*<<< orphan*/ *);
int main(void) {
  double d, e;
  int l;
  omp_lock_t lck;
  omp_nest_lock_t nlck;
  d = omp_get_wtime();
  omp_init_lock(&lck);
  omp_set_lock(&lck);
  if (omp_test_lock(&lck))
    abort();
  omp_unset_lock(&lck);
  if (!omp_test_lock(&lck))
    abort();
  if (omp_test_lock(&lck))
    abort();
  omp_unset_lock(&lck);
  omp_destroy_lock(&lck);
  omp_init_nest_lock(&nlck);
  if (omp_test_nest_lock(&nlck) != 1)
    abort();
  omp_set_nest_lock(&nlck);
  if (omp_test_nest_lock(&nlck) != 3)
    abort();
  omp_unset_nest_lock(&nlck);
  omp_unset_nest_lock(&nlck);
  if (omp_test_nest_lock(&nlck) != 2)
    abort();
  omp_unset_nest_lock(&nlck);
  omp_unset_nest_lock(&nlck);
  omp_destroy_nest_lock(&nlck);
  omp_set_dynamic(1);
  if (!omp_get_dynamic())
    abort();
  omp_set_dynamic(0);
  if (omp_get_dynamic())
    abort();
  omp_set_nested(1);
  if (!omp_get_nested())
    abort();
  omp_set_nested(0);
  if (omp_get_nested())
    abort();
  omp_set_num_threads(5);
  if (omp_get_num_threads() != 1)
    abort();
  if (omp_get_max_threads() != 5)
    abort();
  if (omp_get_thread_num() != 0)
    abort();
  omp_set_num_threads(3);
  if (omp_get_num_threads() != 1)
    abort();
  if (omp_get_max_threads() != 3)
    abort();
  if (omp_get_thread_num() != 0)
    abort();
  l = 0;
#pragma omp parallel reduction(| : l)
  {
    l = omp_get_num_threads() != 3;
    l |= omp_get_thread_num() < 0;
    l |= omp_get_thread_num() >= 3;
#pragma omp master
    l |= omp_get_thread_num() != 0;
  }
  if (l)
    abort();
  if (omp_get_num_procs() <= 0)
    abort();
  if (omp_in_parallel())
    abort();
#pragma omp parallel reduction(| : l)
  l = !omp_in_parallel();
#pragma omp parallel reduction(| : l) if (1)
  l = !omp_in_parallel();
  e = omp_get_wtime();
  if (d > e)
    abort();
  d = omp_get_wtick();
  if (d <= 0 || d > 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <omp_get_wtime@plt>
movsd  %xmm0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1160 <omp_init_lock@plt>
lea    -0x20(%rbp),%rdi
call   1100 <omp_set_lock@plt>
lea    -0x20(%rbp),%rdi
call   1150 <omp_test_lock@plt>
cmp    $0x0,%rax
je     12b7 <main+0x47>
mov    $0x0,%al
call   1050 <abort@plt>
lea    -0x20(%rbp),%rdi
call   1080 <omp_unset_lock@plt>
lea    -0x20(%rbp),%rdi
call   1150 <omp_test_lock@plt>
cmp    $0x0,%rax
jne    12da <main+0x6a>
mov    $0x0,%al
call   1050 <abort@plt>
lea    -0x20(%rbp),%rdi
call   1150 <omp_test_lock@plt>
cmp    $0x0,%rax
je     12f4 <main+0x84>
mov    $0x0,%al
call   1050 <abort@plt>
lea    -0x20(%rbp),%rdi
call   1080 <omp_unset_lock@plt>
lea    -0x20(%rbp),%rdi
call   1170 <omp_destroy_lock@plt>
lea    -0x24(%rbp),%rdi
call   1090 <omp_init_nest_lock@plt>
lea    -0x24(%rbp),%rdi
call   1110 <omp_test_nest_lock@plt>
cmp    $0x1,%eax
je     1328 <main+0xb8>
mov    $0x0,%al
call   1050 <abort@plt>
lea    -0x24(%rbp),%rdi
call   1190 <omp_set_nest_lock@plt>
lea    -0x24(%rbp),%rdi
call   1110 <omp_test_nest_lock@plt>
cmp    $0x3,%eax
je     134a <main+0xda>
mov    $0x0,%al
call   1050 <abort@plt>
lea    -0x24(%rbp),%rdi
call   1040 <omp_unset_nest_lock@plt>
lea    -0x24(%rbp),%rdi
call   1040 <omp_unset_nest_lock@plt>
lea    -0x24(%rbp),%rdi
call   1110 <omp_test_nest_lock@plt>
cmp    $0x2,%eax
je     1375 <main+0x105>
mov    $0x0,%al
call   1050 <abort@plt>
lea    -0x24(%rbp),%rdi
call   1040 <omp_unset_nest_lock@plt>
lea    -0x24(%rbp),%rdi
call   1040 <omp_unset_nest_lock@plt>
lea    -0x24(%rbp),%rdi
call   1130 <omp_destroy_nest_lock@plt>
mov    $0x1,%edi
call   10c0 <omp_set_dynamic@plt>
mov    $0x0,%al
call   1180 <omp_get_dynamic@plt>
cmp    $0x0,%rax
jne    13b2 <main+0x142>
mov    $0x0,%al
call   1050 <abort@plt>
xor    %edi,%edi
call   10c0 <omp_set_dynamic@plt>
mov    $0x0,%al
call   1180 <omp_get_dynamic@plt>
cmp    $0x0,%rax
je     13d1 <main+0x161>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x1,%edi
call   10e0 <omp_set_nested@plt>
mov    $0x0,%al
call   10d0 <omp_get_nested@plt>
cmp    $0x0,%rax
jne    13f3 <main+0x183>
mov    $0x0,%al
call   1050 <abort@plt>
xor    %edi,%edi
call   10e0 <omp_set_nested@plt>
mov    $0x0,%al
call   10d0 <omp_get_nested@plt>
cmp    $0x0,%rax
je     1412 <main+0x1a2>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x5,%edi
call   1120 <omp_set_num_threads@plt>
mov    $0x0,%al
call   10b0 <omp_get_num_threads@plt>
cmp    $0x1,%eax
je     1433 <main+0x1c3>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1140 <omp_get_max_threads@plt>
cmp    $0x5,%eax
je     144a <main+0x1da>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1060 <omp_get_thread_num@plt>
cmp    $0x0,%eax
je     1461 <main+0x1f1>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x3,%edi
call   1120 <omp_set_num_threads@plt>
mov    $0x0,%al
call   10b0 <omp_get_num_threads@plt>
cmp    $0x1,%eax
je     1482 <main+0x212>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1140 <omp_get_max_threads@plt>
cmp    $0x3,%eax
je     1499 <main+0x229>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1060 <omp_get_thread_num@plt>
cmp    $0x0,%eax
je     14b0 <main+0x240>
mov    $0x0,%al
call   1050 <abort@plt>
movl   $0x0,-0x1c(%rbp)
mov    $0x0,%al
call   10b0 <omp_get_num_threads@plt>
cmp    $0x3,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <omp_get_thread_num@plt>
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <omp_get_thread_num@plt>
cmp    $0x3,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1060 <omp_get_thread_num@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1525 <main+0x2b5>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   10f0 <omp_get_num_procs@plt>
cmp    $0x0,%rax
jg     153d <main+0x2cd>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1030 <omp_in_parallel@plt>
cmp    $0x0,%rax
je     1555 <main+0x2e5>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   1030 <omp_in_parallel@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <omp_in_parallel@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1070 <omp_get_wtime@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    15a8 <main+0x338>
mov    $0x0,%al
call   1050 <abort@plt>
mov    $0x0,%al
call   10a0 <omp_get_wtick@plt>
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    15d9 <main+0x369>
movsd  -0x10(%rbp),%xmm0
movsd  0xa31(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    15e0 <main+0x370>
mov    $0x0,%al
call   1050 <abort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1070 <omp_get_wtime@plt>
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1160 <omp_init_lock@plt>
mov    %rbx,%rdi
call   1100 <omp_set_lock@plt>
mov    %rbx,%rdi
call   1150 <omp_test_lock@plt>
test   %rax,%rax
jne    14e1 <main+0x271>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <omp_unset_lock@plt>
mov    %rbx,%rdi
call   1150 <omp_test_lock@plt>
test   %rax,%rax
je     14e1 <main+0x271>
lea    0xc(%rsp),%rdi
call   1150 <omp_test_lock@plt>
test   %rax,%rax
jne    14e1 <main+0x271>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <omp_unset_lock@plt>
mov    %rbx,%rdi
call   1170 <omp_destroy_lock@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <omp_init_nest_lock@plt>
mov    %rbx,%rdi
call   1110 <omp_test_nest_lock@plt>
cmp    $0x1,%eax
jne    14e1 <main+0x271>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1190 <omp_set_nest_lock@plt>
mov    %rbx,%rdi
call   1110 <omp_test_nest_lock@plt>
cmp    $0x3,%eax
jne    14e1 <main+0x271>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <omp_unset_nest_lock@plt>
mov    %rbx,%rdi
call   1040 <omp_unset_nest_lock@plt>
mov    %rbx,%rdi
call   1110 <omp_test_nest_lock@plt>
cmp    $0x2,%eax
jne    14e1 <main+0x271>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <omp_unset_nest_lock@plt>
mov    %rbx,%rdi
call   1040 <omp_unset_nest_lock@plt>
mov    %rbx,%rdi
call   1130 <omp_destroy_nest_lock@plt>
mov    $0x1,%edi
call   10c0 <omp_set_dynamic@plt>
xor    %eax,%eax
call   1180 <omp_get_dynamic@plt>
test   %rax,%rax
je     14e1 <main+0x271>
xor    %edi,%edi
call   10c0 <omp_set_dynamic@plt>
xor    %eax,%eax
call   1180 <omp_get_dynamic@plt>
test   %rax,%rax
jne    14e1 <main+0x271>
mov    $0x1,%edi
call   10e0 <omp_set_nested@plt>
xor    %eax,%eax
call   10d0 <omp_get_nested@plt>
test   %rax,%rax
je     14e1 <main+0x271>
xor    %edi,%edi
call   10e0 <omp_set_nested@plt>
xor    %eax,%eax
call   10d0 <omp_get_nested@plt>
test   %rax,%rax
jne    14e1 <main+0x271>
mov    $0x5,%edi
call   1120 <omp_set_num_threads@plt>
xor    %eax,%eax
call   10b0 <omp_get_num_threads@plt>
cmp    $0x1,%eax
jne    14e1 <main+0x271>
xor    %eax,%eax
call   1140 <omp_get_max_threads@plt>
cmp    $0x5,%eax
jne    14e1 <main+0x271>
xor    %eax,%eax
call   1060 <omp_get_thread_num@plt>
test   %eax,%eax
jne    14e1 <main+0x271>
mov    $0x3,%edi
call   1120 <omp_set_num_threads@plt>
xor    %eax,%eax
call   10b0 <omp_get_num_threads@plt>
cmp    $0x1,%eax
jne    14e1 <main+0x271>
xor    %eax,%eax
call   1140 <omp_get_max_threads@plt>
cmp    $0x3,%eax
jne    14e1 <main+0x271>
xor    %eax,%eax
call   1060 <omp_get_thread_num@plt>
test   %eax,%eax
jne    14e1 <main+0x271>
xor    %eax,%eax
call   10b0 <omp_get_num_threads@plt>
xor    %ebp,%ebp
cmp    $0x3,%eax
setne  %bpl
xor    %eax,%eax
call   1060 <omp_get_thread_num@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
or     %ebp,%ebx
xor    %eax,%eax
call   1060 <omp_get_thread_num@plt>
xor    %ebp,%ebp
cmp    $0x3,%eax
setge  %bpl
or     %ebx,%ebp
xor    %eax,%eax
call   1060 <omp_get_thread_num@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
or     %ebp,%ecx
jne    14e1 <main+0x271>
xor    %eax,%eax
call   10f0 <omp_get_num_procs@plt>
test   %rax,%rax
jle    14e1 <main+0x271>
xor    %eax,%eax
call   1030 <omp_in_parallel@plt>
test   %rax,%rax
jne    14e1 <main+0x271>
xor    %eax,%eax
call   1030 <omp_in_parallel@plt>
xor    %eax,%eax
call   1030 <omp_in_parallel@plt>
xor    %eax,%eax
call   1070 <omp_get_wtime@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     14e1 <main+0x271>
xor    %eax,%eax
call   10a0 <omp_get_wtick@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    14e1 <main+0x271>
ucomisd 0xb2a(%rip),%xmm0
ja     14e1 <main+0x271>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1050 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call double (...) @omp_get_wtime()
store double %7, double* %2
%8 = call i32 @omp_init_lock(i32* %5)
%9 = call i32 @omp_set_lock(i32* %5)
%10 = call i64 @omp_test_lock(i32* %5)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %0
%15 = call i32 @omp_unset_lock(i32* %5)
%16 = call i64 @omp_test_lock(i32* %5)
%17 = icmp ne i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %14
%21 = call i64 @omp_test_lock(i32* %5)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %20
%26 = call i32 @omp_unset_lock(i32* %5)
%27 = call i32 @omp_destroy_lock(i32* %5)
%28 = call i32 @omp_init_nest_lock(i32* %6)
%29 = call i32 @omp_test_nest_lock(i32* %6)
%30 = icmp ne i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = call i32 (...) @abort()
unreachable
33: ; preds = %25
%34 = call i32 @omp_set_nest_lock(i32* %6)
%35 = call i32 @omp_test_nest_lock(i32* %6)
%36 = icmp ne i32 %35, 3
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (...) @abort()
unreachable
39: ; preds = %33
%40 = call i32 @omp_unset_nest_lock(i32* %6)
%41 = call i32 @omp_unset_nest_lock(i32* %6)
%42 = call i32 @omp_test_nest_lock(i32* %6)
%43 = icmp ne i32 %42, 2
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 (...) @abort()
unreachable
46: ; preds = %39
%47 = call i32 @omp_unset_nest_lock(i32* %6)
%48 = call i32 @omp_unset_nest_lock(i32* %6)
%49 = call i32 @omp_destroy_nest_lock(i32* %6)
%50 = call i32 @omp_set_dynamic(i32 1)
%51 = call i64 (...) @omp_get_dynamic()
%52 = icmp ne i64 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %46
%54 = call i32 (...) @abort()
unreachable
55: ; preds = %46
%56 = call i32 @omp_set_dynamic(i32 0)
%57 = call i64 (...) @omp_get_dynamic()
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 (...) @abort()
unreachable
61: ; preds = %55
%62 = call i32 @omp_set_nested(i32 1)
%63 = call i64 (...) @omp_get_nested()
%64 = icmp ne i64 %63, 0
br i1 %64, label %67, label %65
65: ; preds = %61
%66 = call i32 (...) @abort()
unreachable
67: ; preds = %61
%68 = call i32 @omp_set_nested(i32 0)
%69 = call i64 (...) @omp_get_nested()
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 (...) @abort()
unreachable
73: ; preds = %67
%74 = call i32 @omp_set_num_threads(i32 5)
%75 = call i32 (...) @omp_get_num_threads()
%76 = icmp ne i32 %75, 1
br i1 %76, label %77, label %79
77: ; preds = %73
%78 = call i32 (...) @abort()
unreachable
79: ; preds = %73
%80 = call i32 (...) @omp_get_max_threads()
%81 = icmp ne i32 %80, 5
br i1 %81, label %82, label %84
82: ; preds = %79
%83 = call i32 (...) @abort()
unreachable
84: ; preds = %79
%85 = call i32 (...) @omp_get_thread_num()
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = call i32 (...) @abort()
unreachable
89: ; preds = %84
%90 = call i32 @omp_set_num_threads(i32 3)
%91 = call i32 (...) @omp_get_num_threads()
%92 = icmp ne i32 %91, 1
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = call i32 (...) @abort()
unreachable
95: ; preds = %89
%96 = call i32 (...) @omp_get_max_threads()
%97 = icmp ne i32 %96, 3
br i1 %97, label %98, label %100
98: ; preds = %95
%99 = call i32 (...) @abort()
unreachable
100: ; preds = %95
%101 = call i32 (...) @omp_get_thread_num()
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %105
103: ; preds = %100
%104 = call i32 (...) @abort()
unreachable
105: ; preds = %100
store i32 0, i32* %4
%106 = call i32 (...) @omp_get_num_threads()
%107 = icmp ne i32 %106, 3
%108 = zext i1 %107 to i32
store i32 %108, i32* %4
%109 = call i32 (...) @omp_get_thread_num()
%110 = icmp slt i32 %109, 0
%111 = zext i1 %110 to i32
%112 = load i32, i32* %4
%113 = or i32 %112, %111
store i32 %113, i32* %4
%114 = call i32 (...) @omp_get_thread_num()
%115 = icmp sge i32 %114, 3
%116 = zext i1 %115 to i32
%117 = load i32, i32* %4
%118 = or i32 %117, %116
store i32 %118, i32* %4
%119 = call i32 (...) @omp_get_thread_num()
%120 = icmp ne i32 %119, 0
%121 = zext i1 %120 to i32
%122 = load i32, i32* %4
%123 = or i32 %122, %121
store i32 %123, i32* %4
%124 = load i32, i32* %4
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %128
126: ; preds = %105
%127 = call i32 (...) @abort()
unreachable
128: ; preds = %105
%129 = call i64 (...) @omp_get_num_procs()
%130 = icmp sle i64 %129, 0
br i1 %130, label %131, label %133
131: ; preds = %128
%132 = call i32 (...) @abort()
unreachable
133: ; preds = %128
%134 = call i64 (...) @omp_in_parallel()
%135 = icmp ne i64 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %133
%137 = call i32 (...) @abort()
unreachable
138: ; preds = %133
%139 = call i64 (...) @omp_in_parallel()
%140 = icmp ne i64 %139, 0
%141 = xor i1 %140, true
%142 = zext i1 %141 to i32
store i32 %142, i32* %4
%143 = call i64 (...) @omp_in_parallel()
%144 = icmp ne i64 %143, 0
%145 = xor i1 %144, true
%146 = zext i1 %145 to i32
store i32 %146, i32* %4
%147 = call double (...) @omp_get_wtime()
store double %147, double* %3
%148 = load double, double* %2
%149 = load double, double* %3
%150 = fcmp ogt double %148, %149
br i1 %150, label %151, label %153
151: ; preds = %138
%152 = call i32 (...) @abort()
unreachable
153: ; preds = %138
%154 = call double (...) @omp_get_wtick()
store double %154, double* %2
%155 = load double, double* %2
%156 = fcmp ole double %155, 0.000000e+00
br i1 %156, label %160, label %157
157: ; preds = %153
%158 = load double, double* %2
%159 = fcmp ogt double %158, 1.000000e+00
br i1 %159, label %160, label %162
160: ; preds = %157, %153
%161 = call i32 (...) @abort()
unreachable
162: ; preds = %157
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call double (...) @omp_get_wtime()
%6 = call i32 @omp_init_lock(i32* %1)
%7 = call i32 @omp_set_lock(i32* %1)
%8 = call i64 @omp_test_lock(i32* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = call i32 @omp_unset_lock(i32* %1)
%14 = call i64 @omp_test_lock(i32* %1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %12
%19 = call i64 @omp_test_lock(i32* %1)
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %18
%24 = call i32 @omp_unset_lock(i32* %1)
%25 = call i32 @omp_destroy_lock(i32* %1)
%26 = call i32 @omp_init_nest_lock(i32* %2)
%27 = call i32 @omp_test_nest_lock(i32* %2)
%28 = icmp eq i32 %27, 1
br i1 %28, label %31, label %29
29: ; preds = %23
%30 = call i32 (...) @abort()
unreachable
31: ; preds = %23
%32 = call i32 @omp_set_nest_lock(i32* %2)
%33 = call i32 @omp_test_nest_lock(i32* %2)
%34 = icmp eq i32 %33, 3
br i1 %34, label %37, label %35
35: ; preds = %31
%36 = call i32 (...) @abort()
unreachable
37: ; preds = %31
%38 = call i32 @omp_unset_nest_lock(i32* %2)
%39 = call i32 @omp_unset_nest_lock(i32* %2)
%40 = call i32 @omp_test_nest_lock(i32* %2)
%41 = icmp eq i32 %40, 2
br i1 %41, label %44, label %42
42: ; preds = %37
%43 = call i32 (...) @abort()
unreachable
44: ; preds = %37
%45 = call i32 @omp_unset_nest_lock(i32* %2)
%46 = call i32 @omp_unset_nest_lock(i32* %2)
%47 = call i32 @omp_destroy_nest_lock(i32* %2)
%48 = call i32 @omp_set_dynamic(i32 1)
%49 = call i64 (...) @omp_get_dynamic()
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %44
%52 = call i32 (...) @abort()
unreachable
53: ; preds = %44
%54 = call i32 @omp_set_dynamic(i32 0)
%55 = call i64 (...) @omp_get_dynamic()
%56 = icmp eq i64 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = call i32 (...) @abort()
unreachable
59: ; preds = %53
%60 = call i32 @omp_set_nested(i32 1)
%61 = call i64 (...) @omp_get_nested()
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (...) @abort()
unreachable
65: ; preds = %59
%66 = call i32 @omp_set_nested(i32 0)
%67 = call i64 (...) @omp_get_nested()
%68 = icmp eq i64 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %65
%70 = call i32 (...) @abort()
unreachable
71: ; preds = %65
%72 = call i32 @omp_set_num_threads(i32 5)
%73 = call i32 (...) @omp_get_num_threads()
%74 = icmp eq i32 %73, 1
br i1 %74, label %77, label %75
75: ; preds = %71
%76 = call i32 (...) @abort()
unreachable
77: ; preds = %71
%78 = call i32 (...) @omp_get_max_threads()
%79 = icmp eq i32 %78, 5
br i1 %79, label %82, label %80
80: ; preds = %77
%81 = call i32 (...) @abort()
unreachable
82: ; preds = %77
%83 = call i32 (...) @omp_get_thread_num()
%84 = icmp eq i32 %83, 0
br i1 %84, label %87, label %85
85: ; preds = %82
%86 = call i32 (...) @abort()
unreachable
87: ; preds = %82
%88 = call i32 @omp_set_num_threads(i32 3)
%89 = call i32 (...) @omp_get_num_threads()
%90 = icmp eq i32 %89, 1
br i1 %90, label %93, label %91
91: ; preds = %87
%92 = call i32 (...) @abort()
unreachable
93: ; preds = %87
%94 = call i32 (...) @omp_get_max_threads()
%95 = icmp eq i32 %94, 3
br i1 %95, label %98, label %96
96: ; preds = %93
%97 = call i32 (...) @abort()
unreachable
98: ; preds = %93
%99 = call i32 (...) @omp_get_thread_num()
%100 = icmp eq i32 %99, 0
br i1 %100, label %103, label %101
101: ; preds = %98
%102 = call i32 (...) @abort()
unreachable
103: ; preds = %98
%104 = call i32 (...) @omp_get_num_threads()
%105 = icmp ne i32 %104, 3
%106 = zext i1 %105 to i32
%107 = call i32 (...) @omp_get_thread_num()
%108 = lshr i32 %107, 31
%109 = or i32 %108, %106
%110 = call i32 (...) @omp_get_thread_num()
%111 = icmp sgt i32 %110, 2
%112 = zext i1 %111 to i32
%113 = or i32 %109, %112
%114 = call i32 (...) @omp_get_thread_num()
%115 = icmp ne i32 %114, 0
%116 = zext i1 %115 to i32
%117 = or i32 %113, %116
%118 = icmp eq i32 %117, 0
br i1 %118, label %121, label %119
119: ; preds = %103
%120 = call i32 (...) @abort()
unreachable
121: ; preds = %103
%122 = call i64 (...) @omp_get_num_procs()
%123 = icmp slt i64 %122, 1
br i1 %123, label %124, label %126
124: ; preds = %121
%125 = call i32 (...) @abort()
unreachable
126: ; preds = %121
%127 = call i64 (...) @omp_in_parallel()
%128 = icmp eq i64 %127, 0
br i1 %128, label %131, label %129
129: ; preds = %126
%130 = call i32 (...) @abort()
unreachable
131: ; preds = %126
%132 = call i64 (...) @omp_in_parallel()
%133 = call i64 (...) @omp_in_parallel()
%134 = call double (...) @omp_get_wtime()
%135 = fcmp ogt double %5, %134
br i1 %135, label %136, label %138
136: ; preds = %131
%137 = call i32 (...) @abort()
unreachable
138: ; preds = %131
%139 = call double (...) @omp_get_wtick()
%140 = fcmp ole double %139, 0.000000e+00
%141 = fcmp ogt double %139, 1.000000e+00
%142 = or i1 %140, %141
br i1 %142, label %143, label %145
143: ; preds = %138
%144 = call i32 (...) @abort()
unreachable
145: ; preds = %138
ret i32 0
}