void __attribute__((no, noclone)) foo(double *b, double *d, double *f) {
  int i;
  for (i = 0; i < 1024; i++) {
    d[2 * i] = 2. * d[2 * i];
    d[2 * i + 1] = 4. * d[2 * i + 1];
    b[i] = d[2 * i] - 1.;
    f[i] = d[2 * i + 1] + 2.;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x400,-0x1c(%rbp)
jge    11e5 <foo+0xe5>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xec7(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xea8(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe6c(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xe3b(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <foo+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r14
push   %rbx
lea    0x2000(%rdi),%rax
cmp    %rsi,%rax
seta   %r11b
lea    0x4000(%rsi),%rcx
cmp    %rdi,%rcx
seta   %r14b
lea    0x2000(%rdx),%rbp
cmp    %rsi,%rbp
seta   %bl
cmp    %rdx,%rcx
seta   %r9b
cmp    %rdi,%rbp
seta   %r8b
cmp    %rdx,%rax
seta   %r10b
xor    %eax,%eax
test   %r14b,%r11b
jne    11e9 <foo+0xe9>
and    %r9b,%bl
jne    11e9 <foo+0xe9>
and    %r10b,%r8b
jne    11e9 <foo+0xe9>
xor    %eax,%eax
movapd 0xe97(%rip),%xmm0
movapd 0xe9f(%rip),%xmm1
movapd 0xea7(%rip),%xmm2
nopl   0x0(%rax)
movupd (%rsi,%rax,2),%xmm3
movupd 0x10(%rsi,%rax,2),%xmm4
movapd %xmm3,%xmm5
unpcklpd %xmm4,%xmm5
unpckhpd %xmm4,%xmm3
addpd  %xmm5,%xmm5
mulpd  %xmm0,%xmm3
movapd %xmm5,%xmm4
unpckhpd %xmm3,%xmm4
movapd %xmm5,%xmm6
unpcklpd %xmm3,%xmm6
movupd %xmm6,(%rsi,%rax,2)
movupd %xmm4,0x10(%rsi,%rax,2)
addpd  %xmm1,%xmm5
movupd %xmm5,(%rdi,%rax,1)
movupd 0x8(%rsi,%rax,2),%xmm3
movhpd 0x18(%rsi,%rax,2),%xmm3
addpd  %xmm2,%xmm3
movupd %xmm3,(%rdx,%rax,1)
add    $0x10,%rax
cmp    $0x1ff0,%rax
jne    1180 <foo+0x80>
mov    $0x3fe,%eax
shl    $0x3,%rax
movapd 0xe3b(%rip),%xmm0
movsd  0xe43(%rip),%xmm1
movsd  0xe43(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
movupd (%rsi,%rax,2),%xmm3
mulpd  %xmm0,%xmm3
movupd %xmm3,(%rsi,%rax,2)
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rdi,%rax,1)
movsd  0x8(%rsi,%rax,2),%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%rdx,%rax,1)
movupd 0x10(%rsi,%rax,2),%xmm3
mulpd  %xmm0,%xmm3
movupd %xmm3,0x10(%rsi,%rax,2)
addsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rdi,%rax,1)
movsd  0x18(%rsi,%rax,2),%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rdx,%rax,1)
add    $0x10,%rax
cmp    $0x2000,%rax
jne    1210 <foo+0x110>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @foo(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
store i32 0, i32* %7
br label %8
8: ; preds = %61, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 1024
br i1 %10, label %11, label %64
11: ; preds = %8
%12 = load double*, double** %5
%13 = load i32, i32* %7
%14 = mul nsw i32 2, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %12, i64 %15
%17 = load double, double* %16
%18 = fmul double 2.000000e+00, %17
%19 = load double*, double** %5
%20 = load i32, i32* %7
%21 = mul nsw i32 2, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %19, i64 %22
store double %18, double* %23
%24 = load double*, double** %5
%25 = load i32, i32* %7
%26 = mul nsw i32 2, %25
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %24, i64 %28
%30 = load double, double* %29
%31 = fmul double 4.000000e+00, %30
%32 = load double*, double** %5
%33 = load i32, i32* %7
%34 = mul nsw i32 2, %33
%35 = add nsw i32 %34, 1
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %32, i64 %36
store double %31, double* %37
%38 = load double*, double** %5
%39 = load i32, i32* %7
%40 = mul nsw i32 2, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %38, i64 %41
%43 = load double, double* %42
%44 = fsub double %43, 1.000000e+00
%45 = load double*, double** %4
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
store double %44, double* %48
%49 = load double*, double** %5
%50 = load i32, i32* %7
%51 = mul nsw i32 2, %50
%52 = add nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %49, i64 %53
%55 = load double, double* %54
%56 = fadd double %55, 2.000000e+00
%57 = load double*, double** %6
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %57, i64 %59
store double %56, double* %60
br label %61
61: ; preds = %11
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %8
64: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @foo(double* nocapture writeonly %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = getelementptr double, double* %1, i64 2048
%5 = getelementptr double, double* %0, i64 1024
%6 = getelementptr double, double* %2, i64 1024
%7 = icmp ugt double* %5, %1
%8 = icmp ugt double* %4, %0
%9 = and i1 %7, %8
%10 = icmp ugt double* %6, %1
%11 = icmp ugt double* %4, %2
%12 = and i1 %10, %11
%13 = or i1 %9, %12
%14 = icmp ugt double* %6, %0
%15 = icmp ugt double* %5, %2
%16 = and i1 %14, %15
%17 = or i1 %13, %16
br i1 %17, label %44, label %18
18: ; preds = %3, %18
%19 = phi i64 [ %42, %18 ], [ 0, %3 ]
%20 = shl nuw nsw i64 %19, 1
%21 = getelementptr inbounds double, double* %1, i64 %20
%22 = bitcast double* %21 to <4 x double>*
%23 = load <4 x double>, <4 x double>* %22
%24 = shufflevector <4 x double> %23, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%25 = shufflevector <4 x double> %23, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%26 = fmul <2 x double> %24, <double 2.000000e+00, double 2.000000e+00>
%27 = or i64 %20, 1
%28 = getelementptr inbounds double, double* %1, i64 %27
%29 = fmul <2 x double> %25, <double 4.000000e+00, double 4.000000e+00>
%30 = getelementptr inbounds double, double* %28, i64 -1
%31 = bitcast double* %30 to <4 x double>*
%32 = shufflevector <2 x double> %26, <2 x double> %29, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %32, <4 x double>* %31
%33 = fadd <2 x double> %26, <double -1.000000e+00, double -1.000000e+00>
%34 = getelementptr inbounds double, double* %0, i64 %19
%35 = bitcast double* %34 to <2 x double>*
store <2 x double> %33, <2 x double>* %35
%36 = bitcast double* %28 to <4 x double>*
%37 = load <4 x double>, <4 x double>* %36
%38 = shufflevector <4 x double> %37, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%39 = fadd <2 x double> %38, <double 2.000000e+00, double 2.000000e+00>
%40 = getelementptr inbounds double, double* %2, i64 %19
%41 = bitcast double* %40 to <2 x double>*
store <2 x double> %39, <2 x double>* %41
%42 = add nuw i64 %19, 2
%43 = icmp eq i64 %42, 1022
br i1 %43, label %44, label %18
44: ; preds = %18, %3
%45 = phi i64 [ 0, %3 ], [ 1022, %18 ]
br label %46
46: ; preds = %46, %44
%47 = phi i64 [ %45, %44 ], [ %77, %46 ]
%48 = shl nuw nsw i64 %47, 1
%49 = getelementptr inbounds double, double* %1, i64 %48
%50 = or i64 %48, 1
%51 = getelementptr inbounds double, double* %1, i64 %50
%52 = bitcast double* %49 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = fmul <2 x double> %53, <double 2.000000e+00, double 4.000000e+00>
%55 = bitcast double* %49 to <2 x double>*
store <2 x double> %54, <2 x double>* %55
%56 = extractelement <2 x double> %54, i64 0
%57 = fadd double %56, -1.000000e+00
%58 = getelementptr inbounds double, double* %0, i64 %47
store double %57, double* %58
%59 = load double, double* %51
%60 = fadd double %59, 2.000000e+00
%61 = getelementptr inbounds double, double* %2, i64 %47
store double %60, double* %61
%62 = or i64 %47, 1
%63 = shl nuw nsw i64 %62, 1
%64 = getelementptr inbounds double, double* %1, i64 %63
%65 = or i64 %63, 1
%66 = getelementptr inbounds double, double* %1, i64 %65
%67 = bitcast double* %64 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = fmul <2 x double> %68, <double 2.000000e+00, double 4.000000e+00>
%70 = bitcast double* %64 to <2 x double>*
store <2 x double> %69, <2 x double>* %70
%71 = extractelement <2 x double> %69, i64 0
%72 = fadd double %71, -1.000000e+00
%73 = getelementptr inbounds double, double* %0, i64 %62
store double %72, double* %73
%74 = load double, double* %66
%75 = fadd double %74, 2.000000e+00
%76 = getelementptr inbounds double, double* %2, i64 %62
store double %75, double* %76
%77 = add nuw nsw i64 %47, 2
%78 = icmp eq i64 %77, 1024
br i1 %78, label %79, label %46
79: ; preds = %46
ret void
}