double brown(double *x, int N) {
  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    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xef5(%rip),%xmm0
subsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  0xee1(%rip),%xmm0
subsd  %xmm0,%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xec4(%rip),%xmm3
subsd  %xmm3,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
movsd  0xeaf(%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  0xe7a(%rip),%xmm2
addsd  %xmm2,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe59(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%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) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fsub double %8, 1.000000e+06
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %12, 1.000000e+06
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fsub double %16, 2.000000e-06
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = fsub double %20, 2.000000e-06
%22 = fmul double %17, %21
%23 = call double @llvm.fmuladd.f64(double %9, double %13, double %22)
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = load double*, double** %3
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = call double @llvm.fmuladd.f64(double %26, double %29, double -2.000000e+00)
%31 = load double*, double** %3
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = load double*, double** %3
%35 = getelementptr inbounds double, double* %34, i64 1
%36 = load double, double* %35
%37 = call double @llvm.fmuladd.f64(double %33, double %36, double -2.000000e+00)
%38 = call double @llvm.fmuladd.f64(double %30, double %37, double %23)
store double %38, double* %5
%39 = load double, double* %5
ret double %39
}

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