#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 omp_sched_t;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int omp_get_dynamic();
int omp_get_max_threads();
int omp_get_num_procs();
int omp_get_num_threads();
int /*<<< orphan*/ omp_get_schedule(int *, int *);
int omp_get_thread_limit();
int omp_in_parallel();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stderr;
main(int argc, char **argv) {
  int i, n = 200, chunk, a[n], suma = 0;
  omp_sched_t kind;
  int modifier;
  if (argc < 3) {
    fprintf(stderr, "\nFalta iteraciones o chunk \n");
    exit(-1);
  }
  n = atoi(argv[1]);
  if (n > 200)
    n = 200;
  chunk = atoi(argv[2]);
  for (i = 0; i < n; i++)
    a[i] = i;
#pragma omp parallel
  {
#pragma omp for firstprivate(suma) lastprivate(suma) schedule(dynamic, chunk)
    for (i = 0; i < n; i++) {
      suma = suma + a[i];
      printf(" thread %d suma a[%d]=%d suma=%d \n", 0, i, a[i], suma);
    }
#pragma omp single
    {
      omp_get_schedule(&kind, &modifier);
      printf("\nDentro del parallel: dyn-var: %d, nthreads-var: %d, "
             "thread-limit-var: %d, run-sched-var[kind: %d, modifier: %d]\n",
             omp_get_dynamic(), omp_get_max_threads(), omp_get_thread_limit(),
             kind, modifier);
      printf("Nº de threads que se están usando en el parallel: %d\n",
             omp_get_num_threads());
      printf("Nº de procesadores disponibles para el programa en el momento de "
             "ejecución: %d\n",
             omp_get_num_procs());
      printf("¿Dentro de una region parallel? (0:falso, 1: verdadero): %d\n",
             omp_in_parallel());
    }
  }
  printf("\nFuera de 'parallel for' suma=%d\n", suma);
  omp_get_schedule(&kind, &modifier);
  printf("\nFuera del parallel: dyn-var: %d, nthreads-var: %d, "
         "thread-limit-var: %d, run-sched-var[kind: %d, modifier: %d]\n",
         omp_get_dynamic(), omp_get_max_threads(), omp_get_thread_limit(), kind,
         modifier);
  printf("Nº de threads que se están usando en el parallel: %d\n",
         omp_get_num_threads());
  printf("Nº de procesadores disponibles para el programa en el momento de "
         "ejecución: %d\n",
         omp_get_num_procs());
  printf("¿Dentro de una region parallel? (0:falso, 1: verdadero): %d\n",
         omp_in_parallel());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc8,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1224 <main+0x74>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
lea    0xdeb(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xc8,-0x18(%rbp)
jle    1248 <main+0x98>
movl   $0xc8,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1287 <main+0xd7>
mov    -0x48(%rbp),%rax
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    125f <main+0xaf>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    12d7 <main+0x127>
mov    -0x48(%rbp),%rax
mov    -0x34(%rbp),%ecx
movslq -0x14(%rbp),%rdx
add    (%rax,%rdx,4),%ecx
mov    %ecx,-0x34(%rbp)
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x34(%rbp),%r8d
lea    0xd5d(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128e <main+0xde>
lea    -0x38(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
call   1090 <omp_get_schedule@plt>
mov    $0x0,%al
call   10d0 <omp_get_dynamic@plt>
mov    %eax,-0x58(%rbp)
mov    $0x0,%al
call   10a0 <omp_get_max_threads@plt>
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1060 <omp_get_thread_limit@plt>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
mov    %eax,%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,%esi
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <omp_get_num_procs@plt>
mov    %eax,%esi
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_in_parallel@plt>
mov    %eax,%esi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x38(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
call   1090 <omp_get_schedule@plt>
mov    $0x0,%al
call   10d0 <omp_get_dynamic@plt>
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   10a0 <omp_get_max_threads@plt>
mov    %eax,-0x4c(%rbp)
mov    $0x0,%al
call   1060 <omp_get_thread_limit@plt>
mov    -0x50(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    %eax,%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <omp_get_num_procs@plt>
mov    %eax,%esi
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_in_parallel@plt>
mov    %eax,%esi
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x338,%rsp
cmp    $0x2,%edi
jle    14ee <main+0x33e>
mov    0x8(%rsi),%rdi
call   10b0 <atoi@plt>
cmp    $0xc8,%eax
mov    $0xc8,%ecx
cmovl  %eax,%ecx
test   %eax,%eax
jle    13b2 <main+0x202>
cmp    $0x2,%ecx
mov    $0x1,%edx
cmovge %ecx,%edx
cmp    $0x8,%edx
jae    11ff <main+0x4f>
xor    %esi,%esi
jmp    1360 <main+0x1b0>
mov    %edx,%esi
and    $0x7ffffff8,%esi
lea    -0x8(%rsi),%rbx
mov    %rbx,%rdi
shr    $0x3,%rdi
add    $0x1,%rdi
mov    %edi,%ebp
and    $0x3,%ebp
cmp    $0x18,%rbx
jae    1230 <main+0x80>
movdqa 0xdd7(%rip),%xmm0
xor    %ebx,%ebx
jmp    130c <main+0x15c>
and    $0xfffffffffffffffc,%rdi
movdqa 0xdc4(%rip),%xmm0
xor    %ebx,%ebx
movdqa 0xdc9(%rip),%xmm8
movdqa 0xdd0(%rip),%xmm9
movdqa 0xdd7(%rip),%xmm10
movdqa 0xddf(%rip),%xmm4
movdqa 0xde7(%rip),%xmm5
movdqa 0xdef(%rip),%xmm6
movdqa 0xdf7(%rip),%xmm7
movdqa 0xdff(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm2
paddd  %xmm8,%xmm2
movdqa %xmm0,0x10(%rsp,%rbx,4)
movdqa %xmm2,0x20(%rsp,%rbx,4)
movdqa %xmm0,%xmm2
paddd  %xmm9,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm10,%xmm3
movdqa %xmm2,0x30(%rsp,%rbx,4)
movdqa %xmm3,0x40(%rsp,%rbx,4)
movdqa %xmm0,%xmm2
paddd  %xmm4,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm5,%xmm3
movdqa %xmm2,0x50(%rsp,%rbx,4)
movdqa %xmm3,0x60(%rsp,%rbx,4)
movdqa %xmm0,%xmm2
paddd  %xmm6,%xmm2
movdqa %xmm0,%xmm3
paddd  %xmm7,%xmm3
movdqa %xmm2,0x70(%rsp,%rbx,4)
movdqa %xmm3,0x80(%rsp,%rbx,4)
add    $0x20,%rbx
paddd  %xmm1,%xmm0
add    $0xfffffffffffffffc,%rdi
jne    1290 <main+0xe0>
test   %rbp,%rbp
je     1350 <main+0x1a0>
lea    (%rsp,%rbx,4),%rdi
add    $0x20,%rdi
shl    $0x5,%rbp
xor    %ebx,%ebx
movdqa 0xce9(%rip),%xmm1
movdqa 0xcf1(%rip),%xmm2
nop
movdqa %xmm0,%xmm3
paddd  %xmm1,%xmm3
movdqa %xmm0,-0x10(%rdi,%rbx,1)
movdqa %xmm3,(%rdi,%rbx,1)
paddd  %xmm2,%xmm0
add    $0x20,%rbx
cmp    %rbx,%rbp
jne    1330 <main+0x180>
cmp    %rdx,%rsi
je     136d <main+0x1bd>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %esi,0x10(%rsp,%rsi,4)
add    $0x1,%rsi
cmp    %rsi,%rdx
jne    1360 <main+0x1b0>
test   %eax,%eax
jle    13b2 <main+0x202>
cmp    $0x2,%ecx
mov    $0x1,%r15d
cmovge %ecx,%r15d
lea    0xd28(%rip),%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x10(%rsp,%rbp,4),%ecx
add    %ecx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1390 <main+0x1e0>
jmp    13b4 <main+0x204>
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%r15
mov    %r15,%rsi
call   1090 <omp_get_schedule@plt>
xor    %eax,%eax
call   10d0 <omp_get_dynamic@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   10a0 <omp_get_max_threads@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <omp_get_thread_limit@plt>
mov    0x8(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xcdf(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xd35(%rip),%r12
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <omp_get_num_procs@plt>
lea    0xd53(%rip),%r13
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <omp_in_parallel@plt>
lea    0xd8b(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdb6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1090 <omp_get_schedule@plt>
xor    %eax,%eax
call   10d0 <omp_get_dynamic@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10a0 <omp_get_max_threads@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <omp_get_thread_limit@plt>
mov    0x8(%rsp),%r8d
mov    0xc(%rsp),%r9d
lea    0xd98(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <omp_get_num_procs@plt>
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <omp_in_parallel@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2aeb(%rip),%rax
mov    (%rax),%edi
lea    0xb92(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"\0AFalta iteraciones o chunk \0A\00"
@.str.1 = [35 x i8] c" thread %d suma a[%d]=%d suma=%d \0A\00"
@.str.2 = [114 x i8] c"\0ADentro del parallel: dyn-var: %d, nthreads-var: %d, thread-limit-var: %d, run-sched-var[kind: %d, modifier: %d]\0A\00"
@.str.3 = [56 x i8] c"N\C2\BA de threads que se est\C3\A1n usando en el parallel: %d\0A\00"
@.str.4 = [82 x i8] c"N\C2\BA de procesadores disponibles para el programa en el momento de ejecuci\C3\B3n: %d\0A\00"
@.str.5 = [62 x i8] c"\C2\BFDentro de una region parallel? (0:falso, 1: verdadero): %d\0A\00"
@.str.6 = [34 x i8] c"\0AFuera de 'parallel for' suma=%d\0A\00"
@.str.7 = [113 x i8] c"\0AFuera del parallel: dyn-var: %d, nthreads-var: %d, thread-limit-var: %d, run-sched-var[kind: %d, modifier: %d]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 200, i32* %7
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %9
%17 = alloca i32, i64 %15
store i64 %15, i64* %10
store i32 0, i32* %11
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 3
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @exit(i32 -1)
unreachable
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = icmp sgt i32 %29, 200
br i1 %30, label %31, label %32
31: ; preds = %24
store i32 200, i32* %7
br label %32
32: ; preds = %31, %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %8
store i32 0, i32* %6
br label %37
37: ; preds = %46, %32
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %49
41: ; preds = %37
%42 = load i32, i32* %6
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %17, i64 %44
store i32 %42, i32* %45
br label %46
46: ; preds = %41
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %37
49: ; preds = %37
store i32 0, i32* %6
br label %50
50: ; preds = %68, %49
%51 = load i32, i32* %6
%52 = load i32, i32* %7
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %71
54: ; preds = %50
%55 = load i32, i32* %11
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %17, i64 %57
%59 = load i32, i32* %58
%60 = add nsw i32 %55, %59
store i32 %60, i32* %11
%61 = load i32, i32* %6
%62 = load i32, i32* %6
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %17, i64 %63
%65 = load i32, i32* %64
%66 = load i32, i32* %11
%67 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %61, i32 %65, i32 %66)
br label %68
68: ; preds = %54
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
br label %50
71: ; preds = %50
%72 = call i32 @omp_get_schedule(i32* %12, i32* %13)
%73 = call i32 (...) @omp_get_dynamic()
%74 = call i32 (...) @omp_get_max_threads()
%75 = call i32 (...) @omp_get_thread_limit()
%76 = load i32, i32* %12
%77 = load i32, i32* %13
%78 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.2, i64 0, i64 0), i32 %73, i32 %74, i32 %75, i32 %76, i32 %77)
%79 = call i32 (...) @omp_get_num_threads()
%80 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %79)
%81 = call i32 (...) @omp_get_num_procs()
%82 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0), i32 %81)
%83 = call i32 (...) @omp_in_parallel()
%84 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %11
%86 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %85)
%87 = call i32 @omp_get_schedule(i32* %12, i32* %13)
%88 = call i32 (...) @omp_get_dynamic()
%89 = call i32 (...) @omp_get_max_threads()
%90 = call i32 (...) @omp_get_thread_limit()
%91 = load i32, i32* %12
%92 = load i32, i32* %13
%93 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.7, i64 0, i64 0), i32 %88, i32 %89, i32 %90, i32 %91, i32 %92)
%94 = call i32 (...) @omp_get_num_threads()
%95 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %94)
%96 = call i32 (...) @omp_get_num_procs()
%97 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0), i32 %96)
%98 = call i32 (...) @omp_in_parallel()
%99 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %98)
%100 = load i8*, i8** %9
%101 = load i32, i32* %3
ret i32 %101
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"\0AFalta iteraciones o chunk \0A\00"
@.str.1 = [35 x i8] c" thread %d suma a[%d]=%d suma=%d \0A\00"
@.str.2 = [114 x i8] c"\0ADentro del parallel: dyn-var: %d, nthreads-var: %d, thread-limit-var: %d, run-sched-var[kind: %d, modifier: %d]\0A\00"
@.str.3 = [56 x i8] c"N\C2\BA de threads que se est\C3\A1n usando en el parallel: %d\0A\00"
@.str.4 = [82 x i8] c"N\C2\BA de procesadores disponibles para el programa en el momento de ejecuci\C3\B3n: %d\0A\00"
@.str.5 = [62 x i8] c"\C2\BFDentro de una region parallel? (0:falso, 1: verdadero): %d\0A\00"
@.str.6 = [34 x i8] c"\0AFuera de 'parallel for' suma=%d\0A\00"
@.str.7 = [113 x i8] c"\0AFuera del parallel: dyn-var: %d, nthreads-var: %d, thread-limit-var: %d, run-sched-var[kind: %d, modifier: %d]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [200 x i32]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = icmp slt i32 %0, 3
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = icmp slt i32 %16, 200
%18 = select i1 %17, i32 %16, i32 200
%19 = icmp sgt i32 %16, 0
br i1 %19, label %20, label %108
20: ; preds = %13
%21 = call i32 @llvm.smax.i32(i32 %18, i32 1)
%22 = zext i32 %21 to i64
%23 = icmp ult i32 %21, 8
br i1 %23, label %86, label %24
24: ; preds = %20
%25 = and i64 %22, 2147483640
%26 = add nsw i64 %25, -8
%27 = lshr exact i64 %26, 3
%28 = add nuw nsw i64 %27, 1
%29 = and i64 %28, 3
%30 = icmp ult i64 %26, 24
br i1 %30, label %67, label %31
31: ; preds = %24
%32 = and i64 %28, 4611686018427387900
br label %33
33: ; preds = %33, %31
%34 = phi i64 [ 0, %31 ], [ %63, %33 ]
%35 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %31 ], [ %64, %33 ]
%36 = phi i64 [ 0, %31 ], [ %65, %33 ]
%37 = add <4 x i32> %35, <i32 4, i32 4, i32 4, i32 4>
%38 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %34
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> %35, <4 x i32>* %39
%40 = getelementptr inbounds i32, i32* %38, i64 4
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> %37, <4 x i32>* %41
%42 = or i64 %34, 8
%43 = add <4 x i32> %35, <i32 8, i32 8, i32 8, i32 8>
%44 = add <4 x i32> %35, <i32 12, i32 12, i32 12, i32 12>
%45 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %42
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %46
%47 = getelementptr inbounds i32, i32* %45, i64 4
%48 = bitcast i32* %47 to <4 x i32>*
store <4 x i32> %44, <4 x i32>* %48
%49 = or i64 %34, 16
%50 = add <4 x i32> %35, <i32 16, i32 16, i32 16, i32 16>
%51 = add <4 x i32> %35, <i32 20, i32 20, i32 20, i32 20>
%52 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %49
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> %50, <4 x i32>* %53
%54 = getelementptr inbounds i32, i32* %52, i64 4
%55 = bitcast i32* %54 to <4 x i32>*
store <4 x i32> %51, <4 x i32>* %55
%56 = or i64 %34, 24
%57 = add <4 x i32> %35, <i32 24, i32 24, i32 24, i32 24>
%58 = add <4 x i32> %35, <i32 28, i32 28, i32 28, i32 28>
%59 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %56
%60 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> %57, <4 x i32>* %60
%61 = getelementptr inbounds i32, i32* %59, i64 4
%62 = bitcast i32* %61 to <4 x i32>*
store <4 x i32> %58, <4 x i32>* %62
%63 = add nuw i64 %34, 32
%64 = add <4 x i32> %35, <i32 32, i32 32, i32 32, i32 32>
%65 = add i64 %36, 4
%66 = icmp eq i64 %65, %32
br i1 %66, label %67, label %33
67: ; preds = %33, %24
%68 = phi i64 [ 0, %24 ], [ %63, %33 ]
%69 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %24 ], [ %64, %33 ]
%70 = icmp eq i64 %29, 0
br i1 %70, label %84, label %71
71: ; preds = %67, %71
%72 = phi i64 [ %80, %71 ], [ %68, %67 ]
%73 = phi <4 x i32> [ %81, %71 ], [ %69, %67 ]
%74 = phi i64 [ %82, %71 ], [ 0, %67 ]
%75 = add <4 x i32> %73, <i32 4, i32 4, i32 4, i32 4>
%76 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %72
%77 = bitcast i32* %76 to <4 x i32>*
store <4 x i32> %73, <4 x i32>* %77
%78 = getelementptr inbounds i32, i32* %76, i64 4
%79 = bitcast i32* %78 to <4 x i32>*
store <4 x i32> %75, <4 x i32>* %79
%80 = add nuw i64 %72, 8
%81 = add <4 x i32> %73, <i32 8, i32 8, i32 8, i32 8>
%82 = add i64 %74, 1
%83 = icmp eq i64 %82, %29
br i1 %83, label %84, label %71
84: ; preds = %71, %67
%85 = icmp eq i64 %25, %22
br i1 %85, label %88, label %86
86: ; preds = %20, %84
%87 = phi i64 [ 0, %20 ], [ %25, %84 ]
br label %92
88: ; preds = %92, %84
br i1 %19, label %89, label %108
89: ; preds = %88
%90 = call i32 @llvm.smax.i32(i32 %18, i32 1)
%91 = zext i32 %90 to i64
br label %98
92: ; preds = %86, %92
%93 = phi i64 [ %96, %92 ], [ %87, %86 ]
%94 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %93
%95 = trunc i64 %93 to i32
store i32 %95, i32* %94
%96 = add nuw nsw i64 %93, 1
%97 = icmp eq i64 %96, %22
br i1 %97, label %88, label %92
98: ; preds = %89, %98
%99 = phi i64 [ 0, %89 ], [ %106, %98 ]
%100 = phi i32 [ 0, %89 ], [ %103, %98 ]
%101 = getelementptr inbounds [200 x i32], [200 x i32]* %5, i64 0, i64 %99
%102 = load i32, i32* %101
%103 = add nsw i32 %102, %100
%104 = trunc i64 %99 to i32
%105 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %104, i32 %102, i32 %103)
%106 = add nuw nsw i64 %99, 1
%107 = icmp eq i64 %106, %91
br i1 %107, label %108, label %98
108: ; preds = %98, %13, %88
%109 = phi i32 [ 0, %88 ], [ 0, %13 ], [ %103, %98 ]
%110 = call i32 @omp_get_schedule(i32* %3, i32* %4)
%111 = call i32 (...) @omp_get_dynamic()
%112 = call i32 (...) @omp_get_max_threads()
%113 = call i32 (...) @omp_get_thread_limit()
%114 = load i32, i32* %3
%115 = load i32, i32* %4
%116 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.2, i64 0, i64 0), i32 %111, i32 %112, i32 %113, i32 %114, i32 %115)
%117 = call i32 (...) @omp_get_num_threads()
%118 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %117)
%119 = call i32 (...) @omp_get_num_procs()
%120 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0), i32 %119)
%121 = call i32 (...) @omp_in_parallel()
%122 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %121)
%123 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %109)
%124 = call i32 @omp_get_schedule(i32* %3, i32* %4)
%125 = call i32 (...) @omp_get_dynamic()
%126 = call i32 (...) @omp_get_max_threads()
%127 = call i32 (...) @omp_get_thread_limit()
%128 = load i32, i32* %3
%129 = load i32, i32* %4
%130 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.7, i64 0, i64 0), i32 %125, i32 %126, i32 %127, i32 %128, i32 %129)
%131 = call i32 (...) @omp_get_num_threads()
%132 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0), i32 %131)
%133 = call i32 (...) @omp_get_num_procs()
%134 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0), i32 %133)
%135 = call i32 (...) @omp_in_parallel()
%136 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %135)
ret i32 0
}