#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 */
scalar_t__ malloc(int);
double pow(double, long);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int iterations = 10;
  int nelements = 1000 * 1000 * 10;
  double *a = (double *)malloc(sizeof(double) * nelements);
  double *b = (double *)malloc(sizeof(double) * nelements);
  double *c = (double *)malloc(sizeof(double) * nelements);
  for (int i = 0; i < nelements; i++) {
    a[i] = i;
    b[i] = i;
    c[i] = 1;
  }
  for (int iter = 0; iter < iterations; iter++) {
#pragma omp parallel for simd schedule(static)
    for (int i = 0; i < nelements; i++) {
      a[i] = b[i] + iter + c[i];
      b[i] = a[i] + iter + c[i];
      c[i] = pow(a[i], ((long)b[i]) % 2);
    }
  }
  printf("sum= %lf\n", c[1000]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x989680,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e0 <main+0xb0>
cvtsi2sdl -0x2c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdl -0x2c(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    118d <main+0x5d>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12c1 <main+0x191>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12ae <main+0x17e>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rdx,%rdi
call   1050 <pow@plt>
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11fa <main+0xca>
jmp    12b3 <main+0x183>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11e7 <main+0xb7>
mov    -0x28(%rbp),%rax
movsd  0x1f40(%rax),%xmm0
lea    0xd34(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    $0x4c4b400,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0x4c4b400,%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    $0x4c4b400,%edi
call   1040 <malloc@plt>
mov    %rax,%r13
lea    0x4c4b400(%r14),%rax
lea    0x4c4b400(%r15),%rdx
lea    0x4c4b400(%r13),%rsi
cmp    %rdx,%r14
setb   %r8b
cmp    %rax,%r15
setb   %bl
cmp    %rsi,%r14
setb   %cl
cmp    %rax,%r13
setb   %dil
cmp    %rsi,%r15
setb   %al
cmp    %rdx,%r13
setb   %dl
test   %bl,%r8b
jne    1270 <main+0x140>
and    %dil,%cl
jne    1270 <main+0x140>
and    %dl,%al
jne    1270 <main+0x140>
movdqa 0xe3f(%rip),%xmm0
mov    $0x6,%eax
movdqa 0xe42(%rip),%xmm1
movaps 0xe4b(%rip),%xmm2
movdqa 0xe53(%rip),%xmm3
movdqa 0xe5b(%rip),%xmm4
movdqa 0xe63(%rip),%xmm5
nopl   (%rax)
movdqa %xmm0,%xmm6
cvtdq2pd %xmm0,%xmm7
paddd  %xmm1,%xmm6
cvtdq2pd %xmm6,%xmm6
movups %xmm7,-0x30(%r14,%rax,8)
movups %xmm6,-0x20(%r14,%rax,8)
movups %xmm7,-0x30(%r15,%rax,8)
movups %xmm6,-0x20(%r15,%rax,8)
movups %xmm2,-0x30(%r13,%rax,8)
movups %xmm2,-0x20(%r13,%rax,8)
movdqa %xmm0,%xmm6
paddd  %xmm3,%xmm6
movdqa %xmm0,%xmm7
cvtdq2pd %xmm6,%xmm6
paddd  %xmm4,%xmm7
cvtdq2pd %xmm7,%xmm7
movups %xmm6,-0x10(%r14,%rax,8)
movups %xmm7,(%r14,%rax,8)
movups %xmm6,-0x10(%r15,%rax,8)
movups %xmm7,(%r15,%rax,8)
movups %xmm2,-0x10(%r13,%rax,8)
movups %xmm2,0x0(%r13,%rax,8)
paddd  %xmm5,%xmm0
add    $0x8,%rax
cmp    $0x989686,%rax
jne    11f0 <main+0xc0>
jmp    12c1 <main+0x191>
xor    %eax,%eax
movabs $0x3ff0000000000000,%rcx
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rax,8)
movsd  %xmm0,(%r15,%rax,8)
mov    %rcx,0x0(%r13,%rax,8)
lea    0x1(%rax),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  %xmm0,0x8(%r14,%rax,8)
movsd  %xmm0,0x8(%r15,%rax,8)
mov    %rcx,0x8(%r13,%rax,8)
add    $0x2,%rax
cmp    $0x989680,%rax
jne    1280 <main+0x150>
xor    %r12d,%r12d
pxor   %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
movq   %xmm0,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
addsd  0x0(%r13,%rbx,8),%xmm1
movsd  %xmm1,(%r14,%rbx,8)
addsd  %xmm0,%xmm1
addsd  0x0(%r13,%rbx,8),%xmm1
movsd  %xmm1,(%r15,%rbx,8)
movsd  (%r14,%rbx,8),%xmm0
cvttsd2si %xmm1,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
and    $0xfffffffffffffffe,%rax
sub    %rax,%rdi
call   1050 <pow@plt>
movsd  %xmm0,0x0(%r13,%rbx,8)
movsd  0x8(%rsp),%xmm0
add    $0x1,%rbx
cmp    $0x989680,%rbx
jne    12e0 <main+0x1b0>
addsd  0xd15(%rip),%xmm0
add    $0x1,%r12d
cmp    $0xa,%r12d
jne    12d0 <main+0x1a0>
movsd  0x1f40(%r13),%xmm0
lea    0xcff(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"sum= %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 10000000, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to double*
store double* %15, double** %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = mul i64 8, %17
%19 = trunc i64 %18 to i32
%20 = call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to double*
store double* %21, double** %5
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = mul i64 8, %23
%25 = trunc i64 %24 to i32
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %6
store i32 0, i32* %7
br label %28
28: ; preds = %49, %0
%29 = load i32, i32* %7
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %52
32: ; preds = %28
%33 = load i32, i32* %7
%34 = sitofp i32 %33 to double
%35 = load double*, double** %4
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
store double %34, double* %38
%39 = load i32, i32* %7
%40 = sitofp i32 %39 to double
%41 = load double*, double** %5
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double %40, double* %44
%45 = load double*, double** %6
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
store double 1.000000e+00, double* %48
br label %49
49: ; preds = %32
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %28
52: ; preds = %28
store i32 0, i32* %8
br label %53
53: ; preds = %120, %52
%54 = load i32, i32* %8
%55 = load i32, i32* %2
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %123
57: ; preds = %53
store i32 0, i32* %9
br label %58
58: ; preds = %116, %57
%59 = load i32, i32* %9
%60 = load i32, i32* %3
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %119
62: ; preds = %58
%63 = load double*, double** %5
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
%67 = load double, double* %66
%68 = load i32, i32* %8
%69 = sitofp i32 %68 to double
%70 = fadd double %67, %69
%71 = load double*, double** %6
%72 = load i32, i32* %9
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %71, i64 %73
%75 = load double, double* %74
%76 = fadd double %70, %75
%77 = load double*, double** %4
%78 = load i32, i32* %9
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
store double %76, double* %80
%81 = load double*, double** %4
%82 = load i32, i32* %9
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = load double, double* %84
%86 = load i32, i32* %8
%87 = sitofp i32 %86 to double
%88 = fadd double %85, %87
%89 = load double*, double** %6
%90 = load i32, i32* %9
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %89, i64 %91
%93 = load double, double* %92
%94 = fadd double %88, %93
%95 = load double*, double** %5
%96 = load i32, i32* %9
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
store double %94, double* %98
%99 = load double*, double** %4
%100 = load i32, i32* %9
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
%103 = load double, double* %102
%104 = load double*, double** %5
%105 = load i32, i32* %9
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %104, i64 %106
%108 = load double, double* %107
%109 = fptosi double %108 to i64
%110 = srem i64 %109, 2
%111 = call double @pow(double %103, i64 %110)
%112 = load double*, double** %6
%113 = load i32, i32* %9
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
store double %111, double* %115
br label %116
116: ; preds = %62
%117 = load i32, i32* %9
%118 = add nsw i32 %117, 1
store i32 %118, i32* %9
br label %58
119: ; preds = %58
br label %120
120: ; preds = %119
%121 = load i32, i32* %8
%122 = add nsw i32 %121, 1
store i32 %122, i32* %8
br label %53
123: ; preds = %53
%124 = load double*, double** %6
%125 = getelementptr inbounds double, double* %124, i64 1000
%126 = load double, double* %125
%127 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %126)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"sum= %lf\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 80000000)
%2 = inttoptr i64 %1 to double*
%3 = inttoptr i64 %1 to i8*
%4 = tail call i64 @malloc(i32 80000000)
%5 = inttoptr i64 %4 to double*
%6 = inttoptr i64 %4 to i8*
%7 = tail call i64 @malloc(i32 80000000)
%8 = inttoptr i64 %7 to double*
%9 = inttoptr i64 %7 to i8*
%10 = getelementptr double, double* %2, i64 10000000
%11 = bitcast double* %10 to i8*
%12 = getelementptr double, double* %5, i64 10000000
%13 = bitcast double* %12 to i8*
%14 = getelementptr double, double* %8, i64 10000000
%15 = bitcast double* %14 to i8*
%16 = icmp ult i8* %3, %13
%17 = icmp ult i8* %6, %11
%18 = and i1 %16, %17
%19 = icmp ult i8* %3, %15
%20 = icmp ult i8* %9, %11
%21 = and i1 %19, %20
%22 = or i1 %18, %21
%23 = icmp ult i8* %6, %15
%24 = icmp ult i8* %9, %13
%25 = and i1 %23, %24
%26 = or i1 %22, %25
br i1 %26, label %65, label %27
27: ; preds = %0, %27
%28 = phi i64 [ %62, %27 ], [ 0, %0 ]
%29 = phi <2 x i32> [ %63, %27 ], [ <i32 0, i32 1>, %0 ]
%30 = add <2 x i32> %29, <i32 2, i32 2>
%31 = sitofp <2 x i32> %29 to <2 x double>
%32 = sitofp <2 x i32> %30 to <2 x double>
%33 = getelementptr inbounds double, double* %2, i64 %28
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> %31, <2 x double>* %34
%35 = getelementptr inbounds double, double* %33, i64 2
%36 = bitcast double* %35 to <2 x double>*
store <2 x double> %32, <2 x double>* %36
%37 = getelementptr inbounds double, double* %5, i64 %28
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> %31, <2 x double>* %38
%39 = getelementptr inbounds double, double* %37, i64 2
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> %32, <2 x double>* %40
%41 = getelementptr inbounds double, double* %8, i64 %28
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %42
%43 = getelementptr inbounds double, double* %41, i64 2
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %44
%45 = or i64 %28, 4
%46 = add <2 x i32> %29, <i32 4, i32 4>
%47 = add <2 x i32> %29, <i32 6, i32 6>
%48 = sitofp <2 x i32> %46 to <2 x double>
%49 = sitofp <2 x i32> %47 to <2 x double>
%50 = getelementptr inbounds double, double* %2, i64 %45
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> %48, <2 x double>* %51
%52 = getelementptr inbounds double, double* %50, i64 2
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> %49, <2 x double>* %53
%54 = getelementptr inbounds double, double* %5, i64 %45
%55 = bitcast double* %54 to <2 x double>*
store <2 x double> %48, <2 x double>* %55
%56 = getelementptr inbounds double, double* %54, i64 2
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %49, <2 x double>* %57
%58 = getelementptr inbounds double, double* %8, i64 %45
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %59
%60 = getelementptr inbounds double, double* %58, i64 2
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %61
%62 = add nuw nsw i64 %28, 8
%63 = add <2 x i32> %29, <i32 8, i32 8>
%64 = icmp eq i64 %62, 10000000
br i1 %64, label %80, label %27
65: ; preds = %0, %65
%66 = phi i64 [ %78, %65 ], [ 0, %0 ]
%67 = trunc i64 %66 to i32
%68 = sitofp i32 %67 to double
%69 = getelementptr inbounds double, double* %2, i64 %66
store double %68, double* %69
%70 = getelementptr inbounds double, double* %5, i64 %66
store double %68, double* %70
%71 = getelementptr inbounds double, double* %8, i64 %66
store double 1.000000e+00, double* %71
%72 = or i64 %66, 1
%73 = trunc i64 %72 to i32
%74 = sitofp i32 %73 to double
%75 = getelementptr inbounds double, double* %2, i64 %72
store double %74, double* %75
%76 = getelementptr inbounds double, double* %5, i64 %72
store double %74, double* %76
%77 = getelementptr inbounds double, double* %8, i64 %72
store double 1.000000e+00, double* %77
%78 = add nuw nsw i64 %66, 2
%79 = icmp eq i64 %78, 10000000
br i1 %79, label %80, label %65
80: ; preds = %27, %65
br label %81
81: ; preds = %80, %88
%82 = phi i32 [ %89, %88 ], [ 0, %80 ]
%83 = sitofp i32 %82 to double
br label %91
84: ; preds = %88
%85 = getelementptr inbounds double, double* %8, i64 1000
%86 = load double, double* %85
%87 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %86)
ret i32 0
88: ; preds = %91
%89 = add nuw nsw i32 %82, 1
%90 = icmp eq i32 %89, 10
br i1 %90, label %84, label %81
91: ; preds = %81, %91
%92 = phi i64 [ 0, %81 ], [ %107, %91 ]
%93 = getelementptr inbounds double, double* %5, i64 %92
%94 = load double, double* %93
%95 = fadd double %94, %83
%96 = getelementptr inbounds double, double* %8, i64 %92
%97 = load double, double* %96
%98 = fadd double %95, %97
%99 = getelementptr inbounds double, double* %2, i64 %92
store double %98, double* %99
%100 = fadd double %98, %83
%101 = load double, double* %96
%102 = fadd double %100, %101
store double %102, double* %93
%103 = load double, double* %99
%104 = fptosi double %102 to i64
%105 = srem i64 %104, 2
%106 = tail call double @pow(double %103, i64 %105)
store double %106, double* %96
%107 = add nuw nsw i64 %92, 1
%108 = icmp eq i64 %107, 10000000
br i1 %108, label %88, label %91
}