#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 */
int pow(double, int);
double testFunctionSimplex(double *x) {
  return pow(x[0], 2) - (4 * x[0]) + pow(x[1], 2) - x[1] - (x[0] * x[1]);
}


x86 assembly (clang, -O0):
<testFunctionSimplex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xebe(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFunctionSimplex>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  (%rbx),%xmm2
movsd  0x8(%rbx),%xmm0
mulsd  0xec5(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0x8(%rbx),%xmm1
subsd  %xmm1,%xmm0
mulsd  (%rbx),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @testFunctionSimplex(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call i32 @pow(double %5, i32 2)
%7 = sitofp i32 %6 to double
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %10, double %7)
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = call i32 @pow(double %14, i32 2)
%16 = sitofp i32 %15 to double
%17 = fadd double %11, %16
%18 = load double*, double** %2
%19 = getelementptr inbounds double, double* %18, i64 1
%20 = load double, double* %19
%21 = fsub double %17, %20
%22 = load double*, double** %2
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = load double*, double** %2
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
%28 = fneg double %24
%29 = call double @llvm.fmuladd.f64(double %28, double %27, double %21)
ret double %29
}

LLVM IR (-O2):
define double @testFunctionSimplex(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @pow(double %2, i32 2)
%4 = sitofp i32 %3 to double
%5 = load double, double* %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double -4.000000e+00, double %4)
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = tail call i32 @pow(double %8, i32 2)
%10 = sitofp i32 %9 to double
%11 = fadd double %6, %10
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %0
%15 = fneg double %14
%16 = tail call double @llvm.fmuladd.f64(double %15, double %12, double %13)
ret double %16
}