int ave2day(float ave) {
  if (ave <= 0.60)
    return 1;
  if (ave <= 1.35)
    return 2;
  if (ave <= 2.20)
    return 3;
  if (ave <= 3.05)
    return 5;
  if (ave <= 3.90)
    return 7;
  if (ave <= 4.92)
    return 9;
  return 11;
}


x86 assembly (clang, -O0):
<ave2day>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1130 <ave2day+0x30>
movl   $0x1,-0x4(%rbp)
jmp    11fa <ave2day+0xfa>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec7(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1157 <ave2day+0x57>
movl   $0x2,-0x4(%rbp)
jmp    11fa <ave2day+0xfa>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     117e <ave2day+0x7e>
movl   $0x3,-0x4(%rbp)
jmp    11fa <ave2day+0xfa>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11a5 <ave2day+0xa5>
movl   $0x5,-0x4(%rbp)
jmp    11fa <ave2day+0xfa>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe6a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11cc <ave2day+0xcc>
movl   $0x7,-0x4(%rbp)
jmp    11fa <ave2day+0xfa>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe4b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11f3 <ave2day+0xf3>
movl   $0x9,-0x4(%rbp)
jmp    11fa <ave2day+0xfa>
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ave2day>:
cvtss2sd %xmm0,%xmm0
mov    $0x1,%eax
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1179 <ave2day+0x79>
mov    $0x2,%eax
movsd  0xee4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1179 <ave2day+0x79>
mov    $0x3,%eax
movsd  0xed9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1179 <ave2day+0x79>
mov    $0x5,%eax
movsd  0xece(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1179 <ave2day+0x79>
mov    $0x7,%eax
movsd  0xec3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1179 <ave2day+0x79>
movsd  0xebd(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
add    %eax,%eax
add    $0x9,%eax
ret

LLVM IR (-O0):
define i32 @ave2day(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp ole double %5, 6.000000e-01
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %34
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp ole double %10, 1.350000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %34
13: ; preds = %8
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fcmp ole double %15, 2.200000e+00
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 3, i32* %2
br label %34
18: ; preds = %13
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = fcmp ole double %20, 3.050000e+00
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 5, i32* %2
br label %34
23: ; preds = %18
%24 = load float, float* %3
%25 = fpext float %24 to double
%26 = fcmp ole double %25, 3.900000e+00
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 7, i32* %2
br label %34
28: ; preds = %23
%29 = load float, float* %3
%30 = fpext float %29 to double
%31 = fcmp ole double %30, 4.920000e+00
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 9, i32* %2
br label %34
33: ; preds = %28
store i32 11, i32* %2
br label %34
34: ; preds = %33, %32, %27, %22, %17, %12, %7
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @ave2day(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 6.000000e-01
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = fcmp ugt double %2, 1.350000e+00
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = fcmp ugt double %2, 2.200000e+00
br i1 %7, label %8, label %15
8: ; preds = %6
%9 = fcmp ugt double %2, 3.050000e+00
br i1 %9, label %10, label %15
10: ; preds = %8
%11 = fcmp ugt double %2, 3.900000e+00
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = fcmp ugt double %2, 4.920000e+00
%14 = select i1 %13, i32 11, i32 9
br label %15
15: ; preds = %12, %10, %8, %6, %4, %1
%16 = phi i32 [ 1, %1 ], [ 2, %4 ], [ 3, %6 ], [ 5, %8 ], [ 7, %10 ], [ %14, %12 ]
ret i32 %16
}