#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 omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
#pragma omp parallel
  {
    int ID = omp_get_thread_num();
#pragma omp for
    for (int i = 0; i <= 10; i++) {
      printf(" hello(%d, %d) ", ID, i);
      printf(" world(%d, %d) \n", ID, i);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     117c <main+0x5c>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xecb(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <printf@plt>
lea    0xec8(%rip),%r15
mov    %r15,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x2,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x3,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x4,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x7,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x8,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x9,%edx
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0xa,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c" hello(%d, %d) \00"
@.str.1 = [17 x i8] c" world(%d, %d) \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 3)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 3)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 4)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 4)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 5)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 5)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 6)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 6)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 7)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 7)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 8)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 8)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 9)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 9)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 10)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 10)
ret i32 0
}