void projective_map(double y[2], double A[9], double x[2]) {
  y[0] = A[0] * x[0] + A[1] * x[1] + A[2];
  y[1] = A[3] * x[0] + A[4] * x[1] + A[5];
  double y2 = A[6] * x[0] + A[7] * x[1] + A[8];
  y[0] /= y2;
  y[1] /= y2;
}


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

x86 assembly (clang, -O2):
<projective_map>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
mulsd  0x8(%rdx),%xmm1
mulsd  (%rdx),%xmm0
addsd  %xmm1,%xmm0
addsd  0x10(%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x18(%rsi),%xmm1
movsd  0x20(%rsi),%xmm2
mulsd  0x8(%rdx),%xmm2
mulsd  (%rdx),%xmm1
addsd  %xmm2,%xmm1
addsd  0x28(%rsi),%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x30(%rsi),%xmm2
movsd  0x38(%rsi),%xmm3
mulsd  0x8(%rdx),%xmm3
mulsd  (%rdx),%xmm2
addsd  %xmm3,%xmm2
addsd  0x40(%rsi),%xmm2
unpcklpd %xmm1,%xmm0
unpcklpd %xmm2,%xmm2
divpd  %xmm2,%xmm0
movupd %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @projective_map(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %6
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fmul double %16, %19
%21 = call double @llvm.fmuladd.f64(double %10, double %13, double %20)
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fadd double %21, %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 0
store double %25, double* %27
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 3
%30 = load double, double* %29
%31 = load double*, double** %6
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 4
%36 = load double, double* %35
%37 = load double*, double** %6
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = fmul double %36, %39
%41 = call double @llvm.fmuladd.f64(double %30, double %33, double %40)
%42 = load double*, double** %5
%43 = getelementptr inbounds double, double* %42, i64 5
%44 = load double, double* %43
%45 = fadd double %41, %44
%46 = load double*, double** %4
%47 = getelementptr inbounds double, double* %46, i64 1
store double %45, double* %47
%48 = load double*, double** %5
%49 = getelementptr inbounds double, double* %48, i64 6
%50 = load double, double* %49
%51 = load double*, double** %6
%52 = getelementptr inbounds double, double* %51, i64 0
%53 = load double, double* %52
%54 = load double*, double** %5
%55 = getelementptr inbounds double, double* %54, i64 7
%56 = load double, double* %55
%57 = load double*, double** %6
%58 = getelementptr inbounds double, double* %57, i64 1
%59 = load double, double* %58
%60 = fmul double %56, %59
%61 = call double @llvm.fmuladd.f64(double %50, double %53, double %60)
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 8
%64 = load double, double* %63
%65 = fadd double %61, %64
store double %65, double* %7
%66 = load double, double* %7
%67 = load double*, double** %4
%68 = getelementptr inbounds double, double* %67, i64 0
%69 = load double, double* %68
%70 = fdiv double %69, %66
store double %70, double* %68
%71 = load double, double* %7
%72 = load double*, double** %4
%73 = getelementptr inbounds double, double* %72, i64 1
%74 = load double, double* %73
%75 = fdiv double %74, %71
store double %75, double* %73
ret void
}

LLVM IR (-O2):
define void @projective_map(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %2, i64 1
%9 = load double, double* %8
%10 = fmul double %7, %9
%11 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %10)
%12 = getelementptr inbounds double, double* %1, i64 2
%13 = load double, double* %12
%14 = fadd double %13, %11
store double %14, double* %0
%15 = getelementptr inbounds double, double* %1, i64 3
%16 = load double, double* %15
%17 = load double, double* %2
%18 = getelementptr inbounds double, double* %1, i64 4
%19 = load double, double* %18
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = tail call double @llvm.fmuladd.f64(double %16, double %17, double %21)
%23 = getelementptr inbounds double, double* %1, i64 5
%24 = load double, double* %23
%25 = fadd double %24, %22
%26 = getelementptr inbounds double, double* %0, i64 1
store double %25, double* %26
%27 = getelementptr inbounds double, double* %1, i64 6
%28 = load double, double* %27
%29 = load double, double* %2
%30 = getelementptr inbounds double, double* %1, i64 7
%31 = load double, double* %30
%32 = load double, double* %8
%33 = fmul double %31, %32
%34 = tail call double @llvm.fmuladd.f64(double %28, double %29, double %33)
%35 = getelementptr inbounds double, double* %1, i64 8
%36 = load double, double* %35
%37 = fadd double %36, %34
%38 = insertelement <2 x double> poison, double %14, i64 0
%39 = insertelement <2 x double> %38, double %25, i64 1
%40 = insertelement <2 x double> poison, double %37, i64 0
%41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> zeroinitializer
%42 = fdiv <2 x double> %39, %41
%43 = bitcast double* %0 to <2 x double>*
store <2 x double> %42, <2 x double>* %43
ret void
}