#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 uint8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void f(uint64_t *restrict dst, uint32_t *restrict src1,
       uint8_t *restrict src2) {
  for (int i = 0; i < 7; ++i)
    dst[i] = (uint32_t)(src1[i] & src2[i]);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x7,-0x1c(%rbp)
jge    1150 <f+0x50>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
and    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <f+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
andps  %xmm0,%xmm1
movups %xmm1,(%rdi)
mov    0x10(%rdx),%eax
and    0x10(%rsi),%eax
mov    %eax,0x10(%rdi)
mov    0x14(%rdx),%eax
and    0x14(%rsi),%eax
mov    %eax,0x14(%rdi)
mov    0x18(%rdx),%eax
and    0x18(%rsi),%eax
mov    %eax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @f(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 = %27, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 7
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i32*, i32** %5
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = and i32 %16, %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
br label %27
27: ; preds = %11
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @f(i32* noalias nocapture writeonly %0, i32* noalias nocapture %1, i32* noalias nocapture %2) {
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = bitcast i32* %2 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = and <4 x i32> %7, %5
%9 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %9
%10 = getelementptr inbounds i32, i32* %1, i64 4
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %2, i64 4
%13 = load i32, i32* %12
%14 = and i32 %13, %11
%15 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %14, i32* %15
%16 = getelementptr inbounds i32, i32* %1, i64 5
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %2, i64 5
%19 = load i32, i32* %18
%20 = and i32 %19, %17
%21 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %20, i32* %21
%22 = getelementptr inbounds i32, i32* %1, i64 6
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %2, i64 6
%25 = load i32, i32* %24
%26 = and i32 %25, %23
%27 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %26, i32* %27
ret void
}