double fun(int n, const double *x) {
  return 1.0e2 * ((x[1] - ((x[0]) * (x[0]))) * (x[1] - ((x[0]) * (x[0])))) +
         ((x[0] - 1.0) * (x[0] - 1.0));
}


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

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

LLVM IR (-O0):
define double @fun(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 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fneg double %21
%26 = call double @llvm.fmuladd.f64(double %25, double %24, double %18)
%27 = fmul double %15, %26
%28 = load double*, double** %4
%29 = getelementptr inbounds double, double* %28, i64 0
%30 = load double, double* %29
%31 = fsub double %30, 1.000000e+00
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = fsub double %34, 1.000000e+00
%36 = fmul double %31, %35
%37 = call double @llvm.fmuladd.f64(double 1.000000e+02, double %27, double %36)
ret double %37
}

LLVM IR (-O2):
define double @fun(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, %7
%9 = fadd double %5, -1.000000e+00
%10 = fmul double %9, %9
%11 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e+02, double %10)
ret double %11
}