#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*/ level1();
int omp_get_active_level();
int omp_get_dynamic();
int omp_get_level();
int omp_get_max_active_levels();
int omp_get_nested();
int omp_get_thread_limit();
int /*<<< orphan*/ omp_set_max_active_levels(int);
int /*<<< orphan*/ omp_set_nested(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("OMP_DYNAMIC: %d\n", omp_get_dynamic());
  printf("OMP_NESTED: %d\n", omp_get_nested());
  printf("OMP_THREAD_LIMIT: %d\n", omp_get_thread_limit());
  printf("OMP_MAX_ACTIVE_LEVELS: %d\n", omp_get_max_active_levels());
  printf("ActiveNestedParRegions: %d\n", omp_get_active_level());
  printf("NestedParRegions: %d\n", omp_get_level());
  omp_set_nested(1);
  omp_set_max_active_levels(2);
  level1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10c0 <omp_get_dynamic@plt>
mov    %eax,%esi
lea    0xe3a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1080 <omp_get_nested@plt>
mov    %eax,%esi
lea    0xe36(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <omp_get_thread_limit@plt>
mov    %eax,%esi
lea    0xe31(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <omp_get_max_active_levels@plt>
mov    %eax,%esi
lea    0xe32(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <omp_get_active_level@plt>
mov    %eax,%esi
lea    0xe38(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10a0 <omp_get_level@plt>
mov    %eax,%esi
lea    0xe29(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1090 <omp_set_nested@plt>
mov    $0x2,%edi
call   1030 <omp_set_max_active_levels@plt>
mov    $0x0,%al
call   1050 <level1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10c0 <omp_get_dynamic@plt>
lea    0xe51(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <omp_get_nested@plt>
lea    0xe4d(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <omp_get_thread_limit@plt>
lea    0xe48(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <omp_get_max_active_levels@plt>
lea    0xe49(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
call   10b0 <omp_get_active_level@plt>
lea    0xe4f(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
call   10a0 <omp_get_level@plt>
lea    0xe40(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1090 <omp_set_nested@plt>
mov    $0x2,%edi
call   1030 <omp_set_max_active_levels@plt>
xor    %eax,%eax
call   1050 <level1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"OMP_DYNAMIC: %d\0A\00"
@.str.1 = [16 x i8] c"OMP_NESTED: %d\0A\00"
@.str.2 = [22 x i8] c"OMP_THREAD_LIMIT: %d\0A\00"
@.str.3 = [27 x i8] c"OMP_MAX_ACTIVE_LEVELS: %d\0A\00"
@.str.4 = [28 x i8] c"ActiveNestedParRegions: %d\0A\00"
@.str.5 = [22 x i8] c"NestedParRegions: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @omp_get_dynamic()
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @omp_get_nested()
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @omp_get_thread_limit()
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @omp_get_max_active_levels()
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @omp_get_active_level()
%15 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%16 = call i32 (...) @omp_get_level()
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = call i32 @omp_set_nested(i32 1)
%19 = call i32 @omp_set_max_active_levels(i32 2)
%20 = call i32 (...) @level1()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"OMP_DYNAMIC: %d\0A\00"
@.str.1 = [16 x i8] c"OMP_NESTED: %d\0A\00"
@.str.2 = [22 x i8] c"OMP_THREAD_LIMIT: %d\0A\00"
@.str.3 = [27 x i8] c"OMP_MAX_ACTIVE_LEVELS: %d\0A\00"
@.str.4 = [28 x i8] c"ActiveNestedParRegions: %d\0A\00"
@.str.5 = [22 x i8] c"NestedParRegions: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_dynamic()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @omp_get_nested()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @omp_get_thread_limit()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @omp_get_max_active_levels()
%10 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 (...) @omp_get_active_level()
%12 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call i32 (...) @omp_get_level()
%14 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = tail call i32 @omp_set_nested(i32 1)
%16 = tail call i32 @omp_set_max_active_levels(i32 2)
%17 = tail call i32 (...) @level1()
ret i32 0
}