void foo(float *x) {
  int i, j, k;
  float temp;
  static float t16[16] = {1., 2.,  3.,  4.,  5.,  6.,  7.,  8.,
                          9., 10., 11., 12., 13., 14., 15., 16.};
  static float tmp[4] = {0., 0., 0., 0.};
  for (i = 0; i < 4; i++) {
    k = 3 - i;
    temp = t16[5 * k];
    for (j = k + 1; j < 4; j++) {
      tmp[k] = t16[k + j * 4] * temp;
    }
  }
  x[0] = tmp[0];
  x[1] = tmp[1];
  x[2] = tmp[2];
  x[3] = tmp[3];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    119f <foo+0x9f>
mov    $0x3,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x5,-0x14(%rbp),%eax
movslq %eax,%rcx
lea    0x2efe(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    118c <foo+0x8c>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
movslq %eax,%rcx
lea    0x2ecc(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
mulss  -0x18(%rbp),%xmm0
movslq -0x14(%rbp),%rcx
lea    0x2f07(%rip),%rax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <foo+0x45>
jmp    1191 <foo+0x91>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <foo+0xf>
movss  0x2ed9(%rip),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  0x2ecd(%rip),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  0x2ec0(%rip),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  0x2eb3(%rip),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
@foo.t16 = internal global [16 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 9.000000e+00, float 1.000000e+01, float 1.100000e+01, float 1.200000e+01, float 1.300000e+01, float 1.400000e+01, float 1.500000e+01, float 1.600000e+01]
@foo.tmp = internal global [4 x float] zeroinitializer
define void @foo(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store float* %0, float** %2
store i32 0, i32* %3
br label %7
7: ; preds = %40, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %43
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sub nsw i32 3, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = mul nsw i32 5, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x float], [16 x float]* @foo.t16, i64 0, i64 %15
%17 = load float, float* %16
store float %17, float* %6
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %20
20: ; preds = %36, %10
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 4
br i1 %22, label %23, label %39
23: ; preds = %20
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = mul nsw i32 %25, 4
%27 = add nsw i32 %24, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [16 x float], [16 x float]* @foo.t16, i64 0, i64 %28
%30 = load float, float* %29
%31 = load float, float* %6
%32 = fmul float %30, %31
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4 x float], [4 x float]* @foo.tmp, i64 0, i64 %34
store float %32, float* %35
br label %36
36: ; preds = %23
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %20
39: ; preds = %20
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %7
43: ; preds = %7
%44 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @foo.tmp, i64 0, i64 0)
%45 = load float*, float** %2
%46 = getelementptr inbounds float, float* %45, i64 0
store float %44, float* %46
%47 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @foo.tmp, i64 0, i64 1)
%48 = load float*, float** %2
%49 = getelementptr inbounds float, float* %48, i64 1
store float %47, float* %49
%50 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @foo.tmp, i64 0, i64 2)
%51 = load float*, float** %2
%52 = getelementptr inbounds float, float* %51, i64 2
store float %50, float* %52
%53 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @foo.tmp, i64 0, i64 3)
%54 = load float*, float** %2
%55 = getelementptr inbounds float, float* %54, i64 3
store float %53, float* %55
ret void
}

LLVM IR (-O2):
define void @foo(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 1.300000e+01, float 8.400000e+01, float 1.650000e+02, float 0.000000e+00>, <4 x float>* %2
ret void
}