double obterPercentualDeReajuste(double salario) {
  if (salario <= 400.0) {
    return 0.15;
  } else if (salario <= 800.0) {
    return 0.12;
  } else if (salario <= 1200.0) {
    return 0.10;
  } else if (salario <= 2000.00) {
    return 0.07;
  } else {
    return 0.04;
  }
}


x86 assembly (clang, -O0):
<obterPercentualDeReajuste>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     112e <obterPercentualDeReajuste+0x2e>
movsd  0xf1c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11aa <obterPercentualDeReajuste+0xaa>
movsd  0xed2(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1153 <obterPercentualDeReajuste+0x53>
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11aa <obterPercentualDeReajuste+0xaa>
movsd  0xeb5(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1178 <obterPercentualDeReajuste+0x78>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11aa <obterPercentualDeReajuste+0xaa>
movsd  0xe98(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     119d <obterPercentualDeReajuste+0x9d>
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11aa <obterPercentualDeReajuste+0xaa>
movsd  0xe7b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obterPercentualDeReajuste>:
movsd  0xf00(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1148 <obterPercentualDeReajuste+0x48>
movsd  0xf02(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1151 <obterPercentualDeReajuste+0x51>
movsd  0xf04(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    115a <obterPercentualDeReajuste+0x5a>
movsd  0xefe(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
lea    0xef6(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret
movsd  0xeb0(%rip),%xmm0
ret
movsd  0xeb7(%rip),%xmm0
ret
movsd  0xebe(%rip),%xmm0
ret

LLVM IR (-O0):
define double @obterPercentualDeReajuste(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 4.000000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.500000e-01, double* %2
br label %20
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ole double %8, 8.000000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.200000e-01, double* %2
br label %20
11: ; preds = %7
%12 = load double, double* %3
%13 = fcmp ole double %12, 1.200000e+03
br i1 %13, label %14, label %15
14: ; preds = %11
store double 1.000000e-01, double* %2
br label %20
15: ; preds = %11
%16 = load double, double* %3
%17 = fcmp ole double %16, 2.000000e+03
br i1 %17, label %18, label %19
18: ; preds = %15
store double 7.000000e-02, double* %2
br label %20
19: ; preds = %15
store double 4.000000e-02, double* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @obterPercentualDeReajuste(double %0) {
%2 = fcmp ugt double %0, 4.000000e+02
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fcmp ugt double %0, 8.000000e+02
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = fcmp ugt double %0, 1.200000e+03
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = fcmp ugt double %0, 2.000000e+03
%9 = select i1 %8, double 4.000000e-02, double 7.000000e-02
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi double [ 1.500000e-01, %1 ], [ 1.200000e-01, %3 ], [ 1.000000e-01, %5 ], [ %9, %7 ]
ret double %11
}