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


x86 assembly (clang, -O0):
<g3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x400,-0x24(%rbp)
jge    1193 <g3+0x93>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x3,-0x24(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111b <g3+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g3>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups (%rdi,%rax,4),%xmm0
movups (%rsi,%rax,4),%xmm1
movups (%rdx,%rax,4),%xmm2
movaps %xmm2,%xmm3
shufps $0xd4,%xmm0,%xmm3
movaps %xmm1,%xmm4
movlhps %xmm0,%xmm4
shufps $0x82,%xmm3,%xmm4
movaps %xmm0,%xmm3
unpckhpd %xmm1,%xmm3
movaps %xmm2,%xmm5
shufps $0x11,%xmm1,%xmm5
shufps $0x82,%xmm3,%xmm5
shufps $0xff,%xmm2,%xmm1
shufps $0x23,%xmm2,%xmm0
shufps $0x82,%xmm1,%xmm0
movups %xmm0,0x20(%rcx)
movups %xmm5,0x10(%rcx)
movups %xmm4,(%rcx)
movups 0x10(%rdi,%rax,4),%xmm0
movups 0x10(%rsi,%rax,4),%xmm1
movups 0x10(%rdx,%rax,4),%xmm2
movaps %xmm2,%xmm3
shufps $0xd4,%xmm0,%xmm3
movaps %xmm1,%xmm4
movlhps %xmm0,%xmm4
shufps $0x82,%xmm3,%xmm4
movaps %xmm0,%xmm3
unpckhpd %xmm1,%xmm3
movaps %xmm2,%xmm5
shufps $0x11,%xmm1,%xmm5
shufps $0x82,%xmm3,%xmm5
shufps $0xff,%xmm2,%xmm1
shufps $0x23,%xmm2,%xmm0
shufps $0x82,%xmm1,%xmm0
movups %xmm0,0x50(%rcx)
movups %xmm5,0x40(%rcx)
movups %xmm4,0x30(%rcx)
add    $0x8,%rax
add    $0x60,%rcx
cmp    $0x400,%rax
jne    1110 <g3+0x10>
ret

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

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