#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 */
struct parameters {
  int dummy;
};
struct dataSet {
  int dummy;
};
struct chromosome {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ executeChromosome(struct chromosome *, double *);
double fitnessFunction(struct parameters *params, struct chromosome *chromo,
                       struct dataSet *data) {
  int i;
  double inputs[1] = {0.5};
  int numExec = 10000;
  for (i = 0; i < numExec; i++) {
    executeChromosome(chromo, inputs);
  }
  return 10;
}


x86 assembly (clang, -O0):
<fitnessFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x2710,-0x2c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1164 <fitnessFunction+0x54>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <executeChromosome@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <fitnessFunction+0x2d>
movsd  0xe94(%rip),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitnessFunction>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movabs $0x3fe0000000000000,%rax
mov    %rax,0x8(%rsp)
mov    $0x2710,%ebp
lea    0x8(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <executeChromosome@plt>
add    $0xffffffff,%ebp
jne    1140 <fitnessFunction+0x30>
movsd  0xea8(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.parameters = type { i32 }
%struct.chromosome = type { i32 }
%struct.dataSet = type { i32 }
@__const.fitnessFunction.inputs = [1 x double] [double 5.000000e-01]
define double @fitnessFunction(%struct.parameters* %0, %struct.chromosome* %1, %struct.dataSet* %2) {
%4 = alloca %struct.parameters*
%5 = alloca %struct.chromosome*
%6 = alloca %struct.dataSet*
%7 = alloca i32
%8 = alloca [1 x double]
%9 = alloca i32
store %struct.parameters* %0, %struct.parameters** %4
store %struct.chromosome* %1, %struct.chromosome** %5
store %struct.dataSet* %2, %struct.dataSet** %6
%10 = bitcast [1 x double]* %8 to i8*
store i32 10000, i32* %9
store i32 0, i32* %7
br label %11
11: ; preds = %19, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load %struct.chromosome*, %struct.chromosome** %5
%17 = getelementptr inbounds [1 x double], [1 x double]* %8, i64 0, i64 0
%18 = call i32 @executeChromosome(%struct.chromosome* %16, double* %17)
br label %19
19: ; preds = %15
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %11
22: ; preds = %11
ret double 1.000000e+01
}

LLVM IR (-O2):
%struct.parameters = type { i32 }
%struct.chromosome = type { i32 }
%struct.dataSet = type { i32 }
define double @fitnessFunction(%struct.parameters* nocapture readnone %0, %struct.chromosome* %1, %struct.dataSet* nocapture readnone %2) {
%4 = alloca [1 x double]
%5 = bitcast [1 x double]* %4 to i8*
%6 = bitcast [1 x double]* %4 to i64*
store i64 4602678819172646912, i64* %6
%7 = getelementptr inbounds [1 x double], [1 x double]* %4, i64 0, i64 0
br label %8
8: ; preds = %3, %8
%9 = phi i32 [ 0, %3 ], [ %11, %8 ]
%10 = call i32 @executeChromosome(%struct.chromosome* %1, double* %7)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, 10000
br i1 %12, label %13, label %8
13: ; preds = %8
ret double 1.000000e+01
}