void test1(double *out1, double *out2, double *out3, double *in1, double *in2,
           int len) {
  int i;
  double *__restrict o1 = __builtin_assume_aligned(out1, 16);
  double *__restrict o2 = __builtin_assume_aligned(out2, 16);
  double *__restrict o3 = __builtin_assume_aligned(out3, 16);
  double *__restrict i1 = __builtin_assume_aligned(in1, 16);
  double *__restrict i2 = __builtin_assume_aligned(in2, 16);
  for (i = 0; i < len; ++i) {
    o1[i] = i1[i] * i2[i];
    o2[i] = i1[i] + i2[i];
    o3[i] = i1[i] - i2[i];
  }
}


x86 assembly (clang, -O0):
<test1>:
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)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    11da <test1+0xda>
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x30(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    114b <test1+0x4b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %r9d,%r9d
jle    1149 <test1+0x49>
mov    %r9d,%r9d
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rax,8),%xmm0
mulsd  (%r8,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
movsd  (%rcx,%rax,8),%xmm0
addsd  (%r8,%rax,8),%xmm0
movsd  %xmm0,(%rsi,%rax,8)
movsd  (%rcx,%rax,8),%xmm0
subsd  (%r8,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r9
jne    1110 <test1+0x10>
ret

LLVM IR (-O0):
define void @test1(double* %0, double* %1, double* %2, double* %3, double* %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store i32 %5, i32* %12
%19 = load double*, double** %7
%20 = bitcast double* %19 to i8*
%21 = bitcast i8* %20 to double*
store double* %21, double** %14
%22 = load double*, double** %8
%23 = bitcast double* %22 to i8*
%24 = bitcast i8* %23 to double*
store double* %24, double** %15
%25 = load double*, double** %9
%26 = bitcast double* %25 to i8*
%27 = bitcast i8* %26 to double*
store double* %27, double** %16
%28 = load double*, double** %10
%29 = bitcast double* %28 to i8*
%30 = bitcast i8* %29 to double*
store double* %30, double** %17
%31 = load double*, double** %11
%32 = bitcast double* %31 to i8*
%33 = bitcast i8* %32 to double*
store double* %33, double** %18
store i32 0, i32* %13
br label %34
34: ; preds = %84, %6
%35 = load i32, i32* %13
%36 = load i32, i32* %12
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %87
38: ; preds = %34
%39 = load double*, double** %17
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %39, i64 %41
%43 = load double, double* %42
%44 = load double*, double** %18
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = fmul double %43, %48
%50 = load double*, double** %14
%51 = load i32, i32* %13
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %50, i64 %52
store double %49, double* %53
%54 = load double*, double** %17
%55 = load i32, i32* %13
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = load double*, double** %18
%60 = load i32, i32* %13
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %59, i64 %61
%63 = load double, double* %62
%64 = fadd double %58, %63
%65 = load double*, double** %15
%66 = load i32, i32* %13
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
store double %64, double* %68
%69 = load double*, double** %17
%70 = load i32, i32* %13
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
%73 = load double, double* %72
%74 = load double*, double** %18
%75 = load i32, i32* %13
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
%78 = load double, double* %77
%79 = fsub double %73, %78
%80 = load double*, double** %16
%81 = load i32, i32* %13
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
store double %79, double* %83
br label %84
84: ; preds = %38
%85 = load i32, i32* %13
%86 = add nsw i32 %85, 1
store i32 %86, i32* %13
br label %34
87: ; preds = %34
ret void
}

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