double func1(double *x, int N) {
  double f;
  double pi, alpha, alpha2;
  pi = 3.14159;
  alpha = 1;
  alpha2 = alpha * alpha;
  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)
movsd  0xf1d(%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  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  0xeb4(%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  0xe5c(%rip),%xmm1
subsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0xe4c(%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  0xe02(%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  0xda8(%rip),%xmm0
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xd97(%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  0xd60(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xd5c(%rip),%xmm1
mulsd  %xmm2,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm2
movsd  0xd36(%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  0xd08(%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,-0x18(%rbp)
movsd  -0x18(%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) {
%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 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = fneg double %17
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double %14)
%23 = fmul double 1.000000e+02, %22
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = load double*, double** %3
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = load double*, double** %3
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load double, double* %31
%33 = fneg double %29
%34 = call double @llvm.fmuladd.f64(double %33, double %32, double %26)
%35 = load double*, double** %3
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = fsub double 1.000000e+00, %37
%39 = load double*, double** %3
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = fsub double 1.000000e+00, %41
%43 = fmul double %38, %42
%44 = call double @llvm.fmuladd.f64(double %23, double %34, double %43)
%45 = load double*, double** %3
%46 = getelementptr inbounds double, double* %45, i64 3
%47 = load double, double* %46
%48 = load double*, double** %3
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = load double*, double** %3
%52 = getelementptr inbounds double, double* %51, i64 2
%53 = load double, double* %52
%54 = fneg double %50
%55 = call double @llvm.fmuladd.f64(double %54, double %53, double %47)
%56 = fmul double 9.000000e+01, %55
%57 = load double*, double** %3
%58 = getelementptr inbounds double, double* %57, i64 3
%59 = load double, double* %58
%60 = load double*, double** %3
%61 = getelementptr inbounds double, double* %60, i64 2
%62 = load double, double* %61
%63 = load double*, double** %3
%64 = getelementptr inbounds double, double* %63, i64 2
%65 = load double, double* %64
%66 = fneg double %62
%67 = call double @llvm.fmuladd.f64(double %66, double %65, double %59)
%68 = call double @llvm.fmuladd.f64(double %56, double %67, double %44)
%69 = load double*, double** %3
%70 = getelementptr inbounds double, double* %69, i64 2
%71 = load double, double* %70
%72 = fsub double 1.000000e+00, %71
%73 = load double*, double** %3
%74 = getelementptr inbounds double, double* %73, i64 2
%75 = load double, double* %74
%76 = fsub double 1.000000e+00, %75
%77 = call double @llvm.fmuladd.f64(double %72, double %76, double %68)
%78 = load double*, double** %3
%79 = getelementptr inbounds double, double* %78, i64 1
%80 = load double, double* %79
%81 = load double*, double** %3
%82 = getelementptr inbounds double, double* %81, i64 3
%83 = load double, double* %82
%84 = fadd double %80, %83
%85 = fsub double %84, 2.000000e+00
%86 = fmul double 1.000000e+01, %85
%87 = load double*, double** %3
%88 = getelementptr inbounds double, double* %87, i64 1
%89 = load double, double* %88
%90 = load double*, double** %3
%91 = getelementptr inbounds double, double* %90, i64 3
%92 = load double, double* %91
%93 = fadd double %89, %92
%94 = fsub double %93, 2.000000e+00
%95 = call double @llvm.fmuladd.f64(double %86, double %94, double %77)
%96 = load double*, double** %3
%97 = getelementptr inbounds double, double* %96, i64 1
%98 = load double, double* %97
%99 = load double*, double** %3
%100 = getelementptr inbounds double, double* %99, i64 3
%101 = load double, double* %100
%102 = fsub double %98, %101
%103 = fmul double 1.000000e-01, %102
%104 = load double*, double** %3
%105 = getelementptr inbounds double, double* %104, i64 1
%106 = load double, double* %105
%107 = load double*, double** %3
%108 = getelementptr inbounds double, double* %107, i64 3
%109 = load double, double* %108
%110 = fsub double %106, %109
%111 = call double @llvm.fmuladd.f64(double %103, double %110, double %95)
store double %111, double* %5
%112 = load double, double* %5
ret double %112
}

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