#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double pow(double, int);
double testFunctionSimplexFit(double *x) {
  double e;
  e = pow((x[0] + (1.707106 * x[1]) - 12.500000), 2) +
      pow((x[0] + (2.490711 * x[1]) - 4.166667), 2) +
      pow((x[0] + (3.605550 * x[1]) - 31.250000), 2) +
      pow((x[0] + (4.297620 * x[1]) - 81.250000), 2) +
      pow((x[0] + (5.656853 * x[1]) - 112.500000), 2);
  return e;
}


x86 assembly (clang, -O0):
<testFunctionSimplexFit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xf13(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xefb(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xec7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe6f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe57(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe17(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdff(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xdbf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xda7(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFunctionSimplexFit>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  0x8(%rdi),%xmm0
mulsd  0xedb(%rip),%xmm0
addsd  (%rdi),%xmm0
addsd  0xed7(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
mulsd  0xec2(%rip),%xmm0
addsd  (%rbx),%xmm0
addsd  0xebe(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
mulsd  0xea3(%rip),%xmm0
addsd  (%rbx),%xmm0
addsd  0xe9f(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
mulsd  0xe84(%rip),%xmm0
addsd  (%rbx),%xmm0
addsd  0xe80(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rbx),%xmm0
mulsd  0xe65(%rip),%xmm0
addsd  (%rbx),%xmm0
addsd  0xe61(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @testFunctionSimplexFit(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 0
%6 = load double, double* %5
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 1
%9 = load double, double* %8
%10 = call double @llvm.fmuladd.f64(double 0x3FFB504E618CE2D2, double %9, double %6)
%11 = fsub double %10, 1.250000e+01
%12 = call double @pow(double %11, i32 2)
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %2
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = call double @llvm.fmuladd.f64(double 0x4003ECF9E3864CB6, double %18, double %15)
%20 = fsub double %19, 0x4010AAAAC1094A2C
%21 = call double @pow(double %20, i32 2)
%22 = fadd double %12, %21
%23 = load double*, double** %2
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = load double*, double** %2
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %27
%29 = call double @llvm.fmuladd.f64(double 3.605550e+00, double %28, double %25)
%30 = fsub double %29, 3.125000e+01
%31 = call double @pow(double %30, i32 2)
%32 = fadd double %22, %31
%33 = load double*, double** %2
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = load double*, double** %2
%37 = getelementptr inbounds double, double* %36, i64 1
%38 = load double, double* %37
%39 = call double @llvm.fmuladd.f64(double 4.297620e+00, double %38, double %35)
%40 = fsub double %39, 8.125000e+01
%41 = call double @pow(double %40, i32 2)
%42 = fadd double %32, %41
%43 = load double*, double** %2
%44 = getelementptr inbounds double, double* %43, i64 0
%45 = load double, double* %44
%46 = load double*, double** %2
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load double, double* %47
%49 = call double @llvm.fmuladd.f64(double 0x4016A09E12A51E32, double %48, double %45)
%50 = fsub double %49, 1.125000e+02
%51 = call double @pow(double %50, i32 2)
%52 = fadd double %42, %51
store double %52, double* %3
%53 = load double, double* %3
ret double %53
}

LLVM IR (-O2):
define double @testFunctionSimplexFit(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0x3FFB504E618CE2D2, double %2)
%6 = fadd double %5, -1.250000e+01
%7 = tail call double @pow(double %6, i32 2)
%8 = load double, double* %0
%9 = load double, double* %3
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x4003ECF9E3864CB6, double %8)
%11 = fadd double %10, 0xC010AAAAC1094A2C
%12 = tail call double @pow(double %11, i32 2)
%13 = fadd double %7, %12
%14 = load double, double* %0
%15 = load double, double* %3
%16 = tail call double @llvm.fmuladd.f64(double %15, double 3.605550e+00, double %14)
%17 = fadd double %16, -3.125000e+01
%18 = tail call double @pow(double %17, i32 2)
%19 = fadd double %13, %18
%20 = load double, double* %0
%21 = load double, double* %3
%22 = tail call double @llvm.fmuladd.f64(double %21, double 4.297620e+00, double %20)
%23 = fadd double %22, -8.125000e+01
%24 = tail call double @pow(double %23, i32 2)
%25 = fadd double %19, %24
%26 = load double, double* %0
%27 = load double, double* %3
%28 = tail call double @llvm.fmuladd.f64(double %27, double 0x4016A09E12A51E32, double %26)
%29 = fadd double %28, -1.125000e+02
%30 = tail call double @pow(double %29, i32 2)
%31 = fadd double %25, %30
ret double %31
}