#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);
main() {
  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 for shared(a, b, c, chunk) private(i, tid)                \
    schedule(static, chunk)
  {
    tid = omp_get_thread_num();
    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]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1180 <main+0x60>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x1b0(%rbp,%rax,4)
ff ff
movslq -0x8(%rbp),%rax
movss  %xmm0,-0xe0(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
movl   $0x5,-0xc(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    11f6 <main+0xd6>
movslq -0x8(%rbp),%rax
movss  -0xe0(%rbp,%rax,4),%xmm0
ff ff
movslq -0x8(%rbp),%rax
addss  -0x1b0(%rbp,%rax,4),%xmm0
ff ff
movslq -0x8(%rbp),%rax
movss  %xmm0,-0x280(%rbp,%rax,4)
ff ff
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
movslq -0x8(%rbp),%rax
movss  -0x280(%rbp,%rax,4),%xmm0
ff ff
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <main+0x78>
xor    %eax,%eax
add    $0x280,%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() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [50 x float]
%6 = alloca [50 x float]
%7 = alloca [50 x float]
store i32 0, i32* %1
store i32 0, i32* %2
br label %8
8: ; preds = %22, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 50
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 1.000000e+00
%15 = fptrunc double %14 to float
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [50 x float], [50 x float]* %6, i64 0, i64 %17
store float %15, float* %18
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [50 x float], [50 x float]* %5, i64 0, i64 %20
store float %15, float* %21
br label %22
22: ; preds = %11
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %8
25: ; preds = %8
store i32 5, i32* %3
%26 = call i32 (...) @omp_get_thread_num()
store i32 %26, i32* %4
store i32 0, i32* %2
br label %27
27: ; preds = %50, %25
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 50
br i1 %29, label %30, label %53
30: ; preds = %27
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [50 x float], [50 x float]* %5, i64 0, i64 %32
%34 = load float, float* %33
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [50 x float], [50 x float]* %6, i64 0, i64 %36
%38 = load float, float* %37
%39 = fadd float %34, %38
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [50 x float], [50 x float]* %7, i64 0, i64 %41
store float %39, float* %42
%43 = load i32, i32* %4
%44 = load i32, i32* %2
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [50 x float], [50 x float]* %7, i64 0, i64 %46
%48 = load float, float* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, float %48)
br label %50
50: ; preds = %30
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %27
53: ; preds = %27
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"tid= %d i= %d c[i]= %f\0A\00"
define i32 @main() {
%1 = alloca [50 x float]
%2 = alloca [50 x float]
%3 = bitcast [50 x float]* %1 to i8*
%4 = bitcast [50 x float]* %2 to i8*
%5 = bitcast [50 x float]* %2 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>* %5
%6 = bitcast [50 x float]* %1 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>* %6
%7 = getelementptr inbounds [50 x float], [50 x float]* %2, i64 0, i64 4
%8 = bitcast float* %7 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>* %8
%9 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 8
%12 = bitcast float* %11 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>* %12
%13 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 12
%16 = bitcast float* %15 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>* %16
%17 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 16
%20 = bitcast float* %19 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>* %20
%21 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 20
%24 = bitcast float* %23 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>* %24
%25 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 24
%28 = bitcast float* %27 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>* %28
%29 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 28
%32 = bitcast float* %31 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>* %32
%33 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 32
%36 = bitcast float* %35 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>* %36
%37 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 36
%40 = bitcast float* %39 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>* %40
%41 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 40
%44 = bitcast float* %43 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>* %44
%45 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 44
%48 = bitcast float* %47 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>* %48
%49 = getelementptr inbounds [50 x float], [50 x float]* %1, 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]* %2, i64 0, i64 48
store float 4.800000e+01, float* %51
%52 = getelementptr inbounds [50 x float], [50 x float]* %1, i64 0, i64 48
store float 4.800000e+01, float* %52
%53 = getelementptr inbounds [50 x float], [50 x float]* %2, i64 0, i64 49
store float 4.900000e+01, float* %53
%54 = getelementptr inbounds [50 x float], [50 x float]* %1, i64 0, i64 49
store float 4.900000e+01, float* %54
%55 = tail call i32 (...) @omp_get_thread_num()
br label %56
56: ; preds = %0, %56
%57 = phi i64 [ 0, %0 ], [ %65, %56 ]
%58 = getelementptr inbounds [50 x float], [50 x float]* %1, i64 0, i64 %57
%59 = load float, float* %58
%60 = getelementptr inbounds [50 x float], [50 x float]* %2, i64 0, i64 %57
%61 = load float, float* %60
%62 = fadd float %59, %61
%63 = trunc i64 %57 to i32
%64 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %55, i32 %63, float %62)
%65 = add nuw nsw i64 %57, 1
%66 = icmp eq i64 %65, 50
br i1 %66, label %67, label %56
67: ; preds = %56
ret i32 0
}