#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_num_thread();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ pooh(int, double *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  double A[1000];
  omp_set_num_threads(4);
#pragma omp parallel
  {
    int ID = omp_get_num_thread();
    pooh(ID, A);
    printf("Hello(%d)", ID);
  }
  printf("All done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1060 <omp_set_num_threads@plt>
mov    $0x0,%al
call   1050 <omp_get_num_thread@plt>
mov    %eax,-0x1f54(%rbp)
mov    -0x1f54(%rbp),%edi
lea    -0x1f50(%rbp),%rsi
call   1030 <pooh@plt>
mov    -0x1f54(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1f60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1f40,%rsp
mov    $0x4,%edi
call   1070 <omp_set_num_threads@plt>
xor    %eax,%eax
call   1060 <omp_get_num_thread@plt>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %eax,%edi
call   1030 <pooh@plt>
lea    0xe84(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x1f40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hello(%d)\00"
@.str.1 = [10 x i8] c"All done\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000 x double]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @omp_set_num_threads(i32 4)
%9 = call i32 (...) @omp_get_num_thread()
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = getelementptr inbounds [1000 x double], [1000 x double]* %6, i64 0, i64 0
%12 = call i32 @pooh(i32 %10, double* %11)
%13 = load i32, i32* %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello(%d)\00"
@str = [9 x i8] c"All done\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x double]
%4 = bitcast [1000 x double]* %3 to i8*
%5 = tail call i32 @omp_set_num_threads(i32 4)
%6 = tail call i32 (...) @omp_get_num_thread()
%7 = getelementptr inbounds [1000 x double], [1000 x double]* %3, i64 0, i64 0
%8 = call i32 @pooh(i32 %6, double* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}