#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];
  char first_time;
  for (i = 0; i < 50; i++)
    a[i] = b[i] = i * 1.0;
  chunk = 5;
  first_time = 'y';
#pragma omp parallel for shared(a, b, c, chunk) private(i, tid)                \
    schedule(static, chunk) firstprivate(first_time)
  for (i = 0; i < 50; i++) {
    if (first_time == 'y') {
      tid = omp_get_thread_num();
      first_time = 'n';
    }
    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    $0x290,%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)
movb   $0x79,-0x281(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    1214 <main+0xf4>
movsbl -0x281(%rbp),%eax
cmp    $0x79,%eax
jne    11c0 <main+0xa0>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x10(%rbp)
movb   $0x6e,-0x281(%rbp)
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    0xe07(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1195 <main+0x75>
xor    %eax,%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x198,%rsp
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x100(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x110(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x120(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x130(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x140(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x150(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x160(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x170(%rsp)
movaps 0xe98(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0x180(%rsp)
movabs $0x4244000042400000,%rax
mov    %rax,0xc0(%rsp)
mov    %rax,0x190(%rsp)
mov    $0x79,%r15b
lea    0xe74(%rip),%r14
xor    %ebx,%ebx
jmp    1274 <main+0x154>
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
je     1288 <main+0x168>
cmp    $0x79,%r15b
jne    1250 <main+0x130>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebp
mov    $0x6e,%r15b
jmp    1250 <main+0x130>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
pop    %r15
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]
%8 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
br label %9
9: ; preds = %23, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 1.000000e+00
%16 = fptrunc double %15 to float
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [50 x float], [50 x float]* %6, i64 0, i64 %18
store float %16, float* %19
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [50 x float], [50 x float]* %5, i64 0, i64 %21
store float %16, float* %22
br label %23
23: ; preds = %12
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %9
26: ; preds = %9
store i32 5, i32* %3
store i8 121, i8* %8
store i32 0, i32* %2
br label %27
27: ; preds = %56, %26
%28 = load i32, i32* %2
%29 = icmp slt i32 %28, 50
br i1 %29, label %30, label %59
30: ; preds = %27
%31 = load i8, i8* %8
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 121
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 (...) @omp_get_thread_num()
store i32 %35, i32* %4
store i8 110, i8* %8
br label %36
36: ; preds = %34, %30
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [50 x float], [50 x float]* %5, i64 0, i64 %38
%40 = load float, float* %39
%41 = load i32, i32* %2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [50 x float], [50 x float]* %6, i64 0, i64 %42
%44 = load float, float* %43
%45 = fadd float %40, %44
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [50 x float], [50 x float]* %7, i64 0, i64 %47
store float %45, float* %48
%49 = load i32, i32* %4
%50 = load i32, i32* %2
%51 = load i32, i32* %2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [50 x float], [50 x float]* %7, i64 0, i64 %52
%54 = load float, float* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %49, i32 %50, float %54)
br label %56
56: ; preds = %36
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %27
59: ; 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
br label %55
55: ; preds = %0, %62
%56 = phi i64 [ %72, %62 ], [ 0, %0 ]
%57 = phi i8 [ %64, %62 ], [ 121, %0 ]
%58 = phi i32 [ %63, %62 ], [ undef, %0 ]
%59 = icmp eq i8 %57, 121
br i1 %59, label %60, label %62
60: ; preds = %55
%61 = tail call i32 (...) @omp_get_thread_num()
br label %62
62: ; preds = %60, %55
%63 = phi i32 [ %61, %60 ], [ %58, %55 ]
%64 = phi i8 [ 110, %60 ], [ %57, %55 ]
%65 = getelementptr inbounds [50 x float], [50 x float]* %1, i64 0, i64 %56
%66 = load float, float* %65
%67 = getelementptr inbounds [50 x float], [50 x float]* %2, i64 0, i64 %56
%68 = load float, float* %67
%69 = fadd float %66, %68
%70 = trunc i64 %56 to i32
%71 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %63, i32 %70, float %69)
%72 = add nuw nsw i64 %56, 1
%73 = icmp eq i64 %72, 50
br i1 %73, label %74, label %55
74: ; preds = %62
ret i32 0
}