double func1(double *x, int N, void *params) {
  double f;
  f = 100 * (x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0]) +
      (1.0 - x[0]) * (1.0 - x[0]) +
      90 * (x[3] - x[2] * x[2]) * (x[3] - x[2] * x[2]) +
      (1.0 - x[2]) * (1.0 - x[2]) + 10 * (x[1] + x[3] - 2) * (x[1] + x[3] - 2) +
      0.1 * (x[1] - x[3]) * (x[1] - x[3]);
  return f;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0x8(%rbp),%rax
movsd  0xe81(%rip),%xmm1
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0xe71(%rip),%xmm3
subsd  (%rax),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  0xe27(%rip),%xmm1
mulsd  %xmm2,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm4
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0xdcd(%rip),%xmm0
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xdbc(%rip),%xmm2
subsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm2
movsd  0xd85(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xd81(%rip),%xmm1
mulsd  %xmm2,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm2
movsd  0xd5b(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm2
movsd  0xd2d(%rip),%xmm0
mulsd  %xmm2,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm1
movsd  0xef7(%rip),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm2
movapd %xmm1,%xmm4
subsd  %xmm2,%xmm4
movsd  0xed3(%rip),%xmm2
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movsd  0x18(%rdi),%xmm3
movsd  0x10(%rdi),%xmm4
subsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm4
movapd %xmm1,%xmm5
addsd  %xmm3,%xmm5
subsd  %xmm3,%xmm1
subsd  %xmm4,%xmm3
movsd  0xea9(%rip),%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm0,%xmm0
addsd  %xmm4,%xmm0
addsd  0xe95(%rip),%xmm5
movsd  0xe95(%rip),%xmm2
mulsd  %xmm5,%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm0,%xmm2
movsd  0xe89(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @func1(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 1
%10 = load double, double* %9
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = fneg double %13
%18 = call double @llvm.fmuladd.f64(double %17, double %16, double %10)
%19 = fmul double 1.000000e+02, %18
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = fneg double %25
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double %22)
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = fsub double 1.000000e+00, %33
%35 = load double*, double** %4
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = fsub double 1.000000e+00, %37
%39 = fmul double %34, %38
%40 = call double @llvm.fmuladd.f64(double %19, double %30, double %39)
%41 = load double*, double** %4
%42 = getelementptr inbounds double, double* %41, i64 3
%43 = load double, double* %42
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i64 2
%46 = load double, double* %45
%47 = load double*, double** %4
%48 = getelementptr inbounds double, double* %47, i64 2
%49 = load double, double* %48
%50 = fneg double %46
%51 = call double @llvm.fmuladd.f64(double %50, double %49, double %43)
%52 = fmul double 9.000000e+01, %51
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 3
%55 = load double, double* %54
%56 = load double*, double** %4
%57 = getelementptr inbounds double, double* %56, i64 2
%58 = load double, double* %57
%59 = load double*, double** %4
%60 = getelementptr inbounds double, double* %59, i64 2
%61 = load double, double* %60
%62 = fneg double %58
%63 = call double @llvm.fmuladd.f64(double %62, double %61, double %55)
%64 = call double @llvm.fmuladd.f64(double %52, double %63, double %40)
%65 = load double*, double** %4
%66 = getelementptr inbounds double, double* %65, i64 2
%67 = load double, double* %66
%68 = fsub double 1.000000e+00, %67
%69 = load double*, double** %4
%70 = getelementptr inbounds double, double* %69, i64 2
%71 = load double, double* %70
%72 = fsub double 1.000000e+00, %71
%73 = call double @llvm.fmuladd.f64(double %68, double %72, double %64)
%74 = load double*, double** %4
%75 = getelementptr inbounds double, double* %74, i64 1
%76 = load double, double* %75
%77 = load double*, double** %4
%78 = getelementptr inbounds double, double* %77, i64 3
%79 = load double, double* %78
%80 = fadd double %76, %79
%81 = fsub double %80, 2.000000e+00
%82 = fmul double 1.000000e+01, %81
%83 = load double*, double** %4
%84 = getelementptr inbounds double, double* %83, i64 1
%85 = load double, double* %84
%86 = load double*, double** %4
%87 = getelementptr inbounds double, double* %86, i64 3
%88 = load double, double* %87
%89 = fadd double %85, %88
%90 = fsub double %89, 2.000000e+00
%91 = call double @llvm.fmuladd.f64(double %82, double %90, double %73)
%92 = load double*, double** %4
%93 = getelementptr inbounds double, double* %92, i64 1
%94 = load double, double* %93
%95 = load double*, double** %4
%96 = getelementptr inbounds double, double* %95, i64 3
%97 = load double, double* %96
%98 = fsub double %94, %97
%99 = fmul double 1.000000e-01, %98
%100 = load double*, double** %4
%101 = getelementptr inbounds double, double* %100, i64 1
%102 = load double, double* %101
%103 = load double*, double** %4
%104 = getelementptr inbounds double, double* %103, i64 3
%105 = load double, double* %104
%106 = fsub double %102, %105
%107 = call double @llvm.fmuladd.f64(double %99, double %106, double %91)
store double %107, double* %7
%108 = load double, double* %7
ret double %108
}

LLVM IR (-O2):
define double @func1(double* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = load double, double* %0
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double %5)
%9 = fmul double %8, 1.000000e+02
%10 = fsub double 1.000000e+00, %6
%11 = fmul double %10, %10
%12 = tail call double @llvm.fmuladd.f64(double %9, double %8, double %11)
%13 = getelementptr inbounds double, double* %0, i64 3
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = fneg double %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %14)
%19 = fmul double %18, 9.000000e+01
%20 = tail call double @llvm.fmuladd.f64(double %19, double %18, double %12)
%21 = fsub double 1.000000e+00, %16
%22 = tail call double @llvm.fmuladd.f64(double %21, double %21, double %20)
%23 = fadd double %5, %14
%24 = fadd double %23, -2.000000e+00
%25 = fmul double %24, 1.000000e+01
%26 = tail call double @llvm.fmuladd.f64(double %25, double %24, double %22)
%27 = fsub double %5, %14
%28 = fmul double %27, 1.000000e-01
%29 = tail call double @llvm.fmuladd.f64(double %28, double %27, double %26)
ret double %29
}