float calculo(float p) {
  float r;
  if (p < 50)
    r = p + (p * 0.20);
  else if (p >= 50 && p < 100)
    r = p + (p * 0.15);
  else
    r = p + (p * 0.10);
  return r;
}


x86 assembly (clang, -O0):
<calculo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    114b <calculo+0x4b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11d3 <calculo+0xd3>
movss  -0x4(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     11a3 <calculo+0xa3>
movss  0xe9b(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    11a3 <calculo+0xa3>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe83(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11ce <calculo+0xce>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe4b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    11d3 <calculo+0xd3>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculo>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    111e <calculo+0x1e>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xefc(%rip),%xmm0
jmp    114d <calculo+0x4d>
ucomiss 0xedb(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
jb     1145 <calculo+0x45>
movss  0xece(%rip),%xmm2
ucomiss %xmm0,%xmm2
jbe    1145 <calculo+0x45>
movsd  0xecd(%rip),%xmm0
jmp    114d <calculo+0x4d>
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @calculo(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 5.000000e+01
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 2.000000e-01, double %8)
%12 = fptrunc double %11 to float
store float %12, float* %3
br label %34
13: ; preds = %1
%14 = load float, float* %2
%15 = fcmp oge float %14, 5.000000e+01
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load float, float* %2
%18 = fcmp olt float %17, 1.000000e+02
br i1 %18, label %19, label %26
19: ; preds = %16
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = load float, float* %2
%23 = fpext float %22 to double
%24 = call double @llvm.fmuladd.f64(double %23, double 1.500000e-01, double %21)
%25 = fptrunc double %24 to float
store float %25, float* %3
br label %33
26: ; preds = %16, %13
%27 = load float, float* %2
%28 = fpext float %27 to double
%29 = load float, float* %2
%30 = fpext float %29 to double
%31 = call double @llvm.fmuladd.f64(double %30, double 1.000000e-01, double %28)
%32 = fptrunc double %31 to float
store float %32, float* %3
br label %33
33: ; preds = %26, %19
br label %34
34: ; preds = %33, %6
%35 = load float, float* %3
ret float %35
}

LLVM IR (-O2):
define float @calculo(float %0) {
%2 = fcmp olt float %0, 5.000000e+01
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fpext float %0 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 2.000000e-01, double %4)
br label %15
6: ; preds = %1
%7 = fcmp oge float %0, 5.000000e+01
%8 = fcmp olt float %0, 1.000000e+02
%9 = and i1 %7, %8
%10 = fpext float %0 to double
br i1 %9, label %11, label %13
11: ; preds = %6
%12 = tail call double @llvm.fmuladd.f64(double %10, double 1.500000e-01, double %10)
br label %15
13: ; preds = %6
%14 = tail call double @llvm.fmuladd.f64(double %10, double 1.000000e-01, double %10)
br label %15
15: ; preds = %11, %13, %3
%16 = phi double [ %5, %3 ], [ %12, %11 ], [ %14, %13 ]
%17 = fptrunc double %16 to float
ret float %17
}