double brown(double *x, int N, void *params) {
  double f;
  f = (x[0] - 1e06) * (x[0] - 1e06) + (x[1] - 2 * 1e-06) * (x[1] - 2 * 1e-06) +
      (x[0] * x[1] - 2) * (x[0] * x[1] - 2);
  return f;
}


x86 assembly (clang, -O0):
<brown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xef1(%rip),%xmm0
subsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  0xedd(%rip),%xmm0
subsd  %xmm0,%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xec0(%rip),%xmm3
subsd  %xmm3,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
movsd  0xeab(%rip),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe76(%rip),%xmm2
addsd  %xmm2,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe55(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<brown>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0xeef(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm0
addsd  0xee7(%rip),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
addsd  0xedb(%rip),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @brown(double* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = load double, double* %0
%5 = fadd double %4, -1.000000e+06
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fadd double %7, -2.000000e-06
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %9)
%11 = tail call double @llvm.fmuladd.f64(double %4, double %7, double -2.000000e+00)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %10)
ret double %12
}