#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void __attribute__((no, noclone))
f2(uint8_t *__restrict a, uint8_t *__restrict b, uint8_t *__restrict c) {
  for (int i = 0; i < 1024; ++i) {
    a[i] = c[i * 2];
    b[i] = c[i * 2 + 1];
  }
}


x86 assembly (clang, -O0):
<f2>:
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    116b <f2+0x6b>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <f2+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movups (%rdx,%rax,8),%xmm0
movups 0x10(%rdx,%rax,8),%xmm1
movups 0x20(%rdx,%rax,8),%xmm2
movups 0x30(%rdx,%rax,8),%xmm3
movaps %xmm0,%xmm4
shufps $0x88,%xmm1,%xmm4
movaps %xmm2,%xmm5
shufps $0x88,%xmm3,%xmm5
shufps $0xdd,%xmm1,%xmm0
shufps $0xdd,%xmm3,%xmm2
movups %xmm4,(%rdi,%rax,4)
movups %xmm5,0x10(%rdi,%rax,4)
movups %xmm0,(%rsi,%rax,4)
movups %xmm2,0x10(%rsi,%rax,4)
add    $0x8,%rax
cmp    $0x400,%rax
jne    1110 <f2+0x10>
ret

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

LLVM IR (-O2):
define void @f2(i32* noalias nocapture writeonly %0, i32* noalias nocapture writeonly %1, i32* noalias nocapture %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ 0, %3 ], [ %27, %4 ]
%6 = shl nuw nsw i64 %5, 1
%7 = shl i64 %5, 1
%8 = or i64 %7, 8
%9 = getelementptr inbounds i32, i32* %2, i64 %6
%10 = getelementptr inbounds i32, i32* %2, i64 %8
%11 = bitcast i32* %9 to <8 x i32>*
%12 = bitcast i32* %10 to <8 x i32>*
%13 = load <8 x i32>, <8 x i32>* %11
%14 = load <8 x i32>, <8 x i32>* %12
%15 = shufflevector <8 x i32> %13, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%16 = shufflevector <8 x i32> %14, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%17 = shufflevector <8 x i32> %13, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%18 = shufflevector <8 x i32> %14, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%19 = getelementptr inbounds i32, i32* %0, i64 %5
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> %15, <4 x i32>* %20
%21 = getelementptr inbounds i32, i32* %19, i64 4
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> %16, <4 x i32>* %22
%23 = getelementptr inbounds i32, i32* %1, i64 %5
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> %17, <4 x i32>* %24
%25 = getelementptr inbounds i32, i32* %23, i64 4
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> %18, <4 x i32>* %26
%27 = add nuw i64 %5, 8
%28 = icmp eq i64 %27, 1024
br i1 %28, label %29, label %4
29: ; preds = %4
ret void
}