#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, float);
int main(int argc, char *argv[]) {
  int i, chunk, tid;
  float a[50], b[50], c[50];
  for (i = 0; i < 50; i++) {
    a[i] = b[i] = i * 1.0;
  }
  chunk = 5;
#pragma omp parallel shared(a, b, c, chunk) private(i, tid)
  {
    tid = omp_get_thread_num();
#pragma omp parallel for schedule(static, chunk)
    for (i = 0; i < 50; i++) {
      c[i] = a[i] + b[i];
      printf("tid= %d i= %d c[i]= %f\n", tid, i, c[i]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    1187 <main+0x67>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x14(%rbp),%rax
movss  %xmm0,-0x1c0(%rbp,%rax,4)
ff ff
movslq -0x14(%rbp),%rax
movss  %xmm0,-0xf0(%rbp,%rax,4)
ff ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
movl   $0x5,-0x18(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    11fd <main+0xdd>
movslq -0x14(%rbp),%rax
movss  -0xf0(%rbp,%rax,4),%xmm0
ff ff
movslq -0x14(%rbp),%rax
addss  -0x1c0(%rbp,%rax,4),%xmm0
ff ff
movslq -0x14(%rbp),%rax
movss  %xmm0,-0x290(%rbp,%rax,4)
ff ff
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
movslq -0x14(%rbp),%rax
movss  -0x290(%rbp,%rax,4),%xmm0
ff ff
lea    0xe1e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <main+0x7f>
mov    -0x4(%rbp),%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1a0,%rsp
movaps 0xece(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x100(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x110(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x120(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x130(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x140(%rsp)
movaps 0xeaf(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x150(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x160(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x170(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0x180(%rsp)
movabs $0x4244000042400000,%rax
mov    %rax,0xc0(%rsp)
mov    %rax,0x190(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebp
lea    0xe6e(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0xd0(%rsp,%rbx,4),%xmm0
addss  (%rsp,%rbx,4),%xmm0
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1260 <main+0x140>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"tid= %d i= %d c[i]= %f\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 [50 x float]
%10 = alloca [50 x float]
%11 = alloca [50 x float]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %12
12: ; preds = %26, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 50
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 1.000000e+00
%19 = fptrunc double %18 to float
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [50 x float], [50 x float]* %10, i64 0, i64 %21
store float %19, float* %22
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [50 x float], [50 x float]* %9, i64 0, i64 %24
store float %19, float* %25
br label %26
26: ; preds = %15
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %12
29: ; preds = %12
store i32 5, i32* %7
%30 = call i32 (...) @omp_get_thread_num()
store i32 %30, i32* %8
store i32 0, i32* %6
br label %31
31: ; preds = %54, %29
%32 = load i32, i32* %6
%33 = icmp slt i32 %32, 50
br i1 %33, label %34, label %57
34: ; preds = %31
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [50 x float], [50 x float]* %9, i64 0, i64 %36
%38 = load float, float* %37
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [50 x float], [50 x float]* %10, i64 0, i64 %40
%42 = load float, float* %41
%43 = fadd float %38, %42
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [50 x float], [50 x float]* %11, i64 0, i64 %45
store float %43, float* %46
%47 = load i32, i32* %8
%48 = load i32, i32* %6
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [50 x float], [50 x float]* %11, i64 0, i64 %50
%52 = load float, float* %51
%53 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %47, i32 %48, float %52)
br label %54
54: ; preds = %34
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %31
57: ; preds = %31
%58 = load i32, i32* %3
ret i32 %58
}

LLVM IR (-O2):
@.str = [24 x i8] c"tid= %d i= %d c[i]= %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x float]
%4 = alloca [50 x float]
%5 = bitcast [50 x float]* %3 to i8*
%6 = bitcast [50 x float]* %4 to i8*
%7 = bitcast [50 x float]* %4 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, <4 x float>* %7
%8 = bitcast [50 x float]* %3 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 1.000000e+00, float 2.000000e+00, float 3.000000e+00>, <4 x float>* %8
%9 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 4
%10 = bitcast float* %9 to <4 x float>*
store <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, <4 x float>* %10
%11 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 4
%12 = bitcast float* %11 to <4 x float>*
store <4 x float> <float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00>, <4 x float>* %12
%13 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 8
%14 = bitcast float* %13 to <4 x float>*
store <4 x float> <float 8.000000e+00, float 9.000000e+00, float 1.000000e+01, float 1.100000e+01>, <4 x float>* %14
%15 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 8
%16 = bitcast float* %15 to <4 x float>*
store <4 x float> <float 8.000000e+00, float 9.000000e+00, float 1.000000e+01, float 1.100000e+01>, <4 x float>* %16
%17 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 12
%18 = bitcast float* %17 to <4 x float>*
store <4 x float> <float 1.200000e+01, float 1.300000e+01, float 1.400000e+01, float 1.500000e+01>, <4 x float>* %18
%19 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 12
%20 = bitcast float* %19 to <4 x float>*
store <4 x float> <float 1.200000e+01, float 1.300000e+01, float 1.400000e+01, float 1.500000e+01>, <4 x float>* %20
%21 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 16
%22 = bitcast float* %21 to <4 x float>*
store <4 x float> <float 1.600000e+01, float 1.700000e+01, float 1.800000e+01, float 1.900000e+01>, <4 x float>* %22
%23 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 16
%24 = bitcast float* %23 to <4 x float>*
store <4 x float> <float 1.600000e+01, float 1.700000e+01, float 1.800000e+01, float 1.900000e+01>, <4 x float>* %24
%25 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 20
%26 = bitcast float* %25 to <4 x float>*
store <4 x float> <float 2.000000e+01, float 2.100000e+01, float 2.200000e+01, float 2.300000e+01>, <4 x float>* %26
%27 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 20
%28 = bitcast float* %27 to <4 x float>*
store <4 x float> <float 2.000000e+01, float 2.100000e+01, float 2.200000e+01, float 2.300000e+01>, <4 x float>* %28
%29 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 24
%30 = bitcast float* %29 to <4 x float>*
store <4 x float> <float 2.400000e+01, float 2.500000e+01, float 2.600000e+01, float 2.700000e+01>, <4 x float>* %30
%31 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 24
%32 = bitcast float* %31 to <4 x float>*
store <4 x float> <float 2.400000e+01, float 2.500000e+01, float 2.600000e+01, float 2.700000e+01>, <4 x float>* %32
%33 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 28
%34 = bitcast float* %33 to <4 x float>*
store <4 x float> <float 2.800000e+01, float 2.900000e+01, float 3.000000e+01, float 3.100000e+01>, <4 x float>* %34
%35 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 28
%36 = bitcast float* %35 to <4 x float>*
store <4 x float> <float 2.800000e+01, float 2.900000e+01, float 3.000000e+01, float 3.100000e+01>, <4 x float>* %36
%37 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 32
%38 = bitcast float* %37 to <4 x float>*
store <4 x float> <float 3.200000e+01, float 3.300000e+01, float 3.400000e+01, float 3.500000e+01>, <4 x float>* %38
%39 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 32
%40 = bitcast float* %39 to <4 x float>*
store <4 x float> <float 3.200000e+01, float 3.300000e+01, float 3.400000e+01, float 3.500000e+01>, <4 x float>* %40
%41 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 36
%42 = bitcast float* %41 to <4 x float>*
store <4 x float> <float 3.600000e+01, float 3.700000e+01, float 3.800000e+01, float 3.900000e+01>, <4 x float>* %42
%43 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 36
%44 = bitcast float* %43 to <4 x float>*
store <4 x float> <float 3.600000e+01, float 3.700000e+01, float 3.800000e+01, float 3.900000e+01>, <4 x float>* %44
%45 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 40
%46 = bitcast float* %45 to <4 x float>*
store <4 x float> <float 4.000000e+01, float 4.100000e+01, float 4.200000e+01, float 4.300000e+01>, <4 x float>* %46
%47 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 40
%48 = bitcast float* %47 to <4 x float>*
store <4 x float> <float 4.000000e+01, float 4.100000e+01, float 4.200000e+01, float 4.300000e+01>, <4 x float>* %48
%49 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 44
%50 = bitcast float* %49 to <4 x float>*
store <4 x float> <float 4.400000e+01, float 4.500000e+01, float 4.600000e+01, float 4.700000e+01>, <4 x float>* %50
%51 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 44
%52 = bitcast float* %51 to <4 x float>*
store <4 x float> <float 4.400000e+01, float 4.500000e+01, float 4.600000e+01, float 4.700000e+01>, <4 x float>* %52
%53 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 48
store float 4.800000e+01, float* %53
%54 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 48
store float 4.800000e+01, float* %54
%55 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 49
store float 4.900000e+01, float* %55
%56 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 49
store float 4.900000e+01, float* %56
%57 = tail call i32 (...) @omp_get_thread_num()
br label %58
58: ; preds = %2, %58
%59 = phi i64 [ 0, %2 ], [ %67, %58 ]
%60 = getelementptr inbounds [50 x float], [50 x float]* %3, i64 0, i64 %59
%61 = load float, float* %60
%62 = getelementptr inbounds [50 x float], [50 x float]* %4, i64 0, i64 %59
%63 = load float, float* %62
%64 = fadd float %61, %63
%65 = trunc i64 %59 to i32
%66 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %57, i32 %65, float %64)
%67 = add nuw nsw i64 %59, 1
%68 = icmp eq i64 %67, 50
br i1 %68, label %69, label %58
69: ; preds = %58
ret i32 0
}