#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 exp(int /*<<< orphan*/);
int /*<<< orphan*/ pow(double, double);
double fitfun(double *x, int N, void *output, int *info) {
  double f;
  f = 8 * exp(-(pow(x[0], 2.0) + pow(x[1], 2.0))) +
      2 * exp(-(pow(x[0] - 5, 2.0) + pow(x[1] - 4, 2.0))) + 1.0 +
      (x[0] * x[1]) / 10.0;
  return f;
}


x86 assembly (clang, -O0):
<fitfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xec9(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xeb0(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
xor    %edi,%edi
sub    %eax,%edi
call   1030 <exp@plt>
shl    $0x3,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe95(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe68(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
xor    %edi,%edi
sub    %eax,%edi
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe21(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
movsd  0xdfc(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitfun>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0xecd(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%ebp
movsd  0x8(%rbx),%xmm0
movsd  0xeb9(%rip),%xmm1
call   1040 <pow@plt>
add    %eax,%ebp
neg    %ebp
mov    %ebp,%edi
call   1030 <exp@plt>
mov    %eax,%r14d
shl    $0x3,%r14d
movsd  (%rbx),%xmm0
addsd  0xe9e(%rip),%xmm0
movsd  0xe8e(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%ebp
movsd  0x8(%rbx),%xmm0
addsd  0xe8a(%rip),%xmm0
movsd  0xe72(%rip),%xmm1
call   1040 <pow@plt>
add    %eax,%ebp
neg    %ebp
mov    %ebp,%edi
call   1030 <exp@plt>
lea    (%r14,%rax,2),%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  (%rbx),%xmm0
mulsd  0x8(%rbx),%xmm0
divsd  0xe5b(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @fitfun(double* %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = call i32 @pow(double %12, double 2.000000e+00)
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = call i32 @pow(double %16, double 2.000000e+00)
%18 = add nsw i32 %13, %17
%19 = sub nsw i32 0, %18
%20 = call i32 @exp(i32 %19)
%21 = mul nsw i32 8, %20
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = fsub double %24, 5.000000e+00
%26 = call i32 @pow(double %25, double 2.000000e+00)
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = fsub double %29, 4.000000e+00
%31 = call i32 @pow(double %30, double 2.000000e+00)
%32 = add nsw i32 %26, %31
%33 = sub nsw i32 0, %32
%34 = call i32 @exp(i32 %33)
%35 = mul nsw i32 2, %34
%36 = add nsw i32 %21, %35
%37 = sitofp i32 %36 to double
%38 = fadd double %37, 1.000000e+00
%39 = load double*, double** %5
%40 = getelementptr inbounds double, double* %39, i64 0
%41 = load double, double* %40
%42 = load double*, double** %5
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = fmul double %41, %44
%46 = fdiv double %45, 1.000000e+01
%47 = fadd double %38, %46
store double %47, double* %9
%48 = load double, double* %9
ret double %48
}

LLVM IR (-O2):
define double @fitfun(double* nocapture %0, i32 %1, i8* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load double, double* %0
%6 = tail call i32 @pow(double %5, double 2.000000e+00)
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = tail call i32 @pow(double %8, double 2.000000e+00)
%10 = add nsw i32 %6, %9
%11 = sub nsw i32 0, %10
%12 = tail call i32 @exp(i32 %11)
%13 = shl nsw i32 %12, 3
%14 = load double, double* %0
%15 = fadd double %14, -5.000000e+00
%16 = tail call i32 @pow(double %15, double 2.000000e+00)
%17 = load double, double* %7
%18 = fadd double %17, -4.000000e+00
%19 = tail call i32 @pow(double %18, double 2.000000e+00)
%20 = add nsw i32 %16, %19
%21 = sub nsw i32 0, %20
%22 = tail call i32 @exp(i32 %21)
%23 = shl nsw i32 %22, 1
%24 = add nsw i32 %23, %13
%25 = or i32 %24, 1
%26 = sitofp i32 %25 to double
%27 = load double, double* %0
%28 = load double, double* %7
%29 = fmul double %27, %28
%30 = fdiv double %29, 1.000000e+01
%31 = fadd double %30, %26
ret double %31
}