void Unmap2f(double x, double y, const double *corners, double *u, double *v) {
  double xc0 = x - corners[0];
  double yc1 = y - corners[1];
  double c20 = corners[2] - corners[0];
  double c31 = corners[3] - corners[1];
  double c42 = corners[4] - corners[2];
  double c53 = corners[5] - corners[3];
  double det = c20 * c53 - c31 * c42;
  double du = xc0 * c53 - yc1 * c42;
  double dv = c20 * yc1 - c31 * xc0;
  *u = du / det;
  *v = dv / det;
}


x86 assembly (clang, -O0):
<Unmap2f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unmap2f>:
movsd  (%rdi),%xmm3
movsd  0x8(%rdi),%xmm4
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
movsd  0x10(%rdi),%xmm2
movsd  0x18(%rdi),%xmm5
movsd  0x20(%rdi),%xmm6
subsd  %xmm2,%xmm6
subsd  %xmm3,%xmm2
movsd  0x28(%rdi),%xmm3
subsd  %xmm5,%xmm3
subsd  %xmm4,%xmm5
movapd %xmm6,%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm2,%xmm7
mulsd  %xmm3,%xmm7
subsd  %xmm4,%xmm7
mulsd  %xmm1,%xmm6
mulsd  %xmm0,%xmm3
subsd  %xmm6,%xmm3
mulsd  %xmm0,%xmm5
mulsd  %xmm1,%xmm2
subsd  %xmm5,%xmm2
divsd  %xmm7,%xmm3
movsd  %xmm3,(%rsi)
divsd  %xmm7,%xmm2
movsd  %xmm2,(%rdx)
ret

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

LLVM IR (-O2):
define void @Unmap2f(double %0, double %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = load double, double* %2
%7 = fsub double %0, %6
%8 = getelementptr inbounds double, double* %2, i64 1
%9 = load double, double* %8
%10 = fsub double %1, %9
%11 = getelementptr inbounds double, double* %2, i64 2
%12 = load double, double* %11
%13 = fsub double %12, %6
%14 = getelementptr inbounds double, double* %2, i64 3
%15 = load double, double* %14
%16 = fsub double %15, %9
%17 = getelementptr inbounds double, double* %2, i64 4
%18 = load double, double* %17
%19 = fsub double %18, %12
%20 = getelementptr inbounds double, double* %2, i64 5
%21 = load double, double* %20
%22 = fsub double %21, %15
%23 = fneg double %16
%24 = fmul double %19, %23
%25 = tail call double @llvm.fmuladd.f64(double %13, double %22, double %24)
%26 = fneg double %10
%27 = fmul double %19, %26
%28 = tail call double @llvm.fmuladd.f64(double %7, double %22, double %27)
%29 = fmul double %7, %23
%30 = tail call double @llvm.fmuladd.f64(double %13, double %10, double %29)
%31 = fdiv double %28, %25
store double %31, double* %3
%32 = fdiv double %30, %25
store double %32, double* %4
ret void
}