void __attribute__((no, noclone))
sf_g4(float *__restrict a, float *__restrict b, float *__restrict c,
      float *__restrict d, float *__restrict e) {
  for (int i = 0; i < 1024; ++i) {
    e[i * 4] = a[i];
    e[i * 4 + 1] = b[i];
    e[i * 4 + 2] = c[i];
    e[i * 4 + 3] = d[i];
  }
}


x86 assembly (clang, -O0):
<sf_g4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x400,-0x2c(%rbp)
jge    11bf <sf_g4+0xbf>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    111f <sf_g4+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_g4>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups (%rdi,%rax,1),%xmm0
movups (%rsi,%rax,1),%xmm1
movups (%rdx,%rax,1),%xmm2
movups (%rcx,%rax,1),%xmm3
movaps %xmm3,%xmm4
movlhps %xmm2,%xmm4
movaps %xmm0,%xmm5
unpcklps %xmm1,%xmm5
shufps $0x24,%xmm4,%xmm5
movaps %xmm2,%xmm4
unpcklps %xmm3,%xmm4
movaps %xmm1,%xmm6
shufps $0x11,%xmm0,%xmm6
shufps $0xe2,%xmm4,%xmm6
movaps %xmm3,%xmm4
unpckhpd %xmm2,%xmm4
movaps %xmm0,%xmm7
unpckhps %xmm1,%xmm7
shufps $0x24,%xmm4,%xmm7
unpckhps %xmm3,%xmm2
shufps $0x33,%xmm0,%xmm1
shufps $0xe2,%xmm2,%xmm1
movups %xmm1,0x30(%r8,%rax,4)
movups %xmm7,0x20(%r8,%rax,4)
movups %xmm6,0x10(%r8,%rax,4)
movups %xmm5,(%r8,%rax,4)
movups 0x10(%rdi,%rax,1),%xmm0
movups 0x10(%rsi,%rax,1),%xmm1
movups 0x10(%rdx,%rax,1),%xmm2
movups 0x10(%rcx,%rax,1),%xmm3
movaps %xmm3,%xmm4
movlhps %xmm2,%xmm4
movaps %xmm0,%xmm5
unpcklps %xmm1,%xmm5
shufps $0x24,%xmm4,%xmm5
movaps %xmm2,%xmm4
unpcklps %xmm3,%xmm4
movaps %xmm1,%xmm6
shufps $0x11,%xmm0,%xmm6
shufps $0xe2,%xmm4,%xmm6
movaps %xmm3,%xmm4
unpckhpd %xmm2,%xmm4
movaps %xmm0,%xmm7
unpckhps %xmm1,%xmm7
shufps $0x24,%xmm4,%xmm7
unpckhps %xmm3,%xmm2
shufps $0x33,%xmm0,%xmm1
shufps $0xe2,%xmm2,%xmm1
movups %xmm1,0x70(%r8,%rax,4)
movups %xmm7,0x60(%r8,%rax,4)
movups %xmm6,0x50(%r8,%rax,4)
movups %xmm5,0x40(%r8,%rax,4)
add    $0x20,%rax
cmp    $0x1000,%rax
jne    1110 <sf_g4+0x10>
ret

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

LLVM IR (-O2):
define void @sf_g4(float* noalias nocapture %0, float* noalias nocapture %1, float* noalias nocapture %2, float* noalias nocapture %3, float* noalias nocapture writeonly %4) {
%6 = getelementptr inbounds float, float* %4, i64 -3
%7 = getelementptr inbounds float, float* %4, i64 -3
br label %8
8: ; preds = %8, %5
%9 = phi i64 [ 0, %5 ], [ %49, %8 ]
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = bitcast float* %10 to <4 x float>*
%12 = load <4 x float>, <4 x float>* %11
%13 = shl nuw nsw i64 %9, 2
%14 = getelementptr inbounds float, float* %1, i64 %9
%15 = bitcast float* %14 to <4 x float>*
%16 = load <4 x float>, <4 x float>* %15
%17 = getelementptr inbounds float, float* %2, i64 %9
%18 = bitcast float* %17 to <4 x float>*
%19 = load <4 x float>, <4 x float>* %18
%20 = getelementptr inbounds float, float* %3, i64 %9
%21 = bitcast float* %20 to <4 x float>*
%22 = load <4 x float>, <4 x float>* %21
%23 = or i64 %13, 3
%24 = getelementptr inbounds float, float* %6, i64 %23
%25 = bitcast float* %24 to <16 x float>*
%26 = shufflevector <4 x float> %12, <4 x float> %16, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%27 = shufflevector <4 x float> %19, <4 x float> %22, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%28 = shufflevector <8 x float> %26, <8 x float> %27, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
store <16 x float> %28, <16 x float>* %25
%29 = or i64 %9, 4
%30 = getelementptr inbounds float, float* %0, i64 %29
%31 = bitcast float* %30 to <4 x float>*
%32 = load <4 x float>, <4 x float>* %31
%33 = shl nuw nsw i64 %29, 2
%34 = getelementptr inbounds float, float* %1, i64 %29
%35 = bitcast float* %34 to <4 x float>*
%36 = load <4 x float>, <4 x float>* %35
%37 = getelementptr inbounds float, float* %2, i64 %29
%38 = bitcast float* %37 to <4 x float>*
%39 = load <4 x float>, <4 x float>* %38
%40 = getelementptr inbounds float, float* %3, i64 %29
%41 = bitcast float* %40 to <4 x float>*
%42 = load <4 x float>, <4 x float>* %41
%43 = or i64 %33, 3
%44 = getelementptr inbounds float, float* %7, i64 %43
%45 = bitcast float* %44 to <16 x float>*
%46 = shufflevector <4 x float> %32, <4 x float> %36, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%47 = shufflevector <4 x float> %39, <4 x float> %42, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%48 = shufflevector <8 x float> %46, <8 x float> %47, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
store <16 x float> %48, <16 x float>* %45
%49 = add nuw nsw i64 %9, 8
%50 = icmp eq i64 %49, 1024
br i1 %50, label %51, label %8
51: ; preds = %8
ret void
}