#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 calcularNumBits(double, double, int);
scalar_t__ strcmp(char *, char *);
int f_calcularNumBitsIndividuo(char *funcao) {
  if (strcmp(funcao, "ackley") == 0)
    return calcularNumBits(-32.0, 32.0, 1e-4);
  else if (strcmp(funcao, "griewank") == 0)
    return calcularNumBits(-600.0, 600.0, 1e-4);
  else if (strcmp(funcao, "rastrigin") == 0)
    return calcularNumBits(-5.12, 5.12, 1e-4);
  else if (strcmp(funcao, "rosenbrock") == 0)
    return calcularNumBits(-30.0, 30.0, 1e-4);
  else if (strcmp(funcao, "schafferf6") == 0)
    return calcularNumBits(-10.0, 10.0, 1e-4);
  else if (strcmp(funcao, "schafferf7") == 0)
    return calcularNumBits(-100.0, 100.0, 1e-4);
  return 0;
}


x86 assembly (clang, -O0):
<f_calcularNumBitsIndividuo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xf29(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1165 <f_calcularNumBitsIndividuo+0x45>
movsd  0xf02(%rip),%xmm0
movsd  0xf02(%rip),%xmm1
xor    %edi,%edi
call   1040 <calcularNumBits@plt>
mov    %eax,-0x4(%rbp)
jmp    12a2 <f_calcularNumBitsIndividuo+0x182>
mov    -0x10(%rbp),%rdi
lea    0xef7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    119e <f_calcularNumBitsIndividuo+0x7e>
movsd  0xeb9(%rip),%xmm0
movsd  0xeb9(%rip),%xmm1
xor    %edi,%edi
call   1040 <calcularNumBits@plt>
mov    %eax,-0x4(%rbp)
jmp    12a2 <f_calcularNumBitsIndividuo+0x182>
mov    -0x10(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d7 <f_calcularNumBitsIndividuo+0xb7>
movsd  0xe70(%rip),%xmm0
movsd  0xe70(%rip),%xmm1
xor    %edi,%edi
call   1040 <calcularNumBits@plt>
mov    %eax,-0x4(%rbp)
jmp    12a2 <f_calcularNumBitsIndividuo+0x182>
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1210 <f_calcularNumBitsIndividuo+0xf0>
movsd  0xe27(%rip),%xmm0
movsd  0xe27(%rip),%xmm1
xor    %edi,%edi
call   1040 <calcularNumBits@plt>
mov    %eax,-0x4(%rbp)
jmp    12a2 <f_calcularNumBitsIndividuo+0x182>
mov    -0x10(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1249 <f_calcularNumBitsIndividuo+0x129>
movsd  0xdde(%rip),%xmm0
movsd  0xdde(%rip),%xmm1
xor    %edi,%edi
call   1040 <calcularNumBits@plt>
mov    %eax,-0x4(%rbp)
jmp    12a2 <f_calcularNumBitsIndividuo+0x182>
mov    -0x10(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1282 <f_calcularNumBitsIndividuo+0x162>
movsd  0xd95(%rip),%xmm0
movsd  0xd95(%rip),%xmm1
xor    %edi,%edi
call   1040 <calcularNumBits@plt>
mov    %eax,-0x4(%rbp)
jmp    12a2 <f_calcularNumBitsIndividuo+0x182>
jmp    1287 <f_calcularNumBitsIndividuo+0x167>
jmp    128c <f_calcularNumBitsIndividuo+0x16c>
jmp    1291 <f_calcularNumBitsIndividuo+0x171>
jmp    1296 <f_calcularNumBitsIndividuo+0x176>
jmp    129b <f_calcularNumBitsIndividuo+0x17b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_calcularNumBitsIndividuo>:
push   %rbx
mov    %rdi,%rbx
lea    0xf35(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     119d <f_calcularNumBitsIndividuo+0x7d>
lea    0xf2b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11af <f_calcularNumBitsIndividuo+0x8f>
lea    0xf20(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11c1 <f_calcularNumBitsIndividuo+0xa1>
lea    0xf16(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11d3 <f_calcularNumBitsIndividuo+0xb3>
lea    0xf0d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11e5 <f_calcularNumBitsIndividuo+0xc5>
lea    0xf04(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11f7 <f_calcularNumBitsIndividuo+0xd7>
xor    %eax,%eax
pop    %rbx
ret
movsd  0xeab(%rip),%xmm0
movsd  0xeab(%rip),%xmm1
jmp    1207 <f_calcularNumBitsIndividuo+0xe7>
movsd  0xe89(%rip),%xmm0
movsd  0xe89(%rip),%xmm1
jmp    1207 <f_calcularNumBitsIndividuo+0xe7>
movsd  0xe67(%rip),%xmm0
movsd  0xe67(%rip),%xmm1
jmp    1207 <f_calcularNumBitsIndividuo+0xe7>
movsd  0xe45(%rip),%xmm0
movsd  0xe45(%rip),%xmm1
jmp    1207 <f_calcularNumBitsIndividuo+0xe7>
movsd  0xe23(%rip),%xmm0
movsd  0xe23(%rip),%xmm1
jmp    1207 <f_calcularNumBitsIndividuo+0xe7>
movsd  0xe01(%rip),%xmm0
movsd  0xe01(%rip),%xmm1
xor    %edi,%edi
pop    %rbx
jmp    1040 <calcularNumBits@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ackley\00"
@.str.1 = [9 x i8] c"griewank\00"
@.str.2 = [10 x i8] c"rastrigin\00"
@.str.3 = [11 x i8] c"rosenbrock\00"
@.str.4 = [11 x i8] c"schafferf6\00"
@.str.5 = [11 x i8] c"schafferf7\00"
define i32 @f_calcularNumBitsIndividuo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @calcularNumBits(double -3.200000e+01, double 3.200000e+01, i32 0)
store i32 %8, i32* %2
br label %45
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @calcularNumBits(double -6.000000e+02, double 6.000000e+02, i32 0)
store i32 %14, i32* %2
br label %45
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @calcularNumBits(double -5.120000e+00, double 5.120000e+00, i32 0)
store i32 %20, i32* %2
br label %45
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @calcularNumBits(double -3.000000e+01, double 3.000000e+01, i32 0)
store i32 %26, i32* %2
br label %45
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @calcularNumBits(double -1.000000e+01, double 1.000000e+01, i32 0)
store i32 %32, i32* %2
br label %45
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @calcularNumBits(double -1.000000e+02, double 1.000000e+02, i32 0)
store i32 %38, i32* %2
br label %45
39: ; preds = %33
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
br label %44
44: ; preds = %43
store i32 0, i32* %2
br label %45
45: ; preds = %44, %37, %31, %25, %19, %13, %7
%46 = load i32, i32* %2
ret i32 %46
}

LLVM IR (-O2):
@.str = [7 x i8] c"ackley\00"
@.str.1 = [9 x i8] c"griewank\00"
@.str.2 = [10 x i8] c"rastrigin\00"
@.str.3 = [11 x i8] c"rosenbrock\00"
@.str.4 = [11 x i8] c"schafferf6\00"
@.str.5 = [11 x i8] c"schafferf7\00"
define i32 @f_calcularNumBitsIndividuo(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @calcularNumBits(double -3.200000e+01, double 3.200000e+01, i32 0)
br label %31
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @calcularNumBits(double -6.000000e+02, double 6.000000e+02, i32 0)
br label %31
11: ; preds = %6
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @calcularNumBits(double -5.120000e+00, double 5.120000e+00, i32 0)
br label %31
16: ; preds = %11
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @calcularNumBits(double -3.000000e+01, double 3.000000e+01, i32 0)
br label %31
21: ; preds = %16
%22 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @calcularNumBits(double -1.000000e+01, double 1.000000e+01, i32 0)
br label %31
26: ; preds = %21
%27 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @calcularNumBits(double -1.000000e+02, double 1.000000e+02, i32 0)
br label %31
31: ; preds = %26, %29, %24, %19, %14, %9, %4
%32 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %24 ], [ %30, %29 ], [ 0, %26 ]
ret i32 %32
}