void foo(double *output) {
  int i = 0;
  for (i = 0; i < 32; i++)
    output[i] = 4.25;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1143 <foo+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <foo+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xf0(%rdi)
ret

LLVM IR (-O0):
define void @foo(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load double*, double** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %8, i64 %10
store double 4.250000e+00, double* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @foo(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %0, i64 4
%6 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %6
%7 = getelementptr inbounds double, double* %0, i64 6
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 8
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %10
%11 = getelementptr inbounds double, double* %0, i64 10
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %12
%13 = getelementptr inbounds double, double* %0, i64 12
%14 = bitcast double* %13 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %14
%15 = getelementptr inbounds double, double* %0, i64 14
%16 = bitcast double* %15 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %16
%17 = getelementptr inbounds double, double* %0, i64 16
%18 = bitcast double* %17 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %18
%19 = getelementptr inbounds double, double* %0, i64 18
%20 = bitcast double* %19 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %20
%21 = getelementptr inbounds double, double* %0, i64 20
%22 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %22
%23 = getelementptr inbounds double, double* %0, i64 22
%24 = bitcast double* %23 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %24
%25 = getelementptr inbounds double, double* %0, i64 24
%26 = bitcast double* %25 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %26
%27 = getelementptr inbounds double, double* %0, i64 26
%28 = bitcast double* %27 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %28
%29 = getelementptr inbounds double, double* %0, i64 28
%30 = bitcast double* %29 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %30
%31 = getelementptr inbounds double, double* %0, i64 30
%32 = bitcast double* %31 to <2 x double>*
store <2 x double> <double 4.250000e+00, double 4.250000e+00>, <2 x double>* %32
ret void
}