void affine_pt(const double aff[6], double x, double y, double *px,
               double *py) {
  *px = x * aff[0] + y * aff[2] + aff[4];
  *py = x * aff[1] + y * aff[3] + aff[5];
}


x86 assembly (clang, -O0):
<affine_pt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
addsd  0x20(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
movsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x18(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
addsd  0x28(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<affine_pt>:
movsd  0x10(%rdi),%xmm2
mulsd  %xmm1,%xmm2
movsd  (%rdi),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  0x20(%rdi),%xmm3
movsd  %xmm3,(%rsi)
mulsd  0x18(%rdi),%xmm1
mulsd  0x8(%rdi),%xmm0
addsd  %xmm1,%xmm0
addsd  0x28(%rdi),%xmm0
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @affine_pt(double* %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %7
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double, double* %8
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = fmul double %15, %18
%20 = call double @llvm.fmuladd.f64(double %11, double %14, double %19)
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 4
%23 = load double, double* %22
%24 = fadd double %20, %23
%25 = load double*, double** %9
store double %24, double* %25
%26 = load double, double* %7
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = load double, double* %8
%31 = load double*, double** %6
%32 = getelementptr inbounds double, double* %31, i64 3
%33 = load double, double* %32
%34 = fmul double %30, %33
%35 = call double @llvm.fmuladd.f64(double %26, double %29, double %34)
%36 = load double*, double** %6
%37 = getelementptr inbounds double, double* %36, i64 5
%38 = load double, double* %37
%39 = fadd double %35, %38
%40 = load double*, double** %10
store double %39, double* %40
ret void
}

LLVM IR (-O2):
define void @affine_pt(double* nocapture %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = load double, double* %0
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fmul double %8, %2
%10 = tail call double @llvm.fmuladd.f64(double %1, double %6, double %9)
%11 = getelementptr inbounds double, double* %0, i64 4
%12 = load double, double* %11
%13 = fadd double %12, %10
store double %13, double* %3
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %0, i64 3
%17 = load double, double* %16
%18 = fmul double %17, %2
%19 = tail call double @llvm.fmuladd.f64(double %1, double %15, double %18)
%20 = getelementptr inbounds double, double* %0, i64 5
%21 = load double, double* %20
%22 = fadd double %21, %19
store double %22, double* %4
ret void
}