double f_rosen(int D, double x[]) {
  return (100 * (x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0]) +
          (1.0 - x[0]) * (1.0 - x[0]));
}


x86 assembly (clang, -O0):
<f_rosen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x10(%rbp),%rax
movsd  0xe6d(%rip),%xmm1
subsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0xe5d(%rip),%xmm3
subsd  (%rax),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_rosen>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0xef7(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  0xedb(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @f_rosen(i32 %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
%5 = load double, double* %1
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %4)
%8 = fmul double %7, 1.000000e+02
%9 = fsub double 1.000000e+00, %5
%10 = fmul double %9, %9
%11 = tail call double @llvm.fmuladd.f64(double %8, double %7, double %10)
ret double %11
}