double att(double x) {
  if (x < 51)
    return 5.0;
  if (x < 61)
    return 4.0;
  if (x < 71)
    return 3.0;
  if (x < 81)
    return 2.0;
  if (x < 91)
    return 1.0;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<att>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <att+0x2e>
movsd  0xf24(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ca <att+0xca>
movsd  0xed2(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1153 <att+0x53>
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ca <att+0xca>
movsd  0xeb5(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1178 <att+0x78>
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ca <att+0xca>
movsd  0xe98(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119d <att+0x9d>
movsd  0xe9d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ca <att+0xca>
movsd  0xe7b(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c2 <att+0xc2>
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ca <att+0xca>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<att>:
movsd  0xf00(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1117 <att+0x17>
movsd  0xeea(%rip),%xmm0
ret
movsd  0xef9(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112e <att+0x2e>
movsd  0xee3(%rip),%xmm0
ret
movsd  0xef2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1145 <att+0x45>
movsd  0xedc(%rip),%xmm0
ret
movsd  0xeeb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    115c <att+0x5c>
movsd  0xed5(%rip),%xmm0
ret
cmpltsd 0xedb(%rip),%xmm0
movsd  0xedb(%rip),%xmm1
andpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @att(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.100000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 5.000000e+00, double* %2
br label %24
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 6.100000e+01
br i1 %9, label %10, label %11
10: ; preds = %7
store double 4.000000e+00, double* %2
br label %24
11: ; preds = %7
%12 = load double, double* %3
%13 = fcmp olt double %12, 7.100000e+01
br i1 %13, label %14, label %15
14: ; preds = %11
store double 3.000000e+00, double* %2
br label %24
15: ; preds = %11
%16 = load double, double* %3
%17 = fcmp olt double %16, 8.100000e+01
br i1 %17, label %18, label %19
18: ; preds = %15
store double 2.000000e+00, double* %2
br label %24
19: ; preds = %15
%20 = load double, double* %3
%21 = fcmp olt double %20, 9.100000e+01
br i1 %21, label %22, label %23
22: ; preds = %19
store double 1.000000e+00, double* %2
br label %24
23: ; preds = %19
store double 0.000000e+00, double* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load double, double* %2
ret double %25
}

LLVM IR (-O2):
define double @att(double %0) {
%2 = fcmp olt double %0, 5.100000e+01
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = fcmp olt double %0, 6.100000e+01
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = fcmp olt double %0, 7.100000e+01
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = fcmp olt double %0, 8.100000e+01
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = fcmp olt double %0, 9.100000e+01
%11 = select i1 %10, double 1.000000e+00, double 0.000000e+00
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi double [ 5.000000e+00, %1 ], [ 4.000000e+00, %3 ], [ 3.000000e+00, %5 ], [ 2.000000e+00, %7 ], [ %11, %9 ]
ret double %13
}