double func1(double *x, int N) {
  double f;
  double pi, alpha, alpha2;
  pi = 3.14159;
  alpha = 1;
  alpha2 = alpha * alpha;
  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):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  0xf0d(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xef8(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xecc(%rip),%xmm0
subsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  0xeb8(%rip),%xmm0
subsd  %xmm0,%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe9b(%rip),%xmm3
subsd  %xmm3,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
movsd  0xe86(%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  0xe51(%rip),%xmm2
addsd  %xmm2,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe30(%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):
<func1>:
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 @func1(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %3
store i32 %1, i32* %4
store double 3.141590e+00, double* %6
store double 1.000000e+00, double* %7
%9 = load double, double* %7
%10 = load double, double* %7
%11 = fmul double %9, %10
store double %11, double* %8
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fsub double %14, 1.000000e+06
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = fsub double %18, 1.000000e+06
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fsub double %22, 2.000000e-06
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fsub double %26, 2.000000e-06
%28 = fmul double %23, %27
%29 = call double @llvm.fmuladd.f64(double %15, double %19, double %28)
%30 = load double*, double** %3
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = load double*, double** %3
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = call double @llvm.fmuladd.f64(double %32, double %35, double -2.000000e+00)
%37 = load double*, double** %3
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = load double*, double** %3
%41 = getelementptr inbounds double, double* %40, i64 1
%42 = load double, double* %41
%43 = call double @llvm.fmuladd.f64(double %39, double %42, double -2.000000e+00)
%44 = call double @llvm.fmuladd.f64(double %36, double %43, double %29)
store double %44, double* %5
%45 = load double, double* %5
ret double %45
}

LLVM IR (-O2):
define double @func1(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
}