void geom_CM2_cyl_rpz_B(double xm[], double xp[], double xc[], int dir) {
  xc[0] = 2.0 * (xm[0] * xm[0] + xm[0] * xp[0] + xp[0] * xp[0]) /
          (3.0 * (xm[0] + xp[0]));
  xc[1] = 0.5 * (xm[1] + xp[1]);
}


x86 assembly (clang, -O0):
<geom_CM2_cyl_rpz_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm2
movsd  0xe91(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm1
movsd  0xe5f(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_CM2_cyl_rpz_B>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
addsd  %xmm1,%xmm1
mulsd  0xecc(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
mulsd  0xeba(%rip),%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @geom_CM2_cyl_rpz_B(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fmul double %17, %20
%22 = call double @llvm.fmuladd.f64(double %11, double %14, double %21)
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = call double @llvm.fmuladd.f64(double %25, double %28, double %22)
%30 = fmul double 2.000000e+00, %29
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 0
%36 = load double, double* %35
%37 = fadd double %33, %36
%38 = fmul double 3.000000e+00, %37
%39 = fdiv double %30, %38
%40 = load double*, double** %7
%41 = getelementptr inbounds double, double* %40, i64 0
store double %39, double* %41
%42 = load double*, double** %5
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = load double*, double** %6
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = fadd double %44, %47
%49 = fmul double 5.000000e-01, %48
%50 = load double*, double** %7
%51 = getelementptr inbounds double, double* %50, i64 1
store double %49, double* %51
ret void
}

LLVM IR (-O2):
define void @geom_CM2_cyl_rpz_B(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2, i32 %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = fmul double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %8)
%10 = fmul double %9, 2.000000e+00
%11 = fadd double %5, %6
%12 = fmul double %11, 3.000000e+00
%13 = fdiv double %10, %12
store double %13, double* %2
%14 = getelementptr inbounds double, double* %0, i64 1
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %1, i64 1
%17 = load double, double* %16
%18 = fadd double %15, %17
%19 = fmul double %18, 5.000000e-01
%20 = getelementptr inbounds double, double* %2, i64 1
store double %19, double* %20
ret void
}