double tf6(double *x, int N, void *params) {
  double f;
  double *p = (double *)params;
  f = p[0] * (x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0]) +
      (1.0 - x[0]) * (1.0 - x[0]) +
      p[1] * (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) +
      p[2] * (x[1] - x[3]) * (x[1] - x[3]);
  return f;
}


x86 assembly (clang, -O0):
<tf6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%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    -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  0xe71(%rip),%xmm1
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0xe61(%rip),%xmm3
subsd  (%rax),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%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
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  0xdbc(%rip),%xmm0
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xdab(%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  0xd74(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xd70(%rip),%xmm1
mulsd  %xmm2,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm2
movsd  0xd4a(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm2
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):
<tf6>:
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm1
movsd  0xeef(%rip),%xmm0
movapd %xmm0,%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm2
movapd %xmm1,%xmm4
subsd  %xmm2,%xmm4
movsd  (%rdx),%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  0x8(%rdx),%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  %xmm0,%xmm0
addsd  %xmm4,%xmm0
addsd  0xe8c(%rip),%xmm5
movsd  0xe8c(%rip),%xmm2
mulsd  %xmm5,%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm0,%xmm2
movsd  0x10(%rdx),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @tf6(double* %0, i32 %1, i8* %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca double
%8 = alloca double*
store double* %0, double** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to double*
store double* %10, double** %8
%11 = load double*, double** %8
%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 1
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fneg double %19
%24 = call double @llvm.fmuladd.f64(double %23, double %22, double %16)
%25 = fmul double %13, %24
%26 = load double*, double** %4
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %27
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = fneg double %31
%36 = call double @llvm.fmuladd.f64(double %35, double %34, double %28)
%37 = load double*, double** %4
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = fsub double 1.000000e+00, %39
%41 = load double*, double** %4
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fsub double 1.000000e+00, %43
%45 = fmul double %40, %44
%46 = call double @llvm.fmuladd.f64(double %25, double %36, double %45)
%47 = load double*, double** %8
%48 = getelementptr inbounds double, double* %47, i64 1
%49 = load double, double* %48
%50 = load double*, double** %4
%51 = getelementptr inbounds double, double* %50, i64 3
%52 = load double, double* %51
%53 = load double*, double** %4
%54 = getelementptr inbounds double, double* %53, i64 2
%55 = load double, double* %54
%56 = load double*, double** %4
%57 = getelementptr inbounds double, double* %56, i64 2
%58 = load double, double* %57
%59 = fneg double %55
%60 = call double @llvm.fmuladd.f64(double %59, double %58, double %52)
%61 = fmul double %49, %60
%62 = load double*, double** %4
%63 = getelementptr inbounds double, double* %62, i64 3
%64 = load double, double* %63
%65 = load double*, double** %4
%66 = getelementptr inbounds double, double* %65, i64 2
%67 = load double, double* %66
%68 = load double*, double** %4
%69 = getelementptr inbounds double, double* %68, i64 2
%70 = load double, double* %69
%71 = fneg double %67
%72 = call double @llvm.fmuladd.f64(double %71, double %70, double %64)
%73 = call double @llvm.fmuladd.f64(double %61, double %72, double %46)
%74 = load double*, double** %4
%75 = getelementptr inbounds double, double* %74, i64 2
%76 = load double, double* %75
%77 = fsub double 1.000000e+00, %76
%78 = load double*, double** %4
%79 = getelementptr inbounds double, double* %78, i64 2
%80 = load double, double* %79
%81 = fsub double 1.000000e+00, %80
%82 = call double @llvm.fmuladd.f64(double %77, double %81, double %73)
%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 = fmul double 1.000000e+01, %90
%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 = fadd double %94, %97
%99 = fsub double %98, 2.000000e+00
%100 = call double @llvm.fmuladd.f64(double %91, double %99, double %82)
%101 = load double*, double** %8
%102 = getelementptr inbounds double, double* %101, i64 2
%103 = load double, double* %102
%104 = load double*, double** %4
%105 = getelementptr inbounds double, double* %104, i64 1
%106 = load double, double* %105
%107 = load double*, double** %4
%108 = getelementptr inbounds double, double* %107, i64 3
%109 = load double, double* %108
%110 = fsub double %106, %109
%111 = fmul double %103, %110
%112 = load double*, double** %4
%113 = getelementptr inbounds double, double* %112, i64 1
%114 = load double, double* %113
%115 = load double*, double** %4
%116 = getelementptr inbounds double, double* %115, i64 3
%117 = load double, double* %116
%118 = fsub double %114, %117
%119 = call double @llvm.fmuladd.f64(double %111, double %118, double %100)
store double %119, double* %7
%120 = load double, double* %7
ret double %120
}

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