void __attribute__((noipa)) f(double x, double y, double *res) {
  y = -y;
  for (int i = 0; i < 9; ++i) {
    double tmp = y;
    y = x;
    x = tmp;
    res[i] = i;
  }
  res[9] = y * y;
  res[9 + 1] = x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jge    1182 <f+0x82>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <f+0x3a>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x48(%rax)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x50(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  0xef9(%rip),%xmm1
xorps  %xmm2,%xmm2
movhps 0xf2f(%rip),%xmm2
movups %xmm2,(%rdi)
movaps 0xef5(%rip),%xmm2
movups %xmm2,0x10(%rdi)
movaps 0xefa(%rip),%xmm2
movups %xmm2,0x20(%rdi)
movaps 0xeff(%rip),%xmm2
movups %xmm2,0x30(%rdi)
movabs $0x4020000000000000,%rax
mov    %rax,0x40(%rdi)
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x48(%rdi)
movlps %xmm1,0x50(%rdi)
ret

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

LLVM IR (-O2):
define void @f(double %0, double %1, double* nocapture writeonly %2) {
%4 = fneg double %1
%5 = bitcast double* %2 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %5
%6 = getelementptr inbounds double, double* %2, i64 2
%7 = bitcast double* %6 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 3.000000e+00>, <2 x double>* %7
%8 = getelementptr inbounds double, double* %2, i64 4
%9 = bitcast double* %8 to <2 x double>*
store <2 x double> <double 4.000000e+00, double 5.000000e+00>, <2 x double>* %9
%10 = getelementptr inbounds double, double* %2, i64 6
%11 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 6.000000e+00, double 7.000000e+00>, <2 x double>* %11
%12 = getelementptr inbounds double, double* %2, i64 8
store double 8.000000e+00, double* %12
%13 = fmul double %0, %0
%14 = getelementptr inbounds double, double* %2, i64 9
store double %13, double* %14
%15 = getelementptr inbounds double, double* %2, i64 10
store double %4, double* %15
ret void
}