#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*/ baz(char *, int, int);
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
void f5(void) {
  int i;
#pragma omp parallel
  {
#pragma omp for schedule(dynamic, 15)
    for (i = 0; i < 10000; i++)
      printf("section1 %d/%d\n", omp_get_thread_num(), omp_get_num_threads());
    baz("%d/%d\n", omp_get_thread_num(), omp_get_num_threads());
  }
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    118c <f5+0x4c>
mov    $0x0,%al
call   1040 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <omp_get_num_threads@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <f5+0xf>
mov    $0x0,%al
call   1040 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <omp_get_num_threads@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe60(%rip),%rdi
call   1030 <baz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2710,%ebx
lea    0xeb0(%rip),%r14
xor    %eax,%eax
call   1040 <omp_get_thread_num@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <omp_get_num_threads@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <printf@plt>
add    $0xffffffff,%ebx
jne    1150 <f5+0x10>
xor    %eax,%eax
call   1040 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <omp_get_num_threads@plt>
lea    0xe81(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <baz@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"section1 %d/%d\0A\00"
@.str.1 = [7 x i8] c"%d/%d\0A\00"
define void @f5() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10000
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = call i32 (...) @omp_get_thread_num()
%7 = call i32 (...) @omp_get_num_threads()
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
br label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %2
12: ; preds = %2
%13 = call i32 (...) @omp_get_thread_num()
%14 = call i32 (...) @omp_get_num_threads()
%15 = call i32 @baz(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"section1 %d/%d\0A\00"
@.str.1 = [7 x i8] c"%d/%d\0A\00"
define void @f5() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 (...) @omp_get_num_threads()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %8, label %1
8: ; preds = %1
%9 = tail call i32 (...) @omp_get_thread_num()
%10 = tail call i32 (...) @omp_get_num_threads()
%11 = tail call i32 @baz(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret void
}