void PLANESEG(double *plane, double *a, double *b, double *p) {
  double l[3], s;
  l[0] = b[0] - a[0];
  l[1] = b[1] - a[1];
  l[2] = b[2] - a[2];
  s = (((plane)[0] * (a)[0] + (plane)[1] * (a)[1] + (plane)[2] * (a)[2]) +
       (plane)[3]) /
      ((plane)[0] * (l)[0] + (plane)[1] * (l)[1] + (plane)[2] * (l)[2]);
  p[0] = a[0] - l[0] * s;
  p[1] = a[1] - l[1] * s;
  p[2] = a[2] - l[2] * s;
}


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

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

LLVM IR (-O0):
define void @PLANESEG(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca [3 x double]
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fsub double %13, %16
%18 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
store double %17, double* %18
%19 = load double*, double** %7
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = fsub double %21, %24
%26 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
store double %25, double* %26
%27 = load double*, double** %7
%28 = getelementptr inbounds double, double* %27, i64 2
%29 = load double, double* %28
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 2
%32 = load double, double* %31
%33 = fsub double %29, %32
%34 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
store double %33, double* %34
%35 = load double*, double** %5
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = load double, double* %39
%41 = load double*, double** %5
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = fmul double %43, %46
%48 = call double @llvm.fmuladd.f64(double %37, double %40, double %47)
%49 = load double*, double** %5
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = load double*, double** %6
%53 = getelementptr inbounds double, double* %52, i64 2
%54 = load double, double* %53
%55 = call double @llvm.fmuladd.f64(double %51, double %54, double %48)
%56 = load double*, double** %5
%57 = getelementptr inbounds double, double* %56, i64 3
%58 = load double, double* %57
%59 = fadd double %55, %58
%60 = load double*, double** %5
%61 = getelementptr inbounds double, double* %60, i64 0
%62 = load double, double* %61
%63 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%64 = load double, double* %63
%65 = load double*, double** %5
%66 = getelementptr inbounds double, double* %65, i64 1
%67 = load double, double* %66
%68 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%69 = load double, double* %68
%70 = fmul double %67, %69
%71 = call double @llvm.fmuladd.f64(double %62, double %64, double %70)
%72 = load double*, double** %5
%73 = getelementptr inbounds double, double* %72, i64 2
%74 = load double, double* %73
%75 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%76 = load double, double* %75
%77 = call double @llvm.fmuladd.f64(double %74, double %76, double %71)
%78 = fdiv double %59, %77
store double %78, double* %10
%79 = load double*, double** %6
%80 = getelementptr inbounds double, double* %79, i64 0
%81 = load double, double* %80
%82 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%83 = load double, double* %82
%84 = load double, double* %10
%85 = fneg double %83
%86 = call double @llvm.fmuladd.f64(double %85, double %84, double %81)
%87 = load double*, double** %8
%88 = getelementptr inbounds double, double* %87, i64 0
store double %86, double* %88
%89 = load double*, double** %6
%90 = getelementptr inbounds double, double* %89, i64 1
%91 = load double, double* %90
%92 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%93 = load double, double* %92
%94 = load double, double* %10
%95 = fneg double %93
%96 = call double @llvm.fmuladd.f64(double %95, double %94, double %91)
%97 = load double*, double** %8
%98 = getelementptr inbounds double, double* %97, i64 1
store double %96, double* %98
%99 = load double*, double** %6
%100 = getelementptr inbounds double, double* %99, i64 2
%101 = load double, double* %100
%102 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%103 = load double, double* %102
%104 = load double, double* %10
%105 = fneg double %103
%106 = call double @llvm.fmuladd.f64(double %105, double %104, double %101)
%107 = load double*, double** %8
%108 = getelementptr inbounds double, double* %107, i64 2
store double %106, double* %108
ret void
}

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