char *descriptionByIMC(double imc) {
  if (imc < 17)
    return "Muito abaixo do peso";
  if (imc < 18.5)
    return "Abaixo do peso";
  if (imc < 25)
    return "Peso normal";
  if (imc < 30)
    return "Acima do peso";
  if (imc < 35)
    return "Obesidade I";
  if (imc < 40)
    return "Obesidade II (severa)";
  else
    return "Obesidade III (mórbida)";
}


x86 assembly (clang, -O0):
<descriptionByIMC>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112c <descriptionByIMC+0x2c>
lea    0xf0d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <descriptionByIMC+0xe6>
movsd  0xed4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114f <descriptionByIMC+0x4f>
lea    0xeff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <descriptionByIMC+0xe6>
movsd  0xeb9(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1172 <descriptionByIMC+0x72>
lea    0xeeb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <descriptionByIMC+0xe6>
movsd  0xe9e(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1195 <descriptionByIMC+0x95>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <descriptionByIMC+0xe6>
movsd  0xe83(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11b8 <descriptionByIMC+0xb8>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <descriptionByIMC+0xe6>
movsd  0xe68(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11db <descriptionByIMC+0xdb>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <descriptionByIMC+0xe6>
lea    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<descriptionByIMC>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1116 <descriptionByIMC+0x16>
lea    0xf1b(%rip),%rax
ret
movsd  0xeea(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112c <descriptionByIMC+0x2c>
lea    0xf1a(%rip),%rax
ret
movsd  0xedc(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1142 <descriptionByIMC+0x42>
lea    0xf13(%rip),%rax
ret
movsd  0xece(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1158 <descriptionByIMC+0x58>
lea    0xf09(%rip),%rax
ret
movsd  0xec0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    116e <descriptionByIMC+0x6e>
lea    0xf01(%rip),%rax
ret
movsd  0xeb2(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xef9(%rip),%rcx
lea    0xf08(%rip),%rax
cmova  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Muito abaixo do peso\00"
@.str.1 = [15 x i8] c"Abaixo do peso\00"
@.str.2 = [12 x i8] c"Peso normal\00"
@.str.3 = [14 x i8] c"Acima do peso\00"
@.str.4 = [12 x i8] c"Obesidade I\00"
@.str.5 = [22 x i8] c"Obesidade II (severa)\00"
@.str.6 = [25 x i8] c"Obesidade III (m\C3\B3rbida)\00"
define i8* @descriptionByIMC(double %0) {
%2 = alloca i8*
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 1.700000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
br label %28
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 1.850000e+01
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %28
11: ; preds = %7
%12 = load double, double* %3
%13 = fcmp olt double %12, 2.500000e+01
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %28
15: ; preds = %11
%16 = load double, double* %3
%17 = fcmp olt double %16, 3.000000e+01
br i1 %17, label %18, label %19
18: ; preds = %15
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %28
19: ; preds = %15
%20 = load double, double* %3
%21 = fcmp olt double %20, 3.500000e+01
br i1 %21, label %22, label %23
22: ; preds = %19
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %28
23: ; preds = %19
%24 = load double, double* %3
%25 = fcmp olt double %24, 4.000000e+01
br i1 %25, label %26, label %27
26: ; preds = %23
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %28
27: ; preds = %23
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %28
28: ; preds = %27, %26, %22, %18, %14, %10, %6
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
@.str = [21 x i8] c"Muito abaixo do peso\00"
@.str.1 = [15 x i8] c"Abaixo do peso\00"
@.str.2 = [12 x i8] c"Peso normal\00"
@.str.3 = [14 x i8] c"Acima do peso\00"
@.str.4 = [12 x i8] c"Obesidade I\00"
@.str.5 = [22 x i8] c"Obesidade II (severa)\00"
@.str.6 = [25 x i8] c"Obesidade III (m\C3\B3rbida)\00"
define i8* @descriptionByIMC(double %0) {
%2 = fcmp olt double %0, 1.700000e+01
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 1.850000e+01
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = fcmp olt double %0, 2.500000e+01
br i1 %6, label %14, label %7
7: ; preds = %5
%8 = fcmp olt double %0, 3.000000e+01
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = fcmp olt double %0, 3.500000e+01
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = fcmp olt double %0, 4.000000e+01
%13 = select i1 %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0)
br label %14
14: ; preds = %11, %9, %7, %5, %3, %1
%15 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %9 ], [ %13, %11 ]
ret i8* %15
}