void f3(double *p, double *q) {
  p = (double *)__builtin_assume_aligned(p, sizeof(double) * 2);
  q = (double *)__builtin_assume_aligned(q, sizeof(double) * 2);
  for (unsigned int i = 0; i < ~0U - 3; i += 4) {
    double a = q[i + 2] + p[i + 2];
    double b = q[i + 3] + p[i + 3];
    q[i + 2] = a;
    q[i + 3] = b;
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xfffffffc,-0x14(%rbp)
jae    11b5 <f3+0xb5>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x3,%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x3,%ecx
mov    %ecx,%ecx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x3,%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <f3+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
xor    %eax,%eax
movabs $0x7ffffffe0,%rcx
nopl   0x0(%rax)
movapd 0x10(%rsi,%rax,1),%xmm0
movapd 0x30(%rsi,%rax,1),%xmm1
addpd  0x10(%rdi,%rax,1),%xmm0
movapd 0x50(%rsi,%rax,1),%xmm2
movapd %xmm0,0x10(%rsi,%rax,1)
addpd  0x30(%rdi,%rax,1),%xmm1
movapd %xmm1,0x30(%rsi,%rax,1)
addpd  0x50(%rdi,%rax,1),%xmm2
movapd %xmm2,0x50(%rsi,%rax,1)
add    $0x60,%rax
cmp    %rcx,%rax
jne    1110 <f3+0x10>
ret

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

LLVM IR (-O2):
define void @f3(double* %0, double* %1) {
%3 = bitcast double* %0 to i8*
%4 = bitcast double* %1 to i8*
br label %6
5: ; preds = %6
ret void
6: ; preds = %6, %2
%7 = phi i64 [ 0, %2 ], [ %37, %6 ]
%8 = or i64 %7, 2
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = getelementptr inbounds double, double* %0, i64 %8
%11 = bitcast double* %9 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = bitcast double* %10 to <2 x double>*
%14 = load <2 x double>, <2 x double>* %13
%15 = fadd <2 x double> %12, %14
%16 = bitcast double* %9 to <2 x double>*
store <2 x double> %15, <2 x double>* %16
%17 = add nuw nsw i64 %7, 4
%18 = or i64 %17, 2
%19 = getelementptr inbounds double, double* %1, i64 %18
%20 = getelementptr inbounds double, double* %0, i64 %18
%21 = bitcast double* %19 to <2 x double>*
%22 = load <2 x double>, <2 x double>* %21
%23 = bitcast double* %20 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = fadd <2 x double> %22, %24
%26 = bitcast double* %19 to <2 x double>*
store <2 x double> %25, <2 x double>* %26
%27 = add nuw nsw i64 %7, 8
%28 = or i64 %27, 2
%29 = getelementptr inbounds double, double* %1, i64 %28
%30 = getelementptr inbounds double, double* %0, i64 %28
%31 = bitcast double* %29 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = bitcast double* %30 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = fadd <2 x double> %32, %34
%36 = bitcast double* %29 to <2 x double>*
store <2 x double> %35, <2 x double>* %36
%37 = add nuw nsw i64 %7, 12
%38 = icmp eq i64 %37, 4294967292
br i1 %38, label %5, label %6
}